505 |
|
const PFCandidate *pCand = iJet->PFCand(i0); |
506 |
|
if(iPFType != -1 && pCand->PFType() != iPFType) continue; |
507 |
|
double pDR = MathUtils::DeltaR(iJet->Mom(),pCand->Mom()); |
508 |
< |
lDRMean += pDR*(pCand->Pt())/iJet->Pt(); |
508 |
> |
lDRMean += pDR*(pCand->Pt())/iJet->RawMom().Pt(); |
509 |
|
} |
510 |
|
return lDRMean; |
511 |
|
} |
512 |
+ |
Double_t JetTools::frac(const PFJet *iJet,Double_t iDRMax,Double_t iDRMin,Int_t iPFType) { |
513 |
+ |
double lFrac = 0; |
514 |
+ |
for(UInt_t i0 = 0; i0 < iJet->NPFCands(); i0++) { |
515 |
+ |
const PFCandidate *pCand = iJet->PFCand(i0); |
516 |
+ |
if(iPFType != -1 && pCand->PFType() != iPFType) continue; |
517 |
+ |
Double_t pDR = MathUtils::DeltaR(iJet->Mom(),pCand->Mom()); |
518 |
+ |
if(pDR > iDRMax) continue; |
519 |
+ |
if(pDR < iDRMax-0.1) continue; |
520 |
+ |
lFrac += pCand->Pt()/iJet->Pt(); |
521 |
+ |
} |
522 |
+ |
return lFrac; |
523 |
+ |
} |
524 |
+ |
Double_t JetTools::betaStar(const PFJet *iJet,const Vertex *iVertex,const VertexCol* iVertices,Double_t iDZCut) { |
525 |
+ |
Double_t lTotal = 0; |
526 |
+ |
Double_t lPileup = 0; |
527 |
+ |
for(UInt_t i0 = 0; i0 < iJet->NPFCands(); i0++) { |
528 |
+ |
const PFCandidate* pPF = iJet->PFCand(i0); |
529 |
+ |
const Track* pTrack = pPF->TrackerTrk(); |
530 |
+ |
if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); |
531 |
+ |
if(pTrack == 0) continue; |
532 |
+ |
|
533 |
+ |
lTotal += pPF->Pt(); |
534 |
+ |
for(unsigned int i1 = 0; i1 < iVertices->GetEntries(); i1++) { |
535 |
+ |
const Vertex *pV = iVertices->At(i1); |
536 |
+ |
if(fabs(pTrack->DzCorrected(*pV)) < iDZCut && |
537 |
+ |
(pV->Position() - iVertex->Position()).R() > 0.02 ) |
538 |
+ |
{ lPileup +=pPF->Pt();} |
539 |
+ |
} |
540 |
+ |
} |
541 |
+ |
if(lTotal == 0) lTotal = 1; |
542 |
+ |
return lPileup/(lTotal); |
543 |
+ |
} |
544 |
|
Bool_t JetTools::passPFLooseId(const PFJet *iJet) { |
545 |
|
if(iJet->E() == 0) return false; |
546 |
|
if(iJet->NeutralHadronEnergy()/iJet->E() > 0.99) return false; |