29 #include "art_root_io/TFileService.h" 32 #include "artg4tk/pluginDetectors/gdml/PhotonHit.hh" 39 class CheckPhotonHits;
46 void endJob()
override;
54 :
art::EDAnalyzer(p), _ntuple(0)
61 _ntuple = tfs->make<TNtuple>(
"ntuple",
" ntuple",
"Event:Section:ID:NPhotons");
67 typedef std::vector<art::Handle<PhotonHitCollection>> HandleVector;
68 std::map<int, int> photonsperdet;
69 auto allSims =
event.getMany<PhotonHitCollection>();
72 photonsperdet.clear();
73 const PhotonHitCollection& sims(**i);
75 const PhotonHit&
hit = *j;
76 if (photonsperdet.find(hit.GetID()) == photonsperdet.end())
78 photonsperdet.insert(std::make_pair(hit.GetID(), 1));
81 photonsperdet[hit.GetID()]++;
85 while (it != photonsperdet.end()) {
86 std::cout << it->first <<
" :: " << it->second << std::endl;
97 cout <<
" ******************************** CheckPhotonHits: I am done " << endl;
CheckPhotonHits(fhicl::ParameterSet const &p)
#define DEFINE_ART_MODULE(klass)
Detector simulation of raw signals on wires.
void analyze(const art::Event &event) override
Event finding and building.