LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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)
 
double Weight () const
 
void SetWeight (double wt)
 
void SparsifyTrajectory ()
 
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.

References fmass, and SetGvtx().

56  : fstatus(status)
57  , ftrackId(trackId)
58  , fpdgCode(pdg)
59  , fmother(mother)
60  , fprocess(process)
61  , fendprocess(std::string())
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
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
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.

References Daughter(), fdaughters, and NumberDaughters().

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
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 269 of file MCParticle.h.

References fdaughters.

Referenced by larg4::UpdateDaughterInformation::operator()().

269 { 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,
std::string const &  process 
)
inline

Definition at line 264 of file MCParticle.h.

References simb::MCTrajectory::Add(), and ftrajectory.

267  { ftrajectory.Add( position, momentum, process); }
void Add(TLorentzVector const &p, TLorentzVector const &m)
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
int simb::MCParticle::Daughter ( const int  i) const

Definition at line 112 of file MCParticle.cxx.

References fdaughters.

Referenced by cheat::RecoCheckAna::CheckRecoEvents(), cheat::RecoCheckAna::CheckRecoVertices(), ClusteringValidation::ClusterAnalyser::FindPhotonAngle(), ems::MCinfo::Info(), nnet::TrainingDataAlg::isElectronEnd(), nnet::TrainingDataAlg::isMuonDecaying(), MCParticle(), and rwgt::NuReweight::RetrieveGHEP().

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::EndE ( ) const
inline

Definition at line 248 of file MCParticle.h.

References ftrajectory, Momentum(), simb::MCTrajectory::size(), and T().

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

Definition at line 244 of file MCParticle.h.

References ftrajectory, Momentum(), and simb::MCTrajectory::size().

Referenced by NuShowerEff::analyze(), sim::dump::DumpMCParticle(), and DUNE::NeutrinoShowerEff::processEff().

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

Definition at line 229 of file MCParticle.h.

References ftrajectory, Position(), and simb::MCTrajectory::size().

Referenced by NuShowerEff::analyze(), sim::dump::DumpMCParticle(), DUNE::NeutrinoShowerEff::processEff(), and evgb::RetrieveGHEP().

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

Definition at line 220 of file MCParticle.h.

References fendprocess.

Referenced by sim::dump::DumpMCParticle(), ems::MCinfo::Info(), and nnet::TrainingDataAlg::isMuonDecaying().

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

Definition at line 245 of file MCParticle.h.

References ftrajectory, Momentum(), simb::MCTrajectory::size(), and X.

245 { return Momentum(ftrajectory.size()-1).X(); }
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
Float_t X
Definition: plot.C:39
double simb::MCParticle::EndPy ( ) const
inline

Definition at line 246 of file MCParticle.h.

References ftrajectory, Momentum(), simb::MCTrajectory::size(), and Y.

246 { return Momentum(ftrajectory.size()-1).Y(); }
Float_t Y
Definition: plot.C:39
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
double simb::MCParticle::EndPz ( ) const
inline

Definition at line 247 of file MCParticle.h.

References ftrajectory, Momentum(), simb::MCTrajectory::size(), and Z.

247 { return Momentum(ftrajectory.size()-1).Z(); }
Float_t Z
Definition: plot.C:39
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
double simb::MCParticle::EndT ( ) const
inline

Definition at line 233 of file MCParticle.h.

References ftrajectory, Position(), simb::MCTrajectory::size(), and T().

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

Definition at line 230 of file MCParticle.h.

References ftrajectory, Position(), simb::MCTrajectory::size(), and X.

Referenced by opdet::OpFlashMCTruthAna::analyze(), nnet::TrainingDataAlg::particleRange2(), and DUNE::NeutrinoShowerEff::processEff().

230 { return Position(ftrajectory.size()-1).X(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
Float_t X
Definition: plot.C:39
double simb::MCParticle::EndY ( ) const
inline

Definition at line 231 of file MCParticle.h.

References ftrajectory, Position(), simb::MCTrajectory::size(), and Y.

Referenced by opdet::OpFlashMCTruthAna::analyze(), nnet::TrainingDataAlg::particleRange2(), and DUNE::NeutrinoShowerEff::processEff().

231 { return Position(ftrajectory.size()-1).Y(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
Float_t Y
Definition: plot.C:39
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
double simb::MCParticle::EndZ ( ) const
inline

Definition at line 232 of file MCParticle.h.

References ftrajectory, Position(), simb::MCTrajectory::size(), and Z.

Referenced by opdet::OpFlashMCTruthAna::analyze(), nnet::TrainingDataAlg::particleRange2(), and DUNE::NeutrinoShowerEff::processEff().

232 { return Position(ftrajectory.size()-1).Z(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
Float_t Z
Definition: plot.C:39
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
size_type size() const
Definition: MCTrajectory.h:169
int simb::MCParticle::FirstDaughter ( ) const
inline

Definition at line 254 of file MCParticle.h.

References fdaughters.

Referenced by sim::dump::DumpMCParticle().

254 { 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 249 of file MCParticle.h.

References fGvtx.

Referenced by sim::dump::DumpMCParticle().

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

Definition at line 253 of file MCParticle.h.

References fGvtx.

Referenced by rwgt::NuReweight::RetrieveGHEP(), and evgb::RetrieveGHEP().

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

Definition at line 250 of file MCParticle.h.

References fGvtx.

Referenced by rwgt::NuReweight::RetrieveGHEP(), and evgb::RetrieveGHEP().

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

Definition at line 251 of file MCParticle.h.

References fGvtx.

Referenced by rwgt::NuReweight::RetrieveGHEP(), and evgb::RetrieveGHEP().

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

Definition at line 252 of file MCParticle.h.

References fGvtx.

Referenced by rwgt::NuReweight::RetrieveGHEP(), and evgb::RetrieveGHEP().

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

Definition at line 255 of file MCParticle.h.

References fdaughters.

Referenced by sim::dump::DumpMCParticle().

255 { return *(fdaughters.rbegin()); }
daughters_type fdaughters
Sorted list of daughters of this particle.
Definition: MCParticle.h:44
bool simb::MCParticle::operator< ( const simb::MCParticle other) const
inline

Definition at line 275 of file MCParticle.h.

References ftrackId.

275 { 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
int simb::MCParticle::PdgCode ( ) const
inline

Definition at line 216 of file MCParticle.h.

References fpdgCode.

Referenced by opdet::OpFlashMCTruthAna::analyze(), lar_pandora::PFParticleMonitoring::analyze(), shower::TCShowerTemplateMaker::analyze(), shower::TCShowerElectronLikelihood::analyze(), shower::TCShowerAnalysis::analyze(), cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), cluster::DBclusterAna::analyze(), hit::HitFinderAna::analyze(), NuShowerEff::analyze(), lar::example::AnalysisExample::analyze(), trkf::TrackAna::anaStitch(), DUNE::NeutrinoShowerEff::checkCNNtrkshw(), lar_pandora::LArPandoraInput::CreatePandoraMCParticles(), sim::dump::DumpMCParticle(), evgen::NUANCEGen::FillHistograms(), evgen::NDKGen::FillHistograms(), evgen::GENIEGen::FillHistograms(), cheat::RecoCheckAna::FillResults(), simfilter::FilterGenInTime::filter(), g4b::ConvertMCTruthToG4::GeneratePrimaries(), opreco::OpticalRecoAna::get_MC_particle_list(), lar_pandora::PFParticleValidation::GetSimpleMCPrimaryList(), ems::MCinfo::Info(), nnet::TrainingDataAlg::isElectronEnd(), nnet::TrainingDataAlg::isMuonDecaying(), lar_pandora::LArPandoraHelper::IsVisible(), lar::example::TotallyCheatTrackingAlg::makeTrack(), evd::SimulationDrawer::MCTruth3D(), evd::SimulationDrawer::MCTruthLongText(), evd::SimulationDrawer::MCTruthOrtho(), evd::SimulationDrawer::MCTruthShortText(), evd::SimulationDrawer::MCTruthVectors2D(), simb::operator<<(), filt::LArG4ParticleFilter::PDGCheck(), DUNE::NeutrinoShowerEff::processEff(), DUNE::NeutrinoTrackingEff::processEff(), DUNE::MuonTrackingEff::processEff(), wc::CellTree::processMC(), trkf::TrackCheater::produce(), evgen::CosmicsGen::produce(), trkf::TrackKalmanCheater::produce(), evdb::ScanFrame::Record(), rwgt::NuReweight::RetrieveGHEP(), evgb::RetrieveGHEP(), simb::MCTruth::SetNeutrino(), and shower::TCShowerTemplateMaker::showerProfileTrue().

216 { return fpdgCode; }
int fpdgCode
PDG code.
Definition: MCParticle.h:37
const TVector3 & simb::MCParticle::Polarization ( ) const
inline
double simb::MCParticle::Pt ( const int  i = 0) const
inline

Definition at line 240 of file MCParticle.h.

References Momentum(), Px(), and Py().

Referenced by simb::MCNeutrino::Pt().

240  { return std::sqrt( std::pow(Momentum(i).Px(),2.)
241  + std::pow(Momentum(i).Py(),2.)); }
double Py(const int i=0) const
Definition: MCParticle.h:235
double Px(const int i=0) const
Definition: MCParticle.h:234
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
int simb::MCParticle::Rescatter ( ) const
inline

Definition at line 256 of file MCParticle.h.

References frescatter.

Referenced by sim::dump::DumpMCParticle(), rwgt::NuReweight::RetrieveGHEP(), and evgb::RetrieveGHEP().

256 { 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.

References fendprocess, and s.

Referenced by larg4::ParticleListAction::PostTrackingAction().

106  {
107  fendprocess = s;
108  }
Float_t s
Definition: plot.C:23
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
void simb::MCParticle::SetGvtx ( double *  v)

Definition at line 120 of file MCParticle.cxx.

References fGvtx.

Referenced by MCParticle().

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.

References fGvtx.

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.

References fGvtx.

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.

References fGvtx.

143  {
144  fGvtx.SetX(x);
145  fGvtx.SetY(y);
146  fGvtx.SetZ(z);
147  fGvtx.SetT(t);
148  }
Float_t x
Definition: compare.C:6
TLorentzVector fGvtx
Definition: MCParticle.h:46
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
void simb::MCParticle::SetPolarization ( const TVector3 &  p)
inline

Definition at line 270 of file MCParticle.h.

References fpolarization.

Referenced by larg4::ParticleListAction::PreTrackingAction().

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

Definition at line 271 of file MCParticle.h.

References frescatter.

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

Definition at line 272 of file MCParticle.h.

References fWeight.

Referenced by larg4::ParticleListAction::PostTrackingAction().

272 { fWeight = wt; }
double fWeight
Assigned weight to this particle for MC tests.
Definition: MCParticle.h:45
void simb::MCParticle::SparsifyTrajectory ( )
inline

Definition at line 268 of file MCParticle.h.

References ftrajectory, and simb::MCTrajectory::Sparsify().

Referenced by larg4::LArG4::produce().

268 { ftrajectory.Sparsify(); }
void Sparsify(double margin=.1)
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
double simb::MCParticle::Vx ( const int  i = 0) const
inline
double simb::MCParticle::Weight ( ) const
inline

Definition at line 258 of file MCParticle.h.

References fWeight.

Referenced by sim::dump::DumpMCParticle().

258 { 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:237
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:222
int PdgCode() const
Definition: MCParticle.h:216
double Py(const int i=0) const
Definition: MCParticle.h:235
int Mother() const
Definition: MCParticle.h:217
double Mass() const
Definition: MCParticle.h:243
double Px(const int i=0) const
Definition: MCParticle.h:234
int StatusCode() const
Definition: MCParticle.h:215
std::string Process() const
Definition: MCParticle.h:219
int TrackId() const
Definition: MCParticle.h:214
double T(const int i=0) const
Definition: MCParticle.h:228
double Vx(const int i=0) const
Definition: MCParticle.h:225
double Pz(const int i=0) const
Definition: MCParticle.h:236
double Vz(const int i=0) const
Definition: MCParticle.h:227
double Vy(const int i=0) const
Definition: MCParticle.h:226

Member Data Documentation

daughters_type simb::MCParticle::fdaughters
protected

Sorted list of daughters of this particle.

Definition at line 44 of file MCParticle.h.

Referenced by AddDaughter(), Daughter(), FirstDaughter(), LastDaughter(), MCParticle(), and NumberDaughters().

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

end process for the particle

Definition at line 40 of file MCParticle.h.

Referenced by EndProcess(), and SetEndProcess().

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.

Referenced by GetGvtx(), Gvt(), Gvx(), Gvy(), Gvz(), and SetGvtx().

double simb::MCParticle::fmass
protected

Mass; from PDG unless overridden Should be in GeV.

Definition at line 42 of file MCParticle.h.

Referenced by Mass(), MCParticle(), and P().

int simb::MCParticle::fmother
protected

Mother.

Definition at line 38 of file MCParticle.h.

Referenced by Mother().

int simb::MCParticle::fpdgCode
protected

PDG code.

Definition at line 37 of file MCParticle.h.

Referenced by PdgCode().

TVector3 simb::MCParticle::fpolarization
protected

Polarization.

Definition at line 43 of file MCParticle.h.

Referenced by Polarization(), and SetPolarization().

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

Detector-simulation physics process that created the particle.

Definition at line 39 of file MCParticle.h.

Referenced by Process().

int simb::MCParticle::frescatter
protected

rescatter code

Definition at line 48 of file MCParticle.h.

Referenced by Rescatter(), and SetRescatter().

int simb::MCParticle::fstatus
protected

Status code from generator, geant, etc.

Definition at line 35 of file MCParticle.h.

Referenced by StatusCode().

int simb::MCParticle::ftrackId
protected

TrackId.

Definition at line 36 of file MCParticle.h.

Referenced by operator<(), and TrackId().

simb::MCTrajectory simb::MCParticle::ftrajectory
protected
double simb::MCParticle::fWeight
protected

Assigned weight to this particle for MC tests.

Definition at line 45 of file MCParticle.h.

Referenced by SetWeight(), and Weight().

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: