ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthAnalysisBaseComps
src
AthROOTErrorHandlerSvc.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef __ATHROOTERRORHANDLERSVC__
6
#define __ATHROOTERRORHANDLERSVC__
7
8
#include "
AthenaBaseComps/AthService.h
"
9
#include "
CxxUtils/checker_macros.h
"
10
17
18
/*Here's an example of how to include in an athena job options:
19
20
theApp.CreateSvc += ["AthROOTErrorHandlerSvc"]
21
22
*/
23
24
/*Here's an example test for the ROOT prompt:
25
26
AAH::initGaudi();
27
ServiceHandle<IService> s("AthROOTErrorHandlerSvc","");
28
std::map<std::string, int> sources; sources["test1"] = kError;
29
AAH::setProperty( s , "ThrowSources", sources )
30
s->initialize();
31
Error("aaa","bbb"); //should be ok
32
Error("test1","hello"); //should throw exception
33
34
*/
35
36
#include "TError.h"
37
38
namespace
Handler
{
39
void
ErrorHandler
ATLAS_NOT_THREAD_SAFE
( Int_t level, Bool_t abort,
const
char
* location,
const
char
* message );
40
}
41
42
class
AthROOTErrorHandlerSvc
:
public
AthService
{
43
44
public
:
45
friend
void
Handler::ErrorHandler
( Int_t level, Bool_t abort,
const
char
* location,
const
char
* message );
46
47
AthROOTErrorHandlerSvc
(
const
std::string& name, ISvcLocator *svcLoc);
48
virtual
~AthROOTErrorHandlerSvc
();
49
50
virtual
StatusCode
initialize
ATLAS_NOT_THREAD_SAFE
()
override
;
51
virtual
StatusCode finalize
ATLAS_NOT_THREAD_SAFE
()
override
;
52
53
private
:
54
55
Gaudi::Property<int>
m_catchLevel
{
56
this
,
"CatchLevel"
, kFatal+1,
57
"Throw runtime error for all messages at this level or HIGHER"
};
58
59
Gaudi::Property<std::map<std::string,int>>
m_throwSources
{
60
this
,
"ThrowSources"
, {{
"TBranch::GetBasket"
, kError},
61
{
"TFile::ReadBuffer"
, kError}},
62
"Map from source to error level. Any message at level or HIGHER will trigger runtime error"
};
63
};
64
65
66
#endif
67
AthService.h
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition
checker_macros.h:212
AthROOTErrorHandlerSvc::m_throwSources
Gaudi::Property< std::map< std::string, int > > m_throwSources
Definition
AthROOTErrorHandlerSvc.h:59
AthROOTErrorHandlerSvc::AthROOTErrorHandlerSvc
AthROOTErrorHandlerSvc(const std::string &name, ISvcLocator *svcLoc)
Definition
AthROOTErrorHandlerSvc.cxx:36
AthROOTErrorHandlerSvc::ErrorHandler
friend void Handler::ErrorHandler(Int_t level, Bool_t abort, const char *location, const char *message)
AthROOTErrorHandlerSvc::ATLAS_NOT_THREAD_SAFE
virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE() override
AthROOTErrorHandlerSvc::ATLAS_NOT_THREAD_SAFE
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
AthROOTErrorHandlerSvc::~AthROOTErrorHandlerSvc
virtual ~AthROOTErrorHandlerSvc()
Definition
AthROOTErrorHandlerSvc.cxx:40
AthROOTErrorHandlerSvc::m_catchLevel
Gaudi::Property< int > m_catchLevel
Definition
AthROOTErrorHandlerSvc.h:55
AthService::AthService
AthService()
Handler
AthROOTErrorHandlerSvc: Replaces ROOT's standard error handler in order to detect Problematic ROOT is...
Definition
AthROOTErrorHandlerSvc.cxx:9
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0