33AsgForwardElectronIsEMSelector::AsgForwardElectronIsEMSelector(
34 const std::string& myname)
37 , m_rootForwardTool{ nullptr }
41 declareProperty(
"WorkingPoint", m_WorkingPoint =
"",
"The Working Point");
42 declareProperty(
"ConfigFile",
44 "The config file to use (if not setting cuts one by one)");
46 "usePVContainer", m_usePVCont =
true,
"Whether to use the PV container");
48 "nPVdefault", m_nPVdefault = 0,
"The default number of PVs if not counted");
53 m_rootForwardTool->m_isEMMask =
57 declareProperty(
"CutBinEta_ForwardElectron",
58 m_rootForwardTool->m_cutBinEta_ForwardElectron,
61 declareProperty(
"CutVxp_ForwardElectron",
62 m_rootForwardTool->m_cutVxp_ForwardElectron,
65 declareProperty(
"CutLATERAL_ForwardElectron",
66 m_rootForwardTool->m_cutLATERAL_ForwardElectron,
67 "Cut on lateral shower shape in 2nd sampling");
69 declareProperty(
"CutSECONDLAMBDA_ForwardElectron",
70 m_rootForwardTool->m_cutSECONDLAMBDA_ForwardElectron,
71 "Cut on secondLambda");
73 declareProperty(
"CutLONGITUDINAL_ForwardElectron",
74 m_rootForwardTool->m_cutLONGITUDINAL_ForwardElectron,
75 "Cut on longitudinal");
77 declareProperty(
"CutCELLMAXFRAC_ForwardElectron",
78 m_rootForwardTool->m_cutCELLMAXFRAC_ForwardElectron,
81 declareProperty(
"CutCENTERLAMBDA_ForwardElectron",
82 m_rootForwardTool->m_cutCENTERLAMBDA_ForwardElectron,
83 "Cut on centerlambda");
85 declareProperty(
"CutSECONDR_ForwardElectron",
86 m_rootForwardTool->m_cutSECONDR_ForwardElectron,
102 StatusCode
sc = StatusCode::SUCCESS;
112 if (filename.empty()) {
114 sc = StatusCode::FAILURE;
119 env.ReadFile(filename.c_str(), kEnvLocal);
163 ATH_MSG_ERROR(
"Could not initialize the TForwardElectronIsEMSelector!");
164 sc = StatusCode::FAILURE;
187 return accept(Gaudi::Hive::currentContext(), part);
201 ATH_MSG_ERROR(
"AsgForwardElectronIsEMSelector::could not convert argument to "
213 unsigned int isEM = ~0;
215 if (
sc.isFailure()) {
223 "AsgForwardElectronIsEMSelector::accept was given a bad argument");
232 "Entering accept( const EventContext& ctx, const Electron* part )");
241 "Entering accept( const EventContext& ctx, const Photon* part )");
256 ATH_MSG_INFO(
"Didn't recognize the given operating point with mask: "
265 unsigned int& isEM)
const
278 return StatusCode::SUCCESS;
283 if (cluster ==
nullptr) {
287 return StatusCode::SUCCESS;
294 float eta = std::abs(cluster->
etaBE(2));
307 eta = std::max(2.5,std::abs(cluster->
eta()));
312 return StatusCode::SUCCESS;
321 unsigned int iflag)
const
330 double secondLambda(0);
332 double longitudinal(0);
334 double centerLambda(0);
337 bool allFound =
true;
349 allFound = allFound &&
384 unsigned int nVtx(0);
389 for (
const auto *vtxcand : *vtxCont) {
390 if (vtxcand->nTrackParticles() >= 3)
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::string m_configFile
Config File.
unsigned int calocuts_electrons(const xAOD::Egamma *eg, float eta2, float nvtx, unsigned int iflag) const
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override final
Accept with generic interface.
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContKey
read handle key to primary vertex container
bool m_usePVCont
Whether to use the PV (not available for trigger)
virtual StatusCode execute(const EventContext &ctx, const xAOD::Egamma *eg, unsigned int &isEM) const override final
==========================================================================================//
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations.
std::string m_WorkingPoint
Working Point.
Root::TForwardElectronIsEMSelector * m_rootForwardTool
Pointer to the underlying ROOT based tool.
virtual std::string getOperatingPointName() const override final
Method to get the operating point.
unsigned int m_nPVdefault
virtual ASG_TOOL_CLASS3(AsgForwardElectronIsEMSelector, IAsgForwardElectronIsEMSelector, IAsgEGammaIsEMSelector, IAsgSelectionTool) public ~AsgForwardElectronIsEMSelector()
Standard constructor.
unsigned int getNPrimVertices(const EventContext &ctx) const
( This is horrible!
virtual const asg::AcceptInfo & getAcceptInfo() const override final
Method to get the plain AcceptInfo.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
@ SECOND_LAMBDA
Second Moment in .
@ LATERAL
Normalized lateral moment.
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Class providing the definition of the 4-vector interface.
std::string findConfigFile(const std::string &input, const std::map< std::string, std::string > &configmap)
std::vector< float > HelperFloat(const std::string &input, TEnv &env)
const std::map< std::string, std::string > ForwardElectronCutPointToConfFile
@ BinEta_ForwardElectron
cluster eta range
const unsigned int ID_ForwardElectron
cuts on all variables
const unsigned int EgPidUndefined
@ Photon
The object is a photon.
@ Electron
The object is an electron.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".