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

#include <L1CaloPpmDeadChannelsContainer.h>

Inheritance diagram for L1CaloPpmDeadChannelsContainer:
Collaboration diagram for L1CaloPpmDeadChannelsContainer:

Public Types

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

Public Member Functions

 L1CaloPpmDeadChannelsContainer ()
 L1CaloPpmDeadChannelsContainer (const std::string &folderKey)
virtual ~L1CaloPpmDeadChannelsContainer ()
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 L1CaloPpmDeadChannelsppmDeadChannels (unsigned int channelId) const
const L1CaloPpmDeadChannelsppmDeadChannels (const L1CaloCoolChannelId &channelId) const
const_iterator begin () const
const_iterator end () const
void addPpmDeadChannels (const L1CaloPpmDeadChannels &ppmDeadChannels)
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 , eNoiseCut }
typedef std::map< int, std::string > AttrSpecificationMap

Private Attributes

std::vector< L1CaloPpmDeadChannelsm_ppmDeadChannelss
std::string m_coolFolderKey = "/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"
AttrSpecificationMap m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationTypeMap
std::string m_strConditionType

Detailed Description

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

◆ L1CaloPpmDeadChannelsContainer() [1/2]

L1CaloPpmDeadChannelsContainer::L1CaloPpmDeadChannelsContainer ( )

Definition at line 16 of file L1CaloPpmDeadChannelsContainer.cxx.

17 : AbstractL1CaloPersistentCondition("CondAttrListCollection")
18{
19 this->addSpecification(eErrorCode, "ErrorCode", "unsigned int");
20 this->addSpecification(eNoiseCut, "NoiseCut", "unsigned int");
21}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)

◆ L1CaloPpmDeadChannelsContainer() [2/2]

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

Definition at line 23 of file L1CaloPpmDeadChannelsContainer.cxx.

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

◆ ~L1CaloPpmDeadChannelsContainer()

virtual L1CaloPpmDeadChannelsContainer::~L1CaloPpmDeadChannelsContainer ( )
inlinevirtual

Definition at line 33 of file L1CaloPpmDeadChannelsContainer.h.

33{}

Member Function Documentation

◆ addPpmDeadChannels()

void L1CaloPpmDeadChannelsContainer::addPpmDeadChannels ( const L1CaloPpmDeadChannels & ppmDeadChannels)

Definition at line 84 of file L1CaloPpmDeadChannelsContainer.cxx.

85{
86 // insert into the correct position mainting the sorted vector
87 m_ppmDeadChannelss.insert(std::lower_bound(std::begin(m_ppmDeadChannelss),
88 std::end(m_ppmDeadChannelss),
89 ppmDeadChannels.channelId(),
90 [](const L1CaloPpmDeadChannels& el, unsigned int va) -> bool {
91 return el.channelId() < va;
92 }),
94}
std::vector< L1CaloPpmDeadChannels > m_ppmDeadChannelss
const L1CaloPpmDeadChannels * ppmDeadChannels(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 L1CaloPpmDeadChannelsContainer::begin ( ) const
inline

Definition at line 50 of file L1CaloPpmDeadChannelsContainer.h.

50{ return m_ppmDeadChannelss.begin(); }

◆ clear()

virtual void L1CaloPpmDeadChannelsContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 41 of file L1CaloPpmDeadChannelsContainer.h.

41{ m_ppmDeadChannelss.clear(); }

◆ conditionType()

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

◆ coolInputKeys()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 39 of file L1CaloPpmDeadChannelsContainer.h.

39{ return {m_coolFolderKey}; }

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

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

Definition at line 51 of file L1CaloPpmDeadChannelsContainer.h.

51{ return m_ppmDeadChannelss.end(); }

◆ makePersistent()

DataObject * L1CaloPpmDeadChannelsContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 31 of file L1CaloPpmDeadChannelsContainer.cxx.

32{
33 using std::make_unique;
34
35 if(m_coolFolderKey.empty()) return nullptr;
36
37 auto* attrSpecification = this->createAttributeListSpecification();
38 if(!attrSpecification || !attrSpecification->size()) return nullptr;
39
40 auto attrListCollection = make_unique<CondAttrListCollection>(true);
41 for(const auto& item : m_ppmDeadChannelss) {
42 AthenaAttributeList attrList(*attrSpecification);
43 attrList[specificationName(eErrorCode)].setValue(item.errorCode());
44 attrList[specificationName(eNoiseCut)].setValue(item.noiseCut());
45
46 attrListCollection->add(item.channelId(), attrList);
47 }
48 return static_cast<DataObject*>(attrListCollection.release());
49}
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 L1CaloPpmDeadChannelsContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > & condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 51 of file L1CaloPpmDeadChannelsContainer.cxx.

52{
53 clear();
54
55 // In the case of overlay, we need multiple instances of L1CaloPpmDeadChannelsContainer
56 // Take the last element in the map
57 if (condAttrListCollectionMap.empty()) return;
58 auto it = condAttrListCollectionMap.rbegin();
59
60 auto attrListCollection = it->second;
61 for(const auto& item : *attrListCollection) {
62 auto chanNum = item.first;
63 const auto& attrList = item.second;
64
65 auto errorCode = attrList[specificationName(eErrorCode)].data<unsigned int>();
66 auto noiseCut = attrList[specificationName(eNoiseCut)].data<unsigned int>();
67
68 addPpmDeadChannels(L1CaloPpmDeadChannels(chanNum, errorCode, noiseCut));
69 }
70}
void addPpmDeadChannels(const L1CaloPpmDeadChannels &ppmDeadChannels)

◆ ppmDeadChannels() [1/2]

const L1CaloPpmDeadChannels * L1CaloPpmDeadChannelsContainer::ppmDeadChannels ( const L1CaloCoolChannelId & channelId) const
inline

◆ ppmDeadChannels() [2/2]

const L1CaloPpmDeadChannels * L1CaloPpmDeadChannelsContainer::ppmDeadChannels ( unsigned int channelId) const

Definition at line 72 of file L1CaloPpmDeadChannelsContainer.cxx.

73{
74 auto it = std::lower_bound(std::begin(m_ppmDeadChannelss),
75 std::end(m_ppmDeadChannelss),
76 channelId,
77 [](const L1CaloPpmDeadChannels& el, unsigned int val) -> bool {
78 return el.channelId() < val;
79 });
80 if(it == std::end(m_ppmDeadChannelss)) return nullptr;
81 return &(*it);
82}

◆ 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 L1CaloPpmDeadChannelsContainer::m_coolFolderKey = "/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"
private

Definition at line 58 of file L1CaloPpmDeadChannelsContainer.h.

◆ m_ppmDeadChannelss

std::vector<L1CaloPpmDeadChannels> L1CaloPpmDeadChannelsContainer::m_ppmDeadChannelss
private

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