Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "TDirectory.h"
15 #include "Gaudi/Interfaces/IOptionsSvc.h"
16 #include "GaudiKernel/IMessageSvc.h"
17 #include "GaudiKernel/ISvcLocator.h"
18 #include "GaudiKernel/ITHistSvc.h"
19 #include "GaudiKernel/MsgStream.h"
20 #include "Gaudi/Property.h"
21 #include "GaudiKernel/ServiceHandle.h"
72 typedef std::map<std::string,TObject*>
ObjMap_t;
186 std::string strToLower(
const std::string&
str );
198 , m_THistSvc(
"THistSvc",
name)
234 std::string lcstr( strToLower(
str) );
236 if( lcstr ==
"user" )
238 else if( lcstr ==
"nooutput" )
240 else if( lcstr ==
"online" )
242 else if( lcstr ==
"tier0" )
244 else if( lcstr ==
"tier0raw" )
246 else if( lcstr ==
"tier0esd" )
248 else if( lcstr ==
"aod" )
250 else if( lcstr ==
"altprod" )
256 MsgStream
log(
ms,
"AthenaMonManager::envStringToEnum()" );
257 log << MSG::WARNING <<
"Unknown AthenaMonManager::Environment_t \""
258 <<
str <<
"\", returning \"user\"" <<
endmsg;
270 std::string lcstr( strToLower(
str) );
272 if( lcstr ==
"userdefined" )
274 else if( lcstr ==
"montecarlo" )
276 else if( lcstr ==
"collisions" )
278 else if( lcstr ==
"cosmics" )
280 else if( lcstr ==
"heavyioncollisions" )
286 MsgStream
log(
ms,
"AthenaMonManager::dataTypeStringToEnum()" );
287 log << MSG::WARNING <<
"Unknown AthenaMonManager::DataType_t \""
288 <<
str <<
"\", returning \"userDefined\"" <<
endmsg;
300 return Imp::s_environment;
304 return Imp::s_LBsLowStat;
307 return Imp::s_LBsMedStat;
310 return Imp::s_LBsHigStat;
317 return Imp::s_dataType;
331 if (Imp::s_runLBOverridden) {
332 return Imp::s_lumiBlock;
334 return Gaudi::Hive::currentContext().eventID().lumi_block();
343 if (Imp::s_runLBOverridden) {
346 return Gaudi::Hive::currentContext().eventID().run_number();
379 #if 0 // The two branches of the conditional are identical.
415 Imp::s_runLBOverridden =
true;
417 msg(
MSG::DEBUG) <<
" --> using run = " << Imp::s_run <<
", lumiBlock = " << Imp::s_lumiBlock <<
endmsg;
420 msg(
MSG::DEBUG) <<
" --> using run = " << Imp::s_run <<
", lumiBlock = " << Imp::s_lumiBlock <<
endmsg;
433 const std::string
client =
name() + std::string(
"Properties");
448 ToolHandle<IMonitorToolBase>&
tool = *
i;
457 tb->m_bench_alginit_retrieve = bench_tmp;
463 return StatusCode::SUCCESS;
472 pid_t currPID=getpid();
487 if (
name() ==
"HLTMonManager") {
488 ATH_MSG_DEBUG(
"HLTMonManager is obtaining the TrigNavigationThinningSvc lock in slot "
489 << Gaudi::Hive::currentContext().slot() <<
" for event " << Gaudi::Hive::currentContext().eventID().event_number() );
497 ToolHandle<IMonitorToolBase>&
tool = *
i;
502 if(
tool->preSelector() ) {
506 if( !
sc.isSuccess() ) {
507 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::fillHists() unsuccessful" <<
endmsg;
515 tb->m_bench_algexec_fillHists += bench_tmp;
527 ToolHandle<IMonitorToolBase>&
tool = *
i;
533 sc =
tool->checkHists(
false);
537 tb->m_bench_algexec_checkHists += bench_tmp;
539 if( !
sc.isSuccess() ) {
540 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::checkHists() unsuccessful" <<
endmsg;
551 return StatusCode::SUCCESS;
559 return StatusCode::SUCCESS;
573 ToolHandle<IMonitorToolBase>&
tool = *
i;
577 if( !
sc.isSuccess() ) {
578 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::runStat() unsuccessful" <<
endmsg;
583 tb->m_bench_algfin_finalHists.startMeasurement();
586 tb->m_bench_algfin_finalHists.finishMeasurement();
587 if( !
sc.isSuccess() ) {
588 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::finalHists() unsuccessful" <<
endmsg;
591 tb->m_bench_algfin_checkHists.startMeasurement();
592 sc =
tool->checkHists(
true);
594 tb->m_bench_algfin_checkHists.finishMeasurement();
595 if( !
sc.isSuccess() ) {
596 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::checkHists() unsuccessful" <<
endmsg;
603 msg(
MSG::DEBUG) <<
" --> Done calling IMonitorToolBase::finalHists() and IMonitorToolBase::checkHists()" <<
endmsg;
606 return StatusCode::SUCCESS;
621 ToolHandle<IMonitorToolBase>&
tool = *
i;
630 tb->m_bench_algexec_bookHists += bench_tmp;
632 if( !
sc.isSuccess() ) {
633 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"IMonitorToolBase::bookHists() unsuccessful" <<
endmsg;
642 return StatusCode::SUCCESS;
658 Imp::ObjMap_t::value_type valToInsert(
key,
h );
672 TObject* o =
i->second;
673 TH1*
h =
dynamic_cast<TH1*
>( o );
679 bool doRecursiveReferenceDelete = gROOT->MustClean();
680 gROOT->SetMustClean(
false);
681 TDirectory*
dir =
h->GetDirectory();
689 if( !
sc.isSuccess() ) {
690 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" <<
endmsg;
693 gROOT->SetMustClean(doRecursiveReferenceDelete);
709 std::string strToLower(
const std::string&
str )
711 std::string lstr(
str);
712 std::string::const_iterator from =
str.begin();
713 std::string::const_iterator strend =
str.end();
715 while( from != strend ) {
JetConstituentVector::iterator iterator
static std::string s_dataTypeStr ATLAS_THREAD_SAFE
Imp(AthenaMonManager *man, const std::string &name)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::map< IMonitorToolBase *, ToolBench * > m_toolbenchmarks
static unsigned int runNumber()
virtual std::string fileKey() const
std::map< std::string, TObject * > ObjMap_t
virtual void passOwnership(TObject *h, const std::string &key)
Pass ownership of a TObject to this manager so that it will be deleted appropriately.
virtual StatusCode finalize()
static Environment_t envStringToEnum(const std::string &str)
Converts a string to an Environment_t of the same name.
bool msgLvl(const MSG::Level lvl) const
SmartIF< ISGAudSvc > m_sgAudSvc
static std::atomic< bool > s_staticDataAreInit
DataType_t
An enumeration of the different types of data the monitoring application may be running over.
static std::atomic< ISvcLocator * > s_svcLocator
void toolAudStart(const T &tool)
static unsigned int getLBsLowStat()
static Environment_t environment()
Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects ...
static unsigned int fillNumber()
std::string m_environmentProp
static unsigned int getLBsMedStat()
std::string m_dataTypeProp
unsigned int m_LBsLowStatProp
static DataType_t dataType()
Returns the data type that the monitoring application is running over to help ManagedMonitorToolBase ...
virtual StatusCode start()
An Algorithm that manages a set of modules, each inheriting from ManagedMonitorToolBase,...
static DataType_t dataTypeStringToEnum(const std::string &str)
Converts a string to a DataType_t of the same name.
static std::mutex s_mutex
unsigned m_nMonGroupCopies
::StatusCode StatusCode
StatusCode definition for legacy code.
void tolower(std::string &s)
virtual void writeAndDelete(const std::string &key)
If the TObject is owned by this manager, its Write() method is called and it is deleted.
bool m_manualDataTypeSetupProp
ToolHandleArray< IMonitorToolBase > m_monTools
Environment_t
An enumeration of the different types of running environment the monitoring application may be in.
unsigned int m_LBsMedStatProp
static const MSG::Level s_resourceMonThreshold
static unsigned int getLBsHigStat()
virtual StatusCode execute()
std::string m_fileKeyProp
AthenaMonManager * m_theManager
virtual StatusCode stop()
ToolBench * getToolBench(IMonitorToolBase *t)
AthenaMonManager(const std::string &name, ISvcLocator *pSvcLocator)
unsigned int m_lumiBlockProp
unsigned int m_LBsHigStatProp
static unsigned int lumiBlockNumber()
unsigned m_mgcopies_initval
Define macros for attributes used to control the static checker.
virtual ~AthenaMonManager()
ServiceHandle< ITHistSvc > m_THistSvc
virtual StatusCode initialize()