14#include "TFitResult.h"
44int main(
int argc,
char **argv) {
57 JParser<> zap(
"Auxiliary program to fit multiplicity rates from JMonitorMultiplicity output.");
69 catch(
const exception &error) {
73 TFile* in = TFile::Open(inputFile.c_str(),
"exist");
75 if (in ==
NULL || !in->IsOpen()) {
76 FATAL(
"File: " << inputFile <<
" not opened." <<
endl);
84 const int nx = 1 + NUMBER_OF_PMTS;
85 const double xmin = -0.5;
86 const double xmax =
nx - 0.5;
104 FATAL(
"File " << inputFile <<
" does not contain livetime histogram." <<
endl);
125 TString prefix =
hLiveTime->GetXaxis()->GetBinLabel(
bin);
127 DEBUG(
"Processing data from " << prefix <<
endl);
131 TString
h1D_label = prefix + TString(
"_P" );
132 TString
h2D_label = prefix + TString(
"_HT");
155 for (
int M = 2;
M <= NUMBER_OF_PMTS;
M++) {
157 int Mbin =
h2D->GetXaxis()->FindBin(
M);
163 if (
hI->GetEntries() > 0) {
165 const double W = (
hI->GetXaxis()->GetXmax() -
hI->GetXaxis()->GetXmin());
166 const double N =
hI->GetNbinsX();
167 const double V = W / N;
168 const double minRMS = 0.1;
176 TF1 f1(
"f1",
"[0]*exp(-0.5*(x-[1])*(x-[1])/([2]*[2]))/(TMath::Sqrt(2*TMath::Pi())*[2]) + [3]");
178 f1.SetParameter(0,
hI->GetMaximum());
179 f1.SetParameter(1,
hI->GetMean());
180 f1.SetParameter(2,
hI->GetRMS() * 0.25);
181 f1.SetParameter(3,
hI->GetMinimum());
183 hI->Fit(&f1, option.c_str(),
"same");
185 double sg_v = f1.GetParameter(0);
186 double sg_e = f1.GetParError( 0);
188 double bg_v = f1.GetParameter(3);
189 double bg_e = f1.GetParError( 3);
195 double integral =
hI->GetSumOfWeights();
212 hI->Fit(&f1, option.c_str(),
"same");
242 if (
M == NUMBER_OF_PMTS) {
270 fdir = out.mkdir(
"HTF" );
fdir->cd();
274 fdir = out.mkdir(
"HTFE");
fdir->cd();
KM3NeT DAQ constants, bit handling, etc.
int main(int argc, char **argv)
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Auxiliary class to define a range between two values.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).