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

#include <L1CaloRxGainContainer.h>

Inheritance diagram for L1CaloRxGainContainer:
Collaboration diagram for L1CaloRxGainContainer:

Public Types

enum  eCoolFolders { eRxGainFolder }
typedef std::map< unsignedint, L1CaloRxGain >::const_iterator const_iterator

Public Member Functions

 L1CaloRxGainContainer ()
 L1CaloRxGainContainer (const std::map< L1CaloRxGainContainer::eCoolFolders, std::string > &folderKeysMap)
virtual ~L1CaloRxGainContainer ()
virtual DataObject * makePersistent () const
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)
const L1CaloRxGainrxGain (unsigned int channelId) const
const L1CaloRxGainrxGain (const L1CaloRxCoolChannelId &channelId) const
void addRxGain (unsigned int channelId, const L1CaloRxGain &rxGain)
void addRxGain (const L1CaloRxCoolChannelId &channelId, const L1CaloRxGain &rxGain)
L1CaloRxGainMap::const_iterator begin () const
L1CaloRxGainMap::const_iterator end () const
virtual std::vector< std::string > coolInputKeys () const
virtual std::string coolOutputKey () const
virtual void clear ()
void dump () const
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 {
  eIdentifier , eCrate , eSlot , eChannel ,
  eGain , eComment
}
typedef std::map< int, std::string > AttrSpecificationMap

Private Member Functions

std::string coolFolderKey (L1CaloRxGainContainer::eCoolFolders efolder) const

Private Attributes

L1CaloRxGainMap m_mRxGainMap
std::map< L1CaloRxGainContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap
AttrSpecificationMap m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationTypeMap
std::string m_strConditionType

Detailed Description

Definition at line 27 of file L1CaloRxGainContainer.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 35 of file L1CaloRxGainContainer.h.

Member Enumeration Documentation

◆ eAttrSpecification

◆ eCoolFolders

Enumerator
eRxGainFolder 

Definition at line 33 of file L1CaloRxGainContainer.h.

Constructor & Destructor Documentation

◆ L1CaloRxGainContainer() [1/2]

L1CaloRxGainContainer::L1CaloRxGainContainer ( )

Definition at line 15 of file L1CaloRxGainContainer.cxx.

15 :AbstractL1CaloPersistentCondition("CondAttrListCollection") {
16 // Define DB rows names and types in order to construct the AttributeListSpecification object
17 //this->addSpecification(eIdentifier, std::string("Identifier"), std::string("unsigned int"));
18 //this->addSpecification(eCrate, std::string("RecCrate"), std::string("string"));
19 //this->addSpecification(eSlot, std::string("RecSlot"), std::string("unsigned int"));
20 //this->addSpecification(eChannel, std::string("RecChannel"), std::string("unsigned int"));
21 this->addSpecification(eGain, std::string("gains"), std::string("int"));
22 this->addSpecification(eComment, std::string("Comment"), std::string("string"));
23
24 m_mCoolFoldersKeysMap[L1CaloRxGainContainer::eRxGainFolder] = std::string("/receivers/Gains");
25}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)
std::map< L1CaloRxGainContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap

◆ L1CaloRxGainContainer() [2/2]

L1CaloRxGainContainer::L1CaloRxGainContainer ( const std::map< L1CaloRxGainContainer::eCoolFolders, std::string > & folderKeysMap)

Definition at line 27 of file L1CaloRxGainContainer.cxx.

27 :AbstractL1CaloPersistentCondition("CondAttrListCollection"),
28 m_mCoolFoldersKeysMap(folderKeysMap)
29{
30 // Define DB rows names and types in order to construct the AttributeListSpecification object
31 //this->addSpecification(eIdentifier, std::string("Identifier"), std::string("unsigned int"));
32 //this->addSpecification(eCrate, std::string("RecCrate"), std::string("string"));
33 //this->addSpecification(eSlot, std::string("RecSlot"), std::string("unsigned int"));
34 //this->addSpecification(eChannel, std::string("RecChannel"), std::string("unsigned int"));
35 this->addSpecification(eGain, std::string("gains"), std::string("int"));
36 this->addSpecification(eComment, std::string("Comment"), std::string("string"));
37}

◆ ~L1CaloRxGainContainer()

virtual L1CaloRxGainContainer::~L1CaloRxGainContainer ( )
inlinevirtual

Definition at line 39 of file L1CaloRxGainContainer.h.

39{};

Member Function Documentation

◆ addRxGain() [1/2]

void L1CaloRxGainContainer::addRxGain ( const L1CaloRxCoolChannelId & channelId,
const L1CaloRxGain & rxGain )

Definition at line 142 of file L1CaloRxGainContainer.cxx.

142 {
143 return this->addRxGain(channelId.id(), pprLut);
144}
void addRxGain(unsigned int channelId, const L1CaloRxGain &rxGain)

◆ addRxGain() [2/2]

void L1CaloRxGainContainer::addRxGain ( unsigned int channelId,
const L1CaloRxGain & rxGain )

Definition at line 138 of file L1CaloRxGainContainer.cxx.

138 {
139 m_mRxGainMap[channelId] = pprLut;
140}

◆ 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()

L1CaloRxGainMap::const_iterator L1CaloRxGainContainer::begin ( ) const
inline

Definition at line 51 of file L1CaloRxGainContainer.h.

51{ return m_mRxGainMap.begin(); };

◆ clear()

void L1CaloRxGainContainer::clear ( )
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 153 of file L1CaloRxGainContainer.cxx.

153 {
154 m_mRxGainMap.clear();
155}

◆ conditionType()

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

◆ coolFolderKey()

std::string L1CaloRxGainContainer::coolFolderKey ( L1CaloRxGainContainer::eCoolFolders efolder) const
private

Definition at line 39 of file L1CaloRxGainContainer.cxx.

39 {
40
41 std::map<L1CaloRxGainContainer::eCoolFolders, std::string>::const_iterator it = m_mCoolFoldersKeysMap.find(efolder);
42 if(it!=m_mCoolFoldersKeysMap.end()) {
43 return it->second;
44 } else {
45 return std::string("");
46 }
47}

◆ coolInputKeys()

std::vector< std::string > L1CaloRxGainContainer::coolInputKeys ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 49 of file L1CaloRxGainContainer.cxx.

49 {
50 std::vector<std::string> v;
52 return v;
53}
std::string coolFolderKey(L1CaloRxGainContainer::eCoolFolders efolder) const

◆ coolOutputKey()

std::string L1CaloRxGainContainer::coolOutputKey ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 55 of file L1CaloRxGainContainer.cxx.

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

◆ dump()

void L1CaloRxGainContainer::dump ( ) const

Definition at line 146 of file L1CaloRxGainContainer.cxx.

146 {
148 for(;it!=this->end();++it) {
149 std::cout << " * item: " <<it->first << " => "<<it->second <<std::endl;
150 }
151}
L1CaloRxGainMap::const_iterator begin() const
L1CaloRxGainMap::const_iterator end() const
std::map< unsignedint, L1CaloRxGain >::const_iterator const_iterator

◆ end()

L1CaloRxGainMap::const_iterator L1CaloRxGainContainer::end ( ) const
inline

Definition at line 52 of file L1CaloRxGainContainer.h.

52{ return m_mRxGainMap.end(); };

◆ makePersistent()

DataObject * L1CaloRxGainContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 59 of file L1CaloRxGainContainer.cxx.

59 {
60 if(m_mRxGainMap.size()==0) return 0;
61
62 // Create AttributeListSpecification according to the attributes to be recorded
63 // this is required to create the AttributeList objs
64 coral::AttributeListSpecification* attrSpecification = this->createAttributeListSpecification();
65 if(!attrSpecification->size()) return 0;
66
67
68 CondAttrListCollection* attrListCollection = new CondAttrListCollection(true);
69
70 L1CaloRxGainMap::const_iterator pos = m_mRxGainMap.begin();
71 for(;pos!=m_mRxGainMap.end();++pos) {
72 const unsigned int channelId = pos->first;
73 const L1CaloRxGain& p = pos->second;
74
75 AthenaAttributeList attrList(*attrSpecification);
76
77 //attrList[ this->specificationName(eIdentifier) ].setValue(p->identifier());
78 //attrList[ this->specificationName(eCrate) ].setValue(p->crate());
79 //attrList[ this->specificationName(eSlot) ].setValue(p->slot());
80 //attrList[ this->specificationName(eChannel) ].setValue(p->channel());
81 attrList[ this->specificationName(eGain) ].setValue(p.gain());
82 attrList[ this->specificationName(eComment) ].setValue(p.comment());
83
84 // add AttributeList corresponding to channel iChanNumber to the CondAttrListCollection
85 attrListCollection->add(channelId, attrList);
86 }
87
88 return attrListCollection;
89}
coral::AttributeListSpecification * createAttributeListSpecification() const
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.

◆ 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 L1CaloRxGainContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > & condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 91 of file L1CaloRxGainContainer.cxx.

91 {
92
93 this->clear();
94
95 std::map<std::string, const CondAttrListCollection*>::const_iterator it_map;
96
97 it_map = condAttrListCollectionMap.find(this->coolFolderKey(L1CaloRxGainContainer::eRxGainFolder));
98 if(it_map!=condAttrListCollectionMap.end()) {
99
100 const CondAttrListCollection* attrListCollection = it_map->second;
101
102 //loop over CondAttrListCollection
103 CondAttrListCollection::const_iterator it = attrListCollection->begin();
104 for(;it!=attrListCollection->end();++it) {
105
106 const coral::AttributeList& attrList = it->second;
107
108 // Get value of each row for the current channel
110
111 //unsigned int identifier = attrList[ this->specificationName(eIdentifier) ].data<unsigned int>();
112 //std::string crate = attrList[ this->specificationName(eCrate) ].data<std::string>();
113 //unsigned int slot = attrList[ this->specificationName(eSlot) ].data<unsigned int>();
114 //unsigned int channel = attrList[ this->specificationName(eChannel) ].data<unsigned int>();
115 unsigned int gain = attrList[ this->specificationName(eGain) ].data<int>();
116 std::string comment = attrList[ this->specificationName(eComment) ].data<std::string>();
117
118 // Create transient L1CaloPedestal obj
119 //L1CaloRxGain* p = new L1CaloRxGain( chanNum, identifier, crate, slot, channel, gain, comment);
120 L1CaloRxGain l1caloRxGain(chanNum, gain, comment);
121 m_mRxGainMap[chanNum] = l1caloRxGain;
122 }
123 } else {
124 std::cout<<"L1CaloRxGainContainer : Could not find requested CondAttrListCollection "<< this->coolFolderKey(L1CaloRxGainContainer::eRxGainFolder) << std::endl;
125 }
126}
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator

◆ rxGain() [1/2]

const L1CaloRxGain * L1CaloRxGainContainer::rxGain ( const L1CaloRxCoolChannelId & channelId) const

Definition at line 134 of file L1CaloRxGainContainer.cxx.

134 {
135 return this->rxGain(channelId.id());
136}
const L1CaloRxGain * rxGain(unsigned int channelId) const

◆ rxGain() [2/2]

const L1CaloRxGain * L1CaloRxGainContainer::rxGain ( unsigned int channelId) const

Definition at line 128 of file L1CaloRxGainContainer.cxx.

128 {
129 L1CaloRxGainMap::const_iterator pos = m_mRxGainMap.find(channelId);
130 if(pos==m_mRxGainMap.end()) return 0;
131 else return &(pos->second);
132}

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

std::map<L1CaloRxGainContainer::eCoolFolders, std::string> L1CaloRxGainContainer::m_mCoolFoldersKeysMap
private

Definition at line 66 of file L1CaloRxGainContainer.h.

◆ m_mRxGainMap

L1CaloRxGainMap L1CaloRxGainContainer::m_mRxGainMap
private

Definition at line 65 of file L1CaloRxGainContainer.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: