Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JInterDomCal.cc File Reference
#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <tuple>
#include "TCanvas.h"
#include "TTree.h"
#include "RooPlot.h"
#include "TLine.h"
#include "TF1.h"
#include "JDetector/JPMTRouter.hh"
#include "JLang/JObjectID.hh"
#include "JInterDomCal_IO.hh"
#include "JInterDomCal_utils.hh"
#include "Detector.hh"
#include "NBRun.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file JInterDomCal.cc.

28  {
29 
30  // Read user inputs
31 
32  IO options ;
33 
34  read_options(options, argc, argv) ;
35 
36  // Read the detector file. Compute the time of flight of the light from one DOM to the other based on their positions and the difference between their t0s.
37 
38  JDetector detector = loadDetector(options.detector_file) ;
39 
40  NBRun run (options.ifname , detector , options.string_number , options.up_pmts , options.down_pmts , options.number_neighbors) ;
41 
42  cout << "Calibrating DOM t0s with run number: " << run.getRunNumber() << endl ;
43 
44  cout << options.ifname << endl ;
45 
46  run.analyze(options.analysis_level) ;
47 
48  JDetector new_det = Update_Detector(detector , run.getSuperModules()) ;
49 
50  write_output_det(options.ofname_detx , new_det) ;
51 
52  write_output_compare(options.ofname_txt , detector , new_det , options.string_number , options.ref_pmt , options.tgt_pmt) ;
53 
54  write_output_checks(options.ofname_checks , run) ;
55 
56 }
int up_pmts
string ofname_txt
int string_number
void write_output_checks(string filename, NBRun &run)
Writes a .root file with some objects that can be used to check the calibration.
int down_pmts
Detector data structure.
Definition: JDetector.hh:77
Structure to store the different command line arguments for JRunAnalyzer.
Definition: JRunAnalyzer.cc:40
JDetector Update_Detector(JDetector detector, const vector< SuperModule * > &SuperMods)
Produces a new detector file by updating the existing t0s of the PMTs.
string ofname_checks
void write_output_compare(string filename, const JDetector &old_detector, const JDetector &new_detector, int string_number, int ref_pmt, int tgt_pmt)
Writes a .txt with the comparison of the t0s in a given DU for two JDetectors.
int tgt_pmt
int read_options(IO &options, int argc, char **argv)
Parses the command line options and fills an IO structure with them.
void write_output_det(string filename, const JDetector &detector)
Writes a .detx file with a JDetector.
JDetector loadDetector(string detectorFile)
Loads the content of a detector file in a JDetector object.
Definition: Detector.hh:28
string ifname
Definition: JRunAnalyzer.cc:42
int number_neighbors
string ofname_detx
int ref_pmt
string detector_file
Definition: JRunAnalyzer.cc:46
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
Definition: NBRun.hh:24
int analysis_level