pulse_viewer Class Reference
[AnalysisAnalysis]

This is a class to visualize reconstructed pulse information together with the raw waveform on a histogram. More...

#include <pulse_viewer.hh>

Inheritance diagram for pulse_viewer:

ana_base decoder_base List of all members.

Public Member Functions

 pulse_viewer ()
 Default constructor.
virtual ~pulse_viewer ()
 Default destructor.
virtual bool initialize ()
 Initialization method to be called before the analysis event loop.
virtual bool analyze (storage_manager *storage)
 Analyze a data event-by-event.
virtual bool finalize ()
 Finalize method to be called after all events processed.
TH1D * next_pulse (PMT::ch_number_t ch)
 CORE METHOD 1 Given the channel number, this method iterates over the locally stored values for a reconstructed pulse.
TH1D * previous_pulse (PMT::ch_number_t ch)
 CORE METHOD 2 Reverse iteration over reconstructed pulse as opposed to the iteration in an ordinary order.
const TCanvas * get_canvas () const
 Getter for TCanvas object pointer on which waveform & pulse info are visualized.
const std::set< PMT::ch_number_tget_hit_channels () const
 Getter for a set of channel numbers on which hist pulses are found.
PMT::ch_number_t next_channel ()
 Iterator for a set of channels for which reconstructed pulses are found.
void display_cut_ranges ()
 Method to display cut values.
short get_npulse (PMT::ch_number_t ch)
 Returns # of reconstructed pulse for a specified channel number.
void set_range_pulse_start_time (double v1, double v2)
 Setter for the range of pusle start time to select pulses of interest.
void set_range_pulse_start_time_reco (double v1, double v2)
 Setter for the range of reconstructed pusle start time to select pulses of interest.
void set_range_pulse_end_time (double v1, double v2)
 Setter for the range of pusle end time to select pulses of interest..
void set_range_pulse_amp (double v1, double v2)
 Setter for the range of pusle amplitude to select pulses of interest..
void set_range_pulse_charge (double v1, double v2)
 Setter for the range of integrated charge to select pulses of interest..
void set_range_ped_mean (double v1, double v2)
 Setter for the range of pedestal mean value to select pulses of interest..
void set_range_ped_rms (double v1, double v2)
 Setter for the range of pedestal rms to select pulses of interest..
void set_range_event_id (PMT::word_t v1, PMT::word_t v2)
 Setter for the range of event id to select pulses of interest.
void set_range_channel (PMT::ch_number_t v1, PMT::ch_number_t v2)
 Setter for the range of channel numbers to select pulses of interest.
void set_range_sum_charge (double v1, double v2)
 Setter for the range of event charge sum to select pulses of interest.
void set_range_sum_peak (double v1, double v2)
 Setter for the range of event peak sum to select pulses of interest.
void set_range_npulse (double v1, double v2)
 Setter for the range of event-wise number of pulses to select pulses of interest.
const std::pair< double, double > range_pulse_start_time () const
 Getter for the range of pusle start time to select pulses of interest.
const std::pair< double, double > range_pulse_start_time_reco () const
 Getter for the range of pusle reconstructed start time to select pulses of interest.
const std::pair< double, double > range_pulse_end_time () const
 Getter for the range of pusle end time to select pulses of interest..
const std::pair< double, double > range_pulse_amp () const
 Getter for the range of pusle amplitude to select pulses of interest..
const std::pair< double, double > range_pulse_charge () const
 Getter for the range of integrated charge to select pulses of interest..
const std::pair< double, double > range_ped_mean () const
 Getter for the range of pedestal mean value to select pulses of interest..
const std::pair< double, double > range_ped_rms () const
 Getter for the range of pedestal rms to select pulses of interest..
const std::pair< PMT::word_t,
PMT::word_t
range_event_id () const
 Getter for the range of event id to select pulses of interest.
const std::pair< PMT::word_t,
PMT::word_t
range_channel () const
 Getter for the range of channel numbers to select pulses of interest.
const std::pair< double, double > range_sum_charge () const
 Getter for the range of event charge sum to select pulses of interest.
const std::pair< double, double > range_sum_peak () const
 Getter for the range of event peak sum to select pulses of interest.
const std::pair< UInt_t, UInt_t > range_npulse () const
 Getter for the range of event-wise number of pulses to select pulses of interest.
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 Member Functions

void set_style ()
 set Kazu's style
void reset_cuts ()
 reset cut values
void clear_map ()
 clear data holder map objects
void clear_viewer ()
 clear viewer related TObjects on the heap
TH1D * get_waveform (PMT::ch_number_t ch, size_t index)
 returns a waveform TH1D object .
void add_channel_entry (PMT::ch_number_t ch)
 a method to add entries to lots of map objects to hold pulse info

Protected Attributes

PMT::word_t _event_id
 event id holder
double _sum_charge
 event-wise summed charge holder
double _sum_peak
 event-wise summed peak height holder
UInt_t _npulse
 event-wise number of reco-ed pulse holder
std::set< PMT::ch_number_t_channels
 set of channel numbers for reco-ed pulses
std::set< PMT::ch_number_t
>::iterator 
_ch_iter
 internal iterator for _channels member
std::map< PMT::ch_number_t,
std::pair< short, short > > 
_pulse_count
 Map of pulse count: the first element in the pair holds the total reco-ed pulse count while the second element holds the internal index to be updated by pulse_viewer::next_pulse() and pulse_viewer::previous_pulse() methods.
std::map< PMT::ch_number_t,
std::vector< PMT::word_t > > 
_pulse_frame_id
 a set of frame id
std::map< PMT::ch_number_t,
std::vector< PMT::word_t > > 
_pulse_sample_number
 a set of sample numbers
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_tstart
 a set of reco-ed pulse start time
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_tstart_reco
 a set of reco-ed pulse reco-ed start time
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_tend
 a set of reco-ed pulse end time
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_amp
 a set of reco-ed pulse amplitude
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_charge
 a set of reco-ed pulse charge
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_pedbase
 a set of reco-ed pulse pedestal baseline mean
std::map< PMT::ch_number_t,
std::vector< double > > 
_pulse_pedrms
 a set of reco-ed pulse pedestal baseline standard deviation
std::map< PMT::ch_number_t,
std::map< PMT::word_t, std::map<
PMT::word_t, std::vector<
PMT::ch_adc_t > > > > 
_waveforms
 waveform containers
TCanvas * _cWF
 Local (yet main) canvas poitner.
TPad * _pTitle
 title pad
TPad * _pData
 data (histogram, numbers) pad
TPad * _pNote
 pulse parameters
TPad * _pWF
 waveform histogram
TText * _fTitle
 canvas title
TPaveText * _fNote
 pulse parameters
TH1D * _hWF
 Waveform container histogram pointer.
TLine * _lStart
 TLine pointers to display pule start time, end time, pedestal baseline mean and deviations.
TLine * _lEnd
TLine * _lBase
TLine * _lRMSTop
TLine * _lRMSBottom
TLine * _lTop
std::pair< double, double > _cut_tstart
 pairs to define a range of pulse parameters for displaying pulses.
std::pair< double, double > _cut_tstart_reco
std::pair< double, double > _cut_tend
std::pair< double, double > _cut_amp
std::pair< double, double > _cut_charge
std::pair< double, double > _cut_pedbase
std::pair< double, double > _cut_pedrms
std::pair< double, double > _cut_sum_charge
 pairs to define a range of event parameters for displaying pulses.
std::pair< double, double > _cut_sum_peak
std::pair< UInt_t, UInt_t > _cut_npulse
 pairs to define a range of event parameters for displaying pulses.
std::pair< PMT::word_t, PMT::word_t_cut_event_id
 a pair to define a range of event id for displaying pulses.
std::pair< PMT::ch_number_t,
PMT::ch_number_t
_cut_channels
 a pair to define a range of channel numbers for displaying pulses.
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

Detailed Description

This is a class to visualize reconstructed pulse information together with the raw waveform on a histogram.

This helps to debug/understand pulse reconstruction algorithm output. It is meant to be used interactively and not in a batch mode as it does not store any objects in an output. It allows a user to specify a range for various pulse-wise and event-wise parameters so that one can filter out irrelevant pulses from visualization routine (which can take time). See Analysis/mac/pulse_viewer.py for an example usage.

Definition at line 42 of file pulse_viewer.hh.


Constructor & Destructor Documentation

pulse_viewer::pulse_viewer (  ) 

Default constructor.

Definition at line 6 of file pulse_viewer.cc.

References _cWF, _hWF, _lBase, _lEnd, _lRMSBottom, _lRMSTop, _lStart, _lTop, decoder_base::_name, clear_viewer(), and reset_cuts().

00006                            { 
00007   _name="pulse_viewer"; 
00008   _cWF=0;
00009   _hWF=0;
00010   _lStart=0;
00011   _lEnd=0;
00012   _lBase=0;
00013   _lRMSTop=0;
00014   _lRMSBottom=0;
00015   _lTop=0;
00016   
00017   clear_viewer();
00018   reset_cuts();
00019 
00020 }

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

Default destructor.

Definition at line 50 of file pulse_viewer.hh.

00050 {};


Member Function Documentation

void pulse_viewer::add_channel_entry ( PMT::ch_number_t  ch  )  [protected]

a method to add entries to lots of map objects to hold pulse info

Definition at line 107 of file pulse_viewer.cc.

References _channels, _pulse_amp, _pulse_charge, _pulse_count, _pulse_frame_id, _pulse_pedbase, _pulse_pedrms, _pulse_sample_number, _pulse_tend, _pulse_tstart, _pulse_tstart_reco, and _waveforms.

Referenced by analyze().

00107                                                      {
00108 
00109   _channels.insert(ch);
00110   _pulse_frame_id[ch]=std::vector<PMT::word_t>();
00111   _pulse_sample_number[ch]=std::vector<PMT::word_t>();
00112   _pulse_tstart[ch]=std::vector<double>();
00113   _pulse_tstart_reco[ch]=std::vector<double>();
00114   _pulse_tend[ch]=std::vector<double>();
00115   _pulse_amp[ch]=std::vector<double>();
00116   _pulse_charge[ch]=std::vector<double>();
00117   _pulse_pedbase[ch]=std::vector<double>();
00118   _pulse_pedrms[ch]=std::vector<double>();
00119   _pulse_count[ch]=std::make_pair(0,0);
00120 
00121   _waveforms[ch]=std::map<PMT::word_t,std::map<PMT::word_t,std::vector<PMT::ch_adc_t> > >();
00122 
00123 }

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

Analyze a data event-by-event.

Implements ana_base.

Definition at line 125 of file pulse_viewer.cc.

References decoder_base::_buf, _ch_iter, _channels, _cut_amp, _cut_channels, _cut_charge, _cut_event_id, _cut_npulse, _cut_pedbase, _cut_pedrms, _cut_sum_charge, _cut_sum_peak, _cut_tend, _cut_tstart, _cut_tstart_reco, _event_id, _npulse, _pulse_amp, _pulse_charge, _pulse_count, _pulse_frame_id, _pulse_pedbase, _pulse_pedrms, _pulse_sample_number, _pulse_tend, _pulse_tstart, _pulse_tstart_reco, _sum_charge, _sum_peak, decoder_base::_verbosity_level, _waveforms, add_channel_entry(), clear_map(), MSG::DEBUG, MSG::ERROR, pmt_wf_collection::event_id(), DATA_STRUCT::FIXED_WIN_PULSE_COLLECTION, storage_manager::get_data(), pulse_collection::npulse(), DATA_STRUCT::PMT_WF_COLLECTION, DATA_STRUCT::PULSE_COLLECTION, Message::send(), pulse_collection::sum_charge(), pulse_collection::sum_peak(), and DATA_STRUCT::THRES_WIN_PULSE_COLLECTION.

00125                                                    {
00126 
00127   if(_verbosity_level==MSG::DEBUG)
00128 
00129     Message::send(MSG::DEBUG,__PRETTY_FUNCTION__,"called...");
00130   
00131   pulse_collection *pulses = (pulse_collection*)(storage->get_data(DATA_STRUCT::PULSE_COLLECTION));
00132   pmt_wf_collection   *wfs    = (pmt_wf_collection*)(storage->get_data(DATA_STRUCT::PMT_WF_COLLECTION));
00133   _ch_iter     = _channels.begin();
00134 
00135 
00136   if(!pulses)
00137     pulses = (pulse_collection*)(storage->get_data(DATA_STRUCT::FIXED_WIN_PULSE_COLLECTION));
00138 
00139   if(!pulses)
00140     pulses = (pulse_collection*)(storage->get_data(DATA_STRUCT::THRES_WIN_PULSE_COLLECTION));
00141 
00142   if(pulses->size()==0) {
00143     Message::send(MSG::ERROR,__FUNCTION__,"No Pulse Found!");
00144     return false;
00145   }
00146   if(wfs->size()==0) {
00147     Message::send(MSG::ERROR,__FUNCTION__,"No Waveforms Found!");
00148     return false;
00149   }
00150 
00151   _event_id    = wfs->event_id();
00152   _sum_charge  = pulses->sum_charge();
00153   _sum_peak    = pulses->sum_peak();
00154   _npulse      = pulses->npulse();
00155 
00156   // Check if this event is in the range of users' interest
00157   if(_event_id < _cut_event_id.first || _cut_event_id.second < _event_id)
00158     return true;
00159   else if(_sum_charge < _cut_sum_charge.first || _cut_sum_charge.second < _sum_charge)
00160     return true;
00161   else if(_sum_peak < _cut_sum_peak.first || _cut_sum_peak.second < _sum_peak)
00162     return true;
00163   else if(_npulse < _cut_npulse.first || _cut_npulse.second < _npulse)
00164     return true;
00165 
00166   // Clear map
00167   clear_map();
00168 
00169   // Fill map for this event
00170   for(pulse_collection::const_iterator iter(pulses->begin());
00171       iter!=pulses->end();
00172       ++iter){
00173 
00174     PMT::ch_number_t ch((*iter).channel_number());
00175     PMT::word_t sample   = (*iter).timeslice();
00176     PMT::word_t frame    = (*iter).frame_id();
00177     double      t_start  = (*iter).start_time();
00178     double      t_end    = (*iter).end_time();
00179     double      charge   = (*iter).charge();
00180     double      amp      = (*iter).pulse_peak();
00181     double      ped_base = (*iter).ped_mean();
00182     double      ped_rms  = (*iter).ped_rms();
00183     double      t_start_reco = (*iter).start_time_reco();
00184 
00185     // Check if this pulse passes the criteria
00186     if(ch < _cut_channels.first || _cut_channels.second < ch)
00187       continue;
00188     if(t_start_reco < _cut_tstart_reco.first || _cut_tstart_reco.second < t_start_reco)
00189       continue;
00190     if(t_start < _cut_tstart.first || _cut_tstart.second < t_start)
00191       continue;
00192     if(t_end < _cut_tend.first || _cut_tend.second < t_end)
00193       continue;
00194     if(charge < _cut_charge.first || _cut_charge.second < charge)
00195       continue;
00196     if(amp < _cut_amp.first || _cut_amp.second < amp)
00197       continue;
00198     if(ped_base < _cut_pedbase.first || _cut_pedbase.second < ped_base)
00199       continue;
00200     if(ped_rms < _cut_pedrms.first || _cut_pedrms.second < ped_rms)
00201       continue;    
00202 
00203     if(_channels.find(ch)==_channels.end())
00204       add_channel_entry(ch);
00205 
00206     _pulse_frame_id[ch].push_back(frame);
00207     _pulse_sample_number[ch].push_back(sample);
00208     _pulse_tstart[ch].push_back(t_start);
00209     _pulse_tstart_reco[ch].push_back(t_start_reco);
00210     _pulse_tend[ch].push_back(t_end);
00211     _pulse_amp[ch].push_back(amp);
00212     _pulse_charge[ch].push_back(charge);
00213     _pulse_pedbase[ch].push_back(ped_base);
00214     _pulse_pedrms[ch].push_back(ped_rms);
00215     
00216     if(_waveforms[ch].find(frame)==_waveforms[ch].end())
00217       _waveforms[ch][frame]=std::map<PMT::word_t,std::vector<PMT::ch_adc_t> >();
00218 
00219     if(_waveforms[ch][frame].find(sample) == _waveforms[ch][frame].end())
00220       _waveforms[ch][frame][sample]=std::vector<PMT::ch_adc_t>();
00221 
00222     _pulse_count[ch].first+=1;
00223   }
00224 
00225 
00226 
00227   for(pmt_wf_collection::const_iterator ch_iter(wfs->begin());
00228       ch_iter!=wfs->end();
00229       ++ch_iter){
00230     PMT::ch_number_t ch        = (*ch_iter).channel_number();
00231     PMT::word_t this_timeslice = (*ch_iter).timeslice();
00232     PMT::word_t this_frame_id  = (*ch_iter).channel_frame_id();
00233 
00234     if(_waveforms.find(ch) == _waveforms.end())
00235       continue;
00236     if(_waveforms[ch].find(this_frame_id)==_waveforms[ch].end())
00237       continue;
00238     if(_waveforms[ch][this_frame_id].find(this_timeslice) == _waveforms[ch][this_frame_id].end())
00239       continue;
00240 
00241     if(_waveforms[ch][this_frame_id][this_timeslice].size()) {
00242       sprintf(_buf,"Found already filled waveform (ch=%d, frame=%d, sample=%d)",
00243           ch,this_frame_id,this_timeslice);
00244       Message::send(MSG::ERROR,__FUNCTION__,_buf);
00245       continue;
00246     }
00247     
00248     // Fill the waveform vector
00249     for(pmt_waveform::const_iterator adc_iter((*ch_iter).begin());
00250     adc_iter!=(*ch_iter).end();
00251     ++adc_iter){      
00252       _waveforms[ch][this_frame_id][this_timeslice].push_back((*adc_iter));
00253     }
00254         
00255   } // Finieh processing for this channel.
00256 
00257   _ch_iter=_channels.begin();
00258   std::cout<<_channels.size()<<std::endl;
00259 
00260   return true;
00261 }

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 pulse_viewer::clear_map (  )  [protected]

clear data holder map objects

Definition at line 90 of file pulse_viewer.cc.

References _channels, _pulse_amp, _pulse_charge, _pulse_count, _pulse_frame_id, _pulse_pedbase, _pulse_pedrms, _pulse_sample_number, _pulse_tend, _pulse_tstart, _pulse_tstart_reco, and _waveforms.

Referenced by analyze(), and initialize().

00090                             {
00091 
00092   _pulse_frame_id.clear();
00093   _pulse_sample_number.clear();
00094   _pulse_tstart.clear();
00095   _pulse_tstart_reco.clear();
00096   _pulse_tend.clear();
00097   _pulse_amp.clear();
00098   _pulse_charge.clear();
00099   _pulse_pedbase.clear();
00100   _pulse_pedrms.clear();
00101   _waveforms.clear();
00102   _pulse_count.clear();
00103   _channels.clear();
00104 
00105 }

void pulse_viewer::clear_viewer (  )  [protected]

clear viewer related TObjects on the heap

Definition at line 39 of file pulse_viewer.cc.

References _hWF, _lBase, _lEnd, _lRMSBottom, _lRMSTop, _lStart, and _lTop.

Referenced by finalize(), get_waveform(), initialize(), and pulse_viewer().

00039                                 {
00040   
00041   if(_hWF) delete _hWF;
00042   if(_lStart) delete _lStart;
00043   if(_lEnd) delete _lEnd;
00044   if(_lBase) delete _lBase;
00045   if(_lRMSTop) delete _lRMSTop;
00046   if(_lRMSBottom) delete _lRMSBottom;
00047   if(_lTop) delete _lTop;
00048 }

void pulse_viewer::display_cut_ranges (  ) 

Method to display cut values.

Definition at line 546 of file pulse_viewer.cc.

References _cut_amp, _cut_channels, _cut_charge, _cut_event_id, _cut_npulse, _cut_pedbase, _cut_pedrms, _cut_sum_charge, _cut_sum_peak, _cut_tend, _cut_tstart, _cut_tstart_reco, MSG::NORMAL, and Message::send().

00546                                      {
00547 
00548   std::string msg("Displaying the currently set values for cuts...\n");
00549 
00550   msg = "\n";
00551   msg += Form(" Event-wise parameters...\n");
00552   msg += Form("    Event ID            : %d -> %d\n",_cut_event_id.first,_cut_event_id.second);
00553   msg += Form("    Summed Charge       : %g -> %g\n",_cut_sum_charge.first,_cut_sum_charge.second);
00554   msg += Form("    Summed Peak         : %g -> %g\n",_cut_sum_peak.first,_cut_sum_peak.second);
00555   msg += Form("    Num. Pulses         : %d -> %d\n",_cut_npulse.first,_cut_npulse.second);
00556   msg += "\n";
00557   msg += Form(" Pulse-wise parameters...\n");
00558   msg += Form("    Channel Number      : %d -> %d\n",_cut_channels.first,_cut_channels.second);
00559   msg += Form("    Pulse Charge        : %g -> %g\n",_cut_charge.first,_cut_charge.second);
00560   msg += Form("    Pulse Peak          : %g -> %g\n",_cut_amp.first,_cut_amp.second);
00561   msg += Form("    Pulse Start T       : %g -> %g\n",_cut_tstart.first,_cut_tstart.second);
00562   msg += Form("    Pulse Start T (RECO): %g -> %g\n",_cut_tstart_reco.first,_cut_tstart_reco.second);
00563   msg += Form("    Pulse End T         : %g -> %g\n",_cut_tend.first,_cut_tend.second);
00564   msg += Form("    Pedestal Mean       : %g -> %g\n",_cut_pedbase.first,_cut_pedbase.second);
00565   msg += Form("    Pedestal RMS        : %g -> %g\n",_cut_pedrms.first,_cut_pedrms.second);
00566 
00567   Message::send(MSG::NORMAL,__FUNCTION__,msg.c_str());
00568 
00569 }

bool pulse_viewer::finalize (  )  [virtual]

Finalize method to be called after all events processed.

Implements ana_base.

Definition at line 535 of file pulse_viewer.cc.

References _cWF, and clear_viewer().

00535                             {
00536 
00537   // This function is called at the end of event loop.
00538   // Do all variable finalization you wish to do here.
00539   // If you need, you can store your ROOT class instance in the output
00540   // file. You have an access to the output file through "_fout" pointer.
00541   delete _cWF;
00542   clear_viewer();
00543   return true;
00544 }

const TCanvas* pulse_viewer::get_canvas (  )  const [inline]

Getter for TCanvas object pointer on which waveform & pulse info are visualized.

Definition at line 78 of file pulse_viewer.hh.

References _cWF.

00078 {return _cWF;};

const std::set<PMT::ch_number_t> pulse_viewer::get_hit_channels (  )  const [inline]

Getter for a set of channel numbers on which hist pulses are found.

Definition at line 81 of file pulse_viewer.hh.

References _channels.

00081 {return _channels;};

short pulse_viewer::get_npulse ( PMT::ch_number_t  ch  ) 

Returns # of reconstructed pulse for a specified channel number.

Definition at line 263 of file pulse_viewer.cc.

References _channels, and _pulse_count.

00263                                                {
00264   
00265   if(_channels.find(ch)==_channels.end())
00266     return 0;
00267 
00268   return _pulse_count[ch].first;
00269 
00270 }

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;};

TH1D * pulse_viewer::get_waveform ( PMT::ch_number_t  ch,
size_t  index 
) [protected]

returns a waveform TH1D object .

.. to be called internally from pulse_viewer::next_pulse() and pulse_viewer::previous_pulse(). Note that it does not perform a check of array index validity as it assumes the parent function does such validity check.

Definition at line 379 of file pulse_viewer.cc.

References decoder_base::_buf, _cWF, _event_id, _fNote, _hWF, _lBase, _lEnd, _lRMSBottom, _lRMSTop, _lStart, _lTop, _pData, _pNote, _pulse_amp, _pulse_charge, _pulse_frame_id, _pulse_pedbase, _pulse_pedrms, _pulse_sample_number, _pulse_tend, _pulse_tstart, _pulse_tstart_reco, _pWF, _waveforms, clear_viewer(), MSG::ERROR, MSG::NORMAL, and Message::send().

Referenced by next_pulse(), and previous_pulse().

00379                                                                 {
00380 
00381   clear_viewer();
00382   gStyle->SetOptStat(0);
00383   
00384   bool is_wf_stored=true;
00385   PMT::word_t sample=_pulse_sample_number[ch][index];
00386   PMT::word_t frame =_pulse_frame_id[ch][index];
00387 
00388   if(_waveforms.find(ch)==_waveforms.end())
00389     is_wf_stored=false;
00390   else if(_waveforms[ch].find(frame)==_waveforms[ch].end())
00391     is_wf_stored=false;
00392   else if(_waveforms[ch][frame].find(sample)==_waveforms[ch][frame].end())
00393     is_wf_stored=false;
00394 
00395   if(!is_wf_stored){
00396     sprintf(_buf,"Waveform not stored for ch=%d, frame=%d, sample=%d!",
00397         ch,frame,sample);
00398     Message::send(MSG::ERROR,__FUNCTION__,_buf);
00399     return 0;
00400   }
00401 
00402   if(_waveforms[ch][frame][sample].size()<1){
00403     sprintf(_buf,"Waveform has 0-length! ch=%d, frame=%d, sample=%d!",
00404         ch,frame,sample);
00405     Message::send(MSG::ERROR,__FUNCTION__,_buf);
00406     return 0;
00407   }
00408 
00409   _hWF = new TH1D("hWF",
00410           Form("Channel %d Reconstructed Pulse; Time-Slice; Amplitude",ch),
00411           _waveforms[ch][frame][sample].size(),
00412           -0.5,
00413           (double)(_waveforms[ch][frame][sample].size())-0.5);
00414 
00415   for(size_t adc_index=0; adc_index<_waveforms[ch][frame][sample].size(); ++adc_index)
00416     _hWF->SetBinContent(adc_index+1,_waveforms[ch][frame][sample][adc_index]);
00417 
00418   //double x_min=_pulse_tend[ch][index]-20;
00419   //double x_max=_pulse_tend[ch][index]+20;
00420   double y_min=_pulse_pedbase[ch][index] - _pulse_pedrms[ch][index]*5 - 20;
00421   double y_max=_pulse_pedbase[ch][index] + _pulse_amp[ch][index]*1.1;
00422   
00423   _hWF->SetFillColor(kGray);
00424   _hWF->SetFillStyle(3004);
00425   _hWF->SetLineWidth(2);
00426   _hWF->SetMinimum(y_min);
00427   _hWF->SetMaximum(y_max);
00428   //_hWF->GetXaxis()->SetRangeUser(x_min,x_max);
00429 
00430   //
00431   // Canvas title
00432   //
00433   //_fTitle->SetText(0.5,0.5,Form("Reconstructed Waveform @ Event = %d ... Channel %d", _event_id,ch));
00434 
00435   //
00436   // Report parameters to stdout stream
00437   // 
00438   sprintf(_buf,"\n\n");
00439   sprintf(_buf,"%s Event ID       : %d\n",_buf,_event_id);
00440   sprintf(_buf,"%s Channel        : %d\n",_buf,ch);
00441   sprintf(_buf,"%s Start T        : %g\n",_buf,_pulse_tstart[ch][index]);
00442   sprintf(_buf,"%s Start T (RECO) : %g\n",_buf,_pulse_tstart_reco[ch][index]);
00443   sprintf(_buf,"%s End T          : %g\n",_buf,_pulse_tend[ch][index]);
00444   sprintf(_buf,"%s Ped. Mean      : %g\n",_buf,_pulse_pedbase[ch][index]);
00445   sprintf(_buf,"%s Ped. RMS       : %g\n",_buf,_pulse_pedrms[ch][index]);
00446   sprintf(_buf,"%s Peak Amp.      : %g\n",_buf,_pulse_amp[ch][index]);
00447   sprintf(_buf,"%s Charge         : %g\n",_buf,_pulse_charge[ch][index]);
00448   Message::send(MSG::NORMAL,__FUNCTION__,_buf);
00449 
00450   //
00451   // Report parameters to a canvas
00452   //
00453   _fNote->Clear();
00454   _fNote->AddText(Form("Event ID       : %d",_event_id));
00455   _fNote->AddText(Form("Frame  Number  : %d",_pulse_frame_id[ch][index]));
00456   _fNote->AddText(Form("Sample Number  : %d\n",_pulse_sample_number[ch][index]));
00457   _fNote->AddText(Form("Start T        : %g",_pulse_tstart[ch][index]));
00458   _fNote->AddText(Form("Start T (RECO) : %g",_pulse_tstart_reco[ch][index]));
00459   _fNote->AddText(Form("End T          : %g",_pulse_tend[ch][index]));
00460   _fNote->AddText(Form("Ped. Mean      : %g",_pulse_pedbase[ch][index]));
00461   _fNote->AddText(Form("Ped. RMS       : %g",_pulse_pedrms[ch][index]));
00462   _fNote->AddText(Form("Peak Amp.      : %g",_pulse_amp[ch][index]));
00463   _fNote->AddText(Form("Charge         : %g",_pulse_charge[ch][index]));
00464 
00465   //
00466   // Make waveform related  objects to be drawn
00467   //  
00468   _lBase = new TLine(_hWF->GetXaxis()->GetXmin(), _pulse_pedbase[ch][index], 
00469              _hWF->GetXaxis()->GetXmax(), _pulse_pedbase[ch][index]);
00470   _lBase->SetLineWidth(2);
00471   _lBase->SetLineStyle(2);
00472   _lBase->SetLineColor(kBlack);
00473 
00474   _lRMSTop = new TLine(_hWF->GetXaxis()->GetXmin(), _pulse_pedbase[ch][index] + _pulse_pedrms[ch][index],
00475                _hWF->GetXaxis()->GetXmax(), _pulse_pedbase[ch][index] + _pulse_pedrms[ch][index]);
00476   _lRMSTop->SetLineWidth(2);
00477   _lRMSTop->SetLineStyle(2);
00478   _lRMSTop->SetLineColor(kGray);
00479 
00480   _lRMSBottom = new TLine(_hWF->GetXaxis()->GetXmin(), _pulse_pedbase[ch][index] - _pulse_pedrms[ch][index],
00481               _hWF->GetXaxis()->GetXmax(), _pulse_pedbase[ch][index] - _pulse_pedrms[ch][index]);
00482   _lRMSBottom->SetLineWidth(2);
00483   _lRMSBottom->SetLineStyle(2);
00484   _lRMSBottom->SetLineColor(kGray);
00485 
00486   _lStart = new TLine(_pulse_tstart[ch][index]-0.5, _pulse_pedbase[ch][index],
00487               _pulse_tstart[ch][index]-0.5, _pulse_pedbase[ch][index]+_pulse_amp[ch][index]);
00488   _lStart->SetLineWidth(2);
00489   _lStart->SetLineStyle(2);
00490   _lStart->SetLineColor(kBlue);
00491 
00492   _lEnd = new TLine(_pulse_tend[ch][index]+0.5, _pulse_pedbase[ch][index],
00493             _pulse_tend[ch][index]+0.5, _pulse_pedbase[ch][index]+_pulse_amp[ch][index]);
00494   _lEnd->SetLineWidth(2);
00495   _lEnd->SetLineStyle(2);
00496   _lEnd->SetLineColor(kRed);
00497 
00498   _lTop = new TLine(_pulse_tstart[ch][index]-0.5, _pulse_pedbase[ch][index] + _pulse_amp[ch][index],
00499             _pulse_tend[ch][index]+0.5,   _pulse_pedbase[ch][index] + _pulse_amp[ch][index]);
00500   _lTop->SetLineWidth(2);
00501   _lTop->SetLineStyle(2);
00502   _lTop->SetLineColor(kMagenta-7);
00503 
00504   // Draw
00505   _cWF->cd();
00506 
00507   // Waveform
00508   _pWF->cd();
00509   _hWF->Draw();
00510   _lBase->Draw();
00511   _lStart->Draw();
00512   _lEnd->Draw();
00513   _lRMSTop->Draw();
00514   _lRMSBottom->Draw();
00515   _lTop->Draw();
00516   _pWF->Modified();
00517   _pWF->Update();
00518 
00519   // Title
00520   //_pTitle->cd();
00521   //_fTitle->Draw();
00522   //_pTitle->Update();
00523 
00524   // Pulse parameters
00525   _pNote->cd();
00526   _fNote->Draw();
00527   _pNote->Update();
00528   _pData->Update();
00529 
00530   _cWF->Update();
00531 
00532   return _hWF;
00533 }

bool pulse_viewer::initialize (  )  [virtual]

Initialization method to be called before the analysis event loop.

Implements ana_base.

Definition at line 50 of file pulse_viewer.cc.

References _cWF, _fNote, _pData, _pNote, _pWF, decoder_base::_verbosity_level, clear_map(), clear_viewer(), MSG::DEBUG, Message::send(), and set_style().

00050                               {
00051 
00052   if(_verbosity_level==MSG::DEBUG)
00053 
00054     Message::send(MSG::DEBUG,__PRETTY_FUNCTION__,"called...");
00055 
00056   set_style();
00057 
00058   if(!_cWF){
00059 
00060     _cWF    = new TCanvas("_cWF","",1200,800);
00061     _cWF->SetLeftMargin(0.02);
00062     _cWF->SetBottomMargin(0.02);
00063     _cWF->SetRightMargin(0.02);
00064 
00065     _cWF->cd();
00066     //_pTitle = new TPad("_pTitle", "Title",      0.05, 0.92, 0.95, 0.99);
00067     //_pTitle->Draw();
00068 
00069     _cWF->cd();
00070     _pData  = new TPad("_pWF",    "Data",       0.01, 0.01, 0.99, 0.99);
00071     _pData->Draw();
00072 
00073     _pData->cd();
00074     _pNote  = new TPad("_pNote",  "Parameters", 0.80, 0.02, 0.98, 0.99);
00075     _pWF    = new TPad("_pWF",    "Waveform",   0.02, 0.02, 0.80, 0.99);
00076     _pWF->SetRightMargin(0.01);
00077     _pWF->SetLeftMargin(0.12);
00078     _pNote->Draw();
00079     _pWF->Draw();
00080 
00081     _fNote = new TPaveText(0.1,0.1,0.99,0.99);
00082     
00083   }
00084 
00085   clear_map();
00086   clear_viewer();
00087   return true;
00088 }

PMT::ch_number_t pulse_viewer::next_channel (  ) 

Iterator for a set of channels for which reconstructed pulses are found.

It is same as a user's own iterator over a set of channel numbers that can be obtained from pulse_viewer::get_hit_channels(). This method is provided for reducing a coding need for writing users' own iterator loop.

Definition at line 272 of file pulse_viewer.cc.

References _ch_iter, _channels, and PMT::INVALID_CH.

00272                                          {
00273 
00274   PMT::ch_number_t ch=PMT::INVALID_CH;
00275 
00276   if(_ch_iter==_channels.end())
00277     return ch;
00278 
00279   else
00280     ch=(*_ch_iter);
00281   
00282   _ch_iter++;
00283 
00284   return ch;
00285 }

TH1D * pulse_viewer::next_pulse ( PMT::ch_number_t  ch  ) 

CORE METHOD 1 Given the channel number, this method iterates over the locally stored values for a reconstructed pulse.

It visualize these information on a canvas with the original waveform which is returned as TH1D object pointer. The canvas can be retrieved through pulse_viewer::get_canvas() method after you call this function.

Definition at line 287 of file pulse_viewer.cc.

References decoder_base::_buf, _channels, _cut_amp, _cut_channels, _cut_charge, _cut_event_id, _cut_npulse, _cut_pedbase, _cut_pedrms, _cut_sum_charge, _cut_sum_peak, _cut_tend, _cut_tstart, _cut_tstart_reco, _event_id, _npulse, _pulse_amp, _pulse_charge, _pulse_count, _pulse_pedbase, _pulse_pedrms, _pulse_tend, _pulse_tstart, _pulse_tstart_reco, _sum_charge, _sum_peak, MSG::ERROR, get_waveform(), MSG::NORMAL, and Message::send().

00287                                                {
00288 
00289   if(_channels.find(ch)==_channels.end()){
00290     sprintf(_buf,"No pulse found for channel %d!",ch);
00291     Message::send(MSG::ERROR,__FUNCTION__,_buf);
00292     return 0;
00293   }
00294 
00295   //  short this_index = _pulse_count[ch].second;
00296 
00297   // Check event cut criteria
00298   if( (_event_id < _cut_event_id.first || _cut_event_id.second < _event_id) ||
00299       (_sum_charge < _cut_sum_charge.first || _cut_sum_charge.second < _sum_charge) ||
00300       (_sum_peak < _cut_sum_peak.first || _cut_sum_peak.second < _sum_peak) ||
00301       (_npulse < _cut_npulse.first || _cut_npulse.second < _npulse) )
00302     {
00303       // event cut criteria changed and this event is not qualified anymore!
00304       _pulse_count[ch].second=_pulse_count[ch].first;
00305       return 0;
00306     }
00307 
00308   // Check pulse cut criteria
00309   short index=0;
00310   for(index = _pulse_count[ch].second;
00311       index < _pulse_count[ch].first;
00312       index++){
00313 
00314     if(index<0) index=0;
00315 
00316     if(ch < _cut_channels.first || _cut_channels.second < ch)
00317       continue;
00318     if(_pulse_tstart_reco[ch][index] < _cut_tstart_reco.first || _cut_tstart_reco.second < _pulse_tstart_reco[ch][index])
00319       continue;
00320     if(_pulse_tstart[ch][index] < _cut_tstart.first || _cut_tstart.second < _pulse_tstart[ch][index])
00321       continue;
00322     if(_pulse_tend[ch][index] < _cut_tend.first || _cut_tend.second < _pulse_tend[ch][index])
00323       continue;
00324     if(_pulse_charge[ch][index] < _cut_charge.first || _cut_charge.second < _pulse_charge[ch][index])
00325       continue;
00326     if(_pulse_amp[ch][index] < _cut_amp.first || _cut_amp.second < _pulse_amp[ch][index])
00327       continue;
00328     if(_pulse_pedbase[ch][index] < _cut_pedbase.first || _cut_pedbase.second < _pulse_pedbase[ch][index])
00329       continue;
00330     if(_pulse_pedrms[ch][index] < _cut_pedrms.first || _cut_pedrms.second < _pulse_pedrms[ch][index])
00331       continue;
00332     break;
00333   }
00334   
00335   if(index==_pulse_count[ch].first){
00336     _pulse_count[ch].second=_pulse_count[ch].first;
00337     return 0;
00338   }else{
00339     _pulse_count[ch].second=index+1;
00340     sprintf(_buf,"Pulse index %d for ch. %d",index,ch);
00341     Message::send(MSG::NORMAL,__FUNCTION__,_buf);
00342     return get_waveform(ch,(size_t)index);
00343   }
00344 
00345 }

TH1D * pulse_viewer::previous_pulse ( PMT::ch_number_t  ch  ) 

CORE METHOD 2 Reverse iteration over reconstructed pulse as opposed to the iteration in an ordinary order.

See pulse_viewer::next_pulse() for details.

Definition at line 348 of file pulse_viewer.cc.

References decoder_base::_buf, _channels, _pulse_count, MSG::ERROR, get_waveform(), MSG::INFO, MSG::NORMAL, and Message::send().

00348                                                    {
00349 
00350   if(_channels.find(ch)==_channels.end()){
00351     sprintf(_buf,"No pulse found for channel %d!",ch);
00352     Message::send(MSG::ERROR,__FUNCTION__,_buf);
00353     return 0;
00354   }
00355 
00356   short this_index = _pulse_count[ch].second;
00357 
00358   if(this_index < 0){
00359     sprintf(_buf,"No more pulse found on ch %d... (%d/%d)",ch,this_index,_pulse_count[ch].first);
00360     Message::send(MSG::NORMAL,__FUNCTION__,_buf);
00361     return 0;
00362   }
00363   else if(this_index >= _pulse_count[ch].first) {
00364     sprintf(_buf,"Last pulse on Ch: %d",ch);
00365     Message::send(MSG::INFO,__FUNCTION__,_buf);
00366     this_index=_pulse_count[ch].first-1;
00367     _pulse_count[ch].second=this_index-1;
00368   }else{
00369     sprintf(_buf,"Pulse index %d for ch. %d",this_index,ch);
00370     Message::send(MSG::NORMAL,__FUNCTION__,_buf);
00371     _pulse_count[ch].second-=1;
00372   }
00373 
00374   return get_waveform(ch,(size_t)this_index);
00375   
00376 }

const std::pair<PMT::word_t,PMT::word_t> pulse_viewer::range_channel (  )  const [inline]

Getter for the range of channel numbers to select pulses of interest.

Definition at line 166 of file pulse_viewer.hh.

References _cut_channels.

00166 {return _cut_channels;};

const std::pair<PMT::word_t,PMT::word_t> pulse_viewer::range_event_id (  )  const [inline]

Getter for the range of event id to select pulses of interest.

Definition at line 163 of file pulse_viewer.hh.

References _cut_event_id.

00163 {return _cut_event_id;};

const std::pair<UInt_t,UInt_t> pulse_viewer::range_npulse (  )  const [inline]

Getter for the range of event-wise number of pulses to select pulses of interest.

Definition at line 175 of file pulse_viewer.hh.

References _cut_npulse.

00175 {return _cut_npulse;};

const std::pair<double,double> pulse_viewer::range_ped_mean (  )  const [inline]

Getter for the range of pedestal mean value to select pulses of interest..

Definition at line 157 of file pulse_viewer.hh.

References _cut_pedbase.

00157 {return _cut_pedbase;};

const std::pair<double,double> pulse_viewer::range_ped_rms (  )  const [inline]

Getter for the range of pedestal rms to select pulses of interest..

Definition at line 160 of file pulse_viewer.hh.

References _cut_pedrms.

00160 {return _cut_pedrms;};

const std::pair<double,double> pulse_viewer::range_pulse_amp (  )  const [inline]

Getter for the range of pusle amplitude to select pulses of interest..

Definition at line 151 of file pulse_viewer.hh.

References _cut_amp.

00151 {return _cut_amp;};

const std::pair<double,double> pulse_viewer::range_pulse_charge (  )  const [inline]

Getter for the range of integrated charge to select pulses of interest..

Definition at line 154 of file pulse_viewer.hh.

References _cut_charge.

00154 {return _cut_charge;};

const std::pair<double,double> pulse_viewer::range_pulse_end_time (  )  const [inline]

Getter for the range of pusle end time to select pulses of interest..

Definition at line 148 of file pulse_viewer.hh.

References _cut_tend.

00148 {return _cut_tend;};

const std::pair<double,double> pulse_viewer::range_pulse_start_time (  )  const [inline]

Getter for the range of pusle start time to select pulses of interest.

Definition at line 142 of file pulse_viewer.hh.

References _cut_tstart.

00142 {return _cut_tstart;};

const std::pair<double,double> pulse_viewer::range_pulse_start_time_reco (  )  const [inline]

Getter for the range of pusle reconstructed start time to select pulses of interest.

Definition at line 145 of file pulse_viewer.hh.

References _cut_tstart_reco.

00145 {return _cut_tstart_reco;};

const std::pair<double,double> pulse_viewer::range_sum_charge (  )  const [inline]

Getter for the range of event charge sum to select pulses of interest.

Definition at line 169 of file pulse_viewer.hh.

References _cut_sum_charge.

00169 {return _cut_sum_charge;};

const std::pair<double,double> pulse_viewer::range_sum_peak (  )  const [inline]

Getter for the range of event peak sum to select pulses of interest.

Definition at line 172 of file pulse_viewer.hh.

References _cut_sum_peak.

00172 {return _cut_sum_peak;};

void pulse_viewer::reset_cuts (  )  [protected]

reset cut values

Definition at line 22 of file pulse_viewer.cc.

References _cut_amp, _cut_channels, _cut_charge, _cut_event_id, _cut_npulse, _cut_pedbase, _cut_pedrms, _cut_sum_charge, _cut_sum_peak, _cut_tend, _cut_tstart, _cut_tstart_reco, PMT::INVALID_CH, and PMT::NUM_PMT_CHANNEL.

Referenced by pulse_viewer().

00022                               {
00023 
00024   _cut_tstart_reco = std::make_pair(-1,2000);
00025   _cut_tstart   = std::make_pair(-1,2000);
00026   _cut_tend     = std::make_pair(-1,2000);
00027   _cut_amp      = std::make_pair(-1,4096);
00028   _cut_charge   = std::make_pair(-1,4096*2000);
00029   _cut_pedbase  = std::make_pair(-1,4096);
00030   _cut_pedrms   = std::make_pair(0,4096);
00031   _cut_channels = std::make_pair(0,PMT::INVALID_CH);
00032   _cut_event_id = std::make_pair(0,0xffffffff);
00033   _cut_npulse   = std::make_pair(0,0xffffffff);
00034   _cut_sum_charge = std::make_pair(0,4096*2000*PMT::NUM_PMT_CHANNEL);
00035   _cut_sum_peak = std::make_pair(0,4096*PMT::NUM_PMT_CHANNEL);
00036   
00037 }

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 pulse_viewer::set_range_channel ( PMT::ch_number_t  v1,
PMT::ch_number_t  v2 
) [inline]

Setter for the range of channel numbers to select pulses of interest.

Definition at line 125 of file pulse_viewer.hh.

References _cut_channels.

00125 {_cut_channels.first=v1; _cut_channels.second=v2;};

void pulse_viewer::set_range_event_id ( PMT::word_t  v1,
PMT::word_t  v2 
) [inline]

Setter for the range of event id to select pulses of interest.

Definition at line 122 of file pulse_viewer.hh.

References _cut_event_id.

00122 {_cut_event_id.first=v1; _cut_event_id.second=v2; };

void pulse_viewer::set_range_npulse ( double  v1,
double  v2 
) [inline]

Setter for the range of event-wise number of pulses to select pulses of interest.

Definition at line 134 of file pulse_viewer.hh.

References _cut_npulse.

00134 {_cut_npulse.first=v1; _cut_npulse.second=v2;};

void pulse_viewer::set_range_ped_mean ( double  v1,
double  v2 
) [inline]

Setter for the range of pedestal mean value to select pulses of interest..

Definition at line 116 of file pulse_viewer.hh.

References _cut_pedbase.

00116 {_cut_pedbase.first=v1;  _cut_pedbase.second=v2;  };

void pulse_viewer::set_range_ped_rms ( double  v1,
double  v2 
) [inline]

Setter for the range of pedestal rms to select pulses of interest..

Definition at line 119 of file pulse_viewer.hh.

References _cut_pedrms.

00119 {_cut_pedrms.first=v1;   _cut_pedrms.second=v2;   };

void pulse_viewer::set_range_pulse_amp ( double  v1,
double  v2 
) [inline]

Setter for the range of pusle amplitude to select pulses of interest..

Definition at line 110 of file pulse_viewer.hh.

References _cut_amp.

00110 {_cut_amp.first=v1;      _cut_amp.second=v2;      };

void pulse_viewer::set_range_pulse_charge ( double  v1,
double  v2 
) [inline]

Setter for the range of integrated charge to select pulses of interest..

Definition at line 113 of file pulse_viewer.hh.

References _cut_charge.

00113 {_cut_charge.first=v1;   _cut_charge.second=v2;   };

void pulse_viewer::set_range_pulse_end_time ( double  v1,
double  v2 
) [inline]

Setter for the range of pusle end time to select pulses of interest..

Definition at line 107 of file pulse_viewer.hh.

References _cut_tend.

00107 {_cut_tend.first=v1;     _cut_tend.second=v2;     };

void pulse_viewer::set_range_pulse_start_time ( double  v1,
double  v2 
) [inline]

Setter for the range of pusle start time to select pulses of interest.

Definition at line 101 of file pulse_viewer.hh.

References _cut_tstart.

00101 {_cut_tstart.first=v1;   _cut_tstart.second=v2;   };

void pulse_viewer::set_range_pulse_start_time_reco ( double  v1,
double  v2 
) [inline]

Setter for the range of reconstructed pusle start time to select pulses of interest.

Definition at line 104 of file pulse_viewer.hh.

References _cut_tstart_reco.

00104 {_cut_tstart_reco.first=v1;   _cut_tstart_reco.second=v2;   };

void pulse_viewer::set_range_sum_charge ( double  v1,
double  v2 
) [inline]

Setter for the range of event charge sum to select pulses of interest.

Definition at line 128 of file pulse_viewer.hh.

References _cut_sum_charge.

00128 {_cut_sum_charge.first=v1; _cut_sum_charge.second=v2;};

void pulse_viewer::set_range_sum_peak ( double  v1,
double  v2 
) [inline]

Setter for the range of event peak sum to select pulses of interest.

Definition at line 131 of file pulse_viewer.hh.

References _cut_sum_peak.

00131 {_cut_sum_peak.first=v1; _cut_sum_peak.second=v2;};

void pulse_viewer::set_style (  )  [protected]

set Kazu's style

Definition at line 571 of file pulse_viewer.cc.

Referenced by initialize().

00571                             {
00572 
00573   TGaxis::SetMaxDigits(10);
00574   //TGaxis::SetNoExponent();
00575   gROOT->SetStyle("Plain");
00576   gStyle->SetEndErrorSize(0);
00577   gStyle->SetStatX(0.88);
00578   gStyle->SetOptFit(1);
00579   gStyle->SetOptDate(0);
00580 
00581   // Canvas
00582   gStyle->SetCanvasDefW(600);
00583   gStyle->SetCanvasDefH(500);
00584   gStyle->SetCanvasColor(0);
00585   gStyle->SetStatColor(0);
00586   gStyle->SetStatBorderSize(1);
00587   gStyle->SetFrameFillColor(10);
00588   gStyle->SetPadColor(23);
00589   gStyle->SetPadTickX(1);
00590   gStyle->SetPadTickY(1);
00591   gStyle->SetTitleColor(0, "");
00592   gStyle->SetPadTopMargin(0.11);
00593   gStyle->SetPadRightMargin(0.08);
00594   gStyle->SetPadLeftMargin(0.13);
00595   gStyle->SetPadBottomMargin(0.10);
00596   
00597   // Font ... use large Times-Roman fonts
00598   gStyle->SetTextFont(42);
00599   gStyle->SetTextSize(0.01);
00600   gStyle->SetLabelFont(22,"xyz");
00601   gStyle->SetLabelSize(0.04,"xy");
00602   gStyle->SetLabelOffset(0.01,"xy");
00603   gStyle->SetTitleFont(22,"xyz");
00604   gStyle->SetTitleSize(0.04,"xy");
00605   gStyle->SetTitleOffset(1.2,"x");
00606   gStyle->SetTitleOffset(1.5,"y");
00607   
00608   
00609   // Gradient Color
00610   const Int_t NRGBs = 5;  
00611   const Int_t NCont = 99;
00612   Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00};
00613   Double_t red[NRGBs] =   { 0.00, 0.00, 0.87, 1.00, 0.51};
00614   Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00};
00615   Double_t blue[NRGBs] =  { 0.51, 1.00, 0.12, 0.00, 0.00};
00616   TColor::CreateGradientColorTable(NRGBs,stops,red,green,blue,NCont);
00617   gStyle->SetNumberContours(NCont);
00618 
00619 }

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 }


Member Data Documentation

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(), 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(), get_waveform(), ana_processor::initialize(), next_pulse(), storage_manager::open(), bin_io_handler::open(), storage_manager::prepare_tree(), 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().

std::set<PMT::ch_number_t>::iterator pulse_viewer::_ch_iter [protected]

internal iterator for _channels member

Definition at line 205 of file pulse_viewer.hh.

Referenced by analyze(), and next_channel().

std::set<PMT::ch_number_t> pulse_viewer::_channels [protected]

set of channel numbers for reco-ed pulses

Definition at line 204 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_hit_channels(), get_npulse(), next_channel(), next_pulse(), and previous_pulse().

std::pair<double,double> pulse_viewer::_cut_amp [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_pulse_amp(), reset_cuts(), and set_range_pulse_amp().

std::pair<PMT::ch_number_t,PMT::ch_number_t> pulse_viewer::_cut_channels [protected]

a pair to define a range of channel numbers for displaying pulses.

Definition at line 255 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_channel(), reset_cuts(), and set_range_channel().

std::pair<double,double> pulse_viewer::_cut_charge [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_pulse_charge(), reset_cuts(), and set_range_pulse_charge().

std::pair<PMT::word_t,PMT::word_t> pulse_viewer::_cut_event_id [protected]

a pair to define a range of event id for displaying pulses.

Definition at line 252 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_event_id(), reset_cuts(), and set_range_event_id().

std::pair<UInt_t,UInt_t> pulse_viewer::_cut_npulse [protected]

pairs to define a range of event parameters for displaying pulses.

Definition at line 249 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_npulse(), reset_cuts(), and set_range_npulse().

std::pair<double,double> pulse_viewer::_cut_pedbase [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_ped_mean(), reset_cuts(), and set_range_ped_mean().

std::pair<double,double> pulse_viewer::_cut_pedrms [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_ped_rms(), reset_cuts(), and set_range_ped_rms().

std::pair<double,double> pulse_viewer::_cut_sum_charge [protected]

pairs to define a range of event parameters for displaying pulses.

Definition at line 246 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_sum_charge(), reset_cuts(), and set_range_sum_charge().

std::pair<double,double> pulse_viewer::_cut_sum_peak [protected]

Definition at line 246 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_sum_peak(), reset_cuts(), and set_range_sum_peak().

std::pair<double,double> pulse_viewer::_cut_tend [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_pulse_end_time(), reset_cuts(), and set_range_pulse_end_time().

std::pair<double,double> pulse_viewer::_cut_tstart [protected]

pairs to define a range of pulse parameters for displaying pulses.

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_pulse_start_time(), reset_cuts(), and set_range_pulse_start_time().

std::pair<double,double> pulse_viewer::_cut_tstart_reco [protected]

Definition at line 243 of file pulse_viewer.hh.

Referenced by analyze(), display_cut_ranges(), next_pulse(), range_pulse_start_time_reco(), reset_cuts(), and set_range_pulse_start_time_reco().

TCanvas* pulse_viewer::_cWF [protected]

Local (yet main) canvas poitner.

Definition at line 222 of file pulse_viewer.hh.

Referenced by finalize(), get_canvas(), get_waveform(), initialize(), and pulse_viewer().

PMT::word_t pulse_viewer::_event_id [protected]

event id holder

Definition at line 200 of file pulse_viewer.hh.

Referenced by analyze(), get_waveform(), and next_pulse().

TPaveText* pulse_viewer::_fNote [protected]

pulse parameters

Definition at line 234 of file pulse_viewer.hh.

Referenced by get_waveform(), and initialize().

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(), pmtbaseline::finalize(), led_pulse_analyzer::finalize(), beamgate_debugger::finalize(), pulse_analyzer::initialize(), pmt_slow_encoder::pmt_slow_encoder(), pmtbaseline::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().

TText* pulse_viewer::_fTitle [protected]

canvas title

Definition at line 233 of file pulse_viewer.hh.

TH1D* pulse_viewer::_hWF [protected]

Waveform container histogram pointer.

Definition at line 237 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine * pulse_viewer::_lBase [protected]

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine * pulse_viewer::_lEnd [protected]

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine * pulse_viewer::_lRMSBottom [protected]

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine * pulse_viewer::_lRMSTop [protected]

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine* pulse_viewer::_lStart [protected]

TLine pointers to display pule start time, end time, pedestal baseline mean and deviations.

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

TLine * pulse_viewer::_lTop [protected]

Definition at line 240 of file pulse_viewer.hh.

Referenced by clear_viewer(), get_waveform(), and pulse_viewer().

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(), 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(), reco_wf::reco_wf(), storage_manager::storage_manager(), and waveform_sampler::waveform_sampler().

UInt_t pulse_viewer::_npulse [protected]

event-wise number of reco-ed pulse holder

Definition at line 203 of file pulse_viewer.hh.

Referenced by analyze(), and next_pulse().

TPad* pulse_viewer::_pData [protected]

data (histogram, numbers) pad

Definition at line 226 of file pulse_viewer.hh.

Referenced by get_waveform(), and initialize().

TPad* pulse_viewer::_pNote [protected]

pulse parameters

Definition at line 229 of file pulse_viewer.hh.

Referenced by get_waveform(), and initialize().

TPad* pulse_viewer::_pTitle [protected]

title pad

Definition at line 225 of file pulse_viewer.hh.

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_amp [protected]

a set of reco-ed pulse amplitude

Definition at line 215 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_charge [protected]

a set of reco-ed pulse charge

Definition at line 216 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::pair<short,short> > pulse_viewer::_pulse_count [protected]

Map of pulse count: the first element in the pair holds the total reco-ed pulse count while the second element holds the internal index to be updated by pulse_viewer::next_pulse() and pulse_viewer::previous_pulse() methods.

Definition at line 209 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_npulse(), next_pulse(), and previous_pulse().

std::map<PMT::ch_number_t,std::vector<PMT::word_t> > pulse_viewer::_pulse_frame_id [protected]

a set of frame id

Definition at line 210 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), and get_waveform().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_pedbase [protected]

a set of reco-ed pulse pedestal baseline mean

Definition at line 217 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_pedrms [protected]

a set of reco-ed pulse pedestal baseline standard deviation

Definition at line 218 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::vector<PMT::word_t> > pulse_viewer::_pulse_sample_number [protected]

a set of sample numbers

Definition at line 211 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), and get_waveform().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_tend [protected]

a set of reco-ed pulse end time

Definition at line 214 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_tstart [protected]

a set of reco-ed pulse start time

Definition at line 212 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

std::map<PMT::ch_number_t,std::vector<double> > pulse_viewer::_pulse_tstart_reco [protected]

a set of reco-ed pulse reco-ed start time

Definition at line 213 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), get_waveform(), and next_pulse().

TPad* pulse_viewer::_pWF [protected]

waveform histogram

Definition at line 230 of file pulse_viewer.hh.

Referenced by get_waveform(), and initialize().

double pulse_viewer::_sum_charge [protected]

event-wise summed charge holder

Definition at line 201 of file pulse_viewer.hh.

Referenced by analyze(), and next_pulse().

double pulse_viewer::_sum_peak [protected]

event-wise summed peak height holder

Definition at line 202 of file pulse_viewer.hh.

Referenced by analyze(), and next_pulse().

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 analyze(), decoder_base::get_verbosity(), initialize(), decoder_manager::initialize(), ana_processor::initialize(), bin_io_handler::read_multi_word(), bin_io_handler::read_word(), and decoder_base::set_verbosity().

std::map<PMT::ch_number_t,std::map<PMT::word_t,std::map<PMT::word_t,std::vector<PMT::ch_adc_t> > > > pulse_viewer::_waveforms [protected]

waveform containers

Definition at line 219 of file pulse_viewer.hh.

Referenced by add_channel_entry(), analyze(), clear_map(), and get_waveform().


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