ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
L1CaloRxGainContainer Class Reference

#include <L1CaloRxGainContainer.h>

Inheritance diagram for L1CaloRxGainContainer:
Collaboration diagram for L1CaloRxGainContainer:

Public Types

enum  eCoolFolders { eRxGainFolder }
 
typedef std::map< unsigned int, 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 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 {
  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

Enumerator
eIdentifier 
eCrate 
eSlot 
eChannel 
eGain 
eComment 

Definition at line 30 of file L1CaloRxGainContainer.h.

◆ eCoolFolders

Enumerator
eRxGainFolder 

Definition at line 33 of file L1CaloRxGainContainer.h.

33 { eRxGainFolder };

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 }

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

◆ 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

Implements IL1CaloPersistenceCapable.

Definition at line 37 of file AbstractL1CaloPersistentCondition.h.

37 { return m_strConditionType; };

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

◆ coolOutputKey()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 55 of file L1CaloRxGainContainer.cxx.

55  {
57 }

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

◆ 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 (DataObject*) attrListCollection;
89 }

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

◆ makeTransient() [4/4]

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 }

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

◆ 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:
L1CaloRxGainContainer::rxGain
const L1CaloRxGain * rxGain(unsigned int channelId) const
Definition: L1CaloRxGainContainer.cxx:128
CondAttrListCollection::end
const_iterator end() const
Definition: CondAttrListCollection.h:315
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
L1CaloRxGainContainer::clear
virtual void clear()
Definition: L1CaloRxGainContainer.cxx:153
skel.it
it
Definition: skel.GENtoEVGEN.py:423
L1CaloRxCoolChannelId::id
unsigned int id() const
Definition: L1CaloRxCoolChannelId.h:27
AbstractL1CaloPersistentCondition::addSpecification
void addSpecification(int specId, const std::string &specName, const std::string &specType)
Definition: AbstractL1CaloPersistentCondition.cxx:26
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition: CondAttrListCollection.h:309
L1CaloRxGainContainer::eGain
@ eGain
Definition: L1CaloRxGainContainer.h:30
L1CaloRxGain::gain
int gain(void) const
Definition: L1CaloRxGain.h:44
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
L1CaloRxGainContainer::eSlot
@ eSlot
Definition: L1CaloRxGainContainer.h:30
L1CaloRxGainContainer::eComment
@ eComment
Definition: L1CaloRxGainContainer.h:30
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
AbstractL1CaloPersistentCondition::AbstractL1CaloPersistentCondition
AbstractL1CaloPersistentCondition(const std::string &condType)
Definition: AbstractL1CaloPersistentCondition.h:45
L1CaloRxGainContainer::end
L1CaloRxGainMap::const_iterator end() const
Definition: L1CaloRxGainContainer.h:52
L1CaloRxGainContainer::coolFolderKey
std::string coolFolderKey(L1CaloRxGainContainer::eCoolFolders efolder) const
Definition: L1CaloRxGainContainer.cxx:39
AbstractL1CaloPersistentCondition::m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationNameMap
Definition: AbstractL1CaloPersistentCondition.h:51
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
L1CaloRxGainContainer::eIdentifier
@ eIdentifier
Definition: L1CaloRxGainContainer.h:30
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
CondAttrListCollection::ChanNum
unsigned int ChanNum
Definition: CondAttrListCollection.h:55
L1CaloRxGainContainer::const_iterator
std::map< unsigned int, L1CaloRxGain >::const_iterator const_iterator
Definition: L1CaloRxGainContainer.h:35
L1CaloRxGainContainer::eChannel
@ eChannel
Definition: L1CaloRxGainContainer.h:30
CaloCondBlobAlgs_fillNoiseFromASCII.comment
string comment
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:27
L1CaloRxGainContainer::eRxGainFolder
@ eRxGainFolder
Definition: L1CaloRxGainContainer.h:33
L1CaloRxGainContainer::eCrate
@ eCrate
Definition: L1CaloRxGainContainer.h:30
AbstractL1CaloPersistentCondition::specificationName
std::string specificationName(int specId) const
Definition: AbstractL1CaloPersistentCondition.cxx:44
L1CaloRxGainContainer::addRxGain
void addRxGain(unsigned int channelId, const L1CaloRxGain &rxGain)
Definition: L1CaloRxGainContainer.cxx:138
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:157
L1CaloRxGain
Transient conditions class for objects defined by the online framework and retrieved from COOL.
Definition: L1CaloRxGain.h:24
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
L1CaloRxGainContainer::m_mCoolFoldersKeysMap
std::map< L1CaloRxGainContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap
Definition: L1CaloRxGainContainer.h:66
L1CaloRxGain::comment
std::string comment(void) const
Definition: L1CaloRxGain.h:45
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53
CondAttrListCollection::add
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
Definition: CondAttrListCollection.h:452
L1CaloRxGainContainer::m_mRxGainMap
L1CaloRxGainMap m_mRxGainMap
Definition: L1CaloRxGainContainer.h:65
L1CaloRxGainContainer::begin
L1CaloRxGainMap::const_iterator begin() const
Definition: L1CaloRxGainContainer.h:51