00001 #ifndef __StMuRpsCollection_hh__
00002 #define __StMuRpsCollection_hh__
00003
00004 #include "TObject.h"
00005 #include <vector>
00006
00007 using namespace std;
00008
00009 class StRpsCollection;
00010
00011 class StMuRpsCollection : public TObject {
00012
00013 public:
00014
00015 StMuRpsCollection() {; }
00016 StMuRpsCollection(const StRpsCollection& vertex);
00017 ~StMuRpsCollection() {;}
00018
00019
00020
00021 unsigned char siliconBunch() const;
00022
00023
00024
00025 unsigned int numberOfRomanPots() const { return mNumberOfRomanPot; }
00026 unsigned int numberOfPlanesWithClusters(int romanPotId) const;
00027 unsigned int adc(int romanPotId, unsigned int) const;
00028 unsigned int tac(int romanPotId, unsigned int) const;
00029 unsigned char status(int romanPotId) const;
00030
00031
00032
00033 unsigned int numberOfPlanes() const { return mNumberOfPlanes; }
00034 double offsetPlane(int romanPotId, int planeId) const;
00035 double zPlane(int romanPotId, int planeId) const;
00036 double anglePlane(int romanPotId, int planeId) const;
00037 short orientationPlane(int romanPotId, int planeId) const;
00038 unsigned char statusPlane(int romanPotId, int planeId) const;
00039
00040
00041
00042 int numberOfClusters(int romanPotId, int planeId) const;
00043 double positionCluster(int romanPotId, int planeId, int cluster) const;
00044 short lengthCluster(int romanPotId, int planeId, int cluster) const;
00045 double energyCluster(int romanPotId, int planeId, int cluster) const;
00046 double xyCluster(int romanPotId, int planeId, int cluster) const;
00047 unsigned char qualityCluster(int romanPotId, int planeId, int cluster) const;
00048
00049 private:
00050
00051 enum {mNumberOfRomanPot = 8, mNumberOfPlanes = 4};
00052
00053 unsigned char mSiliconBunch;
00054
00055 int mNumberPlanes[mNumberOfRomanPot];
00056 int mNumberPlanesWithClusters[mNumberOfRomanPot];
00057 unsigned char mStatusRomanPot[mNumberOfRomanPot];
00058 int mADC[mNumberOfRomanPot][2];
00059 int mTAC[mNumberOfRomanPot][2];
00060
00061 double mOffsetPlane[mNumberOfRomanPot][mNumberOfPlanes];
00062 double mzPlane[mNumberOfRomanPot][mNumberOfPlanes];
00063 double mAnglePlane[mNumberOfRomanPot][mNumberOfPlanes];
00064 short mOrientationPlane[mNumberOfRomanPot][mNumberOfPlanes];
00065 unsigned char mStatusPlane[mNumberOfRomanPot][mNumberOfPlanes];
00066 int mNumberOfClusters[mNumberOfRomanPot][mNumberOfPlanes];
00067
00068 vector<double> mPositionCluster[mNumberOfRomanPot][mNumberOfPlanes];
00069 vector<short> mLengthCluster[mNumberOfRomanPot][mNumberOfPlanes];
00070 vector<double> mEnergyCluster[mNumberOfRomanPot][mNumberOfPlanes];
00071 vector<double> mXYCluster[mNumberOfRomanPot][mNumberOfPlanes];
00072 vector<unsigned char> mQualityCluster[mNumberOfRomanPot][mNumberOfPlanes];
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 ClassDef(StMuRpsCollection,2)
00083
00084 };
00085 inline unsigned char StMuRpsCollection::siliconBunch() const { return mSiliconBunch ; }
00086 inline unsigned int StMuRpsCollection::numberOfPlanesWithClusters(int romanPotId) const { return romanPotId < mNumberOfRomanPot ? mNumberPlanesWithClusters[romanPotId] : 0; }
00087 inline unsigned char StMuRpsCollection::status(int romanPotId) const {
00088 if (romanPotId < mNumberOfRomanPot) return mStatusRomanPot[romanPotId];
00089 else return 0;
00090 }
00091
00092 inline unsigned int StMuRpsCollection::adc(int romanPotId, unsigned int n) const { return romanPotId < mNumberOfRomanPot && n < 2 ? mADC[romanPotId][n] : 0;}
00093 inline unsigned int StMuRpsCollection::tac(int romanPotId, unsigned int n) const { return romanPotId < mNumberOfRomanPot && n < 2 ? mTAC[romanPotId][n] : 0;}
00094 inline double StMuRpsCollection::offsetPlane(int romanPotId, int planeId) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes ? mOffsetPlane[romanPotId][planeId] : 0;}
00095 inline double StMuRpsCollection::zPlane(int romanPotId, int planeId) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes ? mzPlane[romanPotId][planeId] : 0;}
00096 inline double StMuRpsCollection::anglePlane(int romanPotId, int planeId) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes ? mAnglePlane[romanPotId][planeId] : 0;}
00097 inline short StMuRpsCollection::orientationPlane(int romanPotId, int planeId) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes ? mOrientationPlane[romanPotId][planeId] : 0;}
00098 inline unsigned char StMuRpsCollection::statusPlane(int romanPotId, int planeId) const {
00099 if(romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes) return mStatusPlane[romanPotId][planeId];
00100 else return 0;
00101 }
00102 inline int StMuRpsCollection::numberOfClusters(int romanPotId, int planeId) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes ? mNumberOfClusters[romanPotId][planeId] : 0;}
00103 inline double StMuRpsCollection::positionCluster(int romanPotId, int planeId, int cluster) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes && cluster < mNumberOfClusters[romanPotId][planeId]? mPositionCluster[romanPotId][planeId][cluster] : 0;}
00104 inline short StMuRpsCollection::lengthCluster(int romanPotId, int planeId, int cluster) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes && cluster < mNumberOfClusters[romanPotId][planeId]? mLengthCluster[romanPotId][planeId][cluster] : 0;}
00105 inline double StMuRpsCollection::energyCluster(int romanPotId, int planeId, int cluster) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes && cluster < mNumberOfClusters[romanPotId][planeId]? mEnergyCluster[romanPotId][planeId][cluster] : 0;}
00106 inline double StMuRpsCollection::xyCluster(int romanPotId, int planeId, int cluster) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes && cluster < mNumberOfClusters[romanPotId][planeId]? mXYCluster[romanPotId][planeId][cluster] : 0;}
00107 inline unsigned char StMuRpsCollection::qualityCluster(int romanPotId, int planeId, int cluster) const { return romanPotId < mNumberOfRomanPot && planeId < mNumberOfPlanes && cluster < mNumberOfClusters[romanPotId][planeId]? mQualityCluster[romanPotId][planeId][cluster] : 0;}
00108
00109 #endif