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

#include <L1CaloDerivedRunParsContainer.h>

Inheritance diagram for L1CaloDerivedRunParsContainer:
Collaboration diagram for L1CaloDerivedRunParsContainer:

Public Types

using const_iterator = std::vector< L1CaloDerivedRunPars >::const_iterator
 

Public Member Functions

 L1CaloDerivedRunParsContainer ()
 
 L1CaloDerivedRunParsContainer (const std::string &folderKey)
 
virtual ~L1CaloDerivedRunParsContainer ()
 
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &)
 
virtual DataObject * makePersistent () const
 
virtual std::vector< std::string > coolInputKeys () const
 
virtual std::string coolOutputKey () const
 
virtual void clear ()
 
const L1CaloDerivedRunParsderivedRunPars (unsigned int channelId) const
 
const L1CaloDerivedRunParsderivedRunPars (const L1CaloCoolChannelId &channelId) const
 
const_iterator begin () const
 
const_iterator end () const
 
void addDerivedRunPars (const L1CaloDerivedRunPars &derivedRunPars)
 
void dump () const
 
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)
 
virtual void makeTransient (const std::map< std::string, const AthenaAttributeList * > &condAttributeList)
 
virtual void makeTransient (const std::map< std::string, const AthenaAttributeList * > &condAttributeList)
 
std::string specificationName (int specId) const
 
std::string specificationType (int specId) const
 
void addSpecification (int specId, const std::string &specName, const std::string &specType)
 
coral::AttributeListSpecification * createAttributeListSpecification () const
 
virtual std::string conditionType () const
 

Private Types

enum  eAttrSpecification { etimingRegime, etierZeroTag }
 
typedef std::map< int, std::string > AttrSpecificationMap
 

Private Attributes

std::vector< L1CaloDerivedRunParsm_derivedRunParss
 
std::string m_coolFolderKey = "/TRIGGER/L1Calo/V1/Conditions/DerivedRunPars"
 
AttrSpecificationMap m_attrSpecificationNameMap
 
AttrSpecificationMap m_attrSpecificationTypeMap
 
std::string m_strConditionType
 

Detailed Description

Definition at line 25 of file L1CaloDerivedRunParsContainer.h.

Member Typedef Documentation

◆ AttrSpecificationMap

typedef std::map<int, std::string> AbstractL1CaloPersistentCondition::AttrSpecificationMap
privateinherited

Definition at line 50 of file AbstractL1CaloPersistentCondition.h.

◆ const_iterator

Definition at line 52 of file L1CaloDerivedRunParsContainer.h.

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
etimingRegime 
etierZeroTag 

Definition at line 32 of file L1CaloDerivedRunParsContainer.h.

32 {}

Constructor & Destructor Documentation

◆ L1CaloDerivedRunParsContainer() [1/2]

L1CaloDerivedRunParsContainer::L1CaloDerivedRunParsContainer ( )

Definition at line 15 of file L1CaloDerivedRunParsContainer.cxx.

16  : AbstractL1CaloPersistentCondition("CondAttrListCollection")
17 {
18  this->addSpecification(etimingRegime, "timingRegime", "string");
19  this->addSpecification(etierZeroTag, "tierZeroTag", "string");
20 }

◆ L1CaloDerivedRunParsContainer() [2/2]

L1CaloDerivedRunParsContainer::L1CaloDerivedRunParsContainer ( const std::string &  folderKey)

Definition at line 22 of file L1CaloDerivedRunParsContainer.cxx.

23  : L1CaloDerivedRunParsContainer() // delegating constructor
24 {
25  // cppcheck-suppress useInitializationList
26  m_coolFolderKey = folderKey;
27 }

◆ ~L1CaloDerivedRunParsContainer()

virtual L1CaloDerivedRunParsContainer::~L1CaloDerivedRunParsContainer ( )
inlinevirtual

Definition at line 36 of file L1CaloDerivedRunParsContainer.h.

Member Function Documentation

◆ addDerivedRunPars()

void L1CaloDerivedRunParsContainer::addDerivedRunPars ( const L1CaloDerivedRunPars derivedRunPars)

Definition at line 81 of file L1CaloDerivedRunParsContainer.cxx.

82 {
83  // insert into the correct position mainting the sorted vector
84  m_derivedRunParss.insert(std::lower_bound(std::begin(m_derivedRunParss),
87  [](const L1CaloDerivedRunPars& el, unsigned int va) -> bool {
88  return el.channelId() < va;
89  }),
91 }

◆ addSpecification()

void AbstractL1CaloPersistentCondition::addSpecification ( int  specId,
const std::string &  specName,
const std::string &  specType 
)
inherited

Definition at line 26 of file AbstractL1CaloPersistentCondition.cxx.

26  {
27  m_attrSpecificationNameMap[specId] = specName;
28  m_attrSpecificationTypeMap[specId] = specType;
29 }

◆ begin()

const_iterator L1CaloDerivedRunParsContainer::begin ( ) const
inline

Definition at line 53 of file L1CaloDerivedRunParsContainer.h.

57 :
58  std::vector<L1CaloDerivedRunPars> m_derivedRunParss;

◆ clear()

virtual void L1CaloDerivedRunParsContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 44 of file L1CaloDerivedRunParsContainer.h.

44 {

◆ conditionType()

virtual std::string AbstractL1CaloPersistentCondition::conditionType ( ) const
inlinevirtualinherited

Implements IL1CaloPersistenceCapable.

Definition at line 37 of file AbstractL1CaloPersistentCondition.h.

37 { return m_strConditionType; };

◆ coolInputKeys()

virtual std::vector<std::string> L1CaloDerivedRunParsContainer::coolInputKeys ( ) const
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 42 of file L1CaloDerivedRunParsContainer.h.

44 {

◆ coolOutputKey()

virtual std::string L1CaloDerivedRunParsContainer::coolOutputKey ( ) const
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 43 of file L1CaloDerivedRunParsContainer.h.

44 {

◆ createAttributeListSpecification()

coral::AttributeListSpecification * AbstractL1CaloPersistentCondition::createAttributeListSpecification ( ) const
inherited

Definition at line 31 of file AbstractL1CaloPersistentCondition.cxx.

31  {
32 
33  coral::AttributeListSpecification* attrSpecification = new coral::AttributeListSpecification();
34 
35  AttrSpecificationMap::const_iterator it_name = m_attrSpecificationNameMap.begin();
36  AttrSpecificationMap::const_iterator it_type = m_attrSpecificationTypeMap.begin();
37 
38  for(;it_name!=m_attrSpecificationNameMap.end();++it_name,++it_type) {
39  attrSpecification->extend(it_name->second, it_type->second);
40  }
41  return attrSpecification;
42 }

◆ derivedRunPars() [1/2]

const L1CaloDerivedRunPars* L1CaloDerivedRunParsContainer::derivedRunPars ( const L1CaloCoolChannelId channelId) const
inline

Definition at line 48 of file L1CaloDerivedRunParsContainer.h.

49  { return m_derivedRunParss.begin(); }
50  const_iterator end() const { return m_derivedRunParss.end(); }

◆ derivedRunPars() [2/2]

const L1CaloDerivedRunPars * L1CaloDerivedRunParsContainer::derivedRunPars ( unsigned int  channelId) const

Definition at line 69 of file L1CaloDerivedRunParsContainer.cxx.

70 {
71  auto it = std::lower_bound(std::begin(m_derivedRunParss),
73  channelId,
74  [](const L1CaloDerivedRunPars& el, unsigned int val) -> bool {
75  return el.channelId() < val;
76  });
77  if(it == std::end(m_derivedRunParss)) return nullptr;
78  return &(*it);
79 }

◆ dump()

void L1CaloDerivedRunParsContainer::dump ( ) const

Definition at line 94 of file L1CaloDerivedRunParsContainer.cxx.

94  {
96  for(;it!=this->end();++it) {
97  std::cout << " * item: " << *it <<std::endl;
98  }
99 }

◆ end()

const_iterator L1CaloDerivedRunParsContainer::end ( ) const
inline

Definition at line 54 of file L1CaloDerivedRunParsContainer.h.

57 :
58  std::vector<L1CaloDerivedRunPars> m_derivedRunParss;

◆ makePersistent()

DataObject * L1CaloDerivedRunParsContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 30 of file L1CaloDerivedRunParsContainer.cxx.

31 {
32  using std::make_unique;
33 
34  if(m_coolFolderKey.empty()) return nullptr;
35 
36  auto* attrSpecification = this->createAttributeListSpecification();
37  if(!attrSpecification || !attrSpecification->size()) return nullptr;
38 
39  auto attrListCollection = make_unique<CondAttrListCollection>(true);
40  for(const auto& item : m_derivedRunParss) {
41  AthenaAttributeList attrList(*attrSpecification);
42  attrList[specificationName(etimingRegime)].setValue(item.timingRegime());
43  attrList[specificationName(etierZeroTag)].setValue(item.tierZeroTag());
44 
45  attrListCollection->add(item.channelId(), attrList);
46  }
47  return static_cast<DataObject*>(attrListCollection.release());
48 }

◆ makeTransient() [1/4]

void AbstractL1CaloPersistentCondition::makeTransient ( const std::map< std::string, const AthenaAttributeList * > &  condAttributeList)
virtualinherited

Implements IL1CaloPersistenceCapable.

Definition at line 21 of file AbstractL1CaloPersistentCondition.cxx.

21  {
22  std::cout << "ERROR - The makeTransient(const map<std::string, const AthenaAttributeList*>) method you are calling is not implemented by the current class !" << std::endl;
23  return;
24 }

◆ makeTransient() [2/4]

void AbstractL1CaloPersistentCondition::makeTransient

Definition at line 30 of file AbstractL1CaloPersistentCondition.cxx.

21  {
22  std::cout << "ERROR - The makeTransient(const map<std::string, const AthenaAttributeList*>) method you are calling is not implemented by the current class !" << std::endl;
23  return;
24 }

◆ makeTransient() [3/4]

void L1CaloDerivedRunParsContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > &  condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 50 of file L1CaloDerivedRunParsContainer.cxx.

51 {
52  clear();
53 
54  auto it = condAttrListCollectionMap.find(m_coolFolderKey);
55  if(it == std::end(condAttrListCollectionMap)) return;
56 
57  auto attrListCollection = it->second;
58  for(const auto& item : *attrListCollection) {
59  auto chanNum = item.first;
60  const auto& attrList = item.second;
61 
62  auto timingRegime = attrList[specificationName(etimingRegime)].data<std::string>();
63  auto tierZeroTag = attrList[specificationName(etierZeroTag)].data<std::string>();
64 
65  addDerivedRunPars(L1CaloDerivedRunPars(chanNum, timingRegime, tierZeroTag));
66  }
67 }

◆ makeTransient() [4/4]

void AbstractL1CaloPersistentCondition::makeTransient

Definition at line 29 of file AbstractL1CaloPersistentCondition.cxx.

16  {
17  std::cout << "ERROR - The makeTransient(const map<std::string, const CondAttrListCollection*>) method you are calling is not implemented by the current class !" << std::endl;
18  return;
19 }

◆ specificationName()

std::string AbstractL1CaloPersistentCondition::specificationName ( int  specId) const
inherited

Definition at line 44 of file AbstractL1CaloPersistentCondition.cxx.

44  {
45  return m_attrSpecificationNameMap.find(specId)->second;
46 }

◆ specificationType()

std::string AbstractL1CaloPersistentCondition::specificationType ( int  specId) const
inherited

Definition at line 48 of file AbstractL1CaloPersistentCondition.cxx.

48  {
49  return m_attrSpecificationTypeMap.find(specId)->second;
50 }

Member Data Documentation

◆ m_attrSpecificationNameMap

AttrSpecificationMap AbstractL1CaloPersistentCondition::m_attrSpecificationNameMap
privateinherited

Definition at line 51 of file AbstractL1CaloPersistentCondition.h.

◆ m_attrSpecificationTypeMap

AttrSpecificationMap AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
privateinherited

Definition at line 52 of file AbstractL1CaloPersistentCondition.h.

◆ m_coolFolderKey

std::string L1CaloDerivedRunParsContainer::m_coolFolderKey = "/TRIGGER/L1Calo/V1/Conditions/DerivedRunPars"
private

Definition at line 63 of file L1CaloDerivedRunParsContainer.h.

◆ m_derivedRunParss

std::vector<L1CaloDerivedRunPars> L1CaloDerivedRunParsContainer::m_derivedRunParss
private

Definition at line 62 of file L1CaloDerivedRunParsContainer.h.

◆ m_strConditionType

std::string AbstractL1CaloPersistentCondition::m_strConditionType
privateinherited

Definition at line 53 of file AbstractL1CaloPersistentCondition.h.


The documentation for this class was generated from the following files:
L1CaloDerivedRunPars::channelId
unsigned int channelId() const
Definition: L1CaloDerivedRunPars.h:23
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
L1CaloDerivedRunPars
Folder <-> Object mapping for /TRIGGER/L1Calo/V1/Conditions/DerivedRunPars .
Definition: L1CaloDerivedRunPars.h:17
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AbstractL1CaloPersistentCondition::addSpecification
void addSpecification(int specId, const std::string &specName, const std::string &specType)
Definition: AbstractL1CaloPersistentCondition.cxx:26
L1CaloDerivedRunParsContainer::addDerivedRunPars
void addDerivedRunPars(const L1CaloDerivedRunPars &derivedRunPars)
Definition: L1CaloDerivedRunParsContainer.cxx:81
L1CaloDerivedRunParsContainer::derivedRunPars
const L1CaloDerivedRunPars * derivedRunPars(unsigned int channelId) const
Definition: L1CaloDerivedRunParsContainer.cxx:69
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
L1CaloDerivedRunParsContainer::etimingRegime
@ etimingRegime
Definition: L1CaloDerivedRunParsContainer.h:36
L1CaloDerivedRunParsContainer::begin
const_iterator begin() const
Definition: L1CaloDerivedRunParsContainer.h:53
L1CaloDerivedRunParsContainer::L1CaloDerivedRunParsContainer
L1CaloDerivedRunParsContainer()
Definition: L1CaloDerivedRunParsContainer.cxx:15
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
L1CaloDerivedRunParsContainer::m_derivedRunParss
std::vector< L1CaloDerivedRunPars > m_derivedRunParss
Definition: L1CaloDerivedRunParsContainer.h:62
AbstractL1CaloPersistentCondition::AbstractL1CaloPersistentCondition
AbstractL1CaloPersistentCondition(const std::string &condType)
Definition: AbstractL1CaloPersistentCondition.h:45
AbstractL1CaloPersistentCondition::m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationNameMap
Definition: AbstractL1CaloPersistentCondition.h:51
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
item
Definition: ItemListSvc.h:43
AbstractL1CaloPersistentCondition::specificationName
std::string specificationName(int specId) const
Definition: AbstractL1CaloPersistentCondition.cxx:44
L1CaloDerivedRunParsContainer::const_iterator
std::vector< L1CaloDerivedRunPars >::const_iterator const_iterator
Definition: L1CaloDerivedRunParsContainer.h:52
L1CaloDerivedRunParsContainer::clear
virtual void clear()
Definition: L1CaloDerivedRunParsContainer.h:44
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
L1CaloDerivedRunParsContainer::etierZeroTag
@ etierZeroTag
Definition: L1CaloDerivedRunParsContainer.h:36
L1CaloDerivedRunParsContainer::m_coolFolderKey
std::string m_coolFolderKey
Definition: L1CaloDerivedRunParsContainer.h:63
L1CaloDerivedRunParsContainer::end
const_iterator end() const
Definition: L1CaloDerivedRunParsContainer.h:54
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53