00001 // 00002 // Bes EMC Rec Cluster 00003 // 00004 // Created by Zhe Wang 2003, 10, 1 00005 // 00006 #ifndef REC_EMC_CLUSTER_H 00007 #define REC_EMC_CLUSTER_H 00008 00009 #include "GaudiKernel/ContainedObject.h" 00010 #include "GaudiKernel/ObjectVector.h" 00011 #include "EventModel/EventModel.h" 00012 #include "EmcRecEventModel/RecEmcHit.h" 00013 #include "EmcRecEventModel/RecEmcDataType.h" 00014 00015 using namespace std; 00016 00017 extern const CLID& CLID_RecEmcCluster; 00018 00019 //class RecEmcShower; 00020 00021 class RecEmcCluster : virtual public ContainedObject 00022 { 00023 public: 00024 00025 virtual const CLID& clID() const { return RecEmcCluster::classID();} 00026 static const CLID& classID() { return CLID_RecEmcCluster; } 00027 00028 //Constructors and destructors 00029 RecEmcCluster(); 00030 ~RecEmcCluster(); 00031 00032 //Copy and assignment 00033 //RecEmcCluster(const RecEmcCluster& aCluster); 00034 //RecEmcCluster& operator=(const RecEmcCluster& aCluster); 00035 00036 //Other methods 00037 //Reset all data members to default value 00038 void Clear(); 00039 00040 //Access a cluster 00041 RecEmcID getClusterId() const { return fClusterId; } 00042 void ClusterId(const RecEmcID id); 00043 //Cluster energy 00044 RecEmcEnergy getEnergy() const; 00045 //Cluster position 00046 HepPoint3D getPosition() const; 00047 //Second moment 00048 double getSecondMoment() const; 00049 00050 //Read hit map of a cluster 00051 //Only const_iterator is supplied. 00052 //Use Insert and Erase to add and delete hit. 00053 RecEmcHitMap::const_iterator Begin() const; 00054 RecEmcHitMap::const_iterator End() const; 00055 RecEmcHitMap::const_iterator Find(const RecEmcID& CellId) const; 00056 00057 //Append and remove a hit 00058 void Insert(const RecEmcHit& aHit); 00059 void Erase(const RecEmcHit& aHit); 00060 00061 //Use Insert and Erase to add and delete seed. 00062 RecEmcHitMap::const_iterator BeginSeed() const; 00063 RecEmcHitMap::const_iterator EndSeed() const; 00064 RecEmcHitMap::const_iterator FindSeed(const RecEmcID& CellId) const; 00065 int getSeedSize() const; 00066 00067 //Append and remove a seed 00068 void InsertSeed(const RecEmcHit& aSeed); 00069 00070 int getShowerSize() const; 00071 void InsertShowerId(const RecEmcID id); 00072 vector<RecEmcID> getShowerIdVec() const { return fShowerIdVec; } 00073 void ShowerIdVec(const vector<RecEmcID>& showerIdVec) { fShowerIdVec=showerIdVec; } 00074 00075 //Dump out 00076 void Dump() const; 00077 00078 protected: 00079 //fClusterId: the minimum CellId. 00080 RecEmcID fClusterId; 00081 //fClusterHitMap: hit members of a cluster. 00082 RecEmcHitMap fHitMap; 00083 //fSeedMap: seed members of a cluster. 00084 RecEmcHitMap fSeedMap; 00085 //fShowerMap: shower members of a cluster. 00086 //map<RecEmcID,RecEmcShower*,less<RecEmcID> > fShowerMap; 00087 vector<RecEmcID> fShowerIdVec; 00088 }; 00089 00090 ostream& operator<<(ostream & os, const RecEmcCluster& aCluster); 00091 00092 typedef map<RecEmcID,RecEmcCluster,less<RecEmcID> > RecEmcClusterMap; 00093 typedef ObjectVector<RecEmcCluster> RecEmcClusterCol; 00094 00095 #endif // REC_EMC_CLUSTER_H