![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
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>
|
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...
|
|
|
| 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 LWHist * | ownedLWHistOfKey (const std::string &key) const |
|
virtual LWHist * | writeAndDeleteLWHist (const std::string &key, const std::string &streamName) |
|
virtual LWHist * | writeAndResetLWHist (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 |
|
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.
◆ StoreGateSvc_t
◆ 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.
◆ AthenaMonManager()
AthenaMonManager::AthenaMonManager |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AthenaMonManager()
AthenaMonManager::~AthenaMonManager |
( |
| ) |
|
|
virtual |
◆ dataType()
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.
340 return Imp::s_dataType;
◆ dataTypeStringToEnum()
Converts a string to a DataType_t of the same name.
Definition at line 289 of file AthenaMonManager.cxx.
292 std::string lcstr( strToLower(
str) );
294 if( lcstr ==
"userdefined" )
296 else if( lcstr ==
"montecarlo" )
298 else if( lcstr ==
"collisions" )
300 else if( lcstr ==
"cosmics" )
302 else if( lcstr ==
"heavyioncollisions" )
308 if(
sc.isSuccess() ) {
309 MsgStream
log(
ms,
"AthenaMonManager::dataTypeStringToEnum()" );
310 log << MSG::WARNING <<
"Unknown AthenaMonManager::DataType_t \""
311 <<
str <<
"\", returning \"userDefined\"" <<
endmsg;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ environment()
◆ envStringToEnum()
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.
255 std::string lcstr( strToLower(
str) );
257 if( lcstr ==
"user" )
259 else if( lcstr ==
"nooutput" )
261 else if( lcstr ==
"online" )
263 else if( lcstr ==
"tier0" )
265 else if( lcstr ==
"tier0raw" )
267 else if( lcstr ==
"tier0esd" )
269 else if( lcstr ==
"aod" )
271 else if( lcstr ==
"altprod" )
277 if(
sc.isSuccess() ) {
278 MsgStream
log(
ms,
"AthenaMonManager::envStringToEnum()" );
279 log << MSG::WARNING <<
"Unknown AthenaMonManager::Environment_t \""
280 <<
str <<
"\", returning \"user\"" <<
endmsg;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode AthenaMonManager::execute |
( |
| ) |
|
|
virtual |
Reimplemented in InDetGlobalManager.
Definition at line 511 of file AthenaMonManager.cxx.
515 pid_t currPID=getpid();
523 Imp::LWHistLeakChecker
lc(
m_d);
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() );
540 ToolHandle<IMonitorToolBase>&
tool = *
i;
545 if(
tool->preSelector() ) {
549 if( !
sc.isSuccess() ) {
550 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::fillHists() unsuccessful" <<
endmsg;
558 tb->m_bench_algexec_fillHists += bench_tmp;
570 ToolHandle<IMonitorToolBase>&
tool = *
i;
576 sc =
tool->checkHists(
false);
580 tb->m_bench_algexec_checkHists += bench_tmp;
582 if( !
sc.isSuccess() ) {
583 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::checkHists() unsuccessful" <<
endmsg;
594 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ fileKey()
std::string AthenaMonManager::fileKey |
( |
| ) |
const |
|
virtual |
◆ fillNumber()
unsigned int AthenaMonManager::fillNumber |
( |
| ) |
|
|
static |
◆ finalize()
StatusCode AthenaMonManager::finalize |
( |
| ) |
|
|
virtual |
◆ forkedProcess()
bool AthenaMonManager::forkedProcess |
( |
| ) |
|
◆ getLBsHigStat()
unsigned int AthenaMonManager::getLBsHigStat |
( |
| ) |
|
|
static |
◆ getLBsLowStat()
unsigned int AthenaMonManager::getLBsLowStat |
( |
| ) |
|
|
static |
◆ getLBsMedStat()
unsigned int AthenaMonManager::getLBsMedStat |
( |
| ) |
|
|
static |
◆ initialize()
StatusCode AthenaMonManager::initialize |
( |
| ) |
|
|
virtual |
Reimplemented in InDetGlobalManager.
Definition at line 383 of file AthenaMonManager.cxx.
386 Imp::LWHistLeakChecker
lc(
m_d);
402 if( !
sc.isSuccess() ) {
403 msg(MSG::ERROR) <<
"!! Unable to locate the THistSvc service !!" <<
endmsg;
414 #if 0 // The two branches of the conditional are identical.
450 Imp::s_runLBOverridden =
true;
452 msg(
MSG::DEBUG) <<
" --> using run = " << Imp::s_run <<
", lumiBlock = " << Imp::s_lumiBlock <<
endmsg;
455 msg(
MSG::DEBUG) <<
" --> using run = " << Imp::s_run <<
", lumiBlock = " << Imp::s_lumiBlock <<
endmsg;
468 const std::string
client =
name() + std::string(
"Properties");
480 if( !
sc.isSuccess() ) {
491 ToolHandle<IMonitorToolBase>&
tool = *
i;
500 tb->m_bench_alginit_retrieve = bench_tmp;
506 return StatusCode::SUCCESS;
◆ inputHandles()
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.
354 if (Imp::s_runLBOverridden) {
355 return Imp::s_lumiBlock;
357 return Gaudi::Hive::currentContext().eventID().lumi_block();
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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 |
◆ passOwnership() [1/2]
void AthenaMonManager::passOwnership |
( |
LWHist * |
h, |
|
|
const std::string & |
key |
|
) |
| |
|
virtual |
◆ 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.
709 Imp::ObjMap_t::value_type valToInsert(
key,
h );
◆ renounce()
◆ renounceArray()
◆ runNumber()
unsigned int AthenaMonManager::runNumber |
( |
| ) |
|
|
static |
Definition at line 363 of file AthenaMonManager.cxx.
366 if (Imp::s_runLBOverridden) {
369 return Gaudi::Hive::currentContext().eventID().run_number();
◆ start()
StatusCode AthenaMonManager::start |
( |
| ) |
|
|
virtual |
Definition at line 662 of file AthenaMonManager.cxx.
665 Imp::LWHistLeakChecker
lc(
m_d);
672 ToolHandle<IMonitorToolBase>&
tool = *
i;
681 tb->m_bench_algexec_bookHists += bench_tmp;
683 if( !
sc.isSuccess() ) {
684 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::bookHists() unsuccessful" <<
endmsg;
693 return StatusCode::SUCCESS;
◆ stop()
StatusCode AthenaMonManager::stop |
( |
| ) |
|
|
virtual |
Definition at line 606 of file AthenaMonManager.cxx.
609 Imp::LWHistLeakChecker
lc(
m_d);
616 ToolHandle<IMonitorToolBase>&
tool = *
i;
620 if( !
sc.isSuccess() ) {
621 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::runStat() unsuccessful" <<
endmsg;
626 tb->m_bench_algfin_finalHists.startMeasurement();
629 tb->m_bench_algfin_finalHists.finishMeasurement();
630 if( !
sc.isSuccess() ) {
631 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::finalHists() unsuccessful" <<
endmsg;
634 tb->m_bench_algfin_checkHists.startMeasurement();
635 sc =
tool->checkHists(
true);
637 tb->m_bench_algfin_checkHists.finishMeasurement();
638 if( !
sc.isSuccess() ) {
639 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::checkHists() unsuccessful" <<
endmsg;
642 tb->m_bench_algfin_convertLWHists.startMeasurement();
643 sc =
tool->convertLWHists();
645 tb->m_bench_algfin_convertLWHists.finishMeasurement();
646 if( !
sc.isSuccess() ) {
647 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::convertLWHists() unsuccessful" <<
endmsg;
654 msg(
MSG::DEBUG) <<
" --> Done calling IMonitorToolBase::finalHists() and IMonitorToolBase::checkHists()" <<
endmsg;
657 return StatusCode::SUCCESS;
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ 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.
877 TObject* o =
i->second;
878 TH1*
h =
dynamic_cast<TH1*
>( o );
884 bool doRecursiveReferenceDelete = gROOT->MustClean();
885 gROOT->SetMustClean(
false);
886 TDirectory*
dir =
h->GetDirectory();
894 if( !
sc.isSuccess() ) {
895 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" <<
endmsg;
898 gROOT->SetMustClean(doRecursiveReferenceDelete);
◆ writeAndDeleteLWHist() [1/2]
LWHist * AthenaMonManager::writeAndDeleteLWHist |
( |
const std::string & |
key, |
|
|
const std::string & |
streamName |
|
) |
| |
|
virtual |
Definition at line 742 of file AthenaMonManager.cxx.
752 LWHist * lwhist =iLW->second;
773 bool doRecursiveReferenceDelete = gROOT->MustClean();
774 gROOT->SetMustClean(
false);
775 TDirectory*
dir =
h->GetDirectory();
783 if( !
sc.isSuccess() )
785 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" <<
endmsg;
792 gROOT->SetMustClean(doRecursiveReferenceDelete);
◆ writeAndDeleteLWHist() [2/2]
void AthenaMonManager::writeAndDeleteLWHist |
( |
LWHist * |
lwh | ) |
|
|
virtual |
◆ writeAndResetLWHist()
LWHist * AthenaMonManager::writeAndResetLWHist |
( |
const std::string & |
key, |
|
|
const std::string & |
streamName |
|
) |
| |
|
virtual |
Definition at line 801 of file AthenaMonManager.cxx.
811 LWHist * lwhist =iLW->second;
832 bool doRecursiveReferenceDelete = gROOT->MustClean();
833 gROOT->SetMustClean(
false);
834 TDirectory*
dir =
h->GetDirectory();
842 if( !
sc.isSuccess() )
844 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" <<
endmsg;
859 gROOT->SetMustClean(doRecursiveReferenceDelete);
◆ m_d
Imp* AthenaMonManager::m_d |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_monTools
◆ m_THistSvc
ITHistSvc* AthenaMonManager::m_THistSvc |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
virtual LWHist * writeAndDeleteLWHist(const std::string &key, const std::string &streamName)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
static Environment_t envStringToEnum(const std::string &str)
Converts a string to an Environment_t of the same name.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
static std::atomic< bool > s_staticDataAreInit
static std::atomic< ISvcLocator * > s_svcLocator
void toolAudStart(const T &tool)
virtual void setOwner(IDataHandleHolder *o)=0
static const std::string & streamName(LWHist *)
std::string m_environmentProp
bool usingROOTBackend() const
std::string m_dataTypeProp
unsigned int m_LBsLowStatProp
virtual StatusCode sysInitialize() override
Override sysInitialize.
static const std::string & key(LWHist *)
static DataType_t dataTypeStringToEnum(const std::string &str)
Converts a string to a DataType_t of the same name.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
static std::mutex s_mutex
::StatusCode StatusCode
StatusCode definition for legacy code.
bool m_manualDataTypeSetupProp
static void setROOTBackend(bool)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
ToolHandleArray< IMonitorToolBase > m_monTools
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
unsigned int m_LBsMedStatProp
static const MSG::Level s_resourceMonThreshold
std::string m_fileKeyProp
ToolBench * getToolBench(IMonitorToolBase *t)
void setOwnsROOTHisto(bool b)
DataObjIDColl m_extendedExtraObjects
static void deleteLWHist(LWHist *)
unsigned int m_lumiBlockProp
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
unsigned int m_LBsHigStatProp
AthAlgorithm()
Default constructor:
def load(f, use_proxy=1, key=None)
virtual TH1 * getROOTHistBase()=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>