ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
L1CaloCondSvc Class Reference

L1CaloCondSvc class. More...

#include <L1CaloCondSvc.h>

Inheritance diagram for L1CaloCondSvc:
Collaboration diagram for L1CaloCondSvc:

Public Member Functions

 L1CaloCondSvc (const std::string &name, ISvcLocator *svc)
 
virtual ~L1CaloCondSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
template<typename T >
StatusCode store (const T *&pobj, const std::string &key, const std::string &folder, const std::string &tag) const
 To store a condition object into the COOL DB. More...
 
template<typename T >
StatusCode retrieve (T *&pobj, const std::string &key="")
 To retrieve a condition object from the COOL DB. More...
 
template<typename T , typename FolderMapping >
StatusCode retrieve (T *&pobj, const FolderMapping &folderKeyMap, const std::string &key="")
 To retrieve a condition object from the COOL DB with custom folder mapping. More...
 
virtual StatusCode updateConditions (IOVSVC_CALLBACK_ARGS)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Private Member Functions

template<typename T >
StatusCode retrieveImpl (T *&pobj, const std::string &key)
 
template<typename T >
StatusCode registerCondition (T *&pobj, const std::string &mykey="")
 

Private Attributes

ServiceHandle< StoreGateSvcm_detStore
 
ServiceHandle< IIOVRegistrationSvcm_regSvc
 
std::string m_streamName
 
bool m_bWriteNewChannels
 
unsigned int m_iovBeginRun
 
unsigned int m_iovEndRun
 
unsigned int m_iovBeginLB
 
unsigned int m_iovEndLB
 
uint64_t m_iovBeginTime
 
uint64_t m_iovEndTime
 
bool m_bUseTimeStamp
 
std::map< std::string, const DataHandle< AthenaAttributeList > * > m_mDataHandleAttrList
 
std::map< std::string, const DataHandle< CondAttrListCollection > * > m_mDataHandleAttrListColl
 
std::map< std::string, std::vector< IL1CaloPersistenceCapable * > > m_mConditions
 
std::map< IL1CaloPersistenceCapable *, std::vector< std::string > > m_map_conditions2key
 

Detailed Description

L1CaloCondSvc class.

Service that implement the methods required to store/retrieve inline payload to/from the condition DB

Author
Damien Prieur damie.nosp@m.n.pr.nosp@m.ieur@.nosp@m.cern.nosp@m..ch

Definition at line 38 of file L1CaloCondSvc.h.

Constructor & Destructor Documentation

◆ L1CaloCondSvc()

L1CaloCondSvc::L1CaloCondSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 13 of file L1CaloCondSvc.cxx.

13  :
15  m_detStore ("DetectorStore", name),
16  m_regSvc ("IOVRegistrationSvc", name)
17 {
18  // declare properties
19  declareProperty("StreamName", m_streamName = "COOLStream");
20  declareProperty("BeginRun", m_iovBeginRun = 0 );
22  declareProperty("BeginLB", m_iovBeginLB = 0 );
24  declareProperty("BeginTime", m_iovBeginTime = 0);
25  declareProperty("EndTime", m_iovEndTime = 0);
26  declareProperty("TimeStamp", m_bUseTimeStamp = false);
27  declareProperty("WriteNewChannels", m_bWriteNewChannels = false);
28 }

◆ ~L1CaloCondSvc()

L1CaloCondSvc::~L1CaloCondSvc ( )
virtual

Definition at line 30 of file L1CaloCondSvc.cxx.

30 {}

Member Function Documentation

◆ finalize()

StatusCode L1CaloCondSvc::finalize ( )
virtual

Definition at line 55 of file L1CaloCondSvc.cxx.

56 {
57  ATH_MSG_DEBUG("in finalize()");
58 
59  std::map<std::string, const DataHandle<AthenaAttributeList>* >::iterator it_AttrList = m_mDataHandleAttrList.begin();
60  for(;it_AttrList!=m_mDataHandleAttrList.end();++it_AttrList) {
61  delete it_AttrList->second;
62  }
63 
64  std::map<std::string, const DataHandle<CondAttrListCollection>* >::iterator it_AttrListColl = m_mDataHandleAttrListColl.begin();
65  for(;it_AttrListColl!=m_mDataHandleAttrListColl.end();++it_AttrListColl) {
66  delete it_AttrListColl->second;
67  }
68 
69  return StatusCode::SUCCESS;
70 }

◆ initialize()

StatusCode L1CaloCondSvc::initialize ( )
virtual

Definition at line 47 of file L1CaloCondSvc.cxx.

48 {
50  ATH_CHECK( m_detStore.retrieve() );
51  ATH_CHECK( m_regSvc.retrieve() );
52  return StatusCode::SUCCESS;
53 }

◆ interfaceID()

const InterfaceID & L1CaloCondSvc::interfaceID ( )
inlinestatic

Definition at line 114 of file L1CaloCondSvc.h.

114  {
115  static const InterfaceID IID_L1CaloCondSvc("L1CaloCondSvc",1,0);
116  return IID_L1CaloCondSvc;
117 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ queryInterface()

StatusCode L1CaloCondSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

Definition at line 32 of file L1CaloCondSvc.cxx.

33 {
34  ATH_MSG_DEBUG("in queryInterface()");
35 
36  if (L1CaloCondSvc::interfaceID().versionMatch(riid)) {
37  ATH_MSG_DEBUG("matched L1CaloCondSvc");
38  *ppvInterface=(L1CaloCondSvc*)this;
39  } else {
40  ATH_MSG_DEBUG("Default to Service interface");
41  return AthService::queryInterface(riid,ppvInterface);
42  }
43  return StatusCode::SUCCESS;
44 }

◆ registerCondition()

template<typename T >
StatusCode L1CaloCondSvc::registerCondition ( T *&  pobj,
const std::string &  mykey = "" 
)
private

◆ retrieve() [1/2]

template<typename T , typename FolderMapping >
StatusCode L1CaloCondSvc::retrieve ( T *&  pobj,
const FolderMapping &  folderKeyMap,
const std::string &  key = "" 
)

To retrieve a condition object from the COOL DB with custom folder mapping.

Warning
Only objects that implement the IL1CaloPersistenceCapable interface can be retrieved using this method

◆ retrieve() [2/2]

template<typename T >
StatusCode L1CaloCondSvc::retrieve ( T *&  pobj,
const std::string &  key = "" 
)

To retrieve a condition object from the COOL DB.

Warning
Only objects that implement the IL1CaloPersistenceCapable interface can be retrieved using this method

◆ retrieveImpl()

template<typename T >
StatusCode L1CaloCondSvc::retrieveImpl ( T *&  pobj,
const std::string &  key 
)
private

◆ store()

template<typename T >
StatusCode L1CaloCondSvc::store ( const T *&  pobj,
const std::string &  key,
const std::string &  folder,
const std::string &  tag 
) const

To store a condition object into the COOL DB.

Warning
Only objects that implement the IL1CaloPersistenceCapable interface can be stored using this method

◆ updateConditions()

StatusCode L1CaloCondSvc::updateConditions ( IOVSVC_CALLBACK_ARGS  )
virtual

Definition at line 72 of file L1CaloCondSvc.cxx.

72  {
73 
74 
75 // ATH_MSG_INFO("ACH updateConditions()");
76  ATH_MSG_VERBOSE("updateConditions()");
77 
78  // set to store the list of objects to be updated.
79  std::set<IL1CaloPersistenceCapable*> vToBeUpdated;
80 
81  // loop over the keys of folders that have new conditions to be cached
82  std::list<std::string>::const_iterator itr;
83  for(itr=keys.begin(); itr!=keys.end(); ++itr) {
84  std::string key = *itr;
85 // ATH_MSG_INFO("ACH key = " << key);
86  ATH_MSG_VERBOSE("key = " << key);
87 
88  // find the current key in the map
89  std::map<std::string, std::vector<IL1CaloPersistenceCapable*> >::const_iterator it_map = m_mConditions.find(key);
90  if(it_map!=m_mConditions.end()) {
91 
92  // loop over objects that depend on the current folder/key
93  std::vector<IL1CaloPersistenceCapable*> vObjs = it_map->second;
94  std::vector<IL1CaloPersistenceCapable*>::const_iterator it_vObjs = vObjs.begin();
95  for(;it_vObjs!=vObjs.end();++it_vObjs) {
96  IL1CaloPersistenceCapable* pobj = *it_vObjs;
97  vToBeUpdated.insert(pobj);
98  }
99  }
100  }
101 
102  // form here vToBeUpdated contains the list of objects to be updated
103  // loop over them, get the required datahandles and pass them to pobj
104  std::set<IL1CaloPersistenceCapable*>::const_iterator it_set = vToBeUpdated.begin();
105  for(;it_set!=vToBeUpdated.end();++it_set) {
106  IL1CaloPersistenceCapable* pobj = *it_set;
107 
108  // get the keys/folders required by current object
109  std::vector<std::string> vCoolInputKeys = pobj->coolInputKeys();
110 
111  std::vector<std::string> otherkeys = m_map_conditions2key[pobj];
112  vCoolInputKeys.insert(vCoolInputKeys.end(),otherkeys.begin(),otherkeys.end());
113 
114  std::string conditionType = pobj->conditionType();
115 // ATH_MSG_INFO("ACH conditionType = "<<conditionType);
116 
117  if(conditionType=="CondAttrListCollection") {
118 
119  // will contain pointer to the CondAttrListCollection(s) required by pobj to populate itself.
120  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMap;
121 
122  // loop onver input keys, to get the corresponding datahandle
123  std::vector<std::string>::const_iterator it_coolInputKeys = vCoolInputKeys.begin();
124  for(;it_coolInputKeys!=vCoolInputKeys.end();++it_coolInputKeys) {
125  std::string key = *it_coolInputKeys;
126 // ATH_MSG_INFO("ACH update key = " << key);
127  std::map<std::string, const DataHandle<CondAttrListCollection>* >::iterator it = m_mDataHandleAttrListColl.find(key);
128  if (it != m_mDataHandleAttrListColl.end()) {
130  const CondAttrListCollection* attrListCollection = &(*dh);
131  if (attrListCollection) {
132 // ATH_MSG_INFO("ACH attrListCollection = "<<attrListCollection);
133  condAttrListCollectionMap[key] = (CondAttrListCollection*)attrListCollection;
134  }
135  }
136  }
137 // ATH_MSG_INFO("ACH condAttrListCollectionMap size is "<<condAttrListCollectionMap.size());
138  pobj->makeTransient(condAttrListCollectionMap);
139 
140  } else if(conditionType=="AthenaAttributeList"){
141 /*
142  const DataHandle<AthenaAttributeList>& dh = *m_mDataHandleAttrList[key];
143 
144  const AthenaAttributeList* athenaAttributeList = &(*dh);
145  pobj->makeTransient(athenaAttributeList);
146 */
147  } else {
148  ATH_MSG_ERROR("Condition type " << conditionType<< "not recognized by L1CaloCondSvc");
149  return StatusCode::FAILURE;
150  }
151 
152  }
153 
154 
155 
156 /*
157  std::map<std::string, std::vector<IL1CaloPersistenceCapable*> >::const_iterator it_obj = m_mConditions.find(key);
158  if(it_obj!=m_mConditions.end()) {
159 
160  IL1CaloPersistenceCapable* pobj = it_obj->second;
161 
162  std::string conditionType = pobj->conditionType();
163  if(conditionType=="CondAttrListCollection") {
164 
165  const DataHandle<CondAttrListCollection>& dh = *m_mDataHandleAttrListColl[key];
166 
167  const CondAttrListCollection* attrListCollection = &(*dh);
168  pobj->makeTransient(attrListCollection);
169 
170  } else if(conditionType=="AthenaAttributeList"){
171 
172  const DataHandle<AthenaAttributeList>& dh = *m_mDataHandleAttrList[key];
173 
174  const AthenaAttributeList* athenaAttributeList = &(*dh);
175  pobj->makeTransient(athenaAttributeList);
176 
177  } else {
178  log << MSG::ERROR << "Condition type " << conditionType<< "not recognized by L1CaloCondSvc" << endmsg;
179  return StatusCode::FAILURE;
180  }
181  }
182 */
183 
184 
185  ATH_MSG_VERBOSE("end of L1CaloCondSvc::updateConditions(IOVSVC_CALLBACK_ARGS_P(/*I*/, keys))");
186  return StatusCode::SUCCESS;
187 }

Member Data Documentation

◆ m_bUseTimeStamp

bool L1CaloCondSvc::m_bUseTimeStamp
private

Definition at line 98 of file L1CaloCondSvc.h.

◆ m_bWriteNewChannels

bool L1CaloCondSvc::m_bWriteNewChannels
private

Definition at line 89 of file L1CaloCondSvc.h.

◆ m_detStore

ServiceHandle<StoreGateSvc> L1CaloCondSvc::m_detStore
private

Definition at line 83 of file L1CaloCondSvc.h.

◆ m_iovBeginLB

unsigned int L1CaloCondSvc::m_iovBeginLB
private

Definition at line 94 of file L1CaloCondSvc.h.

◆ m_iovBeginRun

unsigned int L1CaloCondSvc::m_iovBeginRun
private

Definition at line 92 of file L1CaloCondSvc.h.

◆ m_iovBeginTime

uint64_t L1CaloCondSvc::m_iovBeginTime
private

Definition at line 96 of file L1CaloCondSvc.h.

◆ m_iovEndLB

unsigned int L1CaloCondSvc::m_iovEndLB
private

Definition at line 95 of file L1CaloCondSvc.h.

◆ m_iovEndRun

unsigned int L1CaloCondSvc::m_iovEndRun
private

Definition at line 93 of file L1CaloCondSvc.h.

◆ m_iovEndTime

uint64_t L1CaloCondSvc::m_iovEndTime
private

Definition at line 97 of file L1CaloCondSvc.h.

◆ m_map_conditions2key

std::map<IL1CaloPersistenceCapable*,std::vector<std::string> > L1CaloCondSvc::m_map_conditions2key
private

Definition at line 110 of file L1CaloCondSvc.h.

◆ m_mConditions

std::map<std::string, std::vector<IL1CaloPersistenceCapable*> > L1CaloCondSvc::m_mConditions
private

Definition at line 109 of file L1CaloCondSvc.h.

◆ m_mDataHandleAttrList

std::map<std::string, const DataHandle<AthenaAttributeList>* > L1CaloCondSvc::m_mDataHandleAttrList
private

Definition at line 107 of file L1CaloCondSvc.h.

◆ m_mDataHandleAttrListColl

std::map<std::string, const DataHandle<CondAttrListCollection>* > L1CaloCondSvc::m_mDataHandleAttrListColl
private

Definition at line 108 of file L1CaloCondSvc.h.

◆ m_regSvc

ServiceHandle<IIOVRegistrationSvc> L1CaloCondSvc::m_regSvc
private

Definition at line 84 of file L1CaloCondSvc.h.

◆ m_streamName

std::string L1CaloCondSvc::m_streamName
private

Definition at line 87 of file L1CaloCondSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthService::AthService
AthService()
L1CaloCondSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: L1CaloCondSvc.h:114
IL1CaloPersistenceCapable
Definition: IL1CaloPersistenceCapable.h:21
L1CaloCondSvc::m_mDataHandleAttrListColl
std::map< std::string, const DataHandle< CondAttrListCollection > * > m_mDataHandleAttrListColl
Definition: L1CaloCondSvc.h:108
L1CaloCondSvc::m_iovEndRun
unsigned int m_iovEndRun
Definition: L1CaloCondSvc.h:93
initialize
void initialize()
Definition: run_EoverP.cxx:894
skel.it
it
Definition: skel.GENtoEVGEN.py:423
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
IL1CaloPersistenceCapable::makeTransient
virtual void makeTransient(const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)=0
L1CaloCondSvc::m_bUseTimeStamp
bool m_bUseTimeStamp
Definition: L1CaloCondSvc.h:98
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
python.LArBadChannelDBAlg.x7FFFFFFF
x7FFFFFFF
Definition: LArBadChannelDBAlg.py:72
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
python.LArBadChannelDBAlg.xFFFFFFFF
xFFFFFFFF
Definition: LArBadChannelDBAlg.py:73
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1CaloCondSvc::m_regSvc
ServiceHandle< IIOVRegistrationSvc > m_regSvc
Definition: L1CaloCondSvc.h:84
IL1CaloPersistenceCapable::coolInputKeys
virtual std::vector< std::string > coolInputKeys() const =0
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
L1CaloCondSvc::m_mConditions
std::map< std::string, std::vector< IL1CaloPersistenceCapable * > > m_mConditions
Definition: L1CaloCondSvc.h:109
IL1CaloPersistenceCapable::conditionType
virtual std::string conditionType() const =0
L1CaloCondSvc::m_iovEndTime
uint64_t m_iovEndTime
Definition: L1CaloCondSvc.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
L1CaloCondSvc::m_bWriteNewChannels
bool m_bWriteNewChannels
Definition: L1CaloCondSvc.h:89
DataHandle< CondAttrListCollection >
L1CaloCondSvc::m_iovBeginRun
unsigned int m_iovBeginRun
Definition: L1CaloCondSvc.h:92
L1CaloCondSvc::m_map_conditions2key
std::map< IL1CaloPersistenceCapable *, std::vector< std::string > > m_map_conditions2key
Definition: L1CaloCondSvc.h:110
L1CaloCondSvc::m_streamName
std::string m_streamName
Definition: L1CaloCondSvc.h:87
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
L1CaloCondSvc::m_iovBeginLB
unsigned int m_iovBeginLB
Definition: L1CaloCondSvc.h:94
L1CaloCondSvc::m_iovEndLB
unsigned int m_iovEndLB
Definition: L1CaloCondSvc.h:95
L1CaloCondSvc::m_iovBeginTime
uint64_t m_iovBeginTime
Definition: L1CaloCondSvc.h:96
L1CaloCondSvc
L1CaloCondSvc class.
Definition: L1CaloCondSvc.h:39
L1CaloCondSvc::m_mDataHandleAttrList
std::map< std::string, const DataHandle< AthenaAttributeList > * > m_mDataHandleAttrList
Definition: L1CaloCondSvc.h:107
L1CaloCondSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: L1CaloCondSvc.h:83
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37