larlight::fifo Class Reference

Channel-wise data member class to hold a collection of ADC samples. More...

#include <fifo.hh>

Inheritance diagram for larlight::fifo:
larlight::data_base larlight::pmtfifo larlight::tpcfifo

List of all members.

Public Member Functions

 fifo (DATA::DATA_TYPE type=DATA::FIFO)
 Default constructor.
 fifo (const fifo &original)
 Default copy constructor.
 fifo (UShort_t ch, UInt_t frame, UInt_t sample, UChar_t module_address, UChar_t module_id, DATA::DATA_TYPE type, std::vector< UShort_t > wf)
 Fast vector copy constructor.
void set_channel_number (UShort_t ch)
 Setter for the channel number.
void set_readout_frame_number (UInt_t id)
 Setter for the channel frame ID number.
void set_readout_sample_number (UInt_t t)
 Setter for the readout_sample_number number.
void set_module_address (UChar_t n)
 Setter for the module address.
void set_module_id (UChar_t n)
 Setter for the module id.
UInt_t readout_frame_number () const
 Getter for the channel frame ID number.
UInt_t readout_sample_number_RAW () const
 Getter for a RAW readout sample number.
UInt_t readout_sample_number_2MHz () const
 Getter for the readout_sample_number number.
UInt_t readout_sample_number_16MHz () const
 Getter for the readout_sample_number number.
UInt_t readout_sample_number_64MHz () const
 Getter for the readout_sample_number number.
UShort_t channel_number () const
 Getter for the channel number.
UChar_t module_address () const
 Getter for the module address.
UChar_t module_id () const
 Getter for the module id.
virtual void clear_data ()
 Method to clear currently held data contents in the buffer.
 ~fifo ()
 Default destructor.
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 Member Functions

virtual void init_vars ()
 Internal function to reset variables.

Protected Attributes

UShort_t _channel_number
 Channel number.
UChar_t _module_address
 Module number.
UChar_t _module_id
 Module ID.
UInt_t _readout_frame_number
 Frame number.
UInt_t _readout_sample_number
 Sample number.
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.

Detailed Description

Channel-wise data member class to hold a collection of ADC samples.

Definition at line 26 of file fifo.hh.


Constructor & Destructor Documentation

larlight::fifo::fifo ( DATA::DATA_TYPE  type = DATA::FIFO  ) 

Default constructor.

Definition at line 9 of file fifo.cc.

References larlight::data_base::_type, clear_data(), larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::FIFO, larlight::DATA::PMTFIFO, larlight::Message::send(), and larlight::DATA::TPCFIFO.

00009                                : std::vector<UShort_t>(),
00010                      data_base(type)
00011   //***************************************************************************
00012   {
00013     
00014     if(_type!=DATA::FIFO &&
00015        _type!=DATA::PMTFIFO &&
00016        _type!=DATA::TPCFIFO) {
00017       
00018       Message::send(MSG::ERROR,__FUNCTION__,
00019             Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00020       _type=DATA::FIFO;
00021     }
00022 
00023     clear_data();
00024   }

larlight::fifo::fifo ( const fifo original  )  [inline]

Default copy constructor.

Definition at line 35 of file fifo.hh.

00036       : std::vector<UShort_t>(original),
00037     data_base(original),
00038     _channel_number(original._channel_number),
00039     _module_address(original._module_address),
00040     _module_id(original._module_id),
00041     _readout_frame_number(original._readout_frame_number),
00042     _readout_sample_number(original._readout_sample_number)
00043     {}

larlight::fifo::fifo ( UShort_t  ch,
UInt_t  frame,
UInt_t  sample,
UChar_t  module_address,
UChar_t  module_id,
DATA::DATA_TYPE  type,
std::vector< UShort_t >  wf 
) [inline]

Fast vector copy constructor.

Definition at line 46 of file fifo.hh.

00052                              : std::vector<UShort_t>(wf),
00053                      data_base(type),
00054                      _channel_number(ch),
00055                      _module_address(module_address),
00056                      _module_id(module_id),
00057                      _readout_frame_number(frame),
00058                      _readout_sample_number(sample)
00059     {}

larlight::fifo::~fifo (  )  [inline]

Default destructor.

Definition at line 108 of file fifo.hh.

00108 {}


Member Function Documentation

void larlight::data_base::add_association ( DATA::DATA_TYPE  type,
const std::vector< unsigned short >  ass 
) [inherited]

Adder for a set of association.

Definition at line 9 of file data_base.cc.

References larlight::data_base::_ass.

00011   {
00012 
00013     if( _ass.find(type) == _ass.end() )
00014       
00015       _ass[type]=std::vector<std::vector<unsigned short> >();
00016     
00017     _ass[type].push_back(ass);
00018     
00019     
00020   }

const std::vector< unsigned short > larlight::data_base::association ( DATA::DATA_TYPE  type,
size_t  index = 0 
) const [inherited]

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   }

UShort_t larlight::fifo::channel_number (  )  const [inline]

Getter for the channel number.

Definition at line 96 of file fifo.hh.

References _channel_number.

00096 {return _channel_number;}

void larlight::fifo::clear_data (  )  [virtual]

Method to clear currently held data contents in the buffer.

Reimplemented from larlight::data_base.

Reimplemented in larlight::pmtfifo, and larlight::tpcfifo.

Definition at line 27 of file fifo.cc.

References init_vars().

Referenced by fifo().

00029   {
00030 
00031     data_base::clear_data();
00032     clear();
00033     init_vars();
00034   }

DATA::DATA_TYPE larlight::data_base::data_type (  )  const [inline, inherited]

data type getter

Reimplemented in larlight::event_base.

Definition at line 48 of file data_base.hh.

References larlight::data_base::_type.

00048 {return _type; }

void larlight::fifo::init_vars (  )  [protected, virtual]
UChar_t larlight::fifo::module_address (  )  const [inline]

Getter for the module address.

Definition at line 99 of file fifo.hh.

References _module_address.

00099 { return _module_address; }

UChar_t larlight::fifo::module_id (  )  const [inline]

Getter for the module id.

Definition at line 102 of file fifo.hh.

References _module_id.

00102 {return _module_id;}

UInt_t larlight::fifo::readout_frame_number (  )  const [inline]

Getter for the channel frame ID number.

Definition at line 78 of file fifo.hh.

References _readout_frame_number.

00078 {return _readout_frame_number;}

UInt_t larlight::fifo::readout_sample_number_16MHz (  )  const [inline]

Getter for the readout_sample_number number.

Definition at line 88 of file fifo.hh.

References _readout_sample_number, larlight::data_base::_type, and larlight::DATA::PMTFIFO.

UInt_t larlight::fifo::readout_sample_number_2MHz (  )  const [inline]

Getter for the readout_sample_number number.

Definition at line 84 of file fifo.hh.

References _readout_sample_number, larlight::data_base::_type, and larlight::DATA::PMTFIFO.

UInt_t larlight::fifo::readout_sample_number_64MHz (  )  const [inline]

Getter for the readout_sample_number number.

Definition at line 92 of file fifo.hh.

References _readout_sample_number, larlight::data_base::_type, and larlight::DATA::PMTFIFO.

UInt_t larlight::fifo::readout_sample_number_RAW (  )  const [inline]

Getter for a RAW readout sample number.

Definition at line 81 of file fifo.hh.

References _readout_sample_number.

00081 { return _readout_sample_number; }

void larlight::fifo::set_channel_number ( UShort_t  ch  )  [inline]

Setter for the channel number.

Definition at line 63 of file fifo.hh.

References _channel_number.

Referenced by main().

00063 {_channel_number=ch;}

void larlight::fifo::set_module_address ( UChar_t  n  )  [inline]

Setter for the module address.

Definition at line 72 of file fifo.hh.

References _module_address.

00072 { _module_address = n;}

void larlight::fifo::set_module_id ( UChar_t  n  )  [inline]

Setter for the module id.

Definition at line 75 of file fifo.hh.

References _module_id.

00075 { _module_id = n;}

void larlight::fifo::set_readout_frame_number ( UInt_t  id  )  [inline]

Setter for the channel frame ID number.

Definition at line 66 of file fifo.hh.

References _readout_frame_number.

void larlight::fifo::set_readout_sample_number ( UInt_t  t  )  [inline]

Setter for the readout_sample_number number.

Definition at line 69 of file fifo.hh.

References _readout_sample_number.

size_t larlight::data_base::size_association ( DATA::DATA_TYPE  type  )  const [inherited]

Getter for # of associations.

Definition at line 23 of file data_base.cc.

Referenced by larlight::cluster::get_hit_type().

00025   {
00026     
00027     if( _ass.find(type) == _ass.end() ) return 0;
00028     
00029     return ((_ass.find(type))->second).size();
00030     //return _ass[type].size();
00031     
00032   }


Member Data Documentation

std::map<larlight::DATA::DATA_TYPE,std::vector<std::vector<unsigned short> > > larlight::data_base::_ass [protected, inherited]

Association storage ... allow multiple set of associations.

Definition at line 65 of file data_base.hh.

Referenced by larlight::data_base::add_association(), and larlight::data_base::clear_data().

UShort_t larlight::fifo::_channel_number [protected]

Channel number.

Definition at line 116 of file fifo.hh.

Referenced by channel_number(), init_vars(), and set_channel_number().

UChar_t larlight::fifo::_module_address [protected]

Module number.

Definition at line 117 of file fifo.hh.

Referenced by init_vars(), module_address(), and set_module_address().

UChar_t larlight::fifo::_module_id [protected]

Module ID.

Definition at line 118 of file fifo.hh.

Referenced by init_vars(), module_id(), and set_module_id().

Frame number.

Definition at line 119 of file fifo.hh.

Referenced by init_vars(), readout_frame_number(), and set_readout_frame_number().

DATA_TYPE.

Definition at line 62 of file data_base.hh.

Referenced by larlight::calorimetry::calorimetry(), larlight::cluster::cluster(), larlight::data_base::data_base(), larlight::event_base::data_type(), larlight::data_base::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(), 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(), readout_sample_number_16MHz(), readout_sample_number_2MHz(), 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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator

Generated on 3 Jun 2014 for MyProject by  doxygen 1.6.1