ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/JetTools.cc
(Generate patch)

Comparing UserCode/MitPhysics/Utils/src/JetTools.cc (file contents):
Revision 1.18 by pharris, Sat Apr 7 09:36:33 2012 UTC vs.
Revision 1.22 by ceballos, Thu Apr 26 09:58:12 2012 UTC

# Line 340 | Line 340 | Double_t JetTools::Beta(const TrackCol *
340   Double_t JetTools::Beta(const PFJet *jet, const Vertex *vertex, Double_t  delta_z){  
341    double Pt_jets= 0. ;
342    double Pt_jetsTot = 0. ;
343 <
343 >  
344    for(UInt_t i=0;i<jet->NPFCands();i++){
345 <    if(jet->PFCand(i)->BestTrk()){
346 <      Pt_jetsTot += jet->PFCand(i)->BestTrk()->Pt();
347 <      double pDz = TMath::Abs(jet->PFCand(i)->BestTrk()->DzCorrected(*vertex));
345 >    if(jet->PFCand(i)->TrackerTrk()){
346 >      Pt_jetsTot += jet->PFCand(i)->TrackerTrk()->Pt();
347 >      double pDz = TMath::Abs(jet->PFCand(i)->TrackerTrk()->DzCorrected(*vertex));
348        if(pDz < delta_z){
349 <        Pt_jets += jet->PFCand(i)->BestTrk()->Pt();
349 >        Pt_jets += jet->PFCand(i)->TrackerTrk()->Pt();
350        }
351      }
352    }
353  
354 <  Double_t beta = 1.0;
354 >  Double_t beta = 0.;
355    if (Pt_jetsTot > 0)
356      beta = Pt_jets/Pt_jetsTot;
357  
# Line 491 | Line 491 | Double_t JetTools::impactParameter(const
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);
494 >    if(pCand->TrackerTrk() == 0) continue;
495 >    //if(pCand->Pt() < 1.) continue; => previous iterations
496 >    if(iDZ)  lDZCorr = fabs(pCand->TrackerTrk()->DzCorrected(*iVertex));
497 >    if(!iDZ) lDZCorr = fabs(pCand->TrackerTrk()->D0Corrected(*iVertex));
498      break;
499    }
500    return lDZCorr;
# Line 527 | Line 527 | Double_t JetTools::betaStar(const PFJet
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();
530 >    //if(pPF->GsfTrk()) pTrack = pPF->GsfTrk(); ==> not used in CMSSW
531      if(pTrack == 0) continue;
532
532      lTotal += pPF->Pt();
533 +    double pDZPV  = fabs(pTrack->DzCorrected(*iVertex));
534 +    double pDZMin = pDZPV;
535      for(unsigned int i1 = 0; i1 < iVertices->GetEntries(); i1++) {
536        const Vertex *pV = iVertices->At(i1);
537 <      if(fabs(pTrack->DzCorrected(*pV))             < iDZCut  &&
538 <         (pV->Position() - iVertex->Position()).R() > 0.02 )
539 <        { lPileup  +=pPF->Pt();}
537 >      if(pV->Ndof() < 4 ||
538 >         (pV->Position() - iVertex->Position()).R() > 0.02 ) continue;
539 >      pDZMin = TMath::Min(pDZMin,fabs(pTrack->DzCorrected(*pV)));
540      }
541 +    if(pDZPV > 0.2 && pDZMin < 0.2) lPileup += pTrack->Pt();
542    }
543    if(lTotal == 0) lTotal = 1;
544    return lPileup/(lTotal);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines