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
 
IOVRange minRange () 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)
inline

◆ CondAttrListVec() [2/4]

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

Definition at line 135 of file CondAttrListVec.h.

◆ ~CondAttrListVec()

CondAttrListVec::~CondAttrListVec ( )
inline

Definition at line 145 of file CondAttrListVec.h.

145  {
146  if (m_spec!=0) 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(0)
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.size()>0) {
160  m_spec=new coral::AttributeListSpecification();
161  const coral::AttributeList& atr1=rhs.m_data.begin()->second;
162  for (coral::AttributeList::const_iterator itr=atr1.begin();itr!=atr1.end();
163  ++itr) {
164  const coral::AttributeSpecification& aspec=itr->specification();
165  m_spec->extend(aspec.name(),aspec.typeName());
166  }
167  for (const_iterator itr=rhs.m_data.begin();itr!=rhs.m_data.end();++itr) {
168  m_data.push_back(AttrListPair(itr->first,
169  coral::AttributeList(*m_spec,true)));
170  (m_data.back().second).fastCopyData(itr->second);
171  }
172  }
173 }

◆ 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 239 of file CondAttrListVec.h.

241  {
242  //invalidate index
243  m_index.reset();
244  // set minimum range correctly
246  if (m_minrange.start()<range.start()) start=range.start();
248  if (range.stop()<m_minrange.stop()) stop=range.stop();
250  if (m_uniqueiov && range!=m_minrange) m_uniqueiov=false;
251  // store attributeList if needed
252  if (m_spec==0 && data_begin!=data_end) {
253  m_spec=new coral::AttributeListSpecification();
254  for (coral::AttributeList::const_iterator itr=data_begin->begin();itr!=data_begin->end();++itr) {
255  const coral::AttributeSpecification& aspec=itr->specification();
256  m_spec->extend(aspec.name(),aspec.typeName());
257  }
258  }
259  // copy in data
260  for (AttrListDataIter itr=data_begin;itr!=data_end;++itr) {
262  (m_data.back().second).fastCopyData(*itr);
263  }
265 }

◆ addNewStop()

void CondAttrListVec::addNewStop ( const IOVTime stop)
inline

Definition at line 300 of file CondAttrListVec.h.

300  {
302 }

◆ 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 267 of file CondAttrListVec.h.

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

◆ attrListVec()

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

Definition at line 314 of file CondAttrListVec.h.

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

◆ begin()

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

Definition at line 210 of file CondAttrListVec.h.

211 { return m_data.begin(); }

◆ channelIDs()

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

Definition at line 304 of file CondAttrListVec.h.

304  {
305  return index().m_indexchan;
306 }

◆ end()

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

Definition at line 213 of file CondAttrListVec.h.

214 { return m_data.end(); }

◆ hasChannel()

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

Definition at line 308 of file CondAttrListVec.h.

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

◆ hasUniqueIOV()

bool CondAttrListVec::hasUniqueIOV ( ) const
inline

Definition at line 235 of file CondAttrListVec.h.

236 {return m_uniqueiov; }

◆ index()

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

Definition at line 326 of file CondAttrListVec.h.

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

◆ iov_begin()

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

Definition at line 219 of file CondAttrListVec.h.

220 { return m_iovmap.begin(); }

◆ iov_end()

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

Definition at line 222 of file CondAttrListVec.h.

223 { return m_iovmap.end(); }

◆ iov_size()

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

Definition at line 229 of file CondAttrListVec.h.

230 { return m_iovmap.size(); }

◆ iovRange()

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

Definition at line 226 of file CondAttrListVec.h.

227 { return m_iovmap.find(channel); }

◆ minRange()

IOVRange CondAttrListVec::minRange ( ) const
inline

Definition at line 232 of file CondAttrListVec.h.

233 { return m_minrange; }

◆ operator=()

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

◆ size()

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

Definition at line 216 of file CondAttrListVec.h.

217 { 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
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
IOVTime::MAXRUN
static constexpr uint32_t MAXRUN
Definition: IOVTime.h:48
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
CondAttrListVec::m_uniqueiov
bool m_uniqueiov
Definition: CondAttrListVec.h:113
index
Definition: index.py:1
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
IOVRange::start
const IOVTime & start() const
Definition: IOVRange.h:38
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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:326
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
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:14
CondAttrListVec::m_minrange
IOVRange m_minrange
Definition: CondAttrListVec.h:112
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
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
CondAttrListVec::const_iterator
AttrListVec::const_iterator const_iterator
Definition: CondAttrListVec.h:36
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:17
IOVTime::MINTIMESTAMP
static constexpr uint64_t MINTIMESTAMP
Definition: IOVTime.h:56
CondAttrListVec::AttrListDataIter
std::vector< coral::AttributeList >::const_iterator AttrListDataIter
Definition: CondAttrListVec.h:35