Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackPileUpSubtractor.cc

    r781edf86 r341014c  
    1717 */
    1818
    19 
    2019/** \class TrackPileUpSubtractor
    2120 *
     
    3231#include "classes/DelphesFormula.h"
    3332
     33#include "ExRootAnalysis/ExRootClassifier.h"
     34#include "ExRootAnalysis/ExRootFilter.h"
    3435#include "ExRootAnalysis/ExRootResult.h"
    35 #include "ExRootAnalysis/ExRootFilter.h"
    36 #include "ExRootAnalysis/ExRootClassifier.h"
    3736
     37#include "TDatabasePDG.h"
     38#include "TFormula.h"
     39#include "TLorentzVector.h"
    3840#include "TMath.h"
     41#include "TObjArray.h"
     42#include "TRandom3.h"
    3943#include "TString.h"
    40 #include "TFormula.h"
    41 #include "TRandom3.h"
    42 #include "TObjArray.h"
    43 #include "TDatabasePDG.h"
    44 #include "TLorentzVector.h"
    4544
    4645#include <algorithm>
    47 #include <stdexcept>
    4846#include <iostream>
    4947#include <sstream>
     48#include <stdexcept>
    5049
    5150using namespace std;
     
    5453
    5554TrackPileUpSubtractor::TrackPileUpSubtractor() :
    56 fFormula(0)
     55  fFormula(0)
    5756{
    5857  fFormula = new DelphesFormula;
     
    8887
    8988  size = param.GetSize();
    90   for(i = 0; i < size/2; ++i)
     89  for(i = 0; i < size / 2; ++i)
    9190  {
    92     array = ImportArray(param[i*2].GetString());
     91    array = ImportArray(param[i * 2].GetString());
    9392    iterator = array->MakeIterator();
    9493
    95     fInputMap[iterator] = ExportArray(param[i*2 + 1].GetString());
     94    fInputMap[iterator] = ExportArray(param[i * 2 + 1].GetString());
    9695  }
    9796}
     
    101100void TrackPileUpSubtractor::Finish()
    102101{
    103   map< TIterator *, TObjArray * >::iterator itInputMap;
     102  map<TIterator *, TObjArray *>::iterator itInputMap;
    104103  TIterator *iterator;
    105104
     
    119118{
    120119  Candidate *candidate, *particle;
    121   map< TIterator *, TObjArray * >::iterator itInputMap;
     120  map<TIterator *, TObjArray *>::iterator itInputMap;
    122121  TIterator *iterator;
    123122  TObjArray *array;
    124   Double_t z, zvtx=0;
     123  Double_t z, zvtx = 0;
    125124  Double_t pt, eta, phi, e;
    126 
    127125
    128126  // find z position of primary vertex
    129127
    130128  fItVertexInputArray->Reset();
    131   while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next())))
     129  while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next())))
    132130  {
    133131    if(!candidate->IsPU)
     
    146144    // loop over all candidates
    147145    iterator->Reset();
    148     while((candidate = static_cast<Candidate*>(iterator->Next())))
     146    while((candidate = static_cast<Candidate *>(iterator->Next())))
    149147    {
    150       particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
     148      particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0));
    151149      const TLorentzVector &candidateMomentum = particle->Momentum;
    152150
     
    155153      phi = candidateMomentum.Phi();
    156154      e = candidateMomentum.E();
    157      
     155
    158156      z = particle->Position.Z();
    159157
     
    161159      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    162160
    163       if(candidate->Charge !=0 && candidate->IsPU && TMath::Abs(z-zvtx) > fFormula->Eval(pt, eta, phi, e)* 1.0e3)
     161      if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3)
    164162      {
    165163        candidate->IsRecoPU = 1;
Note: See TracChangeset for help on using the changeset viewer.