Fork me on GitHub

Changeset 54b6dfc in git


Ignore:
Timestamp:
Jan 17, 2014, 2:29:22 PM (11 years ago)
Author:
mselvaggi <mselvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
1150871
Parents:
24d005f
Message:

JetId v2

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • examples/delphes_card_CMS_PileUp.tcl

    r24d005f r54b6dfc  
    2525  Rho
    2626  FastJetFinder
     27  PileUpJetID
    2728  JetPileUpSubtractor
    2829
     
    6162
    6263  # pre-generated minbias input file
    63   set PileUpFile MinBias.pileup
     64  set PileUpFile ../../Delphes/MinBias.pileup
    6465
    6566  # average expected pile up
     
    325326  add InputArray ElectronEnergySmearing/electrons electrons
    326327  add InputArray MuonMomentumSmearing/muons muons
    327 
     328 
     329  set VertexInputArray PileUpMerger/vertices
    328330  # assume perfect pile-up subtraction for tracks with |z| > fZVertexResolution
    329331  # Z vertex resolution in m
     
    404406
    405407###########################
     408# Jet Pile-Up ID
     409###########################
     410
     411module PileUpJetID PileUpJetID {
     412  set JetInputArray FastJetFinder/jets
     413  set TrackInputArray Calorimeter/eflowTracks
     414  set NeutralInputArray Calorimeter/eflowTowers
     415
     416  set VertexInputArray PileUpMerger/vertices
     417  # assume perfect pile-up subtraction for tracks with |z| > fZVertexResolution
     418  # Z vertex resolution in m
     419  set ZVertexResolution 0.0001
     420 
     421  set OutputArray jets
     422
     423  set UseConstituents 0
     424  set ParameterR 0.5
     425
     426  set JetPTMin 20.0
     427}
     428
     429###########################
    406430# Jet Pile-Up Subtraction
    407431###########################
    408432
    409433module JetPileUpSubtractor JetPileUpSubtractor {
    410   set JetInputArray FastJetFinder/jets
     434  set JetInputArray PileUpJetID/jets
    411435  set RhoInputArray Rho/rho
    412436
  • modules/PileUpJetID.cc

    r24d005f r54b6dfc  
    3636
    3737PileUpJetID::PileUpJetID() :
    38   fItJetInputArray(0),fTrackInputArray(0),fNeutralInputArray(0)
     38  fItJetInputArray(0),fTrackInputArray(0),fNeutralInputArray(0),fItVertexInputArray(0)
    3939{
    4040
     
    6868  fNeutralInputArray = ImportArray(GetString("NeutralInputArray", "Calorimeter/eflowTowers"));
    6969  fItNeutralInputArray = fNeutralInputArray->MakeIterator();
    70 
    71   // create output array(s)
     70 
     71  fVertexInputArray = ImportArray(GetString("VertexInputArray", "PileUpMerger/vertices"));
     72  fItVertexInputArray = fVertexInputArray->MakeIterator();
     73 
     74  fZVertexResolution  = GetDouble("ZVertexResolution", 0.005)*1.0E3;
     75// create output array(s)
    7276
    7377  fOutputArray = ExportArray(GetString("OutputArray", "jets"));
     
    8387  if(fItTrackInputArray) delete fItTrackInputArray;
    8488  if(fItNeutralInputArray) delete fItNeutralInputArray;
     89  if(fItVertexInputArray) delete fItVertexInputArray;
    8590
    8691}
     
    9297  Candidate *candidate, *constituent;
    9398  TLorentzVector momentum, area;
     99  Double_t zvtx=0;
    94100
    95101  Candidate *trk;
     102
     103 // find z position of primary vertex
     104   
     105  fItVertexInputArray->Reset();
     106  while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next())))
     107  {
     108    if(!candidate->IsPU)
     109    {
     110    zvtx = candidate->Position.Z();
     111    break;
     112    }
     113  }
    96114
    97115  // loop over all input candidates
     
    129147        } else {
    130148          // charged
    131           if (constituent->IsPU) {
     149          if (constituent->IsPU && TMath::Abs(constituent->Position.Z()-zvtx) > fZVertexResolution) {
    132150            sumptchpu += pt;
    133151          } else {
     
    146164      // Not using constituents, using dr
    147165      fItTrackInputArray->Reset();
    148       while ((trk = static_cast<Candidate*>(fItTrackInputArray->Next()))) {
     166       while ((trk = static_cast<Candidate*>(fItTrackInputArray->Next()))) {
    149167        if (trk->Momentum.DeltaR(candidate->Momentum) < fParameterR) {
    150168          float pt = trk->Momentum.Pt();
    151169          sumpt += pt;
    152170          sumptch += pt;
    153           if (trk->IsPU) {
     171          if (trk->IsPU && TMath::Abs(trk->Position.Z()-zvtx) > fZVertexResolution) {
    154172            sumptchpu += pt;
    155173          } else {
  • modules/PileUpJetID.h

    r24d005f r54b6dfc  
    5353
    5454  TObjArray *fOutputArray; //!
     55 
     56  TIterator *fItVertexInputArray; //!
     57  const TObjArray *fVertexInputArray; //!
    5558
     59  Double_t fZVertexResolution;
    5660
    5761  ClassDef(PileUpJetID, 1)
  • modules/TrackPileUpSubtractor.cc

    r24d005f r54b6dfc  
    110110  while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next())))
    111111  {
    112     if(candidate->IsPU == 0)
     112    if(!candidate->IsPU)
    113113    {
    114114    zvtx = candidate->Position.Z();
    115     break;
     115    // break;
    116116    }
    117117  }
    118 
    119118
    120119  // loop over all input arrays
     
    130129      particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    131130      z = particle->Position.Z();
    132 
     131     
    133132      // apply pile-up subtraction
    134133      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
     134     
    135135      if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution) continue;
    136136
Note: See TracChangeset for help on using the changeset viewer.