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

Converts Reconstructed Event Data objects into XML files which can be read by, for example, the Atlantis graphics package. More...

#include <AlgoJiveXML.h>

Inheritance diagram for JiveXML::AlgoJiveXML:
Collaboration diagram for JiveXML::AlgoJiveXML:

Public Member Functions

 AlgoJiveXML (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 Initialize - called once in the beginning. More...
 
StatusCode execute ()
 Execute - called for every event. More...
 
StatusCode finalize ()
 Finalize called once in the end. More...
 
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 ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

Gaudi::Property< std::string > m_AtlasRelease {this, "AtlasRelease", "unknown", "The Athena release number"}
 
Gaudi::Property< std::vector< std::string > > m_dataTypes {this, "DataTypes", {}, "List of data retriever names to be run"}
 
Gaudi::Property< bool > m_writeToFile {this, "WriteToFile", true, "Whether XML files shall be produced"}
 
Gaudi::Property< bool > m_onlineMode {this, "OnlineMode", false, "Whether an XMLRPC server shall be started"}
 
Gaudi::Property< bool > m_writeGeometry {this, "WriteGeometry", false, "Whether Geometry-XML files shall be produced"}
 
Gaudi::Property< std::string > m_geometryVersionIn {this, "GeometryVersion", "default", "Geometry version as read from Athena"}
 
Gaudi::Property< std::vector< std::string > > m_GeoWriterNames {this, "GeoWriterNames", {"JiveXML::GeometryWriter/GeometryWriter","JiveXML::MuonGeometryWriter/MuonGeometryWriter"}, "The names of the geometry-writer tools"}
 
ToolHandleArray< JiveXML::IDataRetrieverm_DataRetrievers
 The list of DataRetrievers. More...
 
ToolHandle< JiveXML::IFormatToolm_FormatTool {this, "FormatTool", "JiveXML::XMLFormatTool/XMLFormatTool", "Format tool"}
 Handle to the formatting tool, which is passed on to the data retrievers and converts the data into XML. More...
 
ToolHandle< JiveXML::IStreamToolm_StreamToFileTool {this, "StreamToFileTool", "JiveXML::StreamToFileTool/StreamToFileTool", "Stream to file tool"}
 Streaming tools that pass the formatted XML text into a file, to a server, etc. More...
 
ToolHandle< JiveXML::IStreamToolm_StreamToServerTool {this, "StreamToServerTool", "JiveXML::StreamServerTool/StreamToServerTool", "Stream to server tool"}
 
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

Converts Reconstructed Event Data objects into XML files which can be read by, for example, the Atlantis graphics package.

Author
N. Konstantinidis
S. Boeser

Definition at line 32 of file AlgoJiveXML.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AlgoJiveXML()

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

Definition at line 21 of file AlgoJiveXML.cxx.

21  :
22  AthAlgorithm(name, pSvcLocator) {}

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 JiveXML::AlgoJiveXML::execute ( )

Execute - called for every event.

  • retrive general event information
  • call data retrievers
  • pass formatted events to streamers

Firstly retrieve all the event header information

Then start a new event with this header information

Now iterate over all the IDataRetrievers and write their data to the xml file by giving it the XMLWriter

Finish the event with a proper footer

Now stream the events to all registered streaming tools

Definition at line 139 of file AlgoJiveXML.cxx.

139  {
140 
144  //The run and event number of the current event
145  unsigned int runNo = 0, lumiBlock = 0;
146  uint64_t eventNo=0;
147  //Date and time string of the current event
148  char dateTime[32];
149  //general event property, unused yet
150  std::string eventProperty = "default";
151 
152  // geometry-version/geometry-tag from Athena (sourced via jOs)
153  std::string geometryVersion = "default";
155 
156  //Retrieve eventInfo from StoreGate
157  const xAOD::EventInfo* eventInfo = nullptr;
158  if (evtStore()->retrieve(eventInfo).isFailure()){
159  ATH_MSG_FATAL("Could not find xAODEventInfo" );
160  return StatusCode::FAILURE;
161  }else{
162  // Event/xAOD/xAODEventInfo/trunk/xAODEventInfo/versions/EventInfo_v1.h
163  ATH_MSG_DEBUG(" xAODEventInfo: runNumber: " << eventInfo->runNumber() // is '222222' for mc events ?
164  << ", eventNumber: " << eventInfo->eventNumber()
165  << ", mcChannelNumber: " << eventInfo->mcChannelNumber()
166  << ", mcEventNumber: " << eventInfo->mcEventNumber() // MC: use this instead of runNumber
167  << ", lumiBlock: " << eventInfo->lumiBlock()
168  << ", timeStamp: " << eventInfo->timeStamp()
169  << ", bcid: " << eventInfo->bcid()
170  << ", eventTypeBitmask: " << eventInfo->eventTypeBitmask()
171  << ", actualInteractionsPerCrossing: " << eventInfo->actualInteractionsPerCrossing()
172  << ", averageInteractionsPerCrossing: " << eventInfo->averageInteractionsPerCrossing()
173  );
174  }
175 
176  // new treatment of mc_channel_number for mc12
177  // from: https://twiki.cern.ch/twiki/bin/viewauth/Atlas/PileupDigitization#Contents_of_Pileup_RDO
178  unsigned int mcChannelNo = 0;
179  bool firstEv = true;
180 
181  //+++ Get sub-event info object
182  ATH_MSG_DEBUG( "Sub Event Infos: " );
183  for (const xAOD::EventInfo::SubEvent& subevt : eventInfo->subEvents()) {
184  const xAOD::EventInfo* sevt = subevt.ptr();
185  if (sevt) {
186  if (firstEv){
187  mcChannelNo = sevt->mcChannelNumber(); // the 'real' mc-channel
188  ATH_MSG_DEBUG( " mc_channel from SubEvent : " << sevt->mcChannelNumber() );
189  firstEv = false;
190  }
191  ATH_MSG_VERBOSE("Sub Event Info:\n Time : " << subevt.time()
192  << " Index : " << subevt.index()
193  << " Provenance : " << subevt.type() // This is the provenance stuff: signal, minbias, cavern, etc
194  << " Run Number : " << sevt->runNumber()
195  << " Event Number : " << sevt->eventNumber()
196  << " ns Offset : " << sevt->timeStampNSOffset()
197  << " Lumi Block : " << sevt->lumiBlock()
198  << " mc_channel : " << sevt->mcChannelNumber()
199  << " BCID : " << sevt->bcid()
200  << " Geo version : " << m_geometryVersionIn
201  );
202  }
203  else ATH_MSG_VERBOSE("Subevent is null ptr ");
204  }
205 
206  //Get run and event numbers
207  runNo = eventInfo->runNumber();
208  eventNo = eventInfo->eventNumber();
209 
210 // Note: 4294967293 is the maximum value for a unsigned long
211 
212  if ( mcChannelNo != 0 ){ runNo = mcChannelNo + 140000000; } // indicating 'mc14'
213  ATH_MSG_DEBUG( " runNumber for filename: " << runNo << ", eventNumber: " << eventNo);
214 
215  if ( eventInfo->lumiBlock() ){
216  lumiBlock = eventInfo->lumiBlock();
217  }else{
218  lumiBlock = -1; // placeholder
219  }
220  if ( mcChannelNo != 0 ) lumiBlock = -1; // mask for mc11a
221 
222  // lumiBlock from mc can be just huge number, ignore then
223  if ( lumiBlock > 1000000 ) { lumiBlock = 0; }
224 
225  //Get timestamp of the event
226  //If Grid job not running in CEST or CET, change to UTC
227  //Only option to avoid odd timezones. jpt 29Mar11
228  size_t found1;
229  size_t found2;
230  if (eventInfo->timeStamp() > 0) {
231  time_t unixtime = (time_t) eventInfo->timeStamp();
232  struct tm time;
233  localtime_r(&unixtime, &time);
234  strftime(dateTime, 32, "%Y-%m-%d %H:%M:%S %Z", &time);
235  struct tm utctime;
236  gmtime_r(&unixtime, &utctime);
237  found1 = (DataType(dateTime).toString().find("CEST"));
238  found2 = (DataType(dateTime).toString().find("CET"));
239  if ( int(found1)<0 && int(found2)<0 ){ // not found is -1
240  strftime(dateTime, 32, "%Y-%m-%d %H:%M:%S UTC", &utctime);
241  ATH_MSG_DEBUG( " TIME NOT CET/CEST. Adjusted to:" << dateTime );
242  }
243  } else {
244  dateTime[0] = '\0'; // empty string
245  }
246  if ( mcChannelNo != 0 ){ dateTime[0] = '\0'; } // mask for mc11a
247 
251  if ( m_FormatTool->StartEvent(eventNo, runNo, dateTime, lumiBlock, eventProperty, geometryVersion).isFailure() ){
252  ATH_MSG_FATAL("Couldn't start event in FormatTool");
253  return StatusCode::FAILURE;
254  }
255 
260  ATH_MSG_DEBUG("Starting loop over data retrievers" );
261  //Loop over data retrievers
263  for(; DataRetrieverItr != m_DataRetrievers.end(); ++DataRetrieverItr) {
264  //Add try-catch to avoid retrieval to fail on single retriever
265  try {
266  //Retrieve information and pass it to formatting tool object
267  if ((*DataRetrieverItr)->retrieve(m_FormatTool).isFailure()) {
268  ATH_MSG_WARNING( "Failed to fill " << (*DataRetrieverItr)->dataTypeName() );
269  } else {
270  ATH_MSG_DEBUG("Filled: " << (*DataRetrieverItr)->dataTypeName() );
271  }
272  //Only catch std::exception
273  } catch ( std::exception& ex ){
274  //Now show some message
275  ATH_MSG_FATAL("Caught exception in " << (*DataRetrieverItr)->name()
276  << " while retrieving data for " << (*DataRetrieverItr)->dataTypeName()
277  << " : " << ex.what() );
278  //and return with an error
279  return StatusCode::FAILURE;
280  }
281  }
282  ATH_MSG_DEBUG( "Finished loop over data retrievers" );
283 
287  if ( m_FormatTool->EndEvent().isFailure() ){
288  ATH_MSG_WARNING( "Couldn't end event in FormatTool" );
289  return StatusCode::FAILURE;
290  }
291 
295  if(m_writeToFile){
296  ATH_MSG_DEBUG("Streaming event to file");
297  if ( (m_StreamToFileTool->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() )){
298  ATH_MSG_WARNING( "Could not stream event to file" );
299  }
300  }
301  if(m_onlineMode){
302  ATH_MSG_DEBUG("Streaming event to server");
303  if ( (m_StreamToServerTool->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() )){
304  ATH_MSG_WARNING( "Could not stream event to server" );
305  }
306  }
307 
308  return StatusCode::SUCCESS;
309  }

◆ 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 JiveXML::AlgoJiveXML::finalize ( )

Finalize called once in the end.

  • release all tools

Release all the tools

Definition at line 315 of file AlgoJiveXML.cxx.

315  {
316 
317  ATH_MSG_VERBOSE( "finalize()" );
318 
320  m_DataRetrievers.release().ignore();
321  m_FormatTool.release().ignore();
322  m_StreamToFileTool.release().ignore();
323  m_StreamToServerTool.release().ignore();
324 
325  return StatusCode::SUCCESS;
326  }

◆ initialize()

StatusCode JiveXML::AlgoJiveXML::initialize ( )

Initialize - called once in the beginning.

  • Get StoreGate service
  • Get GeometryWriters and write geometry if asked for
  • Get the formatting tool
  • Get the data retrievers
  • Get the streaming tools, including defaults if asked for

Get the geometry writer tools and write geometries

Loop over names

Get a tool handle and retrieve the tool

Write geometry

Release tool

Get the formatting tools

Add default file streaming tools if requested

Get the streaming tools

Get the IDataRetrievers requested in the m_dataTypes list from the toolSvc and store them in the ToolHandleArray

Iteratate over the given data types

Loop over the retriever names

Create a tool handle for this tool

See if we can retrieve the tool

If so, store it in our list

Definition at line 31 of file AlgoJiveXML.cxx.

31  {
32 
33  //be verbose
34  ATH_MSG_VERBOSE("Initialize()");
35 
39  if(m_writeGeometry){
40 
41  ATH_MSG_DEBUG("Writing geometry to file");
42 
44  std::vector<std::string>::iterator GeoWriterNameItr = m_GeoWriterNames.begin();
45  for ( ; GeoWriterNameItr != m_GeoWriterNames.end(); ++GeoWriterNameItr){
46 
48 
49  ToolHandle<IGeometryWriter> GeometryWriter(*GeoWriterNameItr);
50  if ( GeometryWriter.retrieve().isFailure() ){
51  ATH_MSG_WARNING("Unable to locate "<<GeometryWriter.name()<<" tool");
52  } else {
54  if ( GeometryWriter->writeGeometry().isFailure() ){
55  ATH_MSG_WARNING("Unable to write geometry");
56  }
58  if ( GeometryWriter.release().isFailure() ){
59  ATH_MSG_WARNING("Unable to release tool GeometryWriter");
60  }
61  }
62  }
63  }
64 
68  ATH_MSG_DEBUG("Retrieving XML format tool");
69 
70  //Retrieve the format tool
71  ATH_CHECK(m_FormatTool.retrieve());
72 
73  //Setting the tags
74  if ( m_FormatTool->SetTag( TagType("Release",m_AtlasRelease)).isFailure() ){
75  ATH_MSG_WARNING( "Couldn't set Release version" );
76  }
77 
81  ATH_MSG_DEBUG("Retrieving streaming tools");
82  if (m_writeToFile){
83  ATH_MSG_INFO("Retrieving default file streaming tool");
84  ATH_CHECK(m_StreamToFileTool.retrieve());
85  }
86  ATH_MSG_INFO("online " << m_onlineMode);
88  if (m_onlineMode){
89  ATH_MSG_INFO("Retrieving default server streaming tool");
90  ATH_CHECK(m_StreamToServerTool.retrieve());
91  }
92 
97  ATH_MSG_DEBUG("Obtaining list of data retrievers");
98 
100  std::vector<std::string>::iterator DataTypesEnd = m_dataTypes.end();
101  std::vector<std::string>::iterator DataTypeItr = m_dataTypes.begin();
102 
104  for( ; DataTypeItr != DataTypesEnd; ++DataTypeItr)
105  {
107  ToolHandle<IDataRetriever> DataRetrieverTool(*DataTypeItr);
109  if( DataRetrieverTool.retrieve().isFailure() ) {
110  ATH_MSG_WARNING( "Unable to locate tool "
111  << DataRetrieverTool.type() << " with name "
112  << DataRetrieverTool.name());
113  } else {
115  m_DataRetrievers.push_back(DataRetrieverTool);
116  }
117  }
118 
119  ATH_MSG_INFO("Retrieving data from " << m_DataRetrievers.size() << " tools" );
120 
121  ATH_MSG_INFO("List property settings: ");
122  ATH_MSG_INFO("AtlasRelease: " << m_AtlasRelease);
123  ATH_MSG_INFO("DataTypes: " << m_dataTypes );
124  ATH_MSG_INFO("WriteToFile: " << m_writeToFile);
125  ATH_MSG_INFO("OnlineMode: " << m_onlineMode);
126  ATH_MSG_INFO("WriteGeometry: " << m_writeGeometry);
127  ATH_MSG_INFO("GeometryVersion: " << m_geometryVersionIn);
128  ATH_MSG_INFO("GeoWriterNames: " << m_GeoWriterNames );
129 
130  return StatusCode::SUCCESS;
131  }

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

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

Gaudi::Property<std::string> JiveXML::AlgoJiveXML::m_AtlasRelease {this, "AtlasRelease", "unknown", "The Athena release number"}
private

Definition at line 45 of file AlgoJiveXML.h.

◆ m_DataRetrievers

ToolHandleArray<JiveXML::IDataRetriever> JiveXML::AlgoJiveXML::m_DataRetrievers
private

The list of DataRetrievers.

This is initialised using the list of names supplied by the jobOptions. DataRetrievers are AlgTools residing in the corresponding sub-detector packages (e.g. TrackRetriever in InDetJiveXML).

Definition at line 57 of file AlgoJiveXML.h.

◆ m_dataTypes

Gaudi::Property<std::vector<std::string> > JiveXML::AlgoJiveXML::m_dataTypes {this, "DataTypes", {}, "List of data retriever names to be run"}
private

Definition at line 46 of file AlgoJiveXML.h.

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

ToolHandle<JiveXML::IFormatTool> JiveXML::AlgoJiveXML::m_FormatTool {this, "FormatTool", "JiveXML::XMLFormatTool/XMLFormatTool", "Format tool"}
private

Handle to the formatting tool, which is passed on to the data retrievers and converts the data into XML.

Definition at line 63 of file AlgoJiveXML.h.

◆ m_geometryVersionIn

Gaudi::Property<std::string> JiveXML::AlgoJiveXML::m_geometryVersionIn {this, "GeometryVersion", "default", "Geometry version as read from Athena"}
private

Definition at line 50 of file AlgoJiveXML.h.

◆ m_GeoWriterNames

Gaudi::Property<std::vector<std::string> > JiveXML::AlgoJiveXML::m_GeoWriterNames {this, "GeoWriterNames", {"JiveXML::GeometryWriter/GeometryWriter","JiveXML::MuonGeometryWriter/MuonGeometryWriter"}, "The names of the geometry-writer tools"}
private

Definition at line 51 of file AlgoJiveXML.h.

◆ m_onlineMode

Gaudi::Property<bool> JiveXML::AlgoJiveXML::m_onlineMode {this, "OnlineMode", false, "Whether an XMLRPC server shall be started"}
private

Definition at line 48 of file AlgoJiveXML.h.

◆ m_StreamToFileTool

ToolHandle<JiveXML::IStreamTool> JiveXML::AlgoJiveXML::m_StreamToFileTool {this, "StreamToFileTool", "JiveXML::StreamToFileTool/StreamToFileTool", "Stream to file tool"}
private

Streaming tools that pass the formatted XML text into a file, to a server, etc.

Definition at line 69 of file AlgoJiveXML.h.

◆ m_StreamToServerTool

ToolHandle<JiveXML::IStreamTool> JiveXML::AlgoJiveXML::m_StreamToServerTool {this, "StreamToServerTool", "JiveXML::StreamServerTool/StreamToServerTool", "Stream to server tool"}
private

Definition at line 70 of file AlgoJiveXML.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.

◆ m_writeGeometry

Gaudi::Property<bool> JiveXML::AlgoJiveXML::m_writeGeometry {this, "WriteGeometry", false, "Whether Geometry-XML files shall be produced"}
private

Definition at line 49 of file AlgoJiveXML.h.

◆ m_writeToFile

Gaudi::Property<bool> JiveXML::AlgoJiveXML::m_writeToFile {this, "WriteToFile", true, "Whether XML files shall be produced"}
private

Definition at line 47 of file AlgoJiveXML.h.


The documentation for this class was generated from the following files:
JiveXML::AlgoJiveXML::m_writeToFile
Gaudi::Property< bool > m_writeToFile
Definition: AlgoJiveXML.h:47
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
JiveXML::AlgoJiveXML::m_GeoWriterNames
Gaudi::Property< std::vector< std::string > > m_GeoWriterNames
Definition: AlgoJiveXML.h:51
jetMakeRefSamples.geometryVersion
string geometryVersion
Definition: jetMakeRefSamples.py:68
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
JiveXML::AlgoJiveXML::m_onlineMode
Gaudi::Property< bool > m_onlineMode
Definition: AlgoJiveXML.h:48
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
JiveXML::AlgoJiveXML::m_dataTypes
Gaudi::Property< std::vector< std::string > > m_dataTypes
Definition: AlgoJiveXML.h:46
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
JiveXML::AlgoJiveXML::m_FormatTool
ToolHandle< JiveXML::IFormatTool > m_FormatTool
Handle to the formatting tool, which is passed on to the data retrievers and converts the data into X...
Definition: AlgoJiveXML.h:63
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
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
xAOD::EventInfo_v1::eventTypeBitmask
uint32_t eventTypeBitmask() const
The event type bitmask.
JiveXML::AlgoJiveXML::m_geometryVersionIn
Gaudi::Property< std::string > m_geometryVersionIn
Definition: AlgoJiveXML.h:50
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAOD::EventInfo_v1::timeStampNSOffset
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
JiveXML::AlgoJiveXML::m_AtlasRelease
Gaudi::Property< std::string > m_AtlasRelease
Definition: AlgoJiveXML.h:45
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::EventInfo_v1::mcChannelNumber
uint32_t mcChannelNumber() const
The MC generator's channel number.
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
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
calibdata.exception
exception
Definition: calibdata.py:496
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
SCT_Cabling::dateTime
std::string dateTime()
Definition: SCT_CablingXmlTags.h:55
JiveXML::AlgoJiveXML::m_StreamToServerTool
ToolHandle< JiveXML::IStreamTool > m_StreamToServerTool
Definition: AlgoJiveXML.h:70
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
JiveXML::AlgoJiveXML::m_DataRetrievers
ToolHandleArray< JiveXML::IDataRetriever > m_DataRetrievers
The list of DataRetrievers.
Definition: AlgoJiveXML.h:57
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
JiveXML::AlgoJiveXML::m_StreamToFileTool
ToolHandle< JiveXML::IStreamTool > m_StreamToFileTool
Streaming tools that pass the formatted XML text into a file, to a server, etc.
Definition: AlgoJiveXML.h:69
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
JiveXML::TagType
std::pair< std::string, std::string > TagType
Defines a tag as a pair of strings.
Definition: DataType.h:62
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
JiveXML::AlgoJiveXML::m_writeGeometry
Gaudi::Property< bool > m_writeGeometry
Definition: AlgoJiveXML.h:49
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::EventInfo_v1::subEvents
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
Definition: EventInfo_v1.cxx:596
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::EventInfo_v1::SubEvent
Class describing the properties of one pileup sub-event.
Definition: EventInfo_v1.h:286
xAOD::EventInfo_v1::mcEventNumber
uint64_t mcEventNumber() const
The MC generator's event number.
fitman.k
k
Definition: fitman.py:528
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
ServiceHandle< ICondSvc >