ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloPprChanDefaultsV1Container Class Reference

#include <L1CaloPprChanDefaultsV1Container.h>

Inheritance diagram for L1CaloPprChanDefaultsV1Container:
Collaboration diagram for L1CaloPprChanDefaultsV1Container:

Public Types

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

Public Member Functions

 L1CaloPprChanDefaultsV1Container ()
 L1CaloPprChanDefaultsV1Container (const std::string &folderKey)
virtual ~L1CaloPprChanDefaultsV1Container ()
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 L1CaloPprChanDefaultsV1pprChanDefaultsV1 (unsigned int channelId) const
const L1CaloPprChanDefaultsV1pprChanDefaultsV1 (const L1CaloCoolChannelId &channelId) const
const_iterator begin () const
const_iterator end () const
void addPprChanDefaultsV1 (const L1CaloPprChanDefaultsV1 &pprChanDefaultsV1)
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 {
  eBcidDecision1 , eSatOverride1 , eBcidDecision2 , eSatOverride2 ,
  eBcidDecision3 , eSatOverride3 , ePeakFinderCond , eDecisionSource
}
typedef std::map< int, std::string > AttrSpecificationMap

Private Attributes

std::vector< L1CaloPprChanDefaultsV1m_pprChanDefaultsV1s
std::string m_coolFolderKey = "/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"
AttrSpecificationMap m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationTypeMap
std::string m_strConditionType

Detailed Description

Definition at line 26 of file L1CaloPprChanDefaultsV1Container.h.

Member Typedef Documentation

◆ AttrSpecificationMap

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

Definition at line 50 of file AbstractL1CaloPersistentCondition.h.

◆ const_iterator

Member Enumeration Documentation

◆ eAttrSpecification

Constructor & Destructor Documentation

◆ L1CaloPprChanDefaultsV1Container() [1/2]

L1CaloPprChanDefaultsV1Container::L1CaloPprChanDefaultsV1Container ( )

Definition at line 16 of file L1CaloPprChanDefaultsV1Container.cxx.

17 : AbstractL1CaloPersistentCondition("CondAttrListCollection")
18{
19 this->addSpecification(eBcidDecision1, "CR12_BcidDecision1", "unsigned int");
20 this->addSpecification(eSatOverride1, "CR12_SatOverride1", "unsigned int");
21 this->addSpecification(eBcidDecision2, "CR13_BcidDecision2", "unsigned int");
22 this->addSpecification(eSatOverride2, "CR13_SatOverride2", "unsigned int");
23 this->addSpecification(eBcidDecision3, "CR14_BcidDecision3", "unsigned int");
24 this->addSpecification(eSatOverride3, "CR14_SatOverride3", "unsigned int");
25 this->addSpecification(ePeakFinderCond, "CR15_PeakFinderCond", "unsigned int");
26 this->addSpecification(eDecisionSource, "CR15_DecisionSource", "unsigned int");
27}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)

◆ L1CaloPprChanDefaultsV1Container() [2/2]

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

Definition at line 29 of file L1CaloPprChanDefaultsV1Container.cxx.

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

◆ ~L1CaloPprChanDefaultsV1Container()

virtual L1CaloPprChanDefaultsV1Container::~L1CaloPprChanDefaultsV1Container ( )
inlinevirtual

Definition at line 33 of file L1CaloPprChanDefaultsV1Container.h.

33{}

Member Function Documentation

◆ addPprChanDefaultsV1()

void L1CaloPprChanDefaultsV1Container::addPprChanDefaultsV1 ( const L1CaloPprChanDefaultsV1 & pprChanDefaultsV1)

Definition at line 100 of file L1CaloPprChanDefaultsV1Container.cxx.

101{
102 // insert into the correct position mainting the sorted vector
103 m_pprChanDefaultsV1s.insert(std::lower_bound(std::begin(m_pprChanDefaultsV1s),
104 std::end(m_pprChanDefaultsV1s),
105 pprChanDefaultsV1.channelId(),
106 [](const L1CaloPprChanDefaultsV1& el, unsigned int va) -> bool {
107 return el.channelId() < va;
108 }),
110}
std::vector< L1CaloPprChanDefaultsV1 > m_pprChanDefaultsV1s
const L1CaloPprChanDefaultsV1 * pprChanDefaultsV1(unsigned int channelId) const

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

◆ clear()

virtual void L1CaloPprChanDefaultsV1Container::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 41 of file L1CaloPprChanDefaultsV1Container.h.

41{ m_pprChanDefaultsV1s.clear(); }

◆ conditionType()

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

◆ coolInputKeys()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 39 of file L1CaloPprChanDefaultsV1Container.h.

39{ return {m_coolFolderKey}; }

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 40 of file L1CaloPprChanDefaultsV1Container.h.

40{ return m_coolFolderKey; }

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

◆ end()

const_iterator L1CaloPprChanDefaultsV1Container::end ( ) const

◆ makePersistent()

DataObject * L1CaloPprChanDefaultsV1Container::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 37 of file L1CaloPprChanDefaultsV1Container.cxx.

38{
39 using std::make_unique;
40
41 if(m_coolFolderKey.empty()) return nullptr;
42
43 auto* attrSpecification = this->createAttributeListSpecification();
44 if(!attrSpecification || !attrSpecification->size()) return nullptr;
45
46 auto attrListCollection = make_unique<CondAttrListCollection>(true);
47 for(const auto& item : m_pprChanDefaultsV1s) {
48 AthenaAttributeList attrList(*attrSpecification);
49 attrList[specificationName(eBcidDecision1)].setValue(item.bcidDecision1());
50 attrList[specificationName(eSatOverride1)].setValue(item.satOverride1());
51 attrList[specificationName(eBcidDecision2)].setValue(item.bcidDecision2());
52 attrList[specificationName(eSatOverride2)].setValue(item.satOverride2());
53 attrList[specificationName(eBcidDecision3)].setValue(item.bcidDecision3());
54 attrList[specificationName(eSatOverride3)].setValue(item.satOverride3());
55 attrList[specificationName(ePeakFinderCond)].setValue(item.peakFinderCond());
56 attrList[specificationName(eDecisionSource)].setValue(item.decisionSource());
57
58 attrListCollection->add(item.channelId(), attrList);
59 }
60 return static_cast<DataObject*>(attrListCollection.release());
61}
coral::AttributeListSpecification * createAttributeListSpecification() const

◆ makeTransient() [1/2]

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

Reimplemented from AbstractL1CaloPersistentCondition.

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() [2/2]

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 63 of file L1CaloPprChanDefaultsV1Container.cxx.

64{
65 clear();
66
67 auto it = condAttrListCollectionMap.find(m_coolFolderKey);
68 if(it == std::end(condAttrListCollectionMap)) return;
69
70 auto attrListCollection = it->second;
71 for(const auto& item : *attrListCollection) {
72 auto chanNum = item.first;
73 const auto& attrList = item.second;
74
75 auto BcidDecision1 = attrList[specificationName(eBcidDecision1)].data<unsigned int>();
76 auto SatOverride1 = attrList[specificationName(eSatOverride1)].data<unsigned int>();
77 auto BcidDecision2 = attrList[specificationName(eBcidDecision2)].data<unsigned int>();
78 auto SatOverride2 = attrList[specificationName(eSatOverride2)].data<unsigned int>();
79 auto BcidDecision3 = attrList[specificationName(eBcidDecision3)].data<unsigned int>();
80 auto SatOverride3 = attrList[specificationName(eSatOverride3)].data<unsigned int>();
81 auto PeakFinderCond = attrList[specificationName(ePeakFinderCond)].data<unsigned int>();
82 auto DecisionSource = attrList[specificationName(eDecisionSource)].data<unsigned int>();
83
84 addPprChanDefaultsV1(L1CaloPprChanDefaultsV1(chanNum, BcidDecision1, SatOverride1, BcidDecision2, SatOverride2, BcidDecision3, SatOverride3, PeakFinderCond, DecisionSource));
85 }
86}
void addPprChanDefaultsV1(const L1CaloPprChanDefaultsV1 &pprChanDefaultsV1)

◆ pprChanDefaultsV1() [1/2]

const L1CaloPprChanDefaultsV1 * L1CaloPprChanDefaultsV1Container::pprChanDefaultsV1 ( const L1CaloCoolChannelId & channelId) const
inline

◆ pprChanDefaultsV1() [2/2]

const L1CaloPprChanDefaultsV1 * L1CaloPprChanDefaultsV1Container::pprChanDefaultsV1 ( unsigned int channelId) const

Definition at line 88 of file L1CaloPprChanDefaultsV1Container.cxx.

89{
90 auto it = std::lower_bound(std::begin(m_pprChanDefaultsV1s),
91 std::end(m_pprChanDefaultsV1s),
92 channelId,
93 [](const L1CaloPprChanDefaultsV1& el, unsigned int val) -> bool {
94 return el.channelId() < val;
95 });
96 if(it == std::end(m_pprChanDefaultsV1s)) return nullptr;
97 return &(*it);
98}

◆ 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 L1CaloPprChanDefaultsV1Container::m_coolFolderKey = "/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"
private

Definition at line 58 of file L1CaloPprChanDefaultsV1Container.h.

◆ m_pprChanDefaultsV1s

std::vector<L1CaloPprChanDefaultsV1> L1CaloPprChanDefaultsV1Container::m_pprChanDefaultsV1s
private

Definition at line 57 of file L1CaloPprChanDefaultsV1Container.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: