Namespaces | Classes | Typedefs | Enumerations | Functions
simb Namespace Reference

This class describes a particle created in the detector Monte Carlo simulation. More...

Namespaces

 gtruthaux
 

Classes

class  GTruth
 
class  MCFlux
 
struct  MCGeneratorInfo
 
class  MCNeutrino
 Event generator information. More...
 
class  MCParticle
 
class  MCTrajectory
 
class  MCTruth
 Event generator information. More...
 

Typedefs

typedef enum simb::_ev_generator Generator_t
 generator used to produce event, if applicable More...
 
typedef enum simb::_ev_origin Origin_t
 event origin types More...
 

Enumerations

enum  flux_code_ {
  kHistPlusFocus = +1, kHistMinusFocus = -1, kGenerator = 0, kNtuple = 2,
  kSimple_Flux = 3, kDk2Nu = 4
}
 Which flux was used to generate this event? More...
 
enum  _ev_generator {
  kUnknown, _ev_generator::kGENIE, _ev_generator::kCRY, _ev_generator::kGIBUU,
  _ev_generator::kNuWro, _ev_generator::kMARLEY, _ev_generator::kNEUT, _ev_generator::kCORSIKA,
  _ev_generator::kGEANT, _ev_generator::kNumGenerators
}
 generator used to produce event, if applicable More...
 
enum  curr_type_ { kCC, kNC }
 Neutrino interaction categories. More...
 
enum  int_type_ {
  kUnknownInteraction = -1, kQE = 0, kRes = 1, kDIS = 2,
  kCoh = 3, kCohElastic = 4, kElectronScattering = 5, kIMDAnnihilation = 6,
  kInverseBetaDecay = 7, kGlashowResonance = 8, kAMNuGamma = 9, kMEC = 10,
  kDiffractive = 11, kEM = 12, kWeakMix = 13, kNuanceOffset = 1000,
  kCCQE = kNuanceOffset + 1, kNCQE = kNuanceOffset + 2, kResCCNuProtonPiPlus = kNuanceOffset + 3, kResCCNuNeutronPi0 = kNuanceOffset + 4,
  kResCCNuNeutronPiPlus = kNuanceOffset + 5, kResNCNuProtonPi0 = kNuanceOffset + 6, kResNCNuProtonPiPlus = kNuanceOffset + 7, kResNCNuNeutronPi0 = kNuanceOffset + 8,
  kResNCNuNeutronPiMinus = kNuanceOffset + 9, kResCCNuBarNeutronPiMinus = kNuanceOffset + 10, kResCCNuBarProtonPi0 = kNuanceOffset + 11, kResCCNuBarProtonPiMinus = kNuanceOffset + 12,
  kResNCNuBarProtonPi0 = kNuanceOffset + 13, kResNCNuBarProtonPiPlus = kNuanceOffset + 14, kResNCNuBarNeutronPi0 = kNuanceOffset + 15, kResNCNuBarNeutronPiMinus = kNuanceOffset + 16,
  kResCCNuDeltaPlusPiPlus = kNuanceOffset + 17, kResCCNuDelta2PlusPiMinus = kNuanceOffset + 21, kResCCNuBarDelta0PiMinus = kNuanceOffset + 28, kResCCNuBarDeltaMinusPiPlus = kNuanceOffset + 32,
  kResCCNuProtonRhoPlus = kNuanceOffset + 39, kResCCNuNeutronRhoPlus = kNuanceOffset + 41, kResCCNuBarNeutronRhoMinus = kNuanceOffset + 46, kResCCNuBarNeutronRho0 = kNuanceOffset + 48,
  kResCCNuSigmaPlusKaonPlus = kNuanceOffset + 53, kResCCNuSigmaPlusKaon0 = kNuanceOffset + 55, kResCCNuBarSigmaMinusKaon0 = kNuanceOffset + 60, kResCCNuBarSigma0Kaon0 = kNuanceOffset + 62,
  kResCCNuProtonEta = kNuanceOffset + 67, kResCCNuBarNeutronEta = kNuanceOffset + 70, kResCCNuKaonPlusLambda0 = kNuanceOffset + 73, kResCCNuBarKaon0Lambda0 = kNuanceOffset + 76,
  kResCCNuProtonPiPlusPiMinus = kNuanceOffset + 79, kResCCNuProtonPi0Pi0 = kNuanceOffset + 80, kResCCNuBarNeutronPiPlusPiMinus = kNuanceOffset + 85, kResCCNuBarNeutronPi0Pi0 = kNuanceOffset + 86,
  kResCCNuBarProtonPi0Pi0 = kNuanceOffset + 90, kCCDIS = kNuanceOffset + 91, kNCDIS = kNuanceOffset + 92, kUnUsed1 = kNuanceOffset + 93,
  kUnUsed2 = kNuanceOffset + 94, kCCQEHyperon = kNuanceOffset + 95, kNCCOH = kNuanceOffset + 96, kCCCOH = kNuanceOffset + 97,
  kNuElectronElastic = kNuanceOffset + 98, kInverseMuDecay = kNuanceOffset + 99, kMEC2p2h = kNuanceOffset + 100
}
 Neutrino interaction categories. More...
 
enum  _ev_origin {
  kUnknown, kUnknown, kBeamNeutrino, kCosmicRay,
  kSuperNovaNeutrino, kSingleParticle
}
 event origin types More...
 

Functions

std::ostream & operator<< (std::ostream &output, const simb::GTruth &gtruth)
 
std::ostream & operator<< (std::ostream &output, const simb::MCFlux &mcflux)
 
std::ostream & operator<< (std::ostream &output, const simb::MCNeutrino &mcnu)
 
std::ostream & operator<< (std::ostream &output, const MCParticle &particle)
 
std::ostream & operator<< (std::ostream &output, const MCTrajectory &list)
 
std::ostream & operator<< (std::ostream &o, simb::MCTruth const &a)
 

Generated particle index

This type represents the position of a specific generated particle in the generator truth record, simb::MCTruth. The particle itself can be accessed from that record via simb::MCTruth::GetParticle().

using GeneratedParticleIndex_t = std::size_t
 Type of particle index in the generator truth record (simb::MCTruth). More...
 
constexpr GeneratedParticleIndex_t NoGeneratedParticleIndex = std::numeric_limits<GeneratedParticleIndex_t>::max()
 Constant representing the absence of generator truth information. More...
 
bool isGeneratedParticleIndex (GeneratedParticleIndex_t index)
 Returns whether the specified one is an acceptable generator index. More...
 

Detailed Description

This class describes a particle created in the detector Monte Carlo simulation.

Base utilities and modules for event generation and detector simulation.

Author
selig.nosp@m.man@.nosp@m.nevis.nosp@m..col.nosp@m.umbia.nosp@m..edu
Date

This class stores/retrieves the additional information needed (and not in MCTruth) to recreate a genie::EventRecord for genie based event reweighting.

This class describes a particle created in the detector Monte Carlo simulation.

This class describes the trajectory of a particle created in the Monte Carlo simulation. It generally behaves like a vector< pair<TLorentzVector,TLorentzVector> >, where the first TLorentzVector is the position and the seoond is the momentum, with the following additions: - Methods Position(int) and Momentum(int) for those who are unfamiliar with the concept of "first" and "second" as used with STL pairs: sim::Trajectory* trajectory = simb::MCParticle.Trajectory(); int numberOfPonts = trajectory->size(); for (int i=0; i<numberOfPoints; ++i) { TLorentzVector position = trajectory->Position(i); TLorentzVector momentum = trajectory->Momentum(i); } The STL equivalent to the above statements (more efficient): sim::Trajectory* trajectory = simb::MCParticle.Trajectory(); for ( sim::Trajectory::const_iterator i = trajectory->begin(); i != trajectory->end(); ++i ) { const TLorentzVector& position = (*i).first; const TLorentzVector& momentum = (*i).second; } - As above, but for each position or momentum component; e.g., trajectory->X(i). - In addition to push_back(pair< TLorentzVector, TLorentzVector>), there's also push_back(TLorentzVector,TLorentzVector) and Add(TLorentzVector,TLorentzVector). They all do the same thing: add another point to the trajectory. - Print() and operator<< methods for ROOT display and ease of debugging. There are no units defined in this class. If it's used with Geant4, the units will be (mm,ns,GeV), but this class does not enforce this.

Typedef Documentation

using simb::GeneratedParticleIndex_t = typedef std::size_t

Type of particle index in the generator truth record (simb::MCTruth).

Definition at line 30 of file simb.h.

generator used to produce event, if applicable

event origin types

Enumeration Type Documentation

enum simb::_ev_generator
strong

generator used to produce event, if applicable

Enumerator
kUnknown 
kGENIE 
kCRY 
kGIBUU 
kNuWro 
kMARLEY 
kNEUT 
kCORSIKA 
kGEANT 
kNumGenerators 

Definition at line 18 of file MCGeneratorInfo.h.

19  {
20  kUnknown,
21  kGENIE,
22  kCRY,
23  kGIBUU,
24  kNuWro,
25  kMARLEY,
26  kNEUT,
27  kCORSIKA,
28  kGEANT,
29  kNumGenerators, // this should always be the last entry
30  } Generator_t;
enum simb::_ev_generator Generator_t
generator used to produce event, if applicable

event origin types

Enumerator
kUnknown 

???

kUnknown 
kBeamNeutrino 

Beam neutrinos.

kCosmicRay 

Cosmic rays.

kSuperNovaNeutrino 

Supernova neutrinos.

kSingleParticle 

single particles thrown at the detector

Definition at line 21 of file MCTruth.h.

21  {
22  kUnknown, ///< ???
23  kBeamNeutrino, ///< Beam neutrinos
24  kCosmicRay, ///< Cosmic rays
25  kSuperNovaNeutrino, ///< Supernova neutrinos
26  kSingleParticle ///< single particles thrown at the detector
27  } Origin_t;
enum simb::_ev_origin Origin_t
event origin types
single particles thrown at the detector
Definition: MCTruth.h:26
Supernova neutrinos.
Definition: MCTruth.h:25
Cosmic rays.
Definition: MCTruth.h:24
Beam neutrinos.
Definition: MCTruth.h:23

Neutrino interaction categories.

Enumerator
kCC 
kNC 

Definition at line 73 of file MCNeutrino.h.

73  {
74  kCC,
75  kNC
76  };

Which flux was used to generate this event?

Enumerator
kHistPlusFocus 

Flux for positive horn focus.

kHistMinusFocus 

Flux for negative horn focus.

kGenerator 

A bogus flux assumed by the generator.

kNtuple 

Full flux simulation ntuple.

kSimple_Flux 

A simplified flux ntuple for quick running.

kDk2Nu 

Unified ntuple flux format (replaces 2)

Definition at line 17 of file MCFlux.h.

17  {
18  kHistPlusFocus = +1, ///< Flux for positive horn focus
19  kHistMinusFocus = -1, ///< Flux for negative horn focus
20  kGenerator = 0, ///< A bogus flux assumed by the generator
21  kNtuple = 2, ///< Full flux simulation ntuple
22  kSimple_Flux = 3, ///< A simplified flux ntuple for quick running
23  kDk2Nu = 4 ///< Unified ntuple flux format (replaces 2)
24  };
Unified ntuple flux format (replaces 2)
Definition: MCFlux.h:23
Full flux simulation ntuple.
Definition: MCFlux.h:21
Flux for negative horn focus.
Definition: MCFlux.h:19
A bogus flux assumed by the generator.
Definition: MCFlux.h:20
Flux for positive horn focus.
Definition: MCFlux.h:18
A simplified flux ntuple for quick running.
Definition: MCFlux.h:22

Neutrino interaction categories.

Enumerator
kUnknownInteraction 

n.b.: this group is similar but not quite, entirely unlike GENIE ScatteringType convention

kQE 
kRes 
kDIS 
kCoh 
kCohElastic 
kElectronScattering 
kIMDAnnihilation 
kInverseBetaDecay 
kGlashowResonance 
kAMNuGamma 
kMEC 
kDiffractive 
kEM 
kWeakMix 
kNuanceOffset 

offset to account for adding in Nuance codes to this enum

kCCQE 

charged current quasi-elastic

kNCQE 

neutral current quasi-elastic

kResCCNuProtonPiPlus 

resonant charged current, nu p -> l- p pi+

kResCCNuNeutronPi0 

resonant charged current, nu n -> l- p pi0

kResCCNuNeutronPiPlus 

resonant charged current, nu n -> l- n pi+

kResNCNuProtonPi0 

resonant neutral current, nu p -> nu p pi0

kResNCNuProtonPiPlus 

resonant neutral current, nu p -> nu p pi+

kResNCNuNeutronPi0 

resonant neutral current, nu n -> nu n pi0

kResNCNuNeutronPiMinus 

resonant neutral current, nu n -> nu p pi-

kResCCNuBarNeutronPiMinus 

resonant charged current, nubar n -> l+ n pi-

kResCCNuBarProtonPi0 

resonant charged current, nubar p -> l+ n pi0

kResCCNuBarProtonPiMinus 

resonant charged current, nubar p -> l+ p pi-

kResNCNuBarProtonPi0 

resonant charged current, nubar p -> nubar p pi0

kResNCNuBarProtonPiPlus 

resonant charged current, nubar p -> nubar n pi+

kResNCNuBarNeutronPi0 

resonant charged current, nubar n -> nubar n pi0

kResNCNuBarNeutronPiMinus 

resonant charged current, nubar n -> nubar p pi-

kResCCNuDeltaPlusPiPlus 
kResCCNuDelta2PlusPiMinus 
kResCCNuBarDelta0PiMinus 
kResCCNuBarDeltaMinusPiPlus 
kResCCNuProtonRhoPlus 
kResCCNuNeutronRhoPlus 
kResCCNuBarNeutronRhoMinus 
kResCCNuBarNeutronRho0 
kResCCNuSigmaPlusKaonPlus 
kResCCNuSigmaPlusKaon0 
kResCCNuBarSigmaMinusKaon0 
kResCCNuBarSigma0Kaon0 
kResCCNuProtonEta 
kResCCNuBarNeutronEta 
kResCCNuKaonPlusLambda0 
kResCCNuBarKaon0Lambda0 
kResCCNuProtonPiPlusPiMinus 
kResCCNuProtonPi0Pi0 
kResCCNuBarNeutronPiPlusPiMinus 
kResCCNuBarNeutronPi0Pi0 
kResCCNuBarProtonPi0Pi0 
kCCDIS 

charged current deep inelastic scatter

kNCDIS 

charged current deep inelastic scatter

kUnUsed1 
kUnUsed2 
kCCQEHyperon 
kNCCOH 
kCCCOH 

charged current coherent pion

kNuElectronElastic 

neutrino electron elastic scatter

kInverseMuDecay 

inverse muon decay

kMEC2p2h 

extension of nuance encoding for MEC / 2p2h

Definition at line 79 of file MCNeutrino.h.

79  {
80  kUnknownInteraction = -1, ///< n.b.: this group is similar but not quite, entirely unlike GENIE ScatteringType convention
81  kQE = 0,
82  kRes = 1,
83  kDIS = 2,
84  kCoh = 3,
85  kCohElastic = 4,
87  kIMDAnnihilation = 6,
90  kAMNuGamma = 9,
91  kMEC = 10,
92  kDiffractive = 11,
93  kEM = 12,
94  kWeakMix = 13,
95  kNuanceOffset = 1000, ///< offset to account for adding in Nuance codes to this enum
96  kCCQE = kNuanceOffset + 1, ///< charged current quasi-elastic
97  kNCQE = kNuanceOffset + 2, ///< neutral current quasi-elastic
98  kResCCNuProtonPiPlus = kNuanceOffset + 3, ///< resonant charged current, nu p -> l- p pi+
99  kResCCNuNeutronPi0 = kNuanceOffset + 4, ///< resonant charged current, nu n -> l- p pi0
100  kResCCNuNeutronPiPlus = kNuanceOffset + 5, ///< resonant charged current, nu n -> l- n pi+
101  kResNCNuProtonPi0 = kNuanceOffset + 6, ///< resonant neutral current, nu p -> nu p pi0
102  kResNCNuProtonPiPlus = kNuanceOffset + 7, ///< resonant neutral current, nu p -> nu p pi+
103  kResNCNuNeutronPi0 = kNuanceOffset + 8, ///< resonant neutral current, nu n -> nu n pi0
104  kResNCNuNeutronPiMinus = kNuanceOffset + 9, ///< resonant neutral current, nu n -> nu p pi-
105  kResCCNuBarNeutronPiMinus = kNuanceOffset + 10, ///< resonant charged current, nubar n -> l+ n pi-
106  kResCCNuBarProtonPi0 = kNuanceOffset + 11, ///< resonant charged current, nubar p -> l+ n pi0
107  kResCCNuBarProtonPiMinus = kNuanceOffset + 12, ///< resonant charged current, nubar p -> l+ p pi-
108  kResNCNuBarProtonPi0 = kNuanceOffset + 13, ///< resonant charged current, nubar p -> nubar p pi0
109  kResNCNuBarProtonPiPlus = kNuanceOffset + 14, ///< resonant charged current, nubar p -> nubar n pi+
110  kResNCNuBarNeutronPi0 = kNuanceOffset + 15, ///< resonant charged current, nubar n -> nubar n pi0
111  kResNCNuBarNeutronPiMinus = kNuanceOffset + 16, ///< resonant charged current, nubar n -> nubar p pi-
133  kCCDIS = kNuanceOffset + 91, ///< charged current deep inelastic scatter
134  kNCDIS = kNuanceOffset + 92, ///< charged current deep inelastic scatter
135  kUnUsed1 = kNuanceOffset + 93,
136  kUnUsed2 = kNuanceOffset + 94,
138  kNCCOH = kNuanceOffset + 96,
139  kCCCOH = kNuanceOffset + 97, ///< charged current coherent pion
140  kNuElectronElastic = kNuanceOffset + 98, ///< neutrino electron elastic scatter
141  kInverseMuDecay = kNuanceOffset + 99, ///< inverse muon decay
142  kMEC2p2h = kNuanceOffset + 100 ///< extension of nuance encoding for MEC / 2p2h
143  };
neutral current quasi-elastic
Definition: MCNeutrino.h:97
resonant charged current, nubar p -> nubar n pi+
Definition: MCNeutrino.h:109
resonant neutral current, nu p -> nu p pi0
Definition: MCNeutrino.h:101
charged current deep inelastic scatter
Definition: MCNeutrino.h:134
resonant charged current, nubar p -> l+ p pi-
Definition: MCNeutrino.h:107
neutrino electron elastic scatter
Definition: MCNeutrino.h:140
resonant charged current, nubar p -> l+ n pi0
Definition: MCNeutrino.h:106
offset to account for adding in Nuance codes to this enum
Definition: MCNeutrino.h:95
charged current quasi-elastic
Definition: MCNeutrino.h:96
resonant charged current, nubar p -> nubar p pi0
Definition: MCNeutrino.h:108
resonant charged current, nu n -> l- p pi0
Definition: MCNeutrino.h:99
resonant neutral current, nu n -> nu n pi0
Definition: MCNeutrino.h:103
resonant charged current, nu n -> l- n pi+
Definition: MCNeutrino.h:100
extension of nuance encoding for MEC / 2p2h
Definition: MCNeutrino.h:142
resonant charged current, nubar n -> nubar p pi-
Definition: MCNeutrino.h:111
charged current deep inelastic scatter
Definition: MCNeutrino.h:133
resonant charged current, nu p -> l- p pi+
Definition: MCNeutrino.h:98
n.b.: this group is similar but not quite, entirely unlike GENIE ScatteringType convention ...
Definition: MCNeutrino.h:80
charged current coherent pion
Definition: MCNeutrino.h:139
resonant neutral current, nu n -> nu p pi-
Definition: MCNeutrino.h:104
inverse muon decay
Definition: MCNeutrino.h:141
resonant charged current, nubar n -> l+ n pi-
Definition: MCNeutrino.h:105
resonant charged current, nubar n -> nubar n pi0
Definition: MCNeutrino.h:110
resonant neutral current, nu p -> nu p pi+
Definition: MCNeutrino.h:102

Function Documentation

bool simb::isGeneratedParticleIndex ( GeneratedParticleIndex_t  index)
inline

Returns whether the specified one is an acceptable generator index.

Definition at line 37 of file simb.h.

References NoGeneratedParticleIndex.

38  { return index != NoGeneratedParticleIndex; }
constexpr GeneratedParticleIndex_t NoGeneratedParticleIndex
Constant representing the absence of generator truth information.
Definition: simb.h:34
std::ostream& simb::operator<< ( std::ostream &  output,
const MCTrajectory list 
)

Definition at line 67 of file MCTrajectory.cxx.

References simb::MCTrajectory::begin(), simb::MCTrajectory::end(), allTimeWatchdog::endl, makeTrainCVSamples::int, std::log10(), output, and simb::MCTrajectory::size().

68  {
69  // Determine a field width for the voxel number.
70  MCTrajectory::size_type numberOfTrajectories = list.size();
71  int numberOfDigits = (int) std::log10( (double) numberOfTrajectories ) + 1;
72 
73  // A simple header.
74  output.width( numberOfDigits );
75  output << "#" << ": < position (x,y,z,t), momentum (Px,Py,Pz,E) >" << std::endl;
76 
77  // Write each trajectory point on a separate line.
78  MCTrajectory::size_type nTrajectory = 0;
79  for ( MCTrajectory::const_iterator trajectory = list.begin(); trajectory != list.end(); ++trajectory, ++nTrajectory ){
80  output.width( numberOfDigits );
81  output << nTrajectory << ": "
82  << "< (" << (*trajectory).first.X()
83  << "," << (*trajectory).first.Y()
84  << "," << (*trajectory).first.Z()
85  << "," << (*trajectory).first.T()
86  << ") , (" << (*trajectory).second.Px()
87  << "," << (*trajectory).second.Py()
88  << "," << (*trajectory).second.Pz()
89  << "," << (*trajectory).second.E()
90  << ") >" << std::endl;
91  }
92 
93  return output;
94  }
ofstream output
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Definition: typedefs.hpp:11
T log10(T number)
Definition: d0nt_math.hpp:120
std::ostream& simb::operator<< ( std::ostream &  o,
simb::MCTruth const &  a 
)

Definition at line 70 of file MCTruth.cxx.

References allTimeWatchdog::endl, simb::MCTruth::GetNeutrino(), simb::MCTruth::GetParticle(), MECModelEnuComparisons::i, kBeamNeutrino, kCosmicRay, kSuperNovaNeutrino, simb::MCTruth::NParticles(), msf_helper::o, and simb::MCTruth::Origin().

71  {
72  if(a.Origin() == kCosmicRay)
73  o << "This is a cosmic ray event" << std::endl;
74  else if(a.Origin() == kBeamNeutrino){
75  o << "This is a beam neutrino event" << std::endl;
76  o << a.GetNeutrino();
77  }
78  else if(a.Origin() == kSuperNovaNeutrino){
79  o << "This is a supernova neutrino event" << std::endl;
80  o << a.GetNeutrino();
81  }
82 
83  for (int i = 0; i < a.NParticles(); ++i)
84  o << i << " " << a.GetParticle(i) << std::endl;
85 
86  return o;
87  }
const double a
Supernova neutrinos.
Definition: MCTruth.h:25
Cosmic rays.
Definition: MCTruth.h:24
Beam neutrinos.
Definition: MCTruth.h:23
std::ostream& simb::operator<< ( std::ostream &  output,
const simb::MCNeutrino mcnu 
)

Definition at line 80 of file MCNeutrino.cxx.

References simb::MCNeutrino::CCNC(), simb::MCParticle::E(), allTimeWatchdog::endl, simb::MCNeutrino::HitNuc(), simb::MCNeutrino::HitQuark(), simb::MCNeutrino::InteractionType(), simb::MCNeutrino::Mode(), simb::MCNeutrino::Nu(), output, simb::MCParticle::PdgCode(), simb::MCNeutrino::QSqr(), simb::MCNeutrino::Target(), simb::MCNeutrino::W(), simb::MCNeutrino::X(), and simb::MCNeutrino::Y().

81  {
82  output << " neutrino = " << mcnu.Nu().PdgCode() << std::endl
83  << " neutrino energy = " << mcnu.Nu().E() << std::endl
84  << " CCNC = " << mcnu.CCNC() << std::endl
85  << " mode = " << mcnu.Mode() << std::endl
86  << " interaction type = " << mcnu.InteractionType() << std::endl
87  << " target = " << mcnu.Target() << std::endl
88  << " nucleon = " << mcnu.HitNuc() << std::endl
89  << " quark = " << mcnu.HitQuark() << std::endl
90  << " W = " << mcnu.W() << std::endl
91  << " X = " << mcnu.X() << std::endl
92  << " Y = " << mcnu.Y() << std::endl
93  << " Q^2 = " << mcnu.QSqr() << std::endl;
94 
95  return output;
96  }
double E(const int i=0) const
Definition: MCParticle.h:232
ofstream output
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
double QSqr() const
Definition: MCNeutrino.h:157
int HitQuark() const
Definition: MCNeutrino.h:153
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
int HitNuc() const
Definition: MCNeutrino.h:152
int InteractionType() const
Definition: MCNeutrino.h:150
double W() const
Definition: MCNeutrino.h:154
double Y() const
Definition: MCNeutrino.h:156
double X() const
Definition: MCNeutrino.h:155
int Target() const
Definition: MCNeutrino.h:151
int Mode() const
Definition: MCNeutrino.h:149
std::ostream& simb::operator<< ( std::ostream &  output,
const simb::GTruth gtruth 
)

Definition at line 81 of file GTruth.cxx.

References allTimeWatchdog::endl, simb::GTruth::fCharmHadronPdg, simb::GTruth::fDecayMode, simb::GTruth::fDiffXsec, simb::GTruth::fFShadSystP4, simb::GTruth::fFSleptonP4, simb::GTruth::fGint, simb::GTruth::fGPhaseSpace, simb::GTruth::fgQ2, simb::GTruth::fgq2, simb::GTruth::fGscatter, simb::GTruth::fgT, simb::GTruth::fgW, simb::GTruth::fgX, simb::GTruth::fgY, simb::GTruth::fHitNucP4, simb::GTruth::fHitNucPDG, simb::GTruth::fHitNucPos, simb::GTruth::fHitQrkPDG, simb::GTruth::fIsCharm, simb::GTruth::fIsSeaQuark, simb::GTruth::fIsStrange, simb::GTruth::fNumNeutron, simb::GTruth::fNumPi0, simb::GTruth::fNumPiMinus, simb::GTruth::fNumPiPlus, simb::GTruth::fNumProton, simb::GTruth::fprobability, simb::GTruth::fProbeP4, simb::GTruth::fProbePDG, simb::GTruth::fResNum, simb::GTruth::fStrangeHadronPdg, simb::GTruth::ftgtA, simb::GTruth::fTgtP4, simb::GTruth::ftgtPDG, simb::GTruth::ftgtZ, simb::GTruth::fVertex, simb::GTruth::fweight, simb::GTruth::fXsec, output, and simb::gtruthaux::stringifyTLorentzVector().

82  {
83  output
84  << "GTruth:" << std::endl
85  // 123456789012
86  << " Vertex " << gtruthaux::stringifyTLorentzVector(gtruth.fVertex) << std::endl
87  << " weight " << std::setw(11) << gtruth.fweight << " "
88  << " prob " << std::setw(11) << gtruth.fprobability << std::endl
89  << " Xsec " << std::setw(11) << gtruth.fXsec << " "
90  << " DiffXsec " << std::setw(11) << gtruth.fDiffXsec << " "
91  << " GPhaseSpace " << std::setw(9) << gtruth.fGPhaseSpace << std::endl
92 
93  << " probe " << std::setw(11) << gtruth.fProbePDG << std::endl
94  << " ProbeP4 " << gtruthaux::stringifyTLorentzVector(gtruth.fProbeP4) << std::endl
95  << " TgtP4 " << gtruthaux::stringifyTLorentzVector(gtruth.fTgtP4) << std::endl
96 
97  << " Z A PDG (nuc,qrk) " << std::setw(4) << gtruth.ftgtZ << " "
98  << std::setw(4) << gtruth.ftgtA << " "
99  << std::setw(11) << gtruth.ftgtPDG << " ("
100  << std::setw(11) << gtruth.fHitNucPDG << " "
101  << std::setw(11) << gtruth.fHitQrkPDG << ") "
102  << " IsSeaQuark " << std::setw(4) << ((gtruth.fIsSeaQuark)?"yes":"no") << std::endl
103  << " HitNucP4 " << gtruthaux::stringifyTLorentzVector(gtruth.fHitNucP4) << " "
104  << " HitNucPos " << std::setw(11) << gtruth.fHitNucPos << std::endl
105 
106  << " Gscatter " << std::setw(11) << gtruth.fGscatter << " "
107  << " Gint " << std::setw(11) << gtruth.fGint << std::endl
108 
109  << " Q2 q2 " << std::setw(11) << gtruth.fgQ2 << " "
110  << std::setw(11) << gtruth.fgq2 << std::endl
111  << " W T " << std::setw(11) << gtruth.fgW << " "
112  << std::setw(11) << gtruth.fgT << std::endl
113  << " X Y " << std::setw(11) << gtruth.fgX << " "
114  << std::setw(11) << gtruth.fgY << std::endl
115  << " FSlepton " << gtruthaux::stringifyTLorentzVector(gtruth.fFSleptonP4) << std::endl
116  << " FShadSyst " << gtruthaux::stringifyTLorentzVector(gtruth.fFShadSystP4) << std::endl
117 
118  << " IsCharm " << std::setw(4) << ((gtruth.fIsCharm)?"yes":"no") << " "
119  << " CharmPDG " << std::setw(6) << gtruth.fCharmHadronPdg << " "
120  << " IsStrange " << std::setw(4) << ((gtruth.fIsStrange)?"yes":"no") << " "
121  << " StrangePDG " << std::setw(6) << gtruth.fStrangeHadronPdg << std::endl
122  << " Np Nn " << std::setw(4) << gtruth.fNumProton << " "
123  << std::setw(4) << gtruth.fNumNeutron << " "
124  << " Npi(0,+,-) " << std::setw(4) << gtruth.fNumPi0 << " "
125  << std::setw(4) << gtruth.fNumPiPlus << " "
126  << std::setw(4) << gtruth.fNumPiMinus << std::endl
127  << " ResNum " << std::setw(4) << gtruth.fResNum << " "
128  << " DecayMode " << std::setw(4) << gtruth.fDecayMode << std::endl
129 
130  << std::endl ;
131 
132  return output;
133  }
double fgW
Definition: GTruth.h:63
int fGint
interaction code
Definition: GTruth.h:56
ofstream output
double fgq2
Definition: GTruth.h:62
double fgX
Definition: GTruth.h:65
int ftgtA
Definition: GTruth.h:46
int fGPhaseSpace
phase space system of DiffXSec
Definition: GTruth.h:32
int fNumNeutron
number of neutrons after reaction, before FSI
Definition: GTruth.h:76
int ftgtZ
Definition: GTruth.h:45
double fXsec
cross section of interaction
Definition: GTruth.h:30
int fNumPiPlus
number of pi pluses after reaction, before FSI
Definition: GTruth.h:78
int fNumPiMinus
number of pi minuses after reaction, before FSI
Definition: GTruth.h:79
bool fIsStrange
strange production // added version 13
Definition: GTruth.h:73
TLorentzVector fProbeP4
Definition: GTruth.h:41
int fResNum
resonance number
Definition: GTruth.h:80
int fNumProton
number of protons after reaction, before FSI
Definition: GTruth.h:75
int fDecayMode
Definition: GTruth.h:81
double fprobability
interaction probability
Definition: GTruth.h:29
int fProbePDG
Definition: GTruth.h:39
TLorentzVector fFSleptonP4
generated final state primary lepton (LAB frame) // added version 13
Definition: GTruth.h:67
std::string stringifyTLorentzVector(const TLorentzVector &tv4)
Definition: GTruth.cxx:70
int fGscatter
neutrino scattering code
Definition: GTruth.h:55
int fNumPi0
number of pi0 after reaction, before FSI
Definition: GTruth.h:77
int fCharmHadronPdg
Definition: GTruth.h:72
int fHitQrkPDG
hit quark PDG code // added version 13
Definition: GTruth.h:49
bool fIsCharm
did the interaction produce a charmed hadron?
Definition: GTruth.h:71
double fweight
event interaction weight (genie internal)
Definition: GTruth.h:28
TLorentzVector fHitNucP4
Definition: GTruth.h:51
double fHitNucPos
Definition: GTruth.h:52
int ftgtPDG
PDG of Target Nucleus, nucleon only if free.
Definition: GTruth.h:47
double fgQ2
Definition: GTruth.h:61
TLorentzVector fFShadSystP4
generated final state hadronic system (LAB frame)
Definition: GTruth.h:68
TLorentzVector fTgtP4
Definition: GTruth.h:42
int fHitNucPDG
hit nucleon PDG code // added version 13
Definition: GTruth.h:48
double fgT
Definition: GTruth.h:64
bool fIsSeaQuark
Definition: GTruth.h:50
TLorentzVector fVertex
Definition: GTruth.h:26
double fgY
Definition: GTruth.h:66
double fDiffXsec
differential cross section of interaction
Definition: GTruth.h:31
int fStrangeHadronPdg
Definition: GTruth.h:74
std::ostream& simb::operator<< ( std::ostream &  output,
const MCParticle particle 
)

Definition at line 151 of file MCParticle.cxx.

References PandAna.Demos.tute_pid_validation::definition, simb::MCParticle::E(), allTimeWatchdog::endl, simb::MCParticle::Mass(), simb::MCParticle::Mother(), simb::MCParticle::NumberTrajectoryPoints(), output, make_root_from_grid_output::pdg, simb::MCParticle::PdgCode(), simb::MCParticle::Process(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), simb::MCParticle::StatusCode(), simb::MCParticle::T(), simb::MCParticle::TrackId(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

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  }
ofstream output
std::ostream& simb::operator<< ( std::ostream &  output,
const simb::MCFlux mcflux 
)

Definition at line 384 of file MCFlux.cxx.

References allTimeWatchdog::endl, simb::MCFlux::fdk2gen, simb::MCFlux::fevtno, simb::MCFlux::fmupare, simb::MCFlux::fmuparpx, simb::MCFlux::fmuparpy, simb::MCFlux::fmuparpz, simb::MCFlux::fndecay, simb::MCFlux::fnecm, simb::MCFlux::fnenergyf, simb::MCFlux::fnenergyn, simb::MCFlux::fnimpwt, simb::MCFlux::fntype, simb::MCFlux::fnwtfar, simb::MCFlux::fnwtnear, simb::MCFlux::fpdpx, simb::MCFlux::fpdpy, simb::MCFlux::fpdpz, simb::MCFlux::fppdxdz, simb::MCFlux::fppdydz, simb::MCFlux::fppmedium, simb::MCFlux::fpppz, simb::MCFlux::fptype, simb::MCFlux::frun, simb::MCFlux::ftptype, simb::MCFlux::ftpx, simb::MCFlux::ftpy, simb::MCFlux::ftpz, simb::MCFlux::fvx, simb::MCFlux::fvy, simb::MCFlux::fvz, and output.

385  {
386  output
387  << "MCFlux:" << std::endl
388  // 123456789012
389  << " flux job " << std::setw(11) << mcflux.frun << " "
390  << " pot # " << std::setw(11) << mcflux.fevtno << std::endl
391  << " ntype " << std::setw(11) << mcflux.fntype << " "
392  << " ptype " << std::setw(11) << mcflux.fptype << " "
393  << " impwt " << std::setw(11) << mcflux.fnimpwt << std::endl
394  << " ndecay " << std::setw(11) << mcflux.fndecay << " "
395  << " ppmedium " << std::setw(11) << mcflux.fppmedium << " "
396  << " tptype " << std::setw(11) << mcflux.ftptype << std::endl
397  << " vxyz " << std::setw(11) << mcflux.fvx << " "
398  << std::setw(11) << mcflux.fvy << " "
399  << std::setw(11) << mcflux.fvz << std::endl
400  << " pdpxyz " << std::setw(11) << mcflux.fpdpx << " "
401  << std::setw(11) << mcflux.fpdpy << " "
402  << std::setw(11) << mcflux.fpdpz << std::endl
403  << " tpxyz " << std::setw(11) << mcflux.ftpx << " "
404  << std::setw(11) << mcflux.ftpy << " "
405  << std::setw(11) << mcflux.ftpz << std::endl
406  << " ppd[xy]dz " << std::setw(11) << mcflux.fppdxdz << " "
407  << std::setw(11) << mcflux.fppdydz << std::endl
408  << " pppxyz " << std::setw(11) << mcflux.fppdxdz*mcflux.fpppz << " "
409  << std::setw(11) << mcflux.fppdydz*mcflux.fpppz << " "
410  << std::setw(11) << mcflux.fpppz << std::endl
411  << " muparpxyz " << std::setw(11) << mcflux.fmuparpx << " "
412  << std::setw(11) << mcflux.fmuparpy << " "
413  << std::setw(11) << mcflux.fmuparpz << " "
414  << " mupare " << std::setw(11) << mcflux.fmupare << std::endl
415  << " necm " << std::setw(11) << mcflux.fnecm << " "
416  << " dk2gen " << std::setw(11) << mcflux.fdk2gen << std::endl
417  << " near E " << std::setw(11) << mcflux.fnenergyn << " "
418  << " wgt " << std::setw(11) << mcflux.fnwtnear << std::endl
419  << " far E " << std::setw(11) << mcflux.fnenergyf << " "
420  << " wgt " << std::setw(11) << mcflux.fnwtfar << std::endl;
421  return output;
422  }
int frun
Definition: MCFlux.h:35
ofstream output
double fpdpx
Definition: MCFlux.h:55
double ftpx
Definition: MCFlux.h:79
int fppmedium
Definition: MCFlux.h:62
int ftptype
Definition: MCFlux.h:82
double fvx
Definition: MCFlux.h:52
double fnwtfar
Definition: MCFlux.h:48
double fppdxdz
Definition: MCFlux.h:58
double fdk2gen
distance from decay to ray origin
Definition: MCFlux.h:103
double fnenergyf
Definition: MCFlux.h:47
double fnwtnear
Definition: MCFlux.h:44
int fptype
Definition: MCFlux.h:63
int fndecay
Definition: MCFlux.h:50
double fpdpz
Definition: MCFlux.h:57
double fmuparpz
Definition: MCFlux.h:69
int fevtno
Definition: MCFlux.h:36
double fppdydz
Definition: MCFlux.h:59
double ftpz
Definition: MCFlux.h:81
double fpdpy
Definition: MCFlux.h:56
double fvy
Definition: MCFlux.h:53
double fmupare
Definition: MCFlux.h:70
int fntype
Definition: MCFlux.h:51
double fnecm
Definition: MCFlux.h:71
double fmuparpy
Definition: MCFlux.h:68
double fpppz
Definition: MCFlux.h:60
double ftpy
Definition: MCFlux.h:80
double fvz
Definition: MCFlux.h:54
double fmuparpx
Definition: MCFlux.h:67
double fnenergyn
Definition: MCFlux.h:43
double fnimpwt
Definition: MCFlux.h:72

Variable Documentation

constexpr GeneratedParticleIndex_t simb::NoGeneratedParticleIndex = std::numeric_limits<GeneratedParticleIndex_t>::max()

Constant representing the absence of generator truth information.

Definition at line 34 of file simb.h.

Referenced by isGeneratedParticleIndex().