2 #include "StjTowerEnergyCorrectionForTracks.h"
14 return Do(energyDepositList, trackList);
17 StjTowerEnergyList StjTowerEnergyCorrectionForTracks::Do(
const StjTowerEnergyList &energyDepositList,
const StjTrackList& trackList)
19 for (
int i = 1; i <= mNOfBemcTowers; ++i) {
20 mNtracksOnTower[i] = 0;
23 for(StjTrackList::const_iterator
track = trackList.begin();
track != trackList.end(); ++
track) {
24 countTracksOnBemcTower(*
track);
27 StjTowerEnergyList ret;
29 for(StjTowerEnergyList::const_iterator it = energyDepositList.begin(); it != energyDepositList.end(); ++it) {
33 energyDeposit.energy = correctBemcTowerEnergyForTracks_(energyDeposit.energy, energyDeposit.towerId, energyDeposit.towerEta, energyDeposit.towerPhi);
35 energyDeposit.energy = (energyDeposit.energy <= 0) ? 0 : energyDeposit.energy;
37 ret.push_back(energyDeposit);
43 void StjTowerEnergyCorrectionForTracks::countTracksOnBemcTower(
const StjTrack&
track)
45 if(track.exitDetectorId == 9 && track.exitTowerId != 0 && track.exitTowerId <= mNOfBemcTowers)
46 mNtracksOnTower[track.exitTowerId]++;
49 double StjTowerEnergyCorrectionForTracks::correctBemcTowerEnergyForTracks_(
double energy,
int bemcTowerId,
float eta,
float phi)
51 if(bemcTowerId > mNOfBemcTowers)
return energy;
53 float theta=2.*atan(exp(-eta));
56 double MipE = 0.261*(1.+0.056*eta*eta)/sin(theta);
58 return energy - mNtracksOnTower[bemcTowerId]*MipE;