Go to the documentation of this file.
24 int main(
int argc,
char **argv) {
32 int Nruns = options.
ifnames.size() ;
42 TTree* t =
new TTree(tname , tname) ;
48 for (
int i=0 ; i<Nbeacons ; i++){
50 sprintf(bname ,
"NB%d" , i+1) ;
52 t->Branch(bname , &evt_table[i][0] ,
"V/D:meanToT_ref/D:meanToT_tgt/D:sigmaToT_ref/D:sigmaToT_tgt/D") ;
60 for(
auto & file : options.
ifnames){
64 Sruns[run_index] = run ;
68 summary_refs.push_back(
refs_th2(run)) ;
70 cout <<
"Analyzing run number: " << run->
getRunNumber() <<
" Voltage = " <<
v <<
" V." << endl ;
80 sprintf(bname ,
"NB%d" , i+1) ;
82 t->SetBranchAddress(bname , &evt_table[i][run_index]) ;
84 evt_table[i][run_index].V =
v ;
86 evt_table[i][run_index].meanToT_ref = sm->getMeanToT_refs() ;
88 evt_table[i][run_index].meanToT_tgt = sm->getMeanToT_tgts() ;
90 evt_table[i][run_index].sigmaToT_ref = sm->getSigmaToT_refs() ;
92 evt_table[i][run_index].sigmaToT_tgt = sm->getSigmaToT_tgts() ;
JMultipleFileScanner ifnames
int read_user_options(IO &options, int argc, char **argv)
Parses the command line options and fills an IO structure with them.
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
int main(int argc, char **argv)
Structure to store the different command line arguments for JRunAnalyzer.
int getNumberOfFloors(const JDetector &detector)
Get number of floors.
double getVoltage()
Get nanobeacon voltage.
int getRunNumber()
Get run number.
void write_output_cal(string filename, vector< pair< double, int > > &optimal_voltages, vector< NBRun * > &Runs, int string_number, int nFloors)
Writes a .root file with the optional output produced by JVoltageOptimizer.
TH2D * refs_th2(NBRun *Run)
Produces a TH2 to be read as a table that summarizes which pmts were used as references for each modu...
void analyze(int option)
Loops over all the SUPERMODULES.
void computeMeanToTs()
Loops over all the SUPERMODULES to compute the mean ToT of the hits from the different nanobeacon pul...
vector< pair< double, int > > optimize_voltage(vector< vector< event > > evt_table, double max_tot)
Optimizes the voltage of each nanobeacon.
void write_output_txt(string filename, vector< pair< double, int > > optimal_voltages)
Writes a .txt file with the result produced by JVoltageOptimizer.
JDetector loadDetector(string detectorFile)
Loads the content of a detector file in a JDetector object.
void write_output_opt(string filename, TTree *t, vector< TH2D * > summary_refs, vector< NBRun * > &Runs)
Writes a .root file with the optional output produced by JVoltageOptimizer.
vector< SuperModule * > getSuperModules()
Get the SuperModules in the DU.