pmtbaseline Class Reference
[AnalysisAnalysis]

User custom analysis class made by vic.genty. More...

#include <pmtbaseline.hh>

Inheritance diagram for pmtbaseline:

ana_base decoder_base List of all members.

Public Member Functions

 pmtbaseline ()
 Default constructor.
virtual ~pmtbaseline ()
 Default destructor.
virtual bool initialize ()
 Initialize method to be called before the event loop.
virtual bool analyze (storage_manager *storage)
 Analyze method to be called per event in a loop.
virtual bool finalize ()
 Finalize method to be called after the event loop.
void set_nsample_ped (UInt_t n)
 Setter for # of samples to be used for pedestal calculation.
void set_nsample_ped_tail (UInt_t n)
 Setter for # of samples to be used for pedestal calculation This sets # of samples to be used from the tail of the waveform in case pedestal sample from the beginning of the waveform is not good AND the user call use_tail function to allow this to happen.
void set_nsigma_threshold (double thres)
 Sets number of standard deviations from baseline mean to claim a pulse.
void set_adc_threshold (double thres)
 Sets absolute adc count (baseline subtracted, hence double type) to claim a pulse.
void set_use_tail (bool use)
 Sets boolean to use the tial pedestal sample.
void set_output_file (TFile *fout)
 A setter for analysis output file poitner.
void set_verbosity (MSG::Level level)
 Setter for the verbosity level.
MSG::Level get_verbosity () const
 Getter for the verbosity level.
const std::string class_name () const
 Getter for the class name.

Protected Attributes

TFile * _fout
 Analysis output file pointer.
char _buf [200]
 char buffer for message manipulation
bool _verbosity [MSG::MSG_TYPE_MAX]
 holder for enabled message levels
MSG::Level _verbosity_level
 holder for specified verbosity level
std::string _name
 class name holder

Private Member Functions

void clear_event ()
double mean (std::vector< UShort_t >, UInt_t)
 Calculate mean using input number of samples.
double rms (std::vector< UShort_t >, UInt_t, double)
 Calculate standard deviation using input number of samples & mean.
double tailmean (std::vector< UShort_t >, UInt_t)
 Same as mean(), but uses samples from the tail.
double tailrms (std::vector< UShort_t >, UInt_t, double)
 Same as rms(), but uses samples from the tail.
double time_reconstructor (double, PMT::ch_waveform_t::const_iterator)
 Sophisiticated time reconstruction algorithm by applying linear extrapolation of rising slope.
void histosetup ()

Private Attributes

TH2D * pedMean
 pedestal mean vs. channels
TH2D * pedRMS
 pedestal RMS vs. channels
TH2D * tailstudy
 pedestal mean vs. channels where mean is taken from tail samples
TH1D * tailMean
 1D histogram of pedestal mean taken from tail samples
TH1D * tailRMS
 1D histogram of pedestal rms taken from tail samples
TH1D * channels
 1D histogram of participating channels
TH1D * pedMeanAll
 1D histogram of pedetal mean (both from head & tail)
TH1D * pedRMSAll
 1D histogram of pedetal RMS (both from head & tail)
TH1D * tailMeanCutrms
 1D histogram of tail pedestal mean for RMS>0.5
TH1D * tailRMSCutrms
 1D histogram of tail pedestal rms for RMS>0.5
TH1D * pedMeanCutrms
 1D histogram of head pedestal mean for RMS>0.5
TH1D * pedRMSCutrms
 1D histogram of head pedestal rms for RMS>0.5
TH1D * reco_time
TH1D * reco_time_diff
TGraphErrors * rdbadwaveforms
TGraphErrors * bgbadwaveforms
bool _use_tail
bool _study_tail
UInt_t _bgpoints
UInt_t _rdpoints
double _ftailmean
double _ftailrms
double _fpedmean
double _fpedrms
double _nsigma
double _min_peak
int _max
std::vector< double > rd_waveforms
std::vector< double > rdticks
std::vector< double > bg_waveforms
std::vector< double > bgticks

Detailed Description

User custom analysis class made by vic.genty.

Definition at line 29 of file pmtbaseline.hh.


Constructor & Destructor Documentation

pmtbaseline::pmtbaseline (  ) 

Default constructor.

Definition at line 7 of file pmtbaseline.cc.

References _bgpoints, ana_base::_fout, _min_peak, decoder_base::_name, _nsigma, _rdpoints, _study_tail, _use_tail, and clear_event().

00007                         {
00008 
00009   _name="pmtbaseline"; 
00010   _fout=0;
00011 
00012   _study_tail=false;
00013   _use_tail=false;
00014   _bgpoints  = 1;
00015   _rdpoints  = 1;
00016   _nsigma   = 5.0;  // 5 times standard deviaiton ~ 2.5 ADC count
00017   _min_peak = 5.0;  // 2.5 ADC count above baseline
00018 
00019   clear_event();
00020 
00021 }

virtual pmtbaseline::~pmtbaseline (  )  [inline, virtual]

Default destructor.

Definition at line 37 of file pmtbaseline.hh.

00037 {};  


Member Function Documentation

bool pmtbaseline::analyze ( storage_manager storage  )  [virtual]

Analyze method to be called per event in a loop.

Implements ana_base.

Definition at line 143 of file pmtbaseline.cc.

References _bgpoints, _fpedmean, _fpedrms, _ftailmean, _ftailrms, _max, _min_peak, _nsigma, _study_tail, _use_tail, bg_waveforms, bgticks, channels, pulse_info::charge(), clear_event(), MSG::ERROR, pmt_wf_collection::event_id(), storage_manager::get_data(), mean(), pedMean, pedMeanAll, pedMeanCutrms, pedRMS, pedRMSAll, pedRMSCutrms, DATA_STRUCT::PMT_WF_COLLECTION, DATA_STRUCT::PULSE_COLLECTION, pulse_info::pulse_peak(), reco_time, reco_time_diff, rms(), Message::send(), pulse_info::set_channel_frame_id(), pulse_info::set_channel_number(), pulse_info::set_charge(), pulse_info::set_disc_id(), pulse_info::set_end_time(), pulse_info::set_max_time(), pulse_collection::set_npulse(), pulse_info::set_ped_mean(), pulse_info::set_ped_rms(), pulse_info::set_pulse_peak(), pulse_info::set_start_time(), pulse_info::set_start_time_reco(), pulse_collection::set_sum_charge(), pulse_collection::set_sum_peak(), pulse_info::set_timeslice(), tailmean(), tailrms(), tailstudy, and time_reconstructor().

00143                                                   {
00144   //New event
00145   clear_event();
00146   
00147   //Set points to hold number of kept points
00148   _max      = 15;
00149   
00150   double event_charge=0;
00151   double event_amplitude=0;
00152   int npulse=0;
00153 
00154   //Get event waveform from storage
00155   pmt_wf_collection   *ewform = (pmt_wf_collection*)(storage->get_data(DATA_STRUCT::PMT_WF_COLLECTION));
00156   pulse_collection *pulses = (pulse_collection*)(storage->get_data(DATA_STRUCT::PULSE_COLLECTION));
00157   
00158   //looping through all channels
00159   for(size_t i=0; i<ewform->size(); ++i){
00160     const pmt_waveform* pmt_data = &(ewform->at(i));
00161 
00162     if(pmt_data->size()<1){
00163       Message::send(MSG::ERROR,__FUNCTION__,
00164             Form("Found 0-length waveform: Event %d ... Ch. %d",ewform->event_id(),pmt_data->channel_number()));
00165       continue;
00166     }
00167 
00168     _fpedmean = mean((*pmt_data),_bgpoints         );
00169     _fpedrms  = rms ((*pmt_data),_bgpoints,_fpedmean);      
00170 
00171 
00172     if(_fpedrms>0.5 && _use_tail){
00173       _fpedmean = tailmean((*pmt_data),_bgpoints         );
00174       _fpedrms  = tailrms ((*pmt_data),_bgpoints,_fpedmean);      
00175     } 
00176     // Mean rms can be still bad! But we continue...(warning)
00177 
00178     pedMean     -> Fill( pmt_data->channel_number(), _fpedmean );
00179     pedRMS      -> Fill( pmt_data->channel_number(), _fpedrms  );
00180     pedMeanAll  -> Fill(  _fpedmean            );
00181     pedRMSAll   -> Fill(  _fpedrms             );
00182     channels    -> Fill( pmt_data->channel_number() );
00183     
00184     //Cut on high RMS
00185     if(_fpedrms>0.5){
00186       pedMeanCutrms->Fill(_fpedmean);
00187       pedRMSCutrms ->Fill(_fpedrms);
00188       
00189       for(UShort_t k=0;k<(*pmt_data).size();k++){
00190     bg_waveforms.push_back((double)(*pmt_data).at(k));
00191     bgticks.push_back((double)k);
00192       }
00193     }
00194     
00195     bool fire = false;
00196     int time_counter = 0;
00197     double t_start   = 0;
00198     double t_start_reco = 0;
00199     double t_start_diff = 0;
00200     double t_max     = 0;
00201     double t_end     = 0;
00202     double a_pulse   = 0;
00203     double q_pulse   = 0;
00204     
00205     //Going through all bins in waveform
00206     for(PMT::ch_waveform_t::const_iterator adc_itr((*pmt_data).begin());
00207     adc_itr!=(*pmt_data).end(); ++adc_itr) {
00208       if(!fire && (*adc_itr)>(_nsigma*_fpedrms+_fpedmean) && (*adc_itr)>(_min_peak+_fpedmean)) {
00209     fire    = true;
00210     t_start = time_counter;
00211 
00212     t_start_diff = time_reconstructor(_fpedmean, adc_itr);
00213     t_start_reco = t_start + time_reconstructor(_fpedmean, adc_itr);
00214 
00215     reco_time->Fill(t_start_reco);
00216     reco_time_diff->Fill(t_start_diff);
00217     q_pulse = 0;
00218     a_pulse = 0;
00219       }
00220       
00221       if(fire) {
00222     if((*adc_itr)<(_nsigma*_fpedrms+_fpedmean) || (*adc_itr)<(_min_peak+_fpedmean)) {
00223       npulse++;
00224       fire  = false;
00225       t_end = time_counter;       
00226     
00227       pulse_info pulse;
00228       pulse.set_ped_mean  ( _fpedmean );
00229       pulse.set_ped_rms   ( _fpedrms  );
00230       pulse.set_charge    ( q_pulse  );
00231       pulse.set_pulse_peak( a_pulse  );
00232       pulse.set_start_time( t_start  );
00233       pulse.set_start_time_reco( t_start_reco );
00234       pulse.set_end_time  ( t_end    );
00235       pulse.set_max_time  ( t_max    );
00236       pulse.set_channel_number(pmt_data->channel_number());
00237       pulse.set_timeslice((*pmt_data).timeslice());
00238       pulse.set_channel_frame_id((*pmt_data).channel_frame_id());
00239       pulse.set_disc_id((*pmt_data).disc_id());
00240       pulses->push_back(pulse);
00241       
00242       event_charge     += pulse.charge(); 
00243       event_amplitude  += pulse.pulse_peak();
00244       
00245     } else {
00246       q_pulse += (*adc_itr) - _fpedmean;
00247       if((*adc_itr) > (a_pulse + _fpedmean)) {
00248         a_pulse= (*adc_itr) - _fpedmean;
00249         t_max=time_counter;
00250       } 
00251     }
00252     
00253       }//end fire
00254       
00255       
00256       time_counter++;
00257     } //End ADCs
00258     
00259     
00260     //Study tail
00261     if(_study_tail && i == 6){
00262       for(int k=3;k<=_max;++k)
00263     {
00264       _ftailmean  = tailmean((*pmt_data),k);
00265       _ftailrms   = tailrms ((*pmt_data),k,_ftailmean);
00266       tailstudy -> Fill((double)k,_ftailmean);
00267     }
00268     }
00269     
00270     
00271   } //End Channels
00272   
00273   pulses->set_sum_charge(event_charge   );  
00274   pulses->set_sum_peak  (event_amplitude);  
00275   pulses->set_npulse    (npulse         );
00276   
00277   /*/// The following is for modifying pulse info ... NOT FOR CREATING!
00278     pulse_collection* pulse_group = ((storage_manager*)storage)->get_pulse_collection_writeable();
00279     for(pulse_collection::iterator iter(pulse_group->begin());
00280     iter!=pulse_group->end();
00281     ++iter)
00282     {
00283     (*iter).channel_number();
00284     (*iter).set_start_time(10);
00285     }*/
00286   
00287   
00288   return true;
00289 }

const std::string decoder_base::class_name (  )  const [inline, inherited]

Getter for the class name.

Definition at line 46 of file decoder_base.hh.

References decoder_base::_name.

00046 {return _name;};

void pmtbaseline::clear_event (  )  [private]

Definition at line 23 of file pmtbaseline.cc.

References _fpedmean, _fpedrms, _ftailmean, and _ftailrms.

Referenced by analyze(), and pmtbaseline().

00023                              {
00024   _fpedmean  = 0.0;
00025   _fpedrms   = 0.0;
00026   _ftailmean = 0.0;
00027   _ftailrms  = 0.0;
00028 
00029 }

bool pmtbaseline::finalize (  )  [virtual]

Finalize method to be called after the event loop.

Implements ana_base.

Definition at line 291 of file pmtbaseline.cc.

References ana_base::_fout, bg_waveforms, bgbadwaveforms, bgticks, channels, MSG::ERROR, pedMean, pedRMS, rd_waveforms, rdbadwaveforms, rdticks, reco_time, reco_time_diff, Message::send(), tailMean, tailMeanCutrms, tailRMS, tailRMSCutrms, and tailstudy.

00291                            {
00292 
00293   int n = rdticks.size();
00294   rdbadwaveforms = new TGraphErrors(n,&rdticks[0],&rd_waveforms[0]);
00295   rdbadwaveforms->SetName("rd_badwforms");
00296   rdbadwaveforms->SetTitle("ADC count vs. Time tick - Random");
00297   
00298   
00299   int t = bgticks.size();
00300   bgbadwaveforms = new TGraphErrors(t,&bgticks[0],&bg_waveforms[0]);
00301   bgbadwaveforms->SetName("bg_badwforms");
00302   bgbadwaveforms->SetTitle("ADC count vs. Time tick - Beam Gate");
00303   if(_fout){
00304   _fout          -> cd();
00305   pedMean        -> Write();
00306   pedRMS         -> Write();
00307   channels       -> Write();
00308   tailMean       -> Write();
00309   tailRMS        -> Write();
00310   tailstudy      -> Write();
00311   rdbadwaveforms -> Write();
00312   bgbadwaveforms -> Write();
00313   tailMeanCutrms -> Write();
00314   tailRMSCutrms  -> Write();
00315   reco_time      -> Write();
00316   reco_time_diff -> Write();
00317   /*  peakheights -> Write();
00318   peakareas   -> Write();
00319   nptstaken   -> Write();*/
00320   }else{
00321     Message::send(MSG::ERROR,__FUNCTION__,"Analysis output file not available!");
00322   }
00323   return true;
00324 }

MSG::Level decoder_base::get_verbosity (  )  const [inline, inherited]

Getter for the verbosity level.

Definition at line 43 of file decoder_base.hh.

References decoder_base::_verbosity_level.

00043 {return _verbosity_level;};

void pmtbaseline::histosetup (  )  [private]

Definition at line 111 of file pmtbaseline.cc.

References channels, pedMean, pedMeanAll, pedMeanCutrms, pedRMS, pedRMSAll, pedRMSCutrms, reco_time, reco_time_diff, tailMean, tailMeanCutrms, tailRMS, tailRMSCutrms, and tailstudy.

Referenced by initialize().

00111                             {
00112   
00113   pedMean     = new TH2D("bg_pedMean","Ped Mean (_bgpoints)",40,0,40,400,2000,2200);
00114   pedRMS      = new TH2D("bg_pedRMS","Ped RMS (bdpoints)",40,0,40,300,0,30);
00115   tailstudy   = new TH2D("rd_tailstudy","Tail Study",16,0,16,600,1900,2200);
00116 
00117   pedMeanAll  = new TH1D("bg_pedMeanAll","Ped Mean (all chan)",400 ,2000,2200 );
00118   pedRMSAll   = new TH1D("bg_pedRMSAll" ,"Ped RMS  (all chan)" ,300 ,0   ,30   );
00119 
00120   pedMeanCutrms  = new TH1D("bg_pedMeanCut","Ped Mean (rms>0.5 all chan)",400 ,2000,2200 );
00121   pedRMSCutrms   = new TH1D("bg_pedRMSCut" ,"Ped RMS  (rms>0.5 all chan)" ,300 ,0   ,30   );
00122  
00123   channels    = new TH1D("bg_channels","Beam Gate Channels",40,0,40); 
00124   tailMean    = new TH1D("rd_tailMean","Ped Tail Mean (_rdpoints)",400,2000,2200);
00125   tailRMS     = new TH1D("rd_tailRMS","Ped Tail RMS (_rdpoints)",100,0,10);
00126   
00127   tailMeanCutrms    = new TH1D("rd_tailMeanCut","Ped Tail Mean (rms>0.5)",400,2000,2200);
00128   tailRMSCutrms     = new TH1D("rd_tailRMSCut","Ped Tail RMS (rms>0.5)",100,0,10);
00129   reco_time = new TH1D("reco_time", "Reconstructed Start Time", 100, 0 , 50);
00130   reco_time_diff = new TH1D("reco_time_diff", "Reconstructed Start Time Diff: start - reco", 100, -5, 5);
00131   /*
00132     peakheights = new TH1D("peakheights","Subtracted Pulse Heights",500,0,1000);
00133     peakareas = new TH1D("peakareas","Areas",1125,0,5000);
00134     nptstaken = new TH1D("npointstake","Num. Points Taken for A.",40,0,80);
00135   */
00136 }

bool pmtbaseline::initialize (  )  [virtual]

Initialize method to be called before the event loop.

Implements ana_base.

Definition at line 138 of file pmtbaseline.cc.

References histosetup().

00138                              {
00139   histosetup();  
00140   return true;
00141 }

double pmtbaseline::mean ( std::vector< UShort_t >  ,
UInt_t   
) [private]

Calculate mean using input number of samples.

Definition at line 31 of file pmtbaseline.cc.

References Message::send(), and MSG::WARNING.

Referenced by analyze(), and tailmean().

00031                                                                 {
00032   double mean = 0;
00033   UShort_t holder = 0;
00034   size_t index=0;
00035 
00036   for(index=0;index<bgpoints && index<adcs.size() ;index++)
00037     holder += adcs.at(index);
00038 
00039   if( index!=bgpoints )
00040     Message::send(MSG::WARNING,__FUNCTION__,
00041           Form("Waveform too short! Length: %d (need %d for baseline estimate).",(int)(adcs.size()),bgpoints));
00042 
00043   mean=((double)holder)/((double)index);
00044   return mean;
00045 }

double pmtbaseline::rms ( std::vector< UShort_t >  ,
UInt_t  ,
double   
) [private]

Calculate standard deviation using input number of samples & mean.

Definition at line 46 of file pmtbaseline.cc.

References Message::send(), and MSG::WARNING.

Referenced by analyze(), and tailrms().

00046                                                                             {
00047   
00048   double rms    = 0;
00049   double holder = 0;
00050   size_t index  = 0;
00051   for(index=0;index<bgpoints && index<adcs.size();index++){
00052     holder += pow((double)adcs.at(index)-mean,2);
00053   }
00054 
00055   if( index!=bgpoints )
00056     Message::send(MSG::WARNING,__FUNCTION__,
00057           Form("Waveform too short! Length: %d (need %d for baseline estimate).",(int)(adcs.size()),bgpoints));
00058 
00059   holder=holder/((double)index);
00060   
00061   rms = sqrt(holder);
00062   return rms;
00063 }

void pmtbaseline::set_adc_threshold ( double  thres  )  [inline]

Sets absolute adc count (baseline subtracted, hence double type) to claim a pulse.

Definition at line 66 of file pmtbaseline.hh.

References _min_peak.

00066 {_min_peak=thres;};

void pmtbaseline::set_nsample_ped ( UInt_t  n  )  [inline]

Setter for # of samples to be used for pedestal calculation.

By default this sample is taken from the beginning of the waveform

Definition at line 52 of file pmtbaseline.hh.

References _bgpoints.

00052 {_bgpoints=n;};

void pmtbaseline::set_nsample_ped_tail ( UInt_t  n  )  [inline]

Setter for # of samples to be used for pedestal calculation This sets # of samples to be used from the tail of the waveform in case pedestal sample from the beginning of the waveform is not good AND the user call use_tail function to allow this to happen.

Definition at line 60 of file pmtbaseline.hh.

References _rdpoints.

00060 {_rdpoints=n;};

void pmtbaseline::set_nsigma_threshold ( double  thres  )  [inline]

Sets number of standard deviations from baseline mean to claim a pulse.

Definition at line 63 of file pmtbaseline.hh.

References _nsigma.

00063 {_nsigma=thres;};

void ana_base::set_output_file ( TFile *  fout  )  [inline, inherited]

A setter for analysis output file poitner.

Definition at line 46 of file ana_base.hh.

References ana_base::_fout.

00046 {_fout=fout;};

void pmtbaseline::set_use_tail ( bool  use  )  [inline]

Sets boolean to use the tial pedestal sample.

Definition at line 69 of file pmtbaseline.hh.

References _use_tail.

00069 {_use_tail=use;};

void decoder_base::set_verbosity ( MSG::Level  level  )  [inherited]

Setter for the verbosity level.

Reimplemented in ana_processor.

Definition at line 11 of file decoder_base.cc.

References decoder_base::_verbosity, decoder_base::_verbosity_level, MSG::DEBUG, MSG::ERROR, MSG::INFO, MSG::MSG_TYPE_MAX, MSG::NORMAL, and MSG::WARNING.

Referenced by algo_slow_readout_decoder::algo_slow_readout_decoder(), compare_content(), decoder_base::decoder_base(), decoder_manager::decoder_manager(), decoder_manager::initialize(), main(), xmit_event_search::run(), bin_word_search::run(), and ana_processor::set_verbosity().

00011                                               {
00012 
00013   _verbosity_level=level;
00014 
00015   for(size_t i=(size_t)(MSG::DEBUG); i<(size_t)(MSG::MSG_TYPE_MAX); ++i)
00016     _verbosity[i]=false;
00017 
00018   switch(level){
00019   case MSG::DEBUG:
00020     _verbosity[MSG::DEBUG]=true;
00021   case MSG::INFO:
00022     _verbosity[MSG::INFO]=true;
00023   case MSG::NORMAL:
00024     _verbosity[MSG::NORMAL]=true;
00025   case MSG::WARNING:
00026     _verbosity[MSG::WARNING]=true;
00027   case MSG::ERROR:
00028     _verbosity[MSG::ERROR]=true;
00029   case MSG::MSG_TYPE_MAX:
00030     break;
00031   }
00032 
00033 }

double pmtbaseline::tailmean ( std::vector< UShort_t >  ,
UInt_t   
) [private]

Same as mean(), but uses samples from the tail.

Definition at line 79 of file pmtbaseline.cc.

References mean(), Message::send(), and MSG::WARNING.

Referenced by analyze().

00079                                                                     {
00080   double mean = 0;
00081   UShort_t holder = 0;
00082   size_t index=0;
00083   for(index=adcs.size()-1;index>=(adcs.size()-rdpoints); index--)
00084     holder += adcs.at(index);
00085   
00086   if( (adcs.size()-index-1)!=rdpoints )
00087     Message::send(MSG::WARNING,__FUNCTION__,
00088           Form("Waveform too short! Length: %d (need %d for baseline estimate).",(int)(adcs.size()),rdpoints));
00089 
00090   mean=(double)holder/(double)rdpoints; 
00091   return mean;
00092     
00093 }

double pmtbaseline::tailrms ( std::vector< UShort_t >  ,
UInt_t  ,
double   
) [private]

Same as rms(), but uses samples from the tail.

Definition at line 95 of file pmtbaseline.cc.

References rms(), Message::send(), and MSG::WARNING.

Referenced by analyze().

00095                                                                                 {
00096   
00097   double rms    = 0;
00098   double holder = 0;
00099   size_t index  = 0;
00100   for(index=adcs.size()-1;index>=(adcs.size()-rdpoints);index--)
00101     holder += pow((double)adcs.at(index)-mean,2)/rdpoints;
00102 
00103   if( (adcs.size()-index-1)!=rdpoints )
00104     Message::send(MSG::WARNING,__FUNCTION__,
00105           Form("Waveform too short! Length: %d (need %d for baseline estimate).",(int)(adcs.size()),rdpoints));
00106   
00107   rms = sqrt(holder);
00108   return rms;
00109 }

double pmtbaseline::time_reconstructor ( double  ,
PMT::ch_waveform_t::const_iterator   
) [private]

Sophisiticated time reconstruction algorithm by applying linear extrapolation of rising slope.

Definition at line 66 of file pmtbaseline.cc.

Referenced by analyze().

00066                                                                                              {
00067   double y1 = (*adc_itr)-fpedmean;
00068   adc_itr += 1;
00069   double y2 = (*adc_itr)-fpedmean;
00070   //x-axis measured in time_counter unit increments.
00071   //fine fraction of time_counter increments that designates start time
00072   double slope = (y2-y1)/1.0; //because Dx = 1 time_step
00073   //y = slope*x + x_0
00074   double time_reconstructed = y1/slope;
00075   return time_reconstructed;
00076 }


Member Data Documentation

UInt_t pmtbaseline::_bgpoints [private]

Definition at line 122 of file pmtbaseline.hh.

Referenced by analyze(), pmtbaseline(), and set_nsample_ped().

char decoder_base::_buf[200] [protected, inherited]

char buffer for message manipulation

Definition at line 46 of file decoder_base.hh.

Referenced by reco_wf::analyze(), pulse_viewer::analyze(), algo_slow_readout_decoder::check_event_quality(), storage_manager::close(), bin_io_handler::close(), decoder_manager::decode(), algo_slow_readout_decoder::decode_ch_word(), algo_pmt_xmit::decode_ch_word(), algo_slow_readout_decoder::decode_event_header(), pulse_viewer::get_waveform(), ana_processor::initialize(), pulse_viewer::next_pulse(), storage_manager::open(), bin_io_handler::open(), storage_manager::prepare_tree(), pulse_viewer::previous_pulse(), algo_slow_readout_decoder::print_adc_values(), algo_tpc_xmit::process_ch_word(), algo_slow_readout_decoder::process_ch_word(), algo_pmt_xmit::process_ch_word(), algo_fem_decoder_base::process_fem_header(), algo_xmit_decoder::process_header(), algo_slow_readout_decoder::process_header(), algo_slow_readout_decoder::process_word(), bin_io_handler::read_multi_word(), bin_io_handler::read_word(), and ana_processor::run().

TFile* ana_base::_fout [protected, inherited]

Analysis output file pointer.

Definition at line 46 of file ana_base.hh.

Referenced by ana_base::ana_base(), waveform_sampler::finalize(), pulse_reco::finalize(), pulse_analyzer::finalize(), pmtbaseline_ana::finalize(), finalize(), led_pulse_analyzer::finalize(), beamgate_debugger::finalize(), pulse_analyzer::initialize(), pmt_slow_encoder::pmt_slow_encoder(), pmtbaseline(), pmtbaseline_ana::pmtbaseline_ana(), pulse_selector_base::pulse_selector_base(), pulse_selector_simple::pulse_selector_simple(), waveform_sampler::sample_waveform(), ana_base::set_output_file(), and waveform_sampler::waveform_sampler().

double pmtbaseline::_fpedmean [private]

Definition at line 127 of file pmtbaseline.hh.

Referenced by analyze(), and clear_event().

double pmtbaseline::_fpedrms [private]

Definition at line 128 of file pmtbaseline.hh.

Referenced by analyze(), and clear_event().

double pmtbaseline::_ftailmean [private]

Definition at line 125 of file pmtbaseline.hh.

Referenced by analyze(), and clear_event().

double pmtbaseline::_ftailrms [private]

Definition at line 126 of file pmtbaseline.hh.

Referenced by analyze(), and clear_event().

int pmtbaseline::_max [private]

Definition at line 132 of file pmtbaseline.hh.

Referenced by analyze().

double pmtbaseline::_min_peak [private]

Definition at line 131 of file pmtbaseline.hh.

Referenced by analyze(), pmtbaseline(), and set_adc_threshold().

std::string decoder_base::_name [protected, inherited]

class name holder

Definition at line 53 of file decoder_base.hh.

Referenced by algo_base::algo_base(), algo_fem_decoder_base::algo_fem_decoder_base(), algo_fixed_window::algo_fixed_window(), algo_slow_readout_decoder::algo_slow_readout_decoder(), algo_threshold::algo_threshold(), algo_tpc_huffman::algo_tpc_huffman(), algo_trig_decoder::algo_trig_decoder(), ana_base::ana_base(), ana_processor::ana_processor(), beamgate_debugger::beamgate_debugger(), bin_io_handler::bin_io_handler(), decoder_base::class_name(), led_pulse_analyzer::led_pulse_analyzer(), led_pulse_selector::led_pulse_selector(), pmt_slow_encoder::pmt_slow_encoder(), pmtbaseline(), pmtbaseline_ana::pmtbaseline_ana(), preco_algo_base::preco_algo_base(), pulse_analyzer::pulse_analyzer(), pulse_reco::pulse_reco(), pulse_selector_base::pulse_selector_base(), pulse_selector_simple::pulse_selector_simple(), pulse_viewer::pulse_viewer(), reco_wf::reco_wf(), storage_manager::storage_manager(), and waveform_sampler::waveform_sampler().

double pmtbaseline::_nsigma [private]

Definition at line 130 of file pmtbaseline.hh.

Referenced by analyze(), pmtbaseline(), and set_nsigma_threshold().

UInt_t pmtbaseline::_rdpoints [private]

Definition at line 123 of file pmtbaseline.hh.

Referenced by pmtbaseline(), and set_nsample_ped_tail().

bool pmtbaseline::_study_tail [private]

Definition at line 120 of file pmtbaseline.hh.

Referenced by analyze(), and pmtbaseline().

bool pmtbaseline::_use_tail [private]

Definition at line 119 of file pmtbaseline.hh.

Referenced by analyze(), pmtbaseline(), and set_use_tail().

bool decoder_base::_verbosity[MSG::MSG_TYPE_MAX] [protected, inherited]

holder for enabled message levels

Definition at line 51 of file decoder_base.hh.

Referenced by reco_wf::analyze(), algo_slow_readout_decoder::check_event_quality(), storage_manager::close(), decoder_manager::decode(), algo_slow_readout_decoder::decode_ch_word(), algo_pmt_xmit::decode_ch_word(), algo_slow_readout_decoder::decode_event_header(), algo_fem_decoder_base::decode_fem_header(), algo_trig_decoder::decode_trigger_words(), decoder_manager::finalize(), beamgate_debugger::finalize(), ana_processor::finalize(), decoder_manager::initialize(), beamgate_debugger::initialize(), ana_processor::initialize(), storage_manager::open(), beamgate_debugger::prepare_histo(), storage_manager::prepare_tree(), algo_tpc_xmit::process_ch_word(), algo_tpc_huffman::process_ch_word(), algo_slow_readout_decoder::process_ch_word(), algo_pmt_xmit::process_ch_word(), algo_tpc_xmit::process_event_last_word(), algo_pmt_xmit::process_event_last_word(), algo_fem_decoder_base::process_fem_header(), algo_pmt_xmit::process_fem_last_word(), algo_xmit_decoder::process_header(), algo_slow_readout_decoder::process_header(), algo_fem_decoder_base::process_word(), bin_io_handler::read_multi_word(), storage_manager::reset(), beamgate_debugger::reset(), ana_processor::reset(), decoder_manager::run(), ana_processor::run(), decoder_base::set_verbosity(), algo_tpc_xmit::store_event(), and algo_pmt_xmit::store_event().

MSG::Level decoder_base::_verbosity_level [protected, inherited]

holder for specified verbosity level

Definition at line 52 of file decoder_base.hh.

Referenced by pulse_viewer::analyze(), decoder_base::get_verbosity(), pulse_viewer::initialize(), decoder_manager::initialize(), ana_processor::initialize(), bin_io_handler::read_multi_word(), bin_io_handler::read_word(), and decoder_base::set_verbosity().

std::vector<double> pmtbaseline::bg_waveforms [private]

Definition at line 139 of file pmtbaseline.hh.

Referenced by analyze(), and finalize().

TGraphErrors* pmtbaseline::bgbadwaveforms [private]

Definition at line 116 of file pmtbaseline.hh.

Referenced by finalize().

std::vector<double> pmtbaseline::bgticks [private]

Definition at line 140 of file pmtbaseline.hh.

Referenced by analyze(), and finalize().

TH1D* pmtbaseline::channels [private]

1D histogram of participating channels

Definition at line 97 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().

TH2D* pmtbaseline::pedMean [private]

pedestal mean vs. channels

Definition at line 91 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().

TH1D* pmtbaseline::pedMeanAll [private]

1D histogram of pedetal mean (both from head & tail)

Definition at line 98 of file pmtbaseline.hh.

Referenced by analyze(), and histosetup().

TH1D* pmtbaseline::pedMeanCutrms [private]

1D histogram of head pedestal mean for RMS>0.5

Definition at line 104 of file pmtbaseline.hh.

Referenced by analyze(), and histosetup().

TH2D* pmtbaseline::pedRMS [private]

pedestal RMS vs. channels

Definition at line 92 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().

TH1D* pmtbaseline::pedRMSAll [private]

1D histogram of pedetal RMS (both from head & tail)

Definition at line 99 of file pmtbaseline.hh.

Referenced by analyze(), and histosetup().

TH1D* pmtbaseline::pedRMSCutrms [private]

1D histogram of head pedestal rms for RMS>0.5

Definition at line 105 of file pmtbaseline.hh.

Referenced by analyze(), and histosetup().

std::vector<double> pmtbaseline::rd_waveforms [private]

Definition at line 136 of file pmtbaseline.hh.

Referenced by finalize().

TGraphErrors* pmtbaseline::rdbadwaveforms [private]

Definition at line 115 of file pmtbaseline.hh.

Referenced by finalize().

std::vector<double> pmtbaseline::rdticks [private]

Definition at line 137 of file pmtbaseline.hh.

Referenced by finalize().

TH1D* pmtbaseline::reco_time [private]

Definition at line 112 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().

TH1D* pmtbaseline::reco_time_diff [private]

Definition at line 113 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().

TH1D* pmtbaseline::tailMean [private]

1D histogram of pedestal mean taken from tail samples

Definition at line 95 of file pmtbaseline.hh.

Referenced by finalize(), and histosetup().

TH1D* pmtbaseline::tailMeanCutrms [private]

1D histogram of tail pedestal mean for RMS>0.5

Definition at line 101 of file pmtbaseline.hh.

Referenced by finalize(), and histosetup().

TH1D* pmtbaseline::tailRMS [private]

1D histogram of pedestal rms taken from tail samples

Definition at line 96 of file pmtbaseline.hh.

Referenced by finalize(), and histosetup().

TH1D* pmtbaseline::tailRMSCutrms [private]

1D histogram of tail pedestal rms for RMS>0.5

Definition at line 102 of file pmtbaseline.hh.

Referenced by finalize(), and histosetup().

TH2D* pmtbaseline::tailstudy [private]

pedestal mean vs. channels where mean is taken from tail samples

Definition at line 93 of file pmtbaseline.hh.

Referenced by analyze(), finalize(), and histosetup().


The documentation for this class was generated from the following files:
Generated on Mon Apr 7 15:35:13 2014 for MyProject by  doxygen 1.4.7