Fork me on GitHub

Changeset 50edcdbf in git for modules/PileUpMerger.cc


Ignore:
Timestamp:
Jun 4, 2016, 8:06:02 PM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
3f8df25
Parents:
7bcca65
Message:

reset eventual z,t shift

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/PileUpMerger.cc

    r7bcca65 r50edcdbf  
    118118  Float_t x, y, z, t, vx, vy, vz, vt;
    119119  Float_t px, py, pz, e, pt;
    120   Double_t dz, dphi, dt, sumpt2;
     120  Double_t dz, dphi, dt, sumpt2, dz0, dt0;
    121121  Int_t numberOfEvents, event, numberOfParticles;
    122122  Long64_t allEntries, entry;
     
    132132  fFunction->GetRandom2(dz, dt);
    133133
     134  dz0 = -1.0e6;
     135  dt0 = -1.0e6;
     136
    134137  dt *= c_light*1.0E3; // necessary in order to make t in mm/c
    135138  dz *= 1.0E3; // necessary in order to make z in mm
     139 
    136140  vx = 0.0;
    137141  vy = 0.0;
     
    151155    pt = candidate->Momentum.Pt();
    152156   
    153     vz += z+dz;
    154     vt += t+dt;
    155    
    156     candidate->Position.SetZ(z + dz);
    157     candidate->Position.SetT(t + dt);
     157    // take postion and time from first stable particle
     158    if (dz0 < -999999.0)
     159      dz0 = z;
     160    if (dt0 < -999999.0)
     161      dt0 = t;
     162
     163    // cancel any possible offset in position and time the input file
     164    candidate->Position.SetZ(z - dz0 + dz);
     165    candidate->Position.SetT(t - dt0 + dt);
     166   
     167    vz += z - dz0 + dz;
     168    vt += t - dt0 + dt;
     169   
    158170    fParticleOutputArray->Add(candidate);
    159171 
     
    170182    vy /= numberOfParticles;
    171183    vz /= numberOfParticles;
    172     vt /= numberOfParticles;
    173  
     184    vt /= numberOfParticles;
    174185  }
    175186
     
    256267      vx += candidate->Position.X();
    257268      vy += candidate->Position.Y();
     269      vz += z+dz;
     270      vt += t+dt;
    258271     
    259272      ++numberOfParticles;
Note: See TracChangeset for help on using the changeset viewer.