LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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
 
void SetMother (int mother)
 
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.

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:126
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, fmother, ftrackId, Mother(), NumberDaughters(), and TrackId().

87  : fstatus(p.StatusCode())
88  , fpdgCode(p.PdgCode())
89  , fprocess(p.Process())
90  , fendprocess(p.EndProcess())
91  , ftrajectory(p.Trajectory())
92  , fmass(p.Mass())
93  , fWeight(p.Weight())
94  , fGvtx(p.GetGvtx())
95  , frescatter(p.Rescatter())
96  {
97 
98  ftrackId = p.TrackId()>=0? p.TrackId()+offset : p.TrackId()-offset;
99  fmother = p.Mother()>=0? p.Mother()+offset : p.Mother()-offset;
100 
101  for(int i=0; i<p.NumberDaughters(); i++){
102  if(p.Daughter(i)>=0)
103  fdaughters.insert(p.Daughter(i)+offset);
104  else
105  fdaughters.insert(p.Daughter(i)-offset);
106  }
107  }
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 sim::MCMiniPart::operator simb::MCParticle(), sim::MCParticleLite::operator simb::MCParticle(), and 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,
bool  keepTransportation = false 
)
inline

Definition at line 261 of file MCParticle.h.

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

265  { ftrajectory.Add( position, momentum, process, keepTransportation); }
void Add(TLorentzVector const &p, TLorentzVector const &m)
simb::MCTrajectory ftrajectory
particle trajectory (position,momentum)
Definition: MCParticle.h:41
double simb::MCParticle::E ( const int  i = 0) const
inline

Definition at line 234 of file MCParticle.h.

References Momentum().

Referenced by opdet::OpFlashMCTruthAna::analyze(), lar_pandora::PFParticleMonitoring::analyze(), shower::TCShowerElectronLikelihood::analyze(), shower::TCShowerTemplateMaker::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), hit::HitFinderAna::analyze(), cluster::ClusterTrackAna::analyze(), rwgt::ReweightAna::analyze(), lcvn::LArNuCVNZlibMaker::analyze(), nnet::RawWaveformDump::analyze(), nnet::RawWaveformClnSigDump::analyze(), trkf::TrackAna::analyze(), trkf::TrackAna::anaStitch(), ShowerRecoTools::ShowerStartPositionCheater::CalculateElement(), lar_pandora::LArPandoraInput::CreatePandoraMCParticles(), sim::ParticleList::Cut(), evdb_tool::DrawLArVoxel3D::Draw(), evgen::NDKGen::FillHistograms(), evgen::GENIEGen::FillHistograms(), simfilter::FilterGenInTime::filter(), opreco::OpticalRecoAna::get_MC_particle_list(), lar_pandora::LArPandoraSliceIdHelper::GetBeamNeutrinoMCTruth(), lar_pandora::PFParticleValidation::GetSimpleMCPrimaryList(), simfilter::FilterGenInTime::KeepParticle(), evd::SimulationDrawer::MCTruth3D(), evd::SimulationDrawer::MCTruthLongText(), evd::SimulationDrawer::MCTruthOrtho(), evd::SimulationDrawer::MCTruthVectors2D(), simb::operator<<(), P(), print_weights(), evdb::ScanFrame::Record(), evgb::RetrieveGHEP(), evgb::GENIEHelper::Sample(), and shower::TCShowerTemplateMaker::showerProfileTrue().

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

Definition at line 245 of file MCParticle.h.

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

245 { return Momentum(ftrajectory.size()-1).T(); }
double T(const int i=0) const
Definition: MCParticle.h:225
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:221
const TLorentzVector & simb::MCParticle::EndMomentum ( ) const
inline

Definition at line 241 of file MCParticle.h.

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

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

241 { 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:221
const TLorentzVector & simb::MCParticle::EndPosition ( ) const
inline

Definition at line 226 of file MCParticle.h.

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

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

226 { return Position(ftrajectory.size()-1); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:220
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
double simb::MCParticle::EndPx ( ) const
inline

Definition at line 242 of file MCParticle.h.

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

242 { 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:221
Float_t X
Definition: plot.C:37
double simb::MCParticle::EndPy ( ) const
inline

Definition at line 243 of file MCParticle.h.

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

243 { return Momentum(ftrajectory.size()-1).Y(); }
Float_t Y
Definition: plot.C:37
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:221
double simb::MCParticle::EndPz ( ) const
inline

Definition at line 244 of file MCParticle.h.

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

244 { return Momentum(ftrajectory.size()-1).Z(); }
Float_t Z
Definition: plot.C:37
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:221
double simb::MCParticle::EndT ( ) const
inline

Definition at line 230 of file MCParticle.h.

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

230 { return Position(ftrajectory.size()-1).T(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:220
double T(const int i=0) const
Definition: MCParticle.h:225
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 227 of file MCParticle.h.

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

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

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

Definition at line 228 of file MCParticle.h.

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

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

228 { return Position(ftrajectory.size()-1).Y(); }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:220
Float_t Y
Definition: plot.C:37
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 229 of file MCParticle.h.

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

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

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

Definition at line 251 of file MCParticle.h.

References fdaughters.

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

251 { 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 246 of file MCParticle.h.

References fGvtx.

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

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

Definition at line 250 of file MCParticle.h.

References fGvtx.

Referenced by evgb::RetrieveGHEP().

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

Definition at line 247 of file MCParticle.h.

References fGvtx.

Referenced by evgb::RetrieveGHEP().

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

Definition at line 248 of file MCParticle.h.

References fGvtx.

Referenced by evgb::RetrieveGHEP().

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

Definition at line 249 of file MCParticle.h.

References fGvtx.

Referenced by evgb::RetrieveGHEP().

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

Definition at line 252 of file MCParticle.h.

References fdaughters.

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

252 { 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 276 of file MCParticle.h.

References ftrackId.

276 { 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 ( void  ) const
inline

Definition at line 213 of file MCParticle.h.

References fpdgCode.

Referenced by opdet::OpFlashMCTruthAna::analyze(), shower::TCShowerAnalysis::analyze(), lar_pandora::PFParticleMonitoring::analyze(), shower::TCShowerElectronLikelihood::analyze(), shower::TCShowerTemplateMaker::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), cluster::DBclusterAna::analyze(), hit::HitFinderAna::analyze(), cluster::ClusterTrackAna::analyze(), NuShowerEff::analyze(), nnet::RawWaveformDump::analyze(), nnet::RawWaveformClnSigDump::analyze(), lar::example::AnalysisExample::analyze(), trkf::TrackAna::anaStitch(), ShowerRecoTools::ShowerTrackFinderCheater::CalculateElement(), ShowerRecoTools::ShowerStartPositionCheater::CalculateElement(), DUNE::NeutrinoShowerEff::checkCNNtrkshw(), nnet::PointIdEffTest::countTruthDep(), lar_pandora::LArPandoraInput::CreatePandoraMCParticles(), evdb_tool::DrawLArVoxel3D::Draw(), sim::dump::DumpMCParticle(), evgen::NDKGen::FillHistograms(), evgen::GENIEGen::FillHistograms(), cheat::RecoCheckAna::FillResults(), simfilter::FilterGenInTime::filter(), larg4::MCTruthEventActionService::generatePrimaries(), g4b::ConvertMCTruthToG4::GeneratePrimaries(), opreco::OpticalRecoAna::get_MC_particle_list(), lcvn::AssignLabels::GetInteractionType(), lcvn::AssignLabels::GetNeutralDaughterHitsRecursive(), lcvn::AssignLabels::GetProtoDUNEBeamInteractionType(), lar_pandora::PFParticleValidation::GetSimpleMCPrimaryList(), lcvn::AssignLabels::GetTopology(), shower::LArPandoraShowerCheatingAlg::GetTrueChain(), ems::MCinfo::Info(), nnet::TrainingDataAlg::isElectronEnd(), nnet::PointIdEffTest::isMuonDecaying(), nnet::TrainingDataAlg::isMuonDecaying(), lar_pandora::LArPandoraHelper::IsVisible(), sim::MCMiniPart::MCMiniPart(), sim::MCParticleLite::MCParticleLite(), 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(), evgen::CosmicsGen::produce(), trkf::TrackCheater::produce(), trkf::TrackKalmanCheater::produce(), evdb::ScanFrame::Record(), evgb::RetrieveGHEP(), simb::MCTruth::SetNeutrino(), shower::TCShowerTemplateMaker::showerProfileTrue(), and nnet::PointIdEffTest::testCNN().

213 { 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 237 of file MCParticle.h.

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

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

237  { return std::sqrt( std::pow(Momentum(i).Px(),2.)
238  + std::pow(Momentum(i).Py(),2.)); }
double Py(const int i=0) const
Definition: MCParticle.h:232
double Px(const int i=0) const
Definition: MCParticle.h:231
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:221
int simb::MCParticle::Rescatter ( ) const
inline

Definition at line 253 of file MCParticle.h.

References frescatter.

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

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

Definition at line 111 of file MCParticle.cxx.

References fendprocess.

Referenced by larg4::ParticleListActionService::postUserTrackingAction().

112  {
113  fendprocess = s;
114  }
std::string fendprocess
end process for the particle
Definition: MCParticle.h:40
void simb::MCParticle::SetGvtx ( double *  v)

Definition at line 126 of file MCParticle.cxx.

References fGvtx.

Referenced by MCParticle().

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

Definition at line 134 of file MCParticle.cxx.

References fGvtx.

135  {
136  for(int i = 0; i < 4; i++) {
137  fGvtx[i] = v[i];
138  }
139  }
TLorentzVector fGvtx
Definition: MCParticle.h:46
void simb::MCParticle::SetGvtx ( TLorentzVector  v)

Definition at line 142 of file MCParticle.cxx.

References fGvtx.

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

Definition at line 148 of file MCParticle.cxx.

References fGvtx.

149  {
150  fGvtx.SetX(x);
151  fGvtx.SetY(y);
152  fGvtx.SetZ(z);
153  fGvtx.SetT(t);
154  }
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:276
void simb::MCParticle::SetMother ( int  mother)
inline

Definition at line 273 of file MCParticle.h.

References fmother.

273 { fmother = mother; }
int fmother
Mother.
Definition: MCParticle.h:38
void simb::MCParticle::SetPolarization ( const TVector3 &  p)
inline

Definition at line 270 of file MCParticle.h.

References fpolarization.

Referenced by larg4::ParticleListActionService::preUserTrackingAction().

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::ParticleListActionService::postUserTrackingAction().

272 { 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 266 of file MCParticle.h.

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

Referenced by larg4::ParticleListActionService::postUserTrackingAction(), and larg4::LArG4::produce().

268  { 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::TrackId ( ) const
inline

Definition at line 211 of file MCParticle.h.

References ftrackId.

Referenced by ClusteringValidation::ClusterAnalyser::Analyse(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), cluster::ClusterTrackAna::analyze(), NuShowerEff::analyze(), lar_pandora::LArPandoraHelper::BuildMCParticleHitMaps(), lar_pandora::LArPandoraHelper::BuildMCParticleMap(), ShowerRecoTools::ShowerTrackFinderCheater::CalculateElement(), shower::LArPandoraShowerCheatingAlg::CheatDebugEVD(), lar_pandora::LArPandoraInput::CreatePandoraMCParticles(), sim::EveIdCalculator::DoCalculateEveId(), evdb_tool::DrawLArVoxel3D::Draw(), sim::dump::DumpMCParticle(), larg4::MCTruthEventActionService::generatePrimaries(), opreco::OpticalRecoAna::get_MC_particle_origin(), lar_pandora::LArPandoraHelper::GetFinalStateMCParticle(), lcvn::AssignLabels::GetNeutralDaughterHitsRecursive(), lar_pandora::LArPandoraHelper::GetParentMCParticle(), lcvn::AssignLabels::GetTopology(), shower::LArPandoraShowerCheatingAlg::GetTrueChain(), shower::LArPandoraShowerCheatingAlg::GetTrueParticleMap(), sim::MCMiniPart::MCMiniPart(), MCParticle(), sim::MCParticleLite::MCParticleLite(), evd::SimulationDrawer::MCTruth3D(), evd::SimulationDrawer::MCTruthLongText(), evd::SimulationDrawer::MCTruthOrtho(), evd::SimulationDrawer::MCTruthVectors2D(), simb::operator<<(), sim::ParticleHistory::ParticleHistory(), cheat::PhotonBackTracker::ParticleToMCTruth(), cheat::ParticleInventoryService::ParticleToMCTruth_P(), cheat::ParticleInventory::ParticleToMCTruth_P(), larg4::ParticleListActionService::postUserTrackingAction(), DUNE::NeutrinoShowerEff::processEff(), DUNE::NeutrinoTrackingEff::processEff(), DUNE::MuonTrackingEff::processEff(), trkf::TrackKalmanCheater::produce(), t0::MCTruthT0Matching::produce(), larg4::LArG4::produce(), and simb::MCTruth::SetNeutrino().

211 { return ftrackId; }
int ftrackId
TrackId.
Definition: MCParticle.h:36
double simb::MCParticle::Weight ( void  ) const
inline

Definition at line 255 of file MCParticle.h.

References fWeight.

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

255 { 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 157 of file MCParticle.cxx.

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

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 MCParticle(), Mother(), and SetMother().

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 MCParticle(), 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.

Referenced by sim::dump::DumpMCParticle(), and sim::RescatteringName().


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