ATLAS Offline Software
MissingEtFilter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 
11 MissingEtFilter::MissingEtFilter(const std::string& name, ISvcLocator* pSvcLocator)
12  : GenFilter(name,pSvcLocator)
13 {
14  declareProperty("METCut",m_METmin = 10000.);
15  // Normally we'd include them, but this is unstable if using EvtGen
16  declareProperty("UseNeutrinosFromHadrons",m_useHadronicNu = false);
17  declareProperty("UseChargedNonShowering",m_useChargedNonShowering = false);
18 }
19 
20 
22  double sumx(0), sumy(0);
23 
24 #ifdef HEPMC3
25 
26 ATH_MSG_ERROR(" For HEPMC3 releases xAOD filters should be used. Exiting with ERROR. ");
27 return StatusCode::FAILURE;
28 
29 #endif
30 
32  for (itr = events()->begin(); itr != events()->end(); ++itr) {
33  const HepMC::GenEvent* genEvt = (*itr);
34  for (const auto& pitr: *genEvt) {
35  if (!MC::isGenStable(pitr)) continue;
36  // Consider all non-interacting particles
37  // We want Missing Transverse Momentum, not "Missing Transverse Energy"
39  bool addpart = true;
40  if(!m_useHadronicNu && MC::isNeutrino(pitr) && !(Common::fromWZorTau(pitr)) ) {
41  addpart = false; // ignore neutrinos from hadron decays
42  }
43  if(addpart) {
44  ATH_MSG_VERBOSE("Found noninteracting particle: ID = " << pitr->pdg_id() << " PX = " << pitr->momentum().px() << " PY = "<< pitr->momentum().py());
45  sumx += pitr->momentum().px();
46  sumy += pitr->momentum().py();
47  }
48  }
49  }
50  }
51 
52  // Now see what the total missing Et is and compare to minimum
53  double met = std::hypot(sumx,sumy);
54  ATH_MSG_DEBUG("Totals for event: EX = " << sumx << ", EY = "<< sumy << ", ET = " << met);
55  setFilterPassed(met >= m_METmin);
56  return StatusCode::SUCCESS;
57 }
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MissingEtFilter.h
MissingEtFilter::m_METmin
double m_METmin
Definition: MissingEtFilter.h:20
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
isNeutrino
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition: AtlasPID.h:152
MissingEtFilter::m_useHadronicNu
bool m_useHadronicNu
Definition: MissingEtFilter.h:21
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
MissingEtFilter::filterEvent
virtual StatusCode filterEvent()
Definition: MissingEtFilter.cxx:21
MC::isGenStable
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Definition: HepMCHelpers.h:36
GenFilter
Base class for event generator filtering modules.
Definition: GenFilter.h:30
met
Definition: IMETSignificance.h:24
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
Common.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MC::isChargedNonShowering
bool isChargedNonShowering(const T &p)
Identify if the particle with given PDG ID would produce ID tracks but not shower in the detector if ...
Definition: HepMCHelpers.h:26
Common::fromWZorTau
bool fromWZorTau(const HepMC::ConstGenParticlePtr &part)
Definition: Common.cxx:93
MC::isInteracting
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
Definition: HepMCHelpers.h:23
MissingEtFilter::MissingEtFilter
MissingEtFilter(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MissingEtFilter.cxx:11
MissingEtFilter::m_useChargedNonShowering
bool m_useChargedNonShowering
Definition: MissingEtFilter.h:22
HepMCHelpers.h