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

An Algorithm that manages a set of modules, each inheriting from ManagedMonitorToolBase, by setting common configuration variables and organizing the output data. More...

#include <AthenaMonManager.h>

Inheritance diagram for AthenaMonManager:
Collaboration diagram for AthenaMonManager:

Classes

class  Imp
 

Public Types

enum  Environment_t {
  user = 0, noOutput, online, tier0,
  tier0Raw, tier0ESD, AOD, altprod
}
 An enumeration of the different types of running environment the monitoring application may be in. More...
 
enum  DataType_t {
  userDefined = 0, monteCarlo, collisions, cosmics,
  heavyIonCollisions
}
 An enumeration of the different types of data the monitoring application may be running over. More...
 

Public Member Functions

 AthenaMonManager (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~AthenaMonManager ()
 
bool forkedProcess ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode start ()
 
virtual StatusCode stop ()
 
virtual StatusCode finalize ()
 
virtual std::string fileKey () const
 
virtual void passOwnership (TObject *h, const std::string &key)
 Pass ownership of a TObject/LWHist to this manager so that it will be deleted appropriately. More...
 
virtual void passOwnership (LWHist *h, const std::string &key)
 
virtual void writeAndDelete (const std::string &key)
 If the TObject is owned by this manager, its Write() method is called and it is deleted. More...
 
virtual LWHistownedLWHistOfKey (const std::string &key) const
 
virtual LWHistwriteAndDeleteLWHist (const std::string &key, const std::string &streamName)
 
virtual LWHistwriteAndResetLWHist (const std::string &key, const std::string &streamName)
 
virtual void writeAndDeleteLWHist (LWHist *lwh)
 
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
 

Static Public Member Functions

static Environment_t envStringToEnum (const std::string &str)
 Converts a string to an Environment_t of the same name. More...
 
static DataType_t dataTypeStringToEnum (const std::string &str)
 Converts a string to a DataType_t of the same name. More...
 
static Environment_t environment ()
 Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects determine which histograms to produce. More...
 
static DataType_t dataType ()
 Returns the data type that the monitoring application is running over to help ManagedMonitorToolBase objects determine which histograms to produce. More...
 
static unsigned int lumiBlockNumber ()
 
static unsigned int runNumber ()
 
static unsigned int fillNumber ()
 
static unsigned int getLBsLowStat ()
 
static unsigned int getLBsMedStat ()
 
static unsigned int getLBsHigStat ()
 

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

Protected Attributes

ToolHandleArray< IMonitorToolBasem_monTools
 
ITHistSvc * m_THistSvc
 

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

Impm_d
 
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

An Algorithm that manages a set of modules, each inheriting from ManagedMonitorToolBase, by setting common configuration variables and organizing the output data.

It provides all the functionality and behaviour of AthenaMon.

Author
Michael Wilson, CERN, January 2007

Definition at line 34 of file AthenaMonManager.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ DataType_t

An enumeration of the different types of data the monitoring application may be running over.

This can be used to select which histograms to produce, e.g., to prevent the production of colliding-beam histograms when running on cosmic-ray data. Strings of the same names may be given as jobOptions.

Enumerator
userDefined 
monteCarlo 
collisions 
cosmics 
heavyIonCollisions 

Definition at line 58 of file AthenaMonManager.h.

◆ Environment_t

An enumeration of the different types of running environment the monitoring application may be in.

The running environment may be used to select which histograms are produced, and where they are located in the output. For example, the output paths of the histograms are different for the "user", "online" and the various offline flags. The 'tier0Raw' and 'tier0ESD' are used to select sets of histograms for production either during the RAW --> ESD transform or during the ESD --> AOD transform (but not both!) Strings of the same names may be given as jobOptions.

Enumerator
user 
noOutput 
online 
tier0 
tier0Raw 
tier0ESD 
AOD 
altprod 

Definition at line 49 of file AthenaMonManager.h.

Constructor & Destructor Documentation

◆ AthenaMonManager()

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

Definition at line 207 of file AthenaMonManager.cxx.

209  : AthAlgorithm( name, pSvcLocator )
210  , m_monTools( this )
211  , m_THistSvc(0)
212  , m_d(new Imp(this, name))
213 {
214  declareProperty( "AthenaMonTools", m_monTools );
215  declareProperty( "CheckEveryNoEvents", m_d->m_everyNevents );
216  declareProperty( "FileKey", m_d->m_fileKeyProp );
217  declareProperty( "ManualDataTypeSetup", m_d->m_manualDataTypeSetupProp );
218  declareProperty( "DataType", m_d->m_dataTypeProp );
219  declareProperty( "Environment", m_d->m_environmentProp );
220  declareProperty( "LBsInLowStatInterval", m_d->m_LBsLowStatProp );
221  declareProperty( "LBsInMediumStatInterval", m_d->m_LBsMedStatProp );
222  declareProperty( "LBsInHighStatInterval", m_d->m_LBsHigStatProp );
223  declareProperty( "ManualRunLBSetup", m_d->m_manualRunLBProp );
224  declareProperty( "Run", m_d->m_runProp );
225  declareProperty( "LumiBlock", m_d->m_lumiBlockProp );
226  declareProperty( "ROOTBackend", m_d->m_rootBackend );
227 
228  if( !Imp::s_svcLocator )
229  Imp::s_svcLocator = pSvcLocator;
230 }

◆ ~AthenaMonManager()

AthenaMonManager::~AthenaMonManager ( )
virtual

Definition at line 233 of file AthenaMonManager.cxx.

235 {
236  if (m_d->m_nActiveLWHists)
237  msg(MSG::WARNING) << m_d->m_nActiveLWHists<< " LW histograms were created but never deleted" << endmsg;
238  /*
239  if (m_d->m_nMonGroupCopies)
240  msg(MSG::WARNING) << "Usage of MonGroup copy constructor or assignment operator detected in associated tools "
241  << m_d->m_nMonGroupCopies<<" time(s). This usually happens when tools pass MonGroup's around by"
242  <<" value. This behaviour will be forbidden at the compilation stage soon, so please fix your packages!" << endmsg;
243  */
244  delete m_d;
245 
246  // If it is known that ManagedMonitorToolBase objects are deleted _after_ this object,
247  // then one should call setMonManager(0) on each of them.
248 }

Member Function Documentation

◆ dataType()

AthenaMonManager::DataType_t AthenaMonManager::dataType ( )
static

Returns the data type that the monitoring application is running over to help ManagedMonitorToolBase objects determine which histograms to produce.

Definition at line 337 of file AthenaMonManager.cxx.

339 {
340  return Imp::s_dataType;
341 }

◆ dataTypeStringToEnum()

AthenaMonManager::DataType_t AthenaMonManager::dataTypeStringToEnum ( const std::string &  str)
static

Converts a string to a DataType_t of the same name.

Definition at line 289 of file AthenaMonManager.cxx.

291 {
292  std::string lcstr( strToLower(str) );
293 
294  if( lcstr == "userdefined" )
295  return userDefined;
296  else if( lcstr == "montecarlo" )
297  return monteCarlo;
298  else if( lcstr == "collisions" )
299  return collisions;
300  else if( lcstr == "cosmics" )
301  return cosmics;
302  else if( lcstr == "heavyioncollisions" )
303  return heavyIonCollisions;
304 
305  if( Imp::s_svcLocator ) {
306  IMessageSvc* ms(0);
307  StatusCode sc = Imp::s_svcLocator.load()->service( "MessageSvc", ms, true );
308  if( sc.isSuccess() ) {
309  MsgStream log( ms, "AthenaMonManager::dataTypeStringToEnum()" );
310  log << MSG::WARNING << "Unknown AthenaMonManager::DataType_t \""
311  << str << "\", returning \"userDefined\"" << endmsg;
312  }
313  }
314 
315  return userDefined;
316 }

◆ 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; }

◆ environment()

AthenaMonManager::Environment_t AthenaMonManager::environment ( )
static

Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects determine which histograms to produce.

Definition at line 320 of file AthenaMonManager.cxx.

322 {
323  return Imp::s_environment;
324 }

◆ envStringToEnum()

AthenaMonManager::Environment_t AthenaMonManager::envStringToEnum ( const std::string &  str)
static

Converts a string to an Environment_t of the same name.

static method (shared by all AthenaMonManager instances during run-time)

Definition at line 252 of file AthenaMonManager.cxx.

254 {
255  std::string lcstr( strToLower(str) );
256 
257  if( lcstr == "user" )
258  return user;
259  else if( lcstr == "nooutput" )
260  return noOutput;
261  else if( lcstr == "online" )
262  return online;
263  else if( lcstr == "tier0" )
264  return tier0;
265  else if( lcstr == "tier0raw" )
266  return tier0Raw;
267  else if( lcstr == "tier0esd" )
268  return tier0ESD;
269  else if( lcstr == "aod" )
270  return AOD;
271  else if( lcstr == "altprod" )
272  return altprod;
273 
274  if( Imp::s_svcLocator ) {
275  IMessageSvc* ms(0);
276  StatusCode sc = Imp::s_svcLocator.load()->service( "MessageSvc", ms, true );
277  if( sc.isSuccess() ) {
278  MsgStream log( ms, "AthenaMonManager::envStringToEnum()" );
279  log << MSG::WARNING << "Unknown AthenaMonManager::Environment_t \""
280  << str << "\", returning \"user\"" << endmsg;
281  }
282  }
283 
284  return user;
285 }

◆ 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 AthenaMonManager::execute ( )
virtual

Reimplemented in InDetGlobalManager.

Definition at line 511 of file AthenaMonManager.cxx.

513 {
514  m_d->m_forkedProcess=false;
515  pid_t currPID=getpid();
516  //m_lastPID 0 means the execute method was not called yet.
517  if (m_d->m_lastPID!=0 && m_d->m_lastPID!=currPID) {
518  m_d->m_forkedProcess=true;
519  ATH_MSG_INFO("Forked event discovered!");
520  }
521  m_d->m_lastPID=currPID;
522 
523  Imp::LWHistLeakChecker lc(m_d);
524  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::execute():" << endmsg;
525 
526  // This is legacy R2 monitoring.
527  // We only permit serial access (over all slots) to both HLT monitoring AND navigation thinning, as both use the same underlying thread un-safe navigation tool
528  // All of these elements are deprecated for R3 and are in the process of being replaced.
529  std::unique_lock<std::mutex> hltLock(TrigNavigationThinningSvcMutex::s_mutex, std::defer_lock);
530  if (name() == "HLTMonManager") {
531  ATH_MSG_DEBUG("HLTMonManager is obtaining the TrigNavigationThinningSvc lock in slot "
532  << Gaudi::Hive::currentContext().slot() << " for event " << Gaudi::Hive::currentContext().eventID().event_number() );
533  hltLock.lock();
534  }
535 
536  StatusCode sc;
537 
539  for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
540  ToolHandle<IMonitorToolBase>& tool = *i;
542  AthMonBench bench_tmp;
543  if (m_d->m_doResourceMon)
544  bench_tmp.startMeasurement();
545  if( tool->preSelector() ) {
546 
547  sc = tool->fillHists();
548 
549  if( !sc.isSuccess() ) {
550  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::fillHists() unsuccessful" << endmsg;
551  }
552  }
553 
554 
555  if (m_d->m_doResourceMon) {
556  bench_tmp.finishMeasurement();
557  Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
558  tb->m_bench_algexec_fillHists += bench_tmp;//fixme: count events and subdivide
559  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> m_doResourceMon is True" << endmsg;
560  }
561  m_d->toolAudEnd();
562  }
563  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::fillHists()" << endmsg;
564 
565  if( m_d->m_eventCounter > 0 ) {
566  m_d->m_eventCounter--;
567  }
568  else if( m_d->m_eventCounter == 0 ) {
569  for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
570  ToolHandle<IMonitorToolBase>& tool = *i;
572  AthMonBench bench_tmp;
573 
574  if (m_d->m_doResourceMon)
575  bench_tmp.startMeasurement();
576  sc = tool->checkHists(false);
577  if (m_d->m_doResourceMon) {
578  bench_tmp.finishMeasurement();
579  Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
580  tb->m_bench_algexec_checkHists += bench_tmp;//fixme: count events and subdivide
581  }
582  if( !sc.isSuccess() ) {
583  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::checkHists() unsuccessful" << endmsg;
584  }
585  m_d->toolAudEnd();
586  }
587  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::checkHists()" << endmsg;
588 
590  }
591  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
592 
593  ATH_MSG_DEBUG(name() << " is releasing the TrigNavigationThinningSvc lock");
594  return StatusCode::SUCCESS;
595 }

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

◆ fileKey()

std::string AthenaMonManager::fileKey ( ) const
virtual

Definition at line 698 of file AthenaMonManager.cxx.

700 {
701  return m_d->m_fileKeyProp;
702 }

◆ fillNumber()

unsigned int AthenaMonManager::fillNumber ( )
static

Definition at line 375 of file AthenaMonManager.cxx.

377 {
378  return Imp::s_fill;
379 }

◆ finalize()

StatusCode AthenaMonManager::finalize ( )
virtual

Reimplemented in InDetGlobalManager.

Definition at line 599 of file AthenaMonManager.cxx.

601 {
602  return StatusCode::SUCCESS;
603 }

◆ forkedProcess()

bool AthenaMonManager::forkedProcess ( )

Definition at line 344 of file AthenaMonManager.cxx.

345  {
346  return m_d->m_forkedProcess;
347 }

◆ getLBsHigStat()

unsigned int AthenaMonManager::getLBsHigStat ( )
static

Definition at line 332 of file AthenaMonManager.cxx.

332  {
333  return Imp::s_LBsHigStat;
334 }

◆ getLBsLowStat()

unsigned int AthenaMonManager::getLBsLowStat ( )
static

Definition at line 326 of file AthenaMonManager.cxx.

326  {
327  return Imp::s_LBsLowStat;
328 }

◆ getLBsMedStat()

unsigned int AthenaMonManager::getLBsMedStat ( )
static

Definition at line 329 of file AthenaMonManager.cxx.

329  {
330  return Imp::s_LBsMedStat;
331 }

◆ initialize()

StatusCode AthenaMonManager::initialize ( )
virtual

Reimplemented in InDetGlobalManager.

Definition at line 383 of file AthenaMonManager.cxx.

385 {
386  Imp::LWHistLeakChecker lc(m_d);
387 
388  //typedef std::vector<IMonitorToolBase*> MonList_t;
389  //typedef MonList_t::iterator MonIter_t;
390 
391  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::initialize():" << endmsg;
392 
393  if (Imp::s_svcLocator.load()->service("SGAudSvc", m_d->m_sgAudSvc, false/*do not create*/).isFailure())
394  m_d->m_sgAudSvc=0;
395 
396 
398 
399  StatusCode sc;
400 
401  sc = service( "THistSvc", m_THistSvc, true );
402  if( !sc.isSuccess() ) {
403  msg(MSG::ERROR) << "!! Unable to locate the THistSvc service !!" << endmsg;
404  return sc;
405  }
406 
407  if( !Imp::s_staticDataAreInit ) {
408  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Initializing static data" << endmsg;
409 
410  if (msgLvl(MSG::DEBUG)) {
411  msg(MSG::DEBUG) << " * \"ManualDataTypeSetup\" = " << m_d->m_manualDataTypeSetupProp << endmsg;
412  }
413 
414 #if 0 // The two branches of the conditional are identical.
416  Imp::s_dataTypeStr = m_d->m_dataTypeProp;
417  Imp::s_dataType = dataTypeStringToEnum( m_d->m_dataTypeProp );
418  }
419  else
420 #endif
421  {
422  Imp::s_dataTypeStr = m_d->m_dataTypeProp;
423  Imp::s_dataType = dataTypeStringToEnum( m_d->m_dataTypeProp );
424  }
425 
426  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"DataType\" = " << Imp::s_dataType << endmsg;
427 
428  Imp::s_environmentStr = m_d->m_environmentProp;
429  Imp::s_environment = envStringToEnum( m_d->m_environmentProp );
430 
431  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"Environment\" = " << Imp::s_environment << endmsg;
432 
433  Imp::s_LBsLowStat = m_d->m_LBsLowStatProp;
434  Imp::s_LBsMedStat = m_d->m_LBsMedStatProp;
435  Imp::s_LBsHigStat = m_d->m_LBsHigStatProp;
436  if (msgLvl(MSG::DEBUG)) {
437  msg(MSG::DEBUG) << " * \"LBsInLowStatInterval\" = " << Imp::s_LBsLowStat << endmsg;
438  msg(MSG::DEBUG) << " * \"LBsInMediumStatInterval\" = " << Imp::s_LBsMedStat << endmsg;
439  msg(MSG::DEBUG) << " * \"LBsInHighStatInterval\" = " << Imp::s_LBsHigStat << endmsg;
440  }
441 
442  m_d->m_isPrimaryManager = true;
444 
445  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"ManualRunLBSetup\" = " << m_d->m_manualRunLBProp << endmsg;
446 
447  if( m_d->m_manualRunLBProp ) {
448  Imp::s_run = m_d->m_runProp;
449  Imp::s_lumiBlock = m_d->m_lumiBlockProp;
450  Imp::s_runLBOverridden = true;
451  if (msgLvl(MSG::DEBUG))
452  msg(MSG::DEBUG) << " --> using run = " << Imp::s_run << ", lumiBlock = " << Imp::s_lumiBlock << endmsg;
453  } else {
454  if (msgLvl(MSG::DEBUG))
455  msg(MSG::DEBUG) << " --> using run = " << Imp::s_run << ", lumiBlock = " << Imp::s_lumiBlock << endmsg;
456  }
457  }
458 
459  // Ensure consistency among all managers
460  m_d->m_dataTypeProp = Imp::s_dataTypeStr;
461  m_d->m_environmentProp = Imp::s_environmentStr;
462 
463  // Provide a virtual Algorithm with a subset of the properties
464  ServiceHandle<Gaudi::Interfaces::IOptionsSvc> joSvc("JobOptionsSvc", name());
465  ATH_CHECK( joSvc.retrieve() );
466  ATH_MSG_DEBUG(" --> Found service \"JobOptionsSvc\"");
467 
468  const std::string client = name() + std::string("Properties");
469  ATH_MSG_DEBUG(" --> Adding properties under name \"" << client << "\"");
470  joSvc->set( client + ".FileKey", m_d->m_fileKeyProp );
471  joSvc->set( client + ".DataType", m_d->m_dataTypeProp );
472  joSvc->set( client + ".Environment", m_d->m_environmentProp );
473 
474  // LWHists not thread-safe. Use alg property to use ROOT backend in MT mode.
475  ATH_MSG_DEBUG("Setting LWHist ROOT backend flag to " << m_d->m_rootBackend);
477 
478  if( m_monTools.size() > 0 ) {
479  sc = m_monTools.retrieve();
480  if( !sc.isSuccess() ) {
481  msg(MSG::ERROR) << "!! Unable to retrieve monitoring tool " << m_monTools << endmsg;
482  return sc;
483  }
484  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Retrieved AthenaMonTools" << endmsg;
485  }
486 
488 
490  for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
491  ToolHandle<IMonitorToolBase>& tool = *i;
492  AthMonBench bench_tmp;
493  IMonitorToolBase* mon = tool.operator->();
494  ManagedMonitorToolBase* managed = dynamic_cast<ManagedMonitorToolBase*>( mon );
495  if( managed != 0 ) {
496  managed->setMonManager( this );
497  }
498  if (m_d->m_doResourceMon) {
499  Imp::ToolBench* tb = m_d->getToolBench(mon);
500  tb->m_bench_alginit_retrieve = bench_tmp;
501  }
502 
503  }
504  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
505 
506  return StatusCode::SUCCESS;
507 }

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

◆ lumiBlockNumber()

unsigned int AthenaMonManager::lumiBlockNumber ( )
static

Definition at line 351 of file AthenaMonManager.cxx.

353 {
354  if (Imp::s_runLBOverridden) {
355  return Imp::s_lumiBlock;
356  } else {
357  return Gaudi::Hive::currentContext().eventID().lumi_block();
358  }
359 }

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

◆ ownedLWHistOfKey()

LWHist * AthenaMonManager::ownedLWHistOfKey ( const std::string &  key) const
virtual

Definition at line 725 of file AthenaMonManager.cxx.

727 {
729  return iLW == m_d->m_objMapLW.end() ? 0 : iLW->second;
730 }

◆ passOwnership() [1/2]

void AthenaMonManager::passOwnership ( LWHist h,
const std::string &  key 
)
virtual

Definition at line 715 of file AthenaMonManager.cxx.

717 {
718  Imp::ObjMapLW_t::value_type valToInsert( key, h );
719  m_d->m_objMapLW.insert( valToInsert );
720 }

◆ passOwnership() [2/2]

void AthenaMonManager::passOwnership ( TObject *  h,
const std::string &  key 
)
virtual

Pass ownership of a TObject/LWHist to this manager so that it will be deleted appropriately.

Definition at line 706 of file AthenaMonManager.cxx.

708 {
709  Imp::ObjMap_t::value_type valToInsert( key, h );
710  m_d->m_objMap.insert( valToInsert );
711 }

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

◆ runNumber()

unsigned int AthenaMonManager::runNumber ( )
static

Definition at line 363 of file AthenaMonManager.cxx.

365 {
366  if (Imp::s_runLBOverridden) {
367  return Imp::s_run;
368  } else {
369  return Gaudi::Hive::currentContext().eventID().run_number();
370  }
371 }

◆ start()

StatusCode AthenaMonManager::start ( )
virtual

Definition at line 662 of file AthenaMonManager.cxx.

664 {
665  Imp::LWHistLeakChecker lc(m_d);
666  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::start():" << endmsg;
667 
668  StatusCode sc;
669 
671  for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
672  ToolHandle<IMonitorToolBase>& tool = *i;
674  AthMonBench bench_tmp;
675  if (m_d->m_doResourceMon)
676  bench_tmp.startMeasurement();
677  sc = tool->bookHists();
678  if (m_d->m_doResourceMon) {
679  bench_tmp.finishMeasurement();
680  Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
681  tb->m_bench_algexec_bookHists += bench_tmp;
682  }
683  if( !sc.isSuccess() ) {
684  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::bookHists() unsuccessful" << endmsg;
685  }
686  m_d->toolAudEnd();
687  }
688  if (msgLvl(MSG::DEBUG)) {
689  msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::bookHists()" << endmsg;
690  msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
691  }
692 
693  return StatusCode::SUCCESS;
694 }

◆ stop()

StatusCode AthenaMonManager::stop ( )
virtual

Definition at line 606 of file AthenaMonManager.cxx.

608 {
609  Imp::LWHistLeakChecker lc(m_d);
610  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::finalize():" << endmsg;
611 
612  StatusCode sc;
613 
615  for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
616  ToolHandle<IMonitorToolBase>& tool = *i;
618 
619  sc = tool->runStat();
620  if( !sc.isSuccess() ) {
621  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::runStat() unsuccessful" << endmsg;
622  }
623 
624  Imp::ToolBench* tb = m_d->m_doResourceMon ? m_d->getToolBench(tool.operator->()) : 0;
625  if (tb)
626  tb->m_bench_algfin_finalHists.startMeasurement();
627  sc = tool->finalHists();
628  if (tb)
629  tb->m_bench_algfin_finalHists.finishMeasurement();
630  if( !sc.isSuccess() ) {
631  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::finalHists() unsuccessful" << endmsg;
632  }
633  if (tb)
634  tb->m_bench_algfin_checkHists.startMeasurement();
635  sc = tool->checkHists(true);
636  if (tb)
637  tb->m_bench_algfin_checkHists.finishMeasurement();
638  if( !sc.isSuccess() ) {
639  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::checkHists() unsuccessful" << endmsg;
640  }
641  if (tb)
642  tb->m_bench_algfin_convertLWHists.startMeasurement();
643  sc = tool->convertLWHists();
644  if (tb)
645  tb->m_bench_algfin_convertLWHists.finishMeasurement();
646  if( !sc.isSuccess() ) {
647  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::convertLWHists() unsuccessful" << endmsg;
648  }
649  if (tb)
650  tb->report(this);
651  m_d->toolAudEnd();
652  }
653  if (msgLvl(MSG::DEBUG)) {
654  msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::finalHists() and IMonitorToolBase::checkHists()" << endmsg;
655  msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
656  }
657  return StatusCode::SUCCESS;
658 }

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

◆ writeAndDelete()

void AthenaMonManager::writeAndDelete ( const std::string &  key)
virtual

If the TObject is owned by this manager, its Write() method is called and it is deleted.

Definition at line 869 of file AthenaMonManager.cxx.

871 {
872  // If is owned TObject, we deregister from THistSvc, write it in a
873  // root file, and delete it.
874 
876  if( i != m_d->m_objMap.end() ) {
877  TObject* o = i->second;
878  TH1* h = dynamic_cast<TH1*>( o );
879  if( h != 0 ) {
880  // By default, ROOT does its own bookkeeping of references to
881  // histograms, and this leads to a significant amount of time
882  // spent in the TObject d'tor when there are >= O(1000) TDirectories.
883  // So, turn this bookkeeping off when deleting these histograms.
884  bool doRecursiveReferenceDelete = gROOT->MustClean();
885  gROOT->SetMustClean(false);
886  TDirectory* dir = h->GetDirectory();
887  TDirectory* g = gDirectory;
888  if( dir )
889  dir->cd();
890  h->Write();
891  g->cd();
892 
893  StatusCode sc = m_THistSvc->deReg( h );
894  if( !sc.isSuccess() ) {
895  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" << endmsg;
896  }
897  delete o;
898  gROOT->SetMustClean(doRecursiveReferenceDelete);
899  m_d->m_objMap.erase( key );
900  }
901  }
902 }

◆ writeAndDeleteLWHist() [1/2]

LWHist * AthenaMonManager::writeAndDeleteLWHist ( const std::string &  key,
const std::string &  streamName 
)
virtual

Definition at line 742 of file AthenaMonManager.cxx.

744 {
745 // std::cout<<"writeAndDeleteLWHist... maybe"<<std::endl;
746  //If is owned LWHist we write it in a root file and deletes it + returns it's (now deallocated) address.
747 
749  if( iLW != m_d->m_objMapLW.end() )
750  {
751  //Fixme: add private helper method actualWriteAndDelete(TH1*), to use by both...
752  LWHist * lwhist =iLW->second;
753  TH1 * h = lwhist->getROOTHistBase();
754  if( h != 0 )
755  {
756  //Get correct dir by doing a quick reg/dereg:
757  bool ok(false);
758  if (lwhist->usingROOTBackend())
759  {
760  //Already registered
761  ok = true;
762  }
763  else
764  {
765  //Delayed registration:
766  if (m_THistSvc->regHist( streamName, h ).isSuccess())
767  // if (m_THistSvc->deReg( h ).isSuccess())
768  ok = true;
769  }
770 
771  if (ok)
772  {
773  bool doRecursiveReferenceDelete = gROOT->MustClean();
774  gROOT->SetMustClean(false);
775  TDirectory* dir = h->GetDirectory();
776  TDirectory* g = gDirectory;
777  if(dir)
778  dir->cd();
779  h->Write();
780  g->cd();
781 
782  StatusCode sc = m_THistSvc->deReg( h );
783  if( !sc.isSuccess() )
784  {
785  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" << endmsg;
786  }
787 
788  m_d->m_objMapLW.erase( iLW );
789  lwhist->setOwnsROOTHisto(true);//Since we deregistered
791  lwhist=0;
792  gROOT->SetMustClean(doRecursiveReferenceDelete);//Should be after the deleteLWHist call
793  }
794  return lwhist;
795  }
796  }
797  return 0;
798 }

◆ writeAndDeleteLWHist() [2/2]

void AthenaMonManager::writeAndDeleteLWHist ( LWHist lwh)
virtual

Definition at line 734 of file AthenaMonManager.cxx.

◆ writeAndResetLWHist()

LWHist * AthenaMonManager::writeAndResetLWHist ( const std::string &  key,
const std::string &  streamName 
)
virtual

Definition at line 801 of file AthenaMonManager.cxx.

803 {
804 // std::cout<<"writeAndDeleteLWHist... maybe"<<std::endl;
805  //If is owned LWHist we write it in a root file and deletes it + returns it's (now deallocated) address.
806 
808  if( iLW != m_d->m_objMapLW.end() )
809  {
810  //Fixme: add private helper method actualWriteAndDelete(TH1*), to use by both...
811  LWHist * lwhist =iLW->second;
812  TH1 * h = lwhist->getROOTHistBase();
813  if( h != 0 )
814  {
815  //Get correct dir by doing a quick reg/dereg:
816  bool ok(false);
817  if (lwhist->usingROOTBackend())
818  {
819  //Already registered
820  ok = true;
821  }
822  else
823  {
824  //Delayed registration:
825  if (m_THistSvc->regHist( streamName, h ).isSuccess())
826  // if (m_THistSvc->deReg( h ).isSuccess())
827  ok = true;
828  }
829 
830  if (ok)
831  {
832  bool doRecursiveReferenceDelete = gROOT->MustClean();
833  gROOT->SetMustClean(false);
834  TDirectory* dir = h->GetDirectory();
835  TDirectory* g = gDirectory;
836  if(dir)
837  dir->cd();
838  h->Write();
839  g->cd();
840 
841  StatusCode sc = m_THistSvc->deReg( h );
842  if( !sc.isSuccess() )
843  {
844  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" << endmsg;
845  }
846 
847  m_d->m_objMapLW.erase( iLW );
848  lwhist->setOwnsROOTHisto(true);//Since we deregistered
849 
850  //LWHistAthMonWrapper::deleteLWHist(lwhist);
851  // Yuriy: commented out this line to make the code properly place histograms
852  // in the offline environament; It has been a bug after I fixed online environment
853  // with a new approach; Basically inherited from writeAndDeletLWHist(...)
854  //LWHistAthMonWrapper::removeCustomData(lwhist);
855 
856  lwhist->Reset();
857 
858  lwhist=0;
859  gROOT->SetMustClean(doRecursiveReferenceDelete);//Should be after the deleteLWHist call
860  }
861  return lwhist;
862  }
863  }
864  return 0;
865 }

Member Data Documentation

◆ m_d

Imp* AthenaMonManager::m_d
private

Definition at line 130 of file AthenaMonManager.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_monTools

ToolHandleArray<IMonitorToolBase> AthenaMonManager::m_monTools
protected

Definition at line 123 of file AthenaMonManager.h.

◆ m_THistSvc

ITHistSvc* AthenaMonManager::m_THistSvc
protected

Definition at line 125 of file AthenaMonManager.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.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LWHist
Definition: LWHist.h:26
pid_t
int32_t pid_t
Definition: FPGATrackSimTypes.h:19
AthenaMonManager::writeAndDeleteLWHist
virtual LWHist * writeAndDeleteLWHist(const std::string &key, const std::string &streamName)
Definition: AthenaMonManager.cxx:743
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:74
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthenaMonManager::Imp::m_eventCounter
long m_eventCounter
Definition: AthenaMonManager.cxx:89
AthenaMonManager::cosmics
@ cosmics
Definition: AthenaMonManager.h:58
AthenaMonManager::AOD
@ AOD
Definition: AthenaMonManager.h:49
AthenaMonManager::Imp::m_everyNevents
long m_everyNevents
Definition: AthenaMonManager.cxx:88
AthenaMonManager::envStringToEnum
static Environment_t envStringToEnum(const std::string &str)
Converts a string to an Environment_t of the same name.
Definition: AthenaMonManager.cxx:253
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthenaMonManager::Imp::m_objMap
ObjMap_t m_objMap
Definition: AthenaMonManager.cxx:78
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
AthenaMonManager::heavyIonCollisions
@ heavyIonCollisions
Definition: AthenaMonManager.h:58
AthenaMonManager::Imp::s_staticDataAreInit
static std::atomic< bool > s_staticDataAreInit
Definition: AthenaMonManager.cxx:180
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaMonManager::Imp::s_svcLocator
static std::atomic< ISvcLocator * > s_svcLocator
Definition: AthenaMonManager.cxx:178
python.LumiCalcHtml.lc
lc
Definition: LumiCalcHtml.py:579
AthenaMonManager::Imp::m_nActiveLWHists
long m_nActiveLWHists
Definition: AthenaMonManager.cxx:104
AthenaMonManager::Imp::toolAudStart
void toolAudStart(const T &tool)
Definition: AthenaMonManager.cxx:127
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
AthenaMonManager::m_d
Imp * m_d
Definition: AthenaMonManager.h:129
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthenaMonManager::Imp::m_runProp
unsigned int m_runProp
Definition: AthenaMonManager.cxx:100
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthenaMonManager::Imp::m_isPrimaryManager
bool m_isPrimaryManager
Definition: AthenaMonManager.cxx:86
LWHistAthMonWrapper::streamName
static const std::string & streamName(LWHist *)
rerun_display.client
client
Definition: rerun_display.py:31
AthenaMonManager::Imp::m_sgAudSvc
ISGAudSvc * m_sgAudSvc
Definition: AthenaMonManager.cxx:84
AthenaMonManager::Imp::m_environmentProp
std::string m_environmentProp
Definition: AthenaMonManager.cxx:95
LWHist::usingROOTBackend
bool usingROOTBackend() const
Definition: LWHist.h:73
Execution.tb
tb
Definition: Execution.py:15
AthMonBench::finishMeasurement
void finishMeasurement()
Definition: AthMonBench.h:91
AthenaMonManager::Imp::m_dataTypeProp
std::string m_dataTypeProp
Definition: AthenaMonManager.cxx:94
AthenaMonManager::tier0ESD
@ tier0ESD
Definition: AthenaMonManager.h:49
AthenaMonManager::Imp::m_LBsLowStatProp
unsigned int m_LBsLowStatProp
Definition: AthenaMonManager.cxx:96
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
LWHistAthMonWrapper::key
static const std::string & key(LWHist *)
AthenaMonManager::dataTypeStringToEnum
static DataType_t dataTypeStringToEnum(const std::string &str)
Converts a string to a DataType_t of the same name.
Definition: AthenaMonManager.cxx:290
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ManagedMonitorToolBase::setMonManager
virtual void setMonManager(AthenaMonManager *manager)
Takes a pointer to a managing object to get information from it when needed.
Definition: ManagedMonitorToolBase.cxx:1436
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:92
AthenaMonManager::collisions
@ collisions
Definition: AthenaMonManager.h:58
TrigNavigationThinningSvcMutex::s_mutex
static std::mutex s_mutex
Definition: TrigNavigationThinningSvcMutex.h:19
AthenaMonManager::tier0
@ tier0
Definition: AthenaMonManager.h:49
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
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
AthenaMonManager::online
@ online
Definition: AthenaMonManager.h:49
AthenaMonManager::Imp::m_manualDataTypeSetupProp
bool m_manualDataTypeSetupProp
Definition: AthenaMonManager.cxx:93
LWHistControls::setROOTBackend
static void setROOTBackend(bool)
Definition: LWHistControls.cxx:53
AthenaMonManager::tier0Raw
@ tier0Raw
Definition: AthenaMonManager.h:49
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaMonManager::user
@ user
Definition: AthenaMonManager.h:49
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthenaMonManager::Imp::toolAudEnd
void toolAudEnd()
Definition: AthenaMonManager.cxx:130
AthenaMonManager::m_monTools
ToolHandleArray< IMonitorToolBase > m_monTools
Definition: AthenaMonManager.h:123
AthenaMonManager::Imp::m_manualRunLBProp
bool m_manualRunLBProp
Definition: AthenaMonManager.cxx:98
beamspotman.dir
string dir
Definition: beamspotman.py:623
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
AthenaMonManager::Imp::m_LBsMedStatProp
unsigned int m_LBsMedStatProp
Definition: AthenaMonManager.cxx:96
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
IMonitorToolBase
Definition: IMonitorToolBase.h:25
AthMonBench::s_resourceMonThreshold
static const MSG::Level s_resourceMonThreshold
Definition: AthMonBench.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
AthMonBench::startMeasurement
void startMeasurement()
Definition: AthMonBench.h:83
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
AthenaMonManager::Imp::m_fileKeyProp
std::string m_fileKeyProp
Definition: AthenaMonManager.cxx:91
AthenaMonManager::Imp::getToolBench
ToolBench * getToolBench(IMonitorToolBase *t)
Definition: AthenaMonManager.cxx:163
LWHist::setOwnsROOTHisto
void setOwnsROOTHisto(bool b)
Definition: LWHist.h:75
AthenaMonManager::Imp::m_doResourceMon
bool m_doResourceMon
Definition: AthenaMonManager.cxx:134
AthenaMonManager::Imp::m_forkedProcess
bool m_forkedProcess
Definition: AthenaMonManager.cxx:106
LWHist::Reset
virtual void Reset()=0
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
AthenaMonManager::Imp::m_rootBackend
bool m_rootBackend
Definition: AthenaMonManager.cxx:109
LWHistAthMonWrapper::deleteLWHist
static void deleteLWHist(LWHist *)
a
TList * a
Definition: liststreamerinfos.cxx:10
h
AthenaMonManager::Imp::m_lumiBlockProp
unsigned int m_lumiBlockProp
Definition: AthenaMonManager.cxx:101
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthenaMonManager::altprod
@ altprod
Definition: AthenaMonManager.h:49
AthenaMonManager::Imp::m_lastPID
pid_t m_lastPID
Definition: AthenaMonManager.cxx:107
TH1
Definition: rootspy.cxx:268
DEBUG
#define DEBUG
Definition: page_access.h:11
plotBeamSpotMon.mon
mon
Definition: plotBeamSpotMon.py:67
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
AthenaMonManager::Imp::m_LBsHigStatProp
unsigned int m_LBsHigStatProp
Definition: AthenaMonManager.cxx:96
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthenaMonManager::m_THistSvc
ITHistSvc * m_THistSvc
Definition: AthenaMonManager.h:125
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
AthenaMonManager::Imp::m_objMapLW
ObjMapLW_t m_objMapLW
Definition: AthenaMonManager.cxx:81
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthenaMonManager::userDefined
@ userDefined
Definition: AthenaMonManager.h:58
python.root_pickle.load
def load(f, use_proxy=1, key=None)
Definition: root_pickle.py:476
LWHist::getROOTHistBase
virtual TH1 * getROOTHistBase()=0
AthMonBench
Definition: AthMonBench.h:27
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthenaMonManager::noOutput
@ noOutput
Definition: AthenaMonManager.h:49
AthenaMonManager::monteCarlo
@ monteCarlo
Definition: AthenaMonManager.h:58
fitman.k
k
Definition: fitman.py:528
ServiceHandle< Gaudi::Interfaces::IOptionsSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37