A base coass for all data objects in LArLight. More...
#include <data_base.hh>
Public Member Functions | |
data_base (DATA::DATA_TYPE type=DATA::DATA_TYPE_MAX) | |
Default constructor. | |
data_base (const data_base &original) | |
Default copy constructor to avoid memory leak in ROOT streamer. | |
virtual | ~data_base () |
Default destructor. | |
virtual void | clear_data () |
Clear method. | |
DATA::DATA_TYPE | data_type () const |
data type getter | |
void | add_association (DATA::DATA_TYPE type, const std::vector< unsigned short > ass) |
Adder for a set of association. | |
size_t | size_association (DATA::DATA_TYPE type) const |
Getter for # of associations. | |
const std::vector< unsigned short > | association (DATA::DATA_TYPE type, size_t index=0) const |
Getter of an association. | |
Protected Attributes | |
DATA::DATA_TYPE | _type |
DATA_TYPE. | |
std::map < larlight::DATA::DATA_TYPE, std::vector< std::vector < unsigned short > > > | _ass |
Association storage ... allow multiple set of associations. |
A base coass for all data objects in LArLight.
Definition at line 27 of file data_base.hh.
larlight::data_base::data_base | ( | DATA::DATA_TYPE | type = DATA::DATA_TYPE_MAX |
) | [inline] |
Default constructor.
Definition at line 32 of file data_base.hh.
References _type, and clear_data().
00032 : TObject(){ clear_data(); _type=type; }
larlight::data_base::data_base | ( | const data_base & | original | ) | [inline] |
Default copy constructor to avoid memory leak in ROOT streamer.
Definition at line 35 of file data_base.hh.
virtual larlight::data_base::~data_base | ( | ) | [inline, virtual] |
void larlight::data_base::add_association | ( | DATA::DATA_TYPE | type, | |
const std::vector< unsigned short > | ass | |||
) |
const std::vector< unsigned short > larlight::data_base::association | ( | DATA::DATA_TYPE | type, | |
size_t | index = 0 | |||
) | const |
Getter of an association.
Definition at line 35 of file data_base.cc.
References larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, and larlight::Message::send().
00037 { 00038 00039 size_t ass_length = size_association(type); 00040 00041 if( !(ass_length) ) { 00042 00043 Message::send(MSG::ERROR,__FUNCTION__, 00044 Form("There is no association to %s",DATA::DATA_TREE_NAME[type].c_str())); 00045 00046 return std::vector<unsigned short>(); 00047 00048 } 00049 00050 if( ass_length <= index ) { 00051 00052 Message::send(MSG::ERROR,__FUNCTION__, 00053 Form("There are only %zu associations. No association @ index=%zu",ass_length,index)); 00054 00055 return std::vector<unsigned short>(); 00056 00057 } 00058 00059 return ((_ass.find(type))->second).at(index); 00060 }
virtual void larlight::data_base::clear_data | ( | ) | [inline, virtual] |
Clear method.
Reimplemented in larlight::calorimetry, larlight::event_calorimetry, larlight::cluster, larlight::event_cluster, larlight::event_base, larlight::endpoint2d, larlight::event_endpoint2d, larlight::fifo, larlight::event_fifo, larlight::hit, larlight::event_hit, larlight::mcnu, larlight::mcpart, larlight::event_mcpart, larlight::mcshower, larlight::event_mcshower, larlight::mctrajectory, larlight::mctruth, larlight::event_mctruth, larlight::pmtfifo, larlight::event_pmtfifo, larlight::pulse, larlight::event_pulse, larlight::shower, larlight::event_shower, larlight::simch, larlight::event_simch, larlight::spacepoint, larlight::event_sps, larlight::tpcfifo, larlight::event_tpcfifo, larlight::track, larlight::event_track, larlight::trigger, larlight::user_info, larlight::event_user, larlight::vertex, larlight::event_vertex, larlight::wire, and larlight::event_wire.
Definition at line 45 of file data_base.hh.
References _ass.
Referenced by data_base().
00045 {_ass.clear();}
DATA::DATA_TYPE larlight::data_base::data_type | ( | ) | const [inline] |
data type getter
Reimplemented in larlight::event_base.
Definition at line 48 of file data_base.hh.
References _type.
00048 {return _type; }
size_t larlight::data_base::size_association | ( | DATA::DATA_TYPE | type | ) | const |
Getter for # of associations.
Definition at line 23 of file data_base.cc.
Referenced by larlight::cluster::get_hit_type().
std::map<larlight::DATA::DATA_TYPE,std::vector<std::vector<unsigned short> > > larlight::data_base::_ass [protected] |
Association storage ... allow multiple set of associations.
Definition at line 65 of file data_base.hh.
Referenced by add_association(), and clear_data().
DATA::DATA_TYPE larlight::data_base::_type [protected] |
DATA_TYPE.
Definition at line 62 of file data_base.hh.
Referenced by larlight::calorimetry::calorimetry(), larlight::cluster::cluster(), data_base(), larlight::event_base::data_type(), data_type(), larlight::endpoint2d::endpoint2d(), larlight::event_calorimetry::event_calorimetry(), larlight::event_cluster::event_cluster(), larlight::event_endpoint2d::event_endpoint2d(), larlight::event_fifo::event_fifo(), larlight::event_hit::event_hit(), larlight::event_mcpart::event_mcpart(), larlight::event_mcshower::event_mcshower(), larlight::event_mctruth::event_mctruth(), larlight::event_pulse::event_pulse(), larlight::event_shower::event_shower(), larlight::event_simch::event_simch(), larlight::event_sps::event_sps(), larlight::event_track::event_track(), larlight::event_user::event_user(), larlight::event_vertex::event_vertex(), larlight::event_wire::event_wire(), larlight::fifo::fifo(), larlight::hit::hit(), larlight::mcnu::mcnu(), larlight::mcpart::mcpart(), larlight::mcshower::mcshower(), larlight::mctrajectory::mctrajectory(), larlight::mctruth::mctruth(), larlight::pmtfifo::pmtfifo(), larlight::pulse::pulse(), larlight::fifo::readout_sample_number_16MHz(), larlight::fifo::readout_sample_number_2MHz(), larlight::fifo::readout_sample_number_64MHz(), larlight::shower::shower(), larlight::simch::simch(), larlight::spacepoint::spacepoint(), larlight::tpcfifo::tpcfifo(), larlight::track::track(), larlight::trigger::trigger(), larlight::user_info::user_info(), larlight::vertex::vertex(), and larlight::wire::wire().