ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaMonManager.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <cctype>
8
9#include "TDirectory.h"
10#include "TH1.h"
11#include "TObject.h"
12#include "TROOT.h"
13#include "AthMonBench.h"
14
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"
22
28
29#include <limits.h>
30#include <vector>
31
32
34public:
35 Imp(AthenaMonManager*man,const std::string& name) : m_theManager(man),
36 m_sgAudSvc(0),
37 m_isPrimaryManager(false),
40 m_fileKeyProp(name),
42 m_dataTypeProp("userDefined"),
43 m_environmentProp("user"),
47 m_manualRunLBProp(false),
48 m_runProp(0),
51 m_forkedProcess(false),
52 m_lastPID(0),
53 m_rootBackend(false),
54 m_doResourceMon(false)
55 {}
56
58 {
59 std::map<IMonitorToolBase*,ToolBench*>::iterator it, itE;
60
61 for (it=m_toolbenchmarks.begin(),itE=m_toolbenchmarks.end(); it!=itE; ++it) {
62 delete it->second;
63 }
64
65 m_toolbenchmarks.clear();
66 }
67
68 //These were protected before we moved to a private implementation:
69 typedef std::map<std::string,TObject*> ObjMap_t;
71
73 SmartIF<ISGAudSvc> m_sgAudSvc;
74
76
79
80 std::string m_fileKeyProp;
81
83 std::string m_dataTypeProp;
84 std::string m_environmentProp;
86
88
89 unsigned int m_runProp;
90 unsigned int m_lumiBlockProp;
91
93
96
98
99 //Hist leak checker is looking for
100 //inappropriate usage of MonGroup copy constructors (temporary
101 //until we outlaw copy/assignment of MonGroups):
112
113 template<class T> void toolAudStart(const T&tool) {
114 if (m_sgAudSvc) m_sgAudSvc->setFakeCurrentAlg(m_theManager->name()+"_MT_"+tool->name());
115 }
116 void toolAudEnd() {
117 if (m_sgAudSvc) m_sgAudSvc->clearFakeCurrentAlg();
118 }
119
121
122 class ToolBench {
123 public:
127 AthMonBench m_bench_algexec_fillHists;//NB: includes call to preselector
130 //NB: So far we don't check the call to runStat()
135 a->msg(l)<<"Init ResourceSummary ["<<m_theTool->name()<<"] --> load/create/initialize : "<<m_bench_alginit_retrieve<<endmsg;
136 m_bench_algexec_checkHists.setUnitCount();
137 m_bench_algexec_bookHists.setUnitCount();
138 a->msg(l)<<"Exec ResourceSummary ["<<m_theTool->name()<<"] --> book : "<<m_bench_algexec_bookHists<<endmsg;
139 a->msg(l)<<"Exec ResourceSummary ["<<m_theTool->name()<<"] --> check : "<<m_bench_algexec_checkHists<<endmsg;
140 a->msg(l)<<"Exec ResourceSummary ["<<m_theTool->name()<<"] --> fill : "<<m_bench_algexec_fillHists<<endmsg;
141 a->msg(l)<<"Fin ResourceSummary ["<<m_theTool->name()<<"] --> finalHists : "<<m_bench_algfin_finalHists<<endmsg;
142 a->msg(l)<<"Fin ResourceSummary ["<<m_theTool->name()<<"] --> checkHists(fromFinalize==true) : "<<m_bench_algfin_checkHists<<endmsg;
143 }
144
145 };
146 std::map<IMonitorToolBase*,ToolBench*> m_toolbenchmarks;
148 std::map<IMonitorToolBase*,ToolBench*>::iterator it = m_toolbenchmarks.find(t);
149 if (it==m_toolbenchmarks.end()) {
150 ToolBench*tb =new ToolBench(t);
151 m_toolbenchmarks[t] = tb;
152 return tb;
153 }
154 return it->second;
155 }
156
157 // The data below should be truly global for a job, and inheriting classes should
158 // not have the option of modifying them.
159 // The data are set from the corresponding m_* properties of the first AthenaMonManager
160 // in the Athena algorithm chain (this manager sets s_staticDataAreInit to true).
161
162 inline static std::atomic<ISvcLocator*> s_svcLocator{nullptr};
163
164 inline static std::atomic<bool> s_staticDataAreInit{false};
165
166 inline static std::string s_dataTypeStr ATLAS_THREAD_SAFE {"userDefined"};
167 inline static std::string s_environmentStr ATLAS_THREAD_SAFE {"user"};
168 inline static DataType_t s_dataType ATLAS_THREAD_SAFE {userDefined};
169 inline static Environment_t s_environment ATLAS_THREAD_SAFE {user};
170
171 inline static bool s_runLBOverridden ATLAS_THREAD_SAFE {false};
172 inline static unsigned int s_lumiBlock ATLAS_THREAD_SAFE {0};
173 inline static unsigned int s_run ATLAS_THREAD_SAFE {0};
174 inline static unsigned int s_fill ATLAS_THREAD_SAFE {0};
175 inline static unsigned int s_LBsLowStat ATLAS_THREAD_SAFE {0};
176 inline static unsigned int s_LBsMedStat ATLAS_THREAD_SAFE {0};
177 inline static unsigned int s_LBsHigStat ATLAS_THREAD_SAFE {0};
178};
179
180
181namespace {
182
183std::string strToLower( const std::string& str );
184
185} // unnamed namespace
186
187// *********************************************************************
188// Public Methods
189// *********************************************************************
190
192AthenaMonManager( const std::string& name, ISvcLocator* pSvcLocator )
193 : AthAlgorithm( name, pSvcLocator )
194 , m_monTools( this )
195 , m_THistSvc("THistSvc", name)
196 , m_d(new Imp(this, name))
197{
198 declareProperty( "AthenaMonTools", m_monTools );
199 declareProperty( "CheckEveryNoEvents", m_d->m_everyNevents );
200 declareProperty( "FileKey", m_d->m_fileKeyProp );
201 declareProperty( "ManualDataTypeSetup", m_d->m_manualDataTypeSetupProp );
202 declareProperty( "DataType", m_d->m_dataTypeProp );
203 declareProperty( "Environment", m_d->m_environmentProp );
204 declareProperty( "LBsInLowStatInterval", m_d->m_LBsLowStatProp );
205 declareProperty( "LBsInMediumStatInterval", m_d->m_LBsMedStatProp );
206 declareProperty( "LBsInHighStatInterval", m_d->m_LBsHigStatProp );
207 declareProperty( "ManualRunLBSetup", m_d->m_manualRunLBProp );
208 declareProperty( "Run", m_d->m_runProp );
209 declareProperty( "LumiBlock", m_d->m_lumiBlockProp );
210 declareProperty( "ROOTBackend", m_d->m_rootBackend );
211
212 if( !Imp::s_svcLocator )
213 Imp::s_svcLocator = pSvcLocator;
214}
215
216
219{
220 delete m_d;
221
222 // If it is known that ManagedMonitorToolBase objects are deleted _after_ this object,
223 // then one should call setMonManager(0) on each of them.
224}
225
226
229envStringToEnum( const std::string& str )
230{
231 std::string lcstr( strToLower(str) );
232
233 if( lcstr == "user" )
234 return user;
235 else if( lcstr == "nooutput" )
236 return noOutput;
237 else if( lcstr == "online" )
238 return online;
239 else if( lcstr == "tier0" )
240 return tier0;
241 else if( lcstr == "tier0raw" )
242 return tier0Raw;
243 else if( lcstr == "tier0esd" )
244 return tier0ESD;
245 else if( lcstr == "aod" )
246 return AOD;
247 else if( lcstr == "altprod" )
248 return altprod;
249
250 if( Imp::s_svcLocator ) {
251 SmartIF<IMessageSvc> ms{Imp::s_svcLocator.load()->service( "MessageSvc" )};
252 if( ms.isValid() ) {
253 MsgStream log( ms, "AthenaMonManager::envStringToEnum()" );
254 log << MSG::WARNING << "Unknown AthenaMonManager::Environment_t \""
255 << str << "\", returning \"user\"" << endmsg;
256 }
257 }
258
259 return user;
260}
261
262
265dataTypeStringToEnum( const std::string& str )
266{
267 std::string lcstr( strToLower(str) );
268
269 if( lcstr == "userdefined" )
270 return userDefined;
271 else if( lcstr == "montecarlo" )
272 return monteCarlo;
273 else if( lcstr == "collisions" )
274 return collisions;
275 else if( lcstr == "cosmics" )
276 return cosmics;
277 else if( lcstr == "heavyioncollisions" )
278 return heavyIonCollisions;
279
280 if( Imp::s_svcLocator ) {
281 SmartIF<IMessageSvc> ms{Imp::s_svcLocator.load()->service( "MessageSvc" )};
282 if( ms.isValid() ) {
283 MsgStream log( ms, "AthenaMonManager::dataTypeStringToEnum()" );
284 log << MSG::WARNING << "Unknown AthenaMonManager::DataType_t \""
285 << str << "\", returning \"userDefined\"" << endmsg;
286 }
287 }
288
289 return userDefined;
290}
291
292
296{
297 return Imp::s_environment;
298}
299
301 return Imp::s_LBsLowStat;
302}
304 return Imp::s_LBsMedStat;
305}
307 return Imp::s_LBsHigStat;
308}
309
312dataType()
313{
314 return Imp::s_dataType;
315}
316
317bool
320 return m_d->m_forkedProcess;
321}
322
323
324unsigned int
327{
328 if (Imp::s_runLBOverridden) {
329 return Imp::s_lumiBlock;
330 } else {
331 return Gaudi::Hive::currentContext().eventID().lumi_block();
332 }
333}
334
335
336unsigned int
338runNumber()
339{
340 if (Imp::s_runLBOverridden) {
341 return Imp::s_run;
342 } else {
343 return Gaudi::Hive::currentContext().eventID().run_number();
344 }
345}
346
347
348unsigned int
351{
352 return Imp::s_fill;
353}
354
355
356StatusCode
359{
361
362 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::initialize():" << endmsg;
363
364 m_d->m_sgAudSvc = Imp::s_svcLocator.load()->service("SGAudSvc", false/*do not create*/);
366
367 ATH_CHECK( m_THistSvc.retrieve() );
368
370 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Initializing static data" << endmsg;
371
372 if (msgLvl(MSG::DEBUG)) {
373 msg(MSG::DEBUG) << " * \"ManualDataTypeSetup\" = " << m_d->m_manualDataTypeSetupProp << endmsg;
374 }
375
376#if 0 // The two branches of the conditional are identical.
377 if( m_d->m_manualDataTypeSetupProp ) {
378 Imp::s_dataTypeStr = m_d->m_dataTypeProp;
379 Imp::s_dataType = dataTypeStringToEnum( m_d->m_dataTypeProp );
380 }
381 else
382#endif
383 {
384 Imp::s_dataTypeStr = m_d->m_dataTypeProp;
385 Imp::s_dataType = dataTypeStringToEnum( m_d->m_dataTypeProp );
386 }
387
388 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"DataType\" = " << Imp::s_dataType << endmsg;
389
390 Imp::s_environmentStr = m_d->m_environmentProp;
391 Imp::s_environment = envStringToEnum( m_d->m_environmentProp );
392
393 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"Environment\" = " << Imp::s_environment << endmsg;
394
395 Imp::s_LBsLowStat = m_d->m_LBsLowStatProp;
396 Imp::s_LBsMedStat = m_d->m_LBsMedStatProp;
397 Imp::s_LBsHigStat = m_d->m_LBsHigStatProp;
398 if (msgLvl(MSG::DEBUG)) {
399 msg(MSG::DEBUG) << " * \"LBsInLowStatInterval\" = " << Imp::s_LBsLowStat << endmsg;
400 msg(MSG::DEBUG) << " * \"LBsInMediumStatInterval\" = " << Imp::s_LBsMedStat << endmsg;
401 msg(MSG::DEBUG) << " * \"LBsInHighStatInterval\" = " << Imp::s_LBsHigStat << endmsg;
402 }
403
404 m_d->m_isPrimaryManager = true;
406
407 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " * \"ManualRunLBSetup\" = " << m_d->m_manualRunLBProp << endmsg;
408
409 if( m_d->m_manualRunLBProp ) {
410 Imp::s_run = m_d->m_runProp;
411 Imp::s_lumiBlock = m_d->m_lumiBlockProp;
412 Imp::s_runLBOverridden = true;
413 if (msgLvl(MSG::DEBUG))
414 msg(MSG::DEBUG) << " --> using run = " << Imp::s_run << ", lumiBlock = " << Imp::s_lumiBlock << endmsg;
415 } else {
416 if (msgLvl(MSG::DEBUG))
417 msg(MSG::DEBUG) << " --> using run = " << Imp::s_run << ", lumiBlock = " << Imp::s_lumiBlock << endmsg;
418 }
419 }
420
421 // Ensure consistency among all managers
422 m_d->m_dataTypeProp = Imp::s_dataTypeStr;
423 m_d->m_environmentProp = Imp::s_environmentStr;
424
425 // Provide a virtual Algorithm with a subset of the properties
426 ServiceHandle<Gaudi::Interfaces::IOptionsSvc> joSvc("JobOptionsSvc", name());
427 ATH_CHECK( joSvc.retrieve() );
428 ATH_MSG_DEBUG(" --> Found service \"JobOptionsSvc\"");
429
430 const std::string client = name() + std::string("Properties");
431 ATH_MSG_DEBUG(" --> Adding properties under name \"" << client << "\"");
432 joSvc->set( client + ".FileKey", m_d->m_fileKeyProp );
433 joSvc->set( client + ".DataType", m_d->m_dataTypeProp );
434 joSvc->set( client + ".Environment", m_d->m_environmentProp );
435
436 if( m_monTools.size() > 0 ) {
437 ATH_CHECK( m_monTools.retrieve() );
438 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Retrieved AthenaMonTools" << endmsg;
439 }
440
441 m_d->m_eventCounter = m_d->m_everyNevents;
442
443 ToolHandleArray<IMonitorToolBase>::iterator monToolsEnd = m_monTools.end();
444 for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
445 ToolHandle<IMonitorToolBase>& tool = *i;
446 AthMonBench bench_tmp;
447 IMonitorToolBase* mon = tool.operator->();
448 ManagedMonitorToolBase* managed = dynamic_cast<ManagedMonitorToolBase*>( mon );
449 if( managed != 0 ) {
450 managed->setMonManager( this );
451 }
452 if (m_d->m_doResourceMon) {
453 Imp::ToolBench* tb = m_d->getToolBench(mon);
454 tb->m_bench_alginit_retrieve = bench_tmp;
455 }
456
457 }
458 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
459
460 return StatusCode::SUCCESS;
461}
462
463
464StatusCode
466execute()
467{
468 const EventContext& ctx = Gaudi::Hive::currentContext();
469
470 m_d->m_forkedProcess=false;
471 pid_t currPID=getpid();
472 //m_lastPID 0 means the execute method was not called yet.
473 if (m_d->m_lastPID!=0 && m_d->m_lastPID!=currPID) {
474 m_d->m_forkedProcess=true;
475 ATH_MSG_INFO("Forked event discovered!");
476 }
477 m_d->m_lastPID=currPID;
478
480 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::execute():" << endmsg;
481
482 StatusCode sc;
483
484 ToolHandleArray<IMonitorToolBase>::iterator monToolsEnd = m_monTools.end();
485 for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
486 ToolHandle<IMonitorToolBase>& tool = *i;
487 m_d->toolAudStart(tool);
488 AthMonBench bench_tmp;
489 if (m_d->m_doResourceMon)
490 bench_tmp.startMeasurement();
491 if( tool->preSelector() ) {
492
493 sc = tool->fillHists(ctx);
494
495 if( !sc.isSuccess() ) {
496 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::fillHists() unsuccessful" << endmsg;
497 }
498 }
499
500
501 if (m_d->m_doResourceMon) {
502 bench_tmp.finishMeasurement();
503 Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
504 tb->m_bench_algexec_fillHists += bench_tmp;//fixme: count events and subdivide
505 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> m_doResourceMon is True" << endmsg;
506 }
507 m_d->toolAudEnd();
508 }
509 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::fillHists()" << endmsg;
510
511 if( m_d->m_eventCounter > 0 ) {
512 m_d->m_eventCounter--;
513 }
514 else if( m_d->m_eventCounter == 0 ) {
515 for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
516 ToolHandle<IMonitorToolBase>& tool = *i;
517 m_d->toolAudStart(tool);
518 AthMonBench bench_tmp;
519
520 if (m_d->m_doResourceMon)
521 bench_tmp.startMeasurement();
522 sc = tool->checkHists(false);
523 if (m_d->m_doResourceMon) {
524 bench_tmp.finishMeasurement();
525 Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
526 tb->m_bench_algexec_checkHists += bench_tmp;//fixme: count events and subdivide
527 }
528 if( !sc.isSuccess() ) {
529 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::checkHists() unsuccessful" << endmsg;
530 }
531 m_d->toolAudEnd();
532 }
533 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::checkHists()" << endmsg;
534
535 m_d->m_eventCounter = m_d->m_everyNevents;
536 }
537 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
538
539 return StatusCode::SUCCESS;
540}
541
542
543StatusCode
545finalize()
546{
547 return StatusCode::SUCCESS;
548}
549
550StatusCode
552stop()
553{
555 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::finalize():" << endmsg;
556
557 StatusCode sc;
558
559 ToolHandleArray<IMonitorToolBase>::iterator monToolsEnd = m_monTools.end();
560 for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
561 ToolHandle<IMonitorToolBase>& tool = *i;
562 m_d->toolAudStart(tool);
563
564 sc = tool->runStat();
565 if( !sc.isSuccess() ) {
566 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::runStat() unsuccessful" << endmsg;
567 }
568
569 Imp::ToolBench* tb = m_d->m_doResourceMon ? m_d->getToolBench(tool.operator->()) : 0;
570 if (tb)
571 tb->m_bench_algfin_finalHists.startMeasurement();
572 sc = tool->finalHists();
573 if (tb)
574 tb->m_bench_algfin_finalHists.finishMeasurement();
575 if( !sc.isSuccess() ) {
576 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::finalHists() unsuccessful" << endmsg;
577 }
578 if (tb)
579 tb->m_bench_algfin_checkHists.startMeasurement();
580 sc = tool->checkHists(true);
581 if (tb)
582 tb->m_bench_algfin_checkHists.finishMeasurement();
583 if( !sc.isSuccess() ) {
584 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::checkHists() unsuccessful" << endmsg;
585 }
586 if (tb)
587 tb->report(this);
588 m_d->toolAudEnd();
589 }
590 if (msgLvl(MSG::DEBUG)) {
591 msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::finalHists() and IMonitorToolBase::checkHists()" << endmsg;
592 msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
593 }
594 return StatusCode::SUCCESS;
595}
596
597
598StatusCode
600start()
601{
603 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AthenaMonManager::start():" << endmsg;
604
605 StatusCode sc;
606
607 ToolHandleArray<IMonitorToolBase>::iterator monToolsEnd = m_monTools.end();
608 for( ToolHandleArray<IMonitorToolBase>::iterator i = m_monTools.begin(); i != monToolsEnd; ++i ) {
609 ToolHandle<IMonitorToolBase>& tool = *i;
610 m_d->toolAudStart(tool);
611 AthMonBench bench_tmp;
612 if (m_d->m_doResourceMon)
613 bench_tmp.startMeasurement();
614 sc = tool->bookHists();
615 if (m_d->m_doResourceMon) {
616 bench_tmp.finishMeasurement();
617 Imp::ToolBench* tb = m_d->getToolBench(tool.operator->());
618 tb->m_bench_algexec_bookHists += bench_tmp;
619 }
620 if( !sc.isSuccess() ) {
621 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "IMonitorToolBase::bookHists() unsuccessful" << endmsg;
622 }
623 m_d->toolAudEnd();
624 }
625 if (msgLvl(MSG::DEBUG)) {
626 msg(MSG::DEBUG) << " --> Done calling IMonitorToolBase::bookHists()" << endmsg;
627 msg(MSG::DEBUG) << " --> Exiting successfully" << endmsg;
628 }
629
630 return StatusCode::SUCCESS;
631}
632
633
634std::string
636fileKey() const
637{
638 return m_d->m_fileKeyProp;
639}
640
641
642void
644passOwnership( TObject* h, const std::string& key )
645{
646 m_d->m_objMap.emplace( key, h );
647}
648
649
650void
652writeAndDelete( const std::string& key )
653{
654 // If is owned TObject, we deregister from THistSvc, write it in a
655 // root file, and delete it.
656
657 Imp::ObjMap_t::iterator i = m_d->m_objMap.find( key );
658 if( i != m_d->m_objMap.end() ) {
659 TObject* o = i->second;
660 TH1* h = dynamic_cast<TH1*>( o );
661 if( h != 0 ) {
662 // By default, ROOT does its own bookkeeping of references to
663 // histograms, and this leads to a significant amount of time
664 // spent in the TObject d'tor when there are >= O(1000) TDirectories.
665 // So, turn this bookkeeping off when deleting these histograms.
666 bool doRecursiveReferenceDelete = gROOT->MustClean();
667 gROOT->SetMustClean(false);
668 TDirectory* dir = h->GetDirectory();
669 TDirectory* g = gDirectory;
670 if( dir )
671 dir->cd();
672 h->Write();
673 g->cd();
674
675 StatusCode sc = m_THistSvc->deReg( h );
676 if( !sc.isSuccess() ) {
677 if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "AthenaMonManager::WriteAndDeleteHist(): Failure to deReg( TObject* )" << endmsg;
678 }
679 delete o;
680 gROOT->SetMustClean(doRecursiveReferenceDelete);
681 m_d->m_objMap.erase( key );
682 }
683 }
684}
685
686// *********************************************************************
687// Protected Methods
688// *********************************************************************
689
690
691// *********************************************************************
692// Private Methods
693// *********************************************************************
694namespace {
695
696std::string strToLower( const std::string& str )
697{
698 std::string lstr(str);
699 std::string::const_iterator from = str.begin();
700 std::string::const_iterator strend = str.end();
701 std::string::iterator to = lstr.begin();
702 while( from != strend ) {
703 *to++ = tolower(*from++);
704 }
705 return lstr;
706}
707
708} // unnamed namespace
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
void tolower(std::string &s)
int32_t pid_t
static Double_t a
static Double_t sc
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
Header file for AthHistogramAlgorithm.
static const MSG::Level s_resourceMonThreshold
Definition AthMonBench.h:28
void finishMeasurement()
Definition AthMonBench.h:83
void startMeasurement()
Definition AthMonBench.h:76
void report(AthenaMonManager *a)
const IMonitorToolBase * m_theTool
AthenaMonManager * m_theManager
std::map< std::string, TObject * > ObjMap_t
Imp(AthenaMonManager *man, const std::string &name)
static std::atomic< bool > s_staticDataAreInit
ToolBench * getToolBench(IMonitorToolBase *t)
static std::string s_dataTypeStr ATLAS_THREAD_SAFE
void toolAudStart(const T &tool)
SmartIF< ISGAudSvc > m_sgAudSvc
std::map< IMonitorToolBase *, ToolBench * > m_toolbenchmarks
static std::atomic< ISvcLocator * > s_svcLocator
virtual StatusCode start()
virtual StatusCode stop()
static unsigned int getLBsLowStat()
ToolHandleArray< IMonitorToolBase > m_monTools
DataType_t
An enumeration of the different types of data the monitoring application may be running over.
ServiceHandle< ITHistSvc > m_THistSvc
static unsigned int fillNumber()
static Environment_t envStringToEnum(const std::string &str)
Converts a string to an Environment_t of the same name.
static DataType_t dataTypeStringToEnum(const std::string &str)
Converts a string to a DataType_t of the same name.
Environment_t
An enumeration of the different types of running environment the monitoring application may be in.
virtual void writeAndDelete(const std::string &key)
If the TObject is owned by this manager, its Write() method is called and it is deleted.
virtual StatusCode finalize()
static unsigned int getLBsHigStat()
AthenaMonManager(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute()
virtual StatusCode initialize()
static unsigned int getLBsMedStat()
static unsigned int lumiBlockNumber()
virtual std::string fileKey() const
static Environment_t environment()
Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects ...
static unsigned int runNumber()
static DataType_t dataType()
Returns the data type that the monitoring application is running over to help ManagedMonitorToolBase ...
virtual void passOwnership(TObject *h, const std::string &key)
Pass ownership of a TObject to this manager so that it will be deleted appropriately.
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
virtual void setMonManager(AthenaMonManager *manager)
Takes a pointer to a managing object to get information from it when needed.