LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
GTruth.cxx
Go to the documentation of this file.
1 
9 
11 
12 #include <vector>
13 #include <iostream>
14 #include <string>
15 #include <sstream> // for ostringstream
16 #include <iomanip>
17 
18 namespace simb {
19 
20  //---------------------------------------------------------------
22  : fGint(-1)
23  , fGscatter(-1)
24  , fGPhaseSpace(-1)
25  , fweight(0)
26  , fprobability(0)
27  , fXsec(0)
28  , fDiffXsec(0)
29  , fNumPiPlus(-1)
30  , fNumPiMinus(-1)
31  , fNumPi0(-1)
32  , fNumProton(-1)
33  , fNumNeutron(-1)
34  , fIsCharm(false)
35  , fResNum(-1)
36  , fgQ2(kUndefinedValue)
37  , fgq2(kUndefinedValue)
38  , fgW(kUndefinedValue)
39  , fgT(kUndefinedValue)
40  , fgX(kUndefinedValue)
41  , fgY(kUndefinedValue)
42  , fIsSeaQuark(false)
43  , ftgtZ(0)
44  , ftgtA(0)
45  , ftgtPDG(0)
46  , fProbePDG(-1)
47  {
48  fFShadSystP4.SetXYZT(0, 0, 0, 0);
49  fHitNucP4.SetXYZT(0, 0, 0, 0);
50  fProbeP4.SetXYZT(0, 0, 0, 0);
51  fVertex.SetXYZT(0, 0, 0, 0);
52  }
53 
54  namespace gtruthaux {
55  std::string stringifyTLorentzVector(const TLorentzVector& tv4) {
56  std::ostringstream s;
57  s << "[ "
58  << std::setw(11) << tv4.X() << " "
59  << std::setw(11) << tv4.Y() << " "
60  << std::setw(11) << tv4.Z() << " "
61  << std::setw(11) << tv4.T() << " ]";
62  return s.str();
63  }
64  }
65  //......................................................................
66  std::ostream& operator<< (std::ostream& output, const simb::GTruth &gtruth)
67  {
68  output
69  << "GTruth:" << std::endl
70  // 123456789012
71  << " Gint " << std::setw(11) << gtruth.fGint << " "
72  << " Gscatter " << std::setw(11) << gtruth.fGscatter << " "
73  << " GPhaseSpace " << std::setw(9) << gtruth.fGPhaseSpace << std::endl
74  << " weight " << std::setw(11) << gtruth.fweight << " "
75  << " prob " << std::setw(11) << gtruth.fprobability << std::endl
76  << " Xsec " << std::setw(11) << gtruth.fXsec << " "
77  << " DiffXsec " << std::setw(11) << gtruth.fDiffXsec << std::endl
78  << " Npi(+,-,0)" << std::setw(4) << gtruth.fNumPiPlus << " "
79  << std::setw(4) << gtruth.fNumPiMinus << " "
80  << std::setw(4) << gtruth.fNumPi0 << " "
81  << " Np Nn " << std::setw(4) << gtruth.fNumProton << " "
82  << std::setw(4) << gtruth.fNumNeutron << std::endl
83  << " IsCharm " << std::setw(4) << ((gtruth.fIsCharm)?"yes":"no") << " "
84  << " ResNum " << std::setw(4) << gtruth.fResNum << std::endl
85  << " Q2 q2 " << std::setw(11) << gtruth.fgQ2 << " "
86  << std::setw(11) << gtruth.fgq2 << std::endl
87  << " W T " << std::setw(11) << gtruth.fgW << " "
88  << std::setw(11) << gtruth.fgT << std::endl
89  << " X Y " << std::setw(11) << gtruth.fgX << " "
90  << std::setw(11) << gtruth.fgY << std::endl
91  << " IsSeaQuark " << std::setw(4) << ((gtruth.fIsSeaQuark)?"yes":"no") << std::endl
92  << " Z A PDG " << std::setw(4) << gtruth.ftgtZ << " "
93  << std::setw(4) << gtruth.ftgtA << " "
94  << std::setw(11) << gtruth.ftgtPDG << " "
95  << " probe " << std::setw(11) << gtruth.fProbePDG << std::endl
96  << " FShadSyst " << gtruthaux::stringifyTLorentzVector(gtruth.fFShadSystP4) << std::endl
97  << " HitNucP4 " << gtruthaux::stringifyTLorentzVector(gtruth.fHitNucP4) << std::endl
98  << " ProbeP4 " << gtruthaux::stringifyTLorentzVector(gtruth.fProbeP4) << std::endl
99  << " Vertex " << gtruthaux::stringifyTLorentzVector(gtruth.fVertex) << std::endl;
100 
101  return output;
102  }
103 
104 } // namespace simb
double fgW
Definition: GTruth.h:48
int fGint
interaction code
Definition: GTruth.h:25
Float_t s
Definition: plot.C:23
double fgq2
Definition: GTruth.h:47
friend std::ostream & operator<<(std::ostream &output, const simb::GTruth &gtruth)
Definition: GTruth.cxx:66
double fgX
Definition: GTruth.h:50
int ftgtA
Definition: GTruth.h:58
int fGPhaseSpace
phase space system of DiffXSec
Definition: GTruth.h:27
int fNumNeutron
number of neutrons after reaction, before FSI
Definition: GTruth.h:40
int ftgtZ
Definition: GTruth.h:57
double fXsec
cross section of interaction
Definition: GTruth.h:32
int fNumPiPlus
number of pi pluses after reaction, before FSI
Definition: GTruth.h:36
int fNumPiMinus
number of pi minuses after reaction, before FSI
Definition: GTruth.h:37
TLorentzVector fProbeP4
Definition: GTruth.h:63
int fResNum
resonance number
Definition: GTruth.h:42
int fNumProton
number of protons after reaction, before FSI
Definition: GTruth.h:39
double fprobability
interaction probability
Definition: GTruth.h:31
int fProbePDG
Definition: GTruth.h:62
std::string stringifyTLorentzVector(const TLorentzVector &tv4)
Definition: GTruth.cxx:55
int fGscatter
neutrino scattering code
Definition: GTruth.h:26
int fNumPi0
number of pi0 after reaction, before FSI
Definition: GTruth.h:38
bool fIsCharm
did the interaction produce a charmed hadron?
Definition: GTruth.h:41
double fweight
event interaction weight (genie internal)
Definition: GTruth.h:30
TLorentzVector fHitNucP4
Definition: GTruth.h:56
Framework includes.
int ftgtPDG
PDG of Target Nucleus, nucleon only if free.
Definition: GTruth.h:59
double fgQ2
< these are for the internal (on shell) genie kinematics
Definition: GTruth.h:46
TLorentzVector fFShadSystP4
Definition: GTruth.h:52
double fgT
Definition: GTruth.h:49
bool fIsSeaQuark
Definition: GTruth.h:55
TLorentzVector fVertex
Definition: GTruth.h:64
double fgY
Definition: GTruth.h:51
double fDiffXsec
differential cross section of interaction
Definition: GTruth.h:33