52 double fractionThreshold;
58 JParser<> zap(
"Auxiliary program to build supernova background from JKexing2D output");
60 zap[
'f'] =
make_field(inputFile,
"input file (JKexing2D).");
62 zap[
'w'] =
make_field(windowSize,
"size of the sliding window to test") = 5;
64 zap[
'F'] =
make_field(fractionThreshold,
"minimum fraction of active channels to compute distribution") = 0.99;
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
79 TFile
in(inputFile.c_str(),
"exist");
81 TParameter<int>* runNumber;
83 in.GetObject(
"RUNNR", runNumber);
85 JManager2D_t MT = JManager2D_t::Read(
in,
mul_p ,
'%');
86 JManager_s1D_t ST = JManager_s1D_t::Read(
in,
status_p,
'%');
92 const int factoryLimit_peak = 250;
93 const int factoryLimit_runs = 10000;
102 string title =
"MD_" + (*f) +
"_%";
103 mmap[*
f] = JManager_i1D_t(
new TH1D(title.c_str(), NULL, factoryLimit_peak, 0, factoryLimit_peak));
107 const double xmin = -0.5;
108 const double xmax = nx - 0.5;
112 JManager_s1D_t TD(
new TH1D(
"SNT_[6,10]_%", NULL, factoryLimit_peak, -0.5, -0.5 + factoryLimit_peak));
114 double epsilon = 1e-4;
117 JManager2D_t BL(
new TH2D(
"BL_%", NULL, 100, epsilon, 1 + epsilon, factoryLimit_peak, -0.5, -0.5 + factoryLimit_peak));
118 JManager2D_t MUL_EFF(
new TH2D(
"MUL_EFF_%", NULL, 100, epsilon, 1 + epsilon, nx, xmin, xmax));
121 JManager_s1D_t
H(
new TH1D(
"H_%", NULL, factoryLimit_runs, 0, factoryLimit_runs));
125 TH1D* LT =
new TH1D(
"LIVETIME_ACF", NULL, 100, epsilon, 1 + epsilon);
131 const int nb = activeChannelFraction->GetN();
132 const Double_t* arr_acf_y = activeChannelFraction->GetY();
136 LT->FillN(nb, arr_acf_y, NULL);
158 transform(vec_acf_y.begin(),
161 back_inserter(select),
162 greater_equal<double> {});
164 mmap[*
f][
M]->FillN(nb, count_vs_frame[*
f]->GetY(), &select[0]);
170 MUL_EFF[*
f]->FillN(nb,
173 count_vs_frame[*
f]->GetY());
178 int RUNNR = runNumber->GetVal();
186 TD[*
f]->FillN(events_per_frame->GetN(), events_per_frame->GetY(), NULL);
191 vector<double> vec(events_per_frame->GetY(), events_per_frame->GetY() + nb);
196 TD[(*f) +
"_nTS"]->FillN(events_per_frame_sliding.size(),
197 &events_per_frame_sliding[0],
204 events_per_frame->GetY(),
211 H[
"PK_" + (*f)]->Fill(RUNNR, peak);
217 double BI = (ST[
"PMT"]->GetSumOfWeights() / ST[
"PMT"]->GetEntries());
219 H[
"BIOLUM"]->Fill(RUNNR, BI);
227 TDirectory* bm = out.mkdir(
"BIOLUM");
228 TDirectory* hs = out.mkdir(
"HISTORY");
236 string dir_name =
"MUL_" + (*f);
237 TDirectory* dir = out.mkdir(dir_name.c_str());
238 mmap[*
f].Write(*dir);
Utility class to parse command line options.
static const char * mul_p
static const char * status_p
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Auxiliary class to manage set of compatible ROOT objects (e.g.
TGraph * histogramToGraph(const TH1 &in)
Converts a 1D histogram to a TGraph with:
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::vector< T > convolve(const std::vector< T > &in, const std::vector< T > &ker)
Convolves a vector (in) with another vector (ker).
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
TH1 * projectHistogram(const TH2 &in, const JTOOLS::JRange< int > R, const char coordinate= 'x')
Helper method for ROOT Projection(X|Y) based on a JRange object and a coordinate. ...