00001 #ifndef TV1730RawData_hxx_seen 00002 #define TV1730RawData_hxx_seen 00003 00004 #include <vector> 00005 00006 #include "TGenericData.hxx" 00007 00008 /// Class for each channel measurement 00009 /// For the definition of obscure variables see the CAEN V1730 manual (for raw (non-DPP) readout). 00010 class RawChannelMeasurement { 00011 00012 friend class TV1730RawData; 00013 00014 public: 00015 00016 int GetNSamples(){ 00017 return fSamples.size(); 00018 } 00019 00020 int GetChannel(){ return fChan;} 00021 00022 /// Get Errors 00023 uint32_t GetSample(int i){ 00024 if(i >= 0 && i < fSamples.size()) 00025 return fSamples[i]; 00026 return 9999999; 00027 } 00028 00029 void AddSamples(std::vector<uint32_t> Samples){ 00030 fSamples = Samples; 00031 } 00032 00033 private: 00034 00035 int fChan; // channel number 00036 00037 /// Constructor; need to pass in header and measurement. 00038 RawChannelMeasurement(int chan){ 00039 fChan = chan; 00040 } 00041 00042 std::vector<uint32_t> fSamples; 00043 00044 00045 }; 00046 00047 00048 /// Class to store raw data from CAEN V1730 (for raw readout, no-DPP). 00049 class TV1730RawData: public TGenericData { 00050 00051 public: 00052 00053 /// Constructor 00054 TV1730RawData(int bklen, int bktype, const char* name, void *pdata); 00055 00056 00057 /// Get Event Counter 00058 uint32_t GetEventCounter() const {return (fGlobalHeader[2] & 0xffffff);}; 00059 00060 /// Get Event Counter 00061 uint32_t GetEventSize() const {return (fGlobalHeader[0] & 0xfffffff);}; 00062 00063 /// Get Geographical Address 00064 uint32_t GetGeoAddress() const {return (fGlobalHeader[1] & 0xf8000000) >> 27 ;}; 00065 00066 /// Get the extended trigger time tag 00067 uint32_t GetTriggerTimeTag() const {return fGlobalHeader[3];}; 00068 00069 /// Get channel mask 00070 uint32_t GetChMask(){return (fGlobalHeader[1] & 0xff) + ((fGlobalHeader[2] & 0xff000000) >> 16);}; 00071 00072 void Print(); 00073 00074 /// Get the Vector of TDC Measurements. 00075 std::vector<RawChannelMeasurement>& GetMeasurements() {return fMeasurements;} 00076 00077 00078 00079 private: 00080 00081 // We have vectors of the headers/trailers/etc, since there can be 00082 // multiple events in a bank. 00083 00084 /// The overall global header 00085 std::vector<uint32_t> fGlobalHeader; 00086 00087 /// Vector of V1730 Measurements. 00088 std::vector<RawChannelMeasurement> fMeasurements; 00089 00090 }; 00091 00092 #endif