83 bool isGsfElectronMatched =
false;
84 float deltaRDummy = 9.9;
85 const float ECALBarrelEndcapEtaBorder = 1.479;
86 float tauEtaAtEcalEntrance = theTauRef->etaAtEcalEntrance();
87 float leadChargedPFCandEtaAtEcalEntrance = theTauRef->etaAtEcalEntranceLeadChargedCand();
89 if( (*theTauRef).leadChargedHadrCand().isNonnull()) {
90 int numSignalPFGammaCandsInSigCone = 0;
93 double dR =
deltaR((*gamma)->p4(), theTauRef->leadChargedHadrCand()->p4());
97 numSignalPFGammaCandsInSigCone += 1;
101 for(
unsigned int ie = 0; ie <
Electrons->size(); ++ie ){
103 if ( theElectron.
pt() > 10. ) {
104 double deltaREleTau =
deltaR(theElectron.
p4(), theTauRef->p4());
105 deltaRDummy = deltaREleTau;
106 if( deltaREleTau < 0.3 ){
108 bool hasGsfTrack = 0;
110 if(
abs(packedLeadTauCand->
pdgId()) == 11 )
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 ) {
146 bool hasGsfTrack = 0;
148 if(
abs(packedLeadTauCand->
pdgId()) == 11 ) hasGsfTrack = 1;
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();
virtual double pt() const final
transverse momentum
bool isNonnull() const
Checks for non-null.
const LorentzVector & p4(P4Kind kind) const
int pdgId() const override
PDG identifier.
std::unique_ptr< PATTauDiscriminator > category_output_
const_iterator begin() const
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
Abs< T >::type abs(const T &t)
const_iterator end() const
bool isInEcalCrack(double) const
T const * get() const
Returns C++ pointer to the item.
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool usePhiAtEcalEntranceExtrapolation_
std::unique_ptr< AntiElectronIDMVA6 > mva_
Analysis-level electron class.
edm::Handle< pat::ElectronCollection > Electrons