00001 // 00002 // Bes EMC Rec Shower 00003 // 00004 // Created by Zhe Wang 2003, 10, 1 00005 // 00006 #ifndef REC_EMC_SHOWER_H 00007 #define REC_EMC_SHOWER_H 00008 00009 #include "GaudiKernel/ContainedObject.h" 00010 #include "GaudiKernel/ObjectVector.h" 00011 #include "EventModel/EventModel.h" 00012 #include "EmcRecEventModel/RecEmcFraction.h" 00013 #include "EmcRecEventModel/RecEmcCluster.h" 00014 #include "EmcRecEventModel/RecEmcDataType.h" 00015 #include "DstEvent/DstEmcShower.h" 00016 00017 using namespace std; 00018 00019 extern const CLID& CLID_RecEmcShower; 00020 00021 class RecEmcShower : public DstEmcShower 00022 { 00023 public: 00024 00025 virtual const CLID& clID() const { return RecEmcShower::classID();} 00026 static const CLID& classID() { return CLID_RecEmcShower; } 00027 00028 //Constructors and destructors 00029 RecEmcShower(); 00030 ~RecEmcShower(); 00031 00032 //Copy and assignment 00033 //RecEmcShower(const RecEmcShower& aShower); 00034 //RecEmcShower& operator=(const RecEmcShower& aShower); 00035 RecEmcShower(const DstEmcShower& aShower); 00036 RecEmcShower& operator=(const DstEmcShower& aShower); 00037 00038 bool operator < (const RecEmcShower& aShower) const { 00039 return energy() < aShower.energy(); 00040 } 00041 00042 bool operator > (const RecEmcShower& aShower) const { 00043 return energy() > aShower.energy(); 00044 } 00045 00046 //Other methods 00047 //Reset all data members to default value 00048 void Clear(); 00049 00050 //Whether this shower comes from Tof 00051 inline bool TofShower() const {return fTofShower;} 00052 inline void TofShower(bool tof) {fTofShower=tof;} 00053 00054 //Access a Shower 00055 RecEmcID getShowerId() const { return fShowerId; } 00056 RecEmcID ShowerId(RecEmcID id); 00057 00058 //Access a cluster 00059 RecEmcID getClusterId() const { return fClusterId; } 00060 void ClusterId(const RecEmcID id); 00061 00062 RecEmcCluster* getCluster() const { return fCluster; } 00063 void Cluster(RecEmcCluster *pCluster); 00064 00065 RecEmcIDVector getCellId3x3() const { return fCellId3x3; } 00066 void CellId3x3(RecEmcIDVector& id3x3); 00067 00068 RecEmcIDVector getCellId5x5() const { return fCellId5x5; } 00069 void CellId5x5(RecEmcIDVector& id5x5); 00070 00071 //Read fraction map of a cluster 00072 //Only const_iterator is supplied. 00073 RecEmcFractionMap::const_iterator Begin() const; 00074 RecEmcFractionMap::const_iterator End() const; 00075 RecEmcFractionMap::const_iterator Find(const RecEmcID& CellId) const; 00076 00077 //Append and remove a Fraction 00078 void Insert(const RecEmcFraction& aFraction); 00079 void Erase(const RecEmcFraction& aFraction); 00080 00081 //Dump out 00082 void Dump() const; 00083 00084 public: 00085 //physics attributes 00086 unsigned int getSize() const; 00087 00088 RecEmcFractionMap getFractionMap() const; 00089 RecEmcFractionMap getFractionMap3x3() const; 00090 RecEmcFractionMap getFractionMap5x5() const; 00091 00092 RecEmcEnergy getEAll() const { return fEAll; } 00093 RecEmcEnergy EAll(RecEmcEnergy e); 00094 00095 RecEmcEnergy getELepton() const { return fELepton; } 00096 RecEmcEnergy ELepton(RecEmcEnergy e); 00097 00098 RecEmcEnergy getETof2x1() const { return fETof2x1; } 00099 RecEmcEnergy ETof2x1(RecEmcEnergy e); 00100 00101 RecEmcEnergy getETof2x3() const { return fETof2x3; } 00102 RecEmcEnergy ETof2x3(RecEmcEnergy e); 00103 00104 // NearestSeed 00105 RecEmcID NearestSeed() const; 00106 RecEmcID NearestSeed(const RecEmcID& ns); 00107 00108 // ThetaGap 00109 int ThetaGap() const; 00110 int ThetaGap(int ThetaGap); 00111 // PhiGap 00112 int PhiGap() const; 00113 int PhiGap(int PhiGap); 00114 00115 protected: 00116 //only from Tof 00117 bool fTofShower; 00118 //fShowerId: the max fraction's CellId. 00119 RecEmcID fShowerId; 00120 //fCluster: the cluster belongs to 00121 RecEmcID fClusterId; 00122 RecEmcCluster *fCluster; 00123 //3x3 Id vector 00124 RecEmcIDVector fCellId3x3; 00125 //5x5 Id vector 00126 RecEmcIDVector fCellId5x5; 00127 //fShowerFractionMap: Fraction members of a Shower. 00128 RecEmcFractionMap fFractionMap; 00129 00130 //attribute 00131 // 00132 // To do: add other physics attributes. 00133 // At the same time you should add corresponding statements 00134 // in the following method. 00135 // Clear(), copy & assignment, read & write interface 00136 // Others is optional. 00137 // 00138 00139 // Some usable attribute of a shower 00140 // Energy with all crystals included 00141 RecEmcEnergy fEAll; 00142 // Energy of shower with certain crystals corrding to E3x3 00143 RecEmcEnergy fELepton; 00144 00145 // Energy of TOF 2x1 scintillators 00146 RecEmcEnergy fETof2x1; 00147 // Energy of TOF 2x3 scintillators 00148 RecEmcEnergy fETof2x3; 00149 00150 // Position 00151 //HepPoint3D fPosition; 00152 00153 // Nearest neighbor seed in the same cluster 00154 // If it exists it will be an ID value, else it it an invalid value. 00155 RecEmcID fNearestSeed; 00156 // 00157 // Gap: gap between its seed and its nearest neighbor seed 00158 // in the same cluster. 00159 // 1: **; 2: *o*; 3: *oo*; 4: *ooo*; 5: *oooo*; 00160 // 6: gap>=6; 00161 // 9: only one seed is in this cluster. 00162 int fThetaGap; 00163 int fPhiGap; 00164 00165 }; 00166 00167 ostream& operator<<(ostream & os, const RecEmcShower& aShower); 00168 00169 typedef map<RecEmcID,RecEmcShower,less<RecEmcID> > RecEmcShowerMap; 00170 typedef vector<RecEmcShower> RecEmcShowerVec; 00171 typedef ObjectVector<RecEmcShower> RecEmcShowerCol; 00172 00173 #endif // REC_EMC_SHOWER_H