84 bool isGsfElectronMatched =
false;
85 float deltaRDummy = 9.9;
86 const float ECALBarrelEndcapEtaBorder = 1.479;
87 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
88 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
90 if( (*theTauRef).leadChargedHadrCand().isNonnull()) {
91 int numSignalPFGammaCandsInSigCone = 0;
93 for (
const auto &
gamma : signalGammaCands ) {
94 double dR =
deltaR(
gamma->p4(), theTauRef->leadChargedHadrCand()->p4());
98 numSignalPFGammaCandsInSigCone += 1;
102 for (
const auto & theElectron : *
Electrons ) {
103 if ( theElectron.pt() > 10. ) {
104 double deltaREleTau =
deltaR(theElectron.p4(), theTauRef->p4());
105 deltaRDummy = deltaREleTau;
106 if( deltaREleTau < 0.3 ){
107 double mva_match =
mva_->MVAValue(*theTauRef, theElectron);
108 bool hasGsfTrack =
false;
110 if(
abs(packedLeadTauCand->
pdgId()) == 11 )
113 hasGsfTrack = theElectron.gsfTrack().isNonnull();
123 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
124 if( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ){
127 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
131 if ( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ) {
134 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
138 mvaValue =
std::min(mvaValue, mva_match);
139 isGsfElectronMatched =
true;
144 if ( !isGsfElectronMatched ) {
145 mvaValue =
mva_->MVAValue(*theTauRef);
146 bool hasGsfTrack =
false;
148 if(
abs(packedLeadTauCand->
pdgId()) == 11 ) hasGsfTrack =
true;
158 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
159 if( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ){
162 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
166 if ( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ) {
169 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
176 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
"<PATTauDiscriminationAgainstElectronMVA6::discriminate>:" ;
177 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" tau: Pt = " << theTauRef->pt() <<
", eta = " << theTauRef->eta() <<
", phi = " << theTauRef->phi();
178 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" deltaREleTau = " << deltaRDummy <<
", isGsfElectronMatched = " << isGsfElectronMatched;
179 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.
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::unique_ptr< AntiElectronIDMVA6 > mva_
edm::Handle< pat::ElectronCollection > Electrons