87 bool isGsfElectronMatched =
false;
88 float deltaRDummy = 9.9;
89 const float ECALBarrelEndcapEtaBorder = 1.479;
90 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
91 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
93 if( (*theTauRef).leadChargedHadrCand().isNonnull()) {
94 int numSignalPFGammaCandsInSigCone = 0;
96 for (
const auto &
gamma : signalGammaCands ) {
97 double dR =
deltaR(
gamma->p4(), theTauRef->leadChargedHadrCand()->p4());
100 if (dR < signalrad) {
101 numSignalPFGammaCandsInSigCone += 1;
105 for (
const auto & theElectron : *
Electrons ) {
106 if ( theElectron.pt() > 10. ) {
107 double deltaREleTau =
deltaR(theElectron.p4(), theTauRef->p4());
108 deltaRDummy = deltaREleTau;
109 if( deltaREleTau < 0.3 ){
110 double mva_match =
mva_->MVAValue(*theTauRef, theElectron);
111 bool hasGsfTrack =
false;
113 if(
abs(packedLeadTauCand->
pdgId()) == 11 )
116 hasGsfTrack = theElectron.gsfTrack().isNonnull();
126 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
127 if( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ){
130 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
134 if ( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ) {
137 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
141 mvaValue =
std::min(mvaValue, mva_match);
142 isGsfElectronMatched =
true;
147 if ( !isGsfElectronMatched ) {
148 mvaValue =
mva_->MVAValue(*theTauRef);
149 bool hasGsfTrack =
false;
151 if(
abs(packedLeadTauCand->
pdgId()) == 11 ) hasGsfTrack =
true;
161 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
162 if( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ){
165 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
169 if ( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ) {
172 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
179 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
"<PATTauDiscriminationAgainstElectronMVA6::discriminate>:" ;
180 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" tau: Pt = " << theTauRef->pt() <<
", eta = " << theTauRef->eta() <<
", phi = " << theTauRef->phi();
181 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" deltaREleTau = " << deltaRDummy <<
", isGsfElectronMatched = " << isGsfElectronMatched;
182 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