//---------------------------------------------------------------------- // File and Version Information: // $Id:$ // Description: // Class Template for PndEmcCluster // // 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 PNDEMCCLUSTER_HH #define PNDEMCCLUSTER_HH #include "TObject.h" #include "PndEmcClusterLiloPos.h" #include #include //class EmcClusterLogPos; class PndEmcClusterLiloPos; class PndEmcClusterLinearPos; class PndEmcDigi; class PndEmcTwoCoordIndex; class TVector3; typedef std::map PndEmcDigiPtrDict; class PndEmcCluster : public TObject { public: // Typedefs, consts, and enums enum CentroidMethod { lilo, linear }; // Constructors PndEmcCluster(); PndEmcCluster(int digiList, int localMaxList); virtual void Print(const Option_t* opt ="") const; // Destructor virtual ~PndEmcCluster(); // List of Digis std::vector digiList() const {return fDigiList;}; const PndEmcDigiPtrDict *itsMemberDigiMap() const {return fMemberDigiMap;}; // Since fMemberDigiMap is transient element the following methods resore it after reading from the root file void ValidateDigiMap(); // Total Energy of Cluster virtual 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(PndEmcDigi* theDigi); // Modifiers virtual void addDigi( PndEmcDigi* d ); void addCluster( PndEmcCluster* c); virtual void setNBumps( unsigned nbumps); // virtual const EmcClusterLogPos& logPositions() const; virtual const PndEmcClusterLiloPos& liloPositions() const; virtual const PndEmcClusterLinearPos& linearPositions() const; private: friend class PndEmcMakeCluster; void invalidateCache(); protected: unsigned _nbumps; std::vector fLocalMaxList; std::vector fDigiList; PndEmcDigiPtrDict* fMemberDigiMap;//! // Cachable data mutable bool fEnergyValid; mutable double fEnergy; mutable bool fWhereValid; mutable TVector3* fWhere; //EmcClusterLogPos* _theClusLogPos; mutable PndEmcClusterLiloPos* fTheClusLiloPos; //! transient element mutable PndEmcClusterLinearPos* fTheClusLinearPos; //! transient element // Modifiers private: // Methods // Select which method to use for cluster centroid static void selectCentroidMethod( CentroidMethod, PndEmcClusterLiloPosData ClusterPositionParameters ); // Used by normal where() method to determine centroid taking into account which method is selected static TVector3 algWhere( const PndEmcCluster* 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 PndEmcCluster* ); ClassDef(PndEmcCluster,1) }; #endif // EMCCLUSTER_HH