82 bool isGsfElectronMatched =
false;
83 float deltaRDummy = 9.9;
84 const float ECALBarrelEndcapEtaBorder = 1.479;
85 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
86 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
88 if ((*theTauRef).leadChargedHadrCand().isNonnull()) {
89 int numSignalPFGammaCandsInSigCone = 0;
91 for (
const auto&
gamma : signalGammaCands) {
92 double dR =
deltaR(
gamma->p4(), theTauRef->leadChargedHadrCand()->p4());
96 numSignalPFGammaCandsInSigCone += 1;
100 for (
const auto& theElectron : *
Electrons) {
101 if (theElectron.pt() > 10.) {
102 double deltaREleTau =
deltaR(theElectron.p4(), theTauRef->p4());
103 deltaRDummy = deltaREleTau;
104 if (deltaREleTau < 0.3) {
105 double mva_match =
mva_->MVAValue(*theTauRef, theElectron);
106 bool hasGsfTrack =
false;
109 if (
abs(packedLeadTauCand->
pdgId()) == 11)
112 hasGsfTrack = theElectron.gsfTrack().isNonnull();
123 if (
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) {
124 if (numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack) {
126 }
else if (numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack) {
130 if (numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack) {
132 }
else if (numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack) {
136 mvaValue =
std::min(mvaValue, mva_match);
137 isGsfElectronMatched =
true;
142 if (!isGsfElectronMatched) {
143 mvaValue =
mva_->MVAValue(*theTauRef);
144 bool hasGsfTrack =
false;
147 if (
abs(packedLeadTauCand->
pdgId()) == 11)
159 if (
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) {
160 if (numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack) {
162 }
else if (numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack) {
166 if (numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack) {
168 }
else if (numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack) {
175 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
"<PATTauDiscriminationAgainstElectronMVA6::discriminate>:";
177 <<
" tau: Pt = " << theTauRef->pt() <<
", eta = " << theTauRef->eta() <<
", phi = " << theTauRef->phi();
179 <<
" deltaREleTau = " << deltaRDummy <<
", isGsfElectronMatched = " << isGsfElectronMatched;
180 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" #Prongs = " << theTauRef->signalChargedHadrCands().size();
int pdgId() const override
PDG identifier.
std::unique_ptr< PATTauDiscriminator > category_output_
Abs< T >::type abs(const T &t)
bool isInEcalCrack(double) const
T const * get() const
Returns C++ pointer to the item.
std::unique_ptr< AntiElectronIDMVA6 > mva_
edm::Handle< pat::ElectronCollection > Electrons