32 #include "art_root_io/TFileService.h" 35 #include "artg4tk/pluginDetectors/gdml/myInteractionArtHitData.hh" 42 class CheckProtonProduction;
49 void beginRun(
const art::Run& Run)
override;
50 void endJob()
override;
94 , fNThetaBinsFW(p.
get<int>(
"ThetaBinsFW", 4))
95 , fThetaMinFW(p.
get<double>(
"ThetaMinFW", 0.05))
96 , fDeltaThetaFW(p.
get<double>(
"DeltaThetaFW", 0.05))
97 , fNThetaBinsLA(p.
get<int>(
"ThetaBinsLA", 9))
98 , fThetaMinLA(p.
get<double>(
"ThetaMinLA", 0.35))
99 , fDeltaThetaLA(p.
get<double>(
"DeltaThetaLA", 0.2))
102 , _fHistoSecPkinE54(0)
103 , _fHistoSecPkinE68(0)
104 , _fHistoSecPkinE90(0)
105 , _fHistoSecPkinE121(0)
106 , _fHistoSecPkinE164(0)
108 , _fHistoSecPTheta(0)
110 , _fHistoSecDkinE54(0)
111 , _fHistoSecDkinE68(0)
112 , _fHistoSecDkinE90(0)
113 , _fHistoSecDkinE121(0)
114 , _fHistoSecDkinE164(0)
116 , _fHistoSecDTheta(0)
118 , _fHistoSecTkinE54(0)
119 , _fHistoSecTkinE68(0)
120 , _fHistoSecTkinE90(0)
121 , _fHistoSecTkinE121(0)
122 , _fHistoSecTkinE164(0)
124 , _fHistoSecTTheta(0)
137 _fHistoNSec = tfs->make<TH1F>(
"NSec",
"neutron + Cu", 100, 0., 100.);
140 tfs->make<TH1F>(
"pmomentum",
"neutron + Cu momentum of secondary protons", 100, 0., 600);
142 "pkinE54",
"neutron + Cu kinetic Energy of secondary protons (54)", 100, 0., 400.);
144 "pkinE68",
"neutron + Cu kinetis Energy of secondary protons (68)", 100, 0., 400.);
146 "pkinE90",
"neutron + Cu kinetic Energy of secondary protons (90)", 100, 0., 400.);
148 "pkinE121",
"neutron + Cu kinetic Energy of secondary protons (121)", 100, 0., 400);
150 "pkinE164",
"neutron + Cu kinetic Energy of secondary protons (168)", 100, 0., 400.);
152 tfs->make<TH1F>(
"pkinE",
"neutron + Cu kinetic Energy of secondary protons", 100, 0., 400.);
154 tfs->make<TH1F>(
"ptheta",
"neutron + Cu kin. theta of secondary protons", 100, 0., 3.2);
157 tfs->make<TH1F>(
"dmomentum",
"neutron + Cu momentum of secondary deuterons", 100, 0., 600);
159 "dkinE54",
"neutron + Cu kinetic Energy of secondary deuterons (54)", 100, 0., 400.);
161 "dkinE68",
"neutron + Cu kinetis Energy of secondary deuterons (68)", 100, 0., 400.);
163 "dkinE90",
"neutron + Cu kinetic Energy of secondary deuterons (90)", 100, 0., 400.);
165 "dkinE121",
"neutron + Cu kinetic Energy of secondary deuterons (121)", 100, 0., 400);
167 "dkinE164",
"neutron + Cu kinetic Energy of secondary deuterons (168)", 100, 0., 400.);
169 tfs->make<TH1F>(
"dkinE",
"neutron + Cu kinetic Energy of secondary deuterons", 100, 0., 400.);
171 tfs->make<TH1F>(
"dtheta",
"neutron + Cu kin. theta of secondary deuterons", 100, 0., 3.2);
174 tfs->make<TH1F>(
"tmomentum",
"neutron + Cu momentum of secondary tritons", 100, 0., 600);
176 "tkinE54",
"neutron + Cu kinetic Energy of secondary tritons (54)", 100, 0., 400.);
178 "tkinE68",
"neutron + Cu kinetis Energy of secondary tritons (68)", 100, 0., 400.);
180 "tkinE90",
"neutron + Cu kinetic Energy of secondary tritons (90)", 100, 0., 400.);
182 "tkinE121",
"neutron + Cu kinetic Energy of secondary tritons (121)", 100, 0., 400);
184 "tkinE164",
"neutron + Cu kinetic Energy of secondary tritons (168)", 100, 0., 400.);
186 tfs->make<TH1F>(
"tkinE",
"neutron + Cu kinetic Energy of secondary tritons", 100, 0., 400.);
188 tfs->make<TH1F>(
"ttheta",
"neutron + Cu kin. theta of secondary tritons", 100, 0., 3.2);
192 string ht =
"neutron + Cu";
194 double thetaMin = 0.;
195 double thetaMax = 0.;
196 std::string theta_bin_fw;
197 std::string theta_bin_la;
203 std::ostringstream osTitle1;
204 std::ostringstream osTitle2;
205 std::ostringstream osTitle3;
208 osTitle1 << thetaMin;
209 theta_bin_fw = osTitle1.str() +
" < theta < ";
211 osTitle2 << thetaMax;
212 theta_bin_fw += osTitle2.str();
213 theta_bin_fw +=
"(rad)";
218 htitle = ht +
" -> X + proton, " + theta_bin_fw;
219 hname =
"proton_fw_" + osTitle3.str();
220 TH1D* histo = tfs->make<TH1D>(hname.c_str(), htitle.c_str(), 80, 0., 8.0);
229 typedef std::vector<art::Handle<myInteractionArtHitDataCollection>> HandleVector;
230 auto allSims =
event.getMany<myInteractionArtHitDataCollection>();
233 const myInteractionArtHitDataCollection& sims(**i);
234 if (sims.size() > 0) {
238 const myInteractionArtHitData&
hit = *j;
239 if (hit.pname ==
"proton") {
241 double angle = hit.theta * 57.29577951;
242 if (fabs(angle - 54.) < 2.)
244 if (fabs(angle - 68.) < 2.)
246 if (fabs(angle - 90.) < 2.)
248 if (fabs(angle - 121.) < 2.)
250 if (fabs(angle - 164.) < 2.)
254 }
else if (hit.pname ==
"deuteron") {
256 double angle = hit.theta * 57.29577951;
257 if (fabs(angle - 54.) < 2.)
259 if (fabs(angle - 68.) < 2.)
261 if (fabs(angle - 90.) < 2.)
263 if (fabs(angle - 121.) < 2.)
265 if (fabs(angle - 164.) < 2.)
269 }
else if (hit.pname ==
"triton") {
271 double angle = hit.theta * 57.29577951;
272 if (fabs(angle - 54.) < 2.)
274 if (fabs(angle - 68.) < 2.)
276 if (fabs(angle - 90.) < 2.)
278 if (fabs(angle - 121.) < 2.)
280 if (fabs(angle - 164.) < 2.)
293 cout <<
" ********************************CheckProtonProduction: now normalizing the histos "
TH1F * _fHistoSecDkinE164
std::vector< TH1D * > fHistoSecProtonFW
void analyze(const art::Event &event) override
TH1F * _fHistoSecPkinE121
CheckProtonProduction(fhicl::ParameterSet const &p)
#define DEFINE_ART_MODULE(klass)
TH1F * _fHistoSecTkinE121
void beginRun(const art::Run &Run) override
TH1F * _fHistoSecDkinE121
Detector simulation of raw signals on wires.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
TH1F * _fHistoSecPkinE164
Timestamp const & beginTime() const
Event finding and building.
TH1F * _fHistoSecTkinE164