![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/SystemOfUnits.h"
38 :
GenFilter(
name, pSvcLocator), m_total(0), m_passed(0), m_ptfailed(0)
39 , m_classif(
"MCTruthClassifier/DFCommonTruthClassifier")
46 declareProperty(
"UseNeutrinosFromWZTau",
m_UseNu =
false,
"Include neutrinos from W/Z/tau decays in the calculation of HT");
80 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
105 setFilterPassed(
m_MinHT < 1. || keepAll());
109 return StatusCode::SUCCESS;
121 <<
", eta " << (*it_truth)->eta()
122 <<
", phi " << (*it_truth)->phi()
123 <<
", nconst = " << (*it_truth)->numConstituents());
124 HT += (*it_truth)->pt();
135 if (
evtStore()->
retrieve(xTruthParticleContainer,
"TruthGen").isFailure()) {
136 ATH_MSG_ERROR(
"No TruthParticle collection with name " <<
"TruthGen" <<
" found in StoreGate!");
137 return StatusCode::FAILURE;
140 std::vector<const xAOD::TruthParticle *> WZleptons;
141 WZleptons.reserve(10);
144 unsigned int nPart = xTruthParticleContainer->
size();
145 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
149 int pdgid = theParticle->
pdgId();
155 HT += theParticle->
pt();
164 HT += theParticle->
pt();
179 setFilterPassed(
false);
180 ATH_MSG_ERROR(
"Could not retrieve MC Event Collection - might not work");
181 return StatusCode::SUCCESS;
185 for (
unsigned int i = 0;
i < mec->
size(); ++
i) {
186 if (!(*mec)[
i])
continue;
188 (*mec)[
i]->add_attribute(
"filterHT", std::make_shared<HepMC3::DoubleAttribute>(HT));
191 if ((HT < m_MinHT || HT >=
m_MaxHT) && (!keepAll()))
193 if ((HT < m_MinHT || HT >=
m_MaxHT) )
197 setFilterPassed(
false);
203 setFilterPassed(
true);
205 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
std::string m_TruthJetContainerName
Name of the truth jet container.
Const iterator class for DataVector/DataList.
double m_MinLepPt
Min pT for the truth jets.
long m_passed
Number of events passing all cuts.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::WriteDecorHandleKey< xAOD::EventInfo > m_mcFilterHTKey
bool isGenStable() const
Check if this is generator stable particle.
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
virtual StatusCode filterFinalize()
bool m_UseNu
Use neutrinos in HT.
bool prompt(const xAOD::TruthParticle *part, ToolHandle< IMCTruthClassifier > &m_classif)
double m_MinJetPt
Min pT for the truth jets.
#define ATH_MSG_VERBOSE(x)
double m_MaxJetEta
Max eta for the truth jets.
virtual StatusCode filterEvent()
double m_MaxLepEta
Max eta for the truth jets.
double m_MinHT
Min HT for events.
virtual StatusCode filterInitialize()
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Base class for event generator filtering modules.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
bool m_UseLep
Use leptons in HT.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
double m_MaxHT
Max HT for events.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
long m_ptfailed
Number of events failing the pT cuts.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
long m_total
Total number of events tested.
int pdgId() const
PDG ID code.
xAODHTFilter(const std::string &name, ISvcLocator *pSvcLocator)
size_type size() const noexcept
Returns the number of elements in the collection.
std::string m_eventInfoName
ToolHandle< IMCTruthClassifier > m_classif