33 AsgForwardElectronIsEMSelector::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,
95 delete m_rootForwardTool;
104 if (!m_WorkingPoint.empty()) {
109 if (!m_configFile.empty()) {
114 sc = StatusCode::FAILURE;
127 m_rootForwardTool->m_isEMMask =
mask;
132 m_rootForwardTool->m_cutBinEta_ForwardElectron =
134 m_rootForwardTool->m_cutVxp_ForwardElectron =
136 m_rootForwardTool->m_cutSECONDLAMBDA_ForwardElectron =
138 m_rootForwardTool->m_cutLATERAL_ForwardElectron =
140 m_rootForwardTool->m_cutLONGITUDINAL_ForwardElectron =
142 m_rootForwardTool->m_cutCELLMAXFRAC_ForwardElectron =
144 m_rootForwardTool->m_cutCENTERLAMBDA_ForwardElectron =
146 m_rootForwardTool->m_cutSECONDR_ForwardElectron =
152 ATH_CHECK(m_primVtxContKey.initialize(m_usePVCont));
154 ATH_MSG_INFO(
"operating point : " << this->getOperatingPointName()
156 << m_rootForwardTool->m_isEMMask);
160 m_rootForwardTool->msg().setLevel(this->
msg().
level());
162 if (m_rootForwardTool->initialize().isFailure()) {
163 ATH_MSG_ERROR(
"Could not initialize the TForwardElectronIsEMSelector!");
164 sc = StatusCode::FAILURE;
178 return m_rootForwardTool->getAcceptInfo();
187 return accept(Gaudi::Hive::currentContext(),
part);
201 ATH_MSG_ERROR(
"AsgForwardElectronIsEMSelector::could not convert argument to "
203 return m_rootForwardTool->accept();
213 unsigned int isEM = ~0;
215 if (
sc.isFailure()) {
217 return m_rootForwardTool->accept();
219 return m_rootForwardTool->fillAccept(isEM);
223 "AsgForwardElectronIsEMSelector::accept was given a bad argument");
224 return m_rootForwardTool->accept();
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: "
257 << m_rootForwardTool->m_isEMMask);
265 unsigned int& isEM)
const
278 return StatusCode::SUCCESS;
283 if (cluster ==
nullptr) {
287 return StatusCode::SUCCESS;
291 static_cast<int>(m_usePVCont ? this->getNPrimVertices(ctx) : m_nPVdefault);
294 float eta = std::abs(cluster->
etaBE(2));
310 isEM = calocuts_electrons(
eg, eta, nvtx, 0);
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 &&
365 return m_rootForwardTool->calocuts_electrons(eta,
384 unsigned int nVtx(0);
389 for (
const auto *vtxcand : *vtxCont) {
390 if (vtxcand->nTrackParticles() >= 3)