7 #ifndef GAR_ROSIM_RAWDIGITANA 8 #define GAR_ROSIM_RAWDIGITANA 17 #include "art_root_io/TFileService.h" 18 #include "art_root_io/TFileDirectory.h" 21 #include "canvas/Persistency/Common/FindMany.h" 23 #include "cetlib_except/exception.h" 26 #include "MCCheater/BackTracker.h" 27 #include "nug4/ParticleNavigation/ParticleList.h" 31 #include "CoreUtils/ServiceUtil.h" 119 fChannelTree = tfs->make<TTree>(
"ChannelTree",
"ChannelTree");
125 description =
"trackID/I:pdg/I:x/F:y/F:z/F:e/F:dX/F:t/F";
129 description =
"channel/I:x/F:y/F:z/F";
152 auto bt = gar::providerFrom<cheat::BackTracker>();
157 if( digCol.failedToGet() ){
159 <<
"failed to get raw digits, bail";
166 if( !fmEnergyDep.isValid() ){
168 <<
"Unable to find valid association between RawDigits and " 169 <<
"energy deposits, no analysis in this module is possible";
174 auto geo = gar::providerFrom<geo::GeometryGAr>();
177 float xyzChan[3] = {0.};
178 unsigned int chan = 0;
180 for(
size_t d = 0;
d < digCol->size(); ++
d){
181 std::vector<const gar::sdp::EnergyDeposit*> edepsCol;
182 fmEnergyDep.get(
d, edepsCol);
183 if(edepsCol.size() < 1)
continue;
188 <<
" energy depositions for channel " 189 << (*digCol)[
d].Channel();
191 geo->ChannelToPosition((*digCol)[
d].Channel(), xyz);
200 for(
auto edep : edepsCol){
203 auto part =
bt->TrackIDToParticle(edep->TrackID());
233 chan =
geo->NearestChannel(xyz);
234 if (chan !=
geo->GapChannelNumber())
236 geo->ChannelToPosition(chan, xyzChan);
293 #endif // GAR_ROSIM_RAWDIGITANA def analyze(root, level, gtrees, gbranches, doprint)
void reconfigure(fhicl::ParameterSet const &pset)
std::string fReadoutModuleLabel
module label for the Geant
EventInfo fEvt
Struct containing event identification.
ChannelInfo fChannelInfo
Struct containing channel info.
EnergyDep fEDep
Struct containing energy deposition info.
#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.
General GArSoft Utilities.
#define MF_LOG_VERBATIM(category)
#define MF_LOG_WARNING(category)
LArSoft geometry interface.
art framework interface to geometry description
void analyze(const ::art::Event &evt)
TTree * fChannelTree
Tree to keep track of sanity check info.