Changeset 21eab4f in git for modules/TreeWriter.cc
- Timestamp:
- Aug 26, 2016, 5:17:14 PM (8 years ago)
- Parents:
- ec5e04b (diff), 94cacb6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- AlexandreMertens <alexandre.mertens@…> (08/26/16 17:17:14)
- git-committer:
- GitHub <noreply@…> (08/26/16 17:17:14)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/TreeWriter.cc
rec5e04b r21eab4f 215 215 entry->Pz = momentum.Pz(); 216 216 217 entry->D0 = candidate->D0; 218 entry->DZ = candidate->DZ; 219 entry->P = candidate->P; 220 entry->PT = candidate->PT; 221 entry->CtgTheta = candidate->CtgTheta; 222 entry->Phi = candidate->Phi; 223 217 224 entry->Eta = eta; 218 225 entry->Phi = momentum.Phi(); … … 233 240 { 234 241 TIter iterator(array); 235 Candidate *candidate = 0 ;242 Candidate *candidate = 0, *constituent = 0; 236 243 Vertex *entry = 0; 237 244 238 245 const Double_t c_light = 2.99792458E8; 239 246 247 Double_t x, y, z, t, xError, yError, zError, tError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2; 248 UInt_t index, ndf; 249 250 CompBase *compare = Candidate::fgCompare; 251 Candidate::fgCompare = CompSumPT2<Candidate>::Instance(); 252 array->Sort(); 253 Candidate::fgCompare = compare; 254 240 255 // loop over all vertices 241 256 iterator.Reset(); 242 257 while((candidate = static_cast<Candidate*>(iterator.Next()))) 243 258 { 244 const TLorentzVector &position = candidate->Position; 259 260 index = candidate->ClusterIndex; 261 ndf = candidate->ClusterNDF; 262 sigma = candidate->ClusterSigma; 263 sumPT2 = candidate->SumPT2; 264 btvSumPT2 = candidate->BTVSumPT2; 265 genDeltaZ = candidate->GenDeltaZ; 266 genSumPT2 = candidate->GenSumPT2; 267 268 x = candidate->Position.X(); 269 y = candidate->Position.Y(); 270 z = candidate->Position.Z(); 271 t = candidate->Position.T()*1.0E-3/c_light; 272 273 xError = candidate->PositionError.X (); 274 yError = candidate->PositionError.Y (); 275 zError = candidate->PositionError.Z (); 276 tError = candidate->PositionError.T ()*1.0E-3/c_light; 245 277 246 278 entry = static_cast<Vertex*>(branch->NewEntry()); 247 279 248 entry->X = position.X(); 249 entry->Y = position.Y(); 250 entry->Z = position.Z(); 251 entry->T = position.T()*1.0E-3/c_light; 252 } 253 } 280 entry->Index = index; 281 entry->NDF = ndf; 282 entry->Sigma = sigma; 283 entry->SumPT2 = sumPT2; 284 entry->BTVSumPT2 = btvSumPT2; 285 entry->GenDeltaZ = genDeltaZ; 286 entry->GenSumPT2 = genSumPT2; 287 288 entry->X = x; 289 entry->Y = y; 290 entry->Z = z; 291 entry->T = t; 292 293 entry->ErrorX = xError; 294 entry->ErrorY = yError; 295 entry->ErrorZ = zError; 296 entry->ErrorT = tError; 297 298 299 TIter itConstituents(candidate->GetCandidates()); 300 itConstituents.Reset(); 301 entry->Constituents.Clear(); 302 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) 303 { 304 entry->Constituents.Add(constituent); 305 } 306 307 } 308 } 309 254 310 255 311 //------------------------------------------------------------------------------ … … 261 317 Candidate *particle = 0; 262 318 Track *entry = 0; 263 Double_t pt, signz, cosTheta, eta, rapidity ;319 Double_t pt, signz, cosTheta, eta, rapidity, p, ctgTheta, phi; 264 320 const Double_t c_light = 2.99792458E8; 265 321 … … 292 348 entry->TOuter = position.T()*1.0E-3/c_light; 293 349 294 entry->Dxy = candidate->Dxy; 295 entry->SDxy = candidate->SDxy ; 350 entry->L = candidate->L; 351 352 entry->D0 = candidate->D0; 353 entry->ErrorD0 = candidate->ErrorD0; 354 entry->DZ = candidate->DZ; 355 entry->ErrorDZ = candidate->ErrorDZ; 356 357 entry->ErrorP = candidate->ErrorP; 358 entry->ErrorPT = candidate->ErrorPT; 359 entry->ErrorCtgTheta = candidate->ErrorCtgTheta; 360 entry->ErrorPhi = candidate->ErrorPhi; 361 296 362 entry->Xd = candidate->Xd; 297 363 entry->Yd = candidate->Yd; … … 301 367 302 368 pt = momentum.Pt(); 369 p = momentum.P(); 370 phi = momentum.Phi(); 371 ctgTheta = (TMath::Tan(momentum.Theta()) != 0) ? 1/TMath::Tan(momentum.Theta()) : 1e10; 372 303 373 cosTheta = TMath::Abs(momentum.CosTheta()); 304 374 signz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0; … … 306 376 rapidity = (cosTheta == 1.0 ? signz*999.9 : momentum.Rapidity()); 307 377 378 entry->PT = pt; 308 379 entry->Eta = eta; 309 entry->Phi = momentum.Phi();310 entry-> PT = pt;380 entry->Phi = phi; 381 entry->CtgTheta = ctgTheta; 311 382 312 383 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); … … 319 390 320 391 entry->Particle = particle; 392 393 entry->VertexIndex = candidate->ClusterIndex; 394 321 395 } 322 396 }
Note:
See TracChangeset
for help on using the changeset viewer.