Fork me on GitHub

Ignore:
Timestamp:
Dec 21, 2013, 3:00:11 PM (11 years ago)
Author:
mselvaggi <mselvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
24d005f
Parents:
af88093
Message:

timing implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackPileUpSubtractor.cc

    raf88093 r22dc7fd  
    5353void TrackPileUpSubtractor::Init()
    5454{
     55// import input array
     56
     57  fVertexInputArray = ImportArray(GetString("VertexInputArray", "PileUpMerger/vertices"));
     58  fItVertexInputArray = fVertexInputArray->MakeIterator();
     59 
    5560  fZVertexResolution  = GetDouble("ZVertexResolution", 0.005)*1.0E3;
    5661
     
    8590    if(iterator) delete iterator;
    8691  }
     92
     93  if(fItVertexInputArray) delete fItVertexInputArray;
    8794}
    8895
     
    95102  TIterator *iterator;
    96103  TObjArray *array;
    97   Double_t z;
     104  Double_t z, zvtx;
     105
     106 
     107  // find z position of primary vertex
     108 
     109  fItVertexInputArray->Reset();
     110  while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next())))
     111  {
     112    if(candidate->IsPU == 0)
     113    {
     114    zvtx = candidate->Position.Z();
     115    break;
     116    }
     117  }
     118
    98119
    99120  // loop over all input arrays
     
    112133      // apply pile-up subtraction
    113134      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    114       if(candidate->IsPU && TMath::Abs(z) > fZVertexResolution) continue;
     135      if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution) continue;
    115136
    116137      array->Add(candidate);
Note: See TracChangeset for help on using the changeset viewer.