12 using namespace TopObjectSelectionTools;
15 ElectronLikelihood::ElectronLikelihood(
const double ptcut,
const bool vetoCrack,
16 const std::string& operatingPoint,
18 const double d0SigCut,
const double delta_z0,
const bool applyTTVACut,
19 const bool applyChargeIDCut) :
21 m_vetoCrack(vetoCrack),
24 m_operatingPoint(
"SetMe"),
25 m_operatingPointLoose(
"SetMe"),
26 m_operatingPoint_DF(
"SetMe"),
27 m_operatingPointLoose_DF(
"SetMe"),
28 m_isolation(isolation),
29 m_applyTTVACut(applyTTVACut),
30 m_applyChargeIDCut(applyChargeIDCut) {
42 std::string egammaNamesAreNotConsistantAnywhere(
"LikelihoodNotSetProperly");
43 std::string egammaNamesAreNotConsistantAnywhereLoose(
"LikelihoodNotSetProperly");
45 if (operatingPoint ==
"LooseLH") {
46 egammaNamesAreNotConsistantAnywhere =
"DFCommonElectronsLHLoose";
48 if (operatingPoint ==
"LooseAndBLayerLH") {
49 egammaNamesAreNotConsistantAnywhere =
"DFCommonElectronsLHLooseBL";
51 if (operatingPoint ==
"MediumLH") {
52 egammaNamesAreNotConsistantAnywhere =
"DFCommonElectronsLHMedium";
54 if (operatingPoint ==
"TightLH") {
55 egammaNamesAreNotConsistantAnywhere =
"DFCommonElectronsLHTight";
58 if (operatingPointLoose ==
"LooseLH") {
59 egammaNamesAreNotConsistantAnywhereLoose =
"DFCommonElectronsLHLoose";
61 if (operatingPointLoose ==
"LooseAndBLayerLH") {
62 egammaNamesAreNotConsistantAnywhereLoose =
"DFCommonElectronsLHLooseBL";
64 if (operatingPointLoose ==
"MediumLH") {
65 egammaNamesAreNotConsistantAnywhereLoose =
"DFCommonElectronsLHMedium";
67 if (operatingPointLoose ==
"TightLH") {
68 egammaNamesAreNotConsistantAnywhereLoose =
"DFCommonElectronsLHTight";
81 const std::string& operatingPoint,
82 const std::string& operatingPointLoose,
84 const bool applyChargeIDCut)
86 operatingPointLoose, isolation, 5.0, 0.5, true,
90 const std::string& operatingPoint,
91 const std::string& operatingPointLoose,
93 const bool applyTTVACut,
94 const bool applyChargeIDCut)
96 operatingPointLoose, isolation, 5.0, 0.5, applyTTVACut,
116 const std::string& operatingPoint)
const {
125 if (
el.auxdataConst<
int>(operatingPoint_DF) != 1)
return false;
128 if (
el.auxdataConst<
char>(operatingPoint_DF) != 1)
return false;
131 if (operatingPoint ==
"LooseAndBLayerLH") {
142 if (
el.auxdataConst<
int>(
"DFCommonElectronsLHLoose") != 1) {
143 ATH_MSG_ERROR(
"This electron fails the DFCommonElectronsLHLoose and has an incorrect decoration.\n pt ("
144 <<
el.pt() <<
"), eta (" <<
el.eta() <<
")");
149 if (
el.auxdataConst<
char>(
"DFCommonElectronsLHLoose") != 1) {
150 ATH_MSG_ERROR(
"This electron fails the DFCommonElectronsLHLoose and has an incorrect decoration.\n pt ("
151 <<
el.pt() <<
"), eta (" <<
el.eta() <<
")");
163 if (std::fabs(
el.caloCluster()->etaBE(2)) > 2.47)
return false;
167 if (
el.isAvailable<
char>(
"DFCommonCrackVetoCleaning"))
168 if (!
el.auxdataConst<
char>(
"DFCommonCrackVetoCleaning"))
return false;
170 if (
m_vetoCrack && std::fabs(
el.caloCluster()->etaBE(2)) > 1.37 &&
171 std::fabs(
el.caloCluster()->etaBE(2)) < 1.52)
return false;
186 else el.auxdecor<
char>(
"passChargeID") = 1;
200 if (!
el.isAvailable<
float>(
"d0sig")) {
201 ATH_MSG_WARNING(
"d0 significance not found for electron. Maybe no primary vertex? Won't accept.");
205 float d0sig =
el.auxdataConst<
float>(
"d0sig");
206 if (std::abs(d0sig) >= 5)
return false;
208 if (!
el.isAvailable<
float>(
"delta_z0_sintheta")) {
209 ATH_MSG_WARNING(
"delta z0*sin(theta) not found for electron. Maybe no primary vertex? Won't accept.");
213 float delta_z0_sintheta =
el.auxdataConst<
float>(
"delta_z0_sintheta");
214 if (std::abs(delta_z0_sintheta) >= 0.5)
return false;
223 el),
"ElectronLikelihood::passChargeIDCut: DFCommonElectronsECIDS is not available");
224 return acc_ECIDS(
el) ? true :
false;
228 os <<
"ElectronLikelihood\n";
230 os <<
" * Currently disabled --- |cluster_eta| < 2.47 \n";
231 os <<
" * Veto 1.37 < |cluster_eta| < 1.52? " << std::boolalpha <<
m_vetoCrack <<
"\n";
233 os <<
" * No isolation requirement\n";
237 os <<
" * LH Tool Operating Point: " <<
m_operatingPoint_DF <<
" \t\t LH Tool Loose Operating Point: " <<