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

#include <OutputConditionsAlg.h>

Inheritance diagram for OutputConditionsAlg:
Collaboration diagram for OutputConditionsAlg:

Public Member Functions

 OutputConditionsAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~OutputConditionsAlg ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ToolHandle< IAthenaOutputStreamToolIAthenaOutputStreamTool_t
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

uint64_t timeToNano (unsigned long int timesec) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< IClassIDSvc > p_clidsvc {this,"ClassIDSvc","ClassIDSvc"}
 
ServiceHandle< IIOVRegistrationSvcp_regsvc {this, "IOVRegistrationSvc","IOVRegistrationSvc"}
 
IAthenaOutputStreamTool_t m_streamer
 
Gaudi::Property< std::vector< std::string > > m_objectList {this,"ObjectList",{},"List of object to be written","OrderedSet<std::string>"}
 
Gaudi::Property< std::string > m_streamName {this,"StreamName","ConditionsAlgStream"}
 
Gaudi::Property< bool > m_par_writeIOV {this,"WriteIOV",true}
 
Gaudi::Property< unsigned int > m_par_run1 {this,"Run1",IOVTime::MINRUN,"IOV start (run-number)"}
 
Gaudi::Property< unsigned int > m_par_lumib1 {this,"LB1",IOVTime::MINEVENT,"IOV start (LB-number)"}
 
Gaudi::Property< unsigned int > m_par_run2 {this,"Run2",IOVTime::MAXRUN,"IOV end (run-number)"}
 
Gaudi::Property< unsigned int > m_par_lumib2 {this,"LB2",IOVTime::MAXEVENT,"IOV end (LB-number)"}
 
UnsignedLongProperty m_par_time1 {this,"Time1",IOVTime::MINTIMESTAMP,"IOV start (timestamp)"}
 
UnsignedLongProperty m_par_time2 {this,"Time2",IOVTime::MAXEVENT,"IOV end (timestamp)"}
 
Gaudi::Property< bool > m_par_timestamp {this,"UseTime",false,"IOV in second or Run/LB"}
 
Gaudi::Property< std::vector< std::string > > m_par_iovtags {this,"IOVTagList",{},"List of Tags to be written","OrderedSet<std::string>"}
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 23 of file OutputConditionsAlg.h.

Member Typedef Documentation

◆ IAthenaOutputStreamTool_t

Definition at line 41 of file OutputConditionsAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ OutputConditionsAlg()

OutputConditionsAlg::OutputConditionsAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 16 of file OutputConditionsAlg.cxx.

17  :
18  AthAlgorithm(name, pSvcLocator)
19 {}

◆ ~OutputConditionsAlg()

OutputConditionsAlg::~OutputConditionsAlg ( )

Definition at line 22 of file OutputConditionsAlg.cxx.

23 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode OutputConditionsAlg::execute ( )

Definition at line 53 of file OutputConditionsAlg.cxx.

53  {
54 
55  return StatusCode::SUCCESS;
56 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode OutputConditionsAlg::finalize ( )

Definition at line 58 of file OutputConditionsAlg.cxx.

58  {
59  ATH_MSG_INFO ("Finalize: preparing to write conditions objects ");
60 
61  StatusCode sc = m_streamer->connectOutput();
62  if (sc.isFailure()) {
63  ATH_MSG_ERROR ("Could not connect stream to output");
64  return( StatusCode::FAILURE);
65  }
66  // create list of objects
67  std::vector<std::string> types;
68  std::vector<std::string> keys;
69  std::vector<std::string> folders;
70  std::vector<std::string> tags;
71  for (unsigned int iobj=0;iobj<m_objectList.size();++iobj) {
72  // if object name contains a '#', it represents a specific typename#key
73  std::string::size_type ihash=m_objectList[iobj].find_first_of("#");
74  if (ihash==std::string::npos) {
75  // no hash, get the default object for this class, and set key
76  // note this will only get ONE object
77  // first need to know CLID from typename
78  CLID clid;
79  if (StatusCode::SUCCESS==p_clidsvc->getIDOfTypeName(
80  m_objectList[iobj],clid)) {
81  SG::DataProxy* proxy=detStore()->proxy(clid);
82  if (proxy) {
83  types.push_back(m_objectList[iobj]);
84  keys.push_back(proxy->name());
85  folders.push_back(proxy->name());
86  if (iobj<m_par_iovtags.size()) {
87  tags.push_back(m_par_iovtags[iobj]);
88  } else {
89  tags.push_back("");
90  }
91  } else {
92  ATH_MSG_ERROR ("Could not get default proxy for CLID " <<
93  clid << " typename " << m_objectList[iobj]);
94  }
95  } else {
96  ATH_MSG_ERROR ("Could not get CLID from typename " <<
97  m_objectList[iobj]);
98  }
99  } else {
100  types.push_back(m_objectList[iobj].substr(0,ihash));
101  // a second hash allows the folder to be specified after the key
102  // otherwise the folder name is taken to be the same as the key name
103  std::string::size_type ihash2=m_objectList[iobj].find_first_of("#",ihash+1);
104  if (ihash2==std::string::npos) {
105  std::string key=m_objectList[iobj].substr(ihash+1,std::string::npos);
106  keys.push_back(key);
107  folders.push_back(key);
108  } else {
109  keys.push_back(m_objectList[iobj].substr(ihash+1,ihash2-ihash-1));
110  folders.push_back(m_objectList[iobj].substr(ihash2+1,
111  std::string::npos));
112  }
113  if (iobj<m_par_iovtags.size()) {
114  tags.push_back(m_par_iovtags[iobj]);
115  } else {
116  tags.push_back("");
117  }
118  }
119  }
120  // list out all typename/key pairs to be written and construct vector
121  int nObjects=types.size();
122  IAthenaOutputStreamTool::TypeKeyPairs typeKeys(nObjects);
123  ATH_MSG_INFO ("Identified a total of " << nObjects <<
124  " objects to write out:");
125  // leave now if nothing to write
126  if (nObjects==0) return StatusCode::SUCCESS;
127  for (int i=0;i<nObjects;i++) {
128  typeKeys[i]=IAthenaOutputStreamTool::TypeKeyPair(types[i],keys[i]);
129  ATH_MSG_INFO (i << ": " << types[i] << "#" << keys[i] <<
130  "#" << folders[i]);
131  // check object actually exists, else return failure
132  CLID clid;
133  SG::DataProxy* proxy=0;
134  if (StatusCode::SUCCESS==p_clidsvc->getIDOfTypeName(types[i],clid))
135  proxy=detStore()->proxy(clid,keys[i]);
136  if (proxy==0) {
137  ATH_MSG_ERROR ("Could not find proxy for object with key " <<
138  keys[i] << " - abort write");
139  return StatusCode::FAILURE;
140  }
141  }
142 
143  // stream output (write objects)
144  sc=m_streamer->streamObjects(typeKeys);
145  if (sc.isFailure()) {
146  ATH_MSG_ERROR ("Could not stream out objects");
147  return StatusCode::FAILURE;
148  }
149  // commit output
150  sc=m_streamer->commitOutput();
151  if (sc.isFailure()) {
152  ATH_MSG_ERROR ("Could not commit output stream");
153  return StatusCode::FAILURE;
154  }
155  ATH_MSG_INFO ("Written " << nObjects << " objects to output stream");
156 
157  if (m_par_writeIOV) {
158  msg() << MSG::INFO <<
159  "Register objects in IOV database, interval of validity ";
160  if (m_par_timestamp) {
161  msg() << "[time] from [" <<
162  m_par_time1.value() << "] to [" << m_par_time2.value() << "]" << endmsg;
163  } else {
164  msg() << "[run,LB] from [" <<
165  m_par_run1.value() << "," << m_par_lumib1.value() << "] to [" << m_par_run2.value() <<
166  "," << m_par_lumib2.value() << "]" << endmsg;
167  }
168  int nreg=0;
169  for (int iobj=0;iobj<nObjects;++iobj) {
170  msg() << MSG::INFO << "Register object " << types[iobj] << "#" <<
171  keys[iobj] << " in IOV database folder " << folders[iobj] << " ";
172  if (tags[iobj]=="") {
173  msg() << MSG::INFO << "without tagging" << endmsg;
174  } else {
175  msg() << MSG::INFO << "with tag " << tags[iobj] << endmsg;
176  }
177  if (m_par_timestamp) {
178  sc=p_regsvc->registerIOV(types[iobj],keys[iobj],
180  } else {
181  sc=p_regsvc->registerIOV(types[iobj],keys[iobj],
183  }
184  if (sc==StatusCode::SUCCESS) {
185  ++nreg;
186  } else {
187  ATH_MSG_ERROR ("Registration failed!");
188  }
189  }
190  ATH_MSG_INFO ("Registered " << nreg << " objects in IOV database");
191  } else {
192  ATH_MSG_INFO ("Objects NOT registered in IOV database");
193  }
194  return StatusCode::SUCCESS;
195 }

◆ initialize()

StatusCode OutputConditionsAlg::initialize ( )

Definition at line 26 of file OutputConditionsAlg.cxx.

26  {
27  ATH_MSG_DEBUG ("in initialize()");
28 
29  // get pointer to ClassIDSvc
30  if (StatusCode::SUCCESS!= p_clidsvc.retrieve()) {
31  ATH_MSG_FATAL ("ClassIDSvc not found");
32  return StatusCode::FAILURE;
33  }
34  if (m_par_writeIOV) {
35  // get pointer to IOVRegistrationSvc
36  if (StatusCode::SUCCESS!=p_regsvc.retrieve()) {
37  ATH_MSG_FATAL ("IOVRegistrationSvc not found");
38  return StatusCode::FAILURE;
39  }
40  }
41  m_streamer = IAthenaOutputStreamTool_t("AthenaOutputStreamTool/"+
42  m_streamName);
43  StatusCode sc = m_streamer.retrieve();
44  if (sc.isFailure()) {
45  ATH_MSG_ERROR ("Unable to find AthenaOutputStreamTool with name " <<
46  m_streamName);
47  return StatusCode::FAILURE;
48  }
49  return StatusCode::SUCCESS;
50 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ timeToNano()

uint64_t OutputConditionsAlg::timeToNano ( unsigned long int  timesec) const
private

Definition at line 197 of file OutputConditionsAlg.cxx.

198 {
199  // convert time specified in seconds to ns used by COOL
200  // use the magic value MAXEVENT to signal full range
201  if (timesec==IOVTime::MAXEVENT) {
202  return IOVTime::MAXTIMESTAMP;
203  } else {
204  return static_cast<uint64_t>(timesec)*1000000000;
205  }
206 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_objectList

Gaudi::Property<std::vector<std::string> > OutputConditionsAlg::m_objectList {this,"ObjectList",{},"List of object to be written","OrderedSet<std::string>"}
private

Definition at line 44 of file OutputConditionsAlg.h.

◆ m_par_iovtags

Gaudi::Property<std::vector<std::string> > OutputConditionsAlg::m_par_iovtags {this,"IOVTagList",{},"List of Tags to be written","OrderedSet<std::string>"}
private

Definition at line 54 of file OutputConditionsAlg.h.

◆ m_par_lumib1

Gaudi::Property<unsigned int> OutputConditionsAlg::m_par_lumib1 {this,"LB1",IOVTime::MINEVENT,"IOV start (LB-number)"}
private

Definition at line 48 of file OutputConditionsAlg.h.

◆ m_par_lumib2

Gaudi::Property<unsigned int> OutputConditionsAlg::m_par_lumib2 {this,"LB2",IOVTime::MAXEVENT,"IOV end (LB-number)"}
private

Definition at line 50 of file OutputConditionsAlg.h.

◆ m_par_run1

Gaudi::Property<unsigned int> OutputConditionsAlg::m_par_run1 {this,"Run1",IOVTime::MINRUN,"IOV start (run-number)"}
private

Definition at line 47 of file OutputConditionsAlg.h.

◆ m_par_run2

Gaudi::Property<unsigned int> OutputConditionsAlg::m_par_run2 {this,"Run2",IOVTime::MAXRUN,"IOV end (run-number)"}
private

Definition at line 49 of file OutputConditionsAlg.h.

◆ m_par_time1

UnsignedLongProperty OutputConditionsAlg::m_par_time1 {this,"Time1",IOVTime::MINTIMESTAMP,"IOV start (timestamp)"}
private

Definition at line 51 of file OutputConditionsAlg.h.

◆ m_par_time2

UnsignedLongProperty OutputConditionsAlg::m_par_time2 {this,"Time2",IOVTime::MAXEVENT,"IOV end (timestamp)"}
private

Definition at line 52 of file OutputConditionsAlg.h.

◆ m_par_timestamp

Gaudi::Property<bool> OutputConditionsAlg::m_par_timestamp {this,"UseTime",false,"IOV in second or Run/LB"}
private

Definition at line 53 of file OutputConditionsAlg.h.

◆ m_par_writeIOV

Gaudi::Property<bool> OutputConditionsAlg::m_par_writeIOV {this,"WriteIOV",true}
private

Definition at line 46 of file OutputConditionsAlg.h.

◆ m_streamer

IAthenaOutputStreamTool_t OutputConditionsAlg::m_streamer
private

Definition at line 42 of file OutputConditionsAlg.h.

◆ m_streamName

Gaudi::Property<std::string> OutputConditionsAlg::m_streamName {this,"StreamName","ConditionsAlgStream"}
private

Definition at line 45 of file OutputConditionsAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ p_clidsvc

ServiceHandle<IClassIDSvc> OutputConditionsAlg::p_clidsvc {this,"ClassIDSvc","ClassIDSvc"}
private

Definition at line 36 of file OutputConditionsAlg.h.

◆ p_regsvc

ServiceHandle<IIOVRegistrationSvc> OutputConditionsAlg::p_regsvc {this, "IOVRegistrationSvc","IOVRegistrationSvc"}
private

Definition at line 37 of file OutputConditionsAlg.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
IAthenaOutputStreamTool::TypeKeyPairs
std::vector< TypeKeyPair > TypeKeyPairs
Definition: IAthenaOutputStreamTool.h:99
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
OutputConditionsAlg::m_par_lumib2
Gaudi::Property< unsigned int > m_par_lumib2
Definition: OutputConditionsAlg.h:50
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
OutputConditionsAlg::p_regsvc
ServiceHandle< IIOVRegistrationSvc > p_regsvc
Definition: OutputConditionsAlg.h:37
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
OutputConditionsAlg::m_streamer
IAthenaOutputStreamTool_t m_streamer
Definition: OutputConditionsAlg.h:42
defineDB.folders
list folders
Definition: JetTagCalibration/share/defineDB.py:26
tags
std::vector< std::string > tags
Definition: hcg.cxx:102
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
OutputConditionsAlg::p_clidsvc
ServiceHandle< IClassIDSvc > p_clidsvc
Definition: OutputConditionsAlg.h:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
OutputConditionsAlg::m_par_iovtags
Gaudi::Property< std::vector< std::string > > m_par_iovtags
Definition: OutputConditionsAlg.h:54
OutputConditionsAlg::m_par_time1
UnsignedLongProperty m_par_time1
Definition: OutputConditionsAlg.h:51
IOVTime::MAXTIMESTAMP
static constexpr uint64_t MAXTIMESTAMP
Definition: IOVTime.h:58
IAthenaOutputStreamTool::TypeKeyPair
std::pair< std::string, std::string > TypeKeyPair
Stream out objects.
Definition: IAthenaOutputStreamTool.h:98
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
IOVTime::MAXEVENT
static constexpr uint32_t MAXEVENT
Definition: IOVTime.h:51
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
OutputConditionsAlg::m_par_writeIOV
Gaudi::Property< bool > m_par_writeIOV
Definition: OutputConditionsAlg.h:46
python.root_lsr_rank.types
types
Definition: root_lsr_rank.py:35
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
OutputConditionsAlg::timeToNano
uint64_t timeToNano(unsigned long int timesec) const
Definition: OutputConditionsAlg.cxx:197
OutputConditionsAlg::m_par_timestamp
Gaudi::Property< bool > m_par_timestamp
Definition: OutputConditionsAlg.h:53
OutputConditionsAlg::IAthenaOutputStreamTool_t
ToolHandle< IAthenaOutputStreamTool > IAthenaOutputStreamTool_t
Definition: OutputConditionsAlg.h:41
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
OutputConditionsAlg::m_par_time2
UnsignedLongProperty m_par_time2
Definition: OutputConditionsAlg.h:52
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
OutputConditionsAlg::m_streamName
Gaudi::Property< std::string > m_streamName
Definition: OutputConditionsAlg.h:45
OutputConditionsAlg::m_par_run1
Gaudi::Property< unsigned int > m_par_run1
Definition: OutputConditionsAlg.h:47
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
OutputConditionsAlg::m_par_run2
Gaudi::Property< unsigned int > m_par_run2
Definition: OutputConditionsAlg.h:49
SG::DataProxy
Definition: DataProxy.h:44
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
OutputConditionsAlg::m_par_lumib1
Gaudi::Property< unsigned int > m_par_lumib1
Definition: OutputConditionsAlg.h:48
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
OutputConditionsAlg::m_objectList
Gaudi::Property< std::vector< std::string > > m_objectList
Definition: OutputConditionsAlg.h:44