Changeset 1345 in svn for trunk/modules/Calorimeter.cc
- Timestamp:
- Dec 21, 2013, 3:00:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/Calorimeter.cc
r1280 r1345 330 330 fTrackHCalEnergy = 0.0; 331 331 332 fTowerECalTime = 0.0; 333 fTowerHCalTime = 0.0; 334 335 fTrackECalTime = 0.0; 336 fTrackHCalTime = 0.0; 337 338 fTowerECalWeightTime = 0.0; 339 fTowerHCalWeightTime = 0.0; 340 332 341 fTowerTrackHits = 0; 333 342 fTowerPhotonHits = 0; … … 343 352 track = static_cast<Candidate*>(fTrackInputArray->At(number)); 344 353 momentum = track->Momentum; 345 354 position = track->Position; 355 356 346 357 ecalEnergy = momentum.E() * fTrackECalFractions[number]; 347 358 hcalEnergy = momentum.E() * fTrackHCalFractions[number]; … … 349 360 fTrackECalEnergy += ecalEnergy; 350 361 fTrackHCalEnergy += hcalEnergy; 362 363 fTrackECalTime += TMath::Sqrt(ecalEnergy)*position.T(); 364 fTrackHCalTime += TMath::Sqrt(hcalEnergy)*position.T(); 365 366 fTrackECalWeightTime += TMath::Sqrt(ecalEnergy); 367 fTrackHCalWeightTime += TMath::Sqrt(hcalEnergy); 351 368 352 369 fTowerTrackArray->Add(track); … … 360 377 particle = static_cast<Candidate*>(fParticleInputArray->At(number)); 361 378 momentum = particle->Momentum; 379 position = particle->Position; 362 380 363 381 // fill current tower … … 367 385 fTowerECalEnergy += ecalEnergy; 368 386 fTowerHCalEnergy += hcalEnergy; 387 388 fTowerECalTime += TMath::Sqrt(ecalEnergy)*position.T(); 389 fTowerHCalTime += TMath::Sqrt(hcalEnergy)*position.T(); 390 391 fTowerECalWeightTime += TMath::Sqrt(ecalEnergy); 392 fTowerHCalWeightTime += TMath::Sqrt(hcalEnergy); 393 369 394 370 395 fTower->AddCandidate(particle); … … 383 408 Double_t ecalEnergy, hcalEnergy; 384 409 Double_t ecalSigma, hcalSigma; 410 Double_t ecalTime, hcalTime, time; 385 411 386 412 if(!fTower) return; … … 392 418 393 419 ecalEnergy = LogNormal(fTowerECalEnergy, ecalSigma); 420 ecalTime = (fTowerECalWeightTime < 1.0E-09 ) ? 0 : fTowerECalTime/fTowerECalWeightTime; 394 421 395 422 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy); … … 399 426 400 427 hcalEnergy = LogNormal(fTowerHCalEnergy, hcalSigma); 428 hcalTime = (fTowerHCalWeightTime < 1.0E-09 ) ? 0 : fTowerHCalTime/fTowerHCalWeightTime; 401 429 402 430 energy = ecalEnergy + hcalEnergy; 431 time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy)); 403 432 404 433 // eta = fTowerEta; … … 410 439 pt = energy / TMath::CosH(eta); 411 440 412 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, 0.0); 441 // fTower->Position.SetXYZT(-time, 0.0, 0.0, time); 442 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, time); 413 443 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 414 444 fTower->Eem = ecalEnergy; … … 420 450 fTower->Edges[3] = fTowerEdges[3]; 421 451 452 422 453 // fill calorimeter towers and photon candidates 423 454 if(energy > 0.0)
Note:
See TracChangeset
for help on using the changeset viewer.