48 template<
class JHit_t>
61 buffer.insert(JType_t(*i));
75 int main(
int argc,
char **argv)
82 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
84 JTriggeredFileScanner_t inputFile;
87 size_t numberOfPrefits;
99 JParser<> zap(
"Example program to histogram fit results.");
103 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
110 zap[
'O'] =
make_field(option) =
"E",
"N",
"LINE",
"LOGE";
116 catch(
const exception& error) {
117 FATAL(error.what() << endl);
120 cout <<
"APPLICATION " << application << endl;
131 const JVolume volume(head, option !=
"LINE");
135 cylinder.
add(center);
137 NOTICE(
"Reposition can [m]: " << cylinder << endl);
139 const double EMIN_GEV = 10e3;
143 TH1D job(
"job", NULL, 100, 0.5, 100.5);
145 TH1D hn(
"hn", NULL, 250, -0.5, 249.5);
146 TH1D hq(
"hq", NULL, 300, 0.0, 600.0);
147 TH1D hi(
"hi", NULL, 101, -0.5, 100.5);
148 TH1D hv(
"hv", NULL, 200, -6.0, 0.0);
149 TH1D h1(
"h1", NULL, 200, -2.0, +2.0);
150 TH1D hc(
"hc", NULL, 200, -1.0, +1.0);
151 TH1D hu(
"hu", NULL, 400, -1.0e3, 1.0e3);
153 TH1D hx(
"hx", NULL, 100, -3.0, +2.3);
154 TH1D hd(
"hd", NULL, 100, 0.0, 10.0);
155 TH1D hz(
"hz", NULL, 100, -200.0, 200.0);
156 TH1D ht(
"ht", NULL, 100, -100.0, 100.0);
161 TH1D er(
"er", NULL, 100, -5.0, +5.0);
166 TH2D hAngle (
"hAngle",
";E_{TRUE};angle [#circ]", 100, volume.
getXmin(), volume.
getXmax(), 360, 0, 180.0);
168 const Int_t ny = 28800;
169 const Double_t ymin = 0.0;
170 const Double_t ymax = 180.0;
174 if (option.find(
'E') != string::npos) {
184 for ( ; x <= 15.5; x += 1.0) { X.push_back(x); }
185 for ( ; x <= 25.5; x += 2.0) { X.push_back(x); }
186 for ( ; x <= 50.5; x += 5.0) { X.push_back(x); }
187 for ( ; x <= 100.5; x += 10.0) { X.push_back(x); }
188 for ( ; x <= 250.5; x += 20.0) { X.push_back(x); }
191 TH2D h2(
"h2", NULL, X.size() - 1, X.data(), ny, ymin, ymax);
192 TProfile he(
"he", NULL, X.size() - 1, X.data());
194 TH2D ha(
"ha", NULL, 100, 0.0, 0.5e6, 100, -100.0, +900.0);
195 TH2D hb(
"hb", NULL, 100, 0.0, 0.5e6, 100, -100.0, +900.0);
201 while (inputFile.hasNext()) {
203 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
205 multi_pointer_type ps = inputFile.next();
227 if (shower->E > Emax) {
231 }
else if(isMuon &&
is_muon(*shower)){
234 if (shower->E > Emax) {
241 if (lepton == event->mc_trks.end()) {
252 if (option.find(
'E') != string::npos)
253 x = volume.
getX(event->mc_trks[0].E);
264 JEvt::iterator __end = partition(evt->begin(), evt->end(),
JHistory::is_event(application));
266 if (evt->begin() == __end) {
272 if (numberOfPrefits > 0) {
274 JEvt::iterator __q = __end;
276 advance(__end = evt->begin(), min(numberOfPrefits, (
size_t)
distance(evt->begin(), __q)));
287 JEvt::iterator best = pointing(evt->begin(), __end);
288 const Double_t beta = pointing.
getAngle(*best);
289 const double Efit = best->getE();
290 const double Eraw = best->getW(
JENERGY_ENERGY, numeric_limits<double>::min());
291 const double mip = best->getW(
JSTART_NPE_MIP, numeric_limits<double>::max());
297 bool ok = (Efit >= Emin_GeV &&
306 hn.Fill((Double_t) best->getNDF());
307 hq.Fill(best->getQ());
308 hi.Fill((Double_t)
distance(evt->begin(), best));
309 hc.Fill(best->getDZ());
313 hu.Fill(atmosphere(evt->begin(), __end));
316 hx.Fill(max(log10(beta), hx.GetXaxis()->GetXmin()));
347 ha.Fill(best->getX()*best->getX() + best->getY()*best->getY(), best->getZ());
352 if (best->getE() >= EMIN_GEV) {
353 hb.Fill(best->getX()*best->getX() + best->getY()*best->getY(), best->getZ());
358 e0.Fill(volume.
getX(Emu,
true));
359 e1.Fill(volume.
getX(Eraw,
true));
360 e2.Fill(volume.
getX(Efit,
true));
361 er.Fill(volume.
getX(Efit) - volume.
getX(Emu));
362 ee.Fill(volume.
getX(Emu), volume.
getX(Efit));
364 hAngle.Fill(Efit, beta);
373 const double npe = best->getW(
JVETO_NPE);
375 const double pv = TMath::PoissonI(count, npe);
377 hv.Fill(max(log10(pv), hv.GetXaxis()->GetXmin()));
386 NOTICE(
"Number of events input " << setw(8) << right << job.GetBinContent(1) << endl);
388 NOTICE(
"Number of events with electron " << setw(8) << right << job.GetBinContent(3) << endl);
390 NOTICE(
"Number of events with muon " << setw(8) << right << job.GetBinContent(3) << endl);
392 NOTICE(
"Number of events with fit " << setw(8) << right << job.GetBinContent(4) << endl);
393 NOTICE(
"Number of events selected " << setw(8) << right << job.GetBinContent(5) << endl);
394 NOTICE(
"Number of events with neutrino " << setw(8) << right << job.GetBinContent(6) << endl);
395 NOTICE(
"Number of events contained " << setw(8) << right << job.GetBinContent(7) << endl);