25 std::cout <<
"constructed FlatG4Tree object in read-only mode" <<
std::endl;
29 std::cout <<
"constructed FlatG4Tree object in write mode" <<
std::endl;
49 std::cout <<
"FlatG4Tree SetBranchAddresses()" <<
std::endl;
110 fNPts =
new vector<UInt_t>();
111 fTrkID =
new vector<Int_t>();
112 fPDG =
new vector<Int_t>();
119 fX =
new vector<Float_t>();
120 fY =
new vector<Float_t>();
121 fZ =
new vector<Float_t>();
122 fT =
new vector<Float_t>();
123 fPx =
new vector<Float_t>();
124 fPy =
new vector<Float_t>();
125 fPz =
new vector<Float_t>();
126 fE =
new vector<Float_t>();
157 return fNPts->at(iparticle);
161 if(
fParentPdg->at(iparticle)==INT_MAX)
return true;
166 return fPDG->at(iparticle);
180 auto v =
new vector<const TLorentzVector*>();
184 size_t ireg_max = ireg+2*
fNRegions->at(iparticle);
188 for(; ireg<ireg_max; ireg+=2){
189 v->push_back(
new TLorentzVector(
fPx->at(ireg),
fPy->at(ireg),
190 fPz->at(ireg),
fE->at(ireg)));
198 auto v =
new vector<const TLorentzVector*>();
202 const size_t ireg_max = ireg-1 + 2*
fNRegions->at(iparticle);
206 for(; ireg<ireg_max; ireg+=2){
207 v->push_back(
new TLorentzVector(
fPx->at(ireg),
fPy->at(ireg),
208 fPz->at(ireg),
fE->at(ireg)));
216 auto v =
new vector<const TLorentzVector*>();
220 size_t ireg_max = ireg+2*
fNRegions->at(iparticle);
224 for(; ireg<ireg_max; ireg+=2){
225 v->push_back(
new TLorentzVector(
fX->at(ireg),
fY->at(ireg),
226 fZ->at(ireg),
fT->at(ireg)));
234 auto v =
new vector<const TLorentzVector*>();
238 size_t ireg_max = ireg-1 + 2*
fNRegions->at(iparticle);
242 for(; ireg<ireg_max; ireg+=2){
243 v->push_back(
new TLorentzVector(
fX->at(ireg),
fY->at(ireg),
244 fZ->at(ireg),
fT->at(ireg)));
251 return new TLorentzVector(
fPx->at(index),
fPy->at(index),
fPz->at(index),
fE->at(index));
256 return new TLorentzVector(
fPx->at(index),
fPy->at(index),
fPz->at(index),
fE->at(index));
261 return new TLorentzVector(
fX->at(index),
fY->at(index),
fZ->at(index),
fT->at(index));
265 return new TLorentzVector(
fX->at(index),
fY->at(index),
fZ->at(index),
fT->at(index));
303 int trkid = -1;
fTrkID->at(0);
vector< Int_t > * fTrkID
particle's G4 trackID
const UInt_t LocalToGlobalIndex(const UInt_t &iparticle) const
const Int_t ProcessI(const UInt_t &iparticle) const override
code for process that created this one
TBranch * b_ProgenitorTrackId
const UInt_t NSim() const override
number of particles
vector< Int_t > * fParentPdg
particle parent's PDG code
vector< Float_t > * fPy
particle's y-momentum in lab frame [GeV/c]
vector< Int_t > * fProcessI
process that produced the particle
const vector< const TLorentzVector * > * SimPosEnter(const UInt_t &iparticle) const override
particle 4-position at entry point, all regions
vector< Int_t > * fRegions
region IDs
TBranch * b_ParentTrackId
const Int_t ProcessF(const UInt_t &iparticle) const override
code for process that killed this one
const UInt_t NRegions(const UInt_t &iparticle) const override
number of regions traversed by particle
const int ParentTrackID(const UInt_t &iparticle) const override
G4 track ID of parent particle.
vector< UInt_t > * fNRegions
number of regions of interest cross by the particle
TTree * fTreeIn
pointer to the analyzed TTree or TChain
vector< UInt_t > * fNPts
number of 4-vector "snapshots" (G4 steps)
TBranch * b_ProgenitorPdg
const int TrackID(const UInt_t &iparticle) const override
G4 track ID (can be <0 if it fell below trking threshold)
const UInt_t NSubEntries() const
const int ProgenitorPDG(const UInt_t &iparticle) const override
PDG of primary that led this one.
const vector< const TLorentzVector * > * SimMomExit(const UInt_t &iparticle) const override
particle 4-momentum at exit point, all regions
const int ParentPDG(const UInt_t &iparticle) const override
parent particle's PDG code
const vector< const TLorentzVector * > * SimMomEnter(const UInt_t &iparticle) const override
particle 4-momentum at entry point, all regions
const Int_t Region(const UInt_t &iparticle, const UInt_t &iregion) const override
region number
vector< UInt_t > * fG4TruthIndex
vector< Float_t > * fE
particle's total energy in lab frame [GeV]
vector< Float_t > * fT
particle's time in lab frame [ns]
const Int_t PDG(const UInt_t &iparticle) const override
particle PDG code
vector< Int_t > * fProgenitorPdg
FS particle from gen stage that led to this one.
vector< Int_t > * fParentTrackId
particle's parent's trackID
const vector< const TLorentzVector * > * SimPosExit(const UInt_t &iparticle) const override
particle 4-position at exit point, all regions
UInt_t fNSim
number of G4 particles per event
void SetupRead(TTree *tree)
vector< Float_t > * fY
particle's y-position in lab frame [cm]
vector< Float_t > * fZ
particle's z-position in lab frame [cm]
vector< Float_t > * fPz
particle's z-momentum in lab frame [GeV/c]
void GetEntry(const UInt_t &ientry) override
const int ProgenitorTrackID(const UInt_t &iparticle) const override
G4 track ID of primary that led this one.
vector< Int_t > * fProcessF
process that killed the particle
std::map< UInt_t, UInt_t > fLocalToGlobalIndex
vector< Int_t > * fProgenitorTrackId
FS particle from gen stage that led to this one.
const UInt_t NPoints(const UInt_t &iparticle) const override
number of G4 steps (i.e. trajectory points)
vector< Int_t > * fPDG
particle's PDG code
Int_t fEvent
event number for tree entry
const bool IsPrimary(const UInt_t &iparticle) const override
did particle come from generator?
vector< Float_t > * fPx
particle's x-momentum in lab frame [GeV/c]
QTextStream & endl(QTextStream &s)
vector< Float_t > * fX
particle's x-position in lab frame [cm]
bool SetBranchAddresses() override