00001
00014 #ifndef StMuEmcCollection__h
00015 #define StMuEmcCollection__h
00016
00017 #include "TObject.h"
00018 #include "TClonesArray.h"
00019 #include "StMuEmcHit.h"
00020 #include "StMuEmcCluster.h"
00021 #include "StMuEmcPoint.h"
00022 #include "StMuEmcTowerData.h"
00023 #include "StEnumerations.h"
00024 #include "Stiostream.h"
00025
00026
00027
00028 class StMuEmcCollection: public TObject
00029 {
00030 public:
00031 StMuEmcCollection();
00032 StMuEmcCollection(const StMuEmcCollection&);
00033 virtual ~StMuEmcCollection();
00034 void clear(Option_t *option="");
00035 virtual void Clear(Option_t *){clear();}
00036 void DeleteThis();
00037
00038 int getTowerADC(int id, int detector = bemc) const;
00039 StEmcCrateStatus getCrateStatus(int crate, int detector = bemc) const { if (mTowerData) return mTowerData->crateStatus(crate,detector); else return crateUnknown; }
00040 int getNSmdHits(int detector) const;
00041 StMuEmcHit* getSmdHit(int hitId, int detector = bsmde);
00042 const StMuEmcHit* getSmdHit(int hitId, int detector = bsmde) const;
00043 TClonesArray* getPrsHits(int detector = bprs) { if (detector==bprs) return mPrsHits; else if (detector==eprs) return mEndcapPrsHits; else return 0; }
00044 const TClonesArray* getPrsHits(int detector = bprs) const { if (detector==bprs) return mPrsHits; else if (detector==eprs) return mEndcapPrsHits; else return 0; }
00045 int getNPrsHits(int detector = bprs) const;
00046 StMuEmcHit* getPrsHit(int hitId, int detector = bprs);
00047 const StMuEmcHit* getPrsHit(int hitId, int detector = bprs) const;
00048 int getNClusters(int detector) const;
00049 StMuEmcCluster* getCluster(int clusterId,int detector);
00050 const StMuEmcCluster* getCluster(int clusterId,int detector) const;
00051 int getNPoints() const;
00052 StMuEmcPoint* getPoint(int);
00053 const StMuEmcPoint* getPoint(int) const;
00054 int getNEndcapPoints() const;
00055 StMuEmcPoint* getEndcapPoint(int);
00056 const StMuEmcPoint* getEndcapPoint(int) const;
00057
00058
00059 int getNEndcapTowerADC() const { return 720;}
00060 void getEndcapTowerADC(int ihit, int &adc, int &sec, int &sub, int & eta) const ;
00061
00062 int getNEndcapPrsHits() const { return getNPrsHits(eprs);}
00063 StMuEmcHit *getEndcapPrsHit(int ihit, int &sec, int &sub, int & eta, int &pre);
00064 const StMuEmcHit *getEndcapPrsHit(int ihit, int &sec, int &sub, int & eta, int &pre) const;
00065
00066 int getNEndcapSmdHits(char uv) const;
00067 StMuEmcHit * getEndcapSmdHit(char uv, int ihit, int &sec, int &strip);
00068 const StMuEmcHit * getEndcapSmdHit(char uv, int ihit, int &sec, int &strip) const;
00069
00070 void setTowerADC(int,int, int detector = bemc);
00071 void addSmdHit(int detector);
00072 void addPrsHit(int detector = bprs);
00073 void addCluster(int detector);
00074 void addPoint();
00075 void addEndcapPoint();
00076 void setPrsArray(int detector, TClonesArray *cla);
00077 void setSmdArray(int detector, TClonesArray *cla);
00078 void setTowerData(StMuEmcTowerData *tow_dat) {mTowerData=tow_dat;}
00079 void setCrateStatus(StEmcCrateStatus status, int crate, int detector = bemc) { if (mTowerData) mTowerData->setCrateStatus(status,crate,detector);}
00080
00081 protected:
00082 void init();
00083 void packbits(unsigned char*, unsigned int, unsigned int, unsigned int);
00084 unsigned int unpackbits(const unsigned char*, unsigned int, unsigned int) const ;
00085
00086
00087 unsigned char mTowerADC[7200];
00088 unsigned char mEndcapTowerADC[1080];
00089 StMuEmcTowerData* mTowerData;
00090
00091 TClonesArray* mPrsHits;
00092 TClonesArray* mSmdHits[2];
00093 TClonesArray* mEmcClusters[4];
00094 TClonesArray* mEmcPoints;
00095
00096 TClonesArray* mEndcapPrsHits;
00097 TClonesArray* mEndcapSmdHits[2];
00098 TClonesArray* mEndcapEmcClusters[4];
00099 TClonesArray* mEndcapEmcPoints;
00100
00101 ClassDef(StMuEmcCollection,3)
00102 };
00103
00104
00105
00106 #endif
00107