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

#include <L1CaloPprChanCalibContainer.h>

Inheritance diagram for L1CaloPprChanCalibContainer:
Collaboration diagram for L1CaloPprChanCalibContainer:

Public Types

using iterator = std::vector<L1CaloPprChanCalib>::iterator
using const_iterator = std::vector<L1CaloPprChanCalib>::const_iterator

Public Member Functions

 L1CaloPprChanCalibContainer ()
 L1CaloPprChanCalibContainer (const std::string &folderKey)
virtual ~L1CaloPprChanCalibContainer ()
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 L1CaloPprChanCalibpprChanCalib (unsigned int channelId) const
const L1CaloPprChanCalibpprChanCalib (const L1CaloCoolChannelId &channelId) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
void addPprChanCalib (const L1CaloPprChanCalib &pprChanCalib)
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 {
  eErrorCode , ePedMean , ePedValue , ePedFirSum ,
  eExtBcidThreshold , eSatBcidThreshLow , eSatBcidThreshHigh , eSatBcidLevel ,
  eBcidEnergyRangeLow , eBcidEnergyRangeHigh , eFirStartBit , eFirCoeff1 ,
  eFirCoeff2 , eFirCoeff3 , eFirCoeff4 , eFirCoeff5 ,
  eLutCpStrategy , eLutCpOffset , eLutCpNoiseCut , eLutCpSlope ,
  eLutCpPar1 , eLutCpPar2 , eLutCpPar3 , eLutCpPar4 ,
  eLutCpScale , eLutJepStrategy , eLutJepOffset , eLutJepNoiseCut ,
  eLutJepSlope , eLutJepPar1 , eLutJepPar2 , eLutJepPar3 ,
  eLutJepPar4 , eLutJepScale
}
typedef std::map< int, std::string > AttrSpecificationMap

Private Attributes

std::vector< L1CaloPprChanCalibm_pprChanCalibs
std::string m_coolFolderKey = "/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"
AttrSpecificationMap m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationTypeMap
std::string m_strConditionType

Detailed Description

Definition at line 26 of file L1CaloPprChanCalibContainer.h.

Member Typedef Documentation

◆ AttrSpecificationMap

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

Definition at line 50 of file AbstractL1CaloPersistentCondition.h.

◆ const_iterator

◆ iterator

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
eErrorCode 
ePedMean 
ePedValue 
ePedFirSum 
eExtBcidThreshold 
eSatBcidThreshLow 
eSatBcidThreshHigh 
eSatBcidLevel 
eBcidEnergyRangeLow 
eBcidEnergyRangeHigh 
eFirStartBit 
eFirCoeff1 
eFirCoeff2 
eFirCoeff3 
eFirCoeff4 
eFirCoeff5 
eLutCpStrategy 
eLutCpOffset 
eLutCpNoiseCut 
eLutCpSlope 
eLutCpPar1 
eLutCpPar2 
eLutCpPar3 
eLutCpPar4 
eLutCpScale 
eLutJepStrategy 
eLutJepOffset 
eLutJepNoiseCut 
eLutJepSlope 
eLutJepPar1 
eLutJepPar2 
eLutJepPar3 
eLutJepPar4 
eLutJepScale 

Definition at line 29 of file L1CaloPprChanCalibContainer.h.

Constructor & Destructor Documentation

◆ L1CaloPprChanCalibContainer() [1/2]

L1CaloPprChanCalibContainer::L1CaloPprChanCalibContainer ( )

Definition at line 15 of file L1CaloPprChanCalibContainer.cxx.

16 : AbstractL1CaloPersistentCondition("CondAttrListCollection")
17{
18 this->addSpecification(eErrorCode, "ErrorCode", "unsigned int");
19 this->addSpecification(ePedMean, "PedMean", "double");
20 this->addSpecification(ePedValue, "PedValue", "unsigned int");
21 this->addSpecification(ePedFirSum, "PedFirSum", "unsigned int");
22 this->addSpecification(eExtBcidThreshold, "ExtBcidThreshold", "unsigned short");
23 this->addSpecification(eSatBcidThreshLow, "SatBcidThreshLow", "unsigned short");
24 this->addSpecification(eSatBcidThreshHigh, "SatBcidThreshHigh", "unsigned short");
25 this->addSpecification(eSatBcidLevel, "SatBcidLevel", "unsigned short");
26 this->addSpecification(eBcidEnergyRangeLow, "BcidEnergyRangeLow", "unsigned short");
27 this->addSpecification(eBcidEnergyRangeHigh, "BcidEnergyRangeHigh", "unsigned short");
28 this->addSpecification(eFirStartBit, "FirStartBit", "unsigned short");
29 this->addSpecification(eFirCoeff1, "FirCoeff1", "short");
30 this->addSpecification(eFirCoeff2, "FirCoeff2", "short");
31 this->addSpecification(eFirCoeff3, "FirCoeff3", "short");
32 this->addSpecification(eFirCoeff4, "FirCoeff4", "short");
33 this->addSpecification(eFirCoeff5, "FirCoeff5", "short");
34 this->addSpecification(eLutCpStrategy, "LutCpStrategy", "unsigned short");
35 this->addSpecification(eLutCpOffset, "LutCpOffset", "unsigned short");
36 this->addSpecification(eLutCpNoiseCut, "LutCpNoiseCut", "unsigned short");
37 this->addSpecification(eLutCpSlope, "LutCpSlope", "unsigned short");
38 this->addSpecification(eLutCpPar1, "LutCpPar1", "short");
39 this->addSpecification(eLutCpPar2, "LutCpPar2", "short");
40 this->addSpecification(eLutCpPar3, "LutCpPar3", "short");
41 this->addSpecification(eLutCpPar4, "LutCpPar4", "short");
42 this->addSpecification(eLutCpScale, "LutCpScale", "unsigned short");
43 this->addSpecification(eLutJepStrategy, "LutJepStrategy", "unsigned short");
44 this->addSpecification(eLutJepOffset, "LutJepOffset", "unsigned short");
45 this->addSpecification(eLutJepNoiseCut, "LutJepNoiseCut", "unsigned short");
46 this->addSpecification(eLutJepSlope, "LutJepSlope", "unsigned short");
47 this->addSpecification(eLutJepPar1, "LutJepPar1", "short");
48 this->addSpecification(eLutJepPar2, "LutJepPar2", "short");
49 this->addSpecification(eLutJepPar3, "LutJepPar3", "short");
50 this->addSpecification(eLutJepPar4, "LutJepPar4", "short");
51 this->addSpecification(eLutJepScale, "LutJepScale", "unsigned short");
52}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)

◆ L1CaloPprChanCalibContainer() [2/2]

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

Definition at line 54 of file L1CaloPprChanCalibContainer.cxx.

55 : L1CaloPprChanCalibContainer() // delegating constructor
56{
57 // cppcheck-suppress useInitializationList
58 m_coolFolderKey = folderKey;
59}

◆ ~L1CaloPprChanCalibContainer()

virtual L1CaloPprChanCalibContainer::~L1CaloPprChanCalibContainer ( )
inlinevirtual

Definition at line 33 of file L1CaloPprChanCalibContainer.h.

33{}

Member Function Documentation

◆ addPprChanCalib()

void L1CaloPprChanCalibContainer::addPprChanCalib ( const L1CaloPprChanCalib & pprChanCalib)

Definition at line 182 of file L1CaloPprChanCalibContainer.cxx.

183{
184 // insert into the correct position mainting the sorted vector
185 m_pprChanCalibs.insert(std::lower_bound(std::begin(m_pprChanCalibs),
186 std::end(m_pprChanCalibs),
187 pprChanCalib.channelId(),
188 [](const L1CaloPprChanCalib& el, unsigned int va) -> bool {
189 return el.channelId() < va;
190 }),
192}
const L1CaloPprChanCalib * pprChanCalib(unsigned int channelId) const
std::vector< L1CaloPprChanCalib > m_pprChanCalibs

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

iterator L1CaloPprChanCalibContainer::begin ( )
inline

Definition at line 50 of file L1CaloPprChanCalibContainer.h.

50{ return m_pprChanCalibs.begin(); }

◆ begin() [2/2]

const_iterator L1CaloPprChanCalibContainer::begin ( ) const
inline

Definition at line 53 of file L1CaloPprChanCalibContainer.h.

53{ return m_pprChanCalibs.begin(); }

◆ clear()

virtual void L1CaloPprChanCalibContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 41 of file L1CaloPprChanCalibContainer.h.

41{ m_pprChanCalibs.clear(); }

◆ conditionType()

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

◆ coolInputKeys()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 39 of file L1CaloPprChanCalibContainer.h.

39{ return {m_coolFolderKey}; }

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 40 of file L1CaloPprChanCalibContainer.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() [1/2]

iterator L1CaloPprChanCalibContainer::end ( )
inline

Definition at line 51 of file L1CaloPprChanCalibContainer.h.

51{ return m_pprChanCalibs.end(); }

◆ end() [2/2]

const_iterator L1CaloPprChanCalibContainer::end ( ) const
inline

Definition at line 54 of file L1CaloPprChanCalibContainer.h.

54{ return m_pprChanCalibs.end(); }

◆ makePersistent()

DataObject * L1CaloPprChanCalibContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 62 of file L1CaloPprChanCalibContainer.cxx.

63{
64 using std::make_unique;
65
66 if(m_coolFolderKey.empty()) return nullptr;
67
68 auto* attrSpecification = this->createAttributeListSpecification();
69 if(!attrSpecification || !attrSpecification->size()) return nullptr;
70
71 auto attrListCollection = make_unique<CondAttrListCollection>(true);
72 for(const auto& item : m_pprChanCalibs) {
73 AthenaAttributeList attrList(*attrSpecification);
74 attrList[specificationName(eErrorCode)].setValue(item.errorCode());
75 attrList[specificationName(ePedMean)].setValue(item.pedMean());
76 attrList[specificationName(ePedValue)].setValue(item.pedValue());
77 attrList[specificationName(ePedFirSum)].setValue(item.pedFirSum());
78 attrList[specificationName(eExtBcidThreshold)].setValue(item.extBcidThreshold());
79 attrList[specificationName(eSatBcidThreshLow)].setValue(item.satBcidThreshLow());
80 attrList[specificationName(eSatBcidThreshHigh)].setValue(item.satBcidThreshHigh());
81 attrList[specificationName(eSatBcidLevel)].setValue(item.satBcidLevel());
82 attrList[specificationName(eBcidEnergyRangeLow)].setValue(item.bcidEnergyRangeLow());
83 attrList[specificationName(eBcidEnergyRangeHigh)].setValue(item.bcidEnergyRangeHigh());
84 attrList[specificationName(eFirStartBit)].setValue(item.firStartBit());
85 attrList[specificationName(eFirCoeff1)].setValue(item.firCoeff1());
86 attrList[specificationName(eFirCoeff2)].setValue(item.firCoeff2());
87 attrList[specificationName(eFirCoeff3)].setValue(item.firCoeff3());
88 attrList[specificationName(eFirCoeff4)].setValue(item.firCoeff4());
89 attrList[specificationName(eFirCoeff5)].setValue(item.firCoeff5());
90 attrList[specificationName(eLutCpStrategy)].setValue(item.lutCpStrategy());
91 attrList[specificationName(eLutCpOffset)].setValue(item.lutCpOffset());
92 attrList[specificationName(eLutCpNoiseCut)].setValue(item.lutCpNoiseCut());
93 attrList[specificationName(eLutCpSlope)].setValue(item.lutCpSlope());
94 attrList[specificationName(eLutCpPar1)].setValue(item.lutCpPar1());
95 attrList[specificationName(eLutCpPar2)].setValue(item.lutCpPar2());
96 attrList[specificationName(eLutCpPar3)].setValue(item.lutCpPar3());
97 attrList[specificationName(eLutCpPar4)].setValue(item.lutCpPar4());
98 attrList[specificationName(eLutCpScale)].setValue(item.lutCpScale());
99 attrList[specificationName(eLutJepStrategy)].setValue(item.lutJepStrategy());
100 attrList[specificationName(eLutJepOffset)].setValue(item.lutJepOffset());
101 attrList[specificationName(eLutJepNoiseCut)].setValue(item.lutJepNoiseCut());
102 attrList[specificationName(eLutJepSlope)].setValue(item.lutJepSlope());
103 attrList[specificationName(eLutJepPar1)].setValue(item.lutJepPar1());
104 attrList[specificationName(eLutJepPar2)].setValue(item.lutJepPar2());
105 attrList[specificationName(eLutJepPar3)].setValue(item.lutJepPar3());
106 attrList[specificationName(eLutJepPar4)].setValue(item.lutJepPar4());
107 attrList[specificationName(eLutJepScale)].setValue(item.lutJepScale());
108
109 attrListCollection->add(item.channelId(), attrList);
110 }
111 return static_cast<DataObject*>(attrListCollection.release());
112}
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 L1CaloPprChanCalibContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > & condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 114 of file L1CaloPprChanCalibContainer.cxx.

115{
116 clear();
117
118 // In the case of overlay, we need multiple instances of L1CaloPprChanCalibContainer
119 // Take the last element in the map
120 if (condAttrListCollectionMap.empty()) return;
121 auto it = condAttrListCollectionMap.rbegin();
122
123 auto attrListCollection = it->second;
124
125 for(const auto& item : *attrListCollection) {
126 auto chanNum = item.first;
127 const auto& attrList = item.second;
128
129 auto errorCode = attrList[specificationName(eErrorCode)].data<unsigned int>();
130 auto pedMean = attrList[specificationName(ePedMean)].data<double>();
131 auto pedValue = attrList[specificationName(ePedValue)].data<unsigned int>();
132 auto pedFirSum = attrList[specificationName(ePedFirSum)].data<unsigned int>();
133 auto extBcidThreshold = attrList[specificationName(eExtBcidThreshold)].data<unsigned short>();
134 auto satBcidThreshLow = attrList[specificationName(eSatBcidThreshLow)].data<unsigned short>();
135 auto satBcidThreshHigh = attrList[specificationName(eSatBcidThreshHigh)].data<unsigned short>();
136 auto satBcidLevel = attrList[specificationName(eSatBcidLevel)].data<unsigned short>();
137 auto bcidEnergyRangeLow = attrList[specificationName(eBcidEnergyRangeLow)].data<unsigned short>();
138 auto bcidEnergyRangeHigh = attrList[specificationName(eBcidEnergyRangeHigh)].data<unsigned short>();
139 auto firStartBit = attrList[specificationName(eFirStartBit)].data<unsigned short>();
140 auto firCoeff1 = attrList[specificationName(eFirCoeff1)].data<short>();
141 auto firCoeff2 = attrList[specificationName(eFirCoeff2)].data<short>();
142 auto firCoeff3 = attrList[specificationName(eFirCoeff3)].data<short>();
143 auto firCoeff4 = attrList[specificationName(eFirCoeff4)].data<short>();
144 auto firCoeff5 = attrList[specificationName(eFirCoeff5)].data<short>();
145 auto lutCpStrategy = attrList[specificationName(eLutCpStrategy)].data<unsigned short>();
146 auto lutCpOffset = attrList[specificationName(eLutCpOffset)].data<unsigned short>();
147 auto lutCpNoiseCut = attrList[specificationName(eLutCpNoiseCut)].data<unsigned short>();
148 auto lutCpSlope = attrList[specificationName(eLutCpSlope)].data<unsigned short>();
149 auto lutCpPar1 = attrList[specificationName(eLutCpPar1)].data<short>();
150 auto lutCpPar2 = attrList[specificationName(eLutCpPar2)].data<short>();
151 auto lutCpPar3 = attrList[specificationName(eLutCpPar3)].data<short>();
152 auto lutCpPar4 = attrList[specificationName(eLutCpPar4)].data<short>();
153 auto lutCpScale = attrList[specificationName(eLutCpScale)].data<unsigned short>();
154 auto lutJepStrategy = attrList[specificationName(eLutJepStrategy)].data<unsigned short>();
155 auto lutJepOffset = attrList[specificationName(eLutJepOffset)].data<unsigned short>();
156 auto lutJepNoiseCut = attrList[specificationName(eLutJepNoiseCut)].data<unsigned short>();
157 auto lutJepSlope = attrList[specificationName(eLutJepSlope)].data<unsigned short>();
158 auto lutJepPar1 = attrList[specificationName(eLutJepPar1)].data<short>();
159 auto lutJepPar2 = attrList[specificationName(eLutJepPar2)].data<short>();
160 auto lutJepPar3 = attrList[specificationName(eLutJepPar3)].data<short>();
161 auto lutJepPar4 = attrList[specificationName(eLutJepPar4)].data<short>();
162 auto lutJepScale = attrList[specificationName(eLutJepScale)].data<unsigned short>();
163
164 addPprChanCalib(L1CaloPprChanCalib(chanNum, errorCode, pedMean, pedValue, pedFirSum, extBcidThreshold, satBcidThreshLow, satBcidThreshHigh, satBcidLevel, bcidEnergyRangeLow, bcidEnergyRangeHigh, firStartBit, firCoeff1, firCoeff2, firCoeff3, firCoeff4, firCoeff5, lutCpStrategy, lutCpOffset, lutCpNoiseCut, lutCpSlope, lutCpPar1, lutCpPar2, lutCpPar3, lutCpPar4, lutCpScale, lutJepStrategy, lutJepOffset, lutJepNoiseCut, lutJepSlope, lutJepPar1, lutJepPar2, lutJepPar3, lutJepPar4, lutJepScale));
165 }
166
167// }
168}
void addPprChanCalib(const L1CaloPprChanCalib &pprChanCalib)

◆ pprChanCalib() [1/2]

const L1CaloPprChanCalib * L1CaloPprChanCalibContainer::pprChanCalib ( const L1CaloCoolChannelId & channelId) const
inline

◆ pprChanCalib() [2/2]

const L1CaloPprChanCalib * L1CaloPprChanCalibContainer::pprChanCalib ( unsigned int channelId) const

Definition at line 170 of file L1CaloPprChanCalibContainer.cxx.

171{
172 auto it = std::lower_bound(std::begin(m_pprChanCalibs),
173 std::end(m_pprChanCalibs),
174 channelId,
175 [](const L1CaloPprChanCalib& el, unsigned int val) -> bool {
176 return el.channelId() < val;
177 });
178 if(it == std::end(m_pprChanCalibs)) return nullptr;
179 return &(*it);
180}

◆ 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 L1CaloPprChanCalibContainer::m_coolFolderKey = "/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"
private

Definition at line 61 of file L1CaloPprChanCalibContainer.h.

◆ m_pprChanCalibs

std::vector<L1CaloPprChanCalib> L1CaloPprChanCalibContainer::m_pprChanCalibs
private

Definition at line 60 of file L1CaloPprChanCalibContainer.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: