26 #include "art_root_io/TFileService.h" 29 #include "artg4tk/pluginDetectors/gdml/ByParticle.hh" 30 #include "artg4tk/pluginDetectors/gdml/CalorimeterHit.hh" 31 #include "artg4tk/pluginDetectors/gdml/DRCalorimeterHit.hh" 37 #include "CLHEP/Units/SystemOfUnits.h" 74 _hnHits = tfs->make<TH1F>(
"hnHits",
"Number of CaloArtHits", 100, 0., 20000.);
75 _hEdep = tfs->make<TH1F>(
"hEdep",
"total Energy deposition in CaloArtHits", 100, 0., 15.);
76 _hnDRHits = tfs->make<TH1F>(
"hnDRHits",
"Number of DRCaloArtHits", 100, 0., 20000.);
77 _hDREdep = tfs->make<TH1F>(
"hDREdep",
"total Energy deposition in DRCaloArtHits", 100, 0., 11.);
79 "hNCeren",
"total number of Cerenkov Photons in DRCaloArtHits", 100, 0., 1000000.);
85 typedef std::vector<art::Handle<CalorimeterHitCollection>> HandleVector;
86 auto allSims =
event.getMany<CalorimeterHitCollection>();
88 cout <<
"CheckHits Event: " <<
event.event() <<
" Nr of CaloHit collections: " << allSims.size()
91 const CalorimeterHitCollection& sims(**i);
92 cout <<
"CaloHit collection size: " << sims.size() << endl;
96 const CalorimeterHit&
hit = *j;
97 sumE = sumE + hit.GetEdep();
99 _hEdep->Fill(sumE / CLHEP::GeV);
101 typedef std::vector<art::Handle<DRCalorimeterHitCollection>> DRHandleVector;
102 auto allDRSims =
event.getMany<DRCalorimeterHitCollection>();
103 cout <<
"Event: " <<
event.event() <<
" Nr of DRCaloHit collections: " << allDRSims.size()
106 const DRCalorimeterHitCollection& DRsims(**i);
107 cout <<
"DRCaloHit collection size: " << DRsims.size() << endl;
109 double sumNCeren = 0.0;
112 const DRCalorimeterHit&
hit = *j;
113 sumDRE = sumDRE + hit.GetEdep();
114 sumNCeren = sumNCeren + hit.GetNceren();
116 _hDREdep->Fill(sumDRE / CLHEP::GeV);
119 typedef std::vector<art::Handle<ByParticle>> EdepHandleVector;
120 auto allEdeps =
event.getMany<ByParticle>();
123 const ByParticle& Edeps(**i);
124 cout <<
"Edep collection size: " << Edeps.size() << endl;
127 std::cout <<
"Particle: " << it->first <<
" " << it->second <<
" % " << std::endl;
CheckHits(fhicl::ParameterSet const &p)
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
Detector simulation of raw signals on wires.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
void analyze(const art::Event &event) override
Event finding and building.