30 |
|
for(int j=0;j<int(jets->GetEntries());j++){ |
31 |
|
fvalpart = TMath::Min(fvalpart,(jets->At(j)->Pt()) * |
32 |
|
(2 * TMath::CosH(TMath::Abs(jets->At(j)->Eta()-particles->At(i)->Eta())) |
33 |
< |
- 2 * TMath::Cos(MathUtils::DeltaPhi(jets->At(j)->Phi(),particles->At(i)->Phi())))); |
33 |
> |
- 2 * TMath::Cos(fabs(MathUtils::DeltaPhi(jets->At(j)->Phi(),particles->At(i)->Phi()))))); |
34 |
|
} |
35 |
|
fval = fval + fvalpart; |
36 |
|
} |
52 |
|
for(int j=0;j<int(jets->GetEntries());j++){ |
53 |
|
fvalpart = TMath::Min(fvalpart,(jets->At(j)->Pt()) * |
54 |
|
(2 * TMath::CosH(TMath::Abs(jets->At(j)->Eta()-pfCandidates->At(i)->Eta())) |
55 |
< |
- 2 * TMath::Cos(MathUtils::DeltaPhi(jets->At(j)->Phi(),pfCandidates->At(i)->Phi())))); |
55 |
> |
- 2 * TMath::Cos(fabs(MathUtils::DeltaPhi(jets->At(j)->Phi(),pfCandidates->At(i)->Phi()))))); |
56 |
|
} |
57 |
|
fval = fval + fvalpart; |
58 |
|
} |
74 |
|
for(int j=0;j<int(jets->GetEntries());j++){ |
75 |
|
fvalpart = TMath::Min(fvalpart,(jets->At(j)->Pt()) * |
76 |
|
(2 * TMath::CosH(TMath::Abs(jets->At(j)->Eta()-tracks->At(i)->Eta())) |
77 |
< |
- 2 * TMath::Cos(MathUtils::DeltaPhi(jets->At(j)->Phi(),tracks->At(i)->Phi())))); |
77 |
> |
- 2 * TMath::Cos(fabs(MathUtils::DeltaPhi(jets->At(j)->Phi(),tracks->At(i)->Phi()))))); |
78 |
|
} |
79 |
|
fval = fval + fvalpart; |
80 |
|
} |
96 |
|
for(int j=0;j<int(jets->GetEntries());j++){ |
97 |
|
fvalpart = TMath::Min(fvalpart,(jets->At(j)->Pt()) * |
98 |
|
(2 * TMath::CosH(TMath::Abs(jets->At(j)->Eta()-jetsS->At(i)->Eta())) |
99 |
< |
- 2 * TMath::Cos(MathUtils::DeltaPhi(jets->At(j)->Phi(),jetsS->At(i)->Phi())))); |
99 |
> |
- 2 * TMath::Cos(fabs(MathUtils::DeltaPhi(jets->At(j)->Phi(),jetsS->At(i)->Phi()))))); |
100 |
|
} |
101 |
|
fval = fval + fvalpart; |
102 |
|
} |
118 |
|
for(int j=0;j<int(jets->GetEntries());j++){ |
119 |
|
fvalpart = TMath::Min(fvalpart,(jets->At(j)->Pt()) * |
120 |
|
(2 * TMath::CosH(TMath::Abs(jets->At(j)->Eta()-calos->At(i)->Eta())) |
121 |
< |
- 2 * TMath::Cos(MathUtils::DeltaPhi(jets->At(j)->Phi(),calos->At(i)->Phi())))); |
121 |
> |
- 2 * TMath::Cos(fabs(MathUtils::DeltaPhi(jets->At(j)->Phi(),calos->At(i)->Phi()))))); |
122 |
|
} |
123 |
|
fval = fval + fvalpart; |
124 |
|
} |
291 |
|
- met->Px()*dilepton->Px() - met->Py()*dilepton->Py() |
292 |
|
- leptons->At(0)->Px()*leptons->At(1)->Px() - leptons->At(0)->Py()*leptons->At(1)->Py()); |
293 |
|
} |
294 |
< |
else if(nsel == 7){ // Use of M mass and mnu == 0, no fancy stuff |
295 |
< |
enell = TMath::Sqrt(dilepton->Pt()*dilepton->Pt() + dilepton->Mass()*dilepton->Mass()); |
296 |
< |
enenn = TMath::Sqrt(met->Pt()*met->Pt() + 0.0*0.0); |
297 |
< |
enex = dilepton->Px() + met->Px(); |
298 |
< |
eney = dilepton->Py() + met->Py(); |
299 |
< |
mtHiggs = (enell+enenn)*(enell+enenn) - enex*enex - eney*eney; |
294 |
> |
else if(nsel == 7){ // Use of M mass and mnu == 0 |
295 |
> |
double deltaPhiDileptonMet = fabs(MathUtils::DeltaPhi(dilepton->Phi(), |
296 |
> |
met->Phi())); |
297 |
> |
mtHiggs = 2.0*dilepton->Pt()*met->Pt()*(1.0 - cos(deltaPhiDileptonMet)); |
298 |
|
} |
299 |
|
|
300 |
|
if(nsel >= 0 && nsel <= 4){ |
475 |
|
} |
476 |
|
return vertexIndex; |
477 |
|
} |
478 |
+ |
const PFCandidate* JetTools::leadCand(const PFJet *iJet,int iPFType,bool i2nd) { |
479 |
+ |
int lCount = 0; |
480 |
+ |
const PFCandidate *lCand = 0; |
481 |
+ |
for(UInt_t i0 = 0; i0 < iJet->NPFCands(); i0++) { |
482 |
+ |
lCand = iJet->PFCand(i0); |
483 |
+ |
if(iPFType != -1 && lCand->PFType() != iPFType) continue; |
484 |
+ |
if(lCount == 0 && !i2nd) break; |
485 |
+ |
if(lCount > 0) break; |
486 |
+ |
lCount++; |
487 |
+ |
} |
488 |
+ |
return lCand; |
489 |
+ |
} |
490 |
+ |
Double_t JetTools::impactParameter(const PFJet *iJet,const Vertex *iVertex,bool iDZ) { |
491 |
+ |
double lDZCorr = -1000; |
492 |
+ |
for(UInt_t i0 = 0; i0 < iJet->NPFCands(); i0++) { |
493 |
+ |
const PFCandidate *pCand = iJet->PFCand(i0); |
494 |
+ |
if(pCand->BestTrk() == 0) continue; |
495 |
+ |
if(pCand->Pt() < 1.) continue; |
496 |
+ |
if(iDZ) lDZCorr = pCand->BestTrk()->DzCorrected(*iVertex); |
497 |
+ |
if(!iDZ) lDZCorr = pCand->BestTrk()->D0Corrected(*iVertex); |
498 |
+ |
break; |
499 |
+ |
} |
500 |
+ |
return lDZCorr; |
501 |
+ |
} |
502 |
+ |
Double_t JetTools::dRMean(const PFJet *iJet,int iPFType) { |
503 |
+ |
double lDRMean = 0; |
504 |
+ |
for(UInt_t i0 = 0; i0 < iJet->NPFCands(); i0++) { |
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->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; |
547 |
+ |
if(iJet->NeutralEmEnergy()/iJet->E() > 0.99) return false; |
548 |
+ |
if(iJet->NConstituents() < 2) return false; |
549 |
+ |
if(iJet->ChargedHadronEnergy()/iJet->E() <= 0 && fabs(iJet->Eta()) < 2.4 ) return false; |
550 |
+ |
if(iJet->ChargedEmEnergy()/iJet->E() > 0.99 && fabs(iJet->Eta()) < 2.4 ) return false; |
551 |
+ |
if(iJet->ChargedMultiplicity() < 1 && fabs(iJet->Eta()) < 2.4 ) return false; |
552 |
+ |
return true; |
553 |
+ |
} |
554 |
+ |
|
555 |
+ |
/* |
556 |
+ |
double JetTools::genFrac(const PFJet *iJet) { |
557 |
+ |
double lTrueFrac = 0; |
558 |
+ |
for(UInt_t i0 = 0; i0 < fParticles->GetEntries(); i0++) { |
559 |
+ |
const MCParticle *p = fParticles->At(i0); |
560 |
+ |
if(p->Status() != 1) continue; |
561 |
+ |
double pDEta = iJet->Eta() - p->Eta(); |
562 |
+ |
double pDPhi = fabs(iJet->Phi()-p->Phi()); if(pDPhi > 2.*TMath::Pi() - pDPhi) pDPhi = 2.*TMath::Pi() - pDPhi; |
563 |
+ |
double pDR = sqrt(pDEta*pDEta + pDPhi*pDPhi); |
564 |
+ |
if(pDR > 0.5) continue; |
565 |
+ |
lTrueFrac += p->Pt(); |
566 |
+ |
} |
567 |
+ |
lTrueFrac/=iJet->Pt(); |
568 |
+ |
return lTrueFrac; |
569 |
+ |
} |
570 |
+ |
*/ |