81 bool isGsfElectronMatched =
false;
82 float deltaRDummy = 9.9;
83 const float ECALBarrelEndcapEtaBorder = 1.479;
84 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
85 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
87 if( (*theTauRef).leadChargedHadrCand().isNonnull()) {
88 int numSignalPFGammaCandsInSigCone = 0;
90 for (
const auto &
gamma : signalGammaCands ) {
91 double dR =
deltaR(
gamma->p4(), theTauRef->leadChargedHadrCand()->p4());
95 numSignalPFGammaCandsInSigCone += 1;
99 for (
const auto & theElectron : *
Electrons ) {
100 if ( theElectron.pt() > 10. ) {
101 double deltaREleTau =
deltaR(theElectron.p4(), theTauRef->p4());
102 deltaRDummy = deltaREleTau;
103 if( deltaREleTau < 0.3 ){
104 double mva_match =
mva_->MVAValue(*theTauRef, theElectron);
105 bool hasGsfTrack =
false;
107 if(
abs(packedLeadTauCand->
pdgId()) == 11 )
110 hasGsfTrack = theElectron.gsfTrack().isNonnull();
120 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
121 if( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ){
124 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
128 if ( numSignalPFGammaCandsInSigCone == 0 && hasGsfTrack ) {
131 else if ( numSignalPFGammaCandsInSigCone >= 1 && hasGsfTrack ) {
135 mvaValue =
std::min(mvaValue, mva_match);
136 isGsfElectronMatched =
true;
141 if ( !isGsfElectronMatched ) {
142 mvaValue =
mva_->MVAValue(*theTauRef);
143 bool hasGsfTrack =
false;
145 if(
abs(packedLeadTauCand->
pdgId()) == 11 ) hasGsfTrack =
true;
155 if(
std::abs(tauEtaAtEcalEntrance) < ECALBarrelEndcapEtaBorder ){
156 if( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ){
159 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
163 if ( numSignalPFGammaCandsInSigCone == 0 && !hasGsfTrack ) {
166 else if ( numSignalPFGammaCandsInSigCone >= 1 && !hasGsfTrack ) {
173 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
"<PATTauDiscriminationAgainstElectronMVA6::discriminate>:" ;
174 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" tau: Pt = " << theTauRef->pt() <<
", eta = " << theTauRef->eta() <<
", phi = " << theTauRef->phi();
175 edm::LogPrint(
"PATTauAgainstEleMVA6") <<
" deltaREleTau = " << deltaRDummy <<
", isGsfElectronMatched = " << isGsfElectronMatched;
176 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