ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CondAttrListVec Class Reference

#include <CondAttrListVec.h>

Inheritance diagram for CondAttrListVec:
Collaboration diagram for CondAttrListVec:

Classes

struct  Index
 

Public Types

typedef std::pair< unsigned int, coral::AttributeList > AttrListPair
 
typedef std::vector< AttrListPairAttrListVec
 
typedef std::vector< coral::AttributeList >::const_iterator AttrListDataIter
 
typedef AttrListVec::const_iterator const_iterator
 
typedef AttrListVec::size_type size_type
 
typedef std::map< unsigned int, IOVRangeAttrListIOVMap
 
typedef AttrListIOVMap::const_iterator iov_const_iterator
 
typedef AttrListIOVMap::size_type iov_size_type
 
typedef std::map< unsigned int, std::vector< const coral::AttributeList * > > AttrListCVMap
 

Public Member Functions

 CondAttrListVec (bool runevent)
 
 CondAttrListVec (bool runevent, size_type nelm)
 
 ~CondAttrListVec ()
 
 CondAttrListVec (const CondAttrListVec &rhs)
 
CondAttrListVecoperator= (const CondAttrListVec &rhs)=delete
 
const_iterator begin () const
 
const_iterator end () const
 
size_type size () const
 
iov_const_iterator iov_begin () const
 
iov_const_iterator iov_end () const
 
iov_const_iterator iovRange (const unsigned int channel) const
 
size_type iov_size () const
 
const IOVRangeminRange () const
 
bool hasUniqueIOV () const
 
void add (const IOVRange &range, const unsigned int chan, AttrListDataIter data_begin, AttrListDataIter data_end)
 
void addSlice (const IOVRange &range, const unsigned int chan, const std::vector< coral::AttributeList > &data, const unsigned int datastart, const unsigned int dataend)
 
void addNewStop (const IOVTime &stop)
 
const std::vector< unsigned int > & channelIDs () const
 
bool hasChannel (const int chan) const
 
const std::vector< const coral::AttributeList * > & attrListVec (const int chan) const
 

Private Member Functions

 CondAttrListVec ()
 
const Indexindex () const
 

Private Attributes

AttrListVec m_data
 
AttrListIOVMap m_iovmap
 
IOVRange m_minrange
 
bool m_uniqueiov
 
bool m_runevent
 
coral::AttributeListSpecification * m_spec
 
CxxUtils::CachedValue< Indexm_index
 

Detailed Description

Definition at line 30 of file CondAttrListVec.h.

Member Typedef Documentation

◆ AttrListCVMap

typedef std::map<unsigned int, std::vector<const coral::AttributeList*> > CondAttrListVec::AttrListCVMap

Definition at line 42 of file CondAttrListVec.h.

◆ AttrListDataIter

typedef std::vector<coral::AttributeList>::const_iterator CondAttrListVec::AttrListDataIter

Definition at line 35 of file CondAttrListVec.h.

◆ AttrListIOVMap

typedef std::map<unsigned int,IOVRange> CondAttrListVec::AttrListIOVMap

Definition at line 38 of file CondAttrListVec.h.

◆ AttrListPair

typedef std::pair<unsigned int,coral::AttributeList> CondAttrListVec::AttrListPair

Definition at line 33 of file CondAttrListVec.h.

◆ AttrListVec

Definition at line 34 of file CondAttrListVec.h.

◆ const_iterator

typedef AttrListVec::const_iterator CondAttrListVec::const_iterator

Definition at line 36 of file CondAttrListVec.h.

◆ iov_const_iterator

typedef AttrListIOVMap::const_iterator CondAttrListVec::iov_const_iterator

Definition at line 39 of file CondAttrListVec.h.

◆ iov_size_type

typedef AttrListIOVMap::size_type CondAttrListVec::iov_size_type

Definition at line 40 of file CondAttrListVec.h.

◆ size_type

typedef AttrListVec::size_type CondAttrListVec::size_type

Definition at line 37 of file CondAttrListVec.h.

Constructor & Destructor Documentation

◆ CondAttrListVec() [1/4]

CondAttrListVec::CondAttrListVec ( bool  runevent)
inlineexplicit

Definition at line 127 of file CondAttrListVec.h.

◆ CondAttrListVec() [2/4]

CondAttrListVec::CondAttrListVec ( bool  runevent,
size_type  nelm 
)
inline

Definition at line 135 of file CondAttrListVec.h.

135  :
138  m_uniqueiov(true),m_runevent(runevent),m_spec(nullptr) {
141  m_data.reserve(nelm);
142 }

◆ ~CondAttrListVec()

CondAttrListVec::~CondAttrListVec ( )
inline

Definition at line 145 of file CondAttrListVec.h.

145  {
146  if (m_spec) m_spec->release();
147 }

◆ CondAttrListVec() [3/4]

CondAttrListVec::CondAttrListVec ( const CondAttrListVec rhs)
inline

Definition at line 149 of file CondAttrListVec.h.

149  :
150  DataObject::DataObject(rhs),
151  m_iovmap(rhs.m_iovmap),
152  m_minrange(rhs.m_minrange),
154  m_runevent(rhs.m_runevent),
155  m_spec(nullptr)
156 {
157  // members with normal semantics setup in initialisation list
158  // make a new cached AttributeListSpecification and make the payload use it
159  if (!rhs.m_data.empty()) {
160  m_spec=new coral::AttributeListSpecification();
161  const coral::AttributeList& atr1=rhs.m_data.begin()->second;
162  for (const auto& attr : atr1) {
163  const coral::AttributeSpecification& aspec=attr.specification();
164  m_spec->extend(aspec.name(),aspec.typeName());
165  }
166  for (const auto& [chan, attrList] : rhs.m_data) {
167  m_data.push_back(AttrListPair(chan,
168  coral::AttributeList(*m_spec,true)));
169  (m_data.back().second).fastCopyData(attrList);
170  }
171  }
172 }

◆ CondAttrListVec() [4/4]

CondAttrListVec::CondAttrListVec ( )
private

Member Function Documentation

◆ add()

void CondAttrListVec::add ( const IOVRange range,
const unsigned int  chan,
AttrListDataIter  data_begin,
AttrListDataIter  data_end 
)
inline

Definition at line 238 of file CondAttrListVec.h.

240  {
241  //invalidate index
242  m_index.reset();
243  // set minimum range correctly
245  if (m_minrange.start()<range.start()) start=range.start();
247  if (range.stop()<m_minrange.stop()) stop=range.stop();
249  if (m_uniqueiov && range!=m_minrange) m_uniqueiov=false;
250  // store attributeList if needed
251  if (!m_spec && data_begin!=data_end) {
252  m_spec=new coral::AttributeListSpecification();
253  for (const auto& attr : *data_begin) {
254  const coral::AttributeSpecification& aspec=attr.specification();
255  m_spec->extend(aspec.name(),aspec.typeName());
256  }
257  }
258  // copy in data
259  for (AttrListDataIter itr=data_begin;itr!=data_end;++itr) {
261  (m_data.back().second).fastCopyData(*itr);
262  }
264 }

◆ addNewStop()

void CondAttrListVec::addNewStop ( const IOVTime stop)
inline

Definition at line 298 of file CondAttrListVec.h.

298  {
300 }

◆ addSlice()

void CondAttrListVec::addSlice ( const IOVRange range,
const unsigned int  chan,
const std::vector< coral::AttributeList > &  data,
const unsigned int  datastart,
const unsigned int  dataend 
)
inline

Definition at line 266 of file CondAttrListVec.h.

271 {
272  // invalidate index
273  m_index.reset();
274  // set minimum range correctly
276  if (m_minrange.start()<range.start()) start=range.start();
278  if (range.stop()<m_minrange.stop()) stop=range.stop();
280  if (m_uniqueiov && range!=m_minrange) m_uniqueiov=false;
281  // store attributeList if needed
282  if (!m_spec && datastart!=dataend) {
283  m_spec=new coral::AttributeListSpecification();
284  const coral::AttributeList& atr0=data[datastart];
285  for (const auto& attr : atr0) {
286  const coral::AttributeSpecification& aspec=attr.specification();
287  m_spec->extend(aspec.name(),aspec.typeName());
288  }
289  }
290  // copy in data
291  for (unsigned int i=datastart;i<dataend;++i) {
293  (m_data.back().second).merge(data[i]);
294  }
296 }

◆ attrListVec()

const std::vector< const coral::AttributeList * > & CondAttrListVec::attrListVec ( const int  chan) const
inline

Definition at line 312 of file CondAttrListVec.h.

313 {
314  const AttrListCVMap& m = index().m_indexchanvec;
315  AttrListCVMap::const_iterator it = m.find (chan);
316  if (it != m.end()) {
317  return it->second;
318  }
319  static const std::vector<const coral::AttributeList*> dum;
320  return dum;
321 }

◆ begin()

CondAttrListVec::const_iterator CondAttrListVec::begin ( ) const
inline

Definition at line 209 of file CondAttrListVec.h.

210 { return m_data.begin(); }

◆ channelIDs()

const std::vector< unsigned int > & CondAttrListVec::channelIDs ( ) const
inline

Definition at line 302 of file CondAttrListVec.h.

302  {
303  return index().m_indexchan;
304 }

◆ end()

CondAttrListVec::const_iterator CondAttrListVec::end ( ) const
inline

Definition at line 212 of file CondAttrListVec.h.

213 { return m_data.end(); }

◆ hasChannel()

bool CondAttrListVec::hasChannel ( const int  chan) const
inline

Definition at line 306 of file CondAttrListVec.h.

306  {
307  const AttrListCVMap& m = index().m_indexchanvec;
308  return (m.find(chan)!=m.end());
309 }

◆ hasUniqueIOV()

bool CondAttrListVec::hasUniqueIOV ( ) const
inline

Definition at line 234 of file CondAttrListVec.h.

235 {return m_uniqueiov; }

◆ index()

const CondAttrListVec::Index & CondAttrListVec::index ( ) const
inlineprivate

Definition at line 324 of file CondAttrListVec.h.

325 {
326  if (!m_index.isValid()) {
327  Index index;
328 
329  // loop over all the elements, build vector of AttributeList for each channel
330  // and a vector of all the channels
331  for (const AttrListPair& p : m_data) {
332  unsigned int chan=p.first;
333  AttrListCVMap::iterator clist=index.m_indexchanvec.find(chan);
334  if (clist==index.m_indexchanvec.end()) {
335  // channel not seen before, create a new entry in map and vector
336  std::pair<AttrListCVMap::iterator,bool> res=
337  index.m_indexchanvec.insert(AttrListCVMap::value_type(chan,
338  std::vector<const coral::AttributeList*>()));
339  clist=res.first;
340  index.m_indexchan.push_back(chan);
341  }
342  clist->second.push_back(&(p.second));
343  }
344 
345  m_index.set (std::move (index));
346  }
347  return *m_index.ptr();
348 }

◆ iov_begin()

CondAttrListVec::iov_const_iterator CondAttrListVec::iov_begin ( ) const
inline

Definition at line 218 of file CondAttrListVec.h.

219 { return m_iovmap.begin(); }

◆ iov_end()

CondAttrListVec::iov_const_iterator CondAttrListVec::iov_end ( ) const
inline

Definition at line 221 of file CondAttrListVec.h.

222 { return m_iovmap.end(); }

◆ iov_size()

CondAttrListVec::size_type CondAttrListVec::iov_size ( ) const
inline

Definition at line 228 of file CondAttrListVec.h.

229 { return m_iovmap.size(); }

◆ iovRange()

CondAttrListVec::iov_const_iterator CondAttrListVec::iovRange ( const unsigned int  channel) const
inline

Definition at line 225 of file CondAttrListVec.h.

226 { return m_iovmap.find(channel); }

◆ minRange()

const IOVRange & CondAttrListVec::minRange ( ) const
inline

Definition at line 231 of file CondAttrListVec.h.

232 { return m_minrange; }

◆ operator=()

CondAttrListVec& CondAttrListVec::operator= ( const CondAttrListVec rhs)
delete

◆ size()

CondAttrListVec::size_type CondAttrListVec::size ( ) const
inline

Definition at line 215 of file CondAttrListVec.h.

216 { return m_data.size(); }

Member Data Documentation

◆ m_data

AttrListVec CondAttrListVec::m_data
private

Definition at line 110 of file CondAttrListVec.h.

◆ m_index

CxxUtils::CachedValue<Index> CondAttrListVec::m_index
private

Definition at line 117 of file CondAttrListVec.h.

◆ m_iovmap

AttrListIOVMap CondAttrListVec::m_iovmap
private

Definition at line 111 of file CondAttrListVec.h.

◆ m_minrange

IOVRange CondAttrListVec::m_minrange
private

Definition at line 112 of file CondAttrListVec.h.

◆ m_runevent

bool CondAttrListVec::m_runevent
private

Definition at line 114 of file CondAttrListVec.h.

◆ m_spec

coral::AttributeListSpecification* CondAttrListVec::m_spec
private

Definition at line 115 of file CondAttrListVec.h.

◆ m_uniqueiov

bool CondAttrListVec::m_uniqueiov
private

Definition at line 113 of file CondAttrListVec.h.


The documentation for this class was generated from the following file:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CondAttrListVec::m_data
AttrListVec m_data
Definition: CondAttrListVec.h:110
IOVRange
Validity Range object. Holds two IOVTimes (start and stop)
Definition: IOVRange.h:30
IOVTime::MAXRUN
static constexpr uint32_t MAXRUN
Definition: IOVTime.h:48
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
CondAttrListVec::m_uniqueiov
bool m_uniqueiov
Definition: CondAttrListVec.h:113
index
Definition: index.py:1
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:13
IOVRange::start
const IOVTime & start() const
Definition: IOVRange.h:38
skel.it
it
Definition: skel.GENtoEVGEN.py:407
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
IOVTime::MINRUN
static constexpr uint32_t MINRUN
Definition: IOVTime.h:44
IOVRange::stop
const IOVTime & stop() const
Definition: IOVRange.h:39
CondAttrListVec::AttrListPair
std::pair< unsigned int, coral::AttributeList > AttrListPair
Definition: CondAttrListVec.h:33
CondAttrListVec::index
const Index & index() const
Definition: CondAttrListVec.h:324
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
CondAttrListVec::m_runevent
bool m_runevent
Definition: CondAttrListVec.h:114
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
CondAttrListVec::m_minrange
IOVRange m_minrange
Definition: CondAttrListVec.h:112
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
IOVTime::MAXTIMESTAMP
static constexpr uint64_t MAXTIMESTAMP
Definition: IOVTime.h:58
CondAttrListVec::m_iovmap
AttrListIOVMap m_iovmap
Definition: CondAttrListVec.h:111
CondAttrListVec::AttrListCVMap
std::map< unsigned int, std::vector< const coral::AttributeList * > > AttrListCVMap
Definition: CondAttrListVec.h:42
CondAttrListVec::m_spec
coral::AttributeListSpecification * m_spec
Definition: CondAttrListVec.h:115
IOVTime::MAXEVENT
static constexpr uint32_t MAXEVENT
Definition: IOVTime.h:51
CondAttrListVec::m_index
CxxUtils::CachedValue< Index > m_index
Definition: CondAttrListVec.h:117
IOVTime::MINEVENT
static constexpr uint32_t MINEVENT
Definition: IOVTime.h:50
CondAttrListVec::Index::m_indexchanvec
AttrListCVMap m_indexchanvec
Definition: CondAttrListVec.h:46
CondAttrListVec::Index::m_indexchan
std::vector< unsigned int > m_indexchan
Definition: CondAttrListVec.h:47
python.utility.LHE.merge
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Definition: LHE.py:29
IOVTime::MINTIMESTAMP
static constexpr uint64_t MINTIMESTAMP
Definition: IOVTime.h:56
CondAttrListVec::AttrListDataIter
std::vector< coral::AttributeList >::const_iterator AttrListDataIter
Definition: CondAttrListVec.h:35
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106