74 result.rawValues = {1., -1.};
76 bool isGsfElectronMatched =
false;
77 float deltaRDummy = 9.9;
78 const float ECALBarrelEndcapEtaBorder = 1.479;
79 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
80 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
82 if ((*theTauRef).leadChargedHadrCand().isNonnull()) {
83 int numSignalPFGammaCandsInSigCone = 0;
85 for (
const auto&
gamma : signalGammaCands) {
86 double dR =
deltaR(
gamma->p4(), theTauRef->leadChargedHadrCand()->p4());
90 numSignalPFGammaCandsInSigCone += 1;
94 for (
const auto& theElectron : *
Electrons) {
95 if (theElectron.pt() > 10.) {
96 double deltaREleTau =
deltaR(theElectron.p4(), theTauRef->p4());
97 deltaRDummy = deltaREleTau;
98 if (deltaREleTau < 0.3) {
99 double mva_match =
mva_->MVAValue(*theTauRef, theElectron);
100 bool hasGsfTrack =
false;
102 dynamic_cast<pat::PackedCandidate const*>(theTauRef->leadChargedHadrCand().
get());
103 if (
abs(packedLeadTauCand->
pdgId()) == 11)
106 hasGsfTrack = theElectron.gsfTrack().isNonnull();
112 result.rawValues.at(0) = -99;
116 if (
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) {
117 if (numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack) {
119 }
else if (numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack) {
123 if (numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack) {
125 }
else if (numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack) {
130 isGsfElectronMatched =
true;
135 if (!isGsfElectronMatched) {
136 result.rawValues.at(0) =
mva_->MVAValue(*theTauRef);
137 bool hasGsfTrack =
false;
139 dynamic_cast<pat::PackedCandidate const*>(theTauRef->leadChargedHadrCand().
get());
140 if (
abs(packedLeadTauCand->
pdgId()) == 11)
149 result.rawValues.at(0) = -99;
153 if (
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) {
154 if (numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack) {
156 }
else if (numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack) {
160 if (numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack) {
162 }
else if (numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack) {
169 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
"<PATTauDiscriminationAgainstElectronMVA6::discriminate>:";
171 <<
" tau: Pt = " << theTauRef->pt() <<
", eta = " << theTauRef->eta() <<
", phi = " << theTauRef->phi();
173 <<
" deltaREleTau = " << deltaRDummy <<
", isGsfElectronMatched = " << isGsfElectronMatched;
174 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" #Prongs = " << theTauRef->signalChargedHadrCands().size();