#include <DataFormats/Common/interface/DataFrameContainer.h>
Public Types | |
typedef std::vector< data_type > ::const_iterator | const_DataIter |
typedef std::vector< id_type > ::const_iterator | const_IdIter |
typedef boost::transform_iterator < IterHelp, boost::counting_iterator< int > > | const_iterator |
typedef std::pair < const_IdIter, const_DataIter > | const_IterPair |
typedef unsigned short | data_type |
typedef std::vector< data_type > | DataContainer |
typedef std::vector< data_type > ::iterator | DataIter |
typedef unsigned int | id_type |
typedef std::vector< id_type > | IdContainer |
typedef std::vector< id_type > ::iterator | IdIter |
typedef std::pair< IdIter, DataIter > | IterPair |
typedef unsigned int | size_type |
Public Member Functions | |
DataFrame | back () |
const_iterator | begin () const |
DataFrameContainer (size_t istride, int isubdet=0, size_t isize=0) | |
DataFrameContainer () | |
bool | empty () const |
const_iterator | end () const |
const_iterator | find (id_type i) const |
data_type const * | frame (size_t cell) const |
id_type | id (size_t cell) const |
data_type | operator() (size_t cell, size_t frame) const |
DataFrameContainer & | operator= (DataFrameContainer const &rhs) |
DataFrame | operator[] (size_t i) const |
DataFrame | operator[] (size_t i) |
const_IterPair | pair (size_t i) const |
IterPair | pair (size_t i) |
void | pop_back () |
void | push_back (id_type iid) |
void | push_back (id_type iid, data_type const *idata) |
void | reserve (size_t isize) |
void | resize (size_t isize) |
void | set_back (data_type const *idata) |
void | set_back (id_type iid) |
void | set_back (id_type iid, data_type const *idata) |
size_type | size () const |
void | sort () |
size_type | stride () const |
int | subdetId () const |
void | swap (IdContainer &iic, DataContainer &idc) |
void | swap (DataFrameContainer &rh) |
Private Attributes | |
DataContainer | m_data |
IdContainer | m_ids |
size_type | m_stride |
int | m_subdetId |
Classes | |
struct | IterHelp |
It corresponds to a set of fixed size array of 16bit words each belonging to a "channel" identified by an 32bit id
FIXME interface to be finalized once use-cases fully identified
although it can be sorted internally it is strongly adviced to fill it already sorted....
Definition at line 23 of file DataFrameContainer.h.
typedef std::vector<data_type>::const_iterator edm::DataFrameContainer::const_DataIter |
Definition at line 34 of file DataFrameContainer.h.
typedef std::vector<id_type>::const_iterator edm::DataFrameContainer::const_IdIter |
Definition at line 33 of file DataFrameContainer.h.
typedef boost::transform_iterator<IterHelp,boost::counting_iterator<int> > edm::DataFrameContainer::const_iterator |
Definition at line 50 of file DataFrameContainer.h.
typedef std::pair<const_IdIter,const_DataIter> edm::DataFrameContainer::const_IterPair |
Definition at line 35 of file DataFrameContainer.h.
typedef unsigned short edm::DataFrameContainer::data_type |
Definition at line 27 of file DataFrameContainer.h.
typedef std::vector<data_type> edm::DataFrameContainer::DataContainer |
Definition at line 29 of file DataFrameContainer.h.
typedef std::vector<data_type>::iterator edm::DataFrameContainer::DataIter |
Definition at line 31 of file DataFrameContainer.h.
typedef unsigned int edm::DataFrameContainer::id_type |
Definition at line 26 of file DataFrameContainer.h.
typedef std::vector<id_type> edm::DataFrameContainer::IdContainer |
Definition at line 28 of file DataFrameContainer.h.
typedef std::vector<id_type>::iterator edm::DataFrameContainer::IdIter |
Definition at line 30 of file DataFrameContainer.h.
typedef std::pair<IdIter,DataIter> edm::DataFrameContainer::IterPair |
Definition at line 32 of file DataFrameContainer.h.
typedef unsigned int edm::DataFrameContainer::size_type |
Reimplemented in EcalDigiCollection, EBDigiCollection, and EEDigiCollection.
Definition at line 25 of file DataFrameContainer.h.
edm::DataFrameContainer::DataFrameContainer | ( | ) | [inline] |
edm::DataFrameContainer::DataFrameContainer | ( | size_t | istride, | |
int | isubdet = 0 , |
|||
size_t | isize = 0 | |||
) | [inline, explicit] |
Definition at line 54 of file DataFrameContainer.h.
00054 : 00055 m_subdetId(isubdet), m_stride(istride), 00056 m_ids(isize), m_data(isize*m_stride){}
DataFrame edm::DataFrameContainer::back | ( | ) | [inline] |
Definition at line 114 of file DataFrameContainer.h.
References size().
Referenced by EcalTB07DaqFormatter::interpretRawData(), EcalTBDaqFormatter::interpretRawData(), EcalBarrelRecHitsMaker::loadEcalBarrelRecHits(), EcalEndcapRecHitsMaker::loadEcalEndcapRecHits(), and EcalTBReadout::readOut().
00114 { 00115 return DataFrame(*this,size()-1); 00116 }
const_iterator edm::DataFrameContainer::begin | ( | ) | const [inline] |
Definition at line 149 of file DataFrameContainer.h.
Referenced by EcalMaxSampleUncalibRecHitProducer::produce(), EcalWeightUncalibRecHitProducer::produce(), EcalFixedAlphaBetaFitUncalibRecHitProducer::produce(), EcalAnalFitUncalibRecHitProducer::produce(), EcalSelectiveReadoutSuppressor::run(), EcalSelectiveReadoutValidation::setTtEtSums(), and EcalSelectiveReadoutSuppressor::setTtFlags().
00149 { 00150 return boost::make_transform_iterator(boost::counting_iterator<int>(0), 00151 IterHelp(*this)); 00152 }
bool edm::DataFrameContainer::empty | ( | ) | const [inline] |
Definition at line 163 of file DataFrameContainer.h.
References m_ids.
00163 { return m_ids.empty();}
const_iterator edm::DataFrameContainer::end | ( | ) | const [inline] |
Definition at line 153 of file DataFrameContainer.h.
References size().
Referenced by EcalEndcapRecHitsValidation::analyze(), EcalSimpleTBAnalyzer::analyze(), EcalBarrelRecHitsValidation::analyze(), EcalTBValidation::analyze(), find(), EcalMaxSampleUncalibRecHitProducer::produce(), EcalWeightUncalibRecHitProducer::produce(), EcalFixedAlphaBetaFitUncalibRecHitProducer::produce(), EcalAnalFitUncalibRecHitProducer::produce(), EcalSelectiveReadoutSuppressor::run(), EcalSelectiveReadoutValidation::setTtEtSums(), and EcalSelectiveReadoutSuppressor::setTtFlags().
00153 { 00154 return boost::make_transform_iterator(boost::counting_iterator<int>(size()), 00155 IterHelp(*this)); 00156 }
const_iterator edm::DataFrameContainer::find | ( | id_type | i | ) | const [inline] |
Definition at line 142 of file DataFrameContainer.h.
References end(), m_ids, and p.
Referenced by EcalEndcapRecHitsValidation::analyze(), EcalSimpleTBAnalyzer::analyze(), EcalBarrelRecHitsValidation::analyze(), and EcalTBValidation::analyze().
00142 { 00143 const_IdIter p = std::lower_bound(m_ids.begin(),m_ids.end(),i); 00144 return (p==m_ids.end() || (*p)!=i) ? end() : 00145 boost::make_transform_iterator(boost::counting_iterator<int>(p-m_ids.begin()), 00146 IterHelp(*this)); 00147 }
data_type const* edm::DataFrameContainer::frame | ( | size_t | cell | ) | const [inline] |
Definition at line 171 of file DataFrameContainer.h.
References m_data, and m_stride.
Referenced by edm::DataFrame::set().
id_type edm::DataFrameContainer::id | ( | size_t | cell | ) | const [inline] |
Definition at line 175 of file DataFrameContainer.h.
References m_ids.
Referenced by edm::DataFrame::set().
00175 { 00176 return m_ids[cell]; 00177 }
data_type edm::DataFrameContainer::operator() | ( | size_t | cell, | |
size_t | frame | |||
) | const [inline] |
DataFrameContainer& edm::DataFrameContainer::operator= | ( | DataFrameContainer const & | rhs | ) | [inline] |
Definition at line 65 of file DataFrameContainer.h.
References swap(), and pyDBSRunClass::temp.
00065 { 00066 DataFrameContainer temp(rhs); 00067 this->swap(temp); 00068 return *this; 00069 }
DataFrame edm::DataFrameContainer::operator[] | ( | size_t | i | ) | const [inline] |
Definition at line 137 of file DataFrameContainer.h.
00137 { 00138 return DataFrame(*this,i); 00139 }
DataFrame edm::DataFrameContainer::operator[] | ( | size_t | i | ) | [inline] |
Definition at line 133 of file DataFrameContainer.h.
00133 { 00134 return DataFrame(*this,i); 00135 }
const_IterPair edm::DataFrameContainer::pair | ( | size_t | i | ) | const [inline] |
IterPair edm::DataFrameContainer::pair | ( | size_t | i | ) | [inline] |
void edm::DataFrameContainer::pop_back | ( | ) | [inline] |
Definition at line 118 of file DataFrameContainer.h.
References m_data, m_ids, and m_stride.
Referenced by EcalTB07DaqFormatter::interpretRawData(), and EcalTBDaqFormatter::interpretRawData().
Definition at line 89 of file DataFrameContainer.h.
References edmNew::copy(), m_data, m_ids, and m_stride.
Referenced by EcalTB07DaqFormatter::interpretRawData(), EcalTBDaqFormatter::interpretRawData(), EcalBarrelRecHitsMaker::loadEcalBarrelRecHits(), EcalEndcapRecHitsMaker::loadEcalEndcapRecHits(), EcalTBReadout::readOut(), and EcalSelectiveReadoutSuppressor::run().
00089 { 00090 m_ids.push_back(iid); 00091 size_t cs = m_data.size(); 00092 m_data.resize(m_data.size()+m_stride); 00093 std::copy(idata,idata+m_stride,m_data.begin()+cs); 00094 }
void edm::DataFrameContainer::reserve | ( | size_t | isize | ) | [inline] |
Definition at line 76 of file DataFrameContainer.h.
References m_data, m_ids, and m_stride.
Referenced by EcalTB07DaqFormatter::interpretRawData(), EcalTBDaqFormatter::interpretRawData(), EcalBarrelRecHitsMaker::loadEcalBarrelRecHits(), EcalEndcapRecHitsMaker::loadEcalEndcapRecHits(), and EcalSelectiveReadoutSuppressor::run().
void edm::DataFrameContainer::resize | ( | size_t | isize | ) | [inline] |
Definition at line 109 of file DataFrameContainer.h.
References edmNew::copy(), m_data, and m_stride.
00109 { 00110 size_t cs = m_data.size()-m_stride; 00111 std::copy(idata,idata+m_stride,m_data.begin()+cs); 00112 }
Definition at line 106 of file DataFrameContainer.h.
References m_ids.
00106 { 00107 m_ids.back() = iid; 00108 }
Definition at line 165 of file DataFrameContainer.h.
References m_ids.
Referenced by EcalDigisValidation::analyze(), HLTGetDigi::analyze(), EcalMixingModuleValidation::analyze(), back(), end(), EcalZeroSuppressionProducer::produce(), EcalTBWeightUncalibRecHitProducer::produce(), EcalWeightUncalibRecHitProducer::produce(), EcalMaxSampleUncalibRecHitProducer::produce(), EcalFixedAlphaBetaFitUncalibRecHitProducer::produce(), EcalAnalFitUncalibRecHitProducer::produce(), EcalTBReadout::readOut(), EcalSelectiveReadoutSuppressor::run(), and sort().
00165 { return m_ids.size();}
void edm::DataFrameContainer::sort | ( | ) |
Definition at line 23 of file DataFrameContainer.cc.
References edmNew::copy(), i, j, m_data, m_ids, m_stride, s, size(), python::multivaluedict::sort(), and tmp.
00023 { 00024 if (size()<2) return; 00025 std::vector<int> indices(size(),1); 00026 indices[0]=0; 00027 std::partial_sum(indices.begin(),indices.end(),indices.begin()); 00028 std::sort(indices.begin(), indices.end(), TypeCompare(m_ids)); 00029 { 00030 IdContainer tmp(m_ids.size()); 00031 std::copy( 00032 boost::make_permutation_iterator( m_ids.begin(), indices.begin() ), 00033 boost::make_permutation_iterator( m_ids.end(), indices.end() ), 00034 tmp.begin()); 00035 tmp.swap(m_ids); 00036 } 00037 { 00038 // std::transform(indices.begin(),indices.end(),indices.begin(), 00039 // boost::bind(std::multiplies<int>(),m_stride,_1)); 00040 DataContainer tmp(m_data.size()); 00041 size_type s = m_stride*sizeof(data_type); 00042 for(size_type j=0, i=0; i!=indices.size(); ++i, j+=m_stride) 00043 ::memcpy(&tmp[j], &m_data[indices[i]*m_stride], s); 00044 tmp.swap(m_data); 00045 } 00046 00047 }
size_type edm::DataFrameContainer::stride | ( | ) | const [inline] |
Definition at line 161 of file DataFrameContainer.h.
References m_stride.
Referenced by edm::DataFrame::set().
00161 { return m_stride; }
int edm::DataFrameContainer::subdetId | ( | ) | const [inline] |
Definition at line 159 of file DataFrameContainer.h.
References m_subdetId.
00159 { return m_subdetId; }
void edm::DataFrameContainer::swap | ( | IdContainer & | iic, | |
DataContainer & | idc | |||
) | [inline] |
void edm::DataFrameContainer::swap | ( | DataFrameContainer & | rh | ) | [inline] |
Definition at line 58 of file DataFrameContainer.h.
References m_data, m_ids, m_stride, m_subdetId, and std::swap().
Referenced by operator=(), edm::swap(), and std::swap().
00058 { 00059 std::swap(m_subdetId,rh.m_subdetId); 00060 std::swap(m_stride,rh.m_stride); 00061 m_ids.swap(rh.m_ids); 00062 m_data.swap(rh.m_data); 00063 }
DataContainer edm::DataFrameContainer::m_data [private] |
Definition at line 190 of file DataFrameContainer.h.
Referenced by frame(), operator()(), pair(), pop_back(), push_back(), reserve(), resize(), set_back(), sort(), and swap().
IdContainer edm::DataFrameContainer::m_ids [private] |
Definition at line 189 of file DataFrameContainer.h.
Referenced by empty(), find(), id(), pair(), pop_back(), push_back(), reserve(), resize(), set_back(), size(), sort(), and swap().
size_type edm::DataFrameContainer::m_stride [private] |
Definition at line 187 of file DataFrameContainer.h.
Referenced by frame(), operator()(), pair(), pop_back(), push_back(), reserve(), resize(), set_back(), sort(), stride(), and swap().
int edm::DataFrameContainer::m_subdetId [private] |