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

#include <L1CaloPprChanCalibV1Container.h>

Inheritance diagram for L1CaloPprChanCalibV1Container:
Collaboration diagram for L1CaloPprChanCalibV1Container:

Public Types

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

Public Member Functions

 L1CaloPprChanCalibV1Container ()
 L1CaloPprChanCalibV1Container (const std::string &folderKey)
virtual ~L1CaloPprChanCalibV1Container ()
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 L1CaloPprChanCalibV1pprChanCalibV1 (unsigned int channelId) const
const L1CaloPprChanCalibV1pprChanCalibV1 (const L1CaloCoolChannelId &channelId) const
const_iterator begin () const
const_iterator end () const
void addPprChanCalibV1 (const L1CaloPprChanCalibV1 &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 , eExtBcidThreshold ,
  eSatBcidThreshLow , eSatBcidThreshHigh , eSatBcidLevel , eBcidEnergyRangeLow ,
  eBcidEnergyRangeHigh , eFirStartBit , eFirCoeff1 , eFirCoeff2 ,
  eFirCoeff3 , eFirCoeff4 , eFirCoeff5 , eLutStrategy ,
  eLutOffset , eLutNoiseCut , eLutSlope
}
typedef std::map< int, std::string > AttrSpecificationMap

Private Attributes

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

Detailed Description

Definition at line 26 of file L1CaloPprChanCalibV1Container.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

Enumerator
eErrorCode 
ePedMean 
ePedValue 
eExtBcidThreshold 
eSatBcidThreshLow 
eSatBcidThreshHigh 
eSatBcidLevel 
eBcidEnergyRangeLow 
eBcidEnergyRangeHigh 
eFirStartBit 
eFirCoeff1 
eFirCoeff2 
eFirCoeff3 
eFirCoeff4 
eFirCoeff5 
eLutStrategy 
eLutOffset 
eLutNoiseCut 
eLutSlope 

Definition at line 29 of file L1CaloPprChanCalibV1Container.h.

Constructor & Destructor Documentation

◆ L1CaloPprChanCalibV1Container() [1/2]

L1CaloPprChanCalibV1Container::L1CaloPprChanCalibV1Container ( )

Definition at line 16 of file L1CaloPprChanCalibV1Container.cxx.

17 : AbstractL1CaloPersistentCondition("CondAttrListCollection")
18{
19 this->addSpecification(eErrorCode, "ErrorCode", "unsigned int");
20 this->addSpecification(ePedMean, "PedMean", "double");
21 this->addSpecification(ePedValue, "PedValue", "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(eLutStrategy, "LutStrategy", "unsigned short");
35 this->addSpecification(eLutOffset, "LutOffset", "unsigned short");
36 this->addSpecification(eLutNoiseCut, "LutNoiseCut", "unsigned short");
37 this->addSpecification(eLutSlope, "LutSlope", "unsigned short");
38}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)

◆ L1CaloPprChanCalibV1Container() [2/2]

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

Definition at line 40 of file L1CaloPprChanCalibV1Container.cxx.

41 : L1CaloPprChanCalibV1Container() // delegating constructor
42{
43 // cppcheck-suppress useInitializationList
44 m_coolFolderKey = folderKey;
45}

◆ ~L1CaloPprChanCalibV1Container()

L1CaloPprChanCalibV1Container::~L1CaloPprChanCalibV1Container ( )
virtual

Definition at line 47 of file L1CaloPprChanCalibV1Container.cxx.

48{
49}

Member Function Documentation

◆ addPprChanCalibV1()

void L1CaloPprChanCalibV1Container::addPprChanCalibV1 ( const L1CaloPprChanCalibV1 & pprChanCalib)

Definition at line 136 of file L1CaloPprChanCalibV1Container.cxx.

137{
138 // insert into the correct position mainting the sorted vector
139 m_pprChanCalibs.insert(std::lower_bound(std::begin(m_pprChanCalibs),
140 std::end(m_pprChanCalibs),
141 pprChanCalib.channelId(),
142 [](const L1CaloPprChanCalibV1& el, unsigned int va) -> bool {
143 return el.channelId() < va;
144 }),
145 pprChanCalib);
146}
std::vector< L1CaloPprChanCalibV1 > m_pprChanCalibs
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 L1CaloPprChanCalibV1Container::begin ( ) const

◆ clear()

void L1CaloPprChanCalibV1Container::clear ( )
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 148 of file L1CaloPprChanCalibV1Container.cxx.

149{
150 m_pprChanCalibs.clear();
151}

◆ conditionType()

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

◆ coolInputKeys()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 39 of file L1CaloPprChanCalibV1Container.h.

39{ return {m_coolFolderKey}; }

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 40 of file L1CaloPprChanCalibV1Container.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 L1CaloPprChanCalibV1Container::end ( ) const

◆ makePersistent()

DataObject * L1CaloPprChanCalibV1Container::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 51 of file L1CaloPprChanCalibV1Container.cxx.

52{
53 using std::make_unique;
54
55 if(m_coolFolderKey.empty()) return nullptr;
56
57 auto* attrSpecification = this->createAttributeListSpecification();
58 if(!attrSpecification || !attrSpecification->size()) return nullptr;
59
60 auto attrListCollection = make_unique<CondAttrListCollection>(true);
61 for(const auto& item : m_pprChanCalibs) {
62 AthenaAttributeList attrList(*attrSpecification);
63 attrList[specificationName(eErrorCode)].setValue(item.errorCode());
64 attrList[specificationName(ePedMean)].setValue(item.pedMean());
65 attrList[specificationName(ePedValue)].setValue(item.pedValue());
66 attrList[specificationName(eExtBcidThreshold)].setValue(item.extBcidThreshold());
67 attrList[specificationName(eSatBcidThreshLow)].setValue(item.satBcidThreshLow());
68 attrList[specificationName(eSatBcidThreshHigh)].setValue(item.satBcidThreshHigh());
69 attrList[specificationName(eSatBcidLevel)].setValue(item.satBcidLevel());
70 attrList[specificationName(eBcidEnergyRangeLow)].setValue(item.bcidEnergyRangeLow());
71 attrList[specificationName(eBcidEnergyRangeHigh)].setValue(item.bcidEnergyRangeHigh());
72 attrList[specificationName(eFirStartBit)].setValue(item.firStartBit());
73 attrList[specificationName(eFirCoeff1)].setValue(item.firCoeff1());
74 attrList[specificationName(eFirCoeff2)].setValue(item.firCoeff2());
75 attrList[specificationName(eFirCoeff3)].setValue(item.firCoeff3());
76 attrList[specificationName(eFirCoeff4)].setValue(item.firCoeff4());
77 attrList[specificationName(eFirCoeff5)].setValue(item.firCoeff5());
78 attrList[specificationName(eLutStrategy)].setValue(item.lutStrategy());
79 attrList[specificationName(eLutOffset)].setValue(item.lutOffset());
80 attrList[specificationName(eLutNoiseCut)].setValue(item.lutNoiseCut());
81 attrList[specificationName(eLutSlope)].setValue(item.lutSlope());
82
83 attrListCollection->add(item.channelId(), attrList);
84 }
85 return static_cast<DataObject*>(attrListCollection.release());
86}
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 L1CaloPprChanCalibV1Container::makeTransient ( const std::map< std::string, const CondAttrListCollection * > & condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 88 of file L1CaloPprChanCalibV1Container.cxx.

89{
90 clear();
91
92 auto it = condAttrListCollectionMap.find(m_coolFolderKey);
93 if(it == std::end(condAttrListCollectionMap)) return;
94
95 auto attrListCollection = it->second;
96 for(const auto& item : *attrListCollection) {
97 auto chanNum = item.first;
98 const auto& attrList = item.second;
99
100 auto errorCode = attrList[specificationName(eErrorCode)].data<unsigned int>();
101 auto pedMean = attrList[specificationName(ePedMean)].data<double>();
102 auto pedValue = attrList[specificationName(ePedValue)].data<unsigned int>();
103 auto extBcidThreshold = attrList[specificationName(eExtBcidThreshold)].data<unsigned short>();
104 auto satBcidThreshLow = attrList[specificationName(eSatBcidThreshLow)].data<unsigned short>();
105 auto satBcidThreshHigh = attrList[specificationName(eSatBcidThreshHigh)].data<unsigned short>();
106 auto satBcidLevel = attrList[specificationName(eSatBcidLevel)].data<unsigned short>();
107 auto bcidEnergyRangeLow = attrList[specificationName(eBcidEnergyRangeLow)].data<unsigned short>();
108 auto bcidEnergyRangeHigh = attrList[specificationName(eBcidEnergyRangeHigh)].data<unsigned short>();
109 auto firStartBit = attrList[specificationName(eFirStartBit)].data<unsigned short>();
110 auto firCoeff1 = attrList[specificationName(eFirCoeff1)].data<short>();
111 auto firCoeff2 = attrList[specificationName(eFirCoeff2)].data<short>();
112 auto firCoeff3 = attrList[specificationName(eFirCoeff3)].data<short>();
113 auto firCoeff4 = attrList[specificationName(eFirCoeff4)].data<short>();
114 auto firCoeff5 = attrList[specificationName(eFirCoeff5)].data<short>();
115 auto lutStrategy = attrList[specificationName(eLutStrategy)].data<unsigned short>();
116 auto lutOffset = attrList[specificationName(eLutOffset)].data<unsigned short>();
117 auto lutNoiseCut = attrList[specificationName(eLutNoiseCut)].data<unsigned short>();
118 auto lutSlope = attrList[specificationName(eLutSlope)].data<unsigned short>();
119
120 addPprChanCalibV1(L1CaloPprChanCalibV1(chanNum, errorCode, pedMean, pedValue, extBcidThreshold, satBcidThreshLow, satBcidThreshHigh, satBcidLevel, bcidEnergyRangeLow, bcidEnergyRangeHigh, firStartBit, firCoeff1, firCoeff2, firCoeff3, firCoeff4, firCoeff5, lutStrategy, lutOffset, lutNoiseCut, lutSlope));
121 }
122}
void addPprChanCalibV1(const L1CaloPprChanCalibV1 &pprChanCalib)

◆ pprChanCalibV1() [1/2]

const L1CaloPprChanCalibV1 * L1CaloPprChanCalibV1Container::pprChanCalibV1 ( const L1CaloCoolChannelId & channelId) const
inline

Definition at line 45 of file L1CaloPprChanCalibV1Container.h.

45 {
46 return pprChanCalibV1(channelId.id());
47 }
const L1CaloPprChanCalibV1 * pprChanCalibV1(unsigned int channelId) const

◆ pprChanCalibV1() [2/2]

const L1CaloPprChanCalibV1 * L1CaloPprChanCalibV1Container::pprChanCalibV1 ( unsigned int channelId) const

Definition at line 124 of file L1CaloPprChanCalibV1Container.cxx.

125{
126 auto it = std::lower_bound(std::begin(m_pprChanCalibs),
127 std::end(m_pprChanCalibs),
128 channelId,
129 [](const L1CaloPprChanCalibV1& el, unsigned int val) -> bool {
130 return el.channelId() < val;
131 });
132 if(it == std::end(m_pprChanCalibs)) return nullptr;
133 return &(*it);
134}

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

Definition at line 58 of file L1CaloPprChanCalibV1Container.h.

◆ m_pprChanCalibs

std::vector<L1CaloPprChanCalibV1> L1CaloPprChanCalibV1Container::m_pprChanCalibs
private

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