- Timestamp:
- Jun 6, 2016, 10:22:47 AM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- e2148f0
- Parents:
- c4a72a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/PileUpMerger.cc
rc4a72a0 r8d601b7 116 116 TParticlePDG *pdgParticle; 117 117 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; 119 119 Float_t px, py, pz, e, pt; 120 120 Double_t dz, dphi, dt, sumpt2, dz0, dt0; … … 134 134 dz0 = -1.0e6; 135 135 dt0 = -1.0e6; 136 136 137 137 dt *= c_light*1.0E3; // necessary in order to make t in mm/c 138 138 dz *= 1.0E3; // necessary in order to make z in mm 139 139 140 //cout<<dz<<","<<dt<<endl; 141 140 142 vx = 0.0; 141 143 vy = 0.0; 142 vz = 0.0;143 vt = 0.0;144 144 145 145 numberOfParticles = fInputArray->GetEntriesFast(); 146 146 nch = 0; 147 147 sumpt2 = 0.0; 148 148 149 cout<<"candidate loop"<<endl; 149 150 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 150 151 { … … 154 155 t = candidate->Position.T(); 155 156 pt = candidate->Momentum.Pt(); 156 157 157 158 // take postion and time from first stable particle 158 159 if (dz0 < -999999.0) … … 164 165 candidate->Position.SetZ(z - dz0 + dz); 165 166 candidate->Position.SetT(t - dt0 + dt); 166 167 vz += z - dz0 + dz;168 vt += t - dt0 + dt;169 167 170 168 fParticleOutputArray->Add(candidate); … … 176 174 } 177 175 } 178 176 179 177 if(numberOfParticles > 0) 180 178 { 181 vx /= numberOfParticles; 182 vy /= numberOfParticles; 183 vz /= numberOfParticles; 184 vt /= numberOfParticles; 179 vx /= sumpt2; 180 vy /= sumpt2; 185 181 } 186 182 187 183 nvtx++; 188 184 factory = GetFactory(); 189 185 186 cout<<"vertex position"<<endl; 187 //cout<<vz<<","<<vt<<endl; 190 188 vertex = factory->NewCandidate(); 191 vertex->Position.SetXYZT(vx, vy, vz, vt);189 vertex->Position.SetXYZT(vx, vy, dz, dt); 192 190 vertex->ClusterIndex = nvtx; 193 191 vertex->ClusterNDF = nch;
Note:
See TracChangeset
for help on using the changeset viewer.