149{
150
151
153
154 po::options_description optDesc("Allowed options");
155 optDesc.add_options()
156 ("help,h", "produce help message")
157 (
"input-file,i", po::value<std::string>()->
required(),
158 "input xAOD file name")
159 ("num-events,n", po::value<Long64_t>()->default_value(-1ll),
160 "number of events to process")
161 ("working-point,w", po::value<std::string>()->default_value("standard"),
162 "OR working point");
163
164 po::variables_map vm;
165 po::store(po::parse_command_line(argc, argv, optDesc), vm);
166 if(vm.count("help")) {
167 std::cout << optDesc << std::endl;
168 return 1;
169 }
170 try {
171 po::notify(vm);
172 }
173 catch(const std::exception& e) {
174 std::cout <<
e.what() << std::endl;
175 return 1;
176 }
177
178
180 StatusCode::enableFailure();
181
182
183 const auto fileName = vm[
"input-file"].as<std::string>();
186
187
191
192
193 Long64_t
entries =
event.getEntries();
194 Long64_t optEntries = vm["num-events"].as<Long64_t>();
198
199
201
202
203 const auto wp = vm[
"working-point"].as<std::string>();
204 if(wp == "standard") {
205
206 } else if(wp == "HF") {
208 } else if(wp == "boosted") {
209 orFlags.boostedLeptons = true;
210 } else if(wp == "boostedHF") {
212 orFlags.boostedLeptons = true;
213 } else if(wp == "photonFavored") {
214 orFlags.doTaus = false;
215 } else {
217 return 1;
218 }
220
221
224
225
226 if(wp == "photonFavored") {
231 }
232
233
234
235
236
239
240
241
242 unsigned int nTotalElectrons = 0;
243 unsigned int nTotalMuons = 0;
244 unsigned int nTotalJets = 0;
245 unsigned int nTotalTaus = 0;
246 unsigned int nTotalPhotons = 0;
247 unsigned int nSelectedElectrons = 0;
248 unsigned int nSelectedMuons = 0;
249 unsigned int nSelectedJets = 0;
250 unsigned int nSelectedTaus = 0;
251 unsigned int nSelectedPhotons = 0;
252 unsigned int nOverlapElectrons = 0;
253 unsigned int nOverlapMuons = 0;
254 unsigned int nOverlapJets = 0;
255 unsigned int nOverlapTaus = 0;
256 unsigned int nOverlapPhotons = 0;
257
258
259 std::cout << "Starting loop" << std::endl;
261
262 event.getEntry(entry);
263
264
266 CHECK(
event.retrieve(evtInfo,
"EventInfo") );
267 Info(
APP_NAME,
"===>>> Processing entry %lli, run %u, event %lu <<<===",
269
270
272 CHECK(
event.retrieve(electrons,
"Electrons") );
273
276
278 CHECK(
event.retrieve(jets,
"AntiKt4EMTopoJets") );
279
282
285
286
292
293 Info(
APP_NAME,
"nEle %lu, nMuo %lu, nJet %lu, nTau %lu, nPho %lu",
297
298
299 CHECK( orTool->removeOverlaps(electrons, muons, jets,
taus, photons) );
300
301
302
303
304
305
306
308 for(auto electron : *electrons){
312 nSelectedElectrons++;
313 }
314 nTotalElectrons++;
315 }
316
317
319 for(auto muon : *muons){
323 nSelectedMuons++;
324 }
325 nTotalMuons++;
326 }
327
328
330 for(
auto jet : *jets){
334 nSelectedJets++;
335 }
336 nTotalJets++;
337 }
338
339
341 for(
auto tau : *
taus){
345 nSelectedTaus++;
346 }
347 nTotalTaus++;
348 }
349
350
352 for(auto photon : *photons){
356 nSelectedPhotons++;
357 }
358 nTotalPhotons++;
359 }
360
361 }
362 Info(
APP_NAME,
"=====================================");
364 Info(
APP_NAME,
"Object count summaries: nOverlap / nSelected / nTotal");
366 nOverlapElectrons, nSelectedElectrons, nTotalElectrons);
368 nOverlapMuons, nSelectedMuons, nTotalMuons);
370 nOverlapJets, nSelectedJets, nTotalJets);
372 nOverlapTaus, nSelectedTaus, nTotalTaus);
373 Info(
APP_NAME,
"Number overlap photons: %5i / %5i / %5i",
374 nOverlapPhotons, nSelectedPhotons, nTotalPhotons);
375
377
378 return 0;
379}
const ort::outputAccessor_t overlapAcc(outputLabel)
const std::string outputLabel
const bool outputPassValue
void printObj(const char *APP_NAME, const char *type, const xAOD::IParticle *obj)
const std::string inputLabel
const ort::inputAccessor_t selectAcc(inputLabel)
const std::string bJetLabel
void selectObjects(const ContainerType *container)
size_type size() const noexcept
Returns the number of elements in the collection.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
Tool for accessing xAOD files outside of Athena.
@ kAthenaAccess
Access containers/objects like Athena does.
A relatively simple transient store for objects created in analysis.
Error
The different types of error that can be flagged in the L1TopoRDO.
StatusCode recommendedTools(const ORFlags &flags, ToolBox &toolBox)
Pre-configured standard recommended OR tools.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
A struct of global config options used to simplify the config helper interface.