13 #ifndef LAREXAMPLES_ALGORITHMS_TOTALLYCHEATTRACKS_CHEATTRACKDATA_CHEATTRACK_H 14 #define LAREXAMPLES_ALGORITHMS_TOTALLYCHEATTRACKS_CHEATTRACKDATA_CHEATTRACK_H 21 #include "TDatabasePDG.h" 124 template <
typename Stream>
126 Stream&& out,
unsigned int verbosity,
129 template <
typename Stream>
131 Stream&& out,
unsigned int verbosity = DefaultDumpVerbosity,
152 inline std::ostream&
operator<<
154 { track.dump(out);
return out; }
167 template <
typename Stream>
169 Stream&& out,
unsigned int verbosity,
178 auto const* pPDGinfo = TDatabasePDG::Instance()->GetParticle(
particleId());
179 if (pPDGinfo) out << pPDGinfo->GetName() <<
" (ID=" <<
particleId() <<
")";
181 out <<
"; momentum: " <<
momentum() <<
" GeV/c; ";
182 trajectory().
Dump(std::forward<Stream>(out), verbosity, indent,
"");
189 #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
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.