ATLAS Offline Software
Generators
GeneratorFilters
src
ElectronFilter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
GeneratorFilters/ElectronFilter.h
"
6
#include "
TruthUtils/HepMCHelpers.h
"
7
8
ElectronFilter::ElectronFilter
(
const
std::string&
name
, ISvcLocator* pSvcLocator)
9
:
GenFilter
(
name
, pSvcLocator)
10
{
11
declareProperty
(
"Ptcut"
,
m_Ptmin
= 10000.);
12
declareProperty
(
"Etacut"
,
m_EtaRange
= 10.0);
13
}
14
15
16
StatusCode
ElectronFilter::filterEvent
() {
17
for
(
McEventCollection::const_iterator
itr =
events
()->
begin
(); itr !=
events
()->end(); ++itr) {
18
const
HepMC::GenEvent* genEvt = *itr;
19
for
(
const
auto
&
part
: *genEvt) {
20
if
(
MC::isStable
(
part
) &&
MC::isElectron
(
part
)) {
// electron
21
if
(
part
->momentum().perp() >=
m_Ptmin
&& std::abs(
part
->momentum().pseudoRapidity()) <=
m_EtaRange
) {
22
return
StatusCode::SUCCESS;
23
}
24
}
25
}
26
}
27
setFilterPassed(
false
);
28
return
StatusCode::SUCCESS;
29
}
LArG4FSStartPointFilter.part
part
Definition:
LArG4FSStartPointFilter.py:21
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition:
DVLIterator.h:82
ElectronFilter::filterEvent
virtual StatusCode filterEvent()
Definition:
ElectronFilter.cxx:16
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition:
AthCommonDataStore.h:145
PlotCalibFromCool.begin
begin
Definition:
PlotCalibFromCool.py:94
python.DataFormatRates.events
events
Definition:
DataFormatRates.py:105
GenFilter
Base class for event generator filtering modules.
Definition:
GenFilter.h:30
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition:
EgammaxAODHelpers.cxx:12
ElectronFilter::m_EtaRange
double m_EtaRange
Definition:
ElectronFilter.h:29
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:195
MC::isStable
bool isStable(const T &p)
Definition:
HepMCHelpers.h:30
ElectronFilter.h
ElectronFilter::m_Ptmin
double m_Ptmin
Definition:
ElectronFilter.h:28
HepMCHelpers.h
ElectronFilter::ElectronFilter
ElectronFilter(const std::string &name, ISvcLocator *pSvcLocator)
Definition:
ElectronFilter.cxx:8
Generated on Thu Jul 4 2024 21:14:49 for ATLAS Offline Software by
1.8.18