Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | Friends | List of all members
simb::MCParticle Class Reference

#include <MCParticle.h>

Public Member Functions

 MCParticle ()
 Don't write this as ROOT output. More...
 
 MCParticle (const int trackId, const int pdg, const std::string process, const int mother=-1, const double mass=s_uninitialized, const int status=1)
 Standard constructor. More...
 
 MCParticle (MCParticle const &)=default
 
MCParticleoperator= (const MCParticle &)=default
 
 MCParticle (MCParticle &&)=default
 
MCParticleoperator= (MCParticle &&)=default
 
 MCParticle (MCParticle const &, int)
 
int TrackId () const
 
int StatusCode () const
 
int PdgCode () const
 
int Mother () const
 
const TVector3 & Polarization () const
 
void SetPolarization (const TVector3 &p)
 
std::string Process () const
 
std::string EndProcess () const
 
void SetEndProcess (std::string s)
 
void AddDaughter (const int trackID)
 
int NumberDaughters () const
 
int Daughter (const int i) const
 
unsigned int NumberTrajectoryPoints () const
 
const TLorentzVector & Position (const int i=0) const
 
double Vx (const int i=0) const
 
double Vy (const int i=0) const
 
double Vz (const int i=0) const
 
double T (const int i=0) const
 
const TLorentzVector & EndPosition () const
 
double EndX () const
 
double EndY () const
 
double EndZ () const
 
double EndT () const
 
const TLorentzVector & Momentum (const int i=0) const
 
double Px (const int i=0) const
 
double Py (const int i=0) const
 
double Pz (const int i=0) const
 
double E (const int i=0) const
 
double P (const int i=0) const
 
double Pt (const int i=0) const
 
double Mass () const
 
const TLorentzVector & EndMomentum () const
 
double EndPx () const
 
double EndPy () const
 
double EndPz () const
 
double EndE () const
 
void SetGvtx (double *v)
 
void SetGvtx (float *v)
 
void SetGvtx (TLorentzVector v)
 
void SetGvtx (double x, double y, double z, double t)
 
TLorentzVector GetGvtx () const
 
double Gvx () const
 
double Gvy () const
 
double Gvz () const
 
double Gvt () const
 
int FirstDaughter () const
 
int LastDaughter () const
 
void SetRescatter (int code)
 
int Rescatter () const
 
const simb::MCTrajectoryTrajectory () const
 
void AddTrajectoryPoint (TLorentzVector const &position, TLorentzVector const &momentum)
 
void AddTrajectoryPoint (TLorentzVector const &position, TLorentzVector const &momentum, std::string const &process, bool keepTransportation=false)
 
double Weight () const
 
void SetWeight (double wt)
 
void SparsifyTrajectory (double margin=0.1, bool keep_second_to_last=false)
 
bool operator< (const simb::MCParticle &other) const
 

Static Public Attributes

static const int s_uninitialized = std::numeric_limits<int>::min()
 

Protected Types

typedef std::set< int > daughters_type
 

Protected Attributes

int fstatus
 Status code from generator, geant, etc. More...
 
int ftrackId
 TrackId. More...
 
int fpdgCode
 PDG code. More...
 
int fmother
 Mother. More...
 
std::string fprocess
 Detector-simulation physics process that created the particle. More...
 
std::string fendprocess
 end process for the particle More...
 
simb::MCTrajectory ftrajectory
 particle trajectory (position,momentum) More...
 
double fmass
 Mass; from PDG unless overridden Should be in GeV. More...
 
TVector3 fpolarization
 Polarization. More...
 
daughters_type fdaughters
 Sorted list of daughters of this particle. More...
 
double fWeight
 Assigned weight to this particle for MC tests. More...
 
TLorentzVector fGvtx
 
int frescatter
 rescatter code More...
 

Friends

std::ostream & operator<< (std::ostream &output, const simb::MCParticle &)
 

Detailed Description

Definition at line 24 of file MCParticle.h.

Member Typedef Documentation

typedef std::set<int> simb::MCParticle::daughters_type
protected

Definition at line 33 of file MCParticle.h.

Constructor & Destructor Documentation

simb::MCParticle::MCParticle ( )

Don't write this as ROOT output.

Definition at line 32 of file MCParticle.cxx.

37  , fprocess()
38  , fendprocess()
40  , fpolarization()
41  , fdaughters()
43  , fGvtx()
45  {
46  }
static const int s_uninitialized
Definition: MCParticle.h:28
TLorentzVector fGvtx
Definition: MCParticle.h:46
int fmother
Mother.
Definition: MCParticle.h:38
double fmass
Mass; from PDG unless overridden Should be in GeV.
Definition: MCParticle.h:42
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
int ftrackId
TrackId.
Definition: MCParticle.h:36
int frescatter
rescatter code
Definition: MCParticle.h:48
int fpdgCode
PDG code.
Definition: MCParticle.h:37
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
std::string fprocess
Detector-simulation physics process that created the particle.
Definition: MCParticle.h:39
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45
int fstatus
Status code from generator, geant, etc.
Definition: MCParticle.h:35
TVector3 fpolarization
Polarization.
Definition: MCParticle.h:43
simb::MCParticle::MCParticle ( const int  trackId,
const int  pdg,
const std::string  process,
const int  mother = -1,
const double  mass = s_uninitialized,
const int  status = 1 
)

Standard constructor.

Definition at line 50 of file MCParticle.cxx.

56  : fstatus(status)
57  , ftrackId(trackId)
58  , fpdgCode(pdg)
59  , fmother(mother)
60  , fprocess(process)
62  , fmass(mass)
63  , fpolarization()
64  , fdaughters()
65  , fWeight(0.)
66  , fGvtx()
68  {
69  // If the user has supplied a mass, use it. Otherwise, get the
70  // particle mass from the PDG table.
71  if ( mass < 0 ){
72  const TDatabasePDG* databasePDG = TDatabasePDG::Instance();
73  const TParticlePDG* definition = databasePDG->GetParticle( pdg );
74  // Check that the particle is known to ROOT. If not, this is
75  // not a major error; Geant4 has an internal particle coding
76  // scheme for nuclei that ROOT doesn't recognize.
77  if ( definition != 0 ){
78  fmass = definition->Mass();
79  }
80  }
81  else fmass = mass;
82  SetGvtx(0, 0, 0, 0);
83  }
static const int s_uninitialized
Definition: MCParticle.h:28
TLorentzVector fGvtx
Definition: MCParticle.h:46
std::string string
Definition: nybbler.cc:12
int fmother
Mother.
Definition: MCParticle.h:38
double fmass
Mass; from PDG unless overridden Should be in GeV.
Definition: MCParticle.h:42
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
int ftrackId
TrackId.
Definition: MCParticle.h:36
def process(f, kind)
Definition: search.py:254
int frescatter
rescatter code
Definition: MCParticle.h:48
int fpdgCode
PDG code.
Definition: MCParticle.h:37
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
std::string fprocess
Detector-simulation physics process that created the particle.
Definition: MCParticle.h:39
void SetGvtx(double *v)
Definition: MCParticle.cxx:120
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45
int fstatus
Status code from generator, geant, etc.
Definition: MCParticle.h:35
TVector3 fpolarization
Polarization.
Definition: MCParticle.h:43
simb::MCParticle::MCParticle ( MCParticle const &  )
default
simb::MCParticle::MCParticle ( MCParticle &&  )
default
simb::MCParticle::MCParticle ( MCParticle const &  p,
int  offset 
)

Definition at line 86 of file MCParticle.cxx.

87  : fstatus(p.StatusCode())
88  , ftrackId(p.TrackId()+offset)
89  , fpdgCode(p.PdgCode())
90  , fmother(p.Mother()+offset)
91  , fprocess(p.Process())
92  , fendprocess(p.EndProcess())
93  , ftrajectory(p.Trajectory())
94  , fmass(p.Mass())
95  , fWeight(p.Weight())
96  , fGvtx(p.GetGvtx())
97  , frescatter(p.Rescatter())
98  {
99  for(int i=0; i<p.NumberDaughters(); i++)
100  fdaughters.insert(p.Daughter(i)+offset);
101  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
int fmother
Mother.
Definition: MCParticle.h:38
double fmass
Mass; from PDG unless overridden Should be in GeV.
Definition: MCParticle.h:42
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
int ftrackId
TrackId.
Definition: MCParticle.h:36
int frescatter
rescatter code
Definition: MCParticle.h:48
int fpdgCode
PDG code.
Definition: MCParticle.h:37
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
p
Definition: test.py:223
std::string fprocess
Detector-simulation physics process that created the particle.
Definition: MCParticle.h:39
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45
int fstatus
Status code from generator, geant, etc.
Definition: MCParticle.h:35

Member Function Documentation

void simb::MCParticle::AddDaughter ( const int  trackID)
inline

Definition at line 268 of file MCParticle.h.

268 { fdaughters.insert(trackID); }
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
void simb::MCParticle::AddTrajectoryPoint ( TLorentzVector const &  position,
TLorentzVector const &  momentum 
)
inline

Definition at line 257 of file MCParticle.h.

void Add(TLorentzVector const &p, TLorentzVector const &m)
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
def momentum(x1, x2, x3, scale=1.)
void simb::MCParticle::AddTrajectoryPoint ( TLorentzVector const &  position,
TLorentzVector const &  momentum,
std::string const &  process,
bool  keepTransportation = false 
)
inline

Definition at line 260 of file MCParticle.h.

264  { ftrajectory.Add( position, momentum, process, keepTransportation); }
void Add(TLorentzVector const &p, TLorentzVector const &m)
def process(f, kind)
Definition: search.py:254
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
def momentum(x1, x2, x3, scale=1.)
int simb::MCParticle::Daughter ( const int  i) const

Definition at line 112 of file MCParticle.cxx.

113  {
115  std::advance( i, index );
116  return *i;
117  }
intermediate_table::const_iterator const_iterator
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
double simb::MCParticle::E ( const int  i = 0) const
inline

Definition at line 233 of file MCParticle.h.

233 { return Momentum(i).E(); }
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::EndE ( ) const
inline

Definition at line 244 of file MCParticle.h.

244 { return Momentum(ftrajectory.size()-1).T(); }
double T(const int i=0) const
Definition: MCParticle.h:224
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
const TLorentzVector & simb::MCParticle::EndMomentum ( ) const
inline

Definition at line 240 of file MCParticle.h.

240 { return Momentum(ftrajectory.size()-1); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
const TLorentzVector & simb::MCParticle::EndPosition ( ) const
inline

Definition at line 225 of file MCParticle.h.

225 { return Position(ftrajectory.size()-1); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
std::string simb::MCParticle::EndProcess ( ) const
inline

Definition at line 216 of file MCParticle.h.

216 { return fendprocess; }
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
double simb::MCParticle::EndPx ( ) const
inline

Definition at line 241 of file MCParticle.h.

241 { return Momentum(ftrajectory.size()-1).X(); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::EndPy ( ) const
inline

Definition at line 242 of file MCParticle.h.

242 { return Momentum(ftrajectory.size()-1).Y(); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::EndPz ( ) const
inline

Definition at line 243 of file MCParticle.h.

243 { return Momentum(ftrajectory.size()-1).Z(); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::EndT ( ) const
inline

Definition at line 229 of file MCParticle.h.

229 { return Position(ftrajectory.size()-1).T(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
double T(const int i=0) const
Definition: MCParticle.h:224
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
double simb::MCParticle::EndX ( ) const
inline

Definition at line 226 of file MCParticle.h.

226 { return Position(ftrajectory.size()-1).X(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
double simb::MCParticle::EndY ( ) const
inline

Definition at line 227 of file MCParticle.h.

227 { return Position(ftrajectory.size()-1).Y(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
double simb::MCParticle::EndZ ( ) const
inline

Definition at line 228 of file MCParticle.h.

228 { return Position(ftrajectory.size()-1).Z(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
int simb::MCParticle::FirstDaughter ( void  ) const
inline

Definition at line 250 of file MCParticle.h.

250 { return *(fdaughters.begin()); }
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
TLorentzVector simb::MCParticle::GetGvtx ( ) const
inline

Definition at line 245 of file MCParticle.h.

245 { return fGvtx; }
TLorentzVector fGvtx
Definition: MCParticle.h:46
double simb::MCParticle::Gvt ( ) const
inline

Definition at line 249 of file MCParticle.h.

249 { return fGvtx.T(); }
TLorentzVector fGvtx
Definition: MCParticle.h:46
double simb::MCParticle::Gvx ( ) const
inline

Definition at line 246 of file MCParticle.h.

246 { return fGvtx.X(); }
TLorentzVector fGvtx
Definition: MCParticle.h:46
double simb::MCParticle::Gvy ( ) const
inline

Definition at line 247 of file MCParticle.h.

247 { return fGvtx.Y(); }
TLorentzVector fGvtx
Definition: MCParticle.h:46
double simb::MCParticle::Gvz ( ) const
inline

Definition at line 248 of file MCParticle.h.

248 { return fGvtx.Z(); }
TLorentzVector fGvtx
Definition: MCParticle.h:46
int simb::MCParticle::LastDaughter ( void  ) const
inline

Definition at line 251 of file MCParticle.h.

251 { return *(fdaughters.rbegin()); }
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
double simb::MCParticle::Mass ( void  ) const
inline

Definition at line 239 of file MCParticle.h.

239 { return fmass; }
double fmass
Mass; from PDG unless overridden Should be in GeV.
Definition: MCParticle.h:42
const TLorentzVector & simb::MCParticle::Momentum ( const int  i = 0) const
inline

Definition at line 220 of file MCParticle.h.

220 { return ftrajectory.Momentum(i); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
const TLorentzVector & Momentum(const size_type) const
int simb::MCParticle::Mother ( ) const
inline

Definition at line 213 of file MCParticle.h.

213 { return fmother; }
int fmother
Mother.
Definition: MCParticle.h:38
int simb::MCParticle::NumberDaughters ( ) const
inline

Definition at line 217 of file MCParticle.h.

217 { return fdaughters.size(); }
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
unsigned int simb::MCParticle::NumberTrajectoryPoints ( ) const
inline

Definition at line 218 of file MCParticle.h.

218 { return ftrajectory.size(); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:166
bool simb::MCParticle::operator< ( const simb::MCParticle other) const
inline

Definition at line 274 of file MCParticle.h.

274 { return ftrackId < other.ftrackId; }
int ftrackId
TrackId.
Definition: MCParticle.h:36
MCParticle& simb::MCParticle::operator= ( const MCParticle )
default
MCParticle& simb::MCParticle::operator= ( MCParticle &&  )
default
double simb::MCParticle::P ( const int  i = 0) const
inline

Definition at line 234 of file MCParticle.h.

234  { return std::sqrt(std::pow(Momentum(i).E(),2.)
235  - std::pow(fmass,2.)); }
double E(const int i=0) const
Definition: MCParticle.h:233
constexpr T pow(T x)
Definition: pow.h:72
double fmass
Mass; from PDG unless overridden Should be in GeV.
Definition: MCParticle.h:42
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
int simb::MCParticle::PdgCode ( void  ) const
inline

Definition at line 212 of file MCParticle.h.

212 { return fpdgCode; }
int fpdgCode
PDG code.
Definition: MCParticle.h:37
const TVector3 & simb::MCParticle::Polarization ( ) const
inline

Definition at line 214 of file MCParticle.h.

214 { return fpolarization; }
TVector3 fpolarization
Polarization.
Definition: MCParticle.h:43
const TLorentzVector & simb::MCParticle::Position ( const int  i = 0) const
inline

Definition at line 219 of file MCParticle.h.

219 { return ftrajectory.Position(i); }
const TLorentzVector & Position(const size_type) const
The accessor methods described above.
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
std::string simb::MCParticle::Process ( void  ) const
inline

Definition at line 215 of file MCParticle.h.

215 { return fprocess; }
std::string fprocess
Detector-simulation physics process that created the particle.
Definition: MCParticle.h:39
double simb::MCParticle::Pt ( const int  i = 0) const
inline

Definition at line 236 of file MCParticle.h.

236  { return std::sqrt( std::pow(Momentum(i).Px(),2.)
237  + std::pow(Momentum(i).Py(),2.)); }
double Py(const int i=0) const
Definition: MCParticle.h:231
constexpr T pow(T x)
Definition: pow.h:72
double Px(const int i=0) const
Definition: MCParticle.h:230
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::Px ( const int  i = 0) const
inline

Definition at line 230 of file MCParticle.h.

230 { return Momentum(i).Px(); }
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::Py ( const int  i = 0) const
inline

Definition at line 231 of file MCParticle.h.

231 { return Momentum(i).Py(); }
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double simb::MCParticle::Pz ( const int  i = 0) const
inline

Definition at line 232 of file MCParticle.h.

232 { return Momentum(i).Pz(); }
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
int simb::MCParticle::Rescatter ( ) const
inline

Definition at line 252 of file MCParticle.h.

252 { return frescatter; }
int frescatter
rescatter code
Definition: MCParticle.h:48
void simb::MCParticle::SetEndProcess ( std::string  s)

Definition at line 105 of file MCParticle.cxx.

106  {
107  fendprocess = s;
108  }
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
static QCString * s
Definition: config.cpp:1042
void simb::MCParticle::SetGvtx ( double *  v)

Definition at line 120 of file MCParticle.cxx.

121  {
122  for(int i = 0; i < 4; i++) {
123  fGvtx[i] = v[i];
124  }
125  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
void simb::MCParticle::SetGvtx ( float *  v)

Definition at line 128 of file MCParticle.cxx.

129  {
130  for(int i = 0; i < 4; i++) {
131  fGvtx[i] = v[i];
132  }
133  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
void simb::MCParticle::SetGvtx ( TLorentzVector  v)

Definition at line 136 of file MCParticle.cxx.

137  {
138  fGvtx = v;
139  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
void simb::MCParticle::SetGvtx ( double  x,
double  y,
double  z,
double  t 
)

Definition at line 142 of file MCParticle.cxx.

143  {
144  fGvtx.SetX(x);
145  fGvtx.SetY(y);
146  fGvtx.SetZ(z);
147  fGvtx.SetT(t);
148  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
list x
Definition: train.py:276
void simb::MCParticle::SetPolarization ( const TVector3 &  p)
inline

Definition at line 269 of file MCParticle.h.

269 { fpolarization = p; }
p
Definition: test.py:223
TVector3 fpolarization
Polarization.
Definition: MCParticle.h:43
void simb::MCParticle::SetRescatter ( int  code)
inline

Definition at line 270 of file MCParticle.h.

270 { frescatter = code; }
int frescatter
rescatter code
Definition: MCParticle.h:48
CodeOutputInterface * code
void simb::MCParticle::SetWeight ( double  wt)
inline

Definition at line 271 of file MCParticle.h.

271 { fWeight = wt; }
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45
void simb::MCParticle::SparsifyTrajectory ( double  margin = 0.1,
bool  keep_second_to_last = false 
)
inline

Definition at line 265 of file MCParticle.h.

267  { ftrajectory.Sparsify( margin, keep_second_to_last ); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
void Sparsify(double margin=.1, bool keep_second_to_last=false)
int simb::MCParticle::StatusCode ( ) const
inline

Definition at line 211 of file MCParticle.h.

211 { return fstatus; }
int fstatus
Status code from generator, geant, etc.
Definition: MCParticle.h:35
double simb::MCParticle::T ( const int  i = 0) const
inline

Definition at line 224 of file MCParticle.h.

224 { return Position(i).T(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
int simb::MCParticle::TrackId ( ) const
inline

Definition at line 210 of file MCParticle.h.

210 { return ftrackId; }
int ftrackId
TrackId.
Definition: MCParticle.h:36
const simb::MCTrajectory & simb::MCParticle::Trajectory ( ) const
inline

Definition at line 253 of file MCParticle.h.

253 { return ftrajectory; }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
double simb::MCParticle::Vx ( const int  i = 0) const
inline

Definition at line 221 of file MCParticle.h.

221 { return Position(i).X(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
double simb::MCParticle::Vy ( const int  i = 0) const
inline

Definition at line 222 of file MCParticle.h.

222 { return Position(i).Y(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
double simb::MCParticle::Vz ( const int  i = 0) const
inline

Definition at line 223 of file MCParticle.h.

223 { return Position(i).Z(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
double simb::MCParticle::Weight ( void  ) const
inline

Definition at line 254 of file MCParticle.h.

254 { return fWeight; }
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const simb::MCParticle particle 
)
friend

Definition at line 151 of file MCParticle.cxx.

152  {
153  output << "ID=" << particle.TrackId() << ", ";
154  int pdg = particle.PdgCode();
155 
156  // Try to translate the PDG code into text.
157  const TDatabasePDG* databasePDG = TDatabasePDG::Instance();
158  const TParticlePDG* definition = databasePDG->GetParticle( pdg );
159  // Check that the particle is known to ROOT. If not, this is
160  // not a major error; Geant4 has an internal particle coding
161  // scheme for nuclei that ROOT doesn't recognize.
162  if ( definition != 0 ) output << definition->GetName();
163  else output << "PDG=" << pdg;
164 
165  output << ", mass=" << particle.Mass()
166  << ", Mother ID=" << particle.Mother()
167  << ", Process=" << particle.Process()
168  << ", Status=" << particle.StatusCode()
169  << "\nthere are " << particle.NumberTrajectoryPoints() << " trajectory points";
170 
171  if(particle.NumberTrajectoryPoints() > 0 )
172  output << "\nInitial vtx (x,y,z,t)=(" << particle.Vx()
173  << "," << particle.Vy()
174  << "," << particle.Vz()
175  << "," << particle.T()
176  << "),\n Initial mom (Px,Py,Pz,E)=(" << particle.Px()
177  << "," << particle.Py()
178  << "," << particle.Pz()
179  << "," << particle.E()
180  << ")" << std::endl;
181  else
182  output << std::endl;
183 
184  return output;
185  }
double E(const int i=0) const
Definition: MCParticle.h:233
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:218
int PdgCode() const
Definition: MCParticle.h:212
double Py(const int i=0) const
Definition: MCParticle.h:231
int Mother() const
Definition: MCParticle.h:213
double Mass() const
Definition: MCParticle.h:239
double Px(const int i=0) const
Definition: MCParticle.h:230
int StatusCode() const
Definition: MCParticle.h:211
std::string Process() const
Definition: MCParticle.h:215
int TrackId() const
Definition: MCParticle.h:210
double T(const int i=0) const
Definition: MCParticle.h:224
double Vx(const int i=0) const
Definition: MCParticle.h:221
double Pz(const int i=0) const
Definition: MCParticle.h:232
double Vz(const int i=0) const
Definition: MCParticle.h:223
double Vy(const int i=0) const
Definition: MCParticle.h:222
QTextStream & endl(QTextStream &s)

Member Data Documentation

daughters_type simb::MCParticle::fdaughters
protected

Sorted list of daughters of this particle.

Definition at line 44 of file MCParticle.h.

std::string simb::MCParticle::fendprocess
protected

end process for the particle

Definition at line 40 of file MCParticle.h.

TLorentzVector simb::MCParticle::fGvtx
protected

Vertex needed by generater (genie) to rebuild genie::EventRecord for event reweighting

Definition at line 46 of file MCParticle.h.

double simb::MCParticle::fmass
protected

Mass; from PDG unless overridden Should be in GeV.

Definition at line 42 of file MCParticle.h.

int simb::MCParticle::fmother
protected

Mother.

Definition at line 38 of file MCParticle.h.

int simb::MCParticle::fpdgCode
protected

PDG code.

Definition at line 37 of file MCParticle.h.

TVector3 simb::MCParticle::fpolarization
protected

Polarization.

Definition at line 43 of file MCParticle.h.

std::string simb::MCParticle::fprocess
protected

Detector-simulation physics process that created the particle.

Definition at line 39 of file MCParticle.h.

int simb::MCParticle::frescatter
protected

rescatter code

Definition at line 48 of file MCParticle.h.

int simb::MCParticle::fstatus
protected

Status code from generator, geant, etc.

Definition at line 35 of file MCParticle.h.

int simb::MCParticle::ftrackId
protected

TrackId.

Definition at line 36 of file MCParticle.h.

simb::MCTrajectory simb::MCParticle::ftrajectory
protected

particle trajectory (position,momentum)

Definition at line 41 of file MCParticle.h.

double simb::MCParticle::fWeight
protected

Assigned weight to this particle for MC tests.

Definition at line 45 of file MCParticle.h.

const int simb::MCParticle::s_uninitialized = std::numeric_limits<int>::min()
static

How do we indicate an uninitialized variable? I don't want to use "0" for PDG, because that's potentially a valid value. Instead, let the compiler give us a value. The following template (from climits) evaluates the lower possible negative number that you can store in an int.

Definition at line 28 of file MCParticle.h.


The documentation for this class was generated from the following files: