78 |
|
int iSign) { |
79 |
|
FourVectorM lVec(0,0,0,0); |
80 |
|
double lPt = fJetIDMVA->correctedPt(iJet,iJetCorrector,iPUEnergyDensity); |
81 |
< |
if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iPUEnergyDensity->At(0)->Rho(),0.); |
81 |
> |
//if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iPUEnergyDensity->At(0)->Rho(),0.); |
82 |
|
lPt *= (iJet->NeutralEmEnergy()/iJet->RawMom().E() + iJet->NeutralHadronEnergy()/iJet->RawMom().E()); |
83 |
|
lVec.SetPt(lPt); lVec.SetEta(iJet->Eta()); lVec.SetPhi(iJet->Phi()); lVec.SetM(iJet->Mass()); |
84 |
|
if(iSign > 0) iVec -= lVec; |
85 |
|
if(iSign < 0) iVec += lVec; |
86 |
< |
iSumEt += lPt; |
86 |
> |
//iSumEt += lPt; |
87 |
|
//=== Above was a bug in the training |
88 |
< |
//if(iSign > 0) iSumEt += lPt; |
89 |
< |
//if(iSign < 0) iSumEt -= lPt; |
88 |
> |
if(iSign > 0) iSumEt += lPt; |
89 |
> |
if(iSign < 0) iSumEt -= lPt; |
90 |
|
} |
91 |
|
|
92 |
|
//-------------------------------------------------------------------------------------------------- |
94 |
|
void RecoilTools::addNeut(const PFJet *iJet,FourVectorM &iVec,Double_t &iSumEt,double iRho,int iSign) { |
95 |
|
FourVectorM lVec(0,0,0,0); |
96 |
|
double lPt = iJet->Pt(); |
97 |
< |
if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iRho,0.);//to be fixed |
97 |
> |
//if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iRho,0.);//to be fixed |
98 |
|
//if(iJet->RawMom().Pt() < 10) lPt = iJet->RawMom().Pt()*iJet->L1OffsetCorrectionScale(); |
99 |
|
lPt *= (iJet->NeutralEmEnergy()/iJet->RawMom().E() + iJet->NeutralHadronEnergy()/iJet->RawMom().E()); |
100 |
|
lVec.SetPt(lPt); lVec.SetEta(iJet->Eta()); lVec.SetPhi(iJet->Phi()); lVec.SetM(iJet->Mass()); |
101 |
|
if(iSign > 0) iVec -= lVec; |
102 |
|
if(iSign < 0) iVec += lVec; |
103 |
< |
iSumEt += lPt; |
103 |
> |
//iSumEt += lPt; |
104 |
|
//=== Above was a bug in the training |
105 |
< |
//if(iSign > 0) iSumEt += lPt; |
106 |
< |
//if(iSign < 0) iSumEt -= lPt; |
105 |
> |
if(iSign > 0) iSumEt += lPt; |
106 |
> |
if(iSign < 0) iSumEt -= lPt; |
107 |
|
} |
108 |
|
|
109 |
|
//-------------------------------------------------------------------------------------------------- |
118 |
|
const Track* pTrack = pPF->TrackerTrk(); |
119 |
|
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
120 |
|
if(pTrack == 0 ) continue; |
121 |
< |
lSumEt += pPF->Pt(); //=> another bug |
122 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
121 |
> |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
122 |
|
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
123 |
+ |
lSumEt += pPF->Pt(); |
124 |
|
lVec -= pPF->Mom(); |
125 |
|
} |
126 |
|
int lNPass = 0; |
127 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
128 |
|
const PFJet *pJet = iJets->At(i0); |
129 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning==> if not done already |
130 |
< |
double lPt = fJetIDMVA->correctedPt(pJet,iJetCorrector,iPileupEnergyDensity); |
131 |
< |
//if(fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) |
132 |
< |
// std::cout << " =====> Jet Passes Id : " << lPt << " -- " << pJet->Eta() << " --- " << fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity) << std::endl; |
133 |
< |
//if(!fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) |
134 |
< |
// std::cout << " =====> Jet Fails Id : " << lPt << " -- " << pJet->Eta() << " --- " << fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity) << std::endl; |
129 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
130 |
|
if(!fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
131 |
|
addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity); |
132 |
|
lNPass++; |
147 |
|
const Track* pTrack = pPF->TrackerTrk(); |
148 |
|
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
149 |
|
if(pTrack == 0 ) continue; |
155 |
– |
lSumEt += pPF->Pt(); //=> another bug |
150 |
|
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
151 |
|
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
152 |
|
lVec -= pPF->Mom(); |
153 |
+ |
lSumEt += pPF->Pt(); |
154 |
|
} |
155 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
156 |
|
const PFJet *pJet = iJets->At(i0); |
157 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning==> if not done already |
163 |
< |
//if(fJetIDMVA->pass(pJet,iVertex,iVertices)) |
164 |
< |
// std::cout << " =====> Jet Passes Id : " << pJet->Pt() << " -- " << pJet->Eta() << " --- " << fJetIDMVA->pass(pJet,iVertex,iVertices) << std::endl; |
165 |
< |
//if(!fJetIDMVA->pass(pJet,iVertex,iVertices)) |
166 |
< |
// std::cout << " =====> Jet Fails Id : " << pJet->Pt() << " -- " << pJet->Eta() << " --- " << fJetIDMVA->pass(pJet,iVertex,iVertices) << std::endl; |
157 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
158 |
|
if(!fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
159 |
|
addNeut(pJet,lVec,lSumEt,iRho); |
160 |
|
} |