StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTowerEnergyCorrectionForTracksMip.cxx
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 25 August 2009
5 //
6 // Adapted from Tai Sakuma's StjTowerEnergyCorrectionForTracks class
7 //
8 
9 #include "StjTowerEnergyCorrectionForTracksMip.h"
10 
12 
13 StjTowerEnergyList StjTowerEnergyCorrectionForTracksMip::Do(const StjTowerEnergyList& energyDepositList, const StjTrackList& trackList)
14 {
15  StjTowerEnergyList elist;
16  // Tower loop
17  for (StjTowerEnergyList::const_iterator iTower = energyDepositList.begin(); iTower != energyDepositList.end(); ++iTower) {
18  StjTowerEnergy tower = *iTower;
19  float eta = tower.towerEta;
20  // Track loop
21  for (StjTrackList::const_iterator iTrack = trackList.begin(); iTrack != trackList.end(); ++iTrack) {
22  const StjTrack& track = *iTrack;
23  // Does track extrapolate to tower?
24  if (track.exitDetectorId == tower.detectorId && track.exitTowerId == tower.towerId) {
25  // You betcha. Do a quick correction for hadronic MIP energy deposition:
26  tower.energy -= 0.261*(1+0.056*eta*eta)*cosh(eta);
27  }
28  } // End track loop
29  // Drop towers without energy
30  if (tower.energy > 0) elist.push_back(tower);
31  } // End tower loop
32  return elist;
33 }