ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
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 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 { 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

Definition at line 53 of file L1CaloPpmDeadChannelsContainer.h.

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
eErrorCode 
eNoiseCut 

Definition at line 33 of file L1CaloPpmDeadChannelsContainer.h.

33 {}

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 }

◆ 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 37 of file L1CaloPpmDeadChannelsContainer.h.

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),
90  [](const L1CaloPpmDeadChannels& el, unsigned int va) -> bool {
91  return el.channelId() < va;
92  }),
94 }

◆ 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 54 of file L1CaloPpmDeadChannelsContainer.h.

56 :
57  std::vector<L1CaloPpmDeadChannels> m_ppmDeadChannelss;

◆ clear()

virtual void L1CaloPpmDeadChannelsContainer::clear ( )
inlinevirtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 45 of file L1CaloPpmDeadChannelsContainer.h.

45 {

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 43 of file L1CaloPpmDeadChannelsContainer.h.

45 {

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 44 of file L1CaloPpmDeadChannelsContainer.h.

45 {

◆ 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 55 of file L1CaloPpmDeadChannelsContainer.h.

56 :
57  std::vector<L1CaloPpmDeadChannels> m_ppmDeadChannelss;

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

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

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

◆ ppmDeadChannels() [1/2]

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

Definition at line 49 of file L1CaloPpmDeadChannelsContainer.h.

50  { return m_ppmDeadChannelss.begin(); }
51  const_iterator end() const { return m_ppmDeadChannelss.end(); }

◆ 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),
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 62 of file L1CaloPpmDeadChannelsContainer.h.

◆ m_ppmDeadChannelss

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

Definition at line 61 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:
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
L1CaloPpmDeadChannels
Folder <-> Object mapping for /TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels .
Definition: L1CaloPpmDeadChannels.h:17
L1CaloPpmDeadChannelsContainer::m_coolFolderKey
std::string m_coolFolderKey
Definition: L1CaloPpmDeadChannelsContainer.h:62
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
L1CaloPpmDeadChannelsContainer::eErrorCode
@ eErrorCode
Definition: L1CaloPpmDeadChannelsContainer.h:37
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AbstractL1CaloPersistentCondition::addSpecification
void addSpecification(int specId, const std::string &specName, const std::string &specType)
Definition: AbstractL1CaloPersistentCondition.cxx:26
L1CaloPpmDeadChannelsContainer::m_ppmDeadChannelss
std::vector< L1CaloPpmDeadChannels > m_ppmDeadChannelss
Definition: L1CaloPpmDeadChannelsContainer.h:61
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
L1CaloPpmDeadChannelsContainer::ppmDeadChannels
const L1CaloPpmDeadChannels * ppmDeadChannels(unsigned int channelId) const
Definition: L1CaloPpmDeadChannelsContainer.cxx:72
L1CaloPpmDeadChannelsContainer::const_iterator
std::vector< L1CaloPpmDeadChannels >::const_iterator const_iterator
Definition: L1CaloPpmDeadChannelsContainer.h:53
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
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
L1CaloPpmDeadChannelsContainer::eNoiseCut
@ eNoiseCut
Definition: L1CaloPpmDeadChannelsContainer.h:37
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
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
L1CaloPpmDeadChannelsContainer::L1CaloPpmDeadChannelsContainer
L1CaloPpmDeadChannelsContainer()
Definition: L1CaloPpmDeadChannelsContainer.cxx:16
L1CaloPpmDeadChannelsContainer::addPpmDeadChannels
void addPpmDeadChannels(const L1CaloPpmDeadChannels &ppmDeadChannels)
Definition: L1CaloPpmDeadChannelsContainer.cxx:84
L1CaloPpmDeadChannels::channelId
unsigned int channelId() const
Definition: L1CaloPpmDeadChannels.h:22
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53
L1CaloPpmDeadChannelsContainer::end
const_iterator end() const
Definition: L1CaloPpmDeadChannelsContainer.h:55
L1CaloPpmDeadChannelsContainer::clear
virtual void clear()
Definition: L1CaloPpmDeadChannelsContainer.h:45