34 using namespace JSUPERNOVA;
44 int main(
int argc,
char **argv) {
56 JParser<> zap(
"Auxiliary program to test generation of L0 background.");
58 zap[
'f'] =
make_field(inputFile,
"input file (output from JRipple).");
60 zap[
'T'] =
make_field(duration_ms,
"duration in ms of the background sample.") = 500;
61 zap[
'N'] =
make_field(outNumberOfLines,
"number of lines of the simulated (output) detector") = 115;
65 catch(
const exception &error) {
66 FATAL(error.what() << endl);
69 TFile* in = TFile::Open(inputFile.c_str(),
"exist");
71 if (in == NULL || !in->IsOpen()) {
72 FATAL(
"File: " << inputFile <<
" not opened." << endl);
75 NOTICE(
"Initialising generator." << endl);
81 NOTICE(
"File loaded." << endl);
83 int T_ms = duration_ms;
88 int inNumberOfLines = 1;
100 NOTICE(
"Generation SEQ" << endl);
102 for (
int i = 0; i < 10; i++) {
105 for (
int j = 0; j < T_ms; j++) {
106 RT_SEQ[i]->Fill(j, seq[0][j]);
107 NC_SEQ[i]->Fill(j, seq[1][j]);
113 NOTICE(
"Generation SHF" << endl);
115 for (
int i = 0; i < 10; i++) {
118 for (
int j = 0; j < T_ms; j++) {
120 RT_SHF[i]->Fill(j, shf[0][j]);
121 NC_SHF[i]->Fill(j, shf[1][j]);
126 NOTICE(
"Generation H2D + FIT" << endl);
132 for (
int j = 0; j < T_ms; j++) {
133 RT_FIT[
"SG_1"]->
Fill(j, fit1[0][j]);
136 NOTICE(
"Generation H2D + FIT - rebin = 5" << endl);
144 for (
int j = 0; j < fit5[0].size(); j++) {
145 cout << fit5[0][j] << endl;
146 RT_FIT[
"SG_5"]->
Fill(j, fit5[0][j]);
168 TDirectory* dseq = out.mkdir(
"SEQ");
169 TDirectory* dshf = out.mkdir(
"SHF");
170 TDirectory* dfit = out.mkdir(
"FIT");
Utility class to parse command line options.
bg_type generate_fitted(int rb=1)
Generate fitted L1 sample.
Dynamic ROOT object management.
void Fill(const JFit &fA, const JFit &fB, const bool option)
Fill histograms.
bg_type generate_shuffled(bool randomizeRun=false)
Generate sample of L0 background The sampling of the L0 data is not sequential but random within the ...
Auxiliary class to manage set of compatible ROOT objects (e.g.
void configureRatio(const int iSize, const int oSize)
Set rebinning ratio.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Class to emulate L0 background for an arbitrarily sized detector.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
This file provides a class to emulate an L0 background on the ms time scale for an arbitrarily sized ...
void setSeed(const UInt_t uSeed=0)
Set TRandom seed.
General purpose messaging.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
void Write(TFile &out)
Write histograms to file.
void configureTimeWindow(const int T_ms)
Configure the duration of an output sample.
KM3NeT DAQ constants, bit handling, etc.
bg_type generate()
Generate sample of L0 background L0 data are randomly sampled from a single L0 dataset.
h2d_t * generate_H2D(int rb=1)
Generate 2D sample.
int main(int argc, char *argv[])