#ifndef INC_CALCELL #define INC_CALCELL ////////////////////////////////////////////////////////////////////// // File: CalCell.hpp // // Purpose: provide information for an individual calorimeter cell // using vertex x, y, z stored in CalData // stores address, 4-momentum and pT // returns stored values and calculates eta, phi // // Created: 7-FEB-1998 Serban Protopopescu // Modified: // 23-NAR-1998 use CellAddress // 8-Nov-1998 use AnglesUtil // 26-Mar-2001 Laurent Duflot: correct bug in theta() and eta() // for negative energy cells ////////////////////////////////////////////////////////////////////// #include "kinem_util/AnglesUtil.hpp" #include "caladdress/CellAddress.hpp" class CalCell{ friend class CalData; friend class CalTower; friend class compareCellPT; public: CalCell(){;} CalCell(CellAddress &address, float p[4], float xyz[3]); // access methods CellAddress address()const; float E() const; float emE() const; float pT() const; float phi() const; float eta() const; float theta() const; void p4vec(float p[4]) const; void cellXYZ(float xyz[3])const; // I/O void print(std::ostream &os) const; // output operator friend std::ostream& operator<<(std::ostream& os, const CalCell &y){ os<<" ieta iphi layer 4-mom ="<_pT > y->_pT; } }; inline float CalCell::E() const { return _E; } inline float CalCell::emE() const { return _address.isEm()? _E: 0; } inline float CalCell::pT() const { return _pT; } inline float CalCell::phi() const { if(_E<0){ float px=-_px; float py=-_py; return kinem::phi(px,py); } return kinem::phi(_px,_py); } inline float CalCell::theta() const { if(_E<0){ float px=-_px; float py=-_py; float pz=-_pz; return kinem::theta(px,py,pz); } return kinem::theta(_px,_py,_pz); } inline float CalCell::eta() const { if(_E<0){ float px=-_px; float py=-_py; float pz=-_pz; return kinem::eta(px,py,pz); } return kinem::eta(_px,_py,_pz); } inline void CalCell::p4vec(float p[4]) const { p[0]=_px; p[1]=_py; p[2]=_pz; p[3]=_E; } inline void CalCell::cellXYZ(float xyz[3]) const { xyz[0]=_x; xyz[1]=_y; xyz[2]=_z; } inline CellAddress CalCell::address()const { return _address; } inline void CalCell::print(std::ostream &os) const { os<<*this<