Fork me on GitHub

Changeset 6049672 in git


Ignore:
Timestamp:
Jan 23, 2020, 8:59:46 PM (5 years ago)
Author:
Kaan Yüksel Oyulmaz <kaanyukseloyulmaz@…>
Branches:
Timing
Children:
4ac0049
Parents:
e70228d
Message:

New changes according to last meeting

Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • cards/FCC/FCChh_PileUpVtx.tcl

    re70228d r6049672  
    4848
    4949  VertexFinderDA4D
    50   TrackTimingPileUpSubtractor
     50  PileUpSubtractor4D
    5151
    5252  HighMassVertexRecover   
     
    568568  set InputArray ECal/eflowPhotons
    569569  set OutputArray timeSmearingPhotons
     570  set TimeResolution {sqrt(20^2 + 150^2)/energy^2}
    570571}
    571572
     
    579580
    580581  # assume 30 ps resolution for now
    581   set TimeResolution {30E-12}
     582  set TimeResolution {sqrt(20^2 + 150^2)/energy^2}
    582583}
    583584
     
    619620##########################
    620621
    621 module TrackTimingPileUpSubtractor TrackTimingPileUpSubtractor {
     622module PileUpSubtractor4D PileUpSubtractor4D {
    622623# add InputArray InputArray OutputArray
    623624
  • modules/TimeSmearing.cc

    re70228d r6049672  
    5353
    5454TimeSmearing::TimeSmearing() :
    55   fItInputArray(0)
     55  fItInputArray(0), fFormula(0)
    5656{
     57        fFormula = new DelphesFormula;
    5758}
    5859
     
    6162TimeSmearing::~TimeSmearing()
    6263
     64        if(fFormula) delete fFormula;
    6365}
    6466
     
    6769void TimeSmearing::Init()
    6870{
    69   // read resolution formula
    70 
    71   fTimeResolution = GetDouble("TimeResolution", 1.);
     71  // read resolution formula   
     72  fFormula->Compile(GetString("TimeResolution", "0.001"));
    7273
    7374  // import input array
     
    9495  Double_t ti, tf_smeared, tf;
    9596  Double_t pt, eta, phi, e, p, l;
    96   Double_t sigma_t, beta_particle;
     97  Double_t beta_particle;
     98  Double_t timeResolution;
    9799
    98100
    99101  const Double_t c_light = 2.99792458E8;
    100 
    101   cout << " STARTINNNGG ---------->" << endl;
    102102
    103103  fItInputArray->Reset();
     
    117117    beta_particle = p/e;
    118118    l = candidate->L;
    119     // apply smearing formula
    120 
     119    timeResolution = fFormula->Eval(e);
     120   
    121121    if(candidate->Charge != 0)
    122122    {
    123       tf_smeared = tf + fTimeResolution*gRandom->Gaus(0, 1);
    124       //mother = candidate;
    125       //candidate = static_cast<Candidate*>(candidate->Clone());  // I am not sure that we need these lines !!!
    126       //candidate->AddCandidate(mother);
     123      tf_smeared = tf + timeResolution*gRandom->Gaus(0, 1);
     124      mother = candidate;
     125      candidate = static_cast<Candidate*>(candidate->Clone());  // I am not sure that we need these lines !!!
     126      candidate->AddCandidate(mother);
    127127      candidate->InitialPosition.SetT((100+ti)*1.0E3*c_light);
    128128      candidate->Position.SetT(tf_smeared*1.0E3*c_light);
    129       candidate->ErrorT = fTimeResolution*1.0E3*c_light;
     129      candidate->ErrorT = timeResolution*1.0E3*c_light;
    130130      fOutputArray->Add(candidate);
    131131    }
    132132    else
    133133    {
    134         sigma_t = sqrt(pow(20,2) + pow(150,2)/e);
    135         ti = sigma_t - l*1.0E3/(c_light*beta_particle);   
    136         candidate->InitialPosition.SetT(ti);
    137         candidate->ErrorT = sigma_t*1.0E3*c_light;              // Do we need to sum with 100 like in upside ?
    138         fOutputArray->Add(candidate);
     134      ti = timeResolution - l*1.0E3/(c_light*beta_particle);   
     135      candidate->InitialPosition.SetT(ti);
     136      candidate->ErrorT = timeResolution*1.0E3*c_light;         // Do we need to sum with 100 like in upside ?
     137      fOutputArray->Add(candidate);
    139138    }
    140139   
  • modules/TimeSmearing.h

    re70228d r6049672  
    4545
    4646private:
    47   Double_t fTimeResolution; //!
     47  DelphesFormula *fFormula;
    4848  Double_t fEtaMax;
    4949
  • modules/TrackPileUpSubtractor.cc

    re70228d r6049672  
    117117void TrackPileUpSubtractor::Process()
    118118{
    119   Candidate *candidate, *particle, *particleTest;
     119  Candidate *candidate, *particle;
    120120  map<TIterator *, TObjArray *>::iterator itInputMap;
    121121  TIterator *iterator;
     
    123123  Double_t z, zvtx = 0;
    124124  Double_t pt, eta, phi, e;
    125   Double_t sumPT2 = 0;
    126   Double_t sumSquare = 0;
    127   int counter = 0;
    128   Double_t tempPTSquare = 0;
    129   Double_t tempZVertex = 0;
     125
    130126  // find z position of primary vertex
    131127
    132   cout << " ---------- NEW EVENT --------- " << endl;
    133 
    134128  fItVertexInputArray->Reset();
    135   cout << " NUMBER OF VERTICES : " << fVertexInputArray->GetEntriesFast() << endl;
    136129  while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next())))
    137130  {
    138       cout << " ---------- NEW VERTEX --------- " << candidate->IsPU << endl;
    139       tempZVertex = candidate->Position.Z();
    140       tempPTSquare = candidate->SumPT2;
    141       if(tempPTSquare > sumSquare)
    142       {
    143         sumSquare = tempPTSquare;
    144         zvtx = tempZVertex;
    145         cout << " Sum Square : " << sumSquare << " Z of Vertex : " << zvtx << "  Is PileUp : " << candidate->IsPU << endl;
    146       }
    147      
    148       /*
    149       for(int i = 0; i < candidate->GetCandidates()->GetEntriesFast(); i++)
    150       {
    151         particleTest = static_cast<Candidate *>(candidate->GetCandidates()->At(i));
    152         TLorentzVector &candidateMomentumNew = particleTest->Momentum;
    153         if(candidateMomentumNew.Pt() > 1.0)
    154           sumSquare += (candidateMomentumNew.Pt()*candidateMomentumNew.Pt());
    155         cout << candidateMomentumNew.Pt() << "  " << candidate->SumPT2 << " counter : " << candidate->GetCandidates()->GetEntriesFast() << endl;
    156       } 
    157       */
     131    if(!candidate->IsPU)
     132    {
     133      zvtx = candidate->Position.Z();
     134    }
    158135  }
    159136
     
    169146    {
    170147      particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0));
    171       const TLorentzVector &candidateMomentum = candidate->Momentum;
     148      const TLorentzVector &candidateMomentum = particle->Momentum;
    172149
    173150      eta = candidateMomentum.Eta();
     
    176153      e = candidateMomentum.E();
    177154
    178       z = candidate->Position.Z();
    179       counter ++;
    180       //sum = pt*pt;
    181       if(pt > 1.0)
    182         sumPT2 += pt*pt;
     155      z = particle->Position.Z();
    183156
    184157      // apply pile-up subtraction
    185158      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    186       // cout << particle->IsRecoPU << " ParticleSumSquare : " << sumPT2 << " VertexResult : " << sumSquare << " Added SumSquare : " << zvtx << endl;
    187       //cout << pt << "  " << candidate->IsPU << "  " <<  TMath::Abs(z - zvtx) << "   " << sumPT2 << "   " << sumPT2 << endl;
    188159
    189      
    190       if(particle->Charge != 0 && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3)
     160      if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3)
    191161      {
    192162        candidate->IsRecoPU = 1;
    193         //cout <<  TMath::Abs(z - zvtx) << "   " << fFormula->Eval(pt, eta, phi, e) * 1.0e3 << endl;
    194163      }
    195164      else
Note: See TracChangeset for help on using the changeset viewer.