CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Friends
edm::DataFrameContainer Class Reference

#include <DataFrameContainer.h>

Inheritance diagram for edm::DataFrameContainer:
EcalDigiCollection HcalDataFrameContainer< Digi > HcalDataFrameContainer< QIE10DataFrame > HcalDataFrameContainer< QIE11DataFrame > EBDigiCollection EEDigiCollection ESDigiCollection

Classes

struct  IterHelp
 

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_DataIterconst_IterPair
 
typedef unsigned short data_type
 
typedef std::vector< data_typeDataContainer
 
typedef std::vector< data_type >::iterator DataIter
 
typedef unsigned int id_type
 
typedef std::vector< id_typeIdContainer
 
typedef std::vector< id_type >::iterator IdIter
 
typedef std::pair< IdIter, DataIterIterPair
 
typedef unsigned int size_type
 

Public Member Functions

DataFrame back ()
 
const_iterator begin () const
 
 DataFrameContainer ()
 
 DataFrameContainer (size_t istride, int isubdet=0, size_t isize=0)
 
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
 
DataFrameContaineroperator= (DataFrameContainer const &rhs)
 
DataFrame operator[] (size_t i)
 
DataFrame operator[] (size_t i) const
 
IterPair pair (size_t i)
 
const_IterPair pair (size_t i) const
 
void pop_back ()
 
void push_back (id_type iid, data_type const *idata)
 
void push_back (id_type iid)
 
void reserve (size_t isize)
 
void resize (size_t isize)
 
void set_back (id_type iid, data_type const *idata)
 
void set_back (id_type iid)
 
void set_back (data_type const *idata)
 
size_type size () const
 
void sort ()
 
size_type stride () const
 
int subdetId () const
 
void swap (DataFrameContainer &rh)
 
void swap (IdContainer &iic, DataContainer &idc)
 

Private Attributes

DataContainer m_data
 
IdContainer m_ids
 
size_type m_stride
 
int m_subdetId
 

Friends

class ::TestDataFrame
 
template<typename DigiCollection >
class ::TestEcalDigi
 

Detailed Description

an optitimized container that linearized a "vector of vector". 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 31 of file DataFrameContainer.h.

Member Typedef Documentation

Definition at line 42 of file DataFrameContainer.h.

Definition at line 41 of file DataFrameContainer.h.

typedef boost::transform_iterator<IterHelp,boost::counting_iterator<int> > edm::DataFrameContainer::const_iterator

Definition at line 58 of file DataFrameContainer.h.

Definition at line 43 of file DataFrameContainer.h.

typedef unsigned short edm::DataFrameContainer::data_type

Definition at line 35 of file DataFrameContainer.h.

Definition at line 37 of file DataFrameContainer.h.

typedef std::vector<data_type>::iterator edm::DataFrameContainer::DataIter

Definition at line 39 of file DataFrameContainer.h.

typedef unsigned int edm::DataFrameContainer::id_type

Definition at line 34 of file DataFrameContainer.h.

Definition at line 36 of file DataFrameContainer.h.

typedef std::vector<id_type>::iterator edm::DataFrameContainer::IdIter

Definition at line 38 of file DataFrameContainer.h.

Definition at line 40 of file DataFrameContainer.h.

typedef unsigned int edm::DataFrameContainer::size_type

Definition at line 33 of file DataFrameContainer.h.

Constructor & Destructor Documentation

edm::DataFrameContainer::DataFrameContainer ( )
inline

Definition at line 60 of file DataFrameContainer.h.

edm::DataFrameContainer::DataFrameContainer ( size_t  istride,
int  isubdet = 0,
size_t  isize = 0 
)
inlineexplicit

Definition at line 64 of file DataFrameContainer.h.

64  :
65  m_subdetId(isubdet), m_stride(istride),
66  m_ids(isize), m_data(isize*m_stride){}

Member Function Documentation

DataFrame edm::DataFrameContainer::back ( )
inline
const_iterator edm::DataFrameContainer::begin ( void  ) const
inline

Definition at line 159 of file DataFrameContainer.h.

References edm::DataFrameContainer::IterHelp::IterHelp().

Referenced by PedestalTask::_process(), LEDTask::_process(), DigiPhase1Task::_process(), DigiTask::_process(), LaserTask::_process(), HcalTriggerPrimitiveAlgo::addDigis(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), ESPedestalTask::analyze(), ESTimingTask::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), ECALpedestalPCLworker::analyze(), EcalSimple2007H4TBAnalyzer::analyze(), EcalPulseShapeGrapher::analyze(), testChannel::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), EcnaAnalyzer::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), EcalSignalGenerator< EEDigitizerTraits >::fill(), reco::HcalNoiseInfoProducer::filldigis(), HFPreReconstructor::fillInfos(), HcalDataFrameFilter::filter(), HLTHcalLaserMisfireFilter::filter(), EcalSimRawData::getEbDigi(), EcalDisplaysByEvent::makeHistos(), HSCPValidator::makeSimDigiPlotsECAL(), ESRecHitProducer::produce(), ESDigiToRaw::produce(), EcalDigiSelector::produce(), ESZeroSuppressionProducer::produce(), EcalPedOffset::readDACs(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), HcalDigisValidation::reco(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalUncalibRecHitWorkerMultiFit::run(), EcalSelectiveReadoutSuppressor::run(), ecaldqm::LedTask::runOnDigis(), EcalMipGraphs::selectDigi(), EcalDisplaysByEvent::selectDigi(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), and HcalZeroSuppressionAlgo::suppress().

159  {
160  return boost::make_transform_iterator(boost::counting_iterator<int>(0),
161  IterHelp(*this));
162  }
bool edm::DataFrameContainer::empty ( ) const
inline
const_iterator edm::DataFrameContainer::end ( void  ) const
inline

Definition at line 163 of file DataFrameContainer.h.

References edm::DataFrameContainer::IterHelp::IterHelp(), and size().

Referenced by PedestalTask::_process(), LEDTask::_process(), DigiPhase1Task::_process(), DigiTask::_process(), LaserTask::_process(), HcalTriggerPrimitiveAlgo::addDigis(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), ESPedestalTask::analyze(), EcalTBValidation::analyze(), ESTimingTask::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), ECALpedestalPCLworker::analyze(), EcalSimpleTBAnalyzer::analyze(), EcalSimple2007H4TBAnalyzer::analyze(), EcalBarrelRecHitsValidation::analyze(), EcalPulseShapeGrapher::analyze(), testChannel::analyze(), EcalLaserAnalyzer2::analyze(), EcalEndcapRecHitsValidation::analyze(), EcalLaserAnalyzer::analyze(), EcnaAnalyzer::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), EcalSignalGenerator< EEDigitizerTraits >::fill(), reco::HcalNoiseInfoProducer::filldigis(), HFPreReconstructor::fillInfos(), HcalDataFrameFilter::filter(), HLTHcalLaserMisfireFilter::filter(), find(), EcalSimRawData::getEbDigi(), EcalDisplaysByEvent::makeHistos(), HSCPValidator::makeSimDigiPlotsECAL(), ESRecHitProducer::produce(), ESDigiToRaw::produce(), EcalDigiSelector::produce(), ESZeroSuppressionProducer::produce(), EcalDigiToRaw::produce(), HLTRechitsToDigis::produce(), EcalPedOffset::readDACs(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), HcalDigisValidation::reco(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalUncalibRecHitWorkerMultiFit::run(), EcalSelectiveReadoutSuppressor::run(), ecaldqm::LedTask::runOnDigis(), EcalMipGraphs::selectDigi(), EcalDisplaysByEvent::selectDigi(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), and HcalZeroSuppressionAlgo::suppress().

163  {
164  return boost::make_transform_iterator(boost::counting_iterator<int>(size()),
165  IterHelp(*this));
166  }
const_iterator edm::DataFrameContainer::find ( id_type  i) const
inline

Definition at line 152 of file DataFrameContainer.h.

References end(), mps_fire::i, edm::DataFrameContainer::IterHelp::IterHelp(), m_ids, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.Tag::__getattr__(), JetToDigiDump::analyze(), EcalTBValidation::analyze(), EcalSimpleTBAnalyzer::analyze(), EcalBarrelRecHitsValidation::analyze(), EcalEndcapRecHitsValidation::analyze(), HLTEcalPhiSymFilter::filter(), BeautifulSoup.Tag::firstText(), and HLTRechitsToDigis::produce().

152  {
153  const_IdIter p = std::lower_bound(m_ids.begin(),m_ids.end(),i);
154  return (p==m_ids.end() || (*p)!=i) ? end() :
155  boost::make_transform_iterator(boost::counting_iterator<int>(p-m_ids.begin()),
156  IterHelp(*this));
157  }
std::vector< id_type >::const_iterator const_IdIter
const_iterator end() const
data_type const* edm::DataFrameContainer::frame ( size_t  cell) const
inline

Definition at line 181 of file DataFrameContainer.h.

References m_data, and m_stride.

Referenced by edm::DataFrame::set().

181  {
182  return &m_data[cell*m_stride];
183  }
id_type edm::DataFrameContainer::id ( size_t  cell) const
inline

Definition at line 185 of file DataFrameContainer.h.

References m_ids.

Referenced by edm::DataFrame::set().

185  {
186  return m_ids[cell];
187  }
data_type edm::DataFrameContainer::operator() ( size_t  cell,
size_t  frame 
) const
inline

Definition at line 177 of file DataFrameContainer.h.

References edm::DataFrameContainer::IterHelp::frame, m_data, and m_stride.

177  {
178  return m_data[cell*m_stride+frame];
179  }
data_type const * frame(size_t cell) const
DataFrameContainer& edm::DataFrameContainer::operator= ( DataFrameContainer const &  rhs)
inline

Definition at line 75 of file DataFrameContainer.h.

References swap(), and groupFilesInBlocks::temp.

75  {
77  this->swap(temp);
78  return *this;
79  }
void swap(DataFrameContainer &rh)
DataFrame edm::DataFrameContainer::operator[] ( size_t  i)
inline

Definition at line 143 of file DataFrameContainer.h.

143  {
144  return DataFrame(*this,i);
145  }
DataFrame edm::DataFrameContainer::operator[] ( size_t  i) const
inline

Definition at line 147 of file DataFrameContainer.h.

147  {
148  return DataFrame(*this,i);
149  }
IterPair edm::DataFrameContainer::pair ( size_t  i)
inline

Definition at line 135 of file DataFrameContainer.h.

References mps_fire::i, m_data, m_ids, and m_stride.

135  {
136  return IterPair(m_ids.begin()+i,m_data.begin()+i*m_stride);
137  }
std::pair< IdIter, DataIter > IterPair
const_IterPair edm::DataFrameContainer::pair ( size_t  i) const
inline

Definition at line 139 of file DataFrameContainer.h.

References mps_fire::i, m_data, m_ids, and m_stride.

139  {
140  return const_IterPair(m_ids.begin()+i,m_data.begin()+i*m_stride);
141  }
std::pair< const_IdIter, const_DataIter > const_IterPair
void edm::DataFrameContainer::pop_back ( )
inline

Definition at line 128 of file DataFrameContainer.h.

References m_data, m_ids, and m_stride.

Referenced by EcalTB07DaqFormatter::interpretRawData(), and EcalTBDaqFormatter::interpretRawData().

128  {
129  m_ids.resize(m_ids.size()-1);
130  m_data.resize(m_data.size()-m_stride);
131  }
void edm::DataFrameContainer::push_back ( id_type  iid,
data_type const *  idata 
)
inline

Definition at line 99 of file DataFrameContainer.h.

References popcon2dropbox::copy(), fwrapper::cs, m_data, m_ids, and m_stride.

Referenced by EEDigiCollection::push_back(), ESDigiCollection::push_back(), and HcalDataFrameContainer< QIE10DataFrame >::swap().

99  {
100  m_ids.push_back(iid);
101  size_t cs = m_data.size();
102  m_data.resize(m_data.size()+m_stride);
103  std::copy(idata,idata+m_stride,m_data.begin()+cs);
104  }
auto_ptr< ClusterSequence > cs
def copy(args, dbName)
void edm::DataFrameContainer::push_back ( id_type  iid)
inline

Definition at line 106 of file DataFrameContainer.h.

References m_data, m_ids, and m_stride.

106  {
107  m_ids.push_back(iid);
108  m_data.resize(m_data.size()+m_stride);
109  }
void edm::DataFrameContainer::reserve ( size_t  isize)
inline
void edm::DataFrameContainer::resize ( size_t  isize)
inline
void edm::DataFrameContainer::set_back ( id_type  iid,
data_type const *  idata 
)
inline

Definition at line 111 of file DataFrameContainer.h.

References popcon2dropbox::copy(), fwrapper::cs, m_data, m_ids, and m_stride.

111  {
112  m_ids.back() = iid;
113  size_t cs = m_data.size()-m_stride;
114  std::copy(idata,idata+m_stride,m_data.begin()+cs);
115  }
auto_ptr< ClusterSequence > cs
def copy(args, dbName)
void edm::DataFrameContainer::set_back ( id_type  iid)
inline

Definition at line 116 of file DataFrameContainer.h.

References m_ids.

116  {
117  m_ids.back() = iid;
118  }
void edm::DataFrameContainer::set_back ( data_type const *  idata)
inline

Definition at line 119 of file DataFrameContainer.h.

References popcon2dropbox::copy(), fwrapper::cs, m_data, and m_stride.

119  {
120  size_t cs = m_data.size()-m_stride;
121  std::copy(idata,idata+m_stride,m_data.begin()+cs);
122  }
auto_ptr< ClusterSequence > cs
def copy(args, dbName)
size_type edm::DataFrameContainer::size ( void  ) const
inline

Definition at line 175 of file DataFrameContainer.h.

References m_ids.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), QIE10Task::_process(), QIE11Task::_process(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), EcalPreshowerNoiseDistrib::analyze(), EcalTPInputAnalyzer::analyze(), EcalTPGAnalyzer::analyze(), EcalPreshowerDigisValidation::analyze(), EcalEndcapDigisValidation::analyze(), EcalBarrelDigisValidation::analyze(), EcalDigisValidation::analyze(), HLTGetDigi::analyze(), HGCalDigiValidation::analyze(), EcalMixingModuleValidation::analyze(), EcnaAnalyzer::analyze(), EcalSelectiveReadoutValidation::analyzeDataVolume(), EcalSelectiveReadoutValidation::analyzeEE(), back(), EcalTBDigiProducer::cacheEEDigis(), end(), GlobalDigisProducer::fillECal(), GlobalDigisAnalyzer::fillECal(), HFPreReconstructor::fillInfos(), HLTHcalLaserMisfireFilter::filter(), EcalUncalibRecHitProducer::produce(), ESRecHitProducer::produce(), HcalRealisticZS::produce(), HcalSimpleAmplitudeZS::produce(), EcalTBWeightUncalibRecHitProducer::produce(), EcalZeroSuppressionProducer::produce(), EcalEBTrigPrimProducer::produce(), EcalTrigPrimProducer::produce(), HcalDigiToRawuHTR::produce(), HBHEPhase1Reconstructor::produce(), EcalDigiDisplay::readEBDigis(), EcalDigiDisplay::readEEDigis(), EcalTBReadout::readOut(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalUncalibRecHitWorkerMultiFit::run(), EcalEBTrigPrimTestAlgo::run(), and EcalSelectiveReadoutSuppressor::run().

175 { return m_ids.size();}
void edm::DataFrameContainer::sort ( )

Definition at line 21 of file DataFrameContainer.cc.

References popcon2dropbox::copy(), mps_fire::i, alignCSCRings::s, findQualityFiles::size, and tmp.

Referenced by resize().

21  {
22  if (size()<2) return;
23  std::vector<int> indices(size(),1);
24  indices[0]=0;
25  std::partial_sum(indices.begin(),indices.end(),indices.begin());
26  std::sort(indices.begin(), indices.end(), TypeCompare(m_ids));
27  {
28  IdContainer tmp(m_ids.size());
29  std::copy(
30  boost::make_permutation_iterator( m_ids.begin(), indices.begin() ),
31  boost::make_permutation_iterator( m_ids.end(), indices.end() ),
32  tmp.begin());
33  tmp.swap(m_ids);
34  }
35  {
36  // std::transform(indices.begin(),indices.end(),indices.begin(),
37  // std::bind(std::multiplies<int>(),m_stride,std::placeholders::_1));
38  DataContainer tmp(m_data.size());
39  size_type s = m_stride*sizeof(data_type);
40  for(size_type j=0, i=0; i!=indices.size(); ++i, j+=m_stride)
41  ::memcpy(&tmp[j], &m_data[indices[i]*m_stride], s);
42  tmp.swap(m_data);
43  }
44 
45  }
def copy(args, dbName)
std::vector< data_type > DataContainer
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< id_type > IdContainer
size_type edm::DataFrameContainer::stride ( ) const
inline

Definition at line 171 of file DataFrameContainer.h.

References m_stride.

Referenced by HcalDataFrameContainer< QIE10DataFrame >::samples(), and edm::DataFrame::set().

171 { return m_stride; }
int edm::DataFrameContainer::subdetId ( ) const
inline

Definition at line 169 of file DataFrameContainer.h.

References m_subdetId.

void edm::DataFrameContainer::swap ( DataFrameContainer rh)
inline

Definition at line 68 of file DataFrameContainer.h.

References m_data, m_ids, m_stride, m_subdetId, and std::swap().

Referenced by operator=(), edm::swap(), and std::swap().

68  {
69  std::swap(m_subdetId,rh.m_subdetId);
70  std::swap(m_stride,rh.m_stride);
71  m_ids.swap(rh.m_ids);
72  m_data.swap(rh.m_data);
73  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void edm::DataFrameContainer::swap ( IdContainer iic,
DataContainer idc 
)
inline

Definition at line 81 of file DataFrameContainer.h.

References m_data, and m_ids.

81  {
82  m_ids.swap(iic);
83  m_data.swap(idc);
84  }

Friends And Related Function Documentation

friend class ::TestDataFrame
friend

Definition at line 194 of file DataFrameContainer.h.

template<typename DigiCollection >
friend class ::TestEcalDigi
friend

Definition at line 197 of file DataFrameContainer.h.

Member Data Documentation

DataContainer edm::DataFrameContainer::m_data
private
IdContainer edm::DataFrameContainer::m_ids
private

Definition at line 205 of file DataFrameContainer.h.

Referenced by empty(), find(), id(), pair(), pop_back(), push_back(), reserve(), resize(), set_back(), size(), and swap().

size_type edm::DataFrameContainer::m_stride
private
int edm::DataFrameContainer::m_subdetId
private

Definition at line 200 of file DataFrameContainer.h.

Referenced by subdetId(), and swap().