Fork me on GitHub

Changeset 34c28a9 in git for modules


Ignore:
Timestamp:
Dec 9, 2019, 11:07:13 PM (5 years ago)
Author:
Kaan Yüksel Oyulmaz <kaanyukseloyulmaz@…>
Branches:
Timing
Children:
9117aaa4
Parents:
1363bf5
Message:

FCC-hh card with 4DVertex Algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackPileUpSubtractor.cc

    r1363bf5 r34c28a9  
    117117void TrackPileUpSubtractor::Process()
    118118{
    119   Candidate *candidate, *particle;
     119  Candidate *candidate, *particle, *particleTest;
    120120  map<TIterator *, TObjArray *>::iterator itInputMap;
    121121  TIterator *iterator;
     
    123123  Double_t z, zvtx = 0;
    124124  Double_t pt, eta, phi, e;
    125 
     125  Double_t sumPT2 = 0;
     126  Double_t sumSquare = 0;
     127  int counter = 0;
     128  Double_t tempPTSquare = 0;
     129  Double_t tempZVertex = 0;
    126130  // find z position of primary vertex
    127131
     132  cout << " ---------- NEW EVENT --------- " << endl;
     133
    128134  fItVertexInputArray->Reset();
     135  cout << " NUMBER OF VERTICES : " << fVertexInputArray->GetEntriesFast() << endl;
    129136  while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next())))
    130137  {
    131     if(!candidate->IsPU)
    132     {
    133       zvtx = candidate->Position.Z();
    134       // break;
    135     }
     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      */
    136158  }
    137159
     
    147169    {
    148170      particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0));
    149       const TLorentzVector &candidateMomentum = particle->Momentum;
     171      const TLorentzVector &candidateMomentum = candidate->Momentum;
    150172
    151173      eta = candidateMomentum.Eta();
     
    154176      e = candidateMomentum.E();
    155177
    156       z = particle->Position.Z();
     178      z = candidate->Position.Z();
     179      counter ++;
     180      //sum = pt*pt;
     181      if(pt > 1.0)
     182        sumPT2 += pt*pt;
    157183
    158184      // apply pile-up subtraction
    159185      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    160 
    161       if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3)
     186      // cout << particle->IsRecoPU << " ParticleSumSquare : " << sumPT2 << " VertexResult : " << sumSquare << " Added SumSquare : " << zvtx << endl;
     187      //cout << pt << "  " << candidate->IsPU << "  " <<  TMath::Abs(z - zvtx) << "   " << sumPT2 << "   " << sumPT2 << endl;
     188
     189     
     190      if(particle->Charge != 0 && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3)
    162191      {
    163192        candidate->IsRecoPU = 1;
     193        //cout <<  TMath::Abs(z - zvtx) << "   " << fFormula->Eval(pt, eta, phi, e) * 1.0e3 << endl;
    164194      }
    165195      else
Note: See TracChangeset for help on using the changeset viewer.