82{
86
87 string inputFile;
92 int rebin;
93 double TMax_ns;
96
97 try {
98
99 JParser<> zap(
"Program to calculate log-likelihood distributions between DOM pairs and fit a poly2 to find the shape, used in FitL1dt to find time offsets");
100
101 zap[
'f'] =
make_field(inputFile,
"input file") =
"monitor.root";
105 zap[
'T'] =
make_field(TMax_ns,
"scan range around 0 in data-model comparison [ns]") = 50.0;
110
112 return 1;
113 }
114 }
115 catch(const exception &error) {
117 }
118
119
121
123
124 try {
126 }
129 }
130
131
132 TFile* in = TFile::Open(inputFile.c_str(),
"exist");
134
135 if (in ==
NULL || !in->IsOpen()) {
136 FATAL(
"File: " << inputFile <<
" not opened." <<
endl);
137 }
140 }
141
143
147
148
149
154 h2A.GetXaxis()->SetBinLabel(
idom+1, label);
155 h2A.GetYaxis()->SetBinLabel(
idom+1, label);
156 h2B.GetXaxis()->SetBinLabel(
idom+1, label);
157 h2B.GetYaxis()->SetBinLabel(
idom+1, label);
158 h2C.GetXaxis()->SetBinLabel(
idom+1, label);
159 h2C.GetYaxis()->SetBinLabel(
idom+1, label);
160
163 }
164
166
170
171
172 TH2D*
d2s = (
TH2D*) in->Get((title +
".2S").c_str());
173 TH1D*
d1l = (
TH1D*) in->Get((title +
".1L").c_str());
174
176 WARNING(
"No data in data histogram " << title <<
endl);
177 continue;
178 }
179
180
183
185 WARNING(
"No mata in model histogram " << title <<
endl);
186 continue;
187 }
188
189
192
194 continue;
195 }
197 continue;
198 }
199
202 d2s->GetXaxis()->FindBin(TString(
Form(
"%i",
moduleB->getID()))),
"e");
205 m2s->GetXaxis()->FindBin(TString(
Form(
"%i",
moduleB->getID()))),
"e");
206
207 if (
d1s->Integral() <= 0.0 ||
m1s->Integral() <= 0.0) {
208 continue;
209 }
210
211
219 }
220 }
222
223
231 }
232 }
234
235
236 const double Ld =
d1l->GetBinContent(
d1l->GetXaxis()->FindBin(TString(
Form(
"%i",
moduleB->getID()))));
237 const double Lm =
m1l->GetBinContent(
m1l->GetXaxis()->FindBin(TString(
Form(
"%i",
moduleB->getID()))));
238
240 const double y =
d1s->GetBinContent(j);
241 const double dy =
d1s->GetBinError(j);
242
243 d1s->SetBinContent(j, y);
244 d1s->SetBinError(j,
dy);
245 }
246
247
249 const double y =
m1s->GetBinContent(j);
250 const double dy =
m1s->GetBinError(j);
251
252 m1s->SetBinContent(j, y *
Ld/
Lm);
254 }
255
256
260 }
261
262
265
266
269
270
273
275
276 for (
int di = 1;
di <=
q1.GetNbinsX();
di++) {
278 }
279
280
281 const double dt_fitmid =
q1.GetBinCenter(
q1.GetMaximumBin());
282
284 q1f.SetParLimits(0, -1
e5, 0.0);
285
289 }
291
292
294
295
296 const double Aij =
q1f.GetParameter(0);
297 const double Bij =
q1f.GetParameter(1);
298 const double Cij =
q1f.GetParameter(2);
299
302
306 }
308
315
318 }
319 }
320
321 out.cd();
322
326
328
329 out.Close();
330}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Wrapper class around STL string class.
Template definition of a multi-dimensional oscillation probability interpolation table.
JReader & read(JReader &in) override final
Read from input.
Utility class to parse command line options.
double getLogQuality(const TH1D *data, const TH1D *model, int di, double data_bkg=0.0001, double model_bkg=0.0001)
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).