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

#include <L1CaloPprChanStrategyContainer.h>

Inheritance diagram for L1CaloPprChanStrategyContainer:
Collaboration diagram for L1CaloPprChanStrategyContainer:

Public Types

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

Public Member Functions

 L1CaloPprChanStrategyContainer ()
 
 L1CaloPprChanStrategyContainer (const std::string &folderKey)
 
virtual ~L1CaloPprChanStrategyContainer ()
 
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 L1CaloPprChanStrategypprChanStrategy (unsigned int channelId) const
 
const L1CaloPprChanStrategypprChanStrategy (const L1CaloCoolChannelId &channelId) const
 
const_iterator begin () const
 
const_iterator end () const
 
void addPprChanStrategy (const L1CaloPprChanStrategy &pprChanStrategy)
 
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 { eStrategy, eCode, eTimingRegime, eDescription }
 
typedef std::map< int, std::string > AttrSpecificationMap
 

Private Attributes

std::vector< L1CaloPprChanStrategym_pprChanStrategys
 
std::string m_coolFolderKey = "/TRIGGER/L1Calo/V2/Configuration/PprChanStrategy"
 
AttrSpecificationMap m_attrSpecificationNameMap
 
AttrSpecificationMap m_attrSpecificationTypeMap
 
std::string m_strConditionType
 

Detailed Description

Definition at line 24 of file L1CaloPprChanStrategyContainer.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 51 of file L1CaloPprChanStrategyContainer.h.

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
eStrategy 
eCode 
eTimingRegime 
eDescription 

Definition at line 31 of file L1CaloPprChanStrategyContainer.h.

31 {}

Constructor & Destructor Documentation

◆ L1CaloPprChanStrategyContainer() [1/2]

L1CaloPprChanStrategyContainer::L1CaloPprChanStrategyContainer ( )

Definition at line 15 of file L1CaloPprChanStrategyContainer.cxx.

16  : AbstractL1CaloPersistentCondition("CondAttrListCollection")
17 {
18  this->addSpecification(eStrategy, "Strategy", "string");
19  this->addSpecification(eCode, "Code", "unsigned int");
20  this->addSpecification(eTimingRegime, "TimingRegime", "string");
21  this->addSpecification(eDescription, "Description", "string");
22 }

◆ L1CaloPprChanStrategyContainer() [2/2]

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

Definition at line 24 of file L1CaloPprChanStrategyContainer.cxx.

25  : L1CaloPprChanStrategyContainer() // delegating constructor
26 {
27  // cppcheck-suppress useInitializationList
28  m_coolFolderKey = folderKey;
29 }

◆ ~L1CaloPprChanStrategyContainer()

virtual L1CaloPprChanStrategyContainer::~L1CaloPprChanStrategyContainer ( )
inlinevirtual

Definition at line 35 of file L1CaloPprChanStrategyContainer.h.

Member Function Documentation

◆ addPprChanStrategy()

void L1CaloPprChanStrategyContainer::addPprChanStrategy ( const L1CaloPprChanStrategy pprChanStrategy)

Definition at line 87 of file L1CaloPprChanStrategyContainer.cxx.

88 {
89  // insert into the correct position mainting the sorted vector
90  m_pprChanStrategys.insert(std::lower_bound(std::begin(m_pprChanStrategys),
93  [](const L1CaloPprChanStrategy& el, unsigned int va) -> bool {
94  return el.channelId() < va;
95  }),
97 }

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

Definition at line 52 of file L1CaloPprChanStrategyContainer.h.

56 :
57  std::vector<L1CaloPprChanStrategy> m_pprChanStrategys;

◆ clear()

virtual void L1CaloPprChanStrategyContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 43 of file L1CaloPprChanStrategyContainer.h.

43 {

◆ 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> L1CaloPprChanStrategyContainer::coolInputKeys ( ) const
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 41 of file L1CaloPprChanStrategyContainer.h.

43 {

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 42 of file L1CaloPprChanStrategyContainer.h.

43 {

◆ 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 L1CaloPprChanStrategyContainer::dump ( ) const

Definition at line 99 of file L1CaloPprChanStrategyContainer.cxx.

99  {
101  for(;it!=this->end();++it) {
102  std::cout << " * item: " << *it <<std::endl;
103  }
104 }

◆ end()

const_iterator L1CaloPprChanStrategyContainer::end ( ) const
inline

Definition at line 53 of file L1CaloPprChanStrategyContainer.h.

56 :
57  std::vector<L1CaloPprChanStrategy> m_pprChanStrategys;

◆ makePersistent()

DataObject * L1CaloPprChanStrategyContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 32 of file L1CaloPprChanStrategyContainer.cxx.

33 {
34  using std::make_unique;
35 
36  if(m_coolFolderKey.empty()) return nullptr;
37 
38  auto* attrSpecification = this->createAttributeListSpecification();
39  if(!attrSpecification || !attrSpecification->size()) return nullptr;
40 
41  auto attrListCollection = make_unique<CondAttrListCollection>(true);
42  for(const auto& item : m_pprChanStrategys) {
43  AthenaAttributeList attrList(*attrSpecification);
44  attrList[specificationName(eStrategy)].setValue(item.strategy());
45  attrList[specificationName(eCode)].setValue(item.code());
46  attrList[specificationName(eTimingRegime)].setValue(item.timingRegime());
47  attrList[specificationName(eDescription)].setValue(item.description());
48 
49  attrListCollection->add(item.channelId(), attrList);
50  }
51  return static_cast<DataObject*>(attrListCollection.release());
52 }

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 54 of file L1CaloPprChanStrategyContainer.cxx.

55 {
56  clear();
57 
58  auto it = condAttrListCollectionMap.find(m_coolFolderKey);
59  if(it == std::end(condAttrListCollectionMap)) return;
60 
61  auto attrListCollection = it->second;
62  for(const auto& item : *attrListCollection) {
63  auto chanNum = item.first;
64  const auto& attrList = item.second;
65 
66  auto strategy = attrList[specificationName(eStrategy)].data<std::string>();
67  auto code = attrList[specificationName(eCode)].data<unsigned int>();
68  auto timingRegime = attrList[specificationName(eTimingRegime)].data<std::string>();
69  auto description = attrList[specificationName(eDescription)].data<std::string>();
70 
72  }
73 }

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

◆ pprChanStrategy() [1/2]

const L1CaloPprChanStrategy* L1CaloPprChanStrategyContainer::pprChanStrategy ( const L1CaloCoolChannelId channelId) const
inline

Definition at line 47 of file L1CaloPprChanStrategyContainer.h.

48  { return m_pprChanStrategys.begin(); }
49  const_iterator end() const { return m_pprChanStrategys.end(); }

◆ pprChanStrategy() [2/2]

const L1CaloPprChanStrategy * L1CaloPprChanStrategyContainer::pprChanStrategy ( unsigned int  channelId) const

Definition at line 75 of file L1CaloPprChanStrategyContainer.cxx.

76 {
77  auto it = std::lower_bound(std::begin(m_pprChanStrategys),
79  channelId,
80  [](const L1CaloPprChanStrategy& el, unsigned int val) -> bool {
81  return el.channelId() < val;
82  });
83  if(it == std::end(m_pprChanStrategys)) return nullptr;
84  return &(*it);
85 }

◆ 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 L1CaloPprChanStrategyContainer::m_coolFolderKey = "/TRIGGER/L1Calo/V2/Configuration/PprChanStrategy"
private

Definition at line 62 of file L1CaloPprChanStrategyContainer.h.

◆ m_pprChanStrategys

std::vector<L1CaloPprChanStrategy> L1CaloPprChanStrategyContainer::m_pprChanStrategys
private

Definition at line 61 of file L1CaloPprChanStrategyContainer.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:
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
L1CaloPprChanStrategyContainer::pprChanStrategy
const L1CaloPprChanStrategy * pprChanStrategy(unsigned int channelId) const
Definition: L1CaloPprChanStrategyContainer.cxx:75
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
L1CaloPprChanStrategyContainer::eDescription
@ eDescription
Definition: L1CaloPprChanStrategyContainer.h:35
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
L1CaloPprChanStrategyContainer::begin
const_iterator begin() const
Definition: L1CaloPprChanStrategyContainer.h:52
L1CaloPprChanStrategyContainer::const_iterator
std::vector< L1CaloPprChanStrategy >::const_iterator const_iterator
Definition: L1CaloPprChanStrategyContainer.h:51
histSizes.code
code
Definition: histSizes.py:129
L1CaloPprChanStrategy::channelId
unsigned int channelId() const
Definition: L1CaloPprChanStrategy.h:23
L1CaloPprChanStrategyContainer::clear
virtual void clear()
Definition: L1CaloPprChanStrategyContainer.h:43
L1CaloPprChanStrategy
Folder <-> Object mapping for /TRIGGER/L1Calo/V2/Configuration/PprChanStrategy .
Definition: L1CaloPprChanStrategy.h:17
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
L1CaloPprChanStrategyContainer::eCode
@ eCode
Definition: L1CaloPprChanStrategyContainer.h:35
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
L1CaloPprChanStrategyContainer::m_pprChanStrategys
std::vector< L1CaloPprChanStrategy > m_pprChanStrategys
Definition: L1CaloPprChanStrategyContainer.h:61
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
L1CaloPprChanStrategyContainer::addPprChanStrategy
void addPprChanStrategy(const L1CaloPprChanStrategy &pprChanStrategy)
Definition: L1CaloPprChanStrategyContainer.cxx:87
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
L1CaloPprChanStrategyContainer::m_coolFolderKey
std::string m_coolFolderKey
Definition: L1CaloPprChanStrategyContainer.h:62
L1CaloPprChanStrategyContainer::eStrategy
@ eStrategy
Definition: L1CaloPprChanStrategyContainer.h:35
L1CaloPprChanStrategyContainer::end
const_iterator end() const
Definition: L1CaloPprChanStrategyContainer.h:53
L1CaloPprChanStrategyContainer::eTimingRegime
@ eTimingRegime
Definition: L1CaloPprChanStrategyContainer.h:35
L1CaloPprChanStrategyContainer::L1CaloPprChanStrategyContainer
L1CaloPprChanStrategyContainer()
Definition: L1CaloPprChanStrategyContainer.cxx:15
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88