Changeset 5496767 in git for modules/PileUpMerger.cc
- Timestamp:
- Jun 17, 2016, 6:52:57 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 62d3bc5
- Parents:
- 0f73bea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/PileUpMerger.cc
r0f73bea r5496767 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 140 //cout<<dz<<","<<dt<<endl; 141 141 142 142 vx = 0.0; 143 143 vy = 0.0; 144 144 145 145 numberOfParticles = fInputArray->GetEntriesFast(); 146 146 nch = 0; 147 sumpt2 = 0.0; 148 147 sumpt2 = 0.0; 148 149 149 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 150 150 { … … 154 154 t = candidate->Position.T(); 155 155 pt = candidate->Momentum.Pt(); 156 156 157 157 // take postion and time from first stable particle 158 158 if (dz0 < -999999.0) … … 164 164 candidate->Position.SetZ(z - dz0 + dz); 165 165 candidate->Position.SetT(t - dt0 + dt); 166 166 167 167 fParticleOutputArray->Add(candidate); 168 168 169 169 if(TMath::Abs(candidate->Charge) > 1.0E-9) 170 170 { 171 nch++; 171 nch++; 172 172 sumpt2 += pt*pt; 173 } 173 } 174 174 } 175 175 176 176 if(numberOfParticles > 0) 177 177 { … … 179 179 vy /= sumpt2; 180 180 } 181 181 182 182 nvtx++; 183 183 factory = GetFactory(); … … 188 188 vertex->ClusterNDF = nch; 189 189 vertex->SumPT2 = sumpt2; 190 vertex->GenSumPT2 = sumpt2; 191 190 vertex->GenSumPT2 = sumpt2; 191 192 192 fVertexOutputArray->Add(vertex); 193 193 … … 204 204 case 2: 205 205 numberOfEvents = fMeanPileUp; 206 break; 206 break; 207 207 default: 208 208 numberOfEvents = gRandom->Poisson(fMeanPileUp); … … 233 233 vx = 0.0; 234 234 vy = 0.0; 235 235 236 236 numberOfParticles = 0; 237 237 sumpt2 = 0.0; 238 238 239 vertex = factory->NewCandidate(); 240 239 241 while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 240 242 { … … 262 264 vx += candidate->Position.X(); 263 265 vy += candidate->Position.Y(); 264 266 265 267 ++numberOfParticles; 266 268 if(TMath::Abs(candidate->Charge) > 1.0E-9) 267 269 { 268 nch++; 270 nch++; 269 271 sumpt2 += pt*pt; 270 } 271 272 vertex->AddCandidate(candidate); 273 274 } 275 272 276 fParticleOutputArray->Add(candidate); 273 277 } … … 278 282 vy /= numberOfParticles; 279 283 } 280 284 281 285 nvtx++; 282 286 283 vertex = factory->NewCandidate();284 287 vertex->Position.SetXYZT(vx, vy, dz, dt); 285 286 vertex->ClusterIndex = nvtx; 288 289 vertex->ClusterIndex = nvtx; 287 290 vertex->ClusterNDF = nch; 288 291 vertex->SumPT2 = sumpt2; 289 292 vertex->GenSumPT2 = sumpt2; 290 293 291 294 vertex->IsPU = 1; 292 295 293 296 fVertexOutputArray->Add(vertex); 294 297 295 298 } 296 299 }
Note:
See TracChangeset
for help on using the changeset viewer.