74int main(
int argc,
char **argv)
86 JAbstractHistogram_t X;
101 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events using offline files.");
106 = JAbstractHistogram_t(100, 1.0, 100.0);
107 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
108 zap[
'C'] =
make_field(cylinder,
"Cylinder to compute visible energy depositions")
110 zap[
'm'] =
make_field(margin,
"Extra margin to consider visible energy depositions")
112 zap[
'e'] =
make_field(epsilon,
"Minimal amount of visible energy assigned to events") = 1e-8;
113 zap[
'O'] =
make_field(option,
"Result option")
115 zap[
'T'] =
make_field(trigger_mask,
"Trigger mask")
121 catch(
const exception &error) {
122 FATAL(error.what() << endl);
130 const double Xmin = X.getLowerLimit();
131 const double Xmax = X.getUpperLimit();
132 const int Xnbins = X.getNumberOfBins();
145 NOTICE(
"Scanning file type " << scanner->getName() << endl);
146 DEBUG (header << endl);
150 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
152 Evt*
event = in.next();
164 Wnorm = getWnorm(header);
166 }
else if (uuid_is_null(event->header_uuid) == 0) {
170 MultiHead::const_iterator i = multiheader.
find(mergedUUID.
uuid,
true);
172 if (i == multiheader.cend()) {
173 FATAL(
"Could not find header corresponding to UUID: " <<
JUUID(event->header_uuid) << endl);
176 const JHead header1(*i);
177 DEBUG(header1 << endl);
179 Wnorm = getWnorm(header1);
185 FATAL(
"Mising normalisation in event/header." << endl);
190 if (
can.getVolume() == 0.0) {
194 can.addMargin(margin);
200 double EvisHad = Evis - EvisLL;
202 if (Evis == 0) Evis = epsilon;
203 if (EvisLL == 0) EvisLL = epsilon;
204 if (EvisHad == 0) EvisHad = epsilon;
207 const double x1 = logx ? log10(Evis) : Evis;
208 const double x2 = logx ? log10(EvisLL) : EvisLL;
209 const double x3 = logx ? log10(EvisHad) : EvisHad;
213 (logx ? log(10.0) *
primary.E * hm0->GetBinWidth(1) : hm0->GetBinWidth(1)) /
216 if (option == Mass_t) {
218 }
else if (option == Volume_t) {
225 hm0[interactionID0]->Fill(x0, y);
226 hm1[interactionID0]->Fill(x1, y);
227 hm2[interactionID0]->Fill(x2, y);
228 hm3[interactionID0]->Fill(x3, y);
230 hm0[interactionID1]->Fill(x0, y);
231 hm2[interactionID1]->Fill(x2, y);
232 hm1[interactionID1]->Fill(x1, y);
233 hm3[interactionID1]->Fill(x3, y);
240 hm0[interactionID2]->Fill(x0, y);
241 hm1[interactionID2]->Fill(x1, y);
242 hm2[interactionID2]->Fill(x2, y);
243 hm3[interactionID2]->Fill(x3, y);
245 hm0[interactionID3]->Fill(x0, y);
246 hm2[interactionID3]->Fill(x2, y);
247 hm1[interactionID3]->Fill(x1, y);
248 hm3[interactionID3]->Fill(x3, y);
257 out << hm0 << hm1 << hm2 << hm3;