#ifdef USE_CDFEDM2 ////////////////////////////////////////////////////////////////////////// // // Component: EmTdcTower.cc // Purpose: Implementation of TdcTower class // // Created: 01/22/2003 Max Goncharov // ////////////////////////////////////////////////////////////////////////// #include #include #include "CalorObjects/EmTdcTower.hh" #include using namespace std; EmTdcTower::EmTdcTower(): TdcTower(), _maxCalorKeys(2) {} EmTdcTower::~EmTdcTower(){} bool EmTdcTower::addEnergy(const CalorKey& key, float pmtE){ if(_nCalorKeys < _maxCalorKeys) return TdcTower::addEnergy(key,pmtE); return false; } bool EmTdcTower::setCalorKeys(const CalorKeyMap& cmap){ if(cmap.size() < _maxCalorKeys) return TdcTower::setCalorKeys(cmap); return false; } float EmTdcTower::energy() const{ float pmtE1 = getPmtEnergy(0); float pmtE2 = getPmtEnergy(1); float energy = sqrt(pmtE1*pmtE2); return energy; } EmTdcTower* EmTdcTower::clone() const{ return new EmTdcTower(*this); } std::ostream& operator<<(std::ostream& os, const EmTdcTower& t) { return t.print(os); } std::ostream& EmTdcTower::print(std::ostream& os) const{ TdcTower::print(os); os<< "Max CalorKeys: "<