• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

beamtime/sts-lasertest/go4/STS/TSTSEvent.h (r4864/r3054)

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 "TSTSDigi.h"
00009 
00010 /*
00011  * Put all definitions here and use them in processor,
00012  * since they are necessary for data structure of event
00013  */
00014 
00015 #define LASERSCANIDOFF 1000
00016 
00017 
00018 #define NUM_STS_STATIONS 2
00019 #define NUM_STS_ROCS 6
00020 #define NUM_STS_STRIPS 257
00021 
00022 
00023 
00024 class TSTSEvent : public TGo4EventElement {
00025 protected:
00026         Int_t fNStations;
00027         std::vector< std::vector < TSpacepoint > > fPoints;
00028         std::vector< std::vector< std::vector < TSTSDigi > > > fDigis; // [station][side][digiId]
00029 
00030         virtual Int_t Init();
00031    public:
00032 
00033 //      struct stshit_t {
00034 //              stshit_t(Double_t ix, Int_t strip, Double_t t, Bool_t negative, Double_t adc):
00035 //                 StationIndex(ix),Strip(strip),Time(t),IsNegative(negative),ADC(adc)
00036 //                 { }
00037 //              stshit_t(){}
00038 //              Int_t StationIndex;
00039 //              Int_t Strip;
00040 //              Double_t Time;
00041 //              Bool_t IsNegative;
00042 //              Double_t ADC;
00043 //           };
00044 
00045       struct lasersetup_t {
00046             lasersetup_t(UInt_t id, Double_t x, Double_t y, Double_t u,
00047                   UInt_t t) :
00048                   ScanId(id), Xpos(x), Ypos(y), Voltage(u), UnixTime(t)
00049             {
00050             }
00051             lasersetup_t()
00052             {
00053             }
00054             void Clear()
00055             {
00056                ScanId=0;
00057                Xpos=-1;
00058                Ypos=-1;
00059                Voltage=-1;
00060                UnixTime=0;
00061             }
00062 
00063             UInt_t ScanId; // id of measurment point: CBM:TABLE:run
00064             Double_t Xpos; // CBM:TABLE:xpos
00065             Double_t Ypos; // CBM:TABLE:ypos
00066             Double_t Voltage; // CBM:KEITHLEY0:GETVOLTS
00067             UInt_t UnixTime;
00068       };
00069 
00070 
00071       TSTSEvent();
00072       TSTSEvent(const char* name, Short_t id=0);
00073       virtual ~TSTSEvent();
00074 
00076       virtual void Clear(Option_t *t="");
00077 
00078       void                                      AddPoint( UInt_t plane, TSpacepoint const & point );
00079       Int_t                                     GetNPlanes() const { return fPoints.size(); }
00080       Int_t                                     GetNPoints( UInt_t plane ) const { return fPoints.at( plane ).size(); }
00081       TSpacepoint const &       GetPoint( UInt_t plane, Int_t point ) const { return fPoints.at( plane ).at( point ); }
00082 
00083       void                                      AddDigi( UInt_t station, UInt_t side, TSTSDigi const & digi );
00084       Int_t                                     GetNStations() const { return fNStations; }
00085       Int_t                                     GetNDigis( UInt_t station, UInt_t side ) const { return fDigis.at( station ).at( side ).size(); }
00086       TSTSDigi const &          GetDigi( UInt_t station, UInt_t side, UInt_t digi ) const { return fDigis.at( station ).at( side ).at( digi ); }
00087 
00088 //      void AddHit(Double_t station, Int_t strip, Double_t t, Bool_t negative, Double_t adc)
00089 //      {
00090 //        stshit_t hit(station,strip, t, negative, adc);
00091 //        fHits.push_back(hit);
00092 //      }
00093 
00094      // return number of hits in the event
00095     // unsigned NumHits() const { return fHits.size(); }
00096 
00097     // return record for specified hit
00098  //   stshit_t& Hit(unsigned n) { return fHits[n]; }
00099 
00100 
00101       const lasersetup_t& GetLaserSetup()
00102          {
00103             return fCurrentScan;
00104          }
00105 
00106       void SetLaserSetup(lasersetup_t set)
00107          {
00108             fCurrentScan=set;
00109          }
00110       void ClearLaserSetup()
00111              {
00112                 fCurrentScan.Clear();;
00113              }
00114 
00115    protected:
00116 
00117    // std::vector<stshit_t>  fHits;
00118 
00119     lasersetup_t fCurrentScan;
00120 
00121 
00122    ClassDef(TSTSEvent,1)
00123 };
00124 #endif //TEVENT_H
00125 
00126 
00127 

Generated on Tue Dec 10 2013 04:52:18 for ROCsoft by  doxygen 1.7.1