Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackTimingPileUpSubtractor.cc

    r9117aaa4 r7939c6c  
    7575
    7676  // read resolution formula in m
    77   fFormula->Compile(GetString("ZVertexResolution", "0.001"));
     77  fChargedMinSignificance = GetDouble("ChargedMinSignificance", 3);
     78  fNeutralMinSignificance = GetDouble("NeutralMinSignificance", 3);
    7879
    7980  fPTMin = GetDouble("PTMin", 0.);
     
    128129  Double_t tempPTSquare = 0;
    129130  Double_t pt, eta, phi, e;
    130   Double_t distance = 0;
     131  Double_t distanceCharged, distanceNeutral = 0;
    131132
    132133  // find z position of primary vertex
     
    166167      z = particle->Position.Z();
    167168      z_err = particle->PositionError.Z();
    168       t = particle->Position.T();
     169      t = particle->InitialPosition.T();
    169170      t_err = particle->PositionError.T();
    170171
    171       // apply pile-up subtraction
    172       distance = pow((zvtx - z),2)/pow((zvtx_err - z_err),2) + pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
    173       // here I calculated distance using Z and T of selected vertex (highest sum Pt square) and particles
    174       // however z_err of vertices is gives 0 because of using CMS trackResolutionCMS.tcl (in that formula, there is limitation on |eta| < 2.5)
    175       // thats why I used TMath::Abs(z - zvtx) < 0.005 && TMath::Abs(t - tvtx) < 5.0
     172      distanceCharged = pow((zvtx - z),2)/pow((zvtx_err - z_err),2) + pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
     173      distanceNeutral = pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
    176174
    177       if(candidate->Charge != 0 && TMath::Abs(z - zvtx) < 0.005 && TMath::Abs(t - tvtx) < 5.0)
     175      if(candidate->Charge != 0 && distanceCharged < fChargedMinSignificance)
    178176      {
    179177        candidate->IsRecoPU = 1;
    180178      }
     179      else if(candidate->Charge == 0 && distanceNeutral < fNeutralMinSignificance)
     180      {
     181        candidate->IsRecoPU = 1;
     182      } 
    181183      else
    182184      {
Note: See TracChangeset for help on using the changeset viewer.