913 |
|
fDiphotonEvent-> eleIdMva = -99.; |
914 |
|
|
915 |
|
if( fApplyLeptonTag ) { |
916 |
+ |
|
917 |
|
// perform lepton tagging |
918 |
|
// the diphoton event record will have one more entry; i.e. leptonTag |
919 |
|
// leptonTag = -1 -> lepton-taggng was swicthed off |
950 |
|
fDiphotonEvent-> muNMatch = fLeptonTagMuons->At(0)->NMatches(); |
951 |
|
} |
952 |
|
} |
953 |
< |
if ( fDiphotonEvent->leptonTag < 2 && fLeptonTagElectrons->GetEntries() > 0 ) { |
953 |
> |
if ( fDiphotonEvent->leptonTag < 1 && fLeptonTagElectrons->GetEntries() > 0 ) { |
954 |
|
if( (MathUtils::DeltaR(fLeptonTagElectrons->At(0),phHard) >= 1) && |
955 |
|
(MathUtils::DeltaR(fLeptonTagElectrons->At(0),phSoft) >= 1) && |
956 |
|
(PhotonTools::ElectronVetoCiC(phHard,fLeptonTagElectrons) >= 1) && |
958 |
|
(TMath::Abs( (phHard->Mom()+fLeptonTagElectrons->At(0)->Mom()).M()-91.19 ) >= 10) && |
959 |
|
(TMath::Abs( (phSoft->Mom()+fLeptonTagElectrons->At(0)->Mom()).M()-91.19 ) >= 10) && |
960 |
|
((phHard->Pt()/(phHard->Mom() + phSoft->Mom()).M())>(45./120.)) && |
961 |
< |
((phSoft->Pt()/(phHard->Mom() + phSoft->Mom()).M())>(30./120.)) ){ |
961 |
> |
((phSoft->Pt()/(phHard->Mom() + phSoft->Mom()).M())>(30./120.))){ |
962 |
|
|
963 |
< |
fDiphotonEvent->leptonTag = 1; |
964 |
< |
|
965 |
< |
fDiphotonEvent-> elePt = fLeptonTagElectrons->At(0)->Pt(); |
966 |
< |
fDiphotonEvent-> eleEta = fLeptonTagElectrons->At(0)->Eta(); |
967 |
< |
fDiphotonEvent-> eleSCEta = fLeptonTagElectrons->At(0)->SCluster()->Eta(); |
968 |
< |
fDiphotonEvent-> eleIso1 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoRandomLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
969 |
< |
|
970 |
< |
fDiphotonEvent-> eleIso2 = -99.; |
971 |
< |
|
972 |
< |
if ( fDoSynching ) { |
972 |
< |
Double_t distVtx = 999.0; |
973 |
< |
for(UInt_t nv=0; nv<fPV->GetEntries(); nv++){ |
974 |
< |
double dz = TMath::Abs(fLeptonTagElectrons->At(0)->GsfTrk()->DzCorrected(*fPV->At(nv))); |
975 |
< |
if(dz < distVtx) { |
976 |
< |
distVtx = dz; |
977 |
< |
closestVtx = nv; |
963 |
> |
int ph1passeveto=1; |
964 |
> |
int ph2passeveto=1; |
965 |
> |
|
966 |
> |
for(UInt_t k=0;k<fElectrons->GetEntries();k++){ |
967 |
> |
if(fElectrons->At(k)->BestTrk()->NMissingHits()==0){ |
968 |
> |
if((fElectrons->At(k)->SCluster()==phHard->SCluster()) && (MathUtils::DeltaR(*fElectrons->At(k)->BestTrk(),*phHard) < 1)){ |
969 |
> |
ph1passeveto=0; |
970 |
> |
} |
971 |
> |
if((fElectrons->At(k)->SCluster()==phSoft->SCluster()) && (MathUtils::DeltaR(*fElectrons->At(k)->BestTrk(),*phSoft) < 1)){ |
972 |
> |
ph2passeveto=0; |
973 |
|
} |
974 |
|
} |
980 |
– |
fDiphotonEvent-> eleIdMva = fElectronIDMVA->MVAValue(fLeptonTagElectrons->At(0), fPV->At(closestVtx)); |
975 |
|
} |
976 |
< |
|
977 |
< |
// fDiphotonEvent-> eleIso2 = ElectronTools::ElectronEffectiveArea(ElectronTools::kEleGammaIso03,fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) + ElectronTools::ElectronEffectiveArea(ElectronTools::kEleNeutralHadronIso03, fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) ; |
978 |
< |
|
979 |
< |
fDiphotonEvent-> eleIso3 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
980 |
< |
fDiphotonEvent-> eleIso4 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->Rho() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
981 |
< |
fDiphotonEvent-> eleDist = fLeptonTagElectrons->At(0)->ConvPartnerDist(); |
982 |
< |
fDiphotonEvent-> eleDcot = fLeptonTagElectrons->At(0)->ConvPartnerDCotTheta(); |
983 |
< |
fDiphotonEvent-> eleCoviee = fLeptonTagElectrons->At(0)->CoviEtaiEta(); |
984 |
< |
fDiphotonEvent-> eleDphiin = TMath::Abs(fLeptonTagElectrons->At(0)->DeltaPhiSuperClusterTrackAtVtx()); |
985 |
< |
fDiphotonEvent-> eleDetain = TMath::Abs(fLeptonTagElectrons->At(0)->DeltaEtaSuperClusterTrackAtVtx()); |
986 |
< |
fDiphotonEvent-> eleDR1 = MathUtils::DeltaR(fLeptonTagElectrons->At(0),phHard); |
987 |
< |
fDiphotonEvent-> eleDR2 = MathUtils::DeltaR(fLeptonTagElectrons->At(0),phSoft); |
988 |
< |
fDiphotonEvent-> eleMass1 = (phHard->Mom()+fLeptonTagElectrons->At(0)->Mom()).M(); |
989 |
< |
fDiphotonEvent-> eleMass2 = (phSoft->Mom()+fLeptonTagElectrons->At(0)->Mom()).M(); |
976 |
> |
|
977 |
> |
if(ph1passeveto==1 && ph2passeveto==1){ |
978 |
> |
fDiphotonEvent->leptonTag = 1; |
979 |
> |
|
980 |
> |
fDiphotonEvent-> elePt = fLeptonTagElectrons->At(0)->Pt(); |
981 |
> |
fDiphotonEvent-> eleEta = fLeptonTagElectrons->At(0)->Eta(); |
982 |
> |
fDiphotonEvent-> eleSCEta = fLeptonTagElectrons->At(0)->SCluster()->Eta(); |
983 |
> |
fDiphotonEvent-> eleIso1 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoRandomLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
984 |
> |
|
985 |
> |
fDiphotonEvent-> eleIso2 = -99.; |
986 |
> |
|
987 |
> |
if ( fDoSynching ) { |
988 |
> |
Double_t distVtx = 999.0; |
989 |
> |
for(UInt_t nv=0; nv<fPV->GetEntries(); nv++){ |
990 |
> |
double dz = TMath::Abs(fLeptonTagElectrons->At(0)->GsfTrk()->DzCorrected(*fPV->At(nv))); |
991 |
> |
if(dz < distVtx) { |
992 |
> |
distVtx = dz; |
993 |
> |
closestVtx = nv; |
994 |
> |
} |
995 |
> |
} |
996 |
> |
fDiphotonEvent-> eleIdMva = fElectronIDMVA->MVAValue(fLeptonTagElectrons->At(0), fPV->At(closestVtx)); |
997 |
> |
} |
998 |
> |
|
999 |
> |
// fDiphotonEvent-> eleIso2 = ElectronTools::ElectronEffectiveArea(ElectronTools::kEleGammaIso03,fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) + ElectronTools::ElectronEffectiveArea(ElectronTools::kEleNeutralHadronIso03, fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) ; |
1000 |
> |
|
1001 |
> |
fDiphotonEvent-> eleIso3 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
1002 |
> |
fDiphotonEvent-> eleIso4 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->Rho() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt; |
1003 |
> |
fDiphotonEvent-> eleDist = fLeptonTagElectrons->At(0)->ConvPartnerDist(); |
1004 |
> |
fDiphotonEvent-> eleDcot = fLeptonTagElectrons->At(0)->ConvPartnerDCotTheta(); |
1005 |
> |
fDiphotonEvent-> eleCoviee = fLeptonTagElectrons->At(0)->CoviEtaiEta(); |
1006 |
> |
fDiphotonEvent-> eleDphiin = TMath::Abs(fLeptonTagElectrons->At(0)->DeltaPhiSuperClusterTrackAtVtx()); |
1007 |
> |
fDiphotonEvent-> eleDetain = TMath::Abs(fLeptonTagElectrons->At(0)->DeltaEtaSuperClusterTrackAtVtx()); |
1008 |
> |
fDiphotonEvent-> eleDR1 = MathUtils::DeltaR(fLeptonTagElectrons->At(0),phHard); |
1009 |
> |
fDiphotonEvent-> eleDR2 = MathUtils::DeltaR(fLeptonTagElectrons->At(0),phSoft); |
1010 |
> |
fDiphotonEvent-> eleMass1 = (phHard->Mom()+fLeptonTagElectrons->At(0)->Mom()).M(); |
1011 |
> |
fDiphotonEvent-> eleMass2 = (phSoft->Mom()+fLeptonTagElectrons->At(0)->Mom()).M(); |
1012 |
|
fDiphotonEvent-> eleNinnerHits = fLeptonTagElectrons->At(0)->Trk()->NExpectedHitsInner(); |
1013 |
+ |
} |
1014 |
|
} |
1015 |
|
} |
1016 |
|
|
1017 |
|
if(false){ |
1018 |
< |
if(fDiphotonEvent->evt==197022547 || fDiphotonEvent->evt==172664113 || fDiphotonEvent->evt==332789938 || fDiphotonEvent->evt==465586356){ |
1018 |
> |
if(fDiphotonEvent->evt==79737729 || fDiphotonEvent->evt==197022547 || fDiphotonEvent->evt==172664113 || fDiphotonEvent->evt==332789938 || fDiphotonEvent->evt==465586356){ |
1019 |
|
printf("ming sync check 0: run:%d evt:%d lumi:%d leptonTag:%d numelectrons:%d idmva:%f mass:%f\n elePt:%f eleEta:%f eleSCEta:%f vtx:%d\n",fDiphotonEvent->run,fDiphotonEvent->evt,fDiphotonEvent->lumi,fDiphotonEvent->leptonTag,fLeptonTagElectrons->GetEntries(),fDiphotonEvent->eleIdMva,_mass,fDiphotonEvent->elePt,fDiphotonEvent->eleEta,fDiphotonEvent->eleSCEta,closestVtx); |
1020 |
|
} |
1021 |
|
} |