ATLAS Offline Software
ParticleLevelLoader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // Filename: ParticleLevelLoader.cxx
6 // Description:
7 // Author: Fabian Wilk
8 // Created: Sun Feb 22 13:24:02 2015
9 
12 
13 #include <list>
14 #include <cassert>
15 #include <iomanip>
16 
17 #include "TopEvent/EventTools.h"
18 
20 
26 
29 
30 #include <boost/algorithm/string.hpp>
32 
33 // #define TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL 1
34 
35 namespace top {
36  ParticleLevelLoader::ParticleLevelLoader(const std::shared_ptr<top::TopConfig>& cfg)
37  : asg::AsgTool("ParticleLevelLoader"),
38  m_config(cfg),
39  // Don't create them here because construction is a bit long-ish
40  m_objectSelector_Electron(nullptr),
41  m_objectSelector_Muon(nullptr),
42  m_objectSelector_Photon(nullptr),
43  m_objectSelector_Jet(nullptr),
44  m_objectSelector_LargeRJet(nullptr),
45  m_objectSelector_Tau(nullptr),
46  // Tool is inactive on non-MC data and whenever particle level is not requested
47  m_active(m_config->doTopParticleLevel() &&
48  m_config->isMC() &&
49  (m_config->useTruthElectrons() ||
50  m_config->useTruthMuons() ||
51  m_config->useTruthPhotons() ||
52  m_config->useTruthJets() ||
53  m_config->useTruthLargeRJets() ||
54  m_config->useTruthTaus() ||
55  m_config->useTruthMET())) {
56  // Configure and create electron object selector
58  m_config->truth_electron_PtCut(),
59  m_config->truth_electron_EtaCut(),
60  m_config->truth_electron_NotFromHadron(),
61  m_config->truth_electron_TauIsHadron()
62  };
63 
65 
66  // Configure and create muon object selector
68  m_config->truth_muon_PtCut(),
69  m_config->truth_muon_EtaCut(),
70  m_config->truth_muon_NotFromHadron(),
71  m_config->truth_muon_TauIsHadron()
72  };
73 
75 
76  // Configure and create photon object selector
78  m_config->truth_photon_PtCut(),
79  m_config->truth_photon_EtaCut(),
80  m_config->truth_photon_Origin(),
81  m_config->truth_photon_Isolation()
82  };
83 
85 
86 
87  // Configure and create jet object selector
89  m_config->truth_jet_PtCut(),
90  m_config->truth_jet_EtaCut()
91  };
92 
94 
95  // Configure and create jet object selector
96  auto optLargeRJet = ParticleLevelJetObjectSelector::Options {
97  m_config->truth_jet_largeR_PtCut(),
98  m_config->truth_jet_largeR_EtaCut()
99  };
100 
102 
103  // Configure and create muon object selector
105  m_config->truth_tau_PtCut(),
106  m_config->truth_tau_EtaCut()
107  };
108 
110 
111 
112  MsgStream &msgInfo = msg(MSG::Level::INFO);
113  if (m_active) {
114  msgInfo << "Particle level reconstruction is enabled; telling you how I am configured:" << '\n';
115  msgInfo << " " << std::setw(20) << "UseElectrons? " << std::setw(5) << std::boolalpha <<
116  m_config->useTruthElectrons();
117  if (m_config->useTruthElectrons()) {
118  msgInfo << " [" << m_config->sgKeyTruthElectrons() << "]" << '\n'
119  << " --- Pt > " << m_config->truth_electron_PtCut() << '\n'
120  << " --- |eta| < " << m_config->truth_electron_EtaCut() << '\n'
121  << " --- notFromHadron? " << std::boolalpha << m_config->truth_electron_NotFromHadron() << '\n'
122  << " --- tauIsHadron? " << std::boolalpha << m_config->truth_electron_TauIsHadron() << '\n';
123  } else {
124  msgInfo << '\n';
125  }
126  msgInfo << " " << std::setw(20) << "UseMuons? " << std::setw(5) << std::boolalpha <<
127  m_config->useTruthMuons();
128  if (m_config->useTruthMuons()) {
129  msgInfo << " [" << m_config->sgKeyTruthMuons() << "]" << '\n'
130  << " --- Pt > " << m_config->truth_muon_PtCut() << '\n'
131  << " --- |eta| < " << m_config->truth_muon_EtaCut() << '\n'
132  << " --- notFromHadron? " << std::boolalpha << m_config->truth_muon_NotFromHadron() << '\n'
133  << " --- tauIsHadron? " << std::boolalpha << m_config->truth_muon_TauIsHadron() << '\n';
134  } else {
135  msgInfo << '\n';
136  }
137  msgInfo << " " << std::setw(20) << "UsePhotons? " << std::setw(5) << std::boolalpha <<
138  m_config->useTruthPhotons();
139  if (m_config->useTruthPhotons()) {
140  msgInfo << " [" << m_config->sgKeyTruthPhotons() << "]" << '\n'
141  << " --- Pt > " << m_config->truth_photon_PtCut() << '\n'
142  << " --- |eta| < " << m_config->truth_photon_EtaCut() << '\n'
143  << " --- Origin = " << m_config->truth_photon_Origin() << '\n'
144  << " --- Isolation = " << m_config->truth_photon_Isolation() << '\n';
145  } else {
146  msgInfo << '\n';
147  }
148  msgInfo << " " << std::setw(20) << "UseJets? " << std::setw(5) << std::boolalpha << m_config->useTruthJets();
149  if (m_config->useTruthJets()) {
150  msgInfo << " [" << m_config->sgKeyTruthJets() << "]" << '\n'
151  << " --- Pt > " << m_config->truth_jet_PtCut() << '\n'
152  << " --- |eta| < " << m_config->truth_jet_EtaCut() << '\n';
153  } else {
154  msgInfo << '\n';
155  }
156  msgInfo << " " << std::setw(20) << "UseLargeRJets? " << std::setw(5) << std::boolalpha <<
157  m_config->useTruthLargeRJets();
158  if (m_config->useTruthJets()) {
159  msgInfo << " [" << m_config->sgKeyTruthLargeRJets() << "]" << '\n'
160  << " --- Pt > " << m_config->truth_jet_largeR_PtCut() << '\n'
161  << " --- |eta| < " << m_config->truth_jet_largeR_EtaCut() << '\n';
162  } else {
163  msgInfo << '\n';
164  }
165  msgInfo << " " << std::setw(20) << "UseTaus? " << std::setw(5) << std::boolalpha << m_config->useTruthTaus();
166  if (m_config->useTruthTaus()) {
167  msgInfo << " [" << m_config->sgKeyTruthTaus() << "]" << '\n'
168  << " --- Pt > " << m_config->truth_tau_PtCut() << '\n'
169  << " --- |eta| < " << m_config->truth_tau_EtaCut() << '\n';
170  } else {
171  msgInfo << '\n';
172  }
173  msgInfo << " " << std::setw(20) << "UseMET? " << std::setw(5) << std::boolalpha << m_config->useTruthMET();
174  if (m_config->useTruthMET()) {
175  msgInfo << " [" << m_config->sgKeyTruthMET() << "]" << '\n';
176  } else {
177  msgInfo << '\n';
178  }
179  msgInfo << " " << std::setw(20) << "DoOverlapRemoval Mu-Jet? " << std::setw(5) << std::boolalpha <<
180  m_config->doParticleLevelOverlapRemovalMuJet() << '\n';
181  msgInfo << " " << std::setw(20) << "DoOverlapRemoval El-Jet? " << std::setw(5) << std::boolalpha <<
182  m_config->doParticleLevelOverlapRemovalElJet() << '\n';
183  msgInfo << " " << std::setw(20) << "DoOverlapRemoval Jet-Photon? " << std::setw(5) << std::boolalpha <<
184  m_config->doParticleLevelOverlapRemovalJetPhoton() << '\n';
185 
186 
187  if (m_config->useRCJets()) {
188  m_particleLevelRCJetObjectLoader = std::unique_ptr<ParticleLevelRCJetObjectLoader> (new ParticleLevelRCJetObjectLoader(
189  m_config));
191  "Failed to initialize ParticleLevelRCJetObjectLoader");
192  }
193 
194  if (m_config->useVarRCJets() == true) {
195  boost::split(m_VarRCJetRho, m_config->VarRCJetRho(), boost::is_any_of(","));
196  boost::split(m_VarRCJetMassScale, m_config->VarRCJetMassScale(), boost::is_any_of(","));
197 
198  for (auto& rho : m_VarRCJetRho) {
199  for (auto& mass_scale : m_VarRCJetMassScale) {
200  std::replace(rho.begin(), rho.end(), '.', '_');
201  std::string name = rho + mass_scale;
202  m_particleLevelVarRCJetObjectLoader[name] = std::unique_ptr<ParticleLevelRCJetObjectLoader> (new ParticleLevelRCJetObjectLoader(
203  m_config));
204  top::check(m_particleLevelVarRCJetObjectLoader[name]->setProperty("VarRCjets",
205  true),
206  "Failed to set VarRCjets property of VarRCJet");
207  top::check(m_particleLevelVarRCJetObjectLoader[name]->setProperty("VarRCjets_rho",
208  rho),
209  "Failed to set VarRCjets rho property of VarRCJet");
210  top::check(m_particleLevelVarRCJetObjectLoader[name]->setProperty("VarRCjets_mass_scale",
211  mass_scale),
212  "Failed to set VarRCjets mass scale property of VarRCJet");
213  top::check(m_particleLevelVarRCJetObjectLoader[name]->initialize(), "Failed to initialize VarRCJet");
214  } // end loop over mass scale parameters (e.g., top mass, w mass, etc.)
215  } // end loop over mass scale multiplies (e.g., 1.,2.,etc.)
216  }
217  } else {
218  msgInfo << "Particle level reconstruction is disabled." << '\n';
219  }
220  msgInfo.doOutput();
221  }
222 
223  ParticleLevelLoader::~ParticleLevelLoader() { /* Deliberately Empty */}
224 
226  // If the ParticleLevelLoader is not active, return an empty object
227  if (!m_active) {
228  return {};
229  }
230 
231  // Create the result object.
232  ParticleLevelEvent plEvent;
233 
234  // Load event info object directly into the plEvent
235  top::check(evtStore()->retrieve(plEvent.m_info, m_config->sgKeyEventInfo()),
236  "xAOD::TEvent::retrieve failed for EventInfo");
237 
238  // Load the info for electrons, muons, jets, and MET into local objects:
239  // They need to be selected / modified / etc
241  nullptr
242  };
243  const xAOD::TruthParticleContainer* muons {
244  nullptr
245  };
246  const xAOD::TruthParticleContainer* photons {
247  nullptr
248  };
249  const xAOD::JetContainer* jets {
250  nullptr
251  };
252  const xAOD::JetContainer* largeRJets {
253  nullptr
254  };
255  const xAOD::TruthParticleContainer* taus {
256  nullptr
257  };
258  const xAOD::MissingETContainer* mets {
259  nullptr
260  };
261 
262  if (m_config->useTruthElectrons()) {
263  top::check(evtStore()->retrieve(electrons, m_config->sgKeyTruthElectrons()),
264  "xAOD::TEvent::retrieve failed for Truth Electrons");
265  }
266 
267  if (m_config->useTruthMuons()) {
268  top::check(evtStore()->retrieve(muons, m_config->sgKeyTruthMuons()),
269  "xAOD::TEvent::retrieve failed for Truth Muons");
270  }
271 
272  if (m_config->useTruthPhotons()) {
273  top::check(evtStore()->retrieve(photons, m_config->sgKeyTruthPhotons()),
274  "xAOD::TEvent::retrieve failed for Truth Photons");
275  }
276 
277  if (m_config->useTruthJets()) {
278  top::check(evtStore()->retrieve(jets, m_config->sgKeyTruthJets()),
279  "xAOD::TEvent::retrieve failed for Truth Jets");
280  }
281 
282  if (m_config->useTruthLargeRJets()) {
283  top::check(evtStore()->retrieve(largeRJets, m_config->sgKeyTruthLargeRJets()),
284  "xAOD::TEvent::retrieve failed for Truth Jets Large R");
285  }
286 
287  if (m_config->useTruthTaus()) {
288  top::check(evtStore()->retrieve(taus, m_config->sgKeyTruthTaus()),
289  "xAOD::TEvent::retrieve failed for Truth Taus");
290  }
291 
292  if (m_config->useTruthMET()) {
293  top::check(evtStore()->retrieve(mets, m_config->sgKeyTruthMET()),
294  "xAOD::TEvent::retrieve failed for Truth Missing ET");
295  }
296 
297  // ======================================================================
298  // DRESSING
299  // We want to put the dressed leptons into the Event container, however,
300  // after reading from the TOPQ file, their dressed kinematics are stored
301  // as decorations. Lets (1) create a shallow copied container now, (2)
302  // set the kinematics for the shallow copies to the dressed values, (3)
303  // create decorations for the bare (non-dressed) kinematics, and (4)
304  // deep-copy the selection electrons from that container later.
305 
306  // ELECTRONS
307  if (m_config->useTruthElectrons()) {
311  "Failure to load dressed electrons.");
312  }
313 
314  // MUONS
315  if (m_config->useTruthMuons()) {
319  "Failure to load dressed muons.");
320  }
321 
322  // ======================================================================
323  // OBJECT SELECTION
324  // This yields index collections, one for each
325  // { electrons, muons, photons, jets, largeRJets }.
326  std::list<std::size_t> idx_electrons; // -> relative to `electrons`
327  std::list<std::size_t> idx_muons; // -> relative to `muons`
328  std::list<std::size_t> idx_photons; // -> relative to `photons`
329  std::list<std::size_t> idx_jets; // -> relative to `jets`
330  std::list<std::size_t> idx_largeRJets; // -> relative to `largeRJets`
331  std::list<std::size_t> idx_taus; // -> relative to `taus`
332 
333  // Electrons
334  if (m_config->useTruthElectrons()) {
335  for (std::size_t i = 0; i < electrons->size(); ++i) {
336  const auto* electron = electrons->at(i);
337 
338  // Allow use of mixed-particle input container.
339  if (electron->absPdgId() != 11) {
340  continue;
341  }
342 
343  // FIXME: Is this still needed?
345  continue;
346  }
347 
348  if (m_objectSelector_Electron->apply(*electron)) {
349  idx_electrons.push_back(i);
350  }
351  }
352  }
353 
354  // Muons
355  if (m_config->useTruthMuons()) {
356  for (std::size_t i = 0; i < muons->size(); ++i) {
357  const auto* muon = muons->at(i);
358 
359  // Allow use of mixed-particle input container.
360  if (muon->absPdgId() != 13) {
361  continue;
362  }
363 
364  // FIXME: Is this still needed?
366  continue;
367  }
368 
369  if (m_objectSelector_Muon->apply(*muon)) {
370  idx_muons.push_back(i);
371  }
372  }
373  }
374 
375  // Photons
376  if (m_config->useTruthPhotons()) {
377  for (std::size_t i = 0; i < photons->size(); ++i) {
378  const auto* photon = photons->at(i);
379 
380  // Allow use of mixed-particle input container.
381  if (photon->absPdgId() != 22) {
382  continue;
383  }
384 
385  // FIXME: Is this still needed?
387  continue;
388  }
389 
390  if (not m_objectSelector_Photon->apply(*photon)) {
391  continue;
392  }
393 
394  // Reject photons used for electron dressing.
395  if (m_config->useTruthElectrons()) {
397  continue;
398  }
399  }
400 
401  // Reject photons used for muon dressing.
402  if (m_config->useTruthMuons()) {
403  if (isDressingPhoton(*photon, *muons)) {
404  continue;
405  }
406  }
407  idx_photons.push_back(i);
408  }
409  }
410 
411  // Jets
412  if (m_config->useTruthJets()) {
413  for (std::size_t i = 0; i < jets->size(); ++i) {
414  if (m_objectSelector_Jet->apply(*jets->at(i))) {
415  idx_jets.push_back(i);
416  }
417  }
418  }
419 
420  // Large-R-Jets
421  if (m_config->useTruthLargeRJets()) {
422  for (std::size_t i = 0; i < largeRJets->size(); ++i) {
423  if (m_objectSelector_LargeRJet->apply(*largeRJets->at(i))) {
424  idx_largeRJets.push_back(i);
425  }
426  }
427  }
428 
429  // Taus
430  if (m_config->useTruthTaus()) {
431  for (std::size_t i = 0; i < taus->size(); ++i) {
432  if (m_objectSelector_Tau->apply(*taus->at(i))) {
433  idx_taus.push_back(i);
434  }
435  }
436  }
437 
438  // ======================================================================
439  // OVERLAP REMOVAL
440  // Removal Steps:
441  // 1. Jets & Muons:
442  // Remove Muons with dR < 0.4
443  // 2. Jets & Electrons:
444  // Remove Electrons with dR < 0.4
445  // 3. Photons & Jets:
446  // Remove Jets with dR < 0.4
447 
448  // Use rapidity instead of pseudo-rapidity in deltaR calculation for overlap removal
449  bool useRapidityInDeltaRCalculation = m_config->useParticleLevelOverlapRemovalWithRapidity();
450 
451  // Jets and Muons: Remove Muon with dR < 0.4
452  if (m_config->useTruthMuons() && m_config->useTruthJets() && m_config->doParticleLevelOverlapRemovalMuJet()) {
453 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
454  const std::size_t nMuonsPreOR {
455  idx_muons.size()
456  };
457 #endif
458 
459  idx_muons.remove_if([&idx_jets, &jets, &useRapidityInDeltaRCalculation, this](std::size_t m) {
460  for (auto j : idx_jets) {
461  if (xAOD::P4Helpers::deltaR(jets->at(j), m_muonsDressed->at(m), useRapidityInDeltaRCalculation) < 0.4) {
462  return true;
463  }
464  }
465  return false;
466  });
467 
468 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
469  ATH_MSG_INFO("[top::ParticleLevelLoader] Muon-In-Jet OR: "
470  << nMuonsPreOR << " -> " << idx_muons.size());
471 #endif
472  }
473 
474  // Jets and Electrons: Remove Electron with dR < 0.4
475  if (m_config->useTruthElectrons() && m_config->useTruthJets() && m_config->doParticleLevelOverlapRemovalElJet()) {
476 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
477  const std::size_t nElectronsPreOR {
478  idx_electrons.size()
479  };
480 #endif
481 
482  idx_electrons.remove_if([&idx_jets, &jets, &useRapidityInDeltaRCalculation, this](std::size_t e) {
483  for (auto j : idx_jets) {
484  if (xAOD::P4Helpers::deltaR(jets->at(j),m_electronsDressed->at(e), useRapidityInDeltaRCalculation) < 0.4) {
485  return true;
486  }
487  }
488  return false;
489  });
490 
491 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
492  ATH_MSG_INFO("[top::ParticleLevelLoader] Electron-In-Jet OR: "
493  << nElectronsPreOR << " -> " << idx_electrons.size());
494 #endif
495  }
496 
497  // Photons and Jets: Remove Jet with dR < 0.4
498  if (m_config->useTruthPhotons() && m_config->useTruthJets() && m_config->doParticleLevelOverlapRemovalJetPhoton()) {
499 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
500  const std::size_t nJetPreOR {
501  idx_jets.size()
502  };
503 #endif
504 
505  idx_jets.remove_if([&idx_photons, &photons, &useRapidityInDeltaRCalculation, &jets](std::size_t j) {
506  for (auto ph : idx_photons) {
507  if (xAOD::P4Helpers::deltaR(photons->at(ph), jets->at(j), useRapidityInDeltaRCalculation) < 0.4) {
508  return true;
509  }
510  }
511  return false;
512  });
513 
514 #ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
515  ATH_MSG_INFO("[top::ParticleLevelLoader] Jet-In-Photon OR: "
516  << nJetsPreOR << " -> " << idx_jets.size());
517 #endif
518  }
519 
520 
521  // ======================================================================
522  // WRITE TO LOADER
523  // 1. Loop index lists for electrons / muons / photons / jets
524  // 2. Create a deep copy of the item and insert it into the
525  // appropriate container
526  // 3. Create a shallow copy of the containers and apply corrections
527  // if needed (dressing, etc.)
528 
529  // Create New Containers holding the "Good" Electrons / Muons / Jets
530  // and the MET
531  if (m_config->useTruthElectrons()) {
534  goodElectrons->setStore(goodElectronsAux); //< Connect the two
535 
536  m_goodElectrons.reset(goodElectrons);
537  m_goodElectronsAux.reset(goodElectronsAux);
538 
539  for (auto e : idx_electrons) {
540  const auto& elPtr = m_electronsDressed->at(e);
542  electron->makePrivateStore(*elPtr);
543  m_goodElectrons->push_back(electron);
544  }
545 
546  // sort electrons based on dressed pT -- otherwise they remain sorted according to bare pT
547  std::sort(m_goodElectrons->begin(), m_goodElectrons->end(), top::descendingPtSorter);
548  }
549 
550  if (m_config->useTruthMuons()) {
553  goodMuons->setStore(goodMuonsAux); //< Connect the two
554 
555  m_goodMuons.reset(goodMuons);
556  m_goodMuonsAux.reset(goodMuonsAux);
557 
558  for (auto m : idx_muons) {
559  const auto& muPtr = m_muonsDressed->at(m);
561  muon->makePrivateStore(*muPtr);
562  m_goodMuons->push_back(muon);
563  }
564 
565  // sort muons based on dressed pT -- otherwise they remain sorted according to bare pT
566  std::sort(m_goodMuons->begin(), m_goodMuons->end(), top::descendingPtSorter);
567  }
568 
569  if (m_config->useTruthPhotons()) {
572  goodPhotons->setStore(goodPhotonsAux); //< Connect the two
573 
574  m_goodPhotons.reset(goodPhotons);
575  m_goodPhotonsAux.reset(goodPhotonsAux);
576 
577  for (auto ph : idx_photons) {
578  const auto& phPtr = photons->at(ph);
580  photon->makePrivateStore(*phPtr);
581  m_goodPhotons->push_back(photon);
582  }
583  }
584 
585  if (m_config->useTruthJets()) {
586  xAOD::JetContainer* goodJets = new xAOD::JetContainer();
587  xAOD::JetAuxContainer* goodJetsAux = new xAOD::JetAuxContainer();
588  goodJets->setStore(goodJetsAux); //< Connect the two
589 
590  m_goodJets.reset(goodJets);
591  m_goodJetsAux.reset(goodJetsAux);
592 
593  for (auto j : idx_jets) {
594  const auto& jetPtr = jets->at(j);
595  xAOD::Jet* jet = new xAOD::Jet();
596  jet->makePrivateStore(*jetPtr);
597  m_goodJets->push_back(jet);
598  }
599  }
600 
601  if (m_config->useTruthLargeRJets()) {
602  xAOD::JetContainer* goodLargeRJets = new xAOD::JetContainer();
603  xAOD::JetAuxContainer* goodLargeRJetsAux = new xAOD::JetAuxContainer();
604  goodLargeRJets->setStore(goodLargeRJetsAux); //< Connect the two
605 
606  m_goodLargeRJets.reset(goodLargeRJets);
607  m_goodLargeRJetsAux.reset(goodLargeRJetsAux);
608 
609  for (auto j : idx_largeRJets) {
610  const auto& jetPtr = largeRJets->at(j);
611  xAOD::Jet* jet = new xAOD::Jet();
612  jet->makePrivateStore(*jetPtr);
613  m_goodLargeRJets->push_back(jet);
614  }
615  }
616 
617  if (m_config->useTruthTaus()) {
620  goodTaus->setStore(goodTausAux); //< Connect the two
621 
622  m_goodTaus.reset(goodTaus);
623  m_goodTausAux.reset(goodTausAux);
624 
625  for (auto t : idx_taus) {
626  const auto& tauPtr = taus->at(t);
628  tau->makePrivateStore(*tauPtr);
629  m_goodTaus->push_back(tau);
630  }
631  }
632 
633  if (m_config->useTruthMuons() && m_config->useSoftMuons() ) {
636  goodSoftMuons->setStore(goodSoftMuonsAux); //< Connect the two
637 
638  m_goodSoftMuons.reset(goodSoftMuons);
639  m_goodSoftMuonsAux.reset(goodSoftMuonsAux);
640 
641  //if we want the soft muon truth history, the parent navigation for the TruthMuons collection is unfortunately working only in DAOD_PHYS, in other derivations
642  //we need a workaround, i.e. we need to use the muon from the TruthParticles container instead of the one from the TruthMuon container
643  std::vector<const xAOD::TruthParticle*> truth_particles_vec; //this is an helper vector to speed up looking for the right muon...
644  const xAOD::TruthParticleContainer* truth_particles = nullptr;
645  if (m_config->useTruthParticles() && m_config->softmuonAdditionalTruthInfo()) {
646  top::check(evtStore()->retrieve(truth_particles, m_config->sgKeyMCParticle()),
647  "xAOD::TEvent::retrieve failed for Truth Particles");
648  if(truth_particles)
649  {
650  for(const xAOD::TruthParticle* p : *truth_particles)
651  {
652  if(p->isMuon() && MC::isStable(p)) truth_particles_vec.push_back(p);
653  }
654  }
655  }
656 
657  for (std::size_t i = 0; i < muons->size(); ++i) { //note we don't use dressed muons in this case
658  if(std::find(idx_muons.begin(), idx_muons.end(), i)!=idx_muons.end()) continue; //we don't want to store muons both as standard muons and as soft muons
659  const auto& muPtr = muons->at(i);
660 
661  //here we apply the selection for soft muons
662  if(muPtr->absPdgId()!=13) continue;
663  if(muPtr->pt()<m_config->truth_softmuon_PtCut()) continue;
664  if(fabs(muPtr->eta())>m_config->truth_softmuon_EtaCut()) continue;
665  //now the association with the jets
666 
667  if(m_config->useTruthJets())
668  {
669  bool isInJet=false;
670  for(xAOD::Jet* jetPtr : *m_goodJets)
671  {
672  float dR = xAOD::P4Helpers::deltaR(*muPtr,*jetPtr,m_config->softmuonDRJetcutUseRapidity());
673  if(dR<m_config->softmuonDRJetcut())
674  {
675  isInJet=true;
676  break;
677  }
678  }
679  if(!isInJet) continue;
680  }
681  //end of selection
682 
683  if(m_config->softmuonAdditionalTruthInfo() && (!muPtr->isAvailable<bool>("hasTruthMuonHistoryInfo") || !muPtr->auxdecor<bool>("hasTruthMuonHistoryInfo"))) //if "hasTruthMuonPartonHistoryInfo" exists and is true, we already filled these info for this muon (since muon history filling can be done in several parts of the code for good reasons)
684  {
685  bool doPartonHistory=m_config->softmuonAdditionalTruthInfoCheckPartonOrigin();
686  top::truth::initTruthMuonHistoryInfo(muPtr,doPartonHistory);
687 
688  //in DAOD_PHYS we can just navigate directly from the muon from TruthMuons
689  if (m_config->getDerivationStream() == "PHYS")
690  {
691  top::truth::getTruthMuonHistory(muPtr,doPartonHistory,m_config->getShoweringAlgorithm(),m_config->softmuonAdditionalTruthInfoDoVerbose());
692  }
693  else //apparently in older derivation formats we have to navigate using the muon from the TruthParticles container, this is annoying
694  {
695  //first we find the associated truth muon from truth_particles
696  const xAOD::TruthParticle* assMuon = 0;
697  for(const xAOD::TruthParticle* p : truth_particles_vec)
698  {
699  if(!p) continue;
700  if(HepMC::uniqueID(p) == HepMC::uniqueID(muPtr))
701  {
702  assMuon = p;
703  break;
704  }
705  }
706  if(assMuon) //then we use it
707  {
708  //if we don't have the info correctly filled already, let's initialize it to default values
709  if(!assMuon->isAvailable<bool>("hasTruthMuonHistoryInfo") || ! assMuon->auxdecor<bool>("hasTruthMuonHistoryInfo")) top::truth::initTruthMuonHistoryInfo(assMuon,doPartonHistory);
710  //we have to use the associated muon from the TruthParticles container in this case
711  top::truth::getTruthMuonHistory(assMuon,doPartonHistory,m_config->getShoweringAlgorithm(),m_config->softmuonAdditionalTruthInfoDoVerbose());
712  //then we copy the info to our muon
714 
715  }
716  }
717  }//end of additional soft muon filling
718 
720  muon->makePrivateStore(*muPtr);
721 
722  m_goodSoftMuons->push_back(muon);
723 
724  }
725 
726  // sort muons based on dressed pT -- otherwise they remain sorted according to bare pT
727  std::sort(m_goodSoftMuons->begin(), m_goodSoftMuons->end(), top::descendingPtSorter);
728  }
729 
730 
731  // ======================================================================
732  // INSERTION INTO STORAGE
733  // Put everything into storage, i.e. into the ParticleLevel.event object
734  plEvent.m_electrons = m_config->useTruthElectrons() ? m_goodElectrons.get() : nullptr;
735  plEvent.m_muons = m_config->useTruthMuons() ? m_goodMuons.get() : nullptr;
736  plEvent.m_softmuons = (m_config->useTruthMuons() && m_config->useSoftMuons()) ? m_goodSoftMuons.get() : nullptr;
737  plEvent.m_photons = m_config->useTruthPhotons() ? m_goodPhotons.get() : nullptr;
738  plEvent.m_jets = m_config->useTruthJets() ? m_goodJets.get() : nullptr;
739  plEvent.m_largeRJets = m_config->useTruthLargeRJets() ? m_goodLargeRJets.get() : nullptr;
740  plEvent.m_taus = m_config->useTruthTaus() ? m_goodTaus.get() : nullptr;
741  plEvent.m_met = m_config->useTruthMET() ? (*mets)[ "NonInt" ] : nullptr;
742 
743  // Reclustered jets
744  if (m_config->useRCJets()) {
746  plEvent), "Failed to execute ParticleLevelRCJetObjectLoader container");
747  // Get the name of the container of re-clustered jets
748  std::string RCJetContainerNane = m_particleLevelRCJetObjectLoader->rcjetContainerName();
749 
750  // -- Retrieve the re-clustered jets from TStore & save good re-clustered jets -- //
751  const xAOD::JetContainer* rc_jets(nullptr);
752  top::check(evtStore()->retrieve(rc_jets, RCJetContainerNane), "Failed to retrieve particle RC JetContainer");
753 
754  for (auto rcjet : *rc_jets) {
755  top::check(rcjet->isAvailable<bool>(
756  "PassedSelection"),
757  " Can't find reclustered jet decoration \"PassedSelection\" - we need it to decide if we should keep the reclustered jet in the top::Event instance or not!");
758  if (rcjet->auxdataConst<bool>("PassedSelection")) plEvent.m_RCJets.push_back((xAOD::Jet*) rcjet);
759  }
760  }
761  // Variable-R reclustered jets
762  if (m_config->useVarRCJets()) {
763  for (auto& rho : m_VarRCJetRho) {
764  for (auto& mass_scale : m_VarRCJetMassScale) {
765  std::replace(rho.begin(), rho.end(), '.', '_');
766  std::string name = rho + mass_scale;
768  plEvent), "Failed to execute RCJet container");
769 
770  // Get the name of the container of re-clustered jets in TStore
771  std::string varRCJetContainerName = m_particleLevelVarRCJetObjectLoader[name]->rcjetContainerName();
772 
773  // -- Retrieve the re-clustered jets from TStore & save good re-clustered jets -- //
774  const xAOD::JetContainer* vrc_jets(nullptr);
775  top::check(evtStore()->retrieve(vrc_jets, varRCJetContainerName), "Failed to retrieve RC JetContainer");
776 
777  plEvent.m_VarRCJets[name] = std::make_shared<xAOD::JetContainer>(SG::VIEW_ELEMENTS);
778  for (auto vrcjet : *vrc_jets) {
779  top::check(vrcjet->isAvailable<bool>(
780  "PassedSelection"),
781  " Can't find jet decoration \"PassedSelection\" - we need it to decide if we should keep the variable-R reclustered jet in the top::Event instance or not!");
782  if (vrcjet->auxdataConst<bool>("PassedSelection")) plEvent.m_VarRCJets[name]->push_back((xAOD::Jet*) vrcjet);
783 
784  }
785  }
786  }
787  }
788 
789 
790 
791  return plEvent;
792  }
793 
795  std::unique_ptr<xAOD::TruthParticleContainer>& store,
796  std::unique_ptr<xAOD::ShallowAuxContainer>& storeAux) const {
797  auto dressed = xAOD::shallowCopyContainer(input);
798 
799  store.reset(dressed.first);
800  storeAux.reset(dressed.second);
801 
802  for (auto pl : *store.get()) {
803  TLorentzVector fvDressed;
804  fvDressed.SetPtEtaPhiE(pl->auxdata<float>("pt_dressed"),
805  pl->auxdata<float>("eta_dressed"),
806  pl->auxdata<float>("phi_dressed"),
807  pl->auxdata<float>("e_dressed"));
808 
809  // Store original kinematics as decoration
810  // m->auxdata<int>( "nPhotons_dressed" ) = m->auxdata<int>( "nPhotons_dressed" );
811 
812  pl->auxdata<float>("pt_bare") = pl->pt();
813  pl->auxdata<float>("eta_bare") = pl->eta();
814  pl->auxdata<float>("phi_bare") = pl->phi();
815  pl->auxdata<float>("e_bare") = pl->e();
816 
817  pl->setPx(fvDressed.Px());
818  pl->setPy(fvDressed.Py());
819  pl->setPz(fvDressed.Pz());
820  pl->setE(fvDressed.E());
821  }
822 
823  return true;
824  }
825 
827  const xAOD::TruthParticleContainer& dressedParticles,
828  const float dressingCone /* = 0.1 */) const {
829  // We do not check whether the original truth particle decoration exists
830  // and / or is valid because at this point we assume that it was already
831  // used by the lepton loading function.
832  static const std::string decoName {
833  "originalTruthParticle"
834  };
835 
836  // Use rapidity instead of pseudo-rapidity in deltaR calculation for overlap removal
837  bool useRapidityInDeltaRCalculation = m_config->useParticleLevelOverlapRemovalWithRapidity();
838 
839  for (const auto *particle : dressedParticles) {
840  bool tp_isValid = false;
842  try {
843  truthProxy = particle->auxdata<ElementLink<xAOD::TruthParticleContainer> >("originalTruthParticle");
844  tp_isValid = truthProxy.isValid();
845  } catch (const SG::ExcBadAuxVar&) {
846  // ExcBadAuxVar can be thrown before checking if proxy is valid
847  tp_isValid = false;
848  }
849 
850  if (not tp_isValid) {
851  if (xAOD::P4Helpers::deltaR(particle, &photon, useRapidityInDeltaRCalculation) <= dressingCone) {
852  return true;
853  }
854  } else {
855  if (xAOD::P4Helpers::deltaR((*truthProxy), &photon, useRapidityInDeltaRCalculation) <= dressingCone) {
856  return true;
857  }
858  }
859  }
860 
861  return false;
862  }
863 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
top::ParticleLevelLoader::m_goodPhotons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodPhotons
Definition: ParticleLevelLoader.h:123
top::ParticleLevelEvent::m_muons
const xAOD::TruthParticleContainer * m_muons
Pointer to truth level muons.
Definition: ParticleLevelEvent.h:45
top::ParticleLevelPhotonObjectSelector
Definition: ParticleLevelPhotonObjectSelector.h:27
ParticleLevelTauObjectSelector.h
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
top::ParticleLevelLoader::m_goodSoftMuons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodSoftMuons
Definition: ParticleLevelLoader.h:120
top::ParticleLevelLoader::m_goodLargeRJets
std::unique_ptr< xAOD::JetContainer > m_goodLargeRJets
Definition: ParticleLevelLoader.h:129
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
top::ParticleLevelEvent::m_info
const xAOD::EventInfo * m_info
Pointer to the event info object.
Definition: ParticleLevelEvent.h:39
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ParticleLevelMuonObjectSelector.h
top::ParticleLevelLoader::m_objectSelector_Photon
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Photon
Definition: ParticleLevelLoader.h:98
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::JetAuxContainer
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
Definition: JetAuxContainer.h:22
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
xAODP4Helpers.h
top::ParticleLevelLoader::m_active
const bool m_active
Definition: ParticleLevelLoader.h:137
top::ParticleLevelElectronObjectSelector::Options
Definition: ParticleLevelElectronObjectSelector.h:25
top::ParticleLevelEvent::m_jets
const xAOD::JetContainer * m_jets
Pointer to truth level jets.
Definition: ParticleLevelEvent.h:54
top::ParticleLevelLoader::m_goodMuonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodMuonsAux
Definition: ParticleLevelLoader.h:118
asg
Definition: DataHandleTestTool.h:28
top::ParticleLevelTauObjectSelector::Options
Definition: ParticleLevelTauObjectSelector.h:20
top::ParticleLevelLoader::loadDressedLeptons
bool loadDressedLeptons(const xAOD::TruthParticleContainer &input, std::unique_ptr< xAOD::TruthParticleContainer > &store, std::unique_ptr< xAOD::ShallowAuxContainer > &storeAux) const
Definition: ParticleLevelLoader.cxx:794
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
top::ParticleLevelLoader::m_goodTaus
std::unique_ptr< xAOD::TruthParticleContainer > m_goodTaus
Definition: ParticleLevelLoader.h:132
top::ParticleLevelEvent::m_taus
const xAOD::TruthParticleContainer * m_taus
Pointer to truth level photons.
Definition: ParticleLevelEvent.h:66
ParticleLevelElectronObjectSelector.h
SG::AuxElement::auxdecor
Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
top::ParticleLevelEvent::m_largeRJets
const xAOD::JetContainer * m_largeRJets
Pointer to the truth level large R jets.
Definition: ParticleLevelEvent.h:63
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
top::ParticleLevelLoader::m_goodSoftMuonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodSoftMuonsAux
Definition: ParticleLevelLoader.h:121
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::ParticleLevelEvent::m_RCJets
xAOD::JetContainer m_RCJets
Container of recluster jets (can be sorted)
Definition: ParticleLevelEvent.h:57
xAOD::TruthParticleAuxContainer_v1
Auxiliary store for the truth vertices.
Definition: TruthParticleAuxContainer_v1.h:27
top::ParticleLevelLoader::m_particleLevelRCJetObjectLoader
std::unique_ptr< ParticleLevelRCJetObjectLoader > m_particleLevelRCJetObjectLoader
Definition: ParticleLevelLoader.h:102
xAOD::JetAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: JetAuxContainer_v1.h:37
top::ParticleLevelEvent::m_VarRCJets
std::unordered_map< std::string, std::shared_ptr< xAOD::JetContainer > > m_VarRCJets
Containers of variable-R reclustered jets (can be sorted)
Definition: ParticleLevelEvent.h:60
xAOD::TruthParticleAuxContainer
TruthParticleAuxContainer_v1 TruthParticleAuxContainer
Declare the latest version of the truth particle auxiliary container.
Definition: TruthParticleAuxContainer.h:16
top::ParticleLevelLoader::m_particleLevelVarRCJetObjectLoader
std::map< std::string, std::unique_ptr< ParticleLevelRCJetObjectLoader > > m_particleLevelVarRCJetObjectLoader
Definition: ParticleLevelLoader.h:103
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
top::truth::initTruthMuonHistoryInfo
void initTruthMuonHistoryInfo(const xAOD::TruthParticle *truthmu, bool doPartonHistory)
Definition: TruthTools.cxx:62
SG::ExcBadAuxVar
Exception — Attempt to retrieve nonexistent aux data item.
Definition: Control/AthContainers/AthContainers/exceptions.h:59
top::ParticleLevelLoader::m_electronsDressedAux
std::unique_ptr< xAOD::ShallowAuxContainer > m_electronsDressedAux
Definition: ParticleLevelLoader.h:109
top::ParticleLevelMuonObjectSelector
Definition: ParticleLevelMuonObjectSelector.h:19
top::ParticleLevelElectronObjectSelector
Definition: ParticleLevelElectronObjectSelector.h:19
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:299
lumiFormat.i
int i
Definition: lumiFormat.py:92
top::ParticleLevelLoader::m_muonsDressedAux
std::unique_ptr< xAOD::ShallowAuxContainer > m_muonsDressedAux
Definition: ParticleLevelLoader.h:112
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
top::ParticleLevelLoader::m_objectSelector_Jet
std::unique_ptr< ObjectSelectorBase< xAOD::Jet > > m_objectSelector_Jet
Definition: ParticleLevelLoader.h:99
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
top::ParticleLevelLoader::m_goodMuons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodMuons
Definition: ParticleLevelLoader.h:117
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
ParticleLevelPhotonObjectSelector.h
top::ParticleLevelTauObjectSelector
Definition: ParticleLevelTauObjectSelector.h:14
ParticleLevelLoader.h
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::truth::getTruthMuonHistory
void getTruthMuonHistory(const xAOD::TruthParticle *truthmu, bool doPartonHistory, SampleXsection::showering shAlgo, bool verbose)
Definition: TruthTools.cxx:200
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::ParticleLevelJetObjectSelector
Definition: ParticleLevelJetObjectSelector.h:19
top::ParticleLevelJetObjectSelector::Options
Definition: ParticleLevelJetObjectSelector.h:25
top::ParticleLevelLoader::m_objectSelector_Tau
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Tau
Definition: ParticleLevelLoader.h:101
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
top::ParticleLevelLoader::m_objectSelector_LargeRJet
std::unique_ptr< ObjectSelectorBase< xAOD::Jet > > m_objectSelector_LargeRJet
Definition: ParticleLevelLoader.h:100
top::ParticleLevelLoader::m_muonsDressed
std::unique_ptr< xAOD::TruthParticleContainer > m_muonsDressed
Definition: ParticleLevelLoader.h:111
top::ParticleLevelLoader::m_goodPhotonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodPhotonsAux
Definition: ParticleLevelLoader.h:124
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
ParticleLevelRCJetObjectLoader
Definition: ParticleLevelRCJetObjectLoader.h:51
top::ParticleLevelLoader::m_electronsDressed
std::unique_ptr< xAOD::TruthParticleContainer > m_electronsDressed
Definition: ParticleLevelLoader.h:108
top::ParticleLevelLoader::load
ParticleLevelEvent load()
Loading function.
Definition: ParticleLevelLoader.cxx:225
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TruthTools.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
TopConfig.h
top::ParticleLevelEvent::m_electrons
const xAOD::TruthParticleContainer * m_electrons
Pointer to truth level electrons.
Definition: ParticleLevelEvent.h:42
top::ParticleLevelLoader::m_goodElectrons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodElectrons
Definition: ParticleLevelLoader.h:114
xAOD::shallowCopyContainer
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
Definition: ShallowCopy.h:110
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
top::ParticleLevelLoader::m_goodJets
std::unique_ptr< xAOD::JetContainer > m_goodJets
Definition: ParticleLevelLoader.h:126
top::ParticleLevelLoader::m_VarRCJetRho
std::vector< std::string > m_VarRCJetRho
Definition: ParticleLevelLoader.h:104
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
top::ParticleLevelLoader::m_goodLargeRJetsAux
std::unique_ptr< xAOD::JetAuxContainer > m_goodLargeRJetsAux
Definition: ParticleLevelLoader.h:130
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
top::ParticleLevelLoader::m_objectSelector_Muon
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Muon
Definition: ParticleLevelLoader.h:97
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
top::ParticleLevelLoader::m_VarRCJetMassScale
std::vector< std::string > m_VarRCJetMassScale
Definition: ParticleLevelLoader.h:105
top::ParticleLevelEvent::m_photons
const xAOD::TruthParticleContainer * m_photons
Pointer to truth level photons.
Definition: ParticleLevelEvent.h:51
top::ParticleLevelLoader::m_goodJetsAux
std::unique_ptr< xAOD::JetAuxContainer > m_goodJetsAux
Definition: ParticleLevelLoader.h:127
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
top::ParticleLevelLoader::ParticleLevelLoader
ParticleLevelLoader(const std::shared_ptr< top::TopConfig > &cfg)
Constructor of the loader tool.
Definition: ParticleLevelLoader.cxx:36
EventInfoRead.isMC
isMC
Definition: EventInfoRead.py:11
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
top::ParticleLevelLoader::m_goodElectronsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodElectronsAux
Definition: ParticleLevelLoader.h:115
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition: JetContainer.h:17
top::ParticleLevelPhotonObjectSelector::Options
Definition: ParticleLevelPhotonObjectSelector.h:33
top::ParticleLevelLoader::m_goodTausAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodTausAux
Definition: ParticleLevelLoader.h:133
top::ParticleLevelLoader::~ParticleLevelLoader
virtual ~ParticleLevelLoader()
Destructor of the loader tool.
Definition: ParticleLevelLoader.cxx:223
top::ParticleLevelEvent::m_softmuons
const xAOD::TruthParticleContainer * m_softmuons
Pointer to truth level soft-muons.
Definition: ParticleLevelEvent.h:48
top::ParticleLevelEvent::m_met
const xAOD::MissingET * m_met
Definition: ParticleLevelEvent.h:69
ParticleLevelEvent.h
top::descendingPtSorter
bool descendingPtSorter(const xAOD::IParticle *p1, const xAOD::IParticle *p2)
Used when sorting the e, mu, jet, tau containers after CP corrections.
Definition: EventTools.cxx:56
ParticleLevelJetObjectSelector.h
asg::AsgTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: AsgTool.h:133
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
top::truth::copyTruthMuonHistoryInfo
void copyTruthMuonHistoryInfo(const xAOD::TruthParticle *tm_origin, const xAOD::TruthParticle *tm_target)
Definition: TruthTools.cxx:77
HepMCHelpers.h
fitman.rho
rho
Definition: fitman.py:532
top::ParticleLevelMuonObjectSelector::Options
Definition: ParticleLevelMuonObjectSelector.h:25
top::ParticleLevelLoader::m_objectSelector_Electron
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Electron
Definition: ParticleLevelLoader.h:96
top::ParticleLevelLoader::isDressingPhoton
bool isDressingPhoton(const xAOD::TruthParticle &photon, const xAOD::TruthParticleContainer &dressedParticles, const float dressingCone=0.1) const
Definition: ParticleLevelLoader.cxx:826
top::ParticleLevelLoader::m_config
const std::shared_ptr< top::TopConfig > & m_config
Definition: ParticleLevelLoader.h:91