37 std::cerr <<
"WARNING(MillG4Tree::MillTrees): " 38 <<
"trying to mill trees that have not been verified" 61 for(
size_t isim=0; isim<
fG4In->
NSim(); isim++){
69 for(
size_t i=0; i<2; i++){
80 fX ->push_back(posenter->at(ireg)->X());
81 fY ->push_back(posenter->at(ireg)->Y());
82 fZ ->push_back(posenter->at(ireg)->Z());
83 fT ->push_back(posenter->at(ireg)->T());
84 fPx ->push_back(momenter->at(ireg)->Px());
85 fPy ->push_back(momenter->at(ireg)->Py());
86 fPz ->push_back(momenter->at(ireg)->Pz());
87 fE ->push_back(momenter->at(ireg)->E());
90 fX ->push_back(posexit->at(ireg)->X());
91 fY ->push_back(posexit->at(ireg)->Y());
92 fZ ->push_back(posexit->at(ireg)->Z());
93 fT ->push_back(posexit->at(ireg)->T());
94 fPx ->push_back(momexit->at(ireg)->Px());
95 fPy ->push_back(momexit->at(ireg)->Py());
96 fPz ->push_back(momexit->at(ireg)->Pz());
97 fE ->push_back(momexit->at(ireg)->E());
121 std::cout <<
"got ObjArray of branches from fTreeIn" <<
std::endl;
123 if(!branches || branches->GetEntries()==0 )
126 catch(TObjArray* branches){
127 std::cerr <<
"ERROR(MillG4Tree::VerifyBranches): no branches found in passed input tree" 133 std::cout <<
"WARNING(MillG4Tree::VerifyBranches): Mismatch in number of branches (expected " 134 <<
nameToG4Branch.size() <<
" but found " << branches->GetEntriesFast()
137 std::cout <<
"found genTree with " << branches->GetEntriesFast() <<
" branches" <<
std::endl;
140 TIter next(branches);
141 TBranch* branch =
nullptr;
142 while( (branch=(TBranch*)next())) {
147 std::cout <<
" chopping branch '" << branch->GetFullName() <<
"'" <<
std::endl;
161 std::cout <<
"WARNING(MillG4Tree): ignoring unknown branch '" 162 << branch->GetFullName() <<
"'" <<
std::endl;
vector< Int_t > * fTrkID
particle's G4 trackID
const int ParentPDG(const UInt_t &iparticle) const override
parent particle's PDG code
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 UInt_t NSim() const override
number of particles
const int ParentTrackID(const UInt_t &iparticle) const override
G4 track ID of parent particle.
bool VerifyBranches() override
const UInt_t NPoints(const UInt_t &iparticle) const override
number of G4 steps (i.e. trajectory points)
TTree * fTreeIn
pointer to the analyzed TTree or TChain
vector< UInt_t > * fNPts
number of 4-vector "snapshots" (G4 steps)
std::string CharStarToString(const char *cstr)
const vector< const TLorentzVector * > * SimMomEnter(const UInt_t &iparticle) const override
particle 4-momentum at entry point, all regions
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 ProcessF(const UInt_t &iparticle) const override
code for process that killed this one
void MillTrees() override
const vector< const TLorentzVector * > * SimMomExit(const UInt_t &iparticle) const override
particle 4-momentum at exit point, all regions
const UInt_t NRegions(const UInt_t &iparticle) const override
number of regions traversed by particle
vector< Int_t > * fProgenitorPdg
FS particle from gen stage that led to this one.
vector< Int_t > * fParentTrackId
particle's parent's trackID
UInt_t fNSim
number of G4 particles per event
const Int_t ProcessI(const UInt_t &iparticle) const override
code for process that created this one
vector< Float_t > * fY
particle's y-position in lab frame [cm]
const Int_t PDG(const UInt_t &iparticle) const override
particle PDG code
const vector< const TLorentzVector * > * SimPosEnter(const UInt_t &iparticle) const override
particle 4-position at entry point, all regions
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]
vector< Int_t > * fProcessF
process that killed the particle
const TObjArray * GetBranchList() const
std::map< std::string, G4Branch > nameToG4Branch
std::map< G4Branch, bool > branchToDrawOpt
vector< Int_t > * fProgenitorTrackId
FS particle from gen stage that led to this one.
vector< Int_t > * fPDG
particle's PDG code
const int TrackID(const UInt_t &iparticle) const override
G4 track ID (can be <0 if it fell below trking threshold)
UInt_t const GetTruthIndex(UInt_t iparticle) const
index in gen tree subentry to truth match to this
const vector< const TLorentzVector * > * SimPosExit(const UInt_t &iparticle) const override
particle 4-position at exit point, all regions
const int ProgenitorTrackID(const UInt_t &iparticle) const override
G4 track ID of primary that led this one.
const int ProgenitorPDG(const UInt_t &iparticle) const override
PDG of primary that led this one.
virtual void GetEntry(const UInt_t &ientry)
Int_t fEvent
event number for tree entry
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