Jpp
Functions
JPulseFinder.cc File Reference
#include <iostream>
#include <iomanip>
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleLocation.hh"
#include "TH1D.h"
#include "TH2D.h"
#include "JPulseFinder_IO.hh"
#include "Physics.hh"
#include "Detector.hh"
#include "PMT_choice.hh"
#include "JPulseFinder_utils.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 34 of file JPulseFinder.cc.

34  {
35 
36  //------------------------------------------------------------
37  // READ COMMAND-LINE OPTIONS AND DECLARE SOME VARIABLES
38  //------------------------------------------------------------
39 
40  IO options ;
41 
42  read_user_options(options, argc , argv);
43 
44  vector < int > top_pmts = setTopPMTs(options.up_pmts) ;
45 
46  vector < int > bottom_pmts = setBottomPMTs(options.down_pmts) ;
47 
48  int max_d = options.number_neighbors ;
49 
50  const double cwater = c_water(470 , 3000);
51 
52  //------------------------------------------------------------
53  // LOAD DETECTOR FROM DETECTOR FILE
54  //------------------------------------------------------------
55 
57 
58  //------------------------------------------------------------
59  // ALLOCATE HISTOGRAMS
60  //------------------------------------------------------------
61 
62  cout << "allocating histograms" << endl;
63 
64  vector < vector < TH2D* > > histograms = allocate_histograms(detector , options , cwater, top_pmts , bottom_pmts , max_d) ;
65 
66  //------------------------------------------------------------
67  // READ TIMESLICES AND FILL HISTOGRAMS
68  //------------------------------------------------------------
69 
70  cout << "reading time slices" << endl;
71 
72  fill_histograms (histograms , options , detector, top_pmts , bottom_pmts , max_d);
73 
74  //------------------------------------------------------------
75  // PROJECT 2D HISTOGRAMS TO OBTAIN TIME AND TOT DISTRIBUTIONS
76  //------------------------------------------------------------
77 
78  vector < vector < TH1D* > > hit_time = project_time(histograms) ;
79 
80  vector < vector < TH1D* > > hit_ToT = project_ToT(histograms) ;
81 
82 
83  //------------------------------------------------------------
84  // WRITE OUTPUT
85  //------------------------------------------------------------
86 
87  cout << "writing output " << endl;
88 
89  write_output(options , histograms , hit_ToT , hit_time) ;
90 
91  //------------------------------------------------------------
92  // DONE
93  //------------------------------------------------------------
94 
95  cout << endl
96  << "---------- Done! ----------"
97  << endl ;
98  cout << "Output in '" << options.ofname << "'." << endl ;
99 }
c_water
double c_water(double wavelength, double water_depth)
Definition: Physics.hh:9
IO::down_pmts
int down_pmts
Definition: JInterDomCal_IO.hh:59
setTopPMTs
vector< int > setTopPMTs(int option)
Select the PMTs in the upper hemisphere of a DOM.
Definition: PMT_choice.hh:48
setBottomPMTs
vector< int > setBottomPMTs(int option)
Select the PMTs in the lower hemisphere of a DOM.
Definition: PMT_choice.hh:100
std::vector< int >
project_ToT
vector< vector< TH1D * > > project_ToT(vector< vector< TH2D * > > ToT_vs_time)
Projects the hit time vs ToT histograms for all the combinations nanobeacon - pmt on the Y axis.
Definition: JPulseFinder_utils.hh:270
IO
Structure to store the different command line arguments for JInterDomCal.
Definition: JInterDomCal_IO.hh:43
IO::ofname
string ofname
Definition: JPulseFinder_IO.hh:42
allocate_histograms
vector< vector< TH2D * > > allocate_histograms(JDetector detector, IO options, double c_w, vector< int > top_pmts, vector< int > bottom_pmts, int max_distance)
Allocates histograms to store the tot vs time hit distribution for all the combinations nanobeacon - ...
Definition: JPulseFinder_utils.hh:86
IO::up_pmts
int up_pmts
Definition: JInterDomCal_IO.hh:57
project_time
vector< vector< TH1D * > > project_time(vector< vector< TH2D * > > ToT_vs_time)
Projects the hit time vs ToT histograms for all the combinations nanobeacon - pmt on the X axis.
Definition: JPulseFinder_utils.hh:300
JDETECTOR::JDetector
Detector data structure.
Definition: JDetector.hh:80
JAANET::detector
Detector file.
Definition: JHead.hh:130
write_output
void write_output(IO options, vector< vector< TH2D * > > ToT_vs_time, vector< vector< TH1D * > > ToT, vector< vector< TH1D * > > time)
Writes a .root file with the nanobeacon pulses found by JPulseFinder.
Definition: JPulseFinder_IO.hh:132
IO::detector_file
string detector_file
Definition: JInterDomCal_IO.hh:45
loadDetector
JDetector loadDetector(string detectorFile)
Loads the content of a detector file in a JDetector object.
Definition: Detector.hh:28
fill_histograms
void fill_histograms(vector< vector< TH2D * > > &histograms, IO options, JDetector detector, vector< int > top_pmts, vector< int > bottom_pmts, int max_distance)
Fills the hit time vs ToT histograms for all the combinations nanobeacon - pmt.
Definition: JPulseFinder_utils.hh:159
read_user_options
int read_user_options(IO &options, int argc, char **argv)
Parses the command line options and fills an IO structure with them.
Definition: JPulseFinder_IO.hh:74
IO::number_neighbors
int number_neighbors
Definition: JInterDomCal_IO.hh:61