79 typedef JTriggeredFileScanner<JEvt> JTriggeredFileScanner_t;
80 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
82 JTriggeredFileScanner_t inputFile;
85 size_t numberOfPrefits;
86 JQualitySorter quality_sorter;
87 JAtmosphericMuon atmosphere;
97 JParser<> zap(
"Example program to histogram fit results.");
101 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
107 zap[
'a'] =
make_field(atmosphere) = JAtmosphericMuon(90.0, 90.0);
108 zap[
'O'] =
make_field(option) =
"E",
"N",
"LINE",
"LOGE";
114 catch(
const exception& error) {
115 FATAL(error.what() << endl);
118 cout <<
"APPLICATION " << application << endl;
125 catch(
const JException& error) {
129 const JVolume volume(head, option !=
"LINE");
130 const JPosition3D center = get<JPosition3D>(head);
131 JCylinder3D cylinder = get<JCylinder3D>(head);
133 cylinder.add(center);
135 NOTICE(
"Reposition can [m]: " << cylinder << endl);
137 const double EMIN_GEV = 10e3;
141 TH1D job(
"job", NULL, 100, 0.5, 100.5);
143 TH1D hn(
"hn", NULL, 250, -0.5, 249.5);
144 TH1D hq(
"hq", NULL, 300, 0.0, 600.0);
145 TH1D hi(
"hi", NULL, 101, -0.5, 100.5);
146 TH1D hv(
"hv", NULL, 200, -6.0, 0.0);
147 TH1D h1(
"h1", NULL, 200, -2.0, +2.0);
148 TH1D hc(
"hc", NULL, 200, -1.0, +1.0);
149 TH1D hu(
"hu", NULL, 400, -1.0e3, 1.0e3);
151 TH1D hx(
"hx", NULL, 100, -3.0, +2.3);
152 TH1D hd(
"hd", NULL, 100, 0.0, 10.0);
153 TH1D hz(
"hz", NULL, 100, -200.0, 200.0);
154 TH1D ht(
"ht", NULL, 100, -100.0, 100.0);
156 TH1D e0(
"e0", NULL, 100, volume.getXmin(), volume.getXmax());
157 TH1D e1(
"e1", NULL, 100, volume.getXmin(), volume.getXmax());
158 TH1D e2(
"e2", NULL, 100, volume.getXmin(), volume.getXmax());
159 TH1D er(
"er", NULL, 100, -5.0, +5.0);
161 40, volume.getXmin(), volume.getXmax(),
162 40, volume.getXmin(), volume.getXmax());
164 TH2D hAngle (
"hAngle",
";E_{TRUE};angle [#circ]", 100, volume.getXmin(), volume.getXmax(), 360, 0, 180.0);
166 const Int_t ny = 28800;
167 const Double_t ymin = 0.0;
168 const Double_t ymax = 180.0;
172 if (option.find(
'E') != string::npos) {
174 for (
double x = volume.getXmin(); x <= volume.getXmax(); x += (volume.getXmax() - volume.getXmin()) / 20) {
182 for ( ; x <= 15.5; x += 1.0) { X.push_back(x); }
183 for ( ; x <= 25.5; x += 2.0) { X.push_back(x); }
184 for ( ; x <= 50.5; x += 5.0) { X.push_back(x); }
185 for ( ; x <= 100.5; x += 10.0) { X.push_back(x); }
186 for ( ; x <= 250.5; x += 20.0) { X.push_back(x); }
189 TH2D h2(
"h2", NULL, X.size() - 1, X.data(), ny, ymin, ymax);
190 TProfile he(
"he", NULL, X.size() - 1, X.data());
192 TH2D ha(
"ha", NULL, 100, 0.0, 0.5e6, 100, -100.0, +900.0);
193 TH2D hb(
"hb", NULL, 100, 0.0, 0.5e6, 100, -100.0, +900.0);
195 JQuantile Q(
"Angle",
true);
196 JQuantile O(
"Omega",
true);
199 while (inputFile.hasNext()) {
201 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
203 multi_pointer_type ps = inputFile.next();
209 const JTimeConverter converter(*event, *tev);
225 if (shower->E > Emax) {
229 }
else if(isMuon &&
is_muon(*shower)){
232 if (shower->E > Emax) {
239 if (lepton == event->mc_trks.end()) {
250 if (option.find(
'E') != string::npos)
251 x = volume.getX(event->mc_trks[0].E);
262 JEvt::iterator __end = partition(evt->begin(), evt->end(), JHistory::is_event(application));
264 if (evt->begin() == __end) {
270 if (numberOfPrefits > 0) {
272 JEvt::iterator __q = __end;
274 advance(__end = evt->begin(), min(numberOfPrefits, (
size_t)
distance(evt->begin(), __q)));
276 partial_sort(evt->begin(), __end, __q, quality_sorter);
280 sort(evt->begin(), __end, quality_sorter);
285 JEvt::iterator best = pointing(evt->begin(), __end);
286 const Double_t beta = pointing.getAngle(*best);
287 const double Efit = best->getE();
288 const double Eraw = best->getW(
JENERGY_ENERGY, numeric_limits<double>::min());
289 const double mip = best->getW(
JSTART_NPE_MIP, numeric_limits<double>::max());
295 bool ok = (Efit >= Emin_GeV &&
304 hn.Fill((Double_t) best->getNDF());
305 hq.Fill(best->getQ());
306 hi.Fill((Double_t)
distance(evt->begin(), best));
307 hc.Fill(best->getDZ());
310 (!
has_neutrino(*event) && best->getDZ() >= atmosphere.dot2)) {
311 hu.Fill(atmosphere(evt->begin(), __end));
314 hx.Fill(max(log10(beta), hx.GetXaxis()->GetXmin()));
322 tb.sub(converter.putTime());
326 static_cast<JTrack3D&>(ta).move(ta.getIntersection(tb),
getSpeedOfLight());
327 static_cast<JTrack3D&>(tb).move(tb.getIntersection(ta),
getSpeedOfLight());
329 hd.Fill((tb.getPosition() - ta.getPosition()).getLength());
339 if (cylinder.is_inside(vertex)) {
345 ha.Fill(best->getX()*best->getX() + best->getY()*best->getY(), best->getZ());
346 hz.Fill(tc.getIntersection(vertex));
350 if (best->getE() >= EMIN_GEV) {
351 hb.Fill(best->getX()*best->getX() + best->getY()*best->getY(), best->getZ());
354 ht.Fill(tb.getT() - ta.getT());
356 e0.Fill(volume.getX(Emu,
true));
357 e1.Fill(volume.getX(Eraw,
true));
358 e2.Fill(volume.getX(Efit,
true));
359 er.Fill(volume.getX(Efit) - volume.getX(Emu));
360 ee.Fill(volume.getX(Emu), volume.getX(Efit));
362 hAngle.Fill(Efit, beta);
371 const double npe = best->getW(
JVETO_NPE);
373 const double pv = TMath::PoissonI(count, npe);
375 hv.Fill(max(log10(pv), hv.GetXaxis()->GetXmin()));
384 NOTICE(
"Number of events input " << setw(8) << right << job.GetBinContent(1) << endl);
386 NOTICE(
"Number of events with electron " << setw(8) << right << job.GetBinContent(3) << endl);
388 NOTICE(
"Number of events with muon " << setw(8) << right << job.GetBinContent(3) << endl);
390 NOTICE(
"Number of events with fit " << setw(8) << right << job.GetBinContent(4) << endl);
391 NOTICE(
"Number of events selected " << setw(8) << right << job.GetBinContent(5) << endl);
392 NOTICE(
"Number of events with neutrino " << setw(8) << right << job.GetBinContent(6) << endl);
393 NOTICE(
"Number of events contained " << setw(8) << right << job.GetBinContent(7) << endl);
395 if (Q.getCount() != 0) {
396 NOTICE(
"Median space angle [deg] " <<
FIXED (6,3) << Q.getQuantile(0.5) << endl);