#ifdef USE_CDFEDM2 ////////////////////////////////////////////////////////////////////////// // // Component: ClumpCalculator.cc // Purpose: This class inherits from TowerCalculator. It sums the // EM and Hadronic compartements according to what was done // in Run 1. This uses a regular eta-phi grid to sum towers // // Created: 15/09/99 Pierre Savard // History: 01/05/03 Dan MacQueen -- changed locs to an array in iEta and iPhi. // ////////////////////////////////////////////////////////////////////////// #include #include "Calor/ClumpCalculator.hh" // namespace calor { ClumpCalculator::ClumpCalculator() { TowerCalculator(string "Clump"); } PhysicsTower* ClumpCalculator::makePhysicsTower(EnergyData* eData, Locations* loc) const { size_t iEta = eData->iEta(); size_t iPhi = eData->iPhi(); float emEnergy = eData->emEnergy(); float hadEnergy = eData->hadEnergy(); float emEt = emEnergy * locs->emSinTheta(iEta,iPhi); float hadEt = hadEnergy * locs->hadSinTheta(iEta,iPhi); float totEt = emEt + hadEt; if(totEt < _etThreshold) return 0; // do not waste time making this tower float emEta = locs->emEta(iEta,iPhi); float hadEta = locs->hadEta(iEta,iPhi); float totEta = (emEta *emEt + hadEta *hadEt)/totEt; float emPhi = eData->emPhi(iEta); float hadPhi = eData->hadPhi(iEta); float totPhi = (emPhi *emEt + hadPhi *hadEt)/totEt; float px = emEnergy * cos(emPhi) * locs->emSinTheta(iEta,iPhi) + hadEnergy * cos(hadPhi) * locs->hadSinTheta(iEta,iPhi); float py = emEnergy * sin(emPhi) * locs->emSinTheta(iEta,iPhi) + hadEnergy * sin(hadPhi) * locs->hadSinTheta(iEta,iPhi); float pz = emEnergy * cos(locs->emTheta(iEta,iPhi)) + hadEnergy * cos(locs->hadTheta(iEta,iPhi)) ; HepLorentzVector fourMomentum(px,py,pz,(emEnergy+HadEnergy)); return new PhysicsTower(totEta, emEta, hadEta, totPhi, emPhi, hadPhi, emEnergy, hadEnergy, fourMomentum, emEt, hadEt, totEt, iEta, iPhi); } // } // namespace calor #endif // USE_CDFEDM2