6 |
|
|
7 |
|
using namespace mithep; |
8 |
|
|
9 |
< |
RecoilTools::RecoilTools(TString iJetLowPtMVAFile,TString iJetHighPtMVAFile,TString iCutFile) { |
9 |
> |
RecoilTools::RecoilTools(TString iJetLowPtMVAFile,TString iJetHighPtMVAFile,TString iCutFile,bool i42,JetIDMVA::MVAType iType) { |
10 |
|
fJetIDMVA = new JetIDMVA(); |
11 |
< |
fJetIDMVA->Initialize( JetIDMVA::kMET,iJetLowPtMVAFile,iJetHighPtMVAFile,JetIDMVA::kBaseline,iCutFile); |
11 |
> |
fJetIDMVA->Initialize( JetIDMVA::kMET,iJetLowPtMVAFile,iJetHighPtMVAFile,iType,iCutFile); |
12 |
> |
f42 = i42; |
13 |
|
} |
14 |
|
//-------------------------------------------------------------------------------------------------- |
15 |
|
RecoilTools::~RecoilTools() { |
46 |
|
FourVectorM lVec(0,0,0,0); |
47 |
|
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
48 |
|
lVec -= iCands->At(i0)->Mom(); |
49 |
< |
lSumEt += iCands->At(i0)->Et(); |
49 |
> |
lSumEt += iCands->At(i0)->Pt(); |
50 |
|
} |
51 |
|
Met lPFMet(lVec.Px(),lVec.Py()); |
52 |
|
lPFMet.SetSumEt(lSumEt); |
64 |
|
const PFCandidate *pfcand = iCands->At(i0); |
65 |
|
if(!filter(pfcand,iPhi1,iEta1,iPhi2,iEta2)) continue; |
66 |
|
lVec -= pfcand->Mom(); |
67 |
< |
lSumEt += pfcand->Et(); |
67 |
> |
lSumEt += pfcand->Pt(); |
68 |
> |
} |
69 |
> |
Met lPFMet(lVec.Px(),lVec.Py()); |
70 |
> |
lPFMet.SetSumEt(lSumEt); |
71 |
> |
return lPFMet; |
72 |
> |
|
73 |
> |
} |
74 |
> |
//-------------------------------------------------------------------------------------------------- |
75 |
> |
void RecoilTools::addType1(FourVectorM &iVec,Double_t &iSumEt, |
76 |
> |
const PFJetCol *iJets,FactorizedJetCorrector *iJetCorrector,const PileupEnergyDensityCol *iPUEnergyDensity, |
77 |
> |
double iPhi1,double iEta1,double iPhi2,double iEta2) { |
78 |
> |
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
79 |
> |
const PFJet *pJet = iJets->At(i0); |
80 |
> |
if(!JetTools::passPFLooseId(pJet)) continue; |
81 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
82 |
> |
if(fJetIDMVA->correctedPt(pJet,iJetCorrector,iPUEnergyDensity) < 10) continue; |
83 |
> |
double lPt = fJetIDMVA->correctedPt(pJet,iJetCorrector,iPUEnergyDensity,RhoUtilities::DEFAULT,100); |
84 |
> |
FourVectorM pVec(0,0,0,0); |
85 |
> |
pVec.SetPt(lPt); pVec.SetEta(pJet->Eta()); pVec.SetPhi(pJet->Phi()); pVec.SetM(pJet->Mass()); |
86 |
> |
iVec -= pVec; |
87 |
> |
iSumEt += pVec.Pt(); |
88 |
> |
} |
89 |
> |
} |
90 |
> |
//-------------------------------------------------------------------------------------------------- |
91 |
> |
Met RecoilTools::pfRecoilType1(Double_t iVisPt,Double_t iVisPhi,Double_t iVisSumEt, |
92 |
> |
const PFCandidateCol *iCands,const PFJetCol *iJets, |
93 |
> |
FactorizedJetCorrector *iJetCorrector,const PileupEnergyDensityCol *iPUEnergyDensity, |
94 |
> |
double iPhi1,double iEta1,double iPhi2,double iEta2) { |
95 |
> |
double lSumEt = 0; |
96 |
> |
FourVectorM lVec(0,0,0,0); |
97 |
> |
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
98 |
> |
lVec -= iCands->At(i0)->Mom(); |
99 |
> |
lSumEt += iCands->At(i0)->Pt(); |
100 |
> |
} |
101 |
> |
addType1(lVec,lSumEt,iJets,iJetCorrector,iPUEnergyDensity,iPhi1,iEta1,iPhi2,iEta2); |
102 |
> |
Met lPFMet(lVec.Px(),lVec.Py()); |
103 |
> |
lPFMet.SetSumEt(lSumEt); |
104 |
> |
lPFMet.SetMex (lPFMet.Mex()+iVisPt*cos(iVisPhi)); |
105 |
> |
lPFMet.SetMey (lPFMet.Mey()+iVisPt*sin(iVisPhi)); |
106 |
> |
lPFMet.SetSumEt(lPFMet.SumEt()-iVisSumEt); |
107 |
> |
return lPFMet; |
108 |
> |
} |
109 |
> |
//-------------------------------------------------------------------------------------------------- |
110 |
> |
Met RecoilTools::pfCone(double iPhi1,double iEta1, |
111 |
> |
const PFCandidateCol *iCands,const Vertex *iVertex,bool iCharge,Double_t iDZCut) { |
112 |
> |
double lSumEt = 0; |
113 |
> |
FourVectorM lVec(0,0,0,0); |
114 |
> |
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
115 |
> |
const PFCandidate *pfcand = iCands->At(i0); |
116 |
> |
if(filter(pfcand,iPhi1,iEta1,100,100)) continue; |
117 |
> |
if(iCharge) { |
118 |
> |
double lDZ = -999; |
119 |
> |
if(pfcand->HasTrackerTrk()) lDZ = fabs(pfcand->TrackerTrk()->DzCorrected(*iVertex));// |
120 |
> |
else if(pfcand->HasGsfTrk()) lDZ = fabs(pfcand->GsfTrk() ->DzCorrected(*iVertex)); |
121 |
> |
if( fabs(lDZ) > iDZCut) continue; |
122 |
> |
} |
123 |
> |
lVec += pfcand->Mom(); |
124 |
> |
lSumEt += pfcand->Pt(); |
125 |
|
} |
126 |
|
Met lPFMet(lVec.Px(),lVec.Py()); |
127 |
|
lPFMet.SetSumEt(lSumEt); |
134 |
|
double trkSumEt = 0; |
135 |
|
for(UInt_t i0=0; i0<iCands->GetEntries(); i0++) { |
136 |
|
const PFCandidate *pfcand = iCands->At(i0); |
137 |
< |
if( (pfcand->HasTrackerTrk() && (fabs(pfcand->TrackerTrk()->DzCorrected(*iVertex))< iDZCut)) || |
138 |
< |
(pfcand->HasGsfTrk() && (fabs(pfcand->GsfTrk()->DzCorrected(*iVertex)) < iDZCut)) ) { |
139 |
< |
trkMetx -= pfcand->Px(); |
140 |
< |
trkMety -= pfcand->Py(); |
141 |
< |
trkSumEt += pfcand->Pt(); |
142 |
< |
} |
137 |
> |
double lDZ = -999; |
138 |
> |
if(pfcand->HasTrackerTrk()) lDZ = fabs(pfcand->TrackerTrk()->DzCorrected(*iVertex));// |
139 |
> |
else if(pfcand->HasGsfTrk()) lDZ = fabs(pfcand->GsfTrk() ->DzCorrected(*iVertex)); |
140 |
> |
if( fabs(lDZ) > iDZCut) continue; |
141 |
> |
trkMetx -= pfcand->Px(); |
142 |
> |
trkMety -= pfcand->Py(); |
143 |
> |
trkSumEt += pfcand->Pt(); |
144 |
|
} |
145 |
|
Met lMet(trkMetx,trkMety); |
146 |
|
lMet.SetSumEt(trkSumEt); |
183 |
|
FactorizedJetCorrector *iJetCorrector,const PileupEnergyDensityCol *iPUEnergyDensity, |
184 |
|
int iSign) { |
185 |
|
FourVectorM lVec(0,0,0,0); |
186 |
< |
double lPt = fJetIDMVA->correctedPt(iJet,iJetCorrector,iPUEnergyDensity); |
187 |
< |
//if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iPUEnergyDensity->At(0)->Rho(),0.); |
188 |
< |
lPt *= (iJet->NeutralEmEnergy()/iJet->RawMom().E() + iJet->NeutralHadronEnergy()/iJet->RawMom().E()); |
186 |
> |
double lPt = fJetIDMVA->correctedPt(iJet,iJetCorrector,iPUEnergyDensity); |
187 |
> |
double lFrac = (iJet->NeutralEmEnergy()/iJet->RawMom().E() + iJet->NeutralHadronEnergy()/iJet->RawMom().E()); |
188 |
> |
if(fabs(iJet->Eta()) > 2.5 && !f42) lFrac = 1.; |
189 |
> |
lPt *= lFrac; |
190 |
|
lVec.SetPt(lPt); lVec.SetEta(iJet->Eta()); lVec.SetPhi(iJet->Phi()); lVec.SetM(iJet->Mass()); |
191 |
|
if(iSign > 0) iVec -= lVec; |
192 |
|
if(iSign < 0) iVec += lVec; |
222 |
|
FourVectorM lVec (0,0,0,0); double lSumEt = 0; |
223 |
|
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
224 |
|
const PFCandidate *pPF = iCands->At(i0); |
225 |
< |
const Track* pTrack = pPF->TrackerTrk(); |
226 |
< |
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
227 |
< |
if(pTrack == 0 ) continue; |
228 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
169 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
225 |
> |
double lDZ = 999; |
226 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
227 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
228 |
> |
if( fabs(lDZ) > iDZCut) continue; |
229 |
|
lSumEt += pPF->Pt(); |
230 |
|
lVec -= pPF->Mom(); |
231 |
|
} |
232 |
|
int lNPass = 0; |
233 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
234 |
|
const PFJet *pJet = iJets->At(i0); |
235 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
235 |
> |
if(!JetTools::passPFLooseId(pJet)) continue; |
236 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
237 |
> |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
238 |
|
if(!fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
239 |
+ |
double pDPhi1 = fabs(pJet->Phi() - iPhi1); if(pDPhi1 > 2.*TMath::Pi()-pDPhi1) pDPhi1 = 2.*TMath::Pi()-pDPhi1; |
240 |
+ |
double pDPhi2 = fabs(pJet->Phi() - iPhi2); if(pDPhi2 > 2.*TMath::Pi()-pDPhi2) pDPhi2 = 2.*TMath::Pi()-pDPhi2; |
241 |
|
addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity); |
242 |
|
lNPass++; |
243 |
|
} |
254 |
|
FourVectorM lVec (0,0,0,0); double lSumEt = 0; |
255 |
|
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
256 |
|
const PFCandidate *pPF = iCands->At(i0); |
257 |
< |
const Track* pTrack = pPF->TrackerTrk(); |
258 |
< |
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
259 |
< |
if(pTrack == 0 ) continue; |
260 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
198 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
257 |
> |
double lDZ = 999; |
258 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
259 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
260 |
> |
if( fabs(lDZ) > iDZCut) continue; |
261 |
|
lVec -= pPF->Mom(); |
262 |
|
lSumEt += pPF->Pt(); |
263 |
|
} |
264 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
265 |
|
const PFJet *pJet = iJets->At(i0); |
266 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
266 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
267 |
> |
if(!fJetIDMVA->passPt(pJet)) continue; |
268 |
|
if(!fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
269 |
|
addNeut(pJet,lVec,lSumEt,iRho); |
270 |
|
} |
284 |
|
for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) { |
285 |
|
const PFCandidate *pPF = iCands->At(i0); |
286 |
|
if(!filter(pPF,iPhi1,iEta1,iPhi2,iEta2)) continue; |
287 |
< |
const Track* pTrack = pPF->TrackerTrk(); |
288 |
< |
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
289 |
< |
if(pTrack == 0 ) continue; |
290 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
228 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
287 |
> |
double lDZ = 999; |
288 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
289 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
290 |
> |
if( fabs(lDZ) > iDZCut) continue; |
291 |
|
lSumEt += pPF->Pt(); |
292 |
|
lVec -= pPF->Mom(); |
293 |
|
} |
295 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
296 |
|
const PFJet *pJet = iJets->At(i0); |
297 |
|
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
298 |
+ |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
299 |
|
if(iJetCorrector != 0 && iPileupEnergyDensity != 0) if(!fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
300 |
|
if(iJetCorrector == 0 || iPileupEnergyDensity == 0) if(!fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
301 |
|
if(iJetCorrector != 0 && iPileupEnergyDensity != 0) addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity); |
356 |
|
pPF->PFType() == PFCandidate::eHadronHF )) |
357 |
|
{lVec -= pPF->Mom(); lSumEt += pPF->Pt();} |
358 |
|
if(pTrack == 0 ) continue; |
359 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
360 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
359 |
> |
double lDZ = 999; |
360 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
361 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
362 |
> |
if( fabs(lDZ) > iDZCut) continue; |
363 |
|
lVec -= pPF->Mom(); |
364 |
|
lSumEt += pPF->Pt(); |
365 |
|
} |
366 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
367 |
|
const PFJet *pJet = iJets->At(i0); |
368 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
369 |
+ |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
370 |
|
if(fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
371 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning==> if not done already |
371 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
372 |
|
addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity,-1); |
373 |
|
} |
374 |
|
Met lMet(lVec.Px(),lVec.Py()); |
394 |
|
pPF->PFType() == PFCandidate::eHadronHF )) |
395 |
|
{lVec -= pPF->Mom(); lSumEt += pPF->Pt();} |
396 |
|
if(pTrack == 0 ) continue; |
397 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
398 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
397 |
> |
double lDZ = 999; |
398 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
399 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
400 |
> |
if( fabs(lDZ) > iDZCut) continue; |
401 |
|
lVec -= pPF->Mom(); |
402 |
|
lSumEt += pPF->Pt(); |
403 |
|
} |
404 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
405 |
|
const PFJet *pJet = iJets->At(i0); |
406 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
407 |
+ |
if(!fJetIDMVA->passPt(pJet)) continue; |
408 |
|
if(fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
409 |
|
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning==> if not done already |
410 |
|
addNeut(pJet,lVec,lSumEt,iRho,-1); |
435 |
|
pPF->PFType() == PFCandidate::eHadronHF )) |
436 |
|
{lVec -= pPF->Mom(); lSumEt += pPF->Pt();} |
437 |
|
if(pTrack == 0 ) continue; |
438 |
< |
if( !((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
439 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
438 |
> |
double lDZ = 999; |
439 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
440 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
441 |
> |
if( fabs(lDZ) > iDZCut) continue; |
442 |
|
lVec -= pPF->Mom(); |
443 |
|
lSumEt += pPF->Pt(); |
444 |
|
} |
445 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
446 |
|
const PFJet *pJet = iJets->At(i0); |
447 |
|
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning==> if not done already |
448 |
+ |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
449 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
450 |
|
if(iJetCorrector != 0 && iPileupEnergyDensity != 0) if(fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
451 |
|
if(iJetCorrector == 0 || iPileupEnergyDensity == 0) if(fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
499 |
|
const Track* pTrack = pPF->TrackerTrk(); |
500 |
|
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
501 |
|
if(pTrack == 0 ) continue; |
502 |
< |
if( ((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
503 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
502 |
> |
double lDZ = 999; |
503 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
504 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
505 |
> |
if( fabs(lDZ) < iDZCut) continue; |
506 |
|
lVec -= pPF->Mom(); |
507 |
|
lSumEt += pPF->Pt(); |
508 |
|
} |
509 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
510 |
|
const PFJet *pJet = iJets->At(i0); |
511 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
512 |
< |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning |
512 |
> |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
513 |
> |
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; |
514 |
|
if(fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
515 |
|
addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity); |
516 |
|
} |
531 |
|
const Track* pTrack = pPF->TrackerTrk(); |
532 |
|
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
533 |
|
if(pTrack == 0 ) continue; |
534 |
< |
if( ((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
535 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
534 |
> |
double lDZ = 999; |
535 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
536 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
537 |
> |
if( fabs(lDZ) < iDZCut) continue; |
538 |
|
lVec -= pPF->Mom(); |
539 |
|
lSumEt += pPF->Pt(); |
540 |
|
} |
541 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
542 |
|
const PFJet *pJet = iJets->At(i0); |
543 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
544 |
+ |
if(!fJetIDMVA->passPt(pJet)) continue; |
545 |
|
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning |
546 |
|
if(fJetIDMVA->pass(pJet,iVertex,iVertices)) continue; |
547 |
|
addNeut(pJet,lVec,lSumEt,iRho); |
565 |
|
const Track* pTrack = pPF->TrackerTrk(); |
566 |
|
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
567 |
|
if(pTrack == 0 ) continue; |
568 |
< |
if( ((pPF->HasTrackerTrk() && (fabs(pPF->TrackerTrk()->DzCorrected(*iVertex))<iDZCut)) || |
569 |
< |
(pPF->HasGsfTrk() && (fabs(pPF->GsfTrk()->DzCorrected(*iVertex)) <iDZCut)))) continue; |
568 |
> |
double lDZ = 999; |
569 |
> |
if(pPF->HasTrackerTrk()) lDZ = fabs(pPF->TrackerTrk()->DzCorrected(*iVertex));// |
570 |
> |
else if(pPF->HasGsfTrk()) lDZ = fabs(pPF->GsfTrk() ->DzCorrected(*iVertex)); |
571 |
> |
if( fabs(lDZ) < iDZCut) continue; |
572 |
|
lVec -= pPF->Mom(); |
573 |
|
lSumEt += pPF->Pt(); |
574 |
|
} |
575 |
|
for(UInt_t i0 = 0; i0 < iJets->GetEntries(); i0++) { |
576 |
|
const PFJet *pJet = iJets->At(i0); |
577 |
|
if(!JetTools::passPFLooseId(pJet)) continue; |
578 |
+ |
if(!fJetIDMVA->passPt(pJet,iJetCorrector,iPileupEnergyDensity)) continue; |
579 |
|
if(!filter(pJet,iPhi1,iEta1,iPhi2,iEta2)) continue; //Quick cleaning |
580 |
|
if(fJetIDMVA->pass(pJet,iVertex,iVertices,iJetCorrector,iPileupEnergyDensity)) continue; |
581 |
|
addNeut(pJet,lVec,lSumEt,iJetCorrector,iPileupEnergyDensity); |