17 :
asg::AsgMessaging(std::string(
name))
21 m_cutPositionBinEta_ForwardElectron(0)
27 m_cutPositionSECONDLAMBDA_ForwardElectron(0)
30 m_cutPositionLATERAL_ForwardElectron(0)
33 m_cutPositionLONGITUDINAL_ForwardElectron(0)
36 m_cutPositionCELLMAXFRAC_ForwardElectron(0)
39 m_cutPositionSECONDR_ForwardElectron(0)
42 m_cutPositionCENTERLAMBDA_ForwardElectron(0)
45 m_cutNameBinEta_ForwardElectron(
"BinEta_ForwardElectron")
51 m_cutNameSECONDLAMBDA_ForwardElectron(
"SECONDLAMBDA_ForwardElectron")
54 m_cutNameLATERAL_ForwardElectron(
"LATERAL_ForwardElectron")
57 m_cutNameLONGITUDINAL_ForwardElectron(
"LONGITUDINAL_ForwardElectron")
60 m_cutNameCELLMAXFRAC_ForwardElectron(
"CELLMAXFRAC_ForwardElectron")
63 m_cutNameSECONDR_ForwardElectron(
"SECONDR_ForwardElectron")
66 m_cutNameCENTERLAMBDA_ForwardElectron(
"CENTERLAMBDA_ForwardElectron")
94 m_cutPositionBinEta_ForwardElectron = m_acceptInfo.addCut(
95 m_cutNameBinEta_ForwardElectron,
"Electron within eta range");
96 if (m_cutPositionBinEta_ForwardElectron < 0)
97 sc = StatusCode::FAILURE;
106 m_cutPositionSECONDLAMBDA_ForwardElectron = m_acceptInfo.addCut(
107 m_cutNameSECONDLAMBDA_ForwardElectron,
"secondLambda < Cut");
108 if (m_cutPositionSECONDLAMBDA_ForwardElectron < 0)
109 sc = StatusCode::FAILURE;
112 m_cutPositionLATERAL_ForwardElectron =
113 m_acceptInfo.addCut(m_cutNameLATERAL_ForwardElectron,
"lateral <0 Cut");
114 if (m_cutPositionLATERAL_ForwardElectron < 0)
115 sc = StatusCode::FAILURE;
118 m_cutPositionLONGITUDINAL_ForwardElectron = m_acceptInfo.addCut(
119 m_cutNameLONGITUDINAL_ForwardElectron,
"longitudinal <Cut");
120 if (m_cutPositionLONGITUDINAL_ForwardElectron < 0)
121 sc = StatusCode::FAILURE;
124 m_cutPositionCELLMAXFRAC_ForwardElectron =
125 m_acceptInfo.addCut(m_cutNameCELLMAXFRAC_ForwardElectron,
"fracMax > Cut");
126 if (m_cutPositionCELLMAXFRAC_ForwardElectron < 0)
127 sc = StatusCode::FAILURE;
130 m_cutPositionSECONDR_ForwardElectron =
131 m_acceptInfo.addCut(m_cutNameSECONDR_ForwardElectron,
"SecondR < Cut");
132 if (m_cutPositionSECONDR_ForwardElectron < 0)
133 sc = StatusCode::FAILURE;
136 m_cutPositionCENTERLAMBDA_ForwardElectron = m_acceptInfo.addCut(
137 m_cutNameCENTERLAMBDA_ForwardElectron,
"CenterLambda < Cut");
138 if (m_cutPositionCENTERLAMBDA_ForwardElectron < 0)
139 sc = StatusCode::FAILURE;
141 if (
sc == StatusCode::FAILURE) {
143 "Exceeded the number of allowed cuts in TForwardElectronIsEMSelector");
153 for (
int i = 0;
i < 7;
i++) {
154 const unsigned int mask = (0x1 <<
i) & m_isEMMask;
181 unsigned int iflag)
const
185 std::vector<int>
bins = findNvtxEtaBin(nvtx, eta);
186 int ibin_nvtx =
bins.at(0);
187 int ibin_eta =
bins.at(1);
188 int ibin_combined =
bins.at(2);
197 if (ibin_eta >= 0 && ibin_nvtx >= 0 && ibin_combined >= 0) {
200 if (checkVar(m_cutSECONDR_ForwardElectron, 4)) {
201 if (secondR >= m_cutSECONDR_ForwardElectron[ibin_combined]) {
205 << m_cutSECONDR_ForwardElectron[ibin_combined]);
209 if (checkVar(m_cutSECONDLAMBDA_ForwardElectron, 4)) {
210 if (secondLambda >= m_cutSECONDLAMBDA_ForwardElectron[ibin_combined]) {
213 << secondLambda <<
" > "
214 << m_cutSECONDLAMBDA_ForwardElectron[ibin_combined]);
219 if (checkVar(m_cutLATERAL_ForwardElectron, 4)) {
220 if (lateral >= m_cutLATERAL_ForwardElectron[ibin_combined]) {
224 << m_cutLATERAL_ForwardElectron[ibin_combined]);
228 if (checkVar(m_cutLONGITUDINAL_ForwardElectron, 4)) {
229 if (longitudinal >= m_cutLONGITUDINAL_ForwardElectron[ibin_combined]) {
232 << longitudinal <<
" > "
233 << m_cutLONGITUDINAL_ForwardElectron[ibin_combined]);
237 if (checkVar(m_cutCELLMAXFRAC_ForwardElectron, 4)) {
238 if (fracMax < m_cutCELLMAXFRAC_ForwardElectron[ibin_combined]) {
242 << m_cutCELLMAXFRAC_ForwardElectron[ibin_combined]);
246 if (checkVar(m_cutCENTERLAMBDA_ForwardElectron, 4)) {
247 if (centerLambda >= m_cutCENTERLAMBDA_ForwardElectron[ibin_combined]) {
250 << centerLambda <<
" > "
251 << m_cutCENTERLAMBDA_ForwardElectron[ibin_combined]);
265 if (!m_cutVxp_ForwardElectron.empty()) {
266 for (
unsigned int ibinNVTX = 0; ibinNVTX < m_cutVxp_ForwardElectron.size();
269 if (nvtx < m_cutVxp_ForwardElectron[ibinNVTX]) {
270 ibin_nvtx = ibinNVTX;
272 }
else if (ibinNVTX > 0 && ibinNVTX < m_cutVxp_ForwardElectron.size()) {
273 if (nvtx >= m_cutVxp_ForwardElectron[ibinNVTX - 1] &&
274 nvtx < m_cutVxp_ForwardElectron[ibinNVTX]) {
275 ibin_nvtx = ibinNVTX;
277 }
else if (ibinNVTX == m_cutVxp_ForwardElectron.size()) {
278 if (nvtx >= m_cutVxp_ForwardElectron[ibinNVTX - 1]) {
279 ibin_nvtx = ibinNVTX;
286 for (
unsigned int ibinEta = 0; ibinEta < m_cutBinEta_ForwardElectron.size();
289 if (eta < m_cutBinEta_ForwardElectron[ibinEta]) {
292 }
else if (ibinEta > 0 && ibinEta < m_cutBinEta_ForwardElectron.size()) {
293 if (eta >= m_cutBinEta_ForwardElectron[ibinEta - 1] &&
294 eta < m_cutBinEta_ForwardElectron[ibinEta]) {
297 }
else if (ibinEta == m_cutBinEta_ForwardElectron.size()) {
298 if (eta >= m_cutBinEta_ForwardElectron[ibinEta - 1]) {
305 int ibin_combined = -1;
307 ibin_combined = ibin_nvtx * ibin_eta - 1;
308 }
else if (ibin_eta == 1) {
309 ibin_combined = 2 * (ibin_nvtx * ibin_eta - 1);
315 std::vector<int>
bins{ ibin_nvtx, ibin_eta, ibin_combined };
338 unsigned int etaNB = m_cutBinEta_ForwardElectron.size();
339 unsigned int etaTRTNB = 1;
340 unsigned int etNB = m_cutVxp_ForwardElectron.size();
342 unsigned int combinedNB = 0;
343 unsigned int combinedTRTNB = 0;
347 combinedNB = (etaNB - 1) * (etNB - 1);
352 combinedTRTNB = etaTRTNB;
356 if (
vec.size() != 1) {
364 if (
vec.size() != etaNB) {
372 if (
vec.size() != etaTRTNB) {
381 if (
vec.size() != etNB) {
390 if (
vec.size() != combinedNB) {
399 if (
vec.size() != combinedTRTNB) {
409 Root::TForwardElectronIsEMSelector::checkVar<float>(
410 const std::vector<float>&
vec,
413 Root::TForwardElectronIsEMSelector::checkVar<int>(
const std::vector<int>&
vec,