//---------------------------------------------------------------------- // File and Version Information: // $Id:$ // Description: // Class Template for EmcCluster // // Software developed for the BaBar Detector at the SLAC B-Factory. // Adapted for the PANDA experiment at GSI // // Author List: // Xiaorong Shi Lawrence Livermore National Lab // Steve Playfer University of Edinburgh // Stephen Gowdy University of Edinburgh // //----------------------------------------------------------------------- #ifndef EMCCLUSTER_HH #define EMCCLUSTER_HH #include "TObject.h" #include //class EmcClusterLogPos; class EmcClusterLiloPos; class EmcDigi; class TwoCoordIndex; class TVector3; using namespace std; typedef std::map EmcDigiPtrDict; class EmcCluster : public TObject { public: // Typedefs, consts, and enums enum CentroidMethod { gravity, logarithmic, neighbour, lilo }; // Constructors EmcCluster(); EmcCluster(int digiList, int localMaxList); virtual void Print(const Option_t* opt ="") const; // Destructor virtual ~EmcCluster(); // List of Digis std::vector digiList() const {return fDigiList;}; const EmcDigiPtrDict *itsMemberDigiMap() const {return fMemberDigiMap;}; // Total Energy of Cluster double energy() const; // Theta centroid of cluster double theta() const; // Phi centroid of cluster double phi() const; // Theta centroid of cluster in index units double thetaIndex() const; int thetaIndexInt() const; // Phi centroid of cluster in index units double phiIndex() const; int phiIndexInt() const; // Direction to ctr clus TVector3 position() const; // Where is cluster? TVector3 where() const; // x co-ordinate of clus double x() const; // y co-ordinate of clus double y() const; // z co-ordinate of clus double z() const; int numberOfDigis() const; unsigned nBumps() const; bool isInCluster(EmcDigi* theDigi); // Modifiers virtual void addDigi( EmcDigi* d ); void addCluster( EmcCluster* c); // virtual const EmcClusterLogPos& logPositions() const; virtual const EmcClusterLiloPos& liloPositions() const; protected: private: friend class EmcMakeCluster; void invalidateCache(); unsigned _nbumps; std::vector fLocalMaxList; std::vector fDigiList; EmcDigiPtrDict* fMemberDigiMap;//! // Cachable data mutable bool fEnergyValid; mutable double fEnergy; mutable bool fWhereValid; mutable TVector3* fWhere; //EmcClusterLogPos* _theClusLogPos; mutable EmcClusterLiloPos* fTheClusLiloPos; //! transient element public: // Centre of gravity centroid method //static TVector3 gravWhere( const EmcCluster* me ); // Modifiers private: // Methods // Select which method to use for cluster centroid static void selectCentroidMethod( CentroidMethod ); // Used by normal where() method to determine centroid taking into account which method is selected static TVector3 algWhere( const EmcCluster* me ); // Retains information about which method to use for centroid // Returns a pointer to a function which takes a const EmcCluster* // as an argument static TVector3 (*&algPointer())( const EmcCluster* ); ClassDef(EmcCluster,1) }; #endif // EMCCLUSTER_HH