Changeset d1678fd in git for modules/Calorimeter.cc
- Timestamp:
- Mar 17, 2021, 5:07:53 PM (4 years ago)
- Branches:
- master
- Children:
- 5eda6767
- Parents:
- 9cc5aeb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/Calorimeter.cc
r9cc5aeb rd1678fd 450 450 451 451 fTower->AddCandidate(particle); 452 fTower->Position = position; 452 453 } 453 454 … … 461 462 { 462 463 Candidate *track, *tower, *mother; 463 Double_t energy, pt, eta, phi ;464 Double_t energy, pt, eta, phi, r; 464 465 Double_t ecalEnergy, hcalEnergy; 465 466 Double_t ecalNeutralEnergy, hcalNeutralEnergy; … … 511 512 for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i) 512 513 { 513 weight = TMath:: Sqrt(fTower->ECalEnergyTimePairs[i].first);514 weight = TMath::Power((fTower->ECalEnergyTimePairs[i].first),2); 514 515 sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second; 515 516 sumWeight += weight; … … 517 518 } 518 519 520 r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y()); 521 519 522 if(sumWeight > 0.0) 520 523 { 521 fTower->Position.SetPtEtaPhiE( 1.0, eta, phi, sumWeightedTime / sumWeight);524 fTower->Position.SetPtEtaPhiE(r, eta, phi, sumWeightedTime / sumWeight); 522 525 } 523 526 else 524 527 { 525 fTower->Position.SetPtEtaPhiE( 1.0, eta, phi, 999999.9);528 fTower->Position.SetPtEtaPhiE(r, eta, phi, 999999.9); 526 529 } 527 530
Note:
See TracChangeset
for help on using the changeset viewer.