12 using namespace JDETECTOR ;
65 NBRun (
string filename_ ,
JDetector detector_ ,
int string_ ,
int pmt_top ,
int pmt_bottom ,
int max_distance_):
69 filename = filename_ ;
71 string_number = string_ ;
73 max_distance = max_distance_ ;
75 setDetector (detector_) ;
77 initializeSuperModules () ;
79 setPMTs (pmt_top , pmt_bottom) ;
92 for (
auto & sm : SuperMods){
107 for (
auto & sm : SuperMods){
109 sm->compute_mean_tot_ref() ;
111 sm->compute_mean_tot_tgt() ;
124 for (
auto & sm : SuperMods){
126 sm->select_good_srcs() ;
128 sm->select_good_tgts() ;
142 for (
auto & sm : SuperMods){
172 TFile* file = TFile::Open(filename.c_str()) ;
174 readBasicInfo (file) ;
198 for (
auto & src : possible_srcs){
200 int thatfloor = src->getFloor () ;
202 int thatstring = src->getString () ;
208 for (
auto & pm : bottomPMTs){
210 sprintf(name ,
"S%dF%d/S%dF%dPMT%d_beaconS%dF%d" , thisstring , thisfloor, thisstring , thisfloor , pm , thatstring , thatfloor);
212 if (file -> Get (name) ){
214 TH2D* h = (TH2D*)file -> Get(name) ;
236 src->add_tgt (tgt_pair) ;
253 for(
auto & sm : SuperMods){
255 findSrcs (sm , file) ;
270 for (
auto & sm : SuperMods){
272 findRefs (sm , file) ;
294 for (
auto & pm : topPMTs){
296 sprintf(name ,
"S%dF%d/S%dF%dPMT%d_beaconS%dF%d" ,
string , floor,
string , floor , pm ,
string , floor);
298 if (file -> Get (name) ){
300 TH2D* h = (TH2D*)file -> Get(name) ;
337 void setPMTs (
int top_option ,
int bottom_option){
351 SuperMods.resize(nSuperModules) ;
353 for (
int i = 0 ; i < (int)SuperMods.size() ; i++){
359 for (
int j = i+1 ; (j < i + 1 + max_distance) && (j<(
int)nSuperModules) ; j++){
365 for (
int j = max(i - max_distance , 0) ; j<i ; j++){
386 detector = detector_ ;
411 filename = file->GetName() ;
413 TVectorD* run_info = (TVectorD*)file->Get(
"Run_Info") ;
415 run_number = (*run_info)(0) ;
417 voltage = (*run_info)(1) ;
JDetector getDetector()
Get the detector.
int getString()
Returns the string of this supermodule.
vector< SuperModule * > SuperMods
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
Data structure for a composite optical module.
vector< SuperModule * > getSuperModules()
Get the SuperModules in the DU.
void readFile()
Reads a .root file containing the nanobeacon pulses observed by the different PMTs in the detector...
vector< int > setTopPMTs(int option)
Select the PMTs in the upper hemisphere of a DOM.
void setSrcs(TFile *file)
Loops over all the SuoperModules in the DU.
void add_possible_src(SuperModule *super_m)
Adds a SUPERMODULE to the list of possible sources of this supermodule.
vector< int > setBottomPMTs(int option)
Select the PMTs in the lower hemisphere of a DOM.
void setDetector(JDetector detector_)
Sets the detector.
int getFloor()
Returns the floor of this supermodule.
void setRefs(TFile *file)
Loops over all the SuoperModules in the DU.
void computeMeanToTs()
Loops over all the SUPERMODULES to compute the mean ToT of the hits from the different nanobeacon pul...
void add_possible_tgt(SuperModule *super_m)
Adds a SUPERMODULE to the list of possible targets of this supermodule.
Class containing a JPMT and a NBPulse object.
void findRefs(SuperModule *sm, TFile *file)
Searches in the .root file for histograms corresponding to pulses produced in one supermodule...
void add_ref_pmt(SuperPMT *superPM)
Adds a reference SUPERPMT to this supermodule.
Data structure for PMT geometry and calibration.
int getNumberOfFloors(const JDetector &detector)
Get number of floors.
void setPMTs(int top_option, int bottom_option)
Select the PMTs in the upper and lower hemispheres of a DOM.
void findSrcs(SuperModule *sm, TFile *file)
Searches in the .root file for histograms corresponding to pulses produced in one target supermodule...
double getVoltage()
Get nanobeacon voltage.
void readBasicInfo(TFile *file)
Reads the basic info from the .root file such as the run number and the nanobeacon voltage...
int getRunNumber()
Get run number.
void analyze(int option)
Loops over all the SUPERMODULES.
void find_good_couples()
Loops over all the SUPERMODULES.
JPMT getPMT(int i)
Returns a JPMT from this supermodule.
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
void add_src(pair< SuperModule *, vector< SuperPMT * > > p)
Adds a source.
NBRun()
Default constructor.
Logical location of module.
vector< SuperModule * > get_possible_srcs()
Returns vector with pointers to all the supermodules below this one in the DU.
NBRun(string filename_, JDetector detector_, int string_, int pmt_top, int pmt_bottom, int max_distance_)
Constructor.
void initializeSuperModules()
Sets the references between the different SuperModules in the DU.