forked from UCATLAS/xAODAnaHelpers
/
DebugTool.cxx
137 lines (94 loc) · 2.53 KB
/
DebugTool.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/************************************
*
* Debug tool
*
* J.Alison (john.alison@cern.ch)
*
************************************/
// c++ include(s):
#include <iostream>
#include <typeinfo>
#include <sstream>
// EL include(s):
#include <EventLoop/Job.h>
#include <EventLoop/StatusCode.h>
#include <EventLoop/Worker.h>
// EDM include(s):
//#include "PATInterfaces/SystematicVariation.h"
//#include "PATInterfaces/SystematicRegistry.h"
//#include "PATInterfaces/SystematicCode.h"
// package include(s):
//#include "xAODEventInfo/EventInfo.h"
#include "xAODAnaHelpers/DebugTool.h"
#include "xAODAnaHelpers/HelperClasses.h"
#include "xAODAnaHelpers/HelperFunctions.h"
#include <xAODAnaHelpers/tools/ReturnCheck.h>
// external tools include(s):
// ROOT include(s):
#include "TEnv.h"
#include "TFile.h"
#include "TSystem.h"
// this is needed to distribute the algorithm to the workers
ClassImp(DebugTool)
DebugTool :: DebugTool () :
m_printStore(false)
{
Info("DebugTool()", "Calling constructor");
}
EL::StatusCode DebugTool :: setupJob (EL::Job& job)
{
Info("setupJob()", "Calling setupJob");
job.useXAOD ();
xAOD::Init( "DebugTool" ).ignore(); // call before opening first file
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: histInitialize ()
{
Info("histInitialize()", "Calling histInitialize");
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: fileExecute ()
{
Info("fileExecute()", "Calling fileExecute");
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: changeInput (bool /*firstFile*/)
{
Info("changeInput()", "Calling changeInput");
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: initialize ()
{
Info("initialize()", " ");
m_event = wk()->xaodEvent();
m_store = wk()->xaodStore();
Info("initialize()", "Number of events in file: %lld ", m_event->getEntries() );
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: execute ()
{
if ( m_debug ) { Info("execute()", " "); }
Info("DebugTool", m_name.c_str());
//
// look what we have in TStore
//
if ( m_printStore ) {
m_store->print();
}
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: postExecute ()
{
if ( m_debug ) { Info("postExecute()", "Calling postExecute"); }
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: finalize ()
{
Info("finalize()", "%s", m_name.c_str());
return EL::StatusCode::SUCCESS;
}
EL::StatusCode DebugTool :: histFinalize ()
{
Info("histFinalize()", "Calling histFinalize");
return EL::StatusCode::SUCCESS;
}