Fork me on GitHub

Changeset 2118a6a in git for modules/PileUpMerger.cc


Ignore:
Timestamp:
May 18, 2016, 5:17:11 PM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b291b0b
Parents:
bc4bff0
Message:

fixed missing vertexing variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/PileUpMerger.cc

    rbc4bff0 r2118a6a  
    115115  TDatabasePDG *pdg = TDatabasePDG::Instance();
    116116  TParticlePDG *pdgParticle;
    117   Int_t pid;
     117  Int_t pid, nch, nvtx = -1;
    118118  Float_t x, y, z, t, vx, vy;
    119   Float_t px, py, pz, e;
    120   Double_t dz, dphi, dt;
     119  Float_t px, py, pz, e, pt;
     120  Double_t dz, dphi, dt, sumpt2;
    121121  Int_t numberOfEvents, event, numberOfParticles;
    122122  Long64_t allEntries, entry;
     
    137137  vy = 0.0;
    138138  numberOfParticles = fInputArray->GetEntriesFast();
     139  nch = 0;
     140  sumpt2 = 0.0;
     141   
    139142  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    140143  {
     
    143146    z = candidate->Position.Z();
    144147    t = candidate->Position.T();
     148    pt = candidate->Momentum.Pt();
    145149    candidate->Position.SetZ(z + dz);
    146150    candidate->Position.SetT(t + dt);
    147151    fParticleOutputArray->Add(candidate);
     152 
     153    if(TMath::Abs(candidate->Charge) >  1.0E-9)
     154    {
     155      nch++;   
     156      sumpt2 += pt*pt;
     157    } 
    148158  }
    149159
     
    154164  }
    155165
     166  nvtx++;
    156167  factory = GetFactory();
    157168
    158169  vertex = factory->NewCandidate();
    159170  vertex->Position.SetXYZT(vx, vy, dz, dt);
     171  vertex->ClusterIndex = nvtx;
     172  vertex->ClusterNDF = nch;
     173  vertex->SumPT2 = sumpt2;
     174  vertex->GenSumPT2 = sumpt2; 
     175 
    160176  fVertexOutputArray->Add(vertex);
    161177
     
    201217    vx = 0.0;
    202218    vy = 0.0;
     219   
    203220    numberOfParticles = 0;
     221    sumpt2 = 0.0;
     222   
    204223    while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e))
    205224    {
     
    227246      vx += candidate->Position.X();
    228247      vy += candidate->Position.Y();
     248     
    229249      ++numberOfParticles;
    230 
     250      if(TMath::Abs(candidate->Charge) >  1.0E-9)
     251      {
     252        nch++;   
     253        sumpt2 += pt*pt;
     254      }
     255       
    231256      fParticleOutputArray->Add(candidate);
    232257    }
     
    237262      vy /= numberOfParticles;
    238263    }
     264   
     265    nvtx++;
    239266
    240267    vertex = factory->NewCandidate();
    241268    vertex->Position.SetXYZT(vx, vy, dz, dt);
     269   
     270    vertex->ClusterIndex = nvtx;
     271    vertex->ClusterNDF = nch;
     272    vertex->SumPT2 = sumpt2;
     273    vertex->GenSumPT2 = sumpt2;
     274   
    242275    vertex->IsPU = 1;
    243276
    244277    fVertexOutputArray->Add(vertex);
    245   }
    246 }
    247 
    248 //------------------------------------------------------------------------------
     278   
     279  }
     280}
     281
     282//------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.