Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
METMaker.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // METMaker.cxx
8 // Implementation file for class METMaker
9 // Author: T.J.Khoo<khoo@cern.ch>
11 
12 // METUtilities includes
13 #include "METUtilities/METMaker.h"
15 
16 // MET EDM
22 
23 // Jet EDM
24 #include "xAODJet/JetAttributes.h"
25 
26 // Tracking EDM
29 
30 // Shallow copy
31 #include "xAODCore/ShallowCopy.h"
32 
33 // Muon EDM
34 #include "xAODMuon/MuonContainer.h"
35 
36 // Electron EDM
39 
40 // framework includes
42 #include <AsgTools/AsgToolConfig.h>
46 
47 #include <memory>
48 
49 namespace met {
50 
51  using xAOD::MissingET;
57  using xAOD::IParticle;
59  using xAOD::JetContainer;
61  using xAOD::TrackParticle;
62 
64  static const SG::AuxElement::ConstAccessor< iplink_t > acc_originalObject("originalObjectLink");
65  static const SG::AuxElement::ConstAccessor< iplink_t > acc_nominalObject("nominalObjectLink");
66  static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_ghostMuons("GhostMuon");
67  static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_ghostElecs("GhostElec");
68 
69  static const SG::AuxElement::ConstAccessor< std::vector<int> > acc_trkN("NumTrkPt500");
70  static const SG::AuxElement::ConstAccessor< std::vector<float> > acc_trksumpt("SumPtTrkPt500");
71  static const SG::AuxElement::ConstAccessor< std::vector<float> > acc_sampleE("EnergyPerSampling");
72 
73  static const SG::AuxElement::ConstAccessor<float> acc_emf("EMFrac");
74  static const SG::AuxElement::ConstAccessor<float> acc_psf("PSFrac");
75  static const SG::AuxElement::ConstAccessor<float> acc_width("Width");
76  static const SG::AuxElement::ConstAccessor<float> acc_Eloss("EnergyLoss");
77 
78  static const SG::AuxElement::Accessor< std::vector<iplink_t> > dec_constitObjLinks("ConstitObjectLinks");
79  static const SG::AuxElement::Accessor< std::vector<float> > dec_constitObjWeights("ConstitObjectWeights");
80 
81 
83  // Public methods:
85 
86  // Constructors
88  METMaker::METMaker(const std::string& name) :
89  AsgTool(name),
90  m_PVkey("PrimaryVertices"),
91  m_acc_jetRejectionDec(nullptr),
92  m_trkseltool(""),
93  m_JvtTool("", this)
94  {
95  //
96  // Property declaration
97  //
98  declareProperty("JetJvtMomentName", m_jetJvtMomentName = "Jvt" );
99  declareProperty("JetRejectionDec", m_jetRejectionDec = "" );
100  declareProperty("JetMinEFrac", m_jetMinEfrac = 0.0 );
101  declareProperty("JetMinWeightedPt", m_jetMinWeightedPt = 20.0e3 );
102  declareProperty("JetConstitScaleMom", m_jetConstitScaleMom = "JetConstitScaleMomentum");
103  declareProperty("CorrectJetPhi", m_jetCorrectPhi = false );
104  declareProperty("DoPFlow", m_doPFlow = false );
105  declareProperty("DoSoftTruth", m_doSoftTruth = false );
106  declareProperty("DoJetTruth", m_doConstJet = false );
107 
108  declareProperty("JetSelection", m_jetSelection = "Tight" );
109  declareProperty("JetEtaMax", m_JetEtaMax = 4.5 );
110  declareProperty("JetEtaForw", m_JetEtaForw = 2.5 );
111  declareProperty("CustomCentralJetPt", m_customCenJetPtCut = 20e3 );
112  declareProperty("CustomForwardJetPt", m_customFwdJetPtCut = 20e3 );
113  declareProperty("CustomJetJvtPtMax", m_customJvtPtMax = 60e3 );
114  declareProperty("CustomJetJvtWP", m_customJvtWP = "FixedEffPt" );
115 
116  declareProperty("DoMuonEloss", m_muEloss = false );
117  declareProperty("ORCaloTaggedMuons", m_orCaloTaggedMuon = true );
118  declareProperty("GreedyPhotons", m_greedyPhotons = false );
119  declareProperty("VeryGreedyPhotons", m_veryGreedyPhotons = false );
120 
121  declareProperty("UseGhostMuons", m_useGhostMuons = false );
122  declareProperty("DoRemoveMuonJets", m_doRemoveMuonJets = true );
123  declareProperty("DoSetMuonJetEMScale", m_doSetMuonJetEMScale = true );
124 
125  declareProperty("DoRemoveElecTrks", m_doRemoveElecTrks = true );
126  declareProperty("DoRemoveElecTrksEM", m_doRemoveElecTrksEM = false );
127 
128  declareProperty("skipSystematicJetSelection", m_skipSystematicJetSelection = false,
129  "EXPERIMENTAL: whether to use simplified OR based on nominal jets "
130  "and for jet-related systematics only. "
131  "WARNING: this property is strictly for doing physics studies of the feasibility "
132  "of this OR scheme, it should not be used in a regular analysis");
133 
134  // muon overlap variables (expert use only)
135  declareProperty("JetTrkNMuOlap", m_jetTrkNMuOlap = 5 );
136  declareProperty("JetWidthMuOlap", m_jetWidthMuOlap = 0.1 );
137  declareProperty("JetPsEMuOlap", m_jetPsEMuOlap = 2.5e3 );
138  declareProperty("JetEmfMuOlap", m_jetEmfMuOlap = 0.9 );
139  declareProperty("JetTrkPtMuPt", m_jetTrkPtMuPt = 0.8 );
140  declareProperty("muIDPTJetPtRatioMuOlap", m_muIDPTJetPtRatioMuOlap = 2.0 );
141 
142  declareProperty("MissingObjWarnThreshold", m_missObjWarningPtThreshold = 7.0e3 );
143 
144  declareProperty("TrackSelectorTool", m_trkseltool );
145  declareProperty("JvtSelTool", m_JvtTool );
146  }
147 
148  // Destructor
151  = default;
152 
153  // Athena algtool's Hooks
156  {
157  ATH_MSG_INFO ("Initializing " << name() << "...");
158 
159  ATH_MSG_INFO("Use jet selection criterion: " << m_jetSelection << " PFlow: " << m_doPFlow);
160  if (m_jetSelection == "Loose") { m_CenJetPtCut = 20e3; m_FwdJetPtCut = 20e3; m_JvtWP = "FixedEffPt"; m_JvtPtMax = 60e3; }
161  else if (m_jetSelection == "Tight") { m_CenJetPtCut = 20e3; m_FwdJetPtCut = 30e3; m_JvtWP = "FixedEffPt"; m_JvtPtMax = 60e3; }
162  else if (m_jetSelection == "Tighter"){ m_CenJetPtCut = 20e3; m_FwdJetPtCut = 35e3; m_JvtWP = "FixedEffPt"; m_JvtPtMax = 60e3; }
163  else if (m_jetSelection == "Tenacious"){ m_CenJetPtCut = 20e3; m_FwdJetPtCut = 40e3; m_JvtWP = "FixedEffPt"; m_JvtPtMax = 60e3; }
164  else if (m_jetSelection == "Tier0") { m_CenJetPtCut = 0; m_FwdJetPtCut = 0; m_JvtWP = "None"; }
165  else if (m_jetSelection == "Expert") {
166  ATH_MSG_INFO("Custom jet selection configured. *** FOR EXPERT USE ONLY ***");
171  }
172  else if (m_jetSelection == "HRecoil") {
173  ATH_MSG_INFO("Jet selection for hadronic recoil calculation is configured.");
174  m_CenJetPtCut = 9999e3;
175  m_FwdJetPtCut = 9999e3;
176  m_JetEtaMax = 5;
177  m_JvtWP = "None";
178  }
179  else {
180  if (m_jetSelection == "Default") ATH_MSG_WARNING( "WARNING: Default is now deprecated" );
181  ATH_MSG_ERROR( "Error: No available jet selection found! Please update JetSelection in METMaker. Choose one: Loose, Tight (recommended), Tighter, Tenacious" );
182  return StatusCode::FAILURE;
183  }
184 
185  if (!m_trkseltool.empty()) ATH_CHECK( m_trkseltool.retrieve() );
186 
187  if (m_JvtWP != "None"){
188  if (m_JvtTool.empty()) {
189  asg::AsgToolConfig config_jvt ("CP::NNJvtSelectionTool/JvtSelTool");
190  ATH_CHECK(config_jvt.setProperty("WorkingPoint", m_JvtWP));
191  ATH_CHECK(config_jvt.setProperty("JvtMomentName", "NNJvt"));
192  ATH_CHECK(config_jvt.setProperty("MaxPtForJvt", m_JvtPtMax));
193  ATH_CHECK(config_jvt.makePrivateTool(m_JvtTool));
194  }
195  ATH_CHECK(m_JvtTool.retrieve());
196  }
197 
198  // ReadHandleKey(s)
199  ATH_CHECK( m_PVkey.initialize() );
200 
201  // configurable accessors
202  if (!m_jetRejectionDec.empty()) {
203  m_acc_jetRejectionDec = std::make_unique<SG::AuxElement::ConstAccessor<char>>(m_jetRejectionDec);
204  ATH_MSG_INFO("Applying additional jet rejection criterium in MET calculation: " << m_jetRejectionDec);
205  }
206 
207  ATH_MSG_INFO("Suppressing warnings of objects missing in METAssociationMap for objects with pT < " << m_missObjWarningPtThreshold/1e3 << " GeV.");
208 
209  // overlap removal simplification?
211  ATH_MSG_INFO("Requesting simplified overlap removal procedure in MET calculation");
212  }
213 
214  return StatusCode::SUCCESS;
215  }
216 
217 
218  // **** Rebuild generic MET term ****
219 
220  StatusCode METMaker::rebuildMET(const std::string& metKey,
221  xAOD::Type::ObjectType metType,
222  xAOD::MissingETContainer* metCont,
223  const xAOD::IParticleContainer* collection,
226  {
228  switch(metType) {
230  metSource = MissingETBase::Source::electron();
231  break;
232  case xAOD::Type::Photon:
233  metSource = MissingETBase::Source::photon();
234  break;
235  case xAOD::Type::Tau:
236  metSource = MissingETBase::Source::tau();
237  break;
238  case xAOD::Type::Muon:
239  metSource = MissingETBase::Source::muon();
240  break;
241  case xAOD::Type::Jet:
242  ATH_MSG_WARNING("Incorrect use of rebuildMET -- use rebuildJetMET for RefJet term");
243  return StatusCode::FAILURE;
244  default:
245  ATH_MSG_WARNING("Invalid object type provided: " << metType);
246  return StatusCode::FAILURE;
247  }
248 
249  MissingET* met = nullptr;
250  if( fillMET(met,metCont, metKey , metSource) != StatusCode::SUCCESS) {
251  ATH_MSG_ERROR("failed to fill MET term \"" << metKey << "\"");
252  return StatusCode::FAILURE;
253  }
254 
255  // If muon eloss corrections are required, create a new term to hold these if it doesn't already exist
256  if(metType==xAOD::Type::Muon && (m_muEloss || m_doSetMuonJetEMScale) && !(*metCont)["MuonEloss"]) {
257  MissingET* met_muEloss = nullptr;
258  if( fillMET(met_muEloss,metCont,"MuonEloss",
260  ATH_MSG_ERROR("failed to create Muon Eloss MET term");
261  return StatusCode::FAILURE;
262  }
263  }
264 
265  return rebuildMET(met,collection,helper,objScale);
266  }
267 
269  const xAOD::IParticleContainer* collection,
272  {
274  bool removeOverlap = true;
275  if(!collection->empty()) {
276  const IParticle* obj = collection->front();
277  if(obj->type()==xAOD::Type::Muon) {
279  removeOverlap = false;
280  }
281  }
284  return rebuildMET(met,collection,helper,p,removeOverlap,objScale);
285  }
286 
288  const xAOD::IParticleContainer* collection,
291  bool removeOverlap,
293  if(!met || !collection) {
294  ATH_MSG_ERROR("Invalid pointer supplied for "
295  << "MET (" << met << ") or "
296  << "collection (" << collection << ").");
297  return StatusCode::FAILURE;
298  }
299  const xAOD::MissingETAssociationMap* map = helper.map();
300  if(!map){
301  ATH_MSG_ERROR("MET Association Helper isn't associated with a MissingETAssociationMap!");
302  return StatusCode::FAILURE;
303  }
304  if(map->empty()) {
305  ATH_MSG_WARNING("Incomplete association map received. Cannot rebuild MET.");
306  ATH_MSG_WARNING("Note: METMaker should only be run on events containing at least one PV");
307  return StatusCode::SUCCESS;
308  }
309  ATH_MSG_VERBOSE("Building MET term " << met->name());
310  dec_constitObjLinks(*met) = std::vector<iplink_t>(0);
311  dec_constitObjWeights(*met) = std::vector<float>(0);
312  std::vector<iplink_t>& uniqueLinks = dec_constitObjLinks(*met);
313  std::vector<float>& uniqueWeights = dec_constitObjWeights(*met);
314  uniqueLinks.reserve(collection->size());
315  uniqueWeights.reserve(collection->size());
316 
317  // Get the hashed key of this collection, if we can. Though his only works
318  // if
319  // 1. the container is an owning container, and not just a view;
320  // 2. the container is in the event store already.
321  // Since we will be creating ElementLink-s to these objects later on in the
322  // code, and it should work in AnalysisBase, only the first one of these
323  // is checked. Since the code can not work otherwise.
324  SG::sgkey_t collectionSgKey = 0;
325  if(collection->ownPolicy() == SG::OWN_ELEMENTS) {
326  collectionSgKey = getKey(collection);
327  if(collectionSgKey == 0) {
328  ATH_MSG_ERROR("Could not find the collection with pointer: "
329  << collection);
330  return StatusCode::FAILURE;
331  }
332  }
333 
334  if(collection->empty()) return StatusCode::SUCCESS;
335 
336  bool originalInputs = !acc_originalObject.isAvailable(*collection->front());
337  bool isShallowCopy = dynamic_cast<const xAOD::ShallowAuxContainer*>(collection->front()->container()->getConstStore());
338  ATH_MSG_VERBOSE("const store = " << collection->front()->container()->getConstStore());
339  if(isShallowCopy && originalInputs) {
340  ATH_MSG_WARNING("Shallow copy provided without \"originalObjectLinks\" decoration! "
341  << "Overlap removal cannot be done. "
342  << "Will not compute this term.");
343  ATH_MSG_WARNING("Please apply xAOD::setOriginalObjectLink() from xAODBase/IParticleHelpers.h");
344  return StatusCode::SUCCESS;
345  }
346  ATH_MSG_VERBOSE("Original inputs? " << originalInputs);
347  for(const auto *const obj : *collection) {
348  const IParticle* orig = obj;
349  bool selected = false;
350  if(!originalInputs) { orig = *acc_originalObject(*obj); }
351  std::vector<const xAOD::MissingETAssociation*> assocs = xAOD::MissingETComposition::getAssociations(map,orig);
352  if(assocs.empty()) {
353  std::string message = "Object is not in association map. Did you make a deep copy but fail to set the \"originalObjectLinks\" decoration? "
354  "If not, Please apply xAOD::setOriginalObjectLink() from xAODBase/IParticleHelpers.h";
355  // Avoid warnings for leptons with pT below threshold for association map
356  if (orig->pt()>m_missObjWarningPtThreshold) {
358  } else {
360  }
361  // if this is an uncalibrated electron below the threshold, then we put it into the soft term
362  if(orig->type()==xAOD::Type::Electron){
363  iplink_t objLink;
364  if(collectionSgKey == 0) {
365  const xAOD::IParticleContainer* ipc = static_cast<const xAOD::IParticleContainer*>(obj->container());
366  objLink = iplink_t(*ipc, obj->index());
367  } else {
368  objLink = iplink_t(collectionSgKey, obj->index());
369  }
370  uniqueLinks.emplace_back( objLink );
371  uniqueWeights.emplace_back( 0. );
372  message = "Missing an electron from the MET map. Included as a track in the soft term. pT: " + std::to_string(obj->pt()/1e3) + " GeV";
373  if (orig->pt()>m_missObjWarningPtThreshold) {
375  } else {
377  }
378  continue;
379  } else {
380  ATH_MSG_ERROR("Missing an object: " << orig->type() << " pT: " << obj->pt()/1e3 << " GeV, may be duplicated in the soft term.");
381  }
382  }
383 
384  // If the object has already been selected and processed, ignore it.
385  if(MissingETComposition::objSelected(helper,orig)) continue;
386  selected = MissingETComposition::selectIfNoOverlaps(helper,orig,p) || !removeOverlap;
387  ATH_MSG_VERBOSE(obj->type() << " (" << orig <<") with pt " << obj->pt()
388  << " is " << ( selected ? "non-" : "") << "overlapping");
389 
390  // Greedy photon options: set selection flags
391  if ((m_greedyPhotons || m_veryGreedyPhotons) && selected && obj->type() == xAOD::Type::Photon){
392  for(const xAOD::MissingETAssociation* assoc : assocs){
393  std::vector<size_t> indices = assoc->overlapIndices(orig);
394  std::vector<const xAOD::IParticle*> allObjects = assoc->objects();
395  for (size_t index : indices){
396  const xAOD::IParticle* thisObj = allObjects[index];
397  if(!thisObj) continue;
398  if ((thisObj->type() == xAOD::Type::Jet && m_veryGreedyPhotons) ||
399  thisObj->type() == xAOD::Type::Electron)
400  helper.setObjSelectionFlag(assoc, thisObj, true);
401  }
402  }
403  }
404 
405  //Do special overlap removal for calo tagged muons
406  if(m_orCaloTaggedMuon && !removeOverlap && orig->type()==xAOD::Type::Muon && static_cast<const xAOD::Muon*>(orig)->muonType()==xAOD::Muon::CaloTagged) {
407  for (size_t i = 0; i < assocs.size(); i++) {
408  std::vector<size_t> ind = assocs[i]->overlapIndices(orig);
409  std::vector<const xAOD::IParticle*> allObjects = assocs[i]->objects();
410  for (size_t indi = 0; indi < ind.size(); indi++) if (allObjects[ind[indi]]) {
411  if (allObjects[ind[indi]]->type()==xAOD::Type::Electron
412  && helper.objSelected(assocs[i], ind[indi])) {
413  selected = false;
414  break;
415  }
416  }
417  }
418  }
419  // Don't overlap remove muons, but flag the non-overlapping muons to take out their tracks from jets
420  // Removed eloss from here -- clusters already flagged.
421  // To be handled in rebuildJetMET
422  if(selected) {
424  ATH_MSG_VERBOSE("Add object with pt " << obj->pt());
425  *met += obj;
426  } else {
428  ATH_MSG_VERBOSE("Add truth object with pt " << constvec.cpt());
429  met->add(constvec.cpx(),constvec.cpy(),constvec.cpt());
430  }
431  iplink_t objLink;
432  if(collectionSgKey == 0) {
433  const xAOD::IParticleContainer* ipc =
434  static_cast<const xAOD::IParticleContainer*>(obj->container());
435  objLink = iplink_t(*ipc, obj->index());
436  } else {
437  objLink = iplink_t(collectionSgKey, obj->index());
438  }
439  uniqueLinks.push_back( objLink );
440  uniqueWeights.push_back( 1. );
441  }
442  }
443  ATH_MSG_DEBUG("Built met term " << met->name() << ", with magnitude " << met->met());
444  return StatusCode::SUCCESS;
445  }
446 
447  StatusCode METMaker::rebuildJetMET(const std::string& metJetKey,
448  const std::string& softKey,
449  xAOD::MissingETContainer* metCont,
450  const xAOD::JetContainer* jets,
451  const xAOD::MissingETContainer* metCoreCont,
453  bool doJetJVT)
454  {
455  ATH_MSG_VERBOSE("Rebuild jet term: " << metJetKey << " and soft term: " << softKey);
456 
457  MissingET* metJet = nullptr;
458  if( fillMET(metJet,metCont, metJetKey, MissingETBase::Source::jet()) != StatusCode::SUCCESS) {
459  ATH_MSG_ERROR("failed to fill MET term \"" << metJetKey << "\"");
460  return StatusCode::FAILURE;
461  }
462 
463  const MissingET *coreSoftClus(nullptr), *coreSoftTrk(nullptr);
464  MissingET *metSoftClus(nullptr), *metSoftTrk(nullptr);
465 
466  const MissingET* coreSoft = (*metCoreCont)[softKey+"Core"];
467  if(!coreSoft) {
468  ATH_MSG_WARNING("Invalid soft term key supplied: " << softKey);
469  return StatusCode::FAILURE;
470  }
471  if(MissingETBase::Source::isTrackTerm(coreSoft->source())) {
472  coreSoftTrk = coreSoft;
473 
474  metSoftTrk = nullptr;
475  if( fillMET(metSoftTrk,metCont, softKey , coreSoftTrk->source() ) != StatusCode::SUCCESS) {
476  ATH_MSG_ERROR("failed to fill MET term \"" << softKey << "\"");
477  return StatusCode::FAILURE;
478  }
479  } else {
480  coreSoftClus = coreSoft;
481 
482  metSoftClus = nullptr;
483  if( fillMET(metSoftClus, metCont, softKey , coreSoftClus->source() ) != StatusCode::SUCCESS) {
484  ATH_MSG_ERROR("failed to fill MET term \"" << softKey << "\"");
485  return StatusCode::FAILURE;
486  }
487  }
488 
489  return rebuildJetMET(metJet, jets, helper,
490  metSoftClus, coreSoftClus,
491  metSoftTrk, coreSoftTrk,
492  doJetJVT);
493  }
494 
495  StatusCode METMaker::rebuildTrackMET(const std::string& metJetKey,
496  const std::string& softKey,
497  xAOD::MissingETContainer* metCont,
498  const xAOD::JetContainer* jets,
499  const xAOD::MissingETContainer* metCoreCont,
501  bool doJetJVT)
502  {
503  ATH_MSG_VERBOSE("Rebuild jet term: " << metJetKey << " and soft term: " << softKey);
504 
505  MissingET* metJet = nullptr;
506  if( fillMET(metJet , metCont, metJetKey , MissingETBase::Source::jet() | MissingETBase::Source::track() ) != StatusCode::SUCCESS) {
507  ATH_MSG_ERROR("failed to fill MET term \"" << metJetKey << "\"");
508  return StatusCode::FAILURE;
509  }
510 
511  const MissingET *coreSoftTrk(nullptr);
512  MissingET *metSoftTrk(nullptr);
513 
514  const MissingET* coreSoft = (*metCoreCont)[softKey+"Core"];
515  if(!coreSoft) {
516  ATH_MSG_WARNING("Invalid soft term key supplied: " << softKey);
517  return StatusCode::FAILURE;
518  }
519  coreSoftTrk = coreSoft;
520 
521  metSoftTrk = nullptr;
522  if( fillMET(metSoftTrk , metCont, softKey , coreSoftTrk->source()) != StatusCode::SUCCESS) {
523  ATH_MSG_ERROR("failed to fill MET term \"" << softKey << "\"");
524  return StatusCode::FAILURE;
525  }
526 
527  return rebuildTrackMET(metJet, jets, helper,
528  metSoftTrk, coreSoftTrk,
529  doJetJVT);
530  }
531 
532  StatusCode METMaker::rebuildJetMET(const std::string& metJetKey,
533  const std::string& softClusKey,
534  const std::string& softTrkKey,
535  xAOD::MissingETContainer* metCont,
536  const xAOD::JetContainer* jets,
537  const xAOD::MissingETContainer* metCoreCont,
539  bool doJetJVT)
540  {
541 
542  ATH_MSG_VERBOSE("Create Jet MET " << metJetKey);
543  MissingET* metJet = nullptr;
544  if( fillMET(metJet , metCont ,metJetKey , MissingETBase::Source::jet()) != StatusCode::SUCCESS) {
545  ATH_MSG_ERROR("failed to fill MET term \"" << metJetKey << "\"");
546  return StatusCode::FAILURE;
547  }
548  ATH_MSG_VERBOSE("Create SoftClus MET " << softClusKey);
549  const MissingET* coreSoftClus = (*metCoreCont)[softClusKey+"Core"];
550  ATH_MSG_VERBOSE("Create SoftTrk MET " << softTrkKey);
551  const MissingET* coreSoftTrk = (*metCoreCont)[softTrkKey+"Core"];
552  if(!coreSoftClus) {
553  ATH_MSG_WARNING("Invalid cluster soft term key supplied: " << softClusKey);
554  return StatusCode::FAILURE;
555  }
556  if(!coreSoftTrk) {
557  ATH_MSG_WARNING("Invalid track soft term key supplied: " << softTrkKey);
558  return StatusCode::FAILURE;
559  }
560  MissingET* metSoftClus = nullptr;
561  if( fillMET(metSoftClus, metCont, softClusKey, coreSoftClus->source()) != StatusCode::SUCCESS) {
562  ATH_MSG_ERROR("failed to fill MET term \"" << softClusKey << "\"");
563  return StatusCode::FAILURE;
564  }
565 
566  MissingET* metSoftTrk = nullptr;
567  if( fillMET(metSoftTrk, metCont, softTrkKey, coreSoftTrk->source()) != StatusCode::SUCCESS) {
568  ATH_MSG_ERROR("failed to fill MET term \"" << softTrkKey << "\"");
569  return StatusCode::FAILURE;
570  }
571 
572  return rebuildJetMET(metJet, jets, helper,
573  metSoftClus, coreSoftClus,
574  metSoftTrk, coreSoftTrk,
575  doJetJVT);
576  }
577 
579  const xAOD::JetContainer* jets,
581  xAOD::MissingET* metSoftClus,
582  const xAOD::MissingET* coreSoftClus,
583  xAOD::MissingET* metSoftTrk,
584  const xAOD::MissingET* coreSoftTrk,
585  bool doJetJVT,
586  bool tracksForHardJets,
587  std::vector<const xAOD::IParticle*>* softConst) {
588  if(!metJet || !jets) {
589  ATH_MSG_ERROR("Invalid pointer supplied for "
590  << "MET (" << metJet << ") or "
591  << "jet collection (" << jets << ").");
592  return StatusCode::FAILURE;
593  }
594  const xAOD::MissingETAssociationMap* map = helper.map();
595  if(!map){
596  ATH_MSG_ERROR("MET Association Helper isn't associated with a MissingETAssociationMap!");
597  return StatusCode::FAILURE;
598  }
599  if(softConst && m_trkseltool.empty() && !m_doPFlow && !m_doSoftTruth) {
600  ATH_MSG_WARNING( "Requested soft track element links, but no track selection tool supplied.");
601  }
602  const xAOD::Vertex *pv = softConst?getPV():nullptr;
603 
604  if(map->empty()) {
605  ATH_MSG_WARNING("Incomplete association map received. Cannot rebuild MET.");
606  ATH_MSG_WARNING("Note: METMaker should only be run on events containing at least one PV");
607  return StatusCode::SUCCESS;
608  }
609 
610  if(doJetJVT && m_JvtWP == "None"){
611  ATH_MSG_WARNING("rebuildJetMET requested JVT, which is inconsistent with jet selection " << m_jetSelection << ". Ignoring JVT.");
612  doJetJVT = false;
613  }
614 
615  ATH_MSG_VERBOSE("Building MET jet term " << metJet->name());
616  if(!metSoftClus && !metSoftTrk) {
617  ATH_MSG_WARNING("Neither soft cluster nor soft track term has been supplied!");
618  return StatusCode::SUCCESS;
619  }
620  static const SG::AuxElement::ConstAccessor<std::vector<ElementLink<IParticleContainer> > > acc_softConst("softConstituents");
621  if(metSoftClus) {
622  dec_constitObjLinks(*metSoftClus) = std::vector<iplink_t>(0);
623  if(!coreSoftClus) {
624  ATH_MSG_ERROR("Soft cluster term provided without a core term!");
625  return StatusCode::FAILURE;
626  }
627  ATH_MSG_VERBOSE("Building MET soft cluster term " << metSoftClus->name());
628  ATH_MSG_VERBOSE("Core soft cluster mpx " << coreSoftClus->mpx()
629  << ", mpy " << coreSoftClus->mpy()
630  << " sumet " << coreSoftClus->sumet());
631  *metSoftClus += *coreSoftClus;
632  // Fill a vector with the soft constituents, if one was provided.
633  // For now, only setting up to work with those corresponding to the jet constituents.
634  // Can expand if needed.
635  if(softConst && acc_softConst.isAvailable(*coreSoftClus)) {
636  for(const auto& constit : acc_softConst(*coreSoftClus)) {
637  softConst->push_back(*constit);
638  }
639  ATH_MSG_DEBUG(softConst->size() << " soft constituents from core term");
640  }
641  }
642  if(metSoftTrk) {
643  dec_constitObjLinks(*metSoftTrk) = std::vector<iplink_t>(0);
644  if(!coreSoftTrk) {
645  ATH_MSG_ERROR("Soft track term provided without a core term!");
646  return StatusCode::FAILURE;
647  }
648  ATH_MSG_VERBOSE("Building MET soft track term " << metSoftTrk->name());
649  ATH_MSG_VERBOSE("Core soft track mpx " << coreSoftTrk->mpx()
650  << ", mpy " << coreSoftTrk->mpy()
651  << " sumet " << coreSoftTrk->sumet());
652  *metSoftTrk += *coreSoftTrk;
653  if(softConst && acc_softConst.isAvailable(*coreSoftTrk) && !m_doPFlow && !m_doSoftTruth) {
654  for(const auto& constit : acc_softConst(*coreSoftTrk)) {
655  softConst->push_back(*constit);
656  }
657  ATH_MSG_DEBUG(softConst->size() << " soft constituents from trk core term");
658  }
659  }
660 
661  dec_constitObjLinks(*metJet) = std::vector<iplink_t>(0);
662  dec_constitObjWeights(*metJet) = std::vector<float>(0);
663  std::vector<iplink_t>& uniqueLinks = dec_constitObjLinks(*metJet);
664  std::vector<float>& uniqueWeights = dec_constitObjWeights(*metJet);
665  uniqueLinks.reserve(jets->size());
666  uniqueWeights.reserve(jets->size());
667  std::vector<iplink_t> softJetLinks;
668  std::vector<float> softJetWeights;
669  bool originalInputs = jets->empty() ? false : !acc_originalObject.isAvailable(*jets->front());
670 
671  // Get the hashed key of this jet, if we can. Though his only works if
672  // 1. the container is an owning container, and not just a view;
673  // 2. the container is in the event store already.
674  // Since we will be creating ElementLink-s to these jets later on in the
675  // code, and it should work in AnalysisBase, only the first one of these
676  // is checked. Since the code can not work otherwise.
677  SG::sgkey_t jetsSgKey = 0;
678  if(jets->ownPolicy() == SG::OWN_ELEMENTS) {
679  jetsSgKey = getKey(jets);
680  if(jetsSgKey == 0) {
681  ATH_MSG_ERROR("Could not find the jets with pointer: " << jets);
682  return StatusCode::FAILURE;
683  }
684  }
685 
686  for(const xAOD::Jet* jet : *jets) {
687  const MissingETAssociation* assoc = nullptr;
688  if(originalInputs) {
690  } else {
691  const IParticle* orig = *acc_originalObject(*jet);
692  assoc = MissingETComposition::getAssociation(map,static_cast<const xAOD::Jet*>(orig));
693  }
694  if(!assoc || assoc->isMisc()){
695  ATH_MSG_WARNING( "Jet without association found!" );
696  continue;
697  }
698 
700  // retrieve nominal calibrated jet
701  if (acc_nominalObject.isAvailable(*jet)){
702  ATH_MSG_VERBOSE( "Jet pt before nominal replacement = " << jet->pt());
703  jet = static_cast<const xAOD::Jet*>(*acc_nominalObject(*jet));
704 
705  }
706  else
707  ATH_MSG_ERROR("No nominal calibrated jet available for jet " << jet->index() << ". Cannot simplify overlap removal!");
708  }
709  ATH_MSG_VERBOSE( "Jet pt = " << jet->pt());
710 
711  bool selected = (std::abs(jet->eta())<m_JetEtaForw && jet->pt()>m_CenJetPtCut) || (std::abs(jet->eta())>=m_JetEtaForw && jet->pt()>m_FwdJetPtCut );
712  bool JVT_reject(false);
713  bool isMuFSRJet(false);
714 
715  // Apply a cut on the maximum jet eta. This restricts jets to those with calibration. Excluding more forward jets was found to have a minimal impact on the MET in Zee events
716  if (m_JetEtaMax > 0.0 && std::abs(jet->eta()) > m_JetEtaMax)
717  JVT_reject = true;
718 
719  if(doJetJVT) {
720  // intrinsically checks that is within range to apply Jvt requirement
721  JVT_reject = !bool(m_JvtTool->accept(jet));
722  ATH_MSG_VERBOSE("Jet " << (JVT_reject ? "fails" : "passes") <<" JVT selection");
723  }
724 
725  // if defined apply additional jet criterium
726  if (m_acc_jetRejectionDec && (*m_acc_jetRejectionDec)(*jet)==0) JVT_reject = true;
727  bool hardJet(false);
729  bool caloverlap = false;
730  caloverlap = calvec.ce()>0;
731  ATH_MSG_DEBUG("Jet " << jet->index() << " is " << ( caloverlap ? "" : "non-") << "overlapping");
732 
733  if(m_veryGreedyPhotons && caloverlap) {
734  for(const auto& object : assoc->objects()) {
735  // Correctly handle this jet if we're using very greedy photons
736  if (object && object->type() == xAOD::Type::Photon) hardJet = true;
737  }
738  }
739 
740  xAOD::JetFourMom_t constjet;
741  double constSF(1);
742  if(m_jetConstitScaleMom.empty() && assoc->hasAlternateConstVec()){
743  constjet = assoc->getAlternateConstVec();
744  } else {
745  constjet = jet->jetP4(m_jetConstitScaleMom);//grab a constituent scale added by the JetMomentTool/JetConstitFourMomTool.cxx
746  double denom = (assoc->hasAlternateConstVec() ? assoc->getAlternateConstVec() : jet->jetP4("JetConstitScaleMomentum")).E();
747  constSF = denom>1e-9 ? constjet.E()/denom : 0.;
748  ATH_MSG_VERBOSE("Scale const jet by factor " << constSF);
749  calvec *= constSF;
750  }
751  double jpx = constjet.Px();
752  double jpy = constjet.Py();
753  double jpt = constjet.Pt();
754  double opx = jpx - calvec.cpx();
755  double opy = jpy - calvec.cpy();
756 
757  MissingET* met_muonEloss(nullptr);
759  // Get a term to hold the Eloss corrections
760  MissingETContainer* metCont = static_cast<MissingETContainer*>(metJet->container());
761  met_muonEloss = (*metCont)["MuonEloss"];
762  if(!met_muonEloss) {
763  ATH_MSG_WARNING("Attempted to apply muon Eloss correction, but corresponding MET term does not exist!");
764  return StatusCode::FAILURE;
765  }
766  }
767 
768  float total_eloss(0);
769  MissingETBase::Types::bitmask_t muons_selflags(0);
770  std::vector<const xAOD::Muon*> muons_in_jet;
771  std::vector<const xAOD::Electron*> electrons_in_jet;
772  bool passJetForEl=false;
773  if(m_useGhostMuons) { // for backwards-compatibility
774  if(!acc_ghostMuons.isAvailable(*jet)){
775  ATH_MSG_ERROR("Ghost muons requested but not found!");
776  return StatusCode::FAILURE;
777  }
778  for(const auto& el : acc_ghostMuons(*jet)) {
779  if(!el.isValid()){
780  ATH_MSG_ERROR("Invalid element link to ghost muon! Quitting.");
781  return StatusCode::FAILURE;
782  }
783  muons_in_jet.push_back(static_cast<const xAOD::Muon*>(*el));
784  }
785  }
786  for(const auto& obj : assoc->objects()) {
787  if(!obj) continue;
788  if(obj->type()==xAOD::Type::Muon && !m_useGhostMuons) {
789  const xAOD::Muon* mu_test(static_cast<const xAOD::Muon*>(obj));
790  ATH_MSG_VERBOSE("Muon " << mu_test->index() << " found in jet " << jet->index());
792  if(acc_originalObject.isAvailable(*mu_test)) mu_test = static_cast<const xAOD::Muon*>(*acc_originalObject(*mu_test));
793  if(MissingETComposition::objSelected(helper,mu_test)) { //
794  muons_in_jet.push_back(mu_test);
795  ATH_MSG_VERBOSE("Muon is selected by MET.");
796  }
797  }
798  } else if(obj->type()==xAOD::Type::Electron && m_doRemoveElecTrks) {
799  const xAOD::Electron* el_test(static_cast<const xAOD::Electron*>(obj));
800  ATH_MSG_VERBOSE("Electron " << el_test->index() << " found in jet " << jet->index());
801  if(acc_originalObject.isAvailable(*el_test)) el_test = static_cast<const xAOD::Electron*>(*acc_originalObject(*el_test));
802  if(helper.objSelected(assoc,el_test)){
803  if(el_test->pt()>90.0e3) { // only worry about high-pt electrons?
804  electrons_in_jet.push_back(el_test);
805  ATH_MSG_VERBOSE("High-pt electron is selected by MET.");
806  }
807  }
808  }
809  }
810  if(m_doRemoveElecTrks) {
811  MissingETBase::Types::constvec_t initialTrkMom = assoc->jetTrkVec();
812  float jet_ORtrk_sumpt = assoc->overlapTrkVec(helper).sumpt();
813  float jet_all_trk_pt = initialTrkMom.sumpt();
814  float jet_unique_trk_pt = jet_all_trk_pt - jet_ORtrk_sumpt;
817  for(const auto& elec : electrons_in_jet) {
818  el_calvec += assoc->calVec(elec);
819  el_trkvec += assoc->trkVec(elec);
820  }
821  float el_cal_pt = el_calvec.cpt();
822  float el_trk_pt = el_trkvec.cpt();
823  ATH_MSG_VERBOSE("Elec trk: " << el_trk_pt
824  << " jetalltrk: " << jet_all_trk_pt
825  << " jetORtrk: " << jet_ORtrk_sumpt
826  << " electrk-jetORtrk: " << (el_trk_pt-jet_ORtrk_sumpt)
827  << " elec cal: " << el_cal_pt
828  << " jetalltrk-electrk: " << (jet_all_trk_pt-el_trk_pt)
829  << " jetalltrk-jetORtrk: " << (jet_all_trk_pt-jet_ORtrk_sumpt) );
830  // Want to use the jet calo measurement if we had at least one electron
831  // and the jet has a lot of residual track pt
832  // Is the cut appropriate?
833  if(el_trk_pt>1e-9 && jet_unique_trk_pt>10.0e3) passJetForEl=true;
834  } // end ele-track removal
835 
836  for(const xAOD::Muon* mu_in_jet : muons_in_jet) {
837  if (!mu_in_jet) continue;
838  float mu_Eloss = acc_Eloss(*mu_in_jet);
839 
840  if(!JVT_reject) {
841  if (m_doRemoveMuonJets) {
842  // need to investigate how this is affected by the recording of muon clusters in the map
843  float mu_id_pt = mu_in_jet->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) ? mu_in_jet->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt() : 0.;
844  float jet_trk_sumpt = acc_trksumpt.isAvailable(*jet) && this->getPV() ? acc_trksumpt(*jet)[this->getPV()->index()] : 0.;
845 
846  // missed the muon, so we should add it back
847  if(0.9999*mu_id_pt>jet_trk_sumpt)
848  jet_trk_sumpt+=mu_id_pt;
849  float jet_trk_N = acc_trkN.isAvailable(*jet) && this->getPV() ? acc_trkN(*jet)[this->getPV()->index()] : 0.;
850  ATH_MSG_VERBOSE("Muon has ID pt " << mu_id_pt);
851  ATH_MSG_VERBOSE("Jet has pt " << jet->pt() << ", trk sumpt " << jet_trk_sumpt << ", trk N " << jet_trk_N);
852  bool jet_from_muon = mu_id_pt>1e-9 && jet_trk_sumpt>1e-9 && (jet->pt()/mu_id_pt < m_muIDPTJetPtRatioMuOlap && mu_id_pt/jet_trk_sumpt>m_jetTrkPtMuPt) && jet_trk_N<m_jetTrkNMuOlap;
853  if(jet_from_muon) {
854  ATH_MSG_VERBOSE("Jet is from muon -- remove.");
855  JVT_reject = true;
856  }
857  }
858 
859  if (m_doSetMuonJetEMScale) {
860  // need to investigate how this is affected by the recording of muon clusters in the map
861  float mu_id_pt = mu_in_jet->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) ? mu_in_jet->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt() : 0.;
862  float jet_trk_sumpt = acc_trksumpt.isAvailable(*jet) && this->getPV() ? acc_trksumpt(*jet)[this->getPV()->index()] : 0.;
863  // missed the muon, so we should add it back
864  if(0.9999*mu_id_pt>jet_trk_sumpt)
865  jet_trk_sumpt+=mu_id_pt;
866  float jet_trk_N = acc_trkN.isAvailable(*jet) && this->getPV() ? acc_trkN(*jet)[this->getPV()->index()] : 0.;
867 
868  float jet_psE = 0.;
869  if (acc_psf.isAvailable(*jet)){
870  jet_psE = acc_psf(*jet);
871  } else if (acc_sampleE.isAvailable(*jet)){
872  jet_psE = acc_sampleE(*jet)[0] + acc_sampleE(*jet)[4];
873  } else {
874  ATH_MSG_ERROR("Jet PS fraction or sampling energy must be available to calculate MET with doSetMuonJetEMScale");
875  return StatusCode::FAILURE;
876  }
877 
878  bool jet_from_muon = jet_trk_sumpt>1e-9 && jet_trk_N<3 && mu_id_pt / jet_trk_sumpt > m_jetTrkPtMuPt && acc_emf(*jet)>m_jetEmfMuOlap && acc_width(*jet)<m_jetWidthMuOlap && jet_psE>m_jetPsEMuOlap;
879  ATH_MSG_VERBOSE("Muon has ID pt " << mu_id_pt);
880  ATH_MSG_VERBOSE("Jet has trk sumpt " << jet_trk_sumpt << ", trk N " << jet_trk_N << ", PS E " << jet_psE << ", width " << acc_width(*jet) << ", emfrac " << acc_emf(*jet));
881 
882  if(jet_from_muon) {
883  ATH_MSG_VERBOSE("Jet is from muon -- set to EM scale and subtract Eloss.");
884  // Using constjet now because we focus on AntiKt4EMTopo.
885  // Probably not a massive difference to LC, but PF needs some consideration
886  ATH_MSG_VERBOSE("Jet e: " << constjet.E() << ", mu Eloss: " << mu_Eloss);
887  float elosscorr = mu_Eloss >= constjet.e() ? 0. : 1.-mu_Eloss/constjet.e();
888  // Effectively, take the unique fraction of the jet times the eloss-corrected fraction
889  // This might in some cases oversubtract, but should err on the side of undercounting the jet contribution
890  opx *= elosscorr;
891  opy *= elosscorr;
892  ATH_MSG_VERBOSE(" Jet eloss factor " << elosscorr << ", final pt: " << sqrt(opx*opx+opy*opy));
893  // Don't treat this jet normally. Instead, just add to the Eloss term
894  isMuFSRJet = true;
895  }
896  }
897  } // end muon-jet overlap-removal
898 
899  switch(mu_in_jet->energyLossType()) {
900  case xAOD::Muon::Parametrized:
901  case xAOD::Muon::MOP:
902  case xAOD::Muon::Tail:
903  case xAOD::Muon::FSRcandidate:
904  case xAOD::Muon::NotIsolated:
905  // For now don't differentiate the behaviour
906  // Remove the Eloss assuming the parameterised value
907  // The correction is limited to the selected clusters
908  total_eloss += mu_Eloss;
909  muons_selflags |= (1<<assoc->findIndex(mu_in_jet));
910  }
911  }
912  ATH_MSG_VERBOSE("Muon selection flags: " << muons_selflags);
913  ATH_MSG_VERBOSE("Muon total eloss: " << total_eloss);
914 
916  // borrowed from overlapCalVec
917  for(size_t iKey = 0; iKey < assoc->sizeCal(); iKey++) {
918  bool selector = (muons_selflags & assoc->calkey()[iKey]);
919  if(selector) mu_calovec += assoc->calVec(iKey);
920  ATH_MSG_VERBOSE("This key: " << assoc->calkey()[iKey] << ", selector: " << selector);
921  }
922  ATH_MSG_VERBOSE("Mu calovec pt, no Eloss: " << mu_calovec.cpt());
923  if(m_muEloss) mu_calovec *= std::max<float>(0.,1-(total_eloss/mu_calovec.ce()));
924  ATH_MSG_VERBOSE("Mu calovec pt, with Eloss: " << mu_calovec.cpt());
925 
926  // re-add calo components of muons beyond Eloss correction
927  ATH_MSG_VERBOSE("Jet " << jet->index() << " const pT before OR " << jpt);
928  ATH_MSG_VERBOSE("Jet " << jet->index() << " const pT after OR " << sqrt(opx*opx+opy*opy));
929  opx += mu_calovec.cpx();
930  opy += mu_calovec.cpy();
931  double opt = sqrt( opx*opx+opy*opy );
932  ATH_MSG_VERBOSE("Jet " << jet->index() << " const pT diff after OR readding muon clusters " << opt-jpt);
933  double uniquefrac = 1. - (calvec.ce() - mu_calovec.ce()) / constjet.E();
934  ATH_MSG_VERBOSE( "Jet constscale px, py, pt, E = " << jpx << ", " << jpy << ", " << jpt << ", " << constjet.E() );
935  ATH_MSG_VERBOSE( "Jet overlap E = " << calvec.ce() - mu_calovec.ce() );
936  ATH_MSG_VERBOSE( "Jet OR px, py, pt, E = " << opx << ", " << opy << ", " << opt << ", " << constjet.E() - calvec.ce() );
937 
938  if(isMuFSRJet) {
939  if(!met_muonEloss){
940  ATH_MSG_ERROR("Attempted to apply muon Eloss correction, but corresponding MET term does not exist!");
941  return StatusCode::FAILURE;
942  }
943  met_muonEloss->add(opx,opy,opt);
944  continue;
945  }
946 
947  if(selected && !JVT_reject) {
948  if(!caloverlap) {
949  // add jet full four-vector
950  hardJet = true;
951  if (!tracksForHardJets) {
952  if(m_doConstJet)
953  metJet->add(jpx,jpy,jpt);
954  else
955  *metJet += jet;
956  }
957  }
958  else if((uniquefrac>m_jetMinEfrac || passJetForEl) && opt>m_jetMinWeightedPt){
959  // add jet corrected for overlaps if sufficient unique fraction
960  hardJet = true;
961  if(!tracksForHardJets) {
962  if(m_jetCorrectPhi) {
963  if (m_doConstJet)
964  metJet->add(opx,opy,opt);
965  else {
966  double jesF = jet->pt() / jpt;
967  metJet->add(opx*jesF,opy*jesF,opt*jesF);
968  }
969  } else {
970  if (m_doConstJet)
971  metJet->add(uniquefrac*jpx,uniquefrac*jpy,uniquefrac*jpt);
972  else{
973  if(passJetForEl && m_doRemoveElecTrksEM)
974  metJet->add(opx,opy,opt);
975  else
976  metJet->add(uniquefrac*jet->px(),uniquefrac*jet->py(),uniquefrac*jet->pt());
977  }
978  }
979  }
980  }
981  } // hard jet selection
982 
983  // Create the appropriate ElementLink for this jet just the once.
984  iplink_t jetLink;
985  if(jetsSgKey == 0) {
986  const xAOD::IParticleContainer* ipc =
987  static_cast<const xAOD::IParticleContainer*>(jet->container());
988  jetLink = iplink_t(*ipc, jet->index());
989  } else {
990  jetLink = iplink_t(jetsSgKey, jet->index());
991  }
992 
993  if(hardJet){
994  ATH_MSG_VERBOSE("Jet added at full scale");
995  uniqueLinks.push_back( jetLink );
996  uniqueWeights.push_back( uniquefrac );
997  } else {
998  if(metSoftClus && !JVT_reject) {
999  // add fractional contribution
1000  ATH_MSG_VERBOSE("Jet added at const scale");
1001  if (std::abs(jet->eta())<2.5 || !(coreSoftClus->source()&MissingETBase::Source::Region::Central)) {
1002  softJetLinks.push_back( jetLink );
1003  softJetWeights.push_back( uniquefrac );
1004  metSoftClus->add(opx,opy,opt);
1005  }
1006 
1007  // Fill a vector with the soft constituents, if one was provided.
1008  // For now, only setting up to work with those corresponding to the jet constituents.
1009  // Can expand if needed.
1010  // This ignores overlap removal.
1011  //
1012  if(softConst) {
1013  for(size_t iConst=0; iConst<jet->numConstituents(); ++iConst) {
1014  const IParticle* constit = jet->rawConstituent(iConst);
1015  softConst->push_back(constit);
1016  }
1017  }
1018  }
1019  } // hard jet or CST
1020 
1021  if(!metSoftTrk || (hardJet && !tracksForHardJets)) continue;
1022 
1023  // use jet tracks
1024  // remove any tracks already used by other objects
1026  MissingETBase::Types::constvec_t jettrkvec = assoc->jetTrkVec();
1027  if(jettrkvec.ce()>1e-9) {
1028  jpx = jettrkvec.cpx();
1029  jpy = jettrkvec.cpy();
1030  jpt = jettrkvec.sumpt();
1031  jettrkvec -= trkvec;
1032  opx = jettrkvec.cpx();
1033  opy = jettrkvec.cpy();
1034  opt = jettrkvec.sumpt();
1035  ATH_MSG_VERBOSE( "Jet track px, py, sumpt = " << jpx << ", " << jpy << ", " << jpt );
1036  ATH_MSG_VERBOSE( "Jet OR px, py, sumpt = " << opx << ", " << opy << ", " << opt );
1037  } else {
1038  opx = opy = opt = 0;
1039  ATH_MSG_VERBOSE( "This jet has no associated tracks" );
1040  }
1041  if (hardJet) metJet->add(opx,opy,opt);
1042  else if (std::abs(jet->eta())<2.5 || !(coreSoftTrk->source()&MissingETBase::Source::Region::Central)) {
1043  metSoftTrk->add(opx,opy,opt);
1044  // Don't need to add if already done for softclus.
1045  if(!metSoftClus) {
1046  softJetLinks.push_back( jetLink );
1047  softJetWeights.push_back( uniquefrac );
1048  }
1049 
1050  // Fill a vector with the soft constituents, if one was provided.
1051  // For now, only setting up to work with those corresponding to the jet constituents.
1052  // Can expand if needed.
1053  // This ignores overlap removal.
1054  //
1055  if(softConst && !m_doPFlow && !m_doSoftTruth) {
1056  std::vector<const IParticle*> jettracks;
1057  jet->getAssociatedObjects<IParticle>(xAOD::JetAttribute::GhostTrack,jettracks);
1058  for(size_t iConst=0; iConst<jettracks.size(); ++iConst) {
1059  const TrackParticle* pTrk = static_cast<const TrackParticle*>(jettracks[iConst]);
1060  if (acceptTrack(pTrk,pv)) softConst->push_back(pTrk);
1061  }
1062  }
1063  }
1064  } // jet loop
1065 
1066  ATH_MSG_DEBUG("Number of selected jets: " << dec_constitObjLinks(*metJet).size());
1067 
1068  if(metSoftTrk) {
1069  dec_constitObjLinks(*metSoftTrk) = softJetLinks;
1070  ATH_MSG_DEBUG("Number of softtrk jets: " << dec_constitObjLinks(*metSoftTrk).size());
1071  }
1072 
1073  if(metSoftClus) {
1074  dec_constitObjLinks(*metSoftClus) = softJetLinks;
1075  ATH_MSG_DEBUG("Number of softclus jets: " << dec_constitObjLinks(*metSoftClus).size());
1076  }
1077 
1078  if(softConst) ATH_MSG_DEBUG(softConst->size() << " soft constituents from core term + jets");
1079 
1080  const MissingETAssociation* assoc = map->getMiscAssociation();
1081  if(!assoc) return StatusCode::SUCCESS;
1082 
1083  if(metSoftTrk) {
1084  // supplement track term with any tracks associated to isolated muons
1085  // these are recorded in the misc association
1087  double opx = trkvec.cpx();
1088  double opy = trkvec.cpy();
1089  double osumpt = trkvec.sumpt();
1090  ATH_MSG_VERBOSE( "Misc track px, py, sumpt = " << opx << ", " << opy << ", " << osumpt );
1091  metSoftTrk->add(opx,opy,osumpt);
1092  ATH_MSG_VERBOSE("Final soft track mpx " << metSoftTrk->mpx()
1093  << ", mpy " << metSoftTrk->mpy()
1094  << " sumet " << metSoftTrk->sumet());
1095  }
1096 
1097  if(metSoftClus) {
1098  // supplement cluster term with any clusters associated to isolated e/gamma
1099  // these are recorded in the misc association
1100  float total_eloss(0.);
1101  MissingETBase::Types::bitmask_t muons_selflags(0);
1103  double opx = calvec.cpx();
1104  double opy = calvec.cpy();
1105  double osumpt = calvec.sumpt();
1106  for(const auto& obj : assoc->objects()) {
1107  if (!obj || obj->type() != xAOD::Type::Muon) continue;
1108  const xAOD::Muon* mu_test(static_cast<const xAOD::Muon*>(obj));
1109  if(acc_originalObject.isAvailable(*mu_test)) mu_test = static_cast<const xAOD::Muon*>(*acc_originalObject(*mu_test));
1110  if(MissingETComposition::objSelected(helper,mu_test)) { //
1111  float mu_Eloss = acc_Eloss(*mu_test);
1112  switch(mu_test->energyLossType()) {
1113  case xAOD::Muon::Parametrized:
1114  case xAOD::Muon::MOP:
1115  case xAOD::Muon::Tail:
1116  case xAOD::Muon::FSRcandidate:
1117  case xAOD::Muon::NotIsolated:
1118  // For now don't differentiate the behaviour
1119  // Remove the Eloss assuming the parameterised value
1120  // The correction is limited to the selected clusters
1121  total_eloss += mu_Eloss;
1122  muons_selflags |= (1<<assoc->findIndex(mu_test));
1123  }
1124  ATH_MSG_VERBOSE("Mu index " << mu_test->index());
1125  }
1126  }
1127  ATH_MSG_VERBOSE("Mu selection flags " << muons_selflags);
1128  ATH_MSG_VERBOSE("Mu total eloss " << total_eloss);
1129 
1131  // borrowed from overlapCalVec
1132  for(size_t iKey = 0; iKey < assoc->sizeCal(); iKey++) {
1133  bool selector = (muons_selflags & assoc->calkey()[iKey]);
1134  ATH_MSG_VERBOSE("This key: " << assoc->calkey()[iKey] << ", selector: " << selector
1135  << " this calvec E: " << assoc->calVec(iKey).ce());
1136  if(selector) mu_calovec += assoc->calVec(iKey);
1137  }
1138  if(m_muEloss){
1139  mu_calovec *= std::max<float>(0.,1-(total_eloss/mu_calovec.ce()));
1140  opx += mu_calovec.cpx();
1141  opy += mu_calovec.cpy();
1142  osumpt += mu_calovec.sumpt();
1143  }
1144  ATH_MSG_VERBOSE("Mu cluster sumpt " << mu_calovec.sumpt());
1145 
1146  ATH_MSG_VERBOSE( "Misc cluster px, py, sumpt = " << opx << ", " << opy << ", " << osumpt );
1147  metSoftClus->add(opx,opy,osumpt);
1148  ATH_MSG_VERBOSE("Final soft cluster mpx " << metSoftClus->mpx()
1149  << ", mpy " << metSoftClus->mpy()
1150  << " sumet " << metSoftClus->sumet());
1151  }
1152 
1153  return StatusCode::SUCCESS;
1154  }
1155 
1157  const xAOD::JetContainer* jets,
1159  xAOD::MissingET* metSoftTrk,
1160  const xAOD::MissingET* coreSoftTrk,
1161  bool doJetJVT) {
1162  return rebuildJetMET(metJet,jets,helper,nullptr,nullptr,metSoftTrk,coreSoftTrk,doJetJVT,true);
1163  }
1164 
1165  // **** Remove objects and any overlaps from MET calculation ****
1168  xAOD::MissingETContainer* metCont)
1169  {
1170  MissingET* met = nullptr;
1171  if( fillMET(met,metCont, "Invisibles" , invisSource) != StatusCode::SUCCESS) {
1172  ATH_MSG_ERROR("failed to fill MET term \"Invisibles\"");
1173  return StatusCode::FAILURE;
1174  }
1176  }
1177 
1178  bool METMaker::acceptTrack(const xAOD::TrackParticle* trk, const xAOD::Vertex* vx) const
1179  {
1180  return static_cast<bool>(m_trkseltool->accept( *trk, vx ));
1181  }
1182 
1184 
1186 
1187  if(!h_PV.isValid()) {
1188  ATH_MSG_WARNING("Unable to retrieve primary vertex container PrimaryVertices");
1189  return nullptr;
1190  }
1191  ATH_MSG_DEBUG("Successfully retrieved primary vertex container");
1192  if(h_PV->empty()) ATH_MSG_WARNING("Event has no primary vertices!");
1193  for(const xAOD::Vertex* vx : *h_PV) {
1194  if(vx->vertexType()==xAOD::VxType::PriVtx) return vx;
1195  }
1196  return nullptr;
1197  }
1198 
1199 } //> end namespace met
ShallowCopy.h
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
met::METMaker::m_muEloss
bool m_muEloss
Definition: METMaker.h:186
met::METMaker::m_jetTrkNMuOlap
int m_jetTrkNMuOlap
Definition: METMaker.h:192
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
met::METMaker::m_skipSystematicJetSelection
bool m_skipSystematicJetSelection
Definition: METMaker.h:184
MissingETBase::Source::muon
static Types::bitmask_t muon(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed muons.
Definition: MissingETBase.h:250
met::METMaker::rebuildJetMET
virtual StatusCode rebuildJetMET(const std::string &metJetKey, const std::string &softClusKey, const std::string &softTrkKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT) override final
Definition: METMaker.cxx:532
xAOD::MissingETAuxContainer
MissingETAuxContainer_v1 MissingETAuxContainer
Definition: MissingETAuxContainer.h:16
MissingETBase::UsageHandler::PhysicsObject
@ PhysicsObject
Physics object based.
Definition: MissingETCompositionBase.h:187
met::METMaker::m_customFwdJetPtCut
double m_customFwdJetPtCut
Definition: METMaker.h:171
MissingETBase::UsageHandler::TruthParticle
@ TruthParticle
Truth particle based.
Definition: MissingETCompositionBase.h:189
xAOD::MissingETAssociation_v1::overlapCalVec
ConstVec overlapCalVec(const MissingETAssociationHelper &helper) const
Retrieve total cluster-based vector to be subtracted from the jet.
Definition: MissingETAssociation_v1.cxx:772
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
met::METMaker::rebuildTrackMET
virtual StatusCode rebuildTrackMET(const std::string &metJetKey, const std::string &softTrkKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT) override final
Definition: METMaker.cxx:495
met::METMaker::m_jetPsEMuOlap
double m_jetPsEMuOlap
Definition: METMaker.h:194
met::METMaker::m_JvtPtMax
double m_JvtPtMax
Definition: METMaker.h:163
met::METMaker::m_missObjWarningPtThreshold
float m_missObjWarningPtThreshold
Definition: METMaker.h:153
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
ObjectType
ObjectType
Definition: BaseObject.h:11
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
xAOD::MissingETAssociation_v1
MET association descriptor contains object links and corresponding parameters.
Definition: MissingETAssociation_v1.h:29
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
met::METMaker::m_doSetMuonJetEMScale
bool m_doSetMuonJetEMScale
Definition: METMaker.h:183
met::METMaker::m_doPFlow
bool m_doPFlow
Definition: METMaker.h:175
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::MissingETAssociation_v1::hasAlternateConstVec
bool hasAlternateConstVec() const
Definition: MissingETAssociation_v1.cxx:754
met::METMaker::m_jetConstitScaleMom
std::string m_jetConstitScaleMom
Definition: METMaker.h:158
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
MissingETBase::Source::electron
static Types::bitmask_t electron(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed electrons.
Definition: MissingETBase.h:229
met::METMaker::m_jetCorrectPhi
bool m_jetCorrectPhi
Definition: METMaker.h:155
met::METMaker::initialize
virtual StatusCode initialize() override final
Dummy implementation of the initialisation function.
Definition: METMaker.cxx:155
AuxContainerBase.h
met::METMaker::m_jetSelection
std::string m_jetSelection
Definition: METMaker.h:167
xAOD::MissingETComposition::objSelected
static bool objSelected(const MissingETAssociationHelper &helper, const IParticle *obj)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:375
JetAttributes.h
xAOD::ShallowAuxContainer
Class creating a shallow copy of an existing auxiliary container.
Definition: ShallowAuxContainer.h:54
MissingETBase::Source::track
static Types::bitmask_t track(Region reg=Region::FullAcceptance)
Bit mask for MET term from Track signal objects.
Definition: MissingETBase.h:291
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
met::METMaker::m_CenJetPtCut
double m_CenJetPtCut
Definition: METMaker.h:162
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition: xAOD/xAODBase/xAODBase/IParticleContainer.h:32
xAOD::MissingET
MissingET_v1 MissingET
Version control by type defintion.
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingET.h:15
xAOD::IParticle::type
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
met::METMaker::m_JetEtaForw
double m_JetEtaForw
Definition: METMaker.h:165
MissingETBase::Source::Region::Central
@ Central
Indicator for MET contribution from the central region.
MissingETComposition
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current MissingETComposition
Definition: RecTPCnv.cxx:86
xAOD::MissingETContainer
MissingETContainer_v1 MissingETContainer
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingETContainer.h:16
met::METMaker::m_jetEmfMuOlap
double m_jetEmfMuOlap
Definition: METMaker.h:195
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
met::METMaker::m_FwdJetPtCut
double m_FwdJetPtCut
Definition: METMaker.h:162
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
xAOD::MissingETAssociation
MissingETAssociation_v1 MissingETAssociation
Version control by type definition.
Definition: MissingETAssociation.h:15
MissingETBase::UsageHandler::OnlyCluster
@ OnlyCluster
CaloCluster based only.
Definition: MissingETCompositionBase.h:184
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MissingETBase::Source::isTrackTerm
static bool isTrackTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:404
met::METMaker::markInvisible
virtual StatusCode markInvisible(const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, xAOD::MissingETContainer *metCont) override final
Definition: METMaker.cxx:1166
met::METMaker::m_muIDPTJetPtRatioMuOlap
double m_muIDPTJetPtRatioMuOlap
Definition: METMaker.h:197
ReweightUtils.message
message
Definition: ReweightUtils.py:15
asg::AsgToolConfig::makePrivateTool
::StatusCode makePrivateTool(ToolHandle< T > &toolHandle) const
make a private tool with the given configuration
met::METMaker::m_customCenJetPtCut
double m_customCenJetPtCut
Definition: METMaker.h:171
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
xAOD::MissingETAssociation_v1::ConstVec
Vector sum of constituents for subtractive overlap removal.
Definition: MissingETAssociation_v1.h:36
MissingETBase::Source::Type::Muon
@ Muon
Indicator for the MET term from reconstructed or MC truth muons.
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
met::METMaker::~METMaker
virtual ~METMaker()
Destructor:
xAOD::Muon_v1::energyLossType
EnergyLossType energyLossType(void) const
Energy determined from parametrization or not (measured).
met::METMaker::m_doRemoveMuonJets
bool m_doRemoveMuonJets
Definition: METMaker.h:180
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::MissingETAssociation_v1::findIndex
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
Definition: MissingETAssociation_v1.cxx:268
met::METMaker::m_JetEtaMax
double m_JetEtaMax
Definition: METMaker.h:164
METHelpers.h
EgammaxAODHelpers.h
met
Definition: IMETSignificance.h:24
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::MissingETComposition::getConstVec
static MissingETBase::Types::constvec_t getConstVec(const MissingETAssociationMap *pMap, const IParticle *pPart, MissingETBase::UsageHandler::Policy p)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:361
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
asg::AsgTool::getKey
SG::sgkey_t getKey(const void *ptr) const
Get the (hashed) key of an object that is in the event store.
Definition: AsgTool.cxx:119
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
PFOAuxContainer.h
asg::AsgToolConfig
an object that can create a AsgTool
Definition: AsgToolConfig.h:22
ElectronContainer.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
met::METMaker::m_JvtWP
std::string m_JvtWP
Definition: METMaker.h:168
met::METMaker::m_doSoftTruth
bool m_doSoftTruth
Definition: METMaker.h:176
MissingETBase::Source::jet
static Types::bitmask_t jet(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed jets.
Definition: MissingETBase.h:257
met::METMaker::m_jetTrkPtMuPt
double m_jetTrkPtMuPt
Definition: METMaker.h:196
met::METMaker::m_customJvtPtMax
double m_customJvtPtMax
Definition: METMaker.h:172
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
met::METMaker::m_jetMinEfrac
double m_jetMinEfrac
Definition: METMaker.h:156
MissingETAuxContainer.h
xAOD::MissingETAssociation_v1::ConstVec::cpy
float cpy() const
Returns .
xAOD::MissingETAssociation_v1::ConstVec::sumpt
float sumpt() const
Returns sum of component pt.
AsgToolConfig.h
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:572
met::METMaker::m_useGhostMuons
bool m_useGhostMuons
Definition: METMaker.h:179
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
MissingETBase::Source::Category::Calo
@ Calo
Indicator for MET terms reconstructed from calorimeter signals alone.
met::METMaker::m_PVkey
SG::ReadHandleKey< xAOD::VertexContainer > m_PVkey
Definition: METMaker.h:147
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
xAOD::MissingET_v1::mpx
float mpx() const
Returns .
met::METMaker::m_customJvtWP
std::string m_customJvtWP
Definition: METMaker.h:173
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::MissingETAssociationMap_v1::getMiscAssociation
const MissingETAssociation_v1 * getMiscAssociation() const
Get an association for miscellaneous objects not associated to jets.
Definition: MissingETAssociationMap_v1.cxx:186
met::METMaker::m_doConstJet
bool m_doConstJet
Definition: METMaker.h:177
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
xAOD::MissingET_v1::name
const std::string & name() const
Identifier getters.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
met::METMaker::m_doRemoveElecTrksEM
bool m_doRemoveElecTrksEM
Definition: METMaker.h:182
compute_lumi.denom
denom
Definition: compute_lumi.py:76
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::MissingETAssociation_v1::calVec
ConstVec calVec(const IParticle *pPart) const
Get calo constituent vector for a given object.
Definition: MissingETAssociation_v1.cxx:540
xAOD::MissingETAssociation_v1::jetTrkVec
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
Definition: MissingETAssociation_v1.cxx:570
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
MissingETBase::UsageHandler::Policy
Policy
Policies on usage checks.
Definition: MissingETCompositionBase.h:182
xAOD::MissingET_v1::add
void add(const IParticle *particle)
Add particle kinematics to MET.
Definition: MissingET_v1.cxx:77
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
xAOD::MissingETAssociationMap
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
Definition: MissingETAssociationMap.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MissingETBase::Source::tau
static Types::bitmask_t tau(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed tau leptons.
Definition: MissingETBase.h:243
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ReadHandle.h
Handle class for reading from StoreGate.
MissingETBase::UsageHandler::OnlyTrack
@ OnlyTrack
Track based only.
Definition: MissingETCompositionBase.h:185
xAOD::MissingET_v1::source
MissingETBase::Types::bitmask_t source() const
MET object source tag.
xAOD::MissingETComposition::getAssociation
static const MissingETAssociation * getAssociation(const MissingETAssociationMap *pMap, const Jet *pJet)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:415
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
met::METMaker::m_acc_jetRejectionDec
std::unique_ptr< SG::AuxElement::ConstAccessor< char > > m_acc_jetRejectionDec
Definition: METMaker.h:150
xAOD::MissingETAssociationHelper
Definition: MissingETAssociationHelper.h:26
xAOD::Electron_v1
Definition: Electron_v1.h:34
met::METMaker::m_jetMinWeightedPt
double m_jetMinWeightedPt
Definition: METMaker.h:157
met::METMaker::rebuildMET
virtual StatusCode rebuildMET(const std::string &metKey, xAOD::Type::ObjectType metType, xAOD::MissingETContainer *metCont, const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, MissingETBase::UsageHandler::Policy objScale) override final
Definition: METMaker.cxx:220
xAOD::MissingETAssociation_v1::overlapTrkVec
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
Definition: MissingETAssociation_v1.cxx:782
MissingETBase::UsageHandler::ParticleFlow
@ ParticleFlow
Particle Flow Object based.
Definition: MissingETCompositionBase.h:188
MuonContainer.h
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
met::METMaker::m_doRemoveElecTrks
bool m_doRemoveElecTrks
Definition: METMaker.h:181
Muon
struct TBPatternUnitContext Muon
METMaker.h
TrackParticle.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
met::METMaker::m_jetWidthMuOlap
double m_jetWidthMuOlap
Definition: METMaker.h:193
DeMoScan.index
string index
Definition: DeMoScan.py:364
VertexContainer.h
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::MissingETAssociation_v1::calkey
const std::vector< MissingETBase::Types::bitmask_t > & calkey() const
Get the vector of cal keys.
xAOD::MissingETAssociation_v1::isMisc
bool isMisc() const
Check if this association is a miscellaneous association.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
met::METMaker::getPV
const xAOD::Vertex * getPV() const
Definition: METMaker.cxx:1183
xAOD::MissingETAssociation_v1::ConstVec::cpt
float cpt() const
Returns .
Definition: MissingETAssociation_v1.cxx:87
met::METMaker::acceptTrack
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *vx) const
Definition: METMaker.cxx:1178
asg::AsgComponentConfig::setProperty
StatusCode setProperty(const std::string &name, const T &value)
set the given property
python.changerun.pv
pv
Definition: changerun.py:81
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
DataVector::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
met::METMaker::m_jetJvtMomentName
std::string m_jetJvtMomentName
Definition: METMaker.h:159
xAODType::Tau
@ Tau
The object is a tau (jet)
Definition: ObjectType.h:49
met::METMaker::METMaker
METMaker()
Default constructor:
MissingETBase::Source::photon
static Types::bitmask_t photon(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed photons.
Definition: MissingETBase.h:236
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
pickleTool.object
object
Definition: pickleTool.py:30
met::METMaker::m_veryGreedyPhotons
bool m_veryGreedyPhotons
Definition: METMaker.h:189
xAOD::JetConstituentVector
A vector of jet constituents at the scale used during jet finding.
Definition: JetConstituentVector.h:117
xAOD::MissingETAssociation_v1::trkVec
ConstVec trkVec(const IParticle *pPart) const
Get track constituent vector for a given object.
Definition: MissingETAssociation_v1.cxx:550
MissingETAssociationMap.h
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition: JetContainer.h:17
met::fillMET
StatusCode fillMET(xAOD::MissingET *&met, xAOD::MissingETContainer *metCont, const std::string &metKey, const MissingETBase::Types::bitmask_t metSource)
Definition: METHelpers.cxx:123
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
xAOD::MissingETAssociation_v1::ConstVec::cpx
float cpx() const
Returns .
met::METMaker::m_greedyPhotons
bool m_greedyPhotons
Definition: METMaker.h:188
xAOD::MissingET_v1::mpy
float mpy() const
Returns .
xAOD::JetAttribute::GhostTrack
@ GhostTrack
Definition: JetAttributes.h:252
python.PyAthena.obj
obj
Definition: PyAthena.py:132
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
xAOD::MissingETComposition::selectIfNoOverlaps
static bool selectIfNoOverlaps(MissingETAssociationHelper &helper, const IParticle *obj, MissingETBase::UsageHandler::Policy p)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:382
met::METMaker::m_JvtTool
ToolHandle< IAsgSelectionTool > m_JvtTool
Definition: METMaker.h:200
MissingETAssociationHelper.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MissingETComposition.h
MissingETContainer.h
xAOD::MissingETAssociation_v1::ConstVec::ce
float ce() const
Returns .
met::METMaker::m_orCaloTaggedMuon
bool m_orCaloTaggedMuon
Definition: METMaker.h:187
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::MissingETAssociation_v1::objects
std::vector< const IParticle * > objects() const
Access contributing objects.
Definition: MissingETAssociation_v1.cxx:505
met::METMaker::m_jetRejectionDec
std::string m_jetRejectionDec
Definition: METMaker.h:160
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
xAOD::MissingETAssociation_v1::getAlternateConstVec
xAOD::JetFourMom_t getAlternateConstVec() const
Definition: MissingETAssociation_v1.cxx:759
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::MissingETComposition::getAssociations
static std::vector< const MissingETAssociation * > getAssociations(const MissingETAssociationMap *pMap, const IParticle *pPart)
Access non-modifiable contribution object.
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:391
xAOD::Muon_v1::muonType
MuonType muonType() const
met::METMaker::m_trkseltool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool
Definition: METMaker.h:199
met::iplink_t
ElementLink< xAOD::IParticleContainer > iplink_t
Definition: METMaker.cxx:63