ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
17
18/*Here's an example of how to include in an athena job options:
19
20theApp.CreateSvc += ["AthROOTErrorHandlerSvc"]
21
22*/
23
24/*Here's an example test for the ROOT prompt:
25
26AAH::initGaudi();
27ServiceHandle<IService> s("AthROOTErrorHandlerSvc","");
28std::map<std::string, int> sources; sources["test1"] = kError;
29AAH::setProperty( s , "ThrowSources", sources )
30s->initialize();
31Error("aaa","bbb"); //should be ok
32Error("test1","hello"); //should throw exception
33
34*/
35
36#include "TError.h"
37
38namespace Handler {
39 void ErrorHandler ATLAS_NOT_THREAD_SAFE ( Int_t level, Bool_t abort, const char* location, const char* message );
40}
41
43
44public:
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);
49
50 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override;
51 virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE() override;
52
53private:
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
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Gaudi::Property< std::map< std::string, int > > m_throwSources
AthROOTErrorHandlerSvc(const std::string &name, ISvcLocator *svcLoc)
friend void Handler::ErrorHandler(Int_t level, Bool_t abort, const char *location, const char *message)
virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE() override
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
Gaudi::Property< int > m_catchLevel
AthROOTErrorHandlerSvc: Replaces ROOT's standard error handler in order to detect Problematic ROOT is...
void initialize()