ATLAS Offline Software
TopObjectSelection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
8 
9 #include "TopEvent/EventTools.h"
12 
15 #include "xAODMuon/MuonContainer.h"
17 #include "xAODJet/JetContainer.h"
21 
23 
27 
29 
30 namespace top {
32  asg::AsgTool(name),
33  m_config(nullptr),
34  m_electronSelection(nullptr),
35  m_fwdElectronSelection(nullptr),
36  m_muonSelection(nullptr),
37  m_softmuonSelection(nullptr),
38  m_tauSelection(nullptr),
39  m_jetSelection(nullptr),
40  m_photonSelection(nullptr),
41  m_largeJetSelection(nullptr),
42  m_trackJetSelection(nullptr),
43  m_jetGhostTrackSelection(nullptr),
44  m_trackSelection(nullptr),
45  m_overlapRemovalToolPostSelection(nullptr),
46  m_electronInJetSubtractor(nullptr),
47  m_passPreORSelection("passPreORSelection"),
48  m_passPreORSelectionLoose("passPreORSelectionLoose"),
49  // the following two are used to give failing JVT and failing fJVT jets a lower priority in the OR
50  m_ORToolDecoration("ORToolDecoration"),
51  m_ORToolDecorationLoose("ORToolDecorationLoose"),
52  m_doLooseCuts(false),
53  m_overlapRemovalTool_softMuons_Alljets("OverlapRemovalTool_softMuons_Alljets")
54  {
55  declareProperty("config", m_config);
56  }
57 
59  // If there are loose selection requirements, then we need additional computations
60  // Tight leptons are not constrained to be a sub-set of loose
61  // We will call the selections in the following order:
62  // (1) passSelection();
63  // (2) passSelectionLoose();
64  //
65  // If your tight is not a sub-set of your loose, then you have 2 different functions
66  // If your tight is a sub-set of your loose, then I suggest you set a loose flag
67  // when calling passSelection(), then have passSelectionLoose() return this flag
68  //
69  // Requests to process loose selections can come from:
70  // (1) Data event
71  // (2) User request overlap removal be done on loose objects
72  // - The top recommendation is that you do OR on tight objects
73  // (3) Determination of Fakes control regions in MC - expert fakes mode
74  //
75 
76  if (m_config->useSoftMuons() && m_config->useMuons()) {
77  top::check(m_overlapRemovalTool_softMuons_Alljets.retrieve(), "Failed to retrieve overlap removal tool for soft muons - all jets");
78  }
79 
80  if (!m_config->isMC()) m_doLooseCuts = true;
81 
82  if (m_config->doOverlapRemovalOnLooseLeptonDef()) m_doLooseCuts = true;
83 
84  if (m_config->doLooseEvents()) m_doLooseCuts = true;
85 
86  if(m_config->useLooseObjectsInMETInLooseTree() || m_config->useLooseObjectsInMETInNominalTree() || m_config->writeMETBuiltWithLooseObjects()) m_doLooseCuts = true;
87 
88  if (m_config->applyElectronInJetSubtraction()) {
89  m_electronInJetSubtractor = std::unique_ptr<top::ElectronInJetSubtractionCollectionMaker>
91  "top::ElectronInJetSubtractionCollectionMaker"));
92  top::check(m_electronInJetSubtractor->setProperty("config",
93  m_config),
94  "Failed to setProperty of top::ElectronInJetSubtractionCollectionMaker");
95  top::check(
96  m_electronInJetSubtractor->initialize(), "Failed to initialize top::ElectronInJetSubtractionCollectionMaker");
97  }
98 
99  // b-tagging stuff
100  // for calo jets
101  for (const std::string& WP : m_config->bTagWP()) {
102  m_btagSelTools[WP] = "BTaggingSelectionTool_" + WP + "_" + m_config->sgKeyJets();
103  top::check(m_btagSelTools[WP].retrieve(), "Failed to retrieve b-tagging Selection tool");
104  }
105  // for track jets
106  if (m_config->useTrackJets()) {
107  for (const std::string& WP : m_config->bTagWP_trkJet()) {
108  m_trkjet_btagSelTools[WP] = "BTaggingSelectionTool_" + WP + "_" + m_config->sgKeyTrackJets();
109  top::check(m_trkjet_btagSelTools[WP].retrieve(), "Failed to retrieve b-tagging Selection tool");
110  }
111  }
112 
113  return StatusCode::SUCCESS;
114  }
115 
117  m_electronSelection.reset(ptr);
118  }
119 
121  m_fwdElectronSelection.reset(ptr);
122  }
123 
125  m_muonSelection.reset(ptr);
126  }
127 
129  m_softmuonSelection.reset(ptr);
130  }
131 
133  m_tauSelection.reset(ptr);
134  }
135 
137  m_jetSelection.reset(ptr);
138  }
139 
141  m_photonSelection.reset(ptr);
142  }
143 
145  m_largeJetSelection.reset(ptr);
146  }
147 
149  m_trackJetSelection.reset(ptr);
150  }
151 
153  m_jetGhostTrackSelection.reset(ptr);
154  }
155 
157  m_trackSelection.reset(ptr);
158  }
159 
160 
163  }
164 
166  // Set variable to tell us if we are doing this execution on nominal or systematic events
167  m_executeNominal = executeNominal;
169  top::check(applyOverlapRemoval(), "Failed to apply overlap removal");
170 
171  return StatusCode::SUCCESS;
172  }
173 
175  // If we are doing Electron in Jet subtraction,
176  // We need to:
177  // (1) Apply object selection to the electrons
178  // (2) Subtract the electron from the jet, which:
179  // - Changes the jet 4-momentum
180  // - Reject additional electrons
181  // (3) Apply object selection to the modified jets
182 
183  if (m_config->useElectrons()) {
185  }
186  if (m_config->useFwdElectrons()) {
188  }
189 
190  if (m_config->applyElectronInJetSubtraction()) {
192  m_executeNominal), "Failed to execute top::ElectronInJetSubtractionCollectionMaker");
193  }
194 
195 
196  if (m_config->usePhotons() && m_photonSelection != nullptr) {
198  }
199  if (m_config->useMuons() && m_muonSelection != nullptr) {
201  }
202  if (m_config->useSoftMuons() && m_softmuonSelection != nullptr) {
204  }
205  if (m_config->useTaus() && m_tauSelection != nullptr) {
207  }
208  if (m_config->useJets() && m_jetSelection != nullptr) {
210  }
211  if (m_config->useLargeRJets() && m_largeJetSelection != nullptr) {
213  }
214  if (m_config->useTrackJets() && m_trackJetSelection != nullptr) {
216  }
217  if (m_config->useJetGhostTrack() && m_jetGhostTrackSelection != nullptr) {
219  }
220  if (m_config->useTracks() && m_trackSelection != nullptr) {
222  }
223 
224  }
225 
227  for (auto currentSystematic : *m_config->systSgKeyMapPhotons()) {
229  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
230  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
231 
232  const xAOD::PhotonContainer* photons(nullptr);
233  top::check(evtStore()->retrieve(photons,
234  currentSystematic.second),
235  "TopObjectSelection::applySelectionPreOverlapRemovalPhotons() failed to retrieve photons");
236  ATH_MSG_DEBUG(" Cut on Photons with key = " << currentSystematic.second);
237 
238  for (auto photonPtr : *photons) {
239  photonPtr->auxdecor<char>(m_passPreORSelection) = m_photonSelection->passSelection(*photonPtr);
240  photonPtr->auxdecor<char>(m_ORToolDecoration) = photonPtr->auxdataConst<char>(m_passPreORSelection) * 2;
241  if (m_doLooseCuts) {
242  photonPtr->auxdecor<char>(m_passPreORSelectionLoose) = m_photonSelection->passSelectionLoose(*photonPtr);
243  photonPtr->auxdecor<char>(m_ORToolDecorationLoose) =
244  photonPtr->auxdataConst<char>(m_passPreORSelectionLoose) * 2;
245  }
246  }
247  }
248  }
249 
255  for (auto currentSystematic : *m_config->systSgKeyMapElectrons()) {
257  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
258  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
259 
260  const xAOD::ElectronContainer* electrons(nullptr);
262  currentSystematic.second),
263  "TopObjectSelection::applySelectionPreOverlapRemovalElectrons() failed to retrieve electrons");
264  ATH_MSG_DEBUG(" Cut on Electrons with key = " << currentSystematic.second);
265 
266  for (auto electronPtr : *electrons) {
267  electronPtr->auxdecor<char>(m_passPreORSelection) = m_electronSelection->passSelection(*electronPtr);
268  electronPtr->auxdecor<char>(m_ORToolDecoration) = electronPtr->auxdataConst<char>(m_passPreORSelection) * 2;
269  if (m_doLooseCuts) {
270  electronPtr->auxdecor<char>(m_passPreORSelectionLoose) =
271  m_electronSelection->passSelectionLoose(*electronPtr);
272  electronPtr->auxdecor<char>(m_ORToolDecorationLoose) = electronPtr->auxdataConst<char>(
274  }
275  }
276  }
277  }
278 
284  for (const auto& currentSystematic : *m_config->systSgKeyMapFwdElectrons()) {
286  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
287  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
288 
289  const xAOD::ElectronContainer* fwdelectrons(nullptr);
290  top::check(evtStore()->retrieve(fwdelectrons,
291  currentSystematic.second),
292  "TopObjectSelection::applySelectionPreOverlapRemovalFwdElectrons() failed to retrieve fwd electrons");
293  ATH_MSG_DEBUG(" Cut on Electrons with key = " << currentSystematic.second);
294 
295  int bcid = 0;
296  int runNumber = 0;
297  if (!m_config->isMC()) {
298  const xAOD::EventInfo* eventInfo(nullptr);
299  top::check(evtStore()->retrieve(eventInfo,
300  m_config->sgKeyEventInfo()),
301  "Failed to retrieve EventInfo in TopObjectSelection::applySelectionPreOverlapRemovalFwdElectrons()");
302  bcid = eventInfo->bcid();
303  runNumber = eventInfo->runNumber();
304  }
305 
306  for (auto electronPtr : *fwdelectrons) {
307  electronPtr->auxdecor<char>(m_passPreORSelection) = m_fwdElectronSelection->passSelection(*electronPtr, bcid,
308  runNumber);
309  electronPtr->auxdecor<char>(m_ORToolDecoration) = electronPtr->auxdataConst<char>(m_passPreORSelection) * 2;
310  if (m_doLooseCuts) {
311  electronPtr->auxdecor<char>(m_passPreORSelectionLoose) = m_fwdElectronSelection->passSelectionLoose(
312  *electronPtr, bcid, runNumber);
313  electronPtr->auxdecor<char>(m_ORToolDecorationLoose) = electronPtr->auxdataConst<char>(
315  }
316  }//end of loop on electrons
317  }//end of loop on systematics
318  }
319 
321  for (auto currentSystematic : *m_config->systSgKeyMapMuons()) {
323  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
324  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
325  const xAOD::MuonContainer* muons(nullptr);
326  top::check(evtStore()->retrieve(muons,
327  currentSystematic.second),
328  "TopObjectSelection::applySelectionPreOverlapRemovalMuons() failed to retrieve muons");
329 
330  for (auto muonPtr : *muons) {
331  muonPtr->auxdecor<char>(m_passPreORSelection) = m_muonSelection->passSelection(*muonPtr);
332  muonPtr->auxdecor<char>(m_ORToolDecoration) = muonPtr->auxdataConst<char>(m_passPreORSelection) * 2;
333  if (m_doLooseCuts) {
334  muonPtr->auxdecor<char>(m_passPreORSelectionLoose) = m_muonSelection->passSelectionLoose(*muonPtr);
335  muonPtr->auxdecor<char>(m_ORToolDecorationLoose) = muonPtr->auxdataConst<char>(m_passPreORSelectionLoose) * 2;
336  }
337  }
338  }
339  }
340 
342  for (const auto& currentSystematic : *m_config->systSgKeyMapSoftMuons()) {
344  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
345  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
346  const xAOD::MuonContainer* softmuons(nullptr);
347  top::check(evtStore()->retrieve(softmuons,
348  currentSystematic.second),
349  "TopObjectSelection::applySelectionPreOverlapRemovalSoftMuons() failed to retrieve soft muons");
350 
351  for (const xAOD::Muon* softmuonPtr : *softmuons) {
352  softmuonPtr->auxdecor<char>(m_passPreORSelection) = m_softmuonSelection->passSelection(*softmuonPtr);
353  softmuonPtr->auxdecor<char>(m_ORToolDecoration) = softmuonPtr->auxdataConst<char>(m_passPreORSelection) * 2;
354  }
355  }
356  }
357 
359  for (auto currentSystematic : *m_config->systSgKeyMapTaus()) {
361  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
362  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
363  const xAOD::TauJetContainer* taus(nullptr);
364  top::check(evtStore()->retrieve(taus,
365  currentSystematic.second),
366  "TopObjectSelection::applySelectionPreOverlapRemovalTaus() failed to retrieve taus");
367 
368  for (auto tauPtr : *taus) {
369  tauPtr->auxdecor<char>(m_passPreORSelection) = m_tauSelection->passSelection(*tauPtr);
370  tauPtr->auxdecor<char>(m_ORToolDecoration) = tauPtr->auxdataConst<char>(m_passPreORSelection) * 2;
371  if (m_doLooseCuts) {
372  tauPtr->auxdecor<char>(m_passPreORSelectionLoose) = m_tauSelection->passSelectionLoose(*tauPtr);
373  tauPtr->auxdecor<char>(m_ORToolDecorationLoose) = tauPtr->auxdataConst<char>(m_passPreORSelectionLoose) * 2;
374  }
375  }
376  }
377  }
378 
380  // Boosted analysis subtract electrons from jets
381  // If we use Loose electrons we end up with loose jet collections
382 
383  bool isLooseJets(false);
384 
385  for (auto currentSystematic : *m_config->systSgKeyMapJets(isLooseJets)) {
387  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
388  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
389 
390  const xAOD::JetContainer* jets(nullptr);
392  currentSystematic.second),
393  "TopObjectSelection::applySelectionPreOverlapRemovalJets() failed to retrieve jets");
394  ATH_MSG_DEBUG(" Cut on Jets with key = " << currentSystematic.second);
395 
396  for (auto jetPtr : *jets) {
397  ATH_MSG_DEBUG(" Jet pt = " << (jetPtr)->pt());
398  bool passed = m_jetSelection->passSelection(*jetPtr);
399 
400  //Forward jets always get JVT=1, Central jets always get fJVT=1
401  bool passedJVT_and_fJVT = true;
402  if (jetPtr->isAvailable<char>("passJVT")) {
403  if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) {
404  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("passJVT") && jetPtr->auxdataConst<char>("AnalysisTop_fJVTdecision");
405  }
406  else {
407  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("passJVT");
408  }
409  }
410  else if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) { //Possibly redundant, fJVT shouldn't really be able to run if passJVT isn't avaliable
411  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("AnalysisTop_fJVTdecision");
412  }
413 
414  if (m_config->applyElectronInJetSubtraction()) {
415  if (jetPtr->isAvailable<char>("passesFancyOR")) {
416  if (!jetPtr->auxdecor<char>("passesFancyOR")) passed = false;
417  }
418  }
419  // if JVT or fJVT cut enabled and valid: jets that pass (f)JVT get passPreORSelection * 2, jets that fail get the same as passPreORSelection
420  // if no JVT cut and central jet, or no fJVT and forward jet, jet gets: passPreORSelection * 2
421  jetPtr->auxdecor<char>(m_passPreORSelection) = passed;
422  jetPtr->auxdecor<char>(m_ORToolDecoration) = (passed ? (passedJVT_and_fJVT ? 2 : 1) : 0);
423  if (m_doLooseCuts) {
424  jetPtr->auxdecor<char>(m_passPreORSelectionLoose) = passed;
425  jetPtr->auxdecor<char>(m_ORToolDecorationLoose) = (passed ? (passedJVT_and_fJVT ? 2 : 1) : 0);
426  }
427  //decorate with b-tagging flags
428  for (const auto& btagSel : m_btagSelTools) {
429  if (btagSel.first.find("Continuous") == std::string::npos) {
430  bool isTagged = false;
431  if (std::fabs(jetPtr->eta()) <= 2.5) {
432  isTagged = static_cast<bool>(btagSel.second->accept(*jetPtr));
433  }
434  jetPtr->auxdecor<char>("isbtagged_" + btagSel.first) = isTagged;
435  } else {
436  int tagWeightBin = -2; // AT default
437  if (std::fabs(jetPtr->eta()) <= 2.5) {
438  tagWeightBin = btagSel.second->getQuantile(*jetPtr);
439  }
440  jetPtr->auxdecor<int>("tagWeightBin_" + btagSel.first) = tagWeightBin;
441  }
442  }
443  }
444  }
445 
446  // Are we using the ElectronInJetSubtraction and running with loose lepton definitons
447  if (m_doLooseCuts && m_config->applyElectronInJetSubtraction()) {
448  for (auto currentSystematic : *m_config->systSgKeyMapJets(m_doLooseCuts)) {
450  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
451  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
452 
453  const xAOD::JetContainer* jets(nullptr);
455  currentSystematic.second),
456  "TopObjectSelection::applySelectionPreOverlapRemovalJets() failed to retrieve jets");
457  ATH_MSG_DEBUG(" Cut on Jets with key = " << currentSystematic.second);
458 
459  for (auto jetPtr : *jets) {
460  bool decoration = m_jetSelection->passSelection(*jetPtr);
461 
462  //Forward jets always get JVT=1, Central jets always get fJVT=1
463  bool passedJVT_and_fJVT = true;
464  if (jetPtr->isAvailable<char>("passJVT")) {
465  if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) {
466  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("passJVT") && jetPtr->auxdataConst<char>("AnalysisTop_fJVTdecision");
467  }
468  else {
469  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("passJVT");
470  }
471  }
472  else if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) { //Possibly redundant, fJVT shouldn't really be able to run if passJVT isn't avaliable
473  passedJVT_and_fJVT = jetPtr->auxdataConst<char>("AnalysisTop_fJVTdecision");
474  }
475 
476  // if JVT or fJVT cut enabled: jets that pass (f)JVT get passPreORSelection*2, jets which fail get the same as passPreORSelection
477  // if no JVT cut and central jet, or no fJVT cut and forward jet, jet gets: passPreORSelection * 2
478  jetPtr->auxdecor<char>(m_passPreORSelection) = decoration;
479  jetPtr->auxdecor<char>(m_passPreORSelectionLoose) = decoration;
480 
481  jetPtr->auxdecor<char>(m_ORToolDecoration) = (decoration ? (passedJVT_and_fJVT ? 2 : 1) : 0);
482  jetPtr->auxdecor<char>(m_ORToolDecorationLoose) = (decoration ? (passedJVT_and_fJVT ? 2 : 1) : 0);;
483 
484  //decorate with b-tagging flags
485  for (const auto& btagSel : m_btagSelTools) {
486  if (btagSel.first.find("Continuous") == std::string::npos) {
487  bool isTagged = false;
488  if (std::fabs(jetPtr->eta()) < 2.5) {
489  isTagged = static_cast<bool>(btagSel.second->accept(*jetPtr));
490  }
491  jetPtr->auxdecor<char>("isbtagged_" + btagSel.first) = isTagged;
492  } else {
493  int tagWeightBin = -2; // AT default
494  if (std::fabs(jetPtr->eta()) < 2.5) {
495  tagWeightBin = btagSel.second->getQuantile(*jetPtr);
496  }
497  jetPtr->auxdecor<int>("tagWeightBin_" + btagSel.first) = tagWeightBin;
498  }
499  }
500  }
501  }
502  }
503  }
504 
506  for (auto currentSystematic : *m_config->systSgKeyMapLargeRJets()) {
508  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
509  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
510 
511  const xAOD::JetContainer* jets(nullptr);
513  currentSystematic.second),
514  "TopObjectSelection::applySelectionPreOverlapRemovalLargeRJets() failed to retrieve large R jets");
515 
516  for (auto jetPtr : *jets) {
517  char decoration = m_largeJetSelection->passSelection(*jetPtr);
518  jetPtr->auxdecor<char>(m_passPreORSelection) = decoration;
519  jetPtr->auxdecor<char>(m_ORToolDecoration) = decoration * 2;
520  if (m_doLooseCuts) {
521  jetPtr->auxdecor<char>(m_passPreORSelectionLoose) = decoration;
522  jetPtr->auxdecor<char>(m_ORToolDecorationLoose) = decoration * 2;
523  }
524  }
525  }
526  }
527 
530  if (!m_executeNominal) return;
531 
532  const xAOD::JetContainer* jets(nullptr);
534  m_config->sgKeyTrackJets()),
535  "TopObjectSelection::applySelectionPreOverlapRemovalTrackJets() failed to retrieve track jets");
536 
537 
538 
539  for (const xAOD::Jet* jetPtr : *jets) {
540  char decoration = m_trackJetSelection->passSelection(*jetPtr);
541  jetPtr->auxdecor<char>(m_passPreORSelection) = decoration;
542  if (m_doLooseCuts) {
543  jetPtr->auxdecor<char>(m_passPreORSelectionLoose) = decoration;
544  }
545 
546  if (m_config->sgKeyTrackJets() == "AntiKtVR30Rmax4Rmin02PV0TrackJets") { // Event cleaning for variable-R track jets
547  float pt_baseline = 5e3;
548  float radius1 = std::max(0.02, std::min(0.4, 30000. / jetPtr->pt()));
549 
550  float dr_jets;
551  bool passDRcut = true;
552  for (const xAOD::Jet* jet2 : *jets) {
553  if (jet2->pt() < pt_baseline) continue;
554  if (jetPtr == jet2) continue;
555 
556  float radius2 = std::max(0.02, std::min(0.4, 30000. / jet2->pt()));
557 
558  dr_jets = xAOD::P4Helpers::deltaR(jetPtr, jet2, false);
559  if (dr_jets < std::min(radius1, radius2)) passDRcut = false;
560  }
561  jetPtr->auxdecor<char>("passDRcut") = passDRcut;
562  }
563 
564  for (const auto& btagSel : m_trkjet_btagSelTools) {
565  if (btagSel.first.find("Continuous") == std::string::npos) {
566  bool isTagged = false;
567  if (std::fabs(jetPtr->eta()) < 2.5) {
568  isTagged = static_cast<bool>(btagSel.second->accept(*jetPtr));
569  }
570  jetPtr->auxdecor<char>("isbtagged_" + btagSel.first) = isTagged;
571  } else {
572  int tagWeightBin = -2; // AT default
573  if (std::fabs(jetPtr->eta()) < 2.5) {
574  tagWeightBin = btagSel.second->getQuantile(*jetPtr);
575  }
576  jetPtr->auxdecor<int>("tagWeightBin_" + btagSel.first) = tagWeightBin;
577  }
578  }
579  }
580  }
581 
583 
584  auto jetsystematic = *m_config->systSgKeyMapJets(false);
586  std::size_t m_nominalHashValue = nominal.hash();
587 
588  for (auto currentSystematic : *m_config->systMapJetGhostTrack()) {
589 
590  // At this point some specific jet collection doesn't exist for tracking systematic so use the nominal jet collection to retrieve the ghost tracks
591  std::unordered_map<std::size_t, std::string>::const_iterator jetsyst_name = jetsystematic.find(currentSystematic.first);
592  if (jetsyst_name == jetsystematic.end()) {
593  jetsyst_name = jetsystematic.find(m_nominalHashValue);
594  }
595 
597  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
598 
599  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
600 
601 
602  const xAOD::JetContainer* jets(nullptr);
604  (*jetsyst_name).second),
605  "TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks() failed to retrieve jets");
606  ATH_MSG_DEBUG(" Cut on JetsGhostTracks with key = " << (*jetsyst_name).second);
607 
608 
609 
610  for (auto jetPtr : *jets)
611  {
612  if(!m_jetGhostTrackSelection->JetConsideredForGhostTrackSelection(jetPtr->pt(),jetPtr->eta())) continue;
613 
614 
615  std::vector<const xAOD::TrackParticle*> jetTracks;
616 
617  jetTracks = jetPtr->getAssociatedObjects<xAOD::TrackParticle>(m_config->decoKeyJetGhostTrack(currentSystematic.first));
618 
619  if (jetTracks.size() == 0){
620  ATH_MSG_WARNING("TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks() failed to retrieve tracks, jet pT and eta:" << jetPtr->pt() << " " << std::fabs(jetPtr->eta()) );
621  continue;
622  }
623 
624  const xAOD::VertexContainer* vertices = nullptr;
625  top::check(evtStore() -> retrieve( vertices, "PrimaryVertices" ), "Failed to get primary vertices");
626  const auto it_pv = std::find_if(vertices->cbegin(), vertices->cend(),
627  [](const xAOD::Vertex* vtx)
628  {return vtx->vertexType() == xAOD::VxType::PriVtx;});
629  const xAOD::Vertex* primaryVertex = (it_pv == vertices->cend()) ? nullptr : *it_pv;
630  if (primaryVertex == nullptr) ATH_MSG_WARNING("TopObjectSelection No primary vertex found." );
631 
632 
633 
634  for (auto jetTrIt : jetTracks){
635 
636  //Decorate the tracks with a flag "passPreORSelection" to indicate if they passed the selection
637  //jetTrIt->auxdecor<char>(m_passPreORSelection) = m_jetGhostTrackSelection->passSelection(*jetTrIt, *primaryVertex);
638  jetTrIt->auxdecor<char>(m_passPreORSelection) = '0';
639  jetTrIt->auxdecor<char>(m_ORToolDecoration) = jetTrIt->auxdataConst<char>(m_passPreORSelection) * 2;
640 
641  }
642 
643  }
644  }
645  }
646 
647 
649 
650  for (auto currentSystematic : *m_config->systSgKeyMapTracks()) {
651 
653  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
654 
655  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(currentSystematic.first))) continue;
656 
657  const xAOD::TrackParticleContainer* tracks(nullptr);
658  top::check(evtStore()->retrieve(tracks,
659  currentSystematic.second),
660  "TopObjectSelection::applySelectionPreOverlapRemovalTracks() failed to retrieve tracks");
661 
662  ATH_MSG_DEBUG(" Cut on Tracks with key = " << currentSystematic.second);
663 
664  const xAOD::VertexContainer* vertices = nullptr;
665 
666  top::check(evtStore() -> retrieve( vertices, "PrimaryVertices" ), "Failed to get primary vertices");
667  const auto it_pv = std::find_if(vertices->cbegin(), vertices->cend(),
668  [](const xAOD::Vertex* vtx)
669  {return vtx->vertexType() == xAOD::VxType::PriVtx;});
670  const xAOD::Vertex* primaryVertex = (it_pv == vertices->cend()) ? nullptr : *it_pv;
671  if (primaryVertex == nullptr) ATH_MSG_WARNING("TopObjectSelection. No primary vertex found." );
672 
673  for (auto trackPtr : *tracks) {
674 
675  //trackPtr -> auxdecor<char>(m_passPreORSelection) = m_trackSelection->passSelection(*trackPtr, *primaryVertex);
676  trackPtr->auxdecor<char>(m_passPreORSelection) = '0';
677  trackPtr -> auxdecor<char>(m_ORToolDecoration) = trackPtr->auxdataConst<char>(m_passPreORSelection) * 2;
678 
679  }
680  }
681 
682  }
683 
684 
686  bool aLooseEvent(true), aTightEvent(false);
687 
688  if (m_config->doTightEvents()) {
689  top::check(applyOverlapRemoval(aTightEvent,
690  m_config->sgKeyTopSystematicEvents()), "Failed to apply overlap removal");
691  }
692  if (m_config->doLooseEvents()) {
693  top::check(applyOverlapRemoval(aLooseEvent,
694  m_config->sgKeyTopSystematicEventsLoose()), "Failed to apply overlap removal");
695  }
696  return StatusCode::SUCCESS;
697  }
698 
699  StatusCode TopObjectSelection::applyOverlapRemoval(const bool isLoose, const std::string& sgKey) {
700  // create the xAOD::SystematicEventContainer
703  systEventCont->setStore(systEventAuxCont);
704 
705  // We need to be able to have the nominal systematic processed first
706  // but we cannot alter this inside TopConfig as we use unordered_set
707  // Using an ordered set will only order on hash and not on insertion
708  // so we still cannot control it there
709  // Best place to handle it is when the systematic object container is being filled (before it is const)
710  // We read all hashes into a vector, and then custom sort to be nominal, then alphabetical
711  std::vector<size_t> sortedSystHashAll(m_config->systHashAll()->begin(), m_config->systHashAll()->end());
712  std::sort(sortedSystHashAll.begin(), sortedSystHashAll.end(),
713  [this](const size_t& lhs, const size_t& rhs) {
714  // if lhs is nominal, true - move
715  if (this->m_config->isSystNominal(this->m_config->systematicName(lhs))) return true;
716  // if rhs is nominal, false - fix
717  else if (this->m_config->isSystNominal(this->m_config->systematicName(rhs))) return false;
718  // otherwise alphabetical - sort
719  else return(this->m_config->systematicName(lhs) < this->m_config->systematicName(rhs));
720  });
721 
722  for (auto systematicNumber : sortedSystHashAll) {
723  ATH_MSG_DEBUG(systematicNumber << " " << m_config->systematicName(systematicNumber));
725  if (m_executeNominal && !m_config->isSystNominal(m_config->systematicName(systematicNumber))) continue;
726  if (!m_executeNominal && m_config->isSystNominal(m_config->systematicName(systematicNumber))) continue;
727 
728  if ((!m_config->doTightSysts() && !isLoose) &&
729  !m_config->isSystNominal(m_config->systematicName(systematicNumber))) continue;
730  if ((!m_config->doLooseSysts() && isLoose) &&
731  !m_config->isSystNominal(m_config->systematicName(systematicNumber))) continue;
732 
733  xAOD::SystematicEvent* systEvent = new xAOD::SystematicEvent {};
734  systEventCont->push_back(systEvent);
735  systEvent->setHashValue(systematicNumber);
736  systEvent->setIsLooseEvent(isLoose);
737  if (!isLoose) {
738  systEvent->setTtreeIndex(m_config->ttreeIndex(systematicNumber));
739  }
740  if (isLoose) {
741  systEvent->setTtreeIndex(m_config->ttreeIndexLoose(systematicNumber));
742  }
743  systEvent->auxdecor<char> (m_config->passEventSelectionDecoration()) = 0;
744  top::check(applyOverlapRemoval(systEvent), "Failed to apply overlap removal");
745  }
746 
747  if (m_executeNominal) {
748  // Create a new StoreGate key
749  std::string sgKeyNominal = sgKey + "Nominal";
750 
751  // Save to StoreGate / TStore
752  std::string outputSGKeyNominalAux = sgKeyNominal + "Aux.";
753 
754  StatusCode save = evtStore()->tds()->record(systEventCont, sgKeyNominal);
755  StatusCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyNominalAux);
756  if (!save || !saveAux) {
757  return StatusCode::FAILURE;
758  }
759  return StatusCode::SUCCESS;
760  } else {
761  // Retrieve nominal container, get nominal event, copy into full systematic container
762  xAOD::SystematicEventContainer* systEventContNominal = new xAOD::SystematicEventContainer {};
763  top::check(evtStore()->retrieve(systEventContNominal, sgKey + "Nominal"), "Failed to retrieve nominal container");
764  for (auto x: *systEventContNominal) {
765  xAOD::SystematicEvent* systEventNominal = new xAOD::SystematicEvent {};
766  systEventCont->push_back(systEventNominal);
767  *systEventNominal = *x;
768  }
769 
770  // Save to StoreGate / TStore
771  std::string outputSGKeyAux = sgKey + "Aux.";
772 
773  StatusCode save = evtStore()->tds()->record(systEventCont, sgKey);
774  StatusCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyAux);
775  if (!save || !saveAux) {
776  return StatusCode::FAILURE;
777  }
778  return StatusCode::SUCCESS;
779  }
780  }
781 
783  // Which lepton definition are we using for the overlap removal?
784  // Default for top analysis is "Tight"
785  //
786  // Use "Loose" for Fakes estimates
787  //
788  // Other physics groups choose to do overlap removal on "Loose" lepton definitions
789  // As such, this mode is fully supported, simply set:
790  // OverlapRemovalLeptonDef Loose
791  // In your configuration file
792 
793  bool looseLeptonOR(false); // default behaviour for top analysis - use the "Tight" definitions
794 
795  if (currentSystematic->isLooseEvent()) {
796  looseLeptonOR = true;
797  }
798  if (m_config->doOverlapRemovalOnLooseLeptonDef()) {
799  looseLeptonOR = true;
800  }
801 
802  std::size_t hash = currentSystematic->hashValue();
803 
804 
805  // Retrieve the relevant shallow copies
806  const xAOD::PhotonContainer* xaod_photon(nullptr);
807  if (m_config->usePhotons()) top::check(evtStore()->retrieve(xaod_photon, m_config->sgKeyPhotons(
808  hash)),
809  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve photons");
810 
811 
812  const xAOD::ElectronContainer* xaod_el(nullptr);
813  if (m_config->useElectrons()) top::check(evtStore()->retrieve(xaod_el, m_config->sgKeyElectrons(
814  hash)),
815  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve electrons");
816 
817 
818  const xAOD::ElectronContainer* xaod_fwdel(nullptr);
819  if (m_config->useFwdElectrons()) top::check(evtStore()->retrieve(xaod_fwdel, m_config->sgKeyFwdElectrons(
820  hash)),
821  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve fwd electrons");
822 
823 
824  const xAOD::MuonContainer* xaod_mu(nullptr);
825  if (m_config->useMuons()) top::check(evtStore()->retrieve(xaod_mu, m_config->sgKeyMuons(
826  hash)),
827  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve muons");
828 
829 
830  const xAOD::MuonContainer* xaod_softmu(nullptr);
831  if (m_config->useSoftMuons()) top::check(evtStore()->retrieve(xaod_softmu, m_config->sgKeySoftMuons(
832  hash)),
833  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve soft muons");
834 
835 
836  const xAOD::TauJetContainer* xaod_tau(nullptr);
837  if (m_config->useTaus()) top::check(evtStore()->retrieve(xaod_tau, m_config->sgKeyTaus(
838  hash)),
839  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve taus");
840 
841 
842  const xAOD::JetContainer* xaod_jet(nullptr);
843  if (m_config->useJets()) top::check(evtStore()->retrieve(xaod_jet, m_config->sgKeyJets(hash,
844  looseLeptonOR)),
845  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve jets");
846 
847 
848  const xAOD::JetContainer* xaod_ljet(nullptr);
849  if (m_config->useLargeRJets()) top::check(evtStore()->retrieve(xaod_ljet, m_config->sgKeyLargeRJets(
850  hash)),
851  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve large-R jets");
852 
853 
854  const xAOD::JetContainer* xaod_tjet(nullptr);
855  if (m_config->useTrackJets()) top::check(evtStore()->retrieve(xaod_tjet,
856  m_config->sgKeyTrackJets()),
857  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve track jets");
858 
859  const xAOD::TrackParticleContainer* xaod_tracks(nullptr);
860  if (m_config->useTracks()) top::check(evtStore()->retrieve(xaod_tracks,
861  m_config->sgKeyTracks(hash)),
862  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve tracks");
863 
864 
865  // vectors to store the indices of objects passing selection and overlap removal
866  std::vector<unsigned int> goodPhotons, goodElectrons, goodFwdElectrons, goodMuons, goodSoftMuons, goodTaus,
867  goodJets, goodLargeRJets, goodTrackJets, goodTracks;
868 
869  // Apply overlap removal
870  m_overlapRemovalToolPostSelection->overlapremoval(xaod_photon, xaod_el, xaod_mu, xaod_tau,
871  xaod_jet, xaod_ljet,
872  goodPhotons, goodElectrons, goodMuons, goodTaus,
873  goodJets, goodLargeRJets, looseLeptonOR);
874 
875  // Additonal lepton information
876  std::vector<unsigned int> overlapsEl, overlapsMu;
877  if (m_overlapRemovalToolPostSelection->overlapsEl(overlapsEl)) {
878  currentSystematic->auxdecor< std::vector<unsigned int> >("overlapsEl") = overlapsEl;
879  }
880  if (m_overlapRemovalToolPostSelection->overlapsMu(overlapsMu)) {
881  currentSystematic->auxdecor< std::vector<unsigned int> >("overlapsMu") = overlapsMu;
882  }
883 
884  // If we did use overlap removal on "Loose" lepton definitions
885  // We take the remaining leptons and only keep those passing the "Tight" cuts
886  if (!currentSystematic->isLooseEvent() && m_config->doOverlapRemovalOnLooseLeptonDef()) {
887  applyTightSelectionPostOverlapRemoval(xaod_photon, goodPhotons);
888  applyTightSelectionPostOverlapRemoval(xaod_el, goodElectrons);
889  applyTightSelectionPostOverlapRemoval(xaod_mu, goodMuons);
890  applyTightSelectionPostOverlapRemoval(xaod_tau, goodTaus);
891  applyTightSelectionPostOverlapRemoval(xaod_jet, goodJets);
892  applyTightSelectionPostOverlapRemoval(xaod_ljet, goodLargeRJets);
893  }
894 
895  if (m_config->useTrackJets()) {
896  for (unsigned int i = 0; i < xaod_tjet->size(); ++i) goodTrackJets.push_back(i);
897  trackJetOverlapRemoval(xaod_el, xaod_mu, xaod_tjet, goodElectrons, goodMuons, goodTrackJets);
898  applyTightSelectionPostOverlapRemoval(xaod_tjet, goodTrackJets);
899  }
900 
901  // for the time being no OR applied on FwdElectrons
902  if (xaod_fwdel) {
903  int i(0);
904  std::string passTopCuts("");
905  if (!looseLeptonOR) {
906  passTopCuts = "passPreORSelection";
907  }
908  if (looseLeptonOR) {
909  passTopCuts = "passPreORSelectionLoose";
910  }
911  for (const xAOD::Electron* x: *xaod_fwdel) {
912  if (x->auxdataConst< char >(passTopCuts) == 1) goodFwdElectrons.push_back(i);
913 
914  i++;
915  }
916  }
917 
918  // no OR applied on tracks
919  if (xaod_tracks) {
920  int i(0);
921  std::string passTopCuts = "passPreORSelection";
922 
923  for (const xAOD::TrackParticle* x: *xaod_tracks) {
924 
925  if (x->auxdataConst< char >(m_passPreORSelection) == 1) goodTracks.push_back(i);
926 
927  i++;
928  }
929  }
930 
931 
932  // for the time being the only OR performed on soft muons is wrt prompt muons
933  if (xaod_softmu) {
934 
935  if(m_config->useJets())
936  {
937  top::check(m_overlapRemovalTool_softMuons_Alljets->removeOverlaps(nullptr, xaod_softmu, xaod_jet, nullptr, nullptr), "Failed to identify overlap for soft muons - all jets");
938  }
939 
940  int i(0);
941  std::string passTopCuts = "passPreORSelection";
942 
943  for (const xAOD::Muon* x: *xaod_softmu) {
944  //OR with prompt muons
945  bool promptMuOR = false;
946  if (xaod_mu) {
947  for (unsigned int iMu : goodMuons) {
948  // Get muon iMu
949  const xAOD::Muon* muPtr = xaod_mu->at(iMu);
950  if (muPtr->p4().DeltaR(x->p4()) < 0.01) {
951  promptMuOR = true;
952  break;
953  }
954  }
955  }
956 
957  float dRmin = 100; //nearest jet dR
958  if(m_config->useJets()) dRmin=this->calculateMinDRMuonJet(*x, xaod_jet, goodJets, m_config->softmuonDRJetcutUseRapidity());
959 
960  if (x->auxdataConst< char >(passTopCuts) == 1 && !promptMuOR && (!m_config->useJets() || dRmin < m_config->softmuonDRJetcut()))
961  {
962  goodSoftMuons.push_back(i);//the dR selection must be done here, because we need the post-OR jets...
963  }
964  i++;
965  }
966  }//end of OR procedure for soft muons
967 
968  if(m_config->isMC() && m_config->useSoftMuons() && m_config->softmuonAdditionalTruthInfo()) decorateSoftMuonsPostOverlapRemoval(xaod_softmu,goodSoftMuons);
969 
970 
971  //Change the collection of ghost tracks associated to jets
972  //Store the selected ghost associated tracks
973  //It doesn't work for the nominal systematic
974  if (m_config->useJetGhostTrack() && m_config->useJets()) {
975 
976  std::vector<const xAOD::TrackParticle*> jetTracks;
977 
978  xAOD::JetContainer* xaod_jet_ga(nullptr);
979  top::check(evtStore()->retrieve(xaod_jet_ga, m_config->sgKeyJets(hash,looseLeptonOR)),
980  "TopObjectSelection::applyOverlapRemovalPostSelection() failed to retrieve jets for ghost matching");
981 
982  unsigned int index= -1;
983 
984  for (const auto jetPtr : *xaod_jet_ga){
985 
986  index=index+1;
987 
988  if(!m_jetGhostTrackSelection->JetConsideredForGhostTrackSelection(jetPtr->pt(),jetPtr->eta()))
989  continue;
990 
991  if (std::find(goodJets.begin(), goodJets.end(), index) == goodJets.end()){
992  continue;
993  }
994 
995  jetTracks.clear();
996 
997  std::vector<const xAOD::TrackParticle*> goodJetGhostTracks;
998  jetTracks = jetPtr->getAssociatedObjects<xAOD::TrackParticle>(m_config->decoKeyJetGhostTrack(hash));
999 
1000  if (jetTracks.size() != 0) {
1001 
1002  std::string passTopCuts = "passPreORSelection";
1003 
1004  for (auto& track: jetTracks) {
1005 
1006  if (track->auxdataConst< char >(passTopCuts) == 1) {
1007  goodJetGhostTracks.push_back(track);
1008  }
1009 
1010  }
1011 
1012  jetPtr->setAssociatedObjects<xAOD::TrackParticle>(m_config->decoKeyJetGhostTrack(hash), goodJetGhostTracks);
1013 
1014  }
1015  }
1016 
1017  }
1018 
1019  // set the indices in the xAOD::SystematicEvent
1020  currentSystematic->setGoodPhotons(goodPhotons);
1021  currentSystematic->setGoodElectrons(goodElectrons);
1022  currentSystematic->setGoodFwdElectrons(goodFwdElectrons);
1023  currentSystematic->setGoodMuons(goodMuons);
1024  currentSystematic->setGoodSoftMuons(goodSoftMuons);
1025  currentSystematic->setGoodTaus(goodTaus);
1026  currentSystematic->setGoodJets(goodJets);
1027  currentSystematic->setGoodLargeRJets(goodLargeRJets);
1028  currentSystematic->setGoodTrackJets(goodTrackJets);
1029  currentSystematic->setGoodTracks(goodTracks);
1030 
1031  decorateEventInfoPostOverlapRemoval(goodJets.size(), currentSystematic->isLooseEvent());
1032 
1033 
1034 
1035  return StatusCode::SUCCESS;
1036  }
1037 
1038  void TopObjectSelection::decorateSoftMuonsPostOverlapRemoval(const xAOD::MuonContainer* xaod_softmu,std::vector<unsigned int>& goodSoftMuons)
1039  {
1040 
1041  for (auto iMu : goodSoftMuons) {
1042  // Get muon iMu
1043  const xAOD::Muon* muon = xaod_softmu->at(iMu);
1044 
1045  top::truth::initRecoMuonHistoryInfo(muon,m_config->softmuonAdditionalTruthInfoCheckPartonOrigin()); //it's safer if we initialize everything to default for each muon before filling the muon history
1046  top::truth::getRecoMuonHistory(muon,m_config->softmuonAdditionalTruthInfoCheckPartonOrigin(),m_config->getShoweringAlgorithm(),m_config->softmuonAdditionalTruthInfoDoVerbose());
1047  }//end of loop on soft muons
1048  }
1050  std::vector<unsigned int>& indices) {
1051  // Copy the original indices of the xAOD objects in
1052  // the collection that pass the overlap removal
1053  std::vector<unsigned int> tmpCopy;
1054  for (auto i : indices) {
1055  tmpCopy.push_back(i);
1056  }
1057 
1058  // Clear the original indices
1059  indices.clear();
1060 
1061  // Only save indices that are in tmpCopy && passPreORSelection
1062  // This will keep the objects that pass the "Loose" overlap selection
1063  // and pass the "Tight" cuts
1064  for (auto i : tmpCopy) {
1065  if (xaod->at(i)->isAvailable< char> (m_passPreORSelection)) {
1066  if (xaod->at(i)->auxdataConst< char >(m_passPreORSelection) == 1) {
1067  indices.push_back(i);
1068  }
1069  }
1070  }
1071  }
1072 
1074  const xAOD::IParticleContainer* xaod_mu,
1075  const xAOD::IParticleContainer* xaod_tjet,
1076  std::vector<unsigned int>& goodElectrons,
1077  std::vector<unsigned int>& goodMuons,
1078  std::vector<unsigned int>& goodTrackJets) {
1079  // Copy the original indices of the xAOD objects in
1080  // the collection that pass the overlap removal
1081  std::vector<unsigned int> tmpGoodTrackJets;
1082  for (auto i : goodTrackJets) {
1083  tmpGoodTrackJets.push_back(i);
1084  }
1085 
1086  // Clear the original indices
1087  goodTrackJets.clear();
1088 
1089  int counterTrk = 0;
1090  for (auto jet : *xaod_tjet) {
1091  bool matchEl(false);
1092  int counterEl = 0;
1093  for (auto el : *xaod_el) {
1094  if ((std::find(goodElectrons.begin(), goodElectrons.end(), counterEl) != goodElectrons.end())) {
1095  if (el->p4().DeltaR(jet->p4()) < 0.2) {
1096  matchEl = true;
1097  break;
1098  }
1099  }
1100  counterEl++;
1101  }
1102 
1103  bool matchMu(false);
1104  int counterMu = 0;
1105  for (auto mu : *xaod_mu) {
1106  if ((std::find(goodMuons.begin(), goodMuons.end(), counterMu) != goodMuons.end())) {
1107  if (mu->p4().DeltaR(jet->p4()) < 0.2) {
1108  matchMu = true;
1109  break;
1110  }
1111  }
1112  counterMu++;
1113  }
1114 
1115  if (!(matchEl || matchMu)) goodTrackJets.push_back(counterTrk);
1116  counterTrk++;
1117  }
1118  }
1119 
1120  float TopObjectSelection::calculateMinDRMuonJet(const xAOD::Muon& mu, const xAOD::JetContainer* xaod_jet, std::vector<unsigned int>& goodJets, bool useRapidity) {
1121 
1122  float dRMin = 100.0;
1123 
1124  // Loop over jets, calculate dR and record smallest value
1125  for (auto iJet : goodJets) {
1126  const xAOD::Jet* jetPtr = xaod_jet->at(iJet);
1127  if(jetPtr->isAvailable<char>("passJVT") && !(jetPtr->auxdataConst<char>("passJVT") )) continue; //at this level we still have jets not passing the JVT cut in the ntuple
1128  float dR = xAOD::P4Helpers::deltaR(mu,*jetPtr,useRapidity);
1129  if (dR < dRMin)
1130  {
1131  dRMin = dR;
1132  }
1133  }
1134 
1135  return dRMin;
1136  }
1137 
1140  // Only continue if this is nominal processing
1141  if (!m_executeNominal) return;
1142 
1143  bool UseLooseNJets = false;
1144  // If we only run on loose nominal, we need to use loose event, otherwise use tight
1145  if (m_config->doLooseEvents() && !m_config->doTightEvents()) UseLooseNJets = true;
1146  // If we use loose, but this is tight, skip
1147  if (UseLooseNJets && !isLoose) return;
1148 
1149  // Get the EventInfo object
1150  const xAOD::EventInfo* eventInfo(nullptr);
1151  top::check(evtStore()->retrieve(eventInfo, m_config->sgKeyEventInfo()), "Failed to retrieve EventInfo");
1152  // Decorate with number of good jets
1153  eventInfo->auxdecor< int >("Njet") = nGoodJets;
1154 
1155  return;
1156  }
1157 
1160  }
1161 
1162  void TopObjectSelection::print(MsgStream& os) const {
1163  os << "TopObjectSelection configuration\n";
1164 
1165  os << "\n";
1166  os << "Electrons\n";
1167  os << " ContainerName: " << m_config->sgKeyElectrons() << "\n";
1168  if (m_config->useElectrons()) {
1169  os << " Selection: ";
1170  if (!m_electronSelection) os << "All";
1171  else os << *m_electronSelection;
1172  }
1173 
1174  os << "\n";
1175  os << "FwdElectrons\n";
1176  os << " ContainerName: " << m_config->sgKeyFwdElectrons() << "\n";
1177  if (m_config->useFwdElectrons()) {
1178  os << " Selection: ";
1179  if (!m_fwdElectronSelection) os << "All";
1180  else os << *m_fwdElectronSelection;
1181  }
1182 
1183  os << "\n";
1184  os << "Photons\n";
1185  os << " ContainerName: " << m_config->sgKeyPhotons() << "\n";
1186  if (m_config->usePhotons()) {
1187  os << " Selection: ";
1188  if (!m_photonSelection) os << "All";
1189  else os << *m_photonSelection;
1190  }
1191 
1192  os << "\n";
1193  os << "Muons\n";
1194  os << " ContainerName: " << m_config->sgKeyMuons() << "\n";
1195  if (m_config->useMuons()) {
1196  os << " Selection: ";
1197  if (!m_muonSelection) os << "All";
1198  else os << *m_muonSelection;
1199  }
1200 
1201  os << "\n";
1202  os << "SoftMuons\n";
1203  os << " ContainerName: " << m_config->sgKeySoftMuons() << "\n";
1204  if (m_config->useSoftMuons()) {
1205  os << " Selection: ";
1206  if (!m_softmuonSelection) os << "All";
1207  else os << *m_softmuonSelection;
1208  }
1209 //
1210 // os << "\n";
1211 // os << "Taus\n";
1212 // os << " ContainerName: " << containerNames().tauCollectionName << "\n";
1213 // if (containerNames().tauCollectionName != "None") {
1214 // os << " Selection: ";
1215 // if (!m_tauSelection)
1216 // os << "All";
1217 // else
1218 // os << *m_tauSelection;
1219 // }
1220 
1221  os << "\n";
1222  os << "Jets\n";
1223  os << " ContainerName: " << m_config->sgKeyJets() << "\n";
1224  if (m_config->useJets()) {
1225  os << " Selection: ";
1226  if (!m_jetSelection) os << "All";
1227  else os << *m_jetSelection;
1228  }
1229 
1230  os << "\n";
1231  os << "LargeJets\n";
1232  os << " ContainerName: " << m_config->sgKeyLargeRJets() << "\n";
1233  if (m_config->useLargeRJets()) {
1234  os << " Selection: ";
1235  if (!m_largeJetSelection) os << "All";
1236  else os << *m_largeJetSelection;
1237  }
1238 
1239  os << "\n";
1240  os << "TrackJets\n";
1241  os << " ContainerName: " << m_config->sgKeyTrackJets() << "\n";
1242  if (m_config->useTrackJets()) {
1243  os << " Selection: ";
1244  if (!m_trackJetSelection) os << "All";
1245  else os << *m_trackJetSelection;
1246  }
1247 
1248  os << "\n";
1249  os << "GhostTracks\n";
1250  os << " ContainerName: " << m_config->decoKeyJetGhostTrack() << "\n";
1251  if (m_config->useJetGhostTrack()) {
1252  os << " Selection: ";
1253  if (!m_jetGhostTrackSelection) os << "All";
1254 // else m_jetGhostTrackSelection->print(os);
1255  else os << *m_jetGhostTrackSelection;
1256  }
1257 
1258 
1259  os << "\n";
1260  os << "MET\n";
1261  os << " ContainerName: " << m_config->sgKeyMissingEt() << "\n";
1262 
1263  os << "\n\n";
1264  os << "OverlapRemoval after object selection: ";
1265  if (!m_overlapRemovalToolPostSelection) os << "None";
1267 
1268  os << "\n\n";
1269  os.doOutput();
1270  }
1271 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
top::TopObjectSelection::applySelectionPreOverlapRemovalElectrons
void applySelectionPreOverlapRemovalElectrons()
For each systematic load each of the electrons and test if they pass the object selection.
Definition: TopObjectSelection.cxx:254
xAOD::SystematicEvent::setGoodPhotons
void setGoodPhotons(const std::vector< unsigned int > &)
set Photons
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
top::FwdElectronSelectionBase
Base class for implementing an electron selection.
Definition: FwdElectronSelectionBase.h:22
top::TopObjectSelection::applySelectionPreOverlapRemovalTaus
void applySelectionPreOverlapRemovalTaus()
Definition: TopObjectSelection.cxx:358
top::TopObjectSelection::photonSelection
void photonSelection(PhotonSelectionBase *ptr)
Set the code used to select photons.
Definition: TopObjectSelection.cxx:140
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
ORUtils::IOverlapRemovalTool::removeOverlaps
virtual StatusCode removeOverlaps(const xAOD::ElectronContainer *electrons, const xAOD::MuonContainer *muons, const xAOD::JetContainer *jets, const xAOD::TauJetContainer *taus=0, const xAOD::PhotonContainer *photons=0, const xAOD::JetContainer *fatJets=0) const =0
Declare the interface.
max
#define max(a, b)
Definition: cfImp.cxx:41
top::TopObjectSelection::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: TopObjectSelection.cxx:58
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SampleXsection.h
asg::AnaToolHandle::retrieve
StatusCode retrieve()
initialize the tool
top::TopObjectSelection::m_photonSelection
std::unique_ptr< top::PhotonSelectionBase > m_photonSelection
Photon selection code - can load user defined classes.
Definition: TopObjectSelection.h:296
top::TopObjectSelection::jetGhostTrackSelection
void jetGhostTrackSelection(JetGhostTrackSelectionBase *ptr)
Set the code used to select tracks ghost associated to small-R jets.
Definition: TopObjectSelection.cxx:152
xAOD::Muon_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Muon_v1.cxx:79
top::TopObjectSelection::m_jetSelection
std::unique_ptr< top::JetSelectionBase > m_jetSelection
Jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:293
index
Definition: index.py:1
xAODP4Helpers.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
IsoCloseByCorrectionTest.WP
WP
Definition: IsoCloseByCorrectionTest.py:56
xAOD::SystematicEvent::setGoodJets
void setGoodJets(const std::vector< unsigned int > &)
set Jets
top::OverlapRemovalBase
Definition: OverlapRemovalBase.h:15
TruthParticleContainer.h
TopObjectSelection.h
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
top::TopObjectSelection::execute
StatusCode execute(bool)
Code that runs for every event (note that it runs the selection on all the systematic variations too)...
Definition: TopObjectSelection.cxx:165
top::TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks
void applySelectionPreOverlapRemovalJetGhostTracks()
Definition: TopObjectSelection.cxx:582
top::TopObjectSelection::overlapRemovalPostSelection
void overlapRemovalPostSelection(OverlapRemovalBase *ptr)
Set the code used to perform the overlap removal.
Definition: TopObjectSelection.cxx:161
top::TopObjectSelection::electronSelection
void electronSelection(ElectronSelectionBase *ptr)
Set the code used to select electrons.
Definition: TopObjectSelection.cxx:116
xAOD::SystematicEvent::setGoodMuons
void setGoodMuons(const std::vector< unsigned int > &)
set Muons
xAOD::SystematicEvent::setGoodTaus
void setGoodTaus(const std::vector< unsigned int > &)
set Taus
asg
Definition: DataHandleTestTool.h:28
test_pyathena.pt
pt
Definition: test_pyathena.py:11
top::TopObjectSelection::m_jetGhostTrackSelection
std::unique_ptr< top::JetGhostTrackSelectionBase > m_jetGhostTrackSelection
Ghost Track associated to small-R jets selection code - can load user defined classes
Definition: TopObjectSelection.h:306
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
top::TopObjectSelection::m_passPreORSelectionLoose
const std::string m_passPreORSelectionLoose
Definition: TopObjectSelection.h:319
xAOD::SystematicEvent::setTtreeIndex
void setTtreeIndex(unsigned int)
set ttreeIndex
DataVector::cend
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
top::TopObjectSelection::m_ORToolDecoration
const std::string m_ORToolDecoration
Definition: TopObjectSelection.h:321
top::TopObjectSelection::m_trackSelection
std::unique_ptr< top::TrackSelectionBase > m_trackSelection
Track selection code - can load user defined classes
Definition: TopObjectSelection.h:309
x
#define x
top::TopObjectSelection::m_passPreORSelection
const std::string m_passPreORSelection
Definition: TopObjectSelection.h:318
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
SG::AuxElement::auxdecor
Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
top::TopObjectSelection::m_ORToolDecorationLoose
const std::string m_ORToolDecorationLoose
Definition: TopObjectSelection.h:322
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
xAOD::SystematicEventAuxContainer
Auxiliary container for xAOD::SystematicEventContainer.
Definition: SystematicEventAuxContainer.h:18
top::TopObjectSelection::tauSelection
void tauSelection(TauSelectionBase *ptr)
Set the code used to select taus.
Definition: TopObjectSelection.cxx:132
top::TopObjectSelection::trackJetOverlapRemoval
void trackJetOverlapRemoval(const xAOD::IParticleContainer *xaod_el, const xAOD::IParticleContainer *xaod_mu, const xAOD::IParticleContainer *xaod_tjet, std::vector< unsigned int > &goodElectrons, std::vector< unsigned int > &goodMuons, std::vector< unsigned int > &goodTrackJets)
Definition: TopObjectSelection.cxx:1073
top::TopObjectSelection::m_overlapRemovalTool_softMuons_Alljets
asg::AnaToolHandle< ORUtils::IOverlapRemovalTool > m_overlapRemovalTool_softMuons_Alljets
Definition: TopObjectSelection.h:335
SG::AuxElement::auxdataConst
Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
top::TopObjectSelection::m_executeNominal
bool m_executeNominal
Definition: TopObjectSelection.h:332
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
top::TopObjectSelection::applySelectionPreOverlapRemovalFwdElectrons
void applySelectionPreOverlapRemovalFwdElectrons()
For each systematic load each of the fwd electrons and test if they pass the object selection.
Definition: TopObjectSelection.cxx:283
top::JetSelectionBase
Definition: JetSelectionBase.h:11
top::TopObjectSelection::m_softmuonSelection
std::unique_ptr< top::SoftMuonSelectionBase > m_softmuonSelection
Soft Muon selection code - can load user defined classes.
Definition: TopObjectSelection.h:287
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
top::TopObjectSelection::m_overlapRemovalToolPostSelection
std::unique_ptr< top::OverlapRemovalBase > m_overlapRemovalToolPostSelection
Overlap removal that runs after all object selection.
Definition: TopObjectSelection.h:312
ElectronContainer.h
xAOD::SystematicEvent::setGoodElectrons
void setGoodElectrons(const std::vector< unsigned int > &)
set Electrons
lumiFormat.i
int i
Definition: lumiFormat.py:92
top::TopObjectSelection::m_electronInJetSubtractor
std::unique_ptr< top::ElectronInJetSubtractionCollectionMaker > m_electronInJetSubtractor
Definition: TopObjectSelection.h:315
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
top::TopObjectSelection::jetSelection
void jetSelection(JetSelectionBase *ptr)
Set the code used to select jets.
Definition: TopObjectSelection.cxx:136
top::TopObjectSelection::applySelectionPreOverlapRemovalSoftMuons
void applySelectionPreOverlapRemovalSoftMuons()
Definition: TopObjectSelection.cxx:341
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
top::TopObjectSelection::TopObjectSelection
TopObjectSelection(const std::string &name)
Setup the object selection at the start of the run.
Definition: TopObjectSelection.cxx:31
SystematicEventAuxContainer.h
top::TopObjectSelection::m_fwdElectronSelection
std::unique_ptr< top::FwdElectronSelectionBase > m_fwdElectronSelection
Fwd Electron selection code - can load user defined classes.
Definition: TopObjectSelection.h:281
top::MuonSelectionBase
Definition: MuonSelectionBase.h:11
top::nominal
@ nominal
Definition: ScaleFactorRetriever.h:29
top::truth::initRecoMuonHistoryInfo
void initRecoMuonHistoryInfo(const xAOD::Muon *muon, bool doPartonHistory)
Definition: TruthTools.cxx:56
top::TopObjectSelection::applyTightSelectionPostOverlapRemoval
void applyTightSelectionPostOverlapRemoval(const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &indices)
Definition: TopObjectSelection.cxx:1049
top::TopObjectSelection::m_trackJetSelection
std::unique_ptr< top::JetSelectionBase > m_trackJetSelection
Track jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:303
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
top::TopObjectSelection::applyOverlapRemoval
virtual StatusCode applyOverlapRemoval()
Definition: TopObjectSelection.cxx:685
top::SoftMuonSelectionBase
Definition: SoftMuonSelectionBase.h:11
top::PhotonSelectionBase
Base class for implementing an Photon selection.
Definition: PhotonSelectionBase.h:20
xAOD::SystematicEvent::setGoodTracks
void setGoodTracks(const std::vector< unsigned int > &)
set Tracks
xAOD::SystematicEvent::hashValue
std::size_t hashValue() const
get hash value
top::truth::getRecoMuonHistory
void getRecoMuonHistory(const xAOD::Muon *muon, bool doPartonHistory, SampleXsection::showering shAlgo, bool verbose)
Definition: TruthTools.cxx:128
top::TopObjectSelection::applySelectionPreOverlapRemovalTracks
void applySelectionPreOverlapRemovalTracks()
Definition: TopObjectSelection.cxx:648
TauJetContainer.h
top::TopObjectSelection::m_electronSelection
std::unique_ptr< top::ElectronSelectionBase > m_electronSelection
Electron selection code - can load user defined classes.
Definition: TopObjectSelection.h:278
top::TopObjectSelection::trackSelection
void trackSelection(TrackSelectionBase *ptr)
Set the code used to select tracks.
Definition: TopObjectSelection.cxx:156
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
top::TopObjectSelection::print
virtual void print() const
or prehaps you'd like the AsgTool print function
Definition: TopObjectSelection.cxx:1158
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
xAOD::SystematicEvent::isLooseEvent
char isLooseEvent() const
get isLooseEvent
top::TopObjectSelection::applySelectionPreOverlapRemoval
void applySelectionPreOverlapRemoval()
Definition: TopObjectSelection.cxx:174
top::JetGhostTrackSelectionBase
Definition: JetGhostTrackSelectionBase.h:11
min
#define min(a, b)
Definition: cfImp.cxx:40
top::TopObjectSelection::calculateMinDRMuonJet
float calculateMinDRMuonJet(const xAOD::Muon &mu, const xAOD::JetContainer *xaod_jet, std::vector< unsigned int > &goodJets, bool useRapidity=false)
Definition: TopObjectSelection.cxx:1120
top::TopObjectSelection::applySelectionPreOverlapRemovalJets
void applySelectionPreOverlapRemovalJets()
Definition: TopObjectSelection.cxx:379
top::ElectronInJetSubtractionCollectionMaker
Definition: ElectronInJetSubtractionCollectionMaker.h:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TruthTools.h
top::TopObjectSelection::trackJetSelection
void trackJetSelection(JetSelectionBase *ptr)
Set the code used to select track jets.
Definition: TopObjectSelection.cxx:148
xAOD::SystematicEvent::setHashValue
void setHashValue(std::size_t)
set hash value
top::TopObjectSelection::m_doLooseCuts
bool m_doLooseCuts
Definition: TopObjectSelection.h:325
top::TopObjectSelection::m_trkjet_btagSelTools
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_trkjet_btagSelTools
Definition: TopObjectSelection.h:329
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
top::TrackSelectionBase
Definition: TrackSelectionBase.h:11
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
top::TopObjectSelection::m_tauSelection
std::unique_ptr< top::TauSelectionBase > m_tauSelection
Tau selection code - can load user defined classes.
Definition: TopObjectSelection.h:290
xAOD::SystematicEvent::setGoodTrackJets
void setGoodTrackJets(const std::vector< unsigned int > &)
set TrackJets
TopConfig.h
xAOD::Electron_v1
Definition: Electron_v1.h:34
top::TopObjectSelection::decorateSoftMuonsPostOverlapRemoval
void decorateSoftMuonsPostOverlapRemoval(const xAOD::MuonContainer *xaod_softmu, std::vector< unsigned int > &goodMuons)
Definition: TopObjectSelection.cxx:1038
xAOD::IParticle::isAvailable
bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:131
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
MuonContainer.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
top::TopObjectSelection::softmuonSelection
void softmuonSelection(SoftMuonSelectionBase *ptr)
Set the code used to select soft muons.
Definition: TopObjectSelection.cxx:128
xAOD::SystematicEvent
SystematicEvent A simple xAOD class which we can persist into a mini-xAOD The xAOD EDM is way too com...
Definition: SystematicEvent.h:27
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
xAOD::SystematicEvent::setIsLooseEvent
void setIsLooseEvent(char)
set isLooseEvent
top::TopObjectSelection::decorateEventInfoPostOverlapRemoval
void decorateEventInfoPostOverlapRemoval(int, bool)
Definition: TopObjectSelection.cxx:1138
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
top::TopObjectSelection::m_btagSelTools
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelTools
Definition: TopObjectSelection.h:328
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
DataVector::cbegin
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
top::TopObjectSelection::applySelectionPreOverlapRemovalPhotons
void applySelectionPreOverlapRemovalPhotons()
Definition: TopObjectSelection.cxx:226
top::TopObjectSelection::m_muonSelection
std::unique_ptr< top::MuonSelectionBase > m_muonSelection
Muon selection code - can load user defined classes.
Definition: TopObjectSelection.h:284
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
top::TopObjectSelection::m_config
std::shared_ptr< top::TopConfig > m_config
Pointer to the configuration object so we can check which objects were requested in the config file.
Definition: TopObjectSelection.h:275
top::TopObjectSelection::applySelectionPreOverlapRemovalLargeRJets
void applySelectionPreOverlapRemovalLargeRJets()
Definition: TopObjectSelection.cxx:505
top::ElectronSelectionBase
Base class for implementing an electron selection.
Definition: ElectronSelectionBase.h:22
top::TopObjectSelection::m_largeJetSelection
std::unique_ptr< top::JetSelectionBase > m_largeJetSelection
Large-R jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:300
TruthParticle.h
xAOD::SystematicEvent::setGoodLargeRJets
void setGoodLargeRJets(const std::vector< unsigned int > &)
set LargeRJets
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
top::TopObjectSelection::applySelectionPreOverlapRemovalMuons
void applySelectionPreOverlapRemovalMuons()
Definition: TopObjectSelection.cxx:320
top::TopObjectSelection::fwdElectronSelection
void fwdElectronSelection(FwdElectronSelectionBase *ptr)
Set the code used to select forward electrons.
Definition: TopObjectSelection.cxx:120
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
xAOD::SystematicEvent::setGoodSoftMuons
void setGoodSoftMuons(const std::vector< unsigned int > &)
set Soft Muons
SystematicEventContainer.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
asg::AsgTool::print
virtual void print() const
Print the state of the tool.
Definition: AsgTool.cxx:131
PhotonContainer.h
top::TopObjectSelection::applySelectionPreOverlapRemovalTrackJets
void applySelectionPreOverlapRemovalTrackJets()
Definition: TopObjectSelection.cxx:528
top::TopObjectSelection::muonSelection
void muonSelection(MuonSelectionBase *ptr)
Set the code used to select muons.
Definition: TopObjectSelection.cxx:124
MissingETContainer.h
TrackParticleContainer.h
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
top::TauSelectionBase
Definition: TauSelectionBase.h:11
top::TopObjectSelection::largeJetSelection
void largeJetSelection(JetSelectionBase *ptr)
Set the code used to select large jets.
Definition: TopObjectSelection.cxx:144
xAOD::SystematicEvent::setGoodFwdElectrons
void setGoodFwdElectrons(const std::vector< unsigned int > &)
set FWD Electrons