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 EcalDigiCollectionPh2 HcalDataFrameContainer< Digi > EBDigiCollection EEDigiCollection ESDigiCollection EBDigiCollectionPh2

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
 The iterator returned can not safely be used across threads. More...
 
DataContainer const & data () 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
 
IdContainer const & ids () 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)
 
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 (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....

NOTE: The iterator used by DataFrameContainer can not safely be used across threads, even if only call const methods

Definition at line 33 of file DataFrameContainer.h.

Member Typedef Documentation

◆ const_DataIter

Definition at line 44 of file DataFrameContainer.h.

◆ const_IdIter

Definition at line 43 of file DataFrameContainer.h.

◆ const_iterator

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

Definition at line 61 of file DataFrameContainer.h.

◆ const_IterPair

Definition at line 45 of file DataFrameContainer.h.

◆ data_type

typedef unsigned short edm::DataFrameContainer::data_type

Definition at line 37 of file DataFrameContainer.h.

◆ DataContainer

Definition at line 39 of file DataFrameContainer.h.

◆ DataIter

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

Definition at line 41 of file DataFrameContainer.h.

◆ id_type

typedef unsigned int edm::DataFrameContainer::id_type

Definition at line 36 of file DataFrameContainer.h.

◆ IdContainer

Definition at line 38 of file DataFrameContainer.h.

◆ IdIter

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

Definition at line 40 of file DataFrameContainer.h.

◆ IterPair

Definition at line 42 of file DataFrameContainer.h.

◆ size_type

typedef unsigned int edm::DataFrameContainer::size_type

Definition at line 35 of file DataFrameContainer.h.

Constructor & Destructor Documentation

◆ DataFrameContainer() [1/2]

edm::DataFrameContainer::DataFrameContainer ( )
inline

Definition at line 63 of file DataFrameContainer.h.

63 : m_subdetId(0), m_stride(0), m_ids(), m_data() {}

◆ DataFrameContainer() [2/2]

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

Definition at line 65 of file DataFrameContainer.h.

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

Member Function Documentation

◆ back()

DataFrame edm::DataFrameContainer::back ( )
inline

Definition at line 122 of file DataFrameContainer.h.

122 { return DataFrame(*this, size() - 1); }

References size().

Referenced by HcalDataFrameContainer< Digi >::backDataFrame(), EcalTBDaqFormatter::interpretRawData(), and EcalTB07DaqFormatter::interpretRawData().

◆ begin()

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

The iterator returned can not safely be used across threads.

Definition at line 149 of file DataFrameContainer.h.

149  {
150  return boost::make_transform_iterator(boost::counting_iterator<int>(0), IterHelp(*this));
151  }

Referenced by PedestalTask::_process(), LEDTask::_process(), DigiTask::_process(), LaserTask::_process(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), ESPedestalTask::analyze(), ZDCQIE10Task::analyze(), ESTimingTask::analyze(), FCDTask::analyze(), ECALpedestalPCLworker::analyze(), EcalSimple2007H4TBAnalyzer::analyze(), HGCalBHValidation::analyze(), testChannel::analyze(), EcalPulseShapeGrapher::analyze(), EcnaAnalyzer::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), HFPreReconstructor::fillInfos(), HcalDataFrameFilter::filter(), HLTHcalLaserMisfireFilter::filter(), EcalSimRawData::getEbDigi(), EcalDisplaysByEvent::makeHistos(), ESRecHitProducer::produce(), ESDigiToRaw::produce(), ESZeroSuppressionProducer::produce(), EcalDigiSelector::produce(), EcalDigiToRaw::produce(), EcalPedOffset::readDACs(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalUncalibRecHitWorkerMultiFit::run(), ecaldqm::LedTask::runOnDigis(), EcalMipGraphs::selectDigi(), EcalDisplaysByEvent::selectDigi(), EcalSelectiveReadoutValidation::setTtEtSums(), and EcalSelectiveReadoutSuppressor::setTtFlags().

◆ data()

DataContainer const& edm::DataFrameContainer::data ( ) const
inline

Definition at line 171 of file DataFrameContainer.h.

171 { return m_data; }

References m_data.

Referenced by HcalDataFrameContainer< Digi >::addDataFrame().

◆ empty()

bool edm::DataFrameContainer::empty ( ) const
inline

◆ end()

const_iterator edm::DataFrameContainer::end ( void  ) const
inline

Definition at line 152 of file DataFrameContainer.h.

152  {
153  return boost::make_transform_iterator(boost::counting_iterator<int>(size()), IterHelp(*this));
154  }

References size().

Referenced by PedestalTask::_process(), LEDTask::_process(), DigiTask::_process(), LaserTask::_process(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), ESPedestalTask::analyze(), ZDCQIE10Task::analyze(), EcalTBValidation::analyze(), ESTimingTask::analyze(), FCDTask::analyze(), ECALpedestalPCLworker::analyze(), EcalSimpleTBAnalyzer::analyze(), EcalSimple2007H4TBAnalyzer::analyze(), HGCalBHValidation::analyze(), testChannel::analyze(), EcalPulseShapeGrapher::analyze(), EcnaAnalyzer::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), HFPreReconstructor::fillInfos(), HcalDataFrameFilter::filter(), HLTHcalLaserMisfireFilter::filter(), find(), EcalSimRawData::getEbDigi(), EcalDisplaysByEvent::makeHistos(), ESRecHitProducer::produce(), ESDigiToRaw::produce(), ESZeroSuppressionProducer::produce(), EcalDigiSelector::produce(), HLTRechitsToDigis::produce(), EcalDigiToRaw::produce(), EcalPedOffset::readDACs(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalUncalibRecHitWorkerMultiFit::run(), ecaldqm::LedTask::runOnDigis(), EcalMipGraphs::selectDigi(), EcalDisplaysByEvent::selectDigi(), EcalSelectiveReadoutValidation::setTtEtSums(), and EcalSelectiveReadoutSuppressor::setTtFlags().

◆ find()

const_iterator edm::DataFrameContainer::find ( id_type  i) const
inline

slow interface The iterator returned can not safely be used across threads

Definition at line 141 of file DataFrameContainer.h.

141  {
142  const_IdIter p = std::lower_bound(m_ids.begin(), m_ids.end(), i);
143  return (p == m_ids.end() || (*p) != i)
144  ? end()
145  : boost::make_transform_iterator(boost::counting_iterator<int>(p - m_ids.begin()), IterHelp(*this));
146  }

References end(), mps_fire::i, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, m_ids, and AlCaHLTBitMon_ParallelJobs::p.

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

◆ frame()

data_type const* edm::DataFrameContainer::frame ( size_t  cell) const
inline

Definition at line 166 of file DataFrameContainer.h.

166 { return &m_data[cell * m_stride]; }

References m_data, and m_stride.

Referenced by operator()(), and edm::DataFrame::set().

◆ id()

id_type edm::DataFrameContainer::id ( size_t  cell) const
inline

Definition at line 168 of file DataFrameContainer.h.

168 { return m_ids[cell]; }

References m_ids.

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

◆ ids()

IdContainer const& edm::DataFrameContainer::ids ( ) const
inline

Definition at line 170 of file DataFrameContainer.h.

170 { return m_ids; }

References m_ids.

◆ operator()()

data_type edm::DataFrameContainer::operator() ( size_t  cell,
size_t  frame 
) const
inline

Definition at line 164 of file DataFrameContainer.h.

164 { return m_data[cell * m_stride + frame]; }

References frame(), m_data, and m_stride.

◆ operator=()

DataFrameContainer& edm::DataFrameContainer::operator= ( DataFrameContainer const &  rhs)
inline

Definition at line 75 of file DataFrameContainer.h.

75  {
77  this->swap(temp);
78  return *this;
79  }

References swap(), and groupFilesInBlocks::temp.

◆ operator[]() [1/2]

DataFrame edm::DataFrameContainer::operator[] ( size_t  i)
inline

Definition at line 135 of file DataFrameContainer.h.

135 { return DataFrame(*this, i); }

References mps_fire::i.

◆ operator[]() [2/2]

DataFrame edm::DataFrameContainer::operator[] ( size_t  i) const
inline

Definition at line 137 of file DataFrameContainer.h.

137 { return DataFrame(*this, i); }

References mps_fire::i.

◆ pair() [1/2]

IterPair edm::DataFrameContainer::pair ( size_t  i)
inline

Definition at line 131 of file DataFrameContainer.h.

131 { return IterPair(m_ids.begin() + i, m_data.begin() + i * m_stride); }

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

◆ pair() [2/2]

const_IterPair edm::DataFrameContainer::pair ( size_t  i) const
inline

Definition at line 133 of file DataFrameContainer.h.

133 { return const_IterPair(m_ids.begin() + i, m_data.begin() + i * m_stride); }

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

◆ pop_back()

void edm::DataFrameContainer::pop_back ( )
inline

Definition at line 124 of file DataFrameContainer.h.

124  {
125  m_ids.resize(m_ids.size() - 1);
126  m_data.resize(m_data.size() - m_stride);
127  }

References m_data, m_ids, and m_stride.

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

◆ push_back() [1/2]

void edm::DataFrameContainer::push_back ( id_type  iid)
inline

Definition at line 106 of file DataFrameContainer.h.

106  {
107  m_ids.push_back(iid);
108  m_data.resize(m_data.size() + m_stride);
109  }

References m_data, m_ids, and m_stride.

◆ push_back() [2/2]

void edm::DataFrameContainer::push_back ( id_type  iid,
data_type const *  idata 
)
inline

Definition at line 99 of file DataFrameContainer.h.

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  }

References filterCSVwithJSON::copy, fwrapper::cs, m_data, m_ids, and m_stride.

Referenced by EEDigiCollection::push_back(), and ESDigiCollection::push_back().

◆ reserve()

void edm::DataFrameContainer::reserve ( size_t  isize)
inline

◆ resize()

void edm::DataFrameContainer::resize ( size_t  isize)
inline

Definition at line 91 of file DataFrameContainer.h.

91  {
92  m_ids.resize(isize);
93  m_data.resize(isize * m_stride);
94  }

References m_data, m_ids, and m_stride.

◆ set_back() [1/3]

void edm::DataFrameContainer::set_back ( data_type const *  idata)
inline

Definition at line 117 of file DataFrameContainer.h.

117  {
118  size_t cs = m_data.size() - m_stride;
119  std::copy(idata, idata + m_stride, m_data.begin() + cs);
120  }

References filterCSVwithJSON::copy, fwrapper::cs, m_data, and m_stride.

◆ set_back() [2/3]

void edm::DataFrameContainer::set_back ( id_type  iid)
inline

Definition at line 116 of file DataFrameContainer.h.

116 { m_ids.back() = iid; }

References m_ids.

◆ set_back() [3/3]

void edm::DataFrameContainer::set_back ( id_type  iid,
data_type const *  idata 
)
inline

Definition at line 111 of file DataFrameContainer.h.

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  }

References filterCSVwithJSON::copy, fwrapper::cs, m_data, m_ids, and m_stride.

◆ size()

size_type edm::DataFrameContainer::size ( void  ) const
inline

Definition at line 162 of file DataFrameContainer.h.

162 { return m_ids.size(); }

References m_ids.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), QIE10Task::_process(), QIE11Task::_process(), HcalDigisProducerGPU::acquire(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMSignals(), CMTRawAnalyzer::analyze(), EcalPreshowerNoiseDistrib::analyze(), EcalTPGAnalyzer::analyze(), EcalTPInputAnalyzer::analyze(), EcalPreshowerDigisValidation::analyze(), EcalBarrelDigisValidation::analyze(), EcalEndcapDigisValidation::analyze(), HGCalBHValidation::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(), EcalTBWeightUncalibRecHitProducer::produce(), HcalRealisticZS::produce(), EcalZeroSuppressionProducer::produce(), HcalDigiToRawuHTR::produce(), EcalEBTrigPrimProducer::produce(), EcalTrigPrimProducer::produce(), HBHEPhase1Reconstructor::produce(), EcalDigiDisplay::readEBDigis(), EcalDigiDisplay::readEEDigis(), EcalUncalibRecHitWorkerRunOneDigiBase::run(), EcalEBTrigPrimTestAlgo::run(), EcalUncalibRecHitWorkerMultiFit::run(), EcalSelectiveReadoutSuppressor::run(), and sort().

◆ sort()

void edm::DataFrameContainer::sort ( )

Definition at line 19 of file DataFrameContainer.cc.

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

References filterCSVwithJSON::copy, mps_fire::i, bTagCombinedSVVariables_cff::indices, dqmiolumiharvest::j, m_data, m_ids, m_stride, alignCSCRings::s, size(), jetUpdater_cfi::sort, and createJobs::tmp.

◆ stride()

size_type edm::DataFrameContainer::stride ( ) const
inline

Definition at line 158 of file DataFrameContainer.h.

158 { return m_stride; }

References m_stride.

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

◆ subdetId()

int edm::DataFrameContainer::subdetId ( ) const
inline

Definition at line 156 of file DataFrameContainer.h.

156 { return m_subdetId; }

References m_subdetId.

◆ swap() [1/2]

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

Definition at line 68 of file DataFrameContainer.h.

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  }

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

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

◆ swap() [2/2]

void edm::DataFrameContainer::swap ( IdContainer iic,
DataContainer idc 
)
inline

Definition at line 81 of file DataFrameContainer.h.

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

References m_data, and m_ids.

Friends And Related Function Documentation

◆ ::TestDataFrame

friend class ::TestDataFrame
friend

Definition at line 175 of file DataFrameContainer.h.

◆ ::TestEcalDigi

template<typename DigiCollection >
friend class ::TestEcalDigi
friend

Definition at line 178 of file DataFrameContainer.h.

Member Data Documentation

◆ m_data

DataContainer edm::DataFrameContainer::m_data
private

◆ m_ids

IdContainer edm::DataFrameContainer::m_ids
private

◆ m_stride

size_type edm::DataFrameContainer::m_stride
private

◆ m_subdetId

int edm::DataFrameContainer::m_subdetId
private

Definition at line 181 of file DataFrameContainer.h.

Referenced by subdetId(), and swap().

bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
edm::DataFrameContainer::m_data
DataContainer m_data
Definition: DataFrameContainer.h:187
edm::DataFrameContainer::IterPair
std::pair< IdIter, DataIter > IterPair
Definition: DataFrameContainer.h:42
mps_fire.i
i
Definition: mps_fire.py:428
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edm::DataFrameContainer::IdContainer
std::vector< id_type > IdContainer
Definition: DataFrameContainer.h:38
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::DataFrameContainer::const_IterPair
std::pair< const_IdIter, const_DataIter > const_IterPair
Definition: DataFrameContainer.h:45
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::DataFrameContainer::m_subdetId
int m_subdetId
Definition: DataFrameContainer.h:181
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::DataFrameContainer::frame
data_type const * frame(size_t cell) const
Definition: DataFrameContainer.h:166
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::DataFrameContainer::const_IdIter
std::vector< id_type >::const_iterator const_IdIter
Definition: DataFrameContainer.h:43
edm::DataFrameContainer::DataContainer
std::vector< data_type > DataContainer
Definition: DataFrameContainer.h:39
edm::DataFrameContainer::swap
void swap(DataFrameContainer &rh)
Definition: DataFrameContainer.h:68
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::DataFrameContainer::m_ids
IdContainer m_ids
Definition: DataFrameContainer.h:186
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::DataFrameContainer::data_type
unsigned short data_type
Definition: DataFrameContainer.h:37
edm::DataFrameContainer::DataFrameContainer
DataFrameContainer()
Definition: DataFrameContainer.h:63
edm::DataFrameContainer::size_type
unsigned int size_type
Definition: DataFrameContainer.h:35
edm::DataFrameContainer::m_stride
size_type m_stride
Definition: DataFrameContainer.h:184
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162