8 |
|
|
9 |
|
RecoilTools::RecoilTools(TString iJetLowPtMVAFile,TString iJetHighPtMVAFile,TString iCutFile) { |
10 |
|
fJetIDMVA = new JetIDMVA(); |
11 |
< |
fJetIDMVA->Initialize( JetIDMVA::kLoose,iJetLowPtMVAFile,iJetHighPtMVAFile,JetIDMVA::kBaseline,iCutFile); |
11 |
> |
fJetIDMVA->Initialize( JetIDMVA::kMET,iJetLowPtMVAFile,iJetHighPtMVAFile,JetIDMVA::kBaseline,iCutFile); |
12 |
|
} |
13 |
|
//-------------------------------------------------------------------------------------------------- |
14 |
|
RecoilTools::~RecoilTools() { |
44 |
|
double trkSumEt = 0; |
45 |
|
for(UInt_t i=0; i<iCands->GetEntries(); ++i) { |
46 |
|
const PFCandidate *pfcand = iCands->At(i); |
47 |
< |
if( (pfcand->HasTrackerTrk() && (fabs(pfcand->TrackerTrk()->DzCorrected(*iVertex))< iDZCut)) || |
48 |
< |
(pfcand->HasGsfTrk() && (fabs(pfcand->GsfTrk()->DzCorrected(*iVertex)) < iDZCut)) ) { |
47 |
> |
if( (pfcand->HasTrackerTrk() && (fabs(pfcand->TrackerTrk()->DzCorrected(*iVertex))< iDZCut)) ) { |
48 |
> |
//(pfcand->HasGsfTrk() && (fabs(pfcand->GsfTrk()->DzCorrected(*iVertex)) < iDZCut)) ) { |
49 |
|
trkMetx -= pfcand->Px(); |
50 |
|
trkMety -= pfcand->Py(); |
51 |
|
trkSumEt += pfcand->Pt(); |
75 |
|
int iSign) { |
76 |
|
FourVectorM lVec(0,0,0,0); |
77 |
|
double lPt = fJetIDMVA->correctedPt(iJet,iJetCorrector,iPUEnergyDensity); |
78 |
+ |
if(iJet->RawMom().Pt() < 10) lPt = TMath::Max(iJet->RawMom().Pt()-iJet->JetArea()*iPUEnergyDensity->At(0)->Rho(),0.); |
79 |
|
lPt *= (iJet->NeutralEmEnergy()/iJet->E() + iJet->NeutralHadronEnergy()/iJet->E()); |
80 |
|
lVec.SetPt(lPt); lVec.SetEta(iJet->Eta()); lVec.SetPhi(iJet->Phi()); lVec.SetM(iJet->Mass()); |
81 |
|
if(iSign > 0) iVec -= lVec; |
91 |
|
void RecoilTools::addNeut(const PFJet *iJet,FourVectorM &iVec,Double_t &iSumEt,int iSign) { |
92 |
|
FourVectorM lVec(0,0,0,0); |
93 |
|
double lPt = iJet->Pt(); |
94 |
< |
lPt *= (iJet->NeutralEmEnergy()/iJet->E() + iJet->NeutralHadronEnergy()/iJet->E()); |
94 |
> |
if(iJet->RawMom().Pt() < 10) lPt = iJet->RawMom().Pt()*iJet->L1OffsetCorrectionScale(); |
95 |
> |
lPt *= (iJet->NeutralEmEnergy()/iJet->RawMom().E() + iJet->NeutralHadronEnergy()/iJet->RawMom().E()); |
96 |
|
lVec.SetPt(lPt); lVec.SetEta(iJet->Eta()); lVec.SetPhi(iJet->Phi()); lVec.SetM(iJet->Mass()); |
97 |
|
if(iSign > 0) iVec -= lVec; |
98 |
|
if(iSign < 0) iVec += lVec; |