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

#include <L1CaloRunParametersContainer.h>

Inheritance diagram for L1CaloRunParametersContainer:
Collaboration diagram for L1CaloRunParametersContainer:

Public Types

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

Public Member Functions

 L1CaloRunParametersContainer ()
 
 L1CaloRunParametersContainer (const std::string &folderKey)
 
virtual ~L1CaloRunParametersContainer ()
 
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 L1CaloRunParametersrunParameters (unsigned int channelId) const
 
const L1CaloRunParametersrunParameters (const L1CaloCoolChannelId &channelId) const
 
const_iterator begin () const
 
const_iterator end () const
 
void addRunParameters (const L1CaloRunParameters &runParameters)
 
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 {
  erunType, erunActionName, erunActionVersion, ereadoutConfig,
  ereadoutConfigID, ettcConfiguration, ettcConfigurationID, etriggerMenu,
  ecalibration, econditions
}
 
typedef std::map< int, std::string > AttrSpecificationMap
 

Private Attributes

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

Detailed Description

Definition at line 25 of file L1CaloRunParametersContainer.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 L1CaloRunParametersContainer.h.

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
erunType 
erunActionName 
erunActionVersion 
ereadoutConfig 
ereadoutConfigID 
ettcConfiguration 
ettcConfigurationID 
etriggerMenu 
ecalibration 
econditions 

Definition at line 32 of file L1CaloRunParametersContainer.h.

32 {}

Constructor & Destructor Documentation

◆ L1CaloRunParametersContainer() [1/2]

L1CaloRunParametersContainer::L1CaloRunParametersContainer ( )

Definition at line 15 of file L1CaloRunParametersContainer.cxx.

16  : AbstractL1CaloPersistentCondition("CondAttrListCollection")
17 {
18  this->addSpecification(erunType, "runType", "string");
19  this->addSpecification(erunActionName, "runActionName", "string");
20  this->addSpecification(erunActionVersion, "runActionVersion", "unsigned int");
21  this->addSpecification(ereadoutConfig, "readoutConfig", "string");
22  this->addSpecification(ereadoutConfigID, "readoutConfigID", "unsigned int");
23  this->addSpecification(ettcConfiguration, "ttcConfiguration", "string");
24  this->addSpecification(ettcConfigurationID, "ttcConfigurationID", "unsigned int");
25  this->addSpecification(etriggerMenu, "triggerMenu", "string");
26  this->addSpecification(ecalibration, "calibration", "string");
27  this->addSpecification(econditions, "conditions", "string");
28 }

◆ L1CaloRunParametersContainer() [2/2]

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

Definition at line 30 of file L1CaloRunParametersContainer.cxx.

31  : L1CaloRunParametersContainer() // delegating constructor
32 {
33  // cppcheck-suppress useInitializationList
34  m_coolFolderKey = folderKey;
35 }

◆ ~L1CaloRunParametersContainer()

virtual L1CaloRunParametersContainer::~L1CaloRunParametersContainer ( )
inlinevirtual

Definition at line 36 of file L1CaloRunParametersContainer.h.

Member Function Documentation

◆ addRunParameters()

void L1CaloRunParametersContainer::addRunParameters ( const L1CaloRunParameters runParameters)

Definition at line 105 of file L1CaloRunParametersContainer.cxx.

106 {
107  // insert into the correct position mainting the sorted vector
108  m_runParameterss.insert(std::lower_bound(std::begin(m_runParameterss),
111  [](const L1CaloRunParameters& el, unsigned int va) -> bool {
112  return el.channelId() < va;
113  }),
114  runParameters);
115 }

◆ 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 L1CaloRunParametersContainer::begin ( ) const
inline

Definition at line 53 of file L1CaloRunParametersContainer.h.

57 :
58  std::vector<L1CaloRunParameters> m_runParameterss;

◆ clear()

virtual void L1CaloRunParametersContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 44 of file L1CaloRunParametersContainer.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> L1CaloRunParametersContainer::coolInputKeys ( ) const
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 42 of file L1CaloRunParametersContainer.h.

44 {

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 43 of file L1CaloRunParametersContainer.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 }

◆ dump()

void L1CaloRunParametersContainer::dump ( ) const

Definition at line 117 of file L1CaloRunParametersContainer.cxx.

117  {
119  for(;it!=this->end();++it) {
120  std::cout << " * item: " << *it <<std::endl;
121  }
122 }

◆ end()

const_iterator L1CaloRunParametersContainer::end ( ) const
inline

Definition at line 54 of file L1CaloRunParametersContainer.h.

57 :
58  std::vector<L1CaloRunParameters> m_runParameterss;

◆ makePersistent()

DataObject * L1CaloRunParametersContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 38 of file L1CaloRunParametersContainer.cxx.

39 {
40  using std::make_unique;
41 
42  if(m_coolFolderKey.empty()) return nullptr;
43 
44  auto* attrSpecification = this->createAttributeListSpecification();
45  if(!attrSpecification || !attrSpecification->size()) return nullptr;
46 
47  auto attrListCollection = make_unique<CondAttrListCollection>(true);
48  for(const auto& item : m_runParameterss) {
49  AthenaAttributeList attrList(*attrSpecification);
50  attrList[specificationName(erunType)].setValue(item.runType());
51  attrList[specificationName(erunActionName)].setValue(item.runActionName());
52  attrList[specificationName(erunActionVersion)].setValue(item.runActionVersion());
53  attrList[specificationName(ereadoutConfig)].setValue(item.readoutConfig());
54  attrList[specificationName(ereadoutConfigID)].setValue(item.readoutConfigID());
55  attrList[specificationName(ettcConfiguration)].setValue(item.ttcConfiguration());
56  attrList[specificationName(ettcConfigurationID)].setValue(item.ttcConfigurationID());
57  attrList[specificationName(etriggerMenu)].setValue(item.triggerMenu());
58  attrList[specificationName(ecalibration)].setValue(item.calibration());
59  attrList[specificationName(econditions)].setValue(item.conditions());
60 
61  attrListCollection->add(item.channelId(), attrList);
62  }
63  return static_cast<DataObject*>(attrListCollection.release());
64 }

◆ 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 L1CaloRunParametersContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > &  condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 66 of file L1CaloRunParametersContainer.cxx.

67 {
68  clear();
69 
70  auto it = condAttrListCollectionMap.find(m_coolFolderKey);
71  if(it == std::end(condAttrListCollectionMap)) return;
72 
73  auto attrListCollection = it->second;
74  for(const auto& item : *attrListCollection) {
75  auto chanNum = item.first;
76  const auto& attrList = item.second;
77 
78  auto runType = attrList[specificationName(erunType)].data<std::string>();
79  auto runActionName = attrList[specificationName(erunActionName)].data<std::string>();
80  auto runActionVersion = attrList[specificationName(erunActionVersion)].data<unsigned int>();
81  auto readoutConfig = attrList[specificationName(ereadoutConfig)].data<std::string>();
82  auto readoutConfigID = attrList[specificationName(ereadoutConfigID)].data<unsigned int>();
83  auto ttcConfiguration = attrList[specificationName(ettcConfiguration)].data<std::string>();
84  auto ttcConfigurationID = attrList[specificationName(ettcConfigurationID)].data<unsigned int>();
85  auto triggerMenu = attrList[specificationName(etriggerMenu)].data<std::string>();
86  auto calibration = attrList[specificationName(ecalibration)].data<std::string>();
87  auto conditions = attrList[specificationName(econditions)].data<std::string>();
88 
89  addRunParameters(L1CaloRunParameters(chanNum, runType, runActionName, runActionVersion, readoutConfig, readoutConfigID, ttcConfiguration, ttcConfigurationID, triggerMenu, calibration, conditions));
90  }
91 }

◆ 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 }

◆ runParameters() [1/2]

const L1CaloRunParameters* L1CaloRunParametersContainer::runParameters ( const L1CaloCoolChannelId channelId) const
inline

Definition at line 48 of file L1CaloRunParametersContainer.h.

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

◆ runParameters() [2/2]

const L1CaloRunParameters * L1CaloRunParametersContainer::runParameters ( unsigned int  channelId) const

Definition at line 93 of file L1CaloRunParametersContainer.cxx.

94 {
95  auto it = std::lower_bound(std::begin(m_runParameterss),
97  channelId,
98  [](const L1CaloRunParameters& el, unsigned int val) -> bool {
99  return el.channelId() < val;
100  });
101  if(it == std::end(m_runParameterss)) return nullptr;
102  return &(*it);
103 }

◆ 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 L1CaloRunParametersContainer::m_coolFolderKey = "/TRIGGER/L1Calo/V1/Conditions/RunParameters"
private

Definition at line 63 of file L1CaloRunParametersContainer.h.

◆ m_runParameterss

std::vector<L1CaloRunParameters> L1CaloRunParametersContainer::m_runParameterss
private

Definition at line 62 of file L1CaloRunParametersContainer.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:
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
L1CaloRunParameters::channelId
unsigned int channelId() const
Definition: L1CaloRunParameters.h:24
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
L1CaloRunParametersContainer::ereadoutConfigID
@ ereadoutConfigID
Definition: L1CaloRunParametersContainer.h:36
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
L1CaloRunParametersContainer::etriggerMenu
@ etriggerMenu
Definition: L1CaloRunParametersContainer.h:36
L1CaloRunParametersContainer::m_coolFolderKey
std::string m_coolFolderKey
Definition: L1CaloRunParametersContainer.h:63
L1CaloRunParametersContainer::L1CaloRunParametersContainer
L1CaloRunParametersContainer()
Definition: L1CaloRunParametersContainer.cxx:15
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
L1CaloRunParametersContainer::addRunParameters
void addRunParameters(const L1CaloRunParameters &runParameters)
Definition: L1CaloRunParametersContainer.cxx:105
L1CaloRunParametersContainer::erunActionVersion
@ erunActionVersion
Definition: L1CaloRunParametersContainer.h:36
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
L1CaloRunParametersContainer::runParameters
const L1CaloRunParameters * runParameters(unsigned int channelId) const
Definition: L1CaloRunParametersContainer.cxx:93
L1CaloRunParametersContainer::econditions
@ econditions
Definition: L1CaloRunParametersContainer.h:36
L1CaloRunParameters
Folder <-> Object mapping for /TRIGGER/L1Calo/V1/Conditions/RunParameters .
Definition: L1CaloRunParameters.h:18
AbstractL1CaloPersistentCondition::AbstractL1CaloPersistentCondition
AbstractL1CaloPersistentCondition(const std::string &condType)
Definition: AbstractL1CaloPersistentCondition.h:45
L1CaloRunParametersContainer::const_iterator
std::vector< L1CaloRunParameters >::const_iterator const_iterator
Definition: L1CaloRunParametersContainer.h:52
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
L1CaloRunParametersContainer::ettcConfigurationID
@ ettcConfigurationID
Definition: L1CaloRunParametersContainer.h:36
python.OnlineISConfiguration.runType
def runType
Definition: OnlineISConfiguration.py:112
L1CaloRunParametersContainer::begin
const_iterator begin() const
Definition: L1CaloRunParametersContainer.h:53
L1CaloRunParametersContainer::clear
virtual void clear()
Definition: L1CaloRunParametersContainer.h:44
L1CaloRunParametersContainer::ereadoutConfig
@ ereadoutConfig
Definition: L1CaloRunParametersContainer.h:36
L1CaloRunParametersContainer::ettcConfiguration
@ ettcConfiguration
Definition: L1CaloRunParametersContainer.h:36
item
Definition: ItemListSvc.h:43
AbstractL1CaloPersistentCondition::specificationName
std::string specificationName(int specId) const
Definition: AbstractL1CaloPersistentCondition.cxx:44
L1CaloRunParametersContainer::end
const_iterator end() const
Definition: L1CaloRunParametersContainer.h:54
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
L1CaloRunParametersContainer::erunType
@ erunType
Definition: L1CaloRunParametersContainer.h:36
L1CaloRunParametersContainer::erunActionName
@ erunActionName
Definition: L1CaloRunParametersContainer.h:36
L1CaloRunParametersContainer::ecalibration
@ ecalibration
Definition: L1CaloRunParametersContainer.h:36
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53
L1CaloRunParametersContainer::m_runParameterss
std::vector< L1CaloRunParameters > m_runParameterss
Definition: L1CaloRunParametersContainer.h:62