1 #ifndef __SUPERMODULE__
2 #define __SUPERMODULE__
13 using namespace JDETECTOR;
83 for (
auto & spm : ref_pmts){
89 for (
auto & src : sources){
91 for (
auto & spm : src.second){
112 if (good_sources.size() > 0) has =
true ;
129 if (good_targets.size() > 0) has =
true ;
144 return mean_tot_refs ;
157 return mean_tot_tgts ;
170 return sigma_tot_refs ;
183 return sigma_tot_tgts ;
198 if (ref_pmts.size() == 0)
return ;
200 for (
auto & spm : ref_pmts){
202 double tot = spm->getNBPulse()->getMeanToT() ;
210 mean_tot_refs = sum / tots.size() ;
215 for (
auto & t : tots){
217 sigma_tot_refs += pow((t - mean_tot_refs) , 2) ;
221 sigma_tot_refs = sqrt(sigma_tot_refs / tots.size());
232 if (targets.size()==0)
return ;
242 for (
auto spm : targets[0].second){
244 double tot = spm->getNBPulse()->getMeanToT() ;
252 mean_tot_tgts = sum / tots.size() ;
257 for (
auto & t : tots){
259 sigma_tot_tgts += pow((t - mean_tot_tgts) , 2) ;
263 sigma_tot_tgts= sqrt(sigma_tot_tgts / tots.size());
277 return sources[sources.size() - 1];
305 return good_sources[good_sources.size() - 1];
319 return good_targets[0];
330 for (
auto & src : sources){
334 for (
auto & spm: src.second){
336 if (spm->getNBPulse()->IsGood()==
true) good_pulses.push_back(spm) ;
340 if(good_pulses.size()>0){
344 good_sources.push_back (good_pair) ;
358 for (
auto & spm : ref_pmts){
360 if (spm->getNBPulse()->IsGood()==
true) good_ref_pmts.push_back(spm) ;
373 for (
auto & tgt : targets){
377 for (
auto & spm: tgt.second){
379 if (spm->getNBPulse()->IsGood()==
true) good_pulses.push_back(spm) ;
383 if(good_pulses.size()>0){
387 good_targets.push_back (good_pair) ;
432 for (
auto & spm : ref_pmts){
447 for (
auto & spm : ref_pmts){
462 for (
auto & src : sources){
464 for (
auto & spm : src.second){
481 for (
auto & src : sources){
483 for (
auto & spm : src.second){
500 for (
auto & tgt : targets){
502 for (
auto & spm : tgt.second){
519 for (
auto & tgt : targets){
521 for (
auto & spm : tgt.second){
566 return good_targets ;
579 return good_sources ;
590 targets.push_back(p) ;
601 sources.push_back(p) ;
627 return dom.getPMT(i) ;
640 return dom.getFloor() ;
653 return dom.getString() ;
679 return possible_tgts ;
692 return possible_srcs ;
718 ref_pmts.push_back(superPM) ;
731 possible_srcs.push_back(super_m) ;
744 possible_tgts.push_back(super_m) ;
int getString()
Returns the string of this supermodule.
void compute_mean_tot_tgt()
Computes the mean and standard deviation of the ToT of the pulse of the nanobeacon in this supermodul...
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
Data structure for a composite optical module.
void analyzeAll()
Performs a fast analysis of all the SUPERPMTs related with this SUPERMODULE.
void analyzeSrcs()
Performs a fast analysis of the NBPulses of the SUPERPMTs from this supermodule corresponding to the ...
vector< pair< SuperModule *, vector< SuperPMT * > > > get_targets()
Get a vector of targets.
vector< SuperModule * > get_possible_tgts()
Returns vector with pointers to all the supermodules above this one in the DU.
void analyzeTgts()
Performs a fast analysis of the NBPulses of the SUPERPMTs from other supermodules corresponding to th...
void add_possible_src(SuperModule *super_m)
Adds a SUPERMODULE to the list of possible sources of this supermodule.
SuperModule()
Default constructor.
int getFloor()
Returns the floor of this supermodule.
void select_good_tgts()
Searches for target supermodules that have detected good pulses from this supermodule.
void fitRefs()
Performs a fit of the NBPulses of the SUPERPMTs from this supermodule.
pair< SuperModule *, vector< SuperPMT * > > get_closest_source()
Get a pair containing a pointer to the closest source supermodule, and a vector of pointers to superp...
void fitTgts()
Performs a fit of the NBPulses of the SUPERPMTs from other supermodules corresponding to the nanobeac...
vector< pair< SuperModule *, vector< SuperPMT * > > > targets
vector< SuperPMT * > good_ref_pmts
void add_possible_tgt(SuperModule *super_m)
Adds a SUPERMODULE to the list of possible targets of this supermodule.
bool has_good_sources()
Checks if the SuperModule has good sources.
Class containing a JPMT and a NBPulse object.
void add_ref_pmt(SuperPMT *superPM)
Adds a reference SUPERPMT to this supermodule.
Data structure for PMT geometry and calibration.
vector< pair< SuperModule *, vector< SuperPMT * > > > good_targets
vector< pair< SuperModule *, vector< SuperPMT * > > > get_good_sources()
Returns a vector of good sources.
void fitSrcs()
Performs a fit of the NBPulses of the SUPERPMTs from this supermodule corresponding to the nanobeacon...
vector< pair< SuperModule *, vector< SuperPMT * > > > good_sources
pair< SuperModule *, vector< SuperPMT * > > get_closest_good_target()
Returns a pair containing a pointer to the closest target supermodule that detected pulses from this ...
double getMeanToT_tgts()
Get the mean ToT of the pulse of the nanobeacon in this supermodule detected by the pmts of the close...
vector< pair< SuperModule *, vector< SuperPMT * > > > get_good_targets()
Returns a vector of good targets.
void select_good_refs()
Searches for sources that have produced pulses classified as good in this supermodule.
bool has_good_targets()
Checks if the SuperModule has good targets.
void add_tgt(pair< SuperModule *, vector< SuperPMT * > > p)
Adds a target.
void setDom(JModule dom_)
Sets the JModule from this supermodule.
double getMeanToT_refs()
Get the mean ToT of the pulse of the nanobeacon in this supermodule detected by the pmts of this supe...
vector< SuperPMT * > ref_pmts
JPMT getPMT(int i)
Returns a JPMT from this supermodule.
double getSigmaToT_tgts()
Get the standard deviation of ToT of the pulse of the nanobeacon in this supermodule detected by the ...
void fitAll()
Performs a fit of the time distribution of all the SUPERPMTs related with this SUPERMODULE.
void analyzeRefs()
Performs a fast analysis of the NBPulses of the SUPERPMTs from this supermodule that detected the pul...
void select_good_srcs()
Searches for sources that have produced pulses classified as good in this supermodule.
vector< pair< SuperModule *, vector< SuperPMT * > > > sources
~SuperModule()
Destructor.
pair< SuperModule *, vector< SuperPMT * > > get_closest_good_source()
Returns a pair containing a pointer to the closest source supermodule from which pulses classified as...
vector< pair< SuperModule *, vector< SuperPMT * > > > get_sources()
Get a vector of sources.
SuperModule(JModule dom_)
Constructor.
void compute_mean_tot_ref()
Computes the mean and standard deviation of the ToT of the pulse of the nanobeacon in this supermodul...
void add_src(pair< SuperModule *, vector< SuperPMT * > > p)
Adds a source.
vector< SuperModule * > possible_srcs
vector< SuperPMT * > get_ref_pmts()
Returns a vector of SUPERPMTs with the pulses from the nanobeacon in this supermodule detected by the...
JModule getDom()
Returns the JModule corresponding to this supermodule.
pair< SuperModule *, vector< SuperPMT * > > get_closest_target()
Returns a pair containing a pointer to the closest target supermodule, and a vector of pointers to su...
double getSigmaToT_refs()
Get the standard deviation of ToT of the pulse of the nanobeacon in this supermodule detected by the ...
vector< SuperModule * > possible_tgts
vector< SuperModule * > get_possible_srcs()
Returns vector with pointers to all the supermodules below this one in the DU.