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

Container of L1CaloEnergyScanResults objects, inherit from the abstract base class AbstractL1CaloConditionContainer. More...

#include <L1CaloEnergyScanResultsContainer.h>

Inheritance diagram for L1CaloEnergyScanResultsContainer:
Collaboration diagram for L1CaloEnergyScanResultsContainer:

Public Types

enum  eCoolFolders { eEnergyScanResults }
typedef std::map< unsigned int, L1CaloEnergyScanResultsL1CaloEnergyScanResultsMap
typedef L1CaloEnergyScanResultsMap::const_iterator const_iterator

Public Member Functions

 L1CaloEnergyScanResultsContainer ()
 L1CaloEnergyScanResultsContainer (const std::map< L1CaloEnergyScanResultsContainer::eCoolFolders, std::string > &folderKeysMap)
virtual ~L1CaloEnergyScanResultsContainer ()
virtual DataObject * makePersistent () const
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)
const L1CaloEnergyScanResultsenergyScanResults (unsigned int channelId) const
const L1CaloEnergyScanResultsenergyScanResults (const L1CaloCoolChannelId &channelId) const
void addEnergyScanResults (unsigned int channelId, const L1CaloEnergyScanResults &energyScanResults)
void addEnergyScanResults (const L1CaloCoolChannelId &channelId, const L1CaloEnergyScanResults &energyScanResults)
const_iterator begin () const
const_iterator end () const
virtual std::vector< std::string > coolInputKeys () const
virtual std::string coolOutputKey () const
virtual void clear ()
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 {
  eOffset , eSlope , eChi2 , eNdf ,
  eBlob , eBlobStrategy , eErrorCode
}
typedef std::map< int, std::string > AttrSpecificationMap

Private Member Functions

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

Private Attributes

L1CaloEnergyScanResultsMap m_mEnergyScanResultsMap
std::map< L1CaloEnergyScanResultsContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap
AttrSpecificationMap m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationTypeMap
std::string m_strConditionType

Detailed Description

Container of L1CaloEnergyScanResults objects, inherit from the abstract base class AbstractL1CaloConditionContainer.

Implement the IL1CaloPersistenceCapable interface.

Copied from L1CaloPprLutContainer and modified.

Author
Veit Scharf veit..nosp@m.scha.nosp@m.rf@ki.nosp@m.p.un.nosp@m.i-hei.nosp@m.delb.nosp@m.erg.d.nosp@m.e

Definition at line 26 of file L1CaloEnergyScanResultsContainer.h.

Member Typedef Documentation

◆ AttrSpecificationMap

typedef std::map<int, std::string> AbstractL1CaloPersistentCondition::AttrSpecificationMap
privateinherited

Definition at line 50 of file AbstractL1CaloPersistentCondition.h.

◆ const_iterator

typedef L1CaloEnergyScanResultsMap::const_iterator L1CaloEnergyScanResultsContainer::const_iterator

Definition at line 35 of file L1CaloEnergyScanResultsContainer.h.

◆ L1CaloEnergyScanResultsMap

Member Enumeration Documentation

◆ eAttrSpecification

◆ eCoolFolders

Constructor & Destructor Documentation

◆ L1CaloEnergyScanResultsContainer() [1/2]

L1CaloEnergyScanResultsContainer::L1CaloEnergyScanResultsContainer ( )

Definition at line 16 of file L1CaloEnergyScanResultsContainer.cxx.

16 :AbstractL1CaloPersistentCondition("CondAttrListCollection") {
17 // Define DB rows names and types in order to construct the AttributeListSpecification object
18 this->addSpecification(eOffset, std::string("Offset"), std::string("double"));
19 this->addSpecification(eSlope, std::string("Slope"), std::string("double"));
20 this->addSpecification(eChi2, std::string("Chi2"), std::string("double"));
21 this->addSpecification(eNdf, std::string("Ndf"), std::string("unsigned char"));
22 this->addSpecification(eBlob, std::string("Blob"), std::string("blob"));
23 this->addSpecification(eBlobStrategy,std::string("BlobStrategy"),std::string("unsigned char"));
24 this->addSpecification(eErrorCode, std::string("ErrorCode"), std::string("unsigned int"));
25
26 m_mCoolFoldersKeysMap[L1CaloEnergyScanResultsContainer::eEnergyScanResults] = std::string("/TRIGGER/L1Calo/V1/Results/EnergyScanResults");
27}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)
std::map< L1CaloEnergyScanResultsContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap

◆ L1CaloEnergyScanResultsContainer() [2/2]

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

Definition at line 29 of file L1CaloEnergyScanResultsContainer.cxx.

29 :
30 AbstractL1CaloPersistentCondition("CondAttrListCollection"),
31 m_mCoolFoldersKeysMap(folderKeysMap)
32{
33 // Define DB rows names and types in order to construct the AttributeListSpecification object
34 this->addSpecification(eOffset, std::string("Offset"), std::string("double"));
35 this->addSpecification(eSlope, std::string("Slope"), std::string("double"));
36 this->addSpecification(eChi2, std::string("Chi2"), std::string("double"));
37 this->addSpecification(eNdf, std::string("Ndf"), std::string("unsigned char"));
38 this->addSpecification(eBlob, std::string("Blob"), std::string("blob"));
39 this->addSpecification(eBlobStrategy,std::string("BlobStrategy"),std::string("unsigned char"));
40 this->addSpecification(eErrorCode, std::string("ErrorCode"), std::string("unsigned int"));
41}

◆ ~L1CaloEnergyScanResultsContainer()

virtual L1CaloEnergyScanResultsContainer::~L1CaloEnergyScanResultsContainer ( )
inlinevirtual

Definition at line 41 of file L1CaloEnergyScanResultsContainer.h.

41{};

Member Function Documentation

◆ addEnergyScanResults() [1/2]

void L1CaloEnergyScanResultsContainer::addEnergyScanResults ( const L1CaloCoolChannelId & channelId,
const L1CaloEnergyScanResults & energyScanResults )

Definition at line 148 of file L1CaloEnergyScanResultsContainer.cxx.

148 {
150}
void addEnergyScanResults(unsigned int channelId, const L1CaloEnergyScanResults &energyScanResults)
const L1CaloEnergyScanResults * energyScanResults(unsigned int channelId) const

◆ addEnergyScanResults() [2/2]

void L1CaloEnergyScanResultsContainer::addEnergyScanResults ( unsigned int channelId,
const L1CaloEnergyScanResults & energyScanResults )

◆ 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 L1CaloEnergyScanResultsContainer::begin ( ) const
inline

Definition at line 56 of file L1CaloEnergyScanResultsContainer.h.

56{ return m_mEnergyScanResultsMap.begin(); };

◆ clear()

void L1CaloEnergyScanResultsContainer::clear ( )
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 152 of file L1CaloEnergyScanResultsContainer.cxx.

152 {
154}

◆ conditionType()

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

◆ coolFolderKey()

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

Definition at line 43 of file L1CaloEnergyScanResultsContainer.cxx.

43 {
44
45 std::map<L1CaloEnergyScanResultsContainer::eCoolFolders, std::string>::const_iterator it = m_mCoolFoldersKeysMap.find(efolder);
46 if(it!=m_mCoolFoldersKeysMap.end()) {
47 return it->second;
48 } else {
49 return std::string("");
50 }
51}

◆ coolInputKeys()

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

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 53 of file L1CaloEnergyScanResultsContainer.cxx.

53 {
54 std::vector<std::string> v;
56 return v;
57}
std::string coolFolderKey(L1CaloEnergyScanResultsContainer::eCoolFolders efolder) const

◆ coolOutputKey()

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

◆ 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 L1CaloEnergyScanResultsContainer::end ( ) const
inline

Definition at line 57 of file L1CaloEnergyScanResultsContainer.h.

57{ return m_mEnergyScanResultsMap.end(); };

◆ energyScanResults() [1/2]

const L1CaloEnergyScanResults * L1CaloEnergyScanResultsContainer::energyScanResults ( const L1CaloCoolChannelId & channelId) const

Definition at line 140 of file L1CaloEnergyScanResultsContainer.cxx.

140 {
141 return this->energyScanResults(channelId.id());
142}

◆ energyScanResults() [2/2]

const L1CaloEnergyScanResults * L1CaloEnergyScanResultsContainer::energyScanResults ( unsigned int channelId) const

Definition at line 134 of file L1CaloEnergyScanResultsContainer.cxx.

134 {
135 L1CaloEnergyScanResultsMap::const_iterator pos = m_mEnergyScanResultsMap.find(channelId);
136 if(pos==m_mEnergyScanResultsMap.end()) return 0;
137 else return &(pos->second);
138}

◆ makePersistent()

DataObject * L1CaloEnergyScanResultsContainer::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 63 of file L1CaloEnergyScanResultsContainer.cxx.

63 {
64 if(m_mEnergyScanResultsMap.size()==0) return 0;
65
66 // Create AttributeListSpecification according to the attributes to be recorded
67 // this is required to create the AttributeList objs
68 coral::AttributeListSpecification* attrSpecification = this->createAttributeListSpecification();
69 if(!attrSpecification->size()) return NULL;
70
71 CondAttrListCollection* attrListCollection = new CondAttrListCollection(true);
72
73 L1CaloEnergyScanResultsMap::const_iterator pos = m_mEnergyScanResultsMap.begin();
74 L1CaloEnergyScanResultsMap::const_iterator end = m_mEnergyScanResultsMap.end();
75 for(; pos!=end; ++pos) {
76 const unsigned int channelId = pos->first;
77 const L1CaloEnergyScanResults& p = pos->second;
78
79 AthenaAttributeList attrList(*attrSpecification);
80
81 // Set value of each row for the current channel
82 attrList[ this->specificationName(eOffset) ].setValue(p.offset());
83 attrList[ this->specificationName(eSlope) ].setValue(p.slope());
84 attrList[ this->specificationName(eChi2) ].setValue(p.chi2());
85 attrList[ this->specificationName(eNdf) ].setValue(p.ndf());
86 attrList[ this->specificationName(eBlob) ].setValue(p.blob());
87 attrList[ this->specificationName(eBlobStrategy) ].setValue(p.blobStrategy());
88 attrList[ this->specificationName(eErrorCode) ].setValue(p.errorCode().errorCode());
89
90 attrListCollection->add(channelId, attrList);
91 }
92
93 return attrListCollection;
94}
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 L1CaloEnergyScanResultsContainer::makeTransient ( const std::map< std::string, const CondAttrListCollection * > & condAttrListCollectionMap)
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 96 of file L1CaloEnergyScanResultsContainer.cxx.

96 {
97
98 this->clear();
99
100 std::map<std::string, const CondAttrListCollection*>::const_iterator
101 it_map(condAttrListCollectionMap.find(this->coolFolderKey(L1CaloEnergyScanResultsContainer::eEnergyScanResults)));
102
103 if(it_map!=condAttrListCollectionMap.end()) {
104
105 const CondAttrListCollection* attrListCollection = it_map->second;
106
107 //loop over CondAttrListCollection
108 CondAttrListCollection::const_iterator pos = attrListCollection->begin();
109 CondAttrListCollection::const_iterator end = attrListCollection->begin();
110 for(; pos!= end; ++pos) {
111
112 const coral::AttributeList& attrList = pos->second;
113
114 // Get value of each row for the current channel
116
117 double offset = attrList[ this->specificationName(eOffset) ].data<double>();
118 double slope = attrList[ this->specificationName(eSlope) ].data<double>();
119 double chi2 = attrList[ this->specificationName(eChi2) ].data<double>();
120 unsigned char ndf = attrList[ this->specificationName(eNdf) ].data<unsigned char>();
121 coral::Blob blob = attrList[ this->specificationName(eBlob) ].data<coral::Blob>();
122 unsigned char blobStrategy = attrList[ this->specificationName(eBlobStrategy) ].data<unsigned char>();
123 ChanFitErrorCode errorCode(attrList[ this->specificationName(eErrorCode) ].data<unsigned int>());
124
125 L1CaloEnergyScanResults l1CaloEnergyScanResults(chanNum, offset, slope, chi2, ndf, blob, blobStrategy, errorCode);
126 m_mEnergyScanResultsMap[chanNum] = l1CaloEnergyScanResults;
127 }
128 } else {
129 std::cout << "L1CaloEnergyScanResultsContainer : Could not find requested CondAttrListCollection "
131 }
132}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
double chi2(TH1 *h0, TH1 *h1)

◆ 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<L1CaloEnergyScanResultsContainer::eCoolFolders, std::string> L1CaloEnergyScanResultsContainer::m_mCoolFoldersKeysMap
private

Definition at line 68 of file L1CaloEnergyScanResultsContainer.h.

◆ m_mEnergyScanResultsMap

L1CaloEnergyScanResultsMap L1CaloEnergyScanResultsContainer::m_mEnergyScanResultsMap
private

Definition at line 67 of file L1CaloEnergyScanResultsContainer.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: