eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TGRooTrackerVtx.cxx
Go to the documentation of this file.
1 #include <iomanip>
2 #include <iostream>
3 
4 #include "TGRooTrackerVtx.hxx"
5 
6 #include "TND280Log.hxx"
7 
8 //
9 //#define __GROOTRACKER_EVENT_DEBUG__
10 //
11 
12 using std::endl;
13 using std::cout;
14 using std::setw;
15 using std::setprecision;
16 using std::setfill;
17 using std::ios;
18 
19 using namespace ND;
20 
22 
24 
26  if (GeomPath != NULL) {
27  delete GeomPath;
28  GeomPath = NULL;
29  }
30  if (GeneratorName != NULL) {
31  delete GeneratorName;
32  GeneratorName = NULL;
33  }
34  if (EvtCode != NULL) {
35  delete EvtCode;
36  EvtCode = NULL;
37  }
38  if (OrigFileName != NULL) {
39  delete OrigFileName;
40  OrigFileName = NULL;
41  }
42  if (OrigTreeName != NULL) {
43  delete OrigTreeName;
44  OrigTreeName = NULL;
45  }
46 }
47 
49  GeomPath->SetString(event->GeomPath->GetString());
50  GeneratorName->SetString(event->GeneratorName->GetString());
51  EvtCode->SetString(event->EvtCode->GetString());
52  OrigFileName->SetString(event->OrigFileName->GetString());
53  OrigTreeName->SetString(event->OrigTreeName->GetString());
54  ///// *EvtFlags = *(event->EvtFlags);
55 
56  EvtNum = event->EvtNum;
57  EvtXSec = event->EvtXSec;
58  EvtDXSec = event->EvtDXSec;
59  EvtWght = event->EvtWght;
60  EvtProb = event->EvtProb;
61  OrigTreePOT = event->OrigTreePOT;
62  OrigEvtNum = event->OrigEvtNum;
63  OrigTreeEntries = event->OrigTreeEntries;
64  TimeInSpill = event->TimeInSpill;
65 
66  TruthVertexID = event->TruthVertexID;
67 
68  G2NeutEvtCode = event->G2NeutEvtCode;
69 
70  for (int i = 0; i < 4; i++) {
71  EvtVtx[i] = event->EvtVtx[i];
72  }
73 
74  StdHepN = event->StdHepN;
75  // Define the dynamic arrays
76  StdHepPdg = new int[StdHepN];
77  StdHepRescat = new int[StdHepN];
78  StdHepStatus = new int[StdHepN];
79  StdHepFd = new int[StdHepN];
80  StdHepLd = new int[StdHepN];
81  StdHepFm = new int[StdHepN];
82  StdHepLm = new int[StdHepN];
83 
84  for (int i = 0; i < StdHepN; i++) {
85  StdHepPdg[i] = event->StdHepPdgTemp[i];
86  StdHepRescat[i] = event->StdHepRescatTemp[i];
87  StdHepStatus[i] = event->StdHepStatusTemp[i];
88  StdHepFd[i] = event->StdHepFdTemp[i];
89  StdHepLd[i] = event->StdHepLdTemp[i];
90  StdHepFm[i] = event->StdHepFmTemp[i];
91  StdHepLm[i] = event->StdHepLmTemp[i];
92  for (int j = 0; j < 4; j++) {
93  StdHepX4[i][j] = event->StdHepX4[i][j];
94  }
95  for (int j = 0; j < 4; j++) {
96  StdHepP4[i][j] = event->StdHepP4[i][j];
97  }
98  for (int j = 0; j < 3; j++) {
99  StdHepPolz[i][j] = event->StdHepPolz[i][j];
100  }
101  }
102 
103  // Remember to copy the flux info
104  JNuBeamFlux* flux = (JNuBeamFlux*)event;
105  JNuBeamFlux::Copy(flux);
106 }
107 
109  if (GeomPath) GeomPath->SetString("Not-set");
110  if (GeneratorName) GeneratorName->SetString("Not-set");
111  if (EvtCode) EvtCode->SetString("Not-set");
112  if (OrigFileName) OrigFileName->SetString("Not-set");
113  if (OrigTreeName) OrigTreeName->SetString("Not-set");
114 
115  EvtNum = -1;
116  EvtXSec = -1.0;
117  EvtDXSec = -1.0;
118  EvtWght = -1.0;
119  EvtProb = -1.0;
120  OrigTreePOT = -1.0;
121  TimeInSpill = -1.0;
122  OrigEvtNum = -1;
123  OrigTreeEntries = -1;
124 
125  TruthVertexID = -1;
126 
127  for (int i = 0; i < 4; i++) {
128  EvtVtx[i] = 0.0;
129  }
130 
131  StdHepN = 0;
132  for (int i = 0; i < kGStdHepNPmax; i++) {
133  StdHepPdgTemp[i] = -1;
134  StdHepRescatTemp[i] = -999999;
135  StdHepStatusTemp[i] = -1;
136  StdHepFdTemp[i] = -1;
137  StdHepLdTemp[i] = -1;
138  StdHepFmTemp[i] = -1;
139  StdHepLmTemp[i] = -1;
140  for (int j = 0; j < 4; j++) {
141  StdHepX4[i][j] = -999999.;
142  }
143  for (int j = 0; j < 4; j++) {
144  StdHepP4[i][j] = -999999.;
145  }
146  for (int j = 0; j < 3; j++) {
147  StdHepPolz[i][j] = -999999.;
148  }
149  }
150 
151  // Reset the JNuBeam info
153 }
154 
156  GeomPath = new TObjString("");
157  GeneratorName = new TObjString("");
158  EvtCode = new TObjString("");
159  OrigFileName = new TObjString("");
160  OrigTreeName = new TObjString("");
161  this->Reset();
162 }
163 
164 void GRooTrackerVtx::Print(const Option_t* option) const {
165  cout << "\nGRooTrackerMCTruth: " << endl;
166  cout << " --> GeneratorName = " << GeneratorName->GetString() << endl;
167  cout << " --> EvtCode = " << EvtCode->GetString() << endl;
168  cout << " --> GeomPath = " << GeomPath->GetString() << endl;
169  cout << " --> EvtNum = " << EvtNum << endl;
170  cout << " --> EvtXSec = " << EvtXSec << endl;
171  cout << " --> EvtDXSec = " << EvtDXSec << endl;
172  cout << " --> EvtWght = " << EvtWght << endl;
173  cout << " --> EvtProb = " << EvtProb << endl;
174  cout << " --> TruthVertexID = " << TruthVertexID << endl;
175 
176  cout << "GRooTrackerStdHep:" << endl;
177 
178  for (int i = 0; i < StdHepN; i++) {
179  cout << setfill(' ') << setw(4) << i << " -> pdgc: " << setfill(' ')
180  << setw(20) << StdHepPdg[i] << " / rescat: " << setfill(' ') << setw(3)
181  << StdHepRescat[i] << " / ist: " << setfill(' ') << setw(3)
182  << StdHepStatus[i] << " / mom: " << setfill(' ') << setw(3)
183  << StdHepFm[i] << " / daughters: (" << setfill(' ') << setw(3)
184  << StdHepFd[i] << ", " << setfill(' ') << setw(3) << StdHepLd[i]
185  << ") / E = " << setfill(' ') << setw(10) << StdHepP4[i][kGStdHepIdxE]
186  << ", px = " << setfill(' ') << setw(10) << StdHepP4[i][kGStdHepIdxPx]
187  << ", py = " << setfill(' ') << setw(10) << StdHepP4[i][kGStdHepIdxPy]
188  << ", pz = " << setfill(' ') << setw(10) << StdHepP4[i][kGStdHepIdxPz]
189  << endl;
190  }
191 
192  cout << "Jnu-beam pass through info:" << endl;
193  cout << " --> NuParentPdg = " << NuParentPdg << endl;
194  cout << " --> NuParentDecMode = " << NuParentDecMode << endl;
195  cout << " --> NuParentDecP4[4] = " << NuParentDecP4[0] << ", "
196  << NuParentDecP4[1] << ", " << NuParentDecP4[2] << ", "
197  << NuParentDecP4[3] << endl;
198  cout << " --> NuParentDecX4[4] = " << NuParentDecX4[0] << ", "
199  << NuParentDecX4[1] << ", " << NuParentDecX4[2] << ", "
200  << NuParentDecX4[3] << endl;
201  cout << " --> NuParentProP4[4] = " << NuParentProP4[0] << ", "
202  << NuParentProP4[1] << ", " << NuParentProP4[2] << ", "
203  << NuParentProP4[3] << endl;
204  cout << " --> NuParentProX4[4] = " << NuParentProX4[0] << ", "
205  << NuParentProX4[1] << ", " << NuParentProX4[2] << ", "
206  << NuParentProX4[3] << endl;
207  cout << " --> NuFluxEntry = " << NuFluxEntry << endl;
208  cout << " --> NuIdfd = " << NuIdfd << endl;
209  cout << " --> NuCospibm = " << NuCospibm << endl;
210  cout << " --> NuCospi0bm = " << NuCospi0bm << endl;
211  cout << " --> NuGipart = " << NuGipart << endl;
212  cout << " --> NuGamom0 = " << NuGamom0 << endl;
213  cout << " --> NuGpos0[3] = " << NuGpos0[0] << ", " << NuGpos0[1] << ", "
214  << NuGpos0[2] << endl;
215  cout << " --> NuGvec0[3] = " << NuGvec0[0] << ", " << NuGvec0[1] << ", "
216  << NuGvec0[2] << endl;
217 
218  cout << "Pass-through file info:" << endl;
219  cout << " --> OrigFileName = " << OrigFileName->GetString() << endl;
220  cout << " --> OrigTreeName = " << OrigTreeName->GetString() << endl;
221  cout << " --> OrigEvtNum = " << OrigEvtNum << endl;
222  cout << " --> TimeInSpill = " << TimeInSpill << endl;
223  cout << " --> OrigTreeEntries = " << OrigTreeEntries << endl;
224  cout << " --> OrigTreePOT = " << OrigTreePOT << endl;
225 }
int StdHepLmTemp[kGStdHepNPmax]
int * StdHepFd
first daughter.
int * StdHepStatus
generator-specific status code
float NuGpos0[3]
primary particle starting point
double NuParentProP4[4]
parent hadron 4-momentum at production
int * StdHepLd
last daughter
int EvtNum
event num.
double EvtVtx[4]
event vertex position in detector coord syst (SI)
const int kGStdHepIdxE
ClassImp(ND::TBeamSummaryDataModule::TBeamSummaryData)
double StdHepP4[kGStdHepNPmax][4]
4-p (px,py,pz,E) of particle in LAB frame (GeV)
int NuParentPdg
parent hadron pdg code
int * StdHepPdg
pdg codes (&amp; generator specific codes for pseudoparticles)
void Reset(void)
int OrigEvtNum
Event number within the gnmc file.
double StdHepPolz[kGStdHepNPmax][3]
polarization vector
float NuCospibm
parent hadron cos(theta) relative to beam at decay
long NuFluxEntry
corresponding entry in orig flux file
int * StdHepLm
last mother
int NuIdfd
Detector ID primary particle information.
float NuGvec0[3]
primary particle direction at starting point
int G2NeutEvtCode
NEUT-like reaction code for the GENIE event.
int StdHepLdTemp[kGStdHepNPmax]
int OrigTreeEntries
Number of entries in the gnmc file.
double EvtWght
weight for that event
int NuGipart
primary particle ID
void Copy(const JNuBeamFlux *flux)
double NuParentDecX4[4]
parent hadron 4-position at decay
double NuParentProX4[4]
parent hadron 4-position at production
int NuParentDecMode
parent hadron decay mode
void Copy(const GRooTrackerVtx *event)
float NuGamom0
momentum of the primary particle at the starting point Interation History Information ...
int StdHepFdTemp[kGStdHepNPmax]
TObjString * GeomPath
Geometry path of where the vertex is.
const int kGStdHepNPmax
double EvtProb
probability for that event (given cross section, pathlengths, etc)
int StdHepStatusTemp[kGStdHepNPmax]
TObjString * EvtCode
generator-specific string with &#39;event code&#39;
const int kGStdHepIdxPy
double StdHepX4[kGStdHepNPmax][4]
4-x (x, y, z, t) of particle in hit nucleus frame (fm)
int StdHepFmTemp[kGStdHepNPmax]
void Print(const Option_t *option="") const
double EvtXSec
cross section for selected event (1E-38 cm2)
float NuCospi0bm
parent hadron cos(theta) relative to beam at production
const int kGStdHepIdxPx
double TimeInSpill
Time of the vertex, relative to spill time.
const int kGStdHepIdxPz
double EvtDXSec
cross section for selected event kinematics (1E-38 cm2{K^n})
double OrigTreePOT
Number of POT in the gnmc file.
int StdHepN
number of particles in particle array stdhep-like particle array
TObjString * OrigFileName
Filename of the gnmc file.
TObjString * OrigTreeName
Tree name within the gnmc file.
int StdHepPdgTemp[kGStdHepNPmax]
int * StdHepFm
first mother.
int * StdHepRescat
generator-specific status code
double NuParentDecP4[4]
parent hadron 4-momentum at decay
TObjString * GeneratorName
genie, also gives some of the running options(e.g. filling events with a fixed or meannumber of verti...
int StdHepRescatTemp[kGStdHepNPmax]
int TruthVertexID
A link to the TTruthVertex tree.

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:59 for eventAnalysis by doxygen 1.8.5