7 #ifndef GARG4GArG4ANA_H 8 #define GARG4GArG4ANA_H 17 #include "art_root_io/TFileService.h" 18 #include "art_root_io/TFileDirectory.h" 22 #include "cetlib_except/exception.h" 25 #include "nug4/ParticleNavigation/ParticleList.h" 28 #include "MCCheater/BackTracker.h" 31 #include "CoreUtils/ServiceUtil.h" 123 fEDepTree = tfs->make<TTree>(
"EDepTree",
"EDepTree" );
124 fParticleTree = tfs->make<TTree>(
"ParticleTree",
"ParicleTree");
129 fParticleTree->Branch(
"info", &
fEvt, description.c_str());
131 description =
"trackID/I:pdg/I:x/F:y/F:z/F:e/F:dX/F:t/F";
135 description =
"trackID/I:pdg/I:length/F:energy/F";
137 fParticleTree->Branch(
"part", &
fPartInfo, description.c_str());
162 auto edepsCol = evt.getValidHandle<std::vector<gar::sdp::EnergyDeposit> >(
fG4ModuleLabel);
164 if( edepsCol.failedToGet() ){
166 <<
"failed to get energy depositions, bail";
170 sim::ParticleList* pList = bt->GetParticleList();
173 for (; itr!=pList->end(); ++itr) {
174 auto part = itr->second;
175 if( !part )
continue;
189 << part->NumberTrajectoryPoints()
191 << part->Trajectory().TotalLength();
197 for(
auto edep : *edepsCol){
200 auto part = bt->TrackIDToParticle(edep.TrackID());
243 #endif // GARG4GARG4H def analyze(root, level, gtrees, gbranches, doprint)
void analyze(const ::art::Event &evt)
TTree * fEDepTree
Tree to keep track of sanity check info.
EnergyDep fEDep
Struct containing energy deposition info.
ParticleInfo fPartInfo
Struct containing particle info.
std::string fTruthModuleLabel
module label for the Geant
#define DEFINE_ART_MODULE(klass)
virtual void reconfigure(fhicl::ParameterSet const &pset)
T get(std::string const &key) const
Code to link reconstructed objects back to the MC truth information.
Base utilities and modules for event generation and detector simulation.
std::string fG4ModuleLabel
module label for the Geant
void reconfigure(fhicl::ParameterSet const &pset)
General GArSoft Utilities.
#define MF_LOG_VERBATIM(category)
art framework interface to geometry description
TTree * fParticleTree
Tree to keep track of sanity check info.
EventInfo fEvt
Struct containing event identification.