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