Fork me on GitHub

Changeset 8d601b7 in git for modules/PileUpMerger.cc


Ignore:
Timestamp:
Jun 6, 2016, 10:22:47 AM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
e2148f0
Parents:
c4a72a0
Message:

fixed vertex z position, go back to A. Hart solution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/PileUpMerger.cc

    rc4a72a0 r8d601b7  
    116116  TParticlePDG *pdgParticle;
    117117  Int_t pid, nch, nvtx = -1;
    118   Float_t x, y, z, t, vx, vy, vz, vt;
     118  Float_t x, y, z, t, vx, vy;
    119119  Float_t px, py, pz, e, pt;
    120120  Double_t dz, dphi, dt, sumpt2, dz0, dt0;
     
    134134  dz0 = -1.0e6;
    135135  dt0 = -1.0e6;
    136 
     136 
    137137  dt *= c_light*1.0E3; // necessary in order to make t in mm/c
    138138  dz *= 1.0E3; // necessary in order to make z in mm
    139139 
     140  //cout<<dz<<","<<dt<<endl;
     141 
    140142  vx = 0.0;
    141143  vy = 0.0;
    142   vz = 0.0;
    143   vt = 0.0;
    144144 
    145145  numberOfParticles = fInputArray->GetEntriesFast();
    146146  nch = 0;
    147147  sumpt2 = 0.0;
    148    
     148   
     149  cout<<"candidate loop"<<endl; 
    149150  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    150151  {
     
    154155    t = candidate->Position.T();
    155156    pt = candidate->Momentum.Pt();
    156    
     157       
    157158    // take postion and time from first stable particle
    158159    if (dz0 < -999999.0)
     
    164165    candidate->Position.SetZ(z - dz0 + dz);
    165166    candidate->Position.SetT(t - dt0 + dt);
    166    
    167     vz += z - dz0 + dz;
    168     vt += t - dt0 + dt;
    169167   
    170168    fParticleOutputArray->Add(candidate);
     
    176174    } 
    177175  }
    178 
     176 
    179177  if(numberOfParticles > 0)
    180178  {
    181     vx /= numberOfParticles;
    182     vy /= numberOfParticles;
    183     vz /= numberOfParticles;
    184     vt /= numberOfParticles;
     179    vx /= sumpt2;
     180    vy /= sumpt2;
    185181  }
    186 
     182 
    187183  nvtx++;
    188184  factory = GetFactory();
    189185
     186  cout<<"vertex position"<<endl;
     187  //cout<<vz<<","<<vt<<endl;
    190188  vertex = factory->NewCandidate();
    191   vertex->Position.SetXYZT(vx, vy, vz, vt);
     189  vertex->Position.SetXYZT(vx, vy, dz, dt);
    192190  vertex->ClusterIndex = nvtx;
    193191  vertex->ClusterNDF = nch;
Note: See TracChangeset for help on using the changeset viewer.