#include <led_pulse_analyzer.hh>
Inheritance diagram for led_pulse_analyzer:

Public Member Functions | |
| led_pulse_analyzer () | |
| Default constructor. | |
| virtual | ~led_pulse_analyzer () |
| 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. | |
| void | clear_event () |
| Clear event. | |
| void | set_pulse_type (DATA_STRUCT::DATA_TYPE type) |
| void | set_ref_channel (PMT::ch_number_t ch) |
| void | set_frame_size (PMT::word_t frame_size) |
| void | set_time_cut (PMT::word_t time_cut) |
| 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 Attributes | |
| PMT::word_t | _event_id |
| event id holder | |
| PMT::word_t | _ch_frame_id |
| PMT::word_t | _ch_sample_id |
| PMT::word_t | _disc_id |
| TTree * | _ch_tree |
| int | _ch |
| int | _nsample |
| double | _wf_charge |
| double | _wf_peak |
| double | _wf_ts |
| double | _wf_tm |
| double | _wf_te |
| double | _ped_mean |
| double | _ped_rms |
| led_pulse_selector | _selector |
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/led_pulse_analyzer.py for an example usage.
Definition at line 45 of file led_pulse_analyzer.hh.
| led_pulse_analyzer::led_pulse_analyzer | ( | ) |
Default constructor.
Definition at line 6 of file led_pulse_analyzer.cc.
References _ch_tree, and decoder_base::_name.
| virtual led_pulse_analyzer::~led_pulse_analyzer | ( | ) | [inline, virtual] |
| bool led_pulse_analyzer::analyze | ( | storage_manager * | storage | ) | [virtual] |
Analyze a data event-by-event.
Implements ana_base.
Definition at line 35 of file led_pulse_analyzer.cc.
References _ch, _ch_frame_id, _ch_sample_id, _ch_tree, _disc_id, _ped_mean, _ped_rms, _selector, _wf_charge, _wf_peak, _wf_te, _wf_tm, _wf_ts, led_pulse_selector::analyze(), MSG::ERROR, storage_manager::get_data(), pulse_selector_base::pulse_type(), led_pulse_selector::select_pulse(), and Message::send().
00035 { 00036 00037 pulse_collection *pulses = (pulse_collection*)(storage->get_data(_selector.pulse_type())); 00038 00039 if(pulses->size()==0) { 00040 Message::send(MSG::ERROR,__FUNCTION__,"No Pulse Found!"); 00041 return false; 00042 } 00043 00044 if(!_selector.analyze(storage)) return false; 00045 00046 // Fill data for this event 00047 for(pulse_collection::const_iterator iter(pulses->begin()); 00048 iter!=pulses->end(); 00049 ++iter){ 00050 00051 if( !( _selector.select_pulse(&(*iter))) ) continue; 00052 00053 _ch = (*iter).channel_number(); 00054 _ch_frame_id = (*iter).frame_id(); 00055 _ch_sample_id = (*iter).timeslice(); 00056 _disc_id = (int)((*iter).disc_id()); 00057 _wf_charge = (*iter).charge(); 00058 _wf_peak = (*iter).pulse_peak(); 00059 _wf_ts = (*iter).start_time(); 00060 _wf_tm = (*iter).max_time(); 00061 _wf_te = (*iter).end_time(); 00062 _ped_mean = (*iter).ped_mean(); 00063 _ped_rms = (*iter).ped_rms(); 00064 _ch_tree->Fill(); 00065 00066 } 00067 00068 return true; 00069 }
| 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 led_pulse_analyzer::clear_event | ( | ) |
Clear event.
| bool led_pulse_analyzer::finalize | ( | ) | [virtual] |
Finalize method to be called after all events processed.
Implements ana_base.
Definition at line 71 of file led_pulse_analyzer.cc.
References _ch_tree, and ana_base::_fout.
00071 { 00072 00073 // This function is called at the end of event loop. 00074 // Do all variable finalization you wish to do here. 00075 // If you need, you can store your ROOT class instance in the output 00076 // file. You have an access to the output file through "_fout" pointer. 00077 //amplitude->Write(); 00078 _fout->cd(); 00079 _ch_tree->Write(); 00080 return true; 00081 }
| 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;};
| bool led_pulse_analyzer::initialize | ( | ) | [virtual] |
Initialization method to be called before the analysis event loop.
Implements ana_base.
Definition at line 11 of file led_pulse_analyzer.cc.
References _ch, _ch_frame_id, _ch_sample_id, _ch_tree, _disc_id, _event_id, _nsample, _ped_mean, _ped_rms, _selector, _wf_charge, _wf_peak, _wf_te, _wf_tm, _wf_ts, and led_pulse_selector::initialize().
00011 { 00012 00013 if(!_ch_tree){ 00014 00015 _ch_tree = new TTree("ch_tree",""); 00016 _ch_tree->Branch("event_id",&_event_id,"event_id/I"); 00017 _ch_tree->Branch("frame_id",&_ch_frame_id,"frame_id/I"); 00018 _ch_tree->Branch("sample_id",&_ch_sample_id,"sample_id/I"); 00019 _ch_tree->Branch("disc_id",&_disc_id,"disc_id/I"); 00020 _ch_tree->Branch("ch",&_ch,"ch/I"); 00021 _ch_tree->Branch("charge",&_wf_charge,"charge/D"); 00022 _ch_tree->Branch("peak",&_wf_peak,"peak/D"); 00023 _ch_tree->Branch("t_start",&_wf_ts,"t_start/D"); 00024 _ch_tree->Branch("t_max",&_wf_tm,"t_max/D"); 00025 _ch_tree->Branch("t_end",&_wf_te,"t_end/D"); 00026 _ch_tree->Branch("ped_mean",&_ped_mean,"ped_mean/D"); 00027 _ch_tree->Branch("ped_rms",&_ped_rms,"ped_rms/D"); 00028 _ch_tree->Branch("nsample",&_nsample,"nsample/I"); 00029 00030 } 00031 00032 return _selector.initialize(); 00033 }
| void led_pulse_analyzer::set_frame_size | ( | PMT::word_t | frame_size | ) | [inline] |
Definition at line 71 of file led_pulse_analyzer.hh.
References _selector, and led_pulse_selector::set_frame_size().
00071 {_selector.set_frame_size(frame_size);};
| 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 led_pulse_analyzer::set_pulse_type | ( | DATA_STRUCT::DATA_TYPE | type | ) | [inline] |
Definition at line 67 of file led_pulse_analyzer.hh.
References _selector, and pulse_selector_base::set_pulse_type().
00067 {_selector.set_pulse_type(type);};
| void led_pulse_analyzer::set_ref_channel | ( | PMT::ch_number_t | ch | ) | [inline] |
Definition at line 69 of file led_pulse_analyzer.hh.
References _selector, and led_pulse_selector::set_ref_channel().
00069 {_selector.set_ref_channel(ch);};
| void led_pulse_analyzer::set_time_cut | ( | PMT::word_t | time_cut | ) | [inline] |
Definition at line 73 of file led_pulse_analyzer.hh.
References _selector, and led_pulse_selector::set_time_cut().
00073 {_selector.set_time_cut(time_cut);};
| 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 }
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().
int led_pulse_analyzer::_ch [private] |
PMT::word_t led_pulse_analyzer::_ch_frame_id [private] |
PMT::word_t led_pulse_analyzer::_ch_sample_id [private] |
TTree* led_pulse_analyzer::_ch_tree [private] |
Definition at line 82 of file led_pulse_analyzer.hh.
Referenced by analyze(), finalize(), initialize(), and led_pulse_analyzer().
PMT::word_t led_pulse_analyzer::_disc_id [private] |
PMT::word_t led_pulse_analyzer::_event_id [private] |
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(), 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().
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_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::pulse_viewer(), reco_wf::reco_wf(), storage_manager::storage_manager(), and waveform_sampler::waveform_sampler().
int led_pulse_analyzer::_nsample [private] |
double led_pulse_analyzer::_ped_mean [private] |
double led_pulse_analyzer::_ped_rms [private] |
Definition at line 88 of file led_pulse_analyzer.hh.
Referenced by analyze(), initialize(), set_frame_size(), set_pulse_type(), set_ref_channel(), and set_time_cut().
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().
double led_pulse_analyzer::_wf_charge [private] |
double led_pulse_analyzer::_wf_peak [private] |
double led_pulse_analyzer::_wf_te [private] |
double led_pulse_analyzer::_wf_tm [private] |
double led_pulse_analyzer::_wf_ts [private] |
1.4.7