31 #include "art_root_io/TFileService.h" 34 #include "artg4tk/pluginDetectors/gdml/myInteractionArtHitData.hh" 41 class CheckInteractions;
48 void beginRun(
const art::Run& Run)
override;
49 void endJob()
override;
70 , fNThetaBinsFW(p.
get<int>(
"ThetaBinsFW", 4))
71 , fThetaMinFW(p.
get<double>(
"ThetaMinFW", 0.05))
72 , fDeltaThetaFW(p.
get<double>(
"DeltaThetaFW", 0.05))
73 , fNThetaBinsLA(p.
get<int>(
"ThetaBinsLA", 9))
74 , fThetaMinLA(p.
get<double>(
"ThetaMinLA", 0.35))
75 , fDeltaThetaLA(p.
get<double>(
"DeltaThetaLA", 0.2))
94 _fHistoNSec = tfs->make<TH1F>(
"NSec",
"proton + Ta", 100, 0., 100.);
95 _hEdep = tfs->make<TH1F>(
"hEdep",
"total Energy deposition in CaloArtHits", 100, 0., 15.);
96 _hnDRHits = tfs->make<TH1F>(
"hnDRHits",
"Number of DRCaloArtHits", 100, 0., 20000.);
97 _hDREdep = tfs->make<TH1F>(
"hDREdep",
"total Energy deposition in DRCaloArtHits", 100, 0., 11.);
99 "hNCeren",
"total number of Cerenkov Photons in DRCaloArtHits", 100, 0., 1000000.);
103 string ht =
"proton + Ta";
105 double thetaMin = 0.;
106 double thetaMax = 0.;
107 std::string theta_bin_fw;
108 std::string theta_bin_la;
114 std::ostringstream osTitle1;
115 std::ostringstream osTitle2;
116 std::ostringstream osTitle3;
119 osTitle1 << thetaMin;
120 theta_bin_fw = osTitle1.str() +
" < theta < ";
122 osTitle2 << thetaMax;
123 theta_bin_fw += osTitle2.str();
124 theta_bin_fw +=
"(rad)";
129 htitle = ht +
" -> X + pi-, " + theta_bin_fw;
130 hname =
"piminus_fw_" + osTitle3.str();
131 TH1D* histo = tfs->make<TH1D>(hname.c_str(), htitle.c_str(), 80, 0., 8.0);
140 typedef std::vector<art::Handle<myInteractionArtHitDataCollection>> HandleVector;
141 auto allSims =
event.getMany<myInteractionArtHitDataCollection>();
143 cout <<
"CheckInteractions Event: " <<
event.event()
144 <<
" Nr of Interaction collections: " << allSims.size() << endl;
147 const myInteractionArtHitDataCollection& sims(**i);
148 cout <<
"InteractionHit collection size: " << sims.size() << endl;
149 if (sims.size() > 0) {
153 const myInteractionArtHitData&
hit = *j;
154 cout <<
"Name: " << hit.pname <<
" Momentum: " << hit.pmom <<
" Theta: " << hit.theta
161 if (hit.pname ==
"pi-") {
173 cout <<
" ********************************CheckInteractions: now normalizing the histos " << endl;
void beginRun(const art::Run &Run) override
CheckInteractions(fhicl::ParameterSet const &p)
std::vector< TH1D * > fHistoSecPiMinusFW
#define DEFINE_ART_MODULE(klass)
void analyze(const art::Event &event) override
Detector simulation of raw signals on wires.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Timestamp const & beginTime() const
Event finding and building.