ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
D3PDMakerCoreComps
src
DummyInitAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
11
12
13
#include "
DummyInitAlg.h
"
14
#include "
AthenaKernel/errorcheck.h
"
15
#include "TDirectory.h"
16
#include "TFile.h"
17
#include "TError.h"
18
19
20
namespace
{
21
22
23
class
ATLAS_NOT_THREAD_SAFE
DirectoryRestore
24
:
public
TDirectory::TContext
25
{
26
public
:
27
DirectoryRestore();
28
~DirectoryRestore();
29
30
private
:
31
TFile* m_file;
32
int
m_ge;
33
};
34
35
36
DirectoryRestore::DirectoryRestore()
37
: TDirectory::TContext (0),
38
m_file (gFile),
39
m_ge (
gErrorIgnoreLevel
)
40
{
41
}
42
43
44
DirectoryRestore::~DirectoryRestore()
45
{
46
gFile = m_file;
47
gErrorIgnoreLevel
= m_ge;
48
}
49
50
51
}
52
53
54
namespace
D3PD
{
55
56
57
DummyInitAlg::DummyInitAlg
(
const
std::string& name,
58
ISvcLocator* svcloc)
59
:
AthAlgorithm
(name, svcloc),
60
m_histSvc
(
"THistSvc"
, name)
61
{
62
declareProperty
(
"HistSvc"
,
m_histSvc
);
63
}
64
65
69
StatusCode DummyInitAlg::initialize
ATLAS_NOT_THREAD_SAFE
()
70
{
71
CHECK
( AthAlgorithm::initialize() );
72
73
// THistSvc has a bug whereby if it opens output files,
74
// then it leaves the root directory pointing at the last output
75
// file when initialize returns. This means that other root
76
// objects that are meant to be transient can end up in this file.
77
// Worse, we can get a double-delete, as these transient objects
78
// will then be deleted when the file is closed.
79
//
80
// We do this here in the hope that we're the first to call THistSvc.
81
// Maybe we should also bash the current directory back to TROOT?
82
//
83
// This can be removed once this is fixed in THistSvc.
84
// https://savannah.cern.ch/bugs/index.php?60162
85
{
86
DirectoryRestore save;
87
CHECK
( m_histSvc.retrieve() );
88
}
89
90
CHECK
( detStore().retrieve() );
91
return
StatusCode::SUCCESS;
92
}
93
94
98
StatusCode
DummyInitAlg::execute
(
const
EventContext&
/*ctx*/
)
99
{
100
return
StatusCode::SUCCESS;
101
}
102
103
104
}
// namespace D3PD
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DummyInitAlg.h
Work around initialization ordering problems.
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
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
D3PD::DummyInitAlg::DummyInitAlg
DummyInitAlg(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi algorithm constructor.
Definition
DummyInitAlg.cxx:57
D3PD::DummyInitAlg::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Definition
DummyInitAlg.h:60
D3PD::DummyInitAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Standard Gaudi execute method.
Definition
DummyInitAlg.cxx:98
D3PD::ATLAS_NOT_THREAD_SAFE
StatusCode DummyInitAlg::initialize ATLAS_NOT_THREAD_SAFE()
Standard Gaudi initialize method.
Definition
DummyInitAlg.cxx:69
covarianceToolsLibrary.gErrorIgnoreLevel
gErrorIgnoreLevel
Definition
covarianceToolsLibrary.py:21
python.CaloCellD3PDObject.D3PD
D3PD
Definition
CaloCellD3PDObject.py:7
Generated on
for ATLAS Offline Software by
1.17.0