Go to the documentation of this file.00001 #ifndef TSTSEVENT_H
00002 #define TSTSEVENT_H
00003
00004 #include "TGo4EventElement.h"
00005 #include <vector>
00006 #include "../TSpacepoint.h"
00007 #include "TSTSTopology.h"
00008 #include "TSTSCluster.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017 #define NUM_STS_STATIONS 2
00018 #define NUM_STS_ROCS 6
00019 #define NUM_STS_STRIPS 257
00020
00021
00022
00023 class TSTSEvent : public TGo4EventElement {
00024 protected:
00025 Int_t fNStations;
00026 std::vector< std::vector < TSpacepoint > > fPoints;
00027 std::vector< std::vector< std::vector < TSTSDigi > > > fDigis;
00028 std::vector< std::vector< std::vector < TSTSCluster > > > fClusters;
00029
00030 public:
00031
00032 struct stshit_t {
00033 stshit_t(Double_t ix, Int_t strip, Double_t t, Bool_t negative, Double_t adc):
00034 StationIndex(ix),Strip(strip),Time(t),IsNegative(negative),ADC(adc)
00035 { }
00036 stshit_t(){}
00037 Int_t StationIndex;
00038 Int_t Strip;
00039 Double_t Time;
00040 Bool_t IsNegative;
00041 Double_t ADC;
00042 };
00043
00044 TSTSEvent();
00045 TSTSEvent(const char* name, Short_t id=0);
00046 virtual ~TSTSEvent();
00047
00049 virtual void Clear(Option_t *t="");
00050
00051 void AddPoint( UInt_t plane, TSpacepoint const & point );
00052 Int_t GetNPlanes() const { return fPoints.size(); }
00053 Int_t GetNPoints( UInt_t plane ) const { return fPoints.at( plane ).size(); }
00054 TSpacepoint const & GetPoint( UInt_t plane, Int_t point ) const { return fPoints.at( plane ).at( point ); }
00055
00056 void AddDigi( UInt_t station, UInt_t side, TSTSDigi const & digi );
00057 Int_t GetNStations() const { return fNStations; }
00058 Int_t GetNDigis( UInt_t station, UInt_t side ) const { return fDigis.at( station ).at( side ).size(); }
00059 TSTSDigi const & GetDigi( UInt_t station, UInt_t side, UInt_t digi ) const { return fDigis.at( station ).at( side ).at( digi ); }
00060
00061 void AddCluster( UInt_t station, UInt_t side, TSTSCluster const & clust );
00062 Int_t GetNClusters( UInt_t station, UInt_t side ) const { return fClusters.at( station ).at( side ).size(); }
00063 TSTSCluster const & GetCluster( UInt_t station, UInt_t side, UInt_t cluster ) const { return fClusters.at( station ).at( side ).at( cluster ); }
00064
00065 void AddHit(Double_t station, Int_t strip, Double_t t, Bool_t negative, Double_t adc)
00066 {
00067 stshit_t hit(station,strip, t, negative, adc);
00068 fHits.push_back(hit);
00069 }
00070
00071
00072 unsigned NumHits() const { return fHits.size(); }
00073
00074
00075 stshit_t& Hit(unsigned n) { return fHits[n]; }
00076
00077 protected:
00078
00079 std::vector<stshit_t> fHits;
00080
00081
00082
00083 ClassDef(TSTSEvent,1)
00084 };
00085 #endif //TEVENT_H
00086
00087
00088