Changeset 2118a6a in git for modules/PileUpMerger.cc
- Timestamp:
- May 18, 2016, 5:17:11 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- b291b0b
- Parents:
- bc4bff0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/PileUpMerger.cc
rbc4bff0 r2118a6a 115 115 TDatabasePDG *pdg = TDatabasePDG::Instance(); 116 116 TParticlePDG *pdgParticle; 117 Int_t pid ;117 Int_t pid, nch, nvtx = -1; 118 118 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; 121 121 Int_t numberOfEvents, event, numberOfParticles; 122 122 Long64_t allEntries, entry; … … 137 137 vy = 0.0; 138 138 numberOfParticles = fInputArray->GetEntriesFast(); 139 nch = 0; 140 sumpt2 = 0.0; 141 139 142 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 140 143 { … … 143 146 z = candidate->Position.Z(); 144 147 t = candidate->Position.T(); 148 pt = candidate->Momentum.Pt(); 145 149 candidate->Position.SetZ(z + dz); 146 150 candidate->Position.SetT(t + dt); 147 151 fParticleOutputArray->Add(candidate); 152 153 if(TMath::Abs(candidate->Charge) > 1.0E-9) 154 { 155 nch++; 156 sumpt2 += pt*pt; 157 } 148 158 } 149 159 … … 154 164 } 155 165 166 nvtx++; 156 167 factory = GetFactory(); 157 168 158 169 vertex = factory->NewCandidate(); 159 170 vertex->Position.SetXYZT(vx, vy, dz, dt); 171 vertex->ClusterIndex = nvtx; 172 vertex->ClusterNDF = nch; 173 vertex->SumPT2 = sumpt2; 174 vertex->GenSumPT2 = sumpt2; 175 160 176 fVertexOutputArray->Add(vertex); 161 177 … … 201 217 vx = 0.0; 202 218 vy = 0.0; 219 203 220 numberOfParticles = 0; 221 sumpt2 = 0.0; 222 204 223 while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 205 224 { … … 227 246 vx += candidate->Position.X(); 228 247 vy += candidate->Position.Y(); 248 229 249 ++numberOfParticles; 230 250 if(TMath::Abs(candidate->Charge) > 1.0E-9) 251 { 252 nch++; 253 sumpt2 += pt*pt; 254 } 255 231 256 fParticleOutputArray->Add(candidate); 232 257 } … … 237 262 vy /= numberOfParticles; 238 263 } 264 265 nvtx++; 239 266 240 267 vertex = factory->NewCandidate(); 241 268 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 242 275 vertex->IsPU = 1; 243 276 244 277 fVertexOutputArray->Add(vertex); 245 } 246 } 247 248 //------------------------------------------------------------------------------ 278 279 } 280 } 281 282 //------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.