Go to the documentation of this file.00001 #ifndef TSPADICV10EVENT_H
00002 #define TSPADICV10EVENT_H
00003
00004 #include "TGo4EventElement.h"
00005 #include "TGo4CompositeEvent.h"
00006 #include <vector>
00007
00008
00009
00010
00011
00012
00013 #include "sp605/Message.h"
00014
00015
00016
00017
00018
00019 #define MAX_SPADICV10_BOARDS 8
00020
00021
00022
00023 #define SET_SPADICV10_BOARDS {0, 1, 0, 0, 0, 0, 0, 1}
00024
00025
00026
00027 #define MAX_SPADICV10_SYNC 2
00028 #define MAX_SPADICV10_AUX 4
00029
00030
00031 #define MAX_SPADICV10_GROUPS 2
00032
00033 #define MAX_SPADICV10CHANNELS 32
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #define MAX_SPADICV10 15
00044
00045
00046
00047
00048
00049
00050
00051
00052 #define SPADICV10_TRACE_SIZE SP605_SPADIC_MAX_SAMPLE+1 //64
00053
00054
00055 #include <stdint.h>
00056
00057
00058
00059
00060
00061
00062
00063
00064 class TSpadicV10MessageExtended
00065 {
00066 public:
00067
00068 TSpadicV10MessageExtended(const sp605::Message& msg, uint64_t fulltime=0) :
00069 fxMessage(msg),
00070 fuFulltime(fulltime),
00071 ffTriggerDeltaT(0)
00072 {
00073 }
00074
00075 TSpadicV10MessageExtended() :
00076 fxMessage(),
00077 fuFulltime(0),
00078 ffTriggerDeltaT(0)
00079 {
00080 }
00081
00082 virtual ~TSpadicV10MessageExtended(){}
00083
00084
00085 bool operator<(const TSpadicV10MessageExtended &rhs) const
00086 { return (fuFulltime < rhs.fuFulltime); }
00087
00088 void SetSpadicV10Message(const sp605::Message & source)
00089 {
00090 fxMessage=source;
00091 }
00092
00093 sp605::Message& GetSpadicV10Message()
00094 {
00095 return fxMessage;
00096 }
00097
00098
00099 unsigned GetSpadicId() const { return fSpadicId; }
00100 void SetSpadicId(unsigned id) { fSpadicId = id; }
00101
00102 uint8_t GetMessageType() const
00103 {
00104 return fxMessage.getMsgType();
00105 }
00106
00107
00108 void SetFullTime(uint64_t ts)
00109 {
00110 fuFulltime=ts;
00111 }
00112
00113 uint64_t GetFullTime() const
00114 {
00115 return fuFulltime;
00116 }
00117
00118 uint16_t GetSpadicNumber() const
00119 {
00120 return fxMessage.getSpadicNumber();
00121 }
00122
00123
00124 uint8_t GetGroupNumber() const
00125 {
00126 return fxMessage.getGroup();
00127 }
00128
00129 uint8_t GetChNum() const
00130 {
00131 return fxMessage.getChNum();
00132 }
00133
00134
00135 unsigned GetFullChNum() const { return fxMessage.getFullChNum(); }
00136
00137
00138 void SetTriggerDeltaT(float dt)
00139 {
00140 ffTriggerDeltaT=dt;
00141 }
00142
00143 float GetTriggerDeltaT() const
00144 {
00145 return ffTriggerDeltaT;
00146 }
00147
00148
00149
00150
00151 protected:
00152
00153
00154 sp605::Message fxMessage;
00155
00156 unsigned fSpadicId;
00157
00158
00159 float ffCorrectedADC;
00160
00161
00162 uint64_t fuFulltime;
00163
00164
00165
00166 float ffTriggerDeltaT;
00167
00168
00169
00170
00171
00172
00173 };
00174
00175 class TSpadicV10Data : public TGo4EventElement {
00176 public:
00177 TSpadicV10Data();
00178 TSpadicV10Data(const char* name, Short_t id=0);
00179 virtual ~TSpadicV10Data();
00180
00182 virtual void Clear(Option_t *t="");
00183
00184
00185 std::vector<TSpadicV10MessageExtended> fExtMessages;
00186
00187
00188
00189
00190 ULong64_t fLastSyncTm[MAX_SPADICV10_SYNC];
00191
00192
00193
00194 ULong64_t fLastTriggerTm;
00195
00196 ClassDef(TSpadicV10Data,1)
00197 };
00198
00199
00200
00201 class TSpadicV10Event : public TGo4CompositeEvent {
00202 public:
00203 TSpadicV10Event();
00204 TSpadicV10Event(const char* name, Short_t id=0);
00205 virtual ~TSpadicV10Event();
00206
00208 double GetEventTime() const { return fLastGlobalTriggerTm*1e-9; }
00209
00210
00211
00212 ULong64_t CalcGlobalTime(Double_t deltaTrigger);
00213
00214
00215 static Bool_t ConfigBoards[MAX_SPADICV10_BOARDS];
00216
00217
00218
00219
00220
00221 ULong64_t fLastGlobalTriggerTm;
00222
00223 ULong64_t fMbsEventNumber;
00224
00225 ClassDef(TSpadicV10Event,1)
00226 };
00227 #endif //TEVENT_H
00228
00229
00230