ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloEnergyScanRunInfoContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "CoralBase/AttributeListSpecification.h"
9
10#include <string>
11#include <iostream>
12
14 AbstractL1CaloPersistentCondition("AthenaAttributeList"),
15 m_runNumber(0),
17{
18 // Define DB rows names and types in order to construct the AttributeListSpecification object
19 this->addSpecification(eRunNumber, std::string("RunNumber"), std::string("unsigned int"));
20 this->addSpecification(eGainStrategy,std::string("GainStrategy"),std::string("string"));
21
22 m_mCoolFoldersKeysMap[L1CaloEnergyScanRunInfoContainer::eEnergyScanRunInfo] = std::string("/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo");
23}
24
25L1CaloEnergyScanRunInfoContainer::L1CaloEnergyScanRunInfoContainer(const std::map<L1CaloEnergyScanRunInfoContainer::eCoolFolders, std::string>& folderKeysMap) :
26 AbstractL1CaloPersistentCondition("AthenaAttributeList"),
27 m_mCoolFoldersKeysMap(folderKeysMap),
28 m_runNumber(0),
30{
31 // Define DB rows names and types in order to construct the AttributeListSpecification object
32 this->addSpecification(eRunNumber, std::string("RunNumber"), std::string("unsigned int"));
33 this->addSpecification(eGainStrategy,std::string("GainStrategy"),std::string("string"));
34}
35
37
38 std::map<L1CaloEnergyScanRunInfoContainer::eCoolFolders, std::string>::const_iterator it = m_mCoolFoldersKeysMap.find(efolder);
39 if(it!=m_mCoolFoldersKeysMap.end()) {
40 return it->second;
41 } else {
42 return std::string("");
43 }
44}
45
46std::vector<std::string> L1CaloEnergyScanRunInfoContainer::coolInputKeys() const {
47 std::vector<std::string> v;
49 return v;
50}
51
55
57
58 // Create AttributeListSpecification according to the attributes to be recorded
59 // this is required to create the AttributeList objs
60 coral::AttributeListSpecification* attrSpecification = this->createAttributeListSpecification();
61 if(!attrSpecification->size()) return NULL;
62
63 AthenaAttributeList* attrList = new AthenaAttributeList(*attrSpecification);
64
65 (*attrList)[ this->specificationName(eRunNumber) ].setValue(m_runNumber);
66 (*attrList)[ this->specificationName(eGainStrategy) ].setValue(m_gainStrategy);
67
68 return attrList;
69}
70
71void L1CaloEnergyScanRunInfoContainer::makeTransient(const std::map<std::string, AthenaAttributeList*>& athenaAttributeListMap) {
72
73 std::map<std::string, AthenaAttributeList*>::const_iterator
74 it_map(athenaAttributeListMap.find(this->coolFolderKey(L1CaloEnergyScanRunInfoContainer::eEnergyScanRunInfo)));
75
76 if(it_map!=athenaAttributeListMap.end()) {
77
78 const AthenaAttributeList& attrList(*(it_map->second));
79
80 m_runNumber = attrList[ this->specificationName(eRunNumber) ].data<unsigned int>();
81 m_gainStrategy = attrList[ this->specificationName(eGainStrategy) ].data<std::string>();
82
83 } else {
84 std::cout << "L1CaloEnergyScanRunInfoContainer : Could not find requested AthenaAttributeList "
86 }
87}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)
coral::AttributeListSpecification * createAttributeListSpecification() const
An AttributeList represents a logical row of attributes in a metadata table.
std::string coolFolderKey(L1CaloEnergyScanRunInfoContainer::eCoolFolders efolder) const
virtual std::vector< std::string > coolInputKeys() const
virtual void makeTransient(const std::map< std::string, AthenaAttributeList * > &athenaAttributeListMap)
std::map< L1CaloEnergyScanRunInfoContainer::eCoolFolders, std::string > m_mCoolFoldersKeysMap