13 #ifndef LAREXAMPLES_ALGORITHMS_TOTALLYCHEATTRACKS_CHEATTRACKDATA_CHEATTRACK_H 14 #define LAREXAMPLES_ALGORITHMS_TOTALLYCHEATTRACKS_CHEATTRACKDATA_CHEATTRACK_H 20 #include "TDatabasePDG.h" 116 template <
typename Stream>
117 void dump(Stream&& out,
118 unsigned int verbosity,
120 std::string firstIndent)
const;
121 template <
typename Stream>
123 unsigned int verbosity = DefaultDumpVerbosity,
124 std::string
indent =
"")
const 159 template <
typename Stream>
161 unsigned int verbosity,
163 std::string firstIndent)
const 168 out << firstIndent <<
"particle: ";
169 auto const* pPDGinfo = TDatabasePDG::Instance()->GetParticle(
particleId());
171 out << pPDGinfo->GetName() <<
" (ID=" <<
particleId() <<
")";
174 out <<
"; momentum: " <<
momentum() <<
" GeV/c; ";
175 trajectory().
Dump(std::forward<Stream>(out), verbosity, indent,
"");
181 #endif // LAREXAMPLES_ALGORITHMS_TOTALLYCHEATTRACKS_CHEATTRACKDATA_CHEATTRACK_H CheatTrack(recob::Trajectory &&traj, PDGID_t pid)
Constructor from trajectory (stolen) and particle ID.
static constexpr unsigned int DefaultDumpVerbosity
Default verbosity level.
PDGID_t particleId() const
Returns the particle ID, in PDG standard.
Data product for reconstructed trajectory in space.
CheatTrack()=default
Default constructor, only for ROOT I/O (do not use it!).
recob::Trajectory fTraj
The trejectory of this track.
PDGID_t fPDGID
Particle ID in PDG standard.
bool hasParticleId() const
Returns whether the particle ID is valid.
double StartMomentum() const
Computes and returns the modulus of momentum at the first point [GeV/c].
Pseudo-track object for TotallyCheatTracks example.
static constexpr PDGID_t InvalidParticleID
Value of a particle ID that denotes it as invalid.
int PDGID_t
Type of the particle ID.
void dump(Stream &&out, unsigned int verbosity=DefaultDumpVerbosity, std::string indent="") const
Default verbosity level.
std::string indent(std::size_t const i)
double momentum() const
Returns the initial momentum of the particle [MeV].
static constexpr unsigned int MaxDumpVerbosity
Maximum verbosity level.
recob::Trajectory const & trajectory() const
Returns the trajectory of this track.
static constexpr unsigned int MaxDumpVerbosity
Largest verbosity level supported by Dump().
void dump(Stream &&out, unsigned int verbosity, std::string indent, std::string firstIndent) const
Prints the content of this object into an output stream.
A trajectory in space reconstructed from hits.
LArSoft-specific namespace.
void Dump(Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const
Prints trajectory content into a stream.
std::ostream & operator<<(std::ostream &out, lar::example::CheatTrack const &track)