Analyzes the signal of a nanobeacon in a PMT.  
 More...
#include <NBPulse.hh>
Analyzes the signal of a nanobeacon in a PMT. 
Definition at line 33 of file NBPulse.hh.
 
◆ NBPulse() [1/2]
Default constructor. 
Definition at line 66 of file NBPulse.hh.
 
 
◆ NBPulse() [2/2]
  
  
      
        
          | NBPulse::NBPulse  | 
          ( | 
          TH2D *  | 
          h | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
This constructor initializes the nanobeacon pulse from a 2D histogram containing the time vs ToT hit distribution.
- Parameters
 - 
  
  
 
Definition at line 76 of file NBPulse.hh.
 
 
◆ ~NBPulse()
◆ Kolmogorov_Smirnov_uniform()
  
  
      
        
          | double NBPulse::Kolmogorov_Smirnov_uniform  | 
          ( | 
          TH1D *  | 
          h | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Performs a Kolmogorov-Smirnov compatibility test between the hit time distribution and a uniform distribution. 
- Parameters
 - 
  
    | h | The hit time distribution  | 
  
   
- Returns
 - The probability that the hit time distribution is compatible with a uniform distribution. 
 
Definition at line 141 of file NBPulse.hh.
  143     TRandom3* 
r = 
new TRandom3() ;
 
  147     double high_x = h->GetBinCenter(h->GetNbinsX() - 1) ;
 
  149     int nentries = h->Integral(1 , h->GetNbinsX() - 1) ;
 
  151     if (h->GetBinCenter(1)>=0){
 
  153       low_x = h->GetBinCenter(1) ;
 
  157     TH1D* 
u = (TH1D*)h->Clone(
"uniform") ;
 
  161     for (
int i = 0 ; i<nentries ; i++){
 
  163       u->Fill(
r->Uniform(low_x, high_x));
 
  167     double proba = h->KolmogorovTest(
u) ;
 
 
 
 
◆ initialize()
  
  
      
        
          | void NBPulse::initialize  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Leaves the pulse ready for analysis by projecting the time vs ToT distribution to the time axis and moving it out of the Root file directory. 
Definition at line 184 of file NBPulse.hh.
 
 
◆ analyzeFast()
  
  
      
        
          | void NBPulse::analyzeFast  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Performs a fast analysis of the hit time distribution. 
Definition at line 198 of file NBPulse.hh.
  206     double height = 
htime_full->GetBinContent(peakbin) ;
 
  220     for (
int i=0 ; i<
htime_peak->GetNbinsX() ; i++){
 
  222       if (i<leftbin || i>rightbin){
 
 
 
 
◆ computeBaseline()
  
  
      
        
          | void NBPulse::computeBaseline  | 
          ( | 
          TH1 *  | 
          h | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Computes baseline of the hit time distribution measured by the PMT. 
For this the first bins of the distribution (where the nanobeacon pulse is absent) are used.
- Parameters
 - 
  
    | h | Histogram with the hit time distribution  | 
  
   
Definition at line 279 of file NBPulse.hh.
  289       if(h->GetBinContent(i) > 0 ){
 
  291         sum += h->GetBinContent(i);
 
  293         bins.push_back(h->GetBinContent(i));
 
  311         if(h->GetBinContent(h->GetNbinsX() - i)>0){
 
  313           sum += h->GetBinContent(h->GetNbinsX() - i);
 
  315           bins.push_back(h->GetBinContent(h->GetNbinsX() - i));
 
  335     double bg_mean = sum/N ;
 
  341     for (
int i=0 ; i<N ; i++){
 
  343       sdev += pow((bins[i] - bg_mean) , 2) ;
 
 
 
 
◆ fit()
Fits the hit nanobeacon signal to a model composed by a Landau and a Gauss functions. 
Definition at line 355 of file NBPulse.hh.
  357     if (
fitted==
true)   return ;
 
  361     w.SetName((std::string(
"W_") + 
htime_full->GetName()).c_str());
 
  371     RooLandau L1(
"L1" , 
"Main_Landau" , x , ml , sl) ;
 
  377     RooGaussian 
G1(
"G1" , 
"Main_Gaussian" , x , mg , sg) ;
 
  381     RooAddPdf M(
"Model" , 
"Model" , RooArgList(
G1,L1) , RooArgList(
c1));
 
  385     RooDataHist Data (
"data" , 
"data" , *
w.var(
"time") , Import(*
htime_full));
 
  393     RooRealVar Tpeak (
"tpeak" , 
"tpeak" , 
tpeak) ;
 
  395     RooRealVar Mpv(
"mpv" , 
"mpv" , Tmin.getVal()) ;
 
  397     RooRealVar Diff(
"peak-mpv" , 
"peak-mpv" , Tpeak.getVal() - Tmin.getVal()) ;
 
  399     double max_pdfval = 0 ;
 
  401     RooRealVar *var = (RooRealVar*)
w.function(
"Model")->getObservables(RooArgSet(*
w.var(
"time")))->first();
 
  403     for(
double x = Tmin.getVal() ; x<Tmax.getVal() ; x+=0.1){
 
  407       double pdfval = 
w.function(
"Model")->getVal(RooArgSet(*var)) ;
 
  409       if (pdfval>max_pdfval){
 
  411         max_pdfval = pdfval ;
 
 
 
 
◆ IsGood()
Check if the peak is good. 
- Returns
 - true if the peak is classified as good. 
 
Definition at line 439 of file NBPulse.hh.
 
 
◆ IsFitted()
  
  
      
        
          | bool NBPulse::IsFitted  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Check if the peak is fitted. 
- Returns
 - true if the peak has been fitted. 
 
Definition at line 451 of file NBPulse.hh.
 
 
◆ IsSaturatedHit()
  
  
      
        
          | bool NBPulse::IsSaturatedHit  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Check if the hit time distribution is saturated. 
- Returns
 - true if the hit time distributon is classified as saturated. 
 
Definition at line 463 of file NBPulse.hh.
 
 
◆ IsWeak()
Check if the hit time distribution is weak. 
- Returns
 - true if the hit time distributon is classified as weak. 
 
Definition at line 475 of file NBPulse.hh.
 
 
◆ getHtime_full()
  
  
      
        
          | TH1D* NBPulse::getHtime_full  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the hit time distribution. 
- Returns
 - histogram with hit time distribution 
 
Definition at line 488 of file NBPulse.hh.
 
 
◆ gettime_peak()
  
  
      
        
          | TH1D* NBPulse::gettime_peak  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the hit time distribution. 
- Returns
 - histogram with hit time distribution 
 
Definition at line 501 of file NBPulse.hh.
 
 
◆ gettot_peak()
  
  
      
        
          | TH1D* NBPulse::gettot_peak  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the hit time distribution. 
- Returns
 - histogram with hit time distribution 
 
Definition at line 514 of file NBPulse.hh.
 
 
◆ gettime_vs_tot()
  
  
      
        
          | TH2D* NBPulse::gettime_vs_tot  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the hit time vs ToT distribution. 
- Returns
 - a 2d histogram with hit time vs ToT distribution 
 
Definition at line 528 of file NBPulse.hh.
 
 
◆ getWorkspace()
  
  
      
        
          | RooWorkspace NBPulse::getWorkspace  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get all the information from the fit. 
- Returns
 - Roofit Workspace with all the information and parameters from the fit 
 
Definition at line 541 of file NBPulse.hh.
 
 
◆ getPeakTime()
  
  
      
        
          | double NBPulse::getPeakTime  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the arrival time of the nanobeacon pulse. 
- Returns
 - pulse arrival time 
 
Definition at line 554 of file NBPulse.hh.
 
 
◆ getMeanToT()
  
  
      
        
          | double NBPulse::getMeanToT  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the mean of the ToT distribution of the hits produced by the nanobeacon. 
- Returns
 - mean ToT value 
 
Definition at line 567 of file NBPulse.hh.
 
 
◆ getSigmaToT()
  
  
      
        
          | double NBPulse::getSigmaToT  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get the standard deviation of the ToT distribution of the hits produced by the nanobeacon. 
- Returns
 - standard deviation from ToT distribution 
 
Definition at line 580 of file NBPulse.hh.
 
 
◆ getName()
  
  
      
        
          | string NBPulse::getName  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get name of the hit time vs ToT histogram. 
- Returns
 - The name of the histogram. 
 
Definition at line 593 of file NBPulse.hh.
 
 
◆ time_vs_tot
  
  
      
        
          | TH2D* NBPulse::time_vs_tot | 
         
       
   | 
  
private   | 
  
 
 
◆ htime_full
  
  
      
        
          | TH1D* NBPulse::htime_full | 
         
       
   | 
  
private   | 
  
 
 
◆ htime_peak
  
  
      
        
          | TH1D * NBPulse::htime_peak | 
         
       
   | 
  
private   | 
  
 
 
◆ tot_peak
◆ baseline
  
  
      
        
          | pair<double , double> NBPulse::baseline | 
         
       
   | 
  
private   | 
  
 
 
◆ tlow
◆ thigh
◆ tpeak
◆ nhits
◆ meanToT
◆ sigmaToT
◆ max_ToT
◆ n_bins_right
  
  
      
        
          | int NBPulse::n_bins_right | 
         
       
   | 
  
private   | 
  
 
 
◆ n_bins_left
◆ n_bins_before_peak
  
  
      
        
          | int NBPulse::n_bins_before_peak | 
         
       
   | 
  
private   | 
  
 
 
◆ n_bins_afterpulse
  
  
      
        
          | int NBPulse::n_bins_afterpulse | 
         
       
   | 
  
private   | 
  
 
 
◆ max_n_bins_baseline
  
  
      
        
          | int NBPulse::max_n_bins_baseline | 
         
       
   | 
  
private   | 
  
 
 
◆ min_n_bins_baseline
  
  
      
        
          | int NBPulse::min_n_bins_baseline | 
         
       
   | 
  
private   | 
  
 
 
◆ n_sigma_peak
  
  
      
        
          | int NBPulse::n_sigma_peak | 
         
       
   | 
  
private   | 
  
 
 
◆ n_sigma_before_peak
  
  
      
        
          | int NBPulse::n_sigma_before_peak | 
         
       
   | 
  
private   | 
  
 
 
◆ fit_region_min
  
  
      
        
          | double NBPulse::fit_region_min | 
         
       
   | 
  
private   | 
  
 
 
◆ fit_region_max
  
  
      
        
          | double NBPulse::fit_region_max | 
         
       
   | 
  
private   | 
  
 
 
◆ fit_range_min
  
  
      
        
          | double NBPulse::fit_range_min | 
         
       
   | 
  
private   | 
  
 
 
◆ fit_range_max
  
  
      
        
          | double NBPulse::fit_range_max | 
         
       
   | 
  
private   | 
  
 
 
◆ landau_m_min
  
  
      
        
          | double NBPulse::landau_m_min | 
         
       
   | 
  
private   | 
  
 
 
◆ landau_m_max
  
  
      
        
          | double NBPulse::landau_m_max | 
         
       
   | 
  
private   | 
  
 
 
◆ landau_s_min
  
  
      
        
          | double NBPulse::landau_s_min | 
         
       
   | 
  
private   | 
  
 
 
◆ landau_s_max
  
  
      
        
          | double NBPulse::landau_s_max | 
         
       
   | 
  
private   | 
  
 
 
◆ gaus_m_min
  
  
      
        
          | double NBPulse::gaus_m_min | 
         
       
   | 
  
private   | 
  
 
 
◆ gaus_m_max
  
  
      
        
          | double NBPulse::gaus_m_max | 
         
       
   | 
  
private   | 
  
 
 
◆ gaus_s_min
  
  
      
        
          | double NBPulse::gaus_s_min | 
         
       
   | 
  
private   | 
  
 
 
◆ gaus_s_max
  
  
      
        
          | double NBPulse::gaus_s_max | 
         
       
   | 
  
private   | 
  
 
 
◆ l_g_ratio_min
  
  
      
        
          | double NBPulse::l_g_ratio_min | 
         
       
   | 
  
private   | 
  
 
 
◆ l_g_ratio_max
  
  
      
        
          | double NBPulse::l_g_ratio_max | 
         
       
   | 
  
private   | 
  
 
 
◆ KS_threshold
  
  
      
        
          | double NBPulse::KS_threshold | 
         
       
   | 
  
private   | 
  
 
 
◆ analyzed
◆ fitted
◆ is_good
◆ saturated_hit
  
  
      
        
          | bool NBPulse::saturated_hit | 
         
       
   | 
  
private   | 
  
 
 
◆ saturated_tot
  
  
      
        
          | bool NBPulse::saturated_tot | 
         
       
   | 
  
private   | 
  
 
 
◆ weak
The documentation for this class was generated from the following file: