@@ -59,12 +59,10 @@ EL::StatusCode MyxAODAnalysis :: setupJob (EL::Job& job)
59
59
// activated/deactivated when you add/remove the algorithm from your
60
60
// job, which may or may not be of value to you.
61
61
62
- // GitHubProgramCode added
63
62
// let's initialize the algorithm to use the xAODRootAccess package
64
63
job.useXAOD ();
65
- // xAOD::Init(); // call before opening first file
66
64
ANA_CHECK_SET_TYPE (EL::StatusCode); // set type of return code you are expecting (add to top of each function once)
67
- ANA_CHECK (xAOD::Init ());
65
+ ANA_CHECK (xAOD::Init ());
68
66
69
67
return EL::StatusCode::SUCCESS;
70
68
}
@@ -78,7 +76,6 @@ EL::StatusCode MyxAODAnalysis :: histInitialize ()
78
76
// trees. This method gets called before any input files are
79
77
// connected.
80
78
81
- // GitHubProgramCode added
82
79
// This method is called before processing any events. Note that the wk()->addOutput call is a mechanism EventLoop uses for delivering the results of an algorithm to the outside world. When running in PROOF, ROOT will merge all of the objects in this list.
83
80
84
81
// Initializing histograms
@@ -109,6 +106,7 @@ EL::StatusCode MyxAODAnalysis :: changeInput (bool firstFile)
109
106
// Here you do everything you need to do when we change input files,
110
107
// e.g. resetting branch addresses on trees. If you are using
111
108
// D3PDReader or a similar service this method is not needed.
109
+ (void )firstFile; // Suppress unused-variable warning.
112
110
return EL::StatusCode::SUCCESS;
113
111
}
114
112
@@ -125,17 +123,14 @@ EL::StatusCode MyxAODAnalysis :: initialize ()
125
123
// you create here won't be available in the output if you have no
126
124
// input events.
127
125
128
- // GitHubProgramCode added
129
126
ANA_CHECK_SET_TYPE (EL::StatusCode); // set type of return code you are expecting (add to top of each function once)
130
127
xAOD::TEvent* event = wk ()->xaodEvent ();
131
128
132
- // GitHubProgramCode added
133
129
// as a check, let's see the number of events in our xAOD
134
130
Info (" initialize()" , " Number of events = %lli" , event->getEntries () ); // print long long int
135
131
136
- // GitHubProgramCode added
137
132
// count number of events
138
- m_eventCounter = 0 ;
133
+ m_eventCounter = 0 ;
139
134
140
135
return EL::StatusCode::SUCCESS;
141
136
}
@@ -149,47 +144,20 @@ EL::StatusCode MyxAODAnalysis :: execute ()
149
144
// histograms and trees. This is where most of your actual analysis
150
145
// code will go.
151
146
152
- // GitHubProgramCode added
153
147
ANA_CHECK_SET_TYPE (EL::StatusCode); // set type of return code you are expecting (add to top of each function once)
154
148
xAOD::TEvent* event = wk ()->xaodEvent ();
155
149
156
- // GitHubProgramCode added
157
150
// print every 100 events, so we know where we are:
158
- if ( (m_eventCounter % 100 ) ==0 ) Info (" execute()" , " Event number = %i" , m_eventCounter );
151
+ if ((m_eventCounter % 100 ) == 0 )
152
+ {
153
+ Info (" execute()" , " Event number = %i" , m_eventCounter);
154
+ }
159
155
m_eventCounter++;
160
156
161
- // ----------------------------
162
- // Event information
163
- // ---------------------------
164
- const xAOD::EventInfo* eventInfo = 0 ;
165
- ANA_CHECK (event->retrieve ( eventInfo, " EventInfo" ));
166
-
167
- // check if the event is data or MC
168
- // (many tools are applied either to data or MC)
169
- // Warning: set but not used below commented out
170
- // bool isMC = false;
171
- // check if the event is MC
172
- // if(eventInfo->eventType( xAOD::EventInfo::IS_SIMULATION ) ){
173
- // isMC = true; // can do something with this later
174
- // }
175
-
176
- // GitHubProgramCode added + Gordoncode
177
- // get jet container of interest
178
- const xAOD::TruthEventContainer* truths = 0 ;
179
- ANA_CHECK (event->retrieve ( truths, " TruthEvents" ));
180
- Info (" execute()" , " number of truths = %lu" , truths->size ());
181
-
182
- // loop over the jets in the container
183
- xAOD::TruthEventContainer::const_iterator truth_itr = truths->begin ();
184
- xAOD::TruthEventContainer::const_iterator truth_end = truths->end ();
185
-
186
- // Get the truth info
157
+ // Get the truth events.
187
158
const xAOD::TruthEventContainer *truth = nullptr ;
188
- // RETURN_CHECK (APP_NAME, event->retrieve(truth, "TruthEvents"));
189
- ANA_CHECK (event->retrieve ( truth, " TruthEvents" ));
190
- // Warning: set but not used below commented out
191
- // bool isHiggs62 = false;
192
- // Loop over all the truth particles in there
159
+ ANA_CHECK (event->retrieve ( truth, " TruthEvents" ));
160
+ // Loop over all of the truth events.
193
161
for (auto evt : *truth)
194
162
{
195
163
for (auto p : truth_as_range (evt))
@@ -249,10 +217,7 @@ EL::StatusCode MyxAODAnalysis :: finalize ()
249
217
// merged. This is different from histFinalize() in that it only
250
218
// gets called on worker nodes that processed input events.
251
219
252
- // GitHubProgramCode added
253
220
ANA_CHECK_SET_TYPE (EL::StatusCode); // set type of return code you are expecting (add to top of each function once)
254
- // Warning: unused variable below commented out
255
- // xAOD::TEvent* event = wk()->xaodEvent();
256
221
257
222
return EL::StatusCode::SUCCESS;
258
223
}
0 commit comments