ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
S800.h
Go to the documentation of this file.
1 #ifndef __S800_HH
2 #define __S800_HH
3 
4 #include <Rtypes.h>
5 #include <TObject.h>
6 
7 #include <string.h>
8 
9 #include <algorithm>
10 #include <iostream>
11 #include <vector>
12 
13 class TBuffer;
14 class TClass;
15 class TMemberInspector;
16 
17 using namespace std;
18 
22 class GTimeOfFlight : public TObject {
23 public:
25  {
26  frf = 0;
27  fobj = 0;
28  fxfp = 0;
29  fsi = 0;
30  ftac_obj = 0;
31  ftac_xfp = 0;
32  }
33  ~GTimeOfFlight() { Clear(); };
34  void Clear()
35  {
36  frf = 0;
37  fobj = 0;
38  fxfp = 0;
39  fsi = 0;
40  ftac_obj = 0;
41  ftac_xfp = 0;
42  }
43  void Set(Short_t rf, Short_t obj, Short_t xfp, Short_t si)
44  {
45  frf = rf;
46  fobj = obj;
47  fxfp = xfp;
48  fsi = si;
49  }
50  void SetTAC(Short_t tac_obj, Short_t tac_xfp)
51  {
52  ftac_obj = tac_obj;
53  ftac_xfp = tac_xfp;
54  }
55  Short_t GetRF() { return frf; }
56  Short_t GetOBJ() { return fobj; }
57  Short_t GetXFP() { return fxfp; }
58  Short_t GetSi() { return fsi; }
59  Short_t GetTACOBJ() { return ftac_obj; }
60  Short_t GetTACXFP() { return ftac_xfp; }
61 
62 protected:
63  Short_t frf;
64  Short_t fobj;
65  Short_t fxfp;
66  Short_t fsi;
67  Short_t ftac_obj;
68  Short_t ftac_xfp;
69 
71 };
72 
76 class GTrigger : public TObject {
77 public:
79  {
80  fregistr = 0;
81  fs800 = 0;
82  fexternal1 = 0;
83  fexternal2 = 0;
84  fsecondary = 0;
85  }
86  ~GTrigger() { Clear(); };
87  void Clear()
88  {
89  fregistr = 0;
90  fs800 = 0;
91  fexternal1 = 0;
92  fexternal2 = 0;
93  fsecondary = 0;
94  }
95  void Set(int registr, int s800, int external1, int external2, int secondary)
96  {
97  fregistr = registr;
98  fs800 = s800;
99  fexternal1 = external1;
100  fexternal2 = external2;
101  fsecondary = secondary;
102  }
103  Short_t GetRegistr() { return fregistr; }
104  Short_t GetS800() { return fs800; }
105  Short_t GetExternal1() { return fexternal1; }
106  Short_t GetExternal2() { return fexternal2; }
107  Short_t GetSecondary() { return fsecondary; }
108 
109 protected:
110  Short_t fregistr;
111  Short_t fs800;
112  Short_t fexternal1;
113  Short_t fexternal2;
114  Short_t fsecondary;
115 
117 };
118 
122 class GScintillator : public TObject {
123 public:
125  {
126  fID = -1;
127  fde_up = -1.0;
128  fde_down = -1.0;
129  ftime_up = -1.0;
130  ftime_down = -1.0;
131  }
132  ~GScintillator() { Clear(); };
133  void Clear()
134  {
135  fID = -1;
136  fde_up = -1.0;
137  fde_down = -1.0;
138  ftime_up = -1.0;
139  ftime_down = -1.0;
140  }
141  void SetID(int id) { fID = id; }
142  void Set(int de_up, int time_up, int de_down, int time_down)
143  {
144  if (de_up > -1)
145  fde_up = de_up;
146  if (time_up > -1)
147  ftime_up = time_up;
148  if (de_down > -1)
149  fde_down = de_down;
150  if (time_down > -1)
151  ftime_down = time_down;
152  }
153  Int_t GetID() { return fID; }
154  Float_t GetDE_up() { return fde_up; }
155  Float_t GetTime_up() { return ftime_up; }
156  Float_t GetDE_down() { return fde_down; }
157  Float_t GetTime_down() { return ftime_down; }
158 
159 protected:
160  Int_t fID;
161  Float_t fde_up;
162  Float_t fde_down;
163  Float_t ftime_up;
164  Float_t ftime_down;
165 
167 };
168 
171 class GHodoscope : public TObject {
172 public:
173  GHodoscope() { fenergy = -1.0; }
174  ~GHodoscope() { Clear(); }
175  void Clear() { fenergy = -1.0; }
176  void SetEnergy(Int_t energy) { fenergy = (Float_t)energy; }
177  Float_t GetEnergy() { return fenergy; }
178 
179 protected:
180  Float_t fenergy;
181 
183 };
184 
188 class GIonChamber : public TObject {
189 public:
191  {
192  fchannels.clear();
193  fdata.clear();
194  }
195  ~GIonChamber() { Clear(); };
196  void Clear()
197  {
198  fchannels.clear();
199  fdata.clear();
200  }
201  void Set(int ch, int data)
202  {
203  fchannels.push_back(ch);
204  fdata.push_back(data);
205  }
206 
207  std::vector<int> GetChannels() { return fchannels; }
208  std::vector<float> GetData() { return fdata; }
209 
210 protected:
211  std::vector<int> fchannels;
212  std::vector<float> fdata;
213 
215 };
216 
220 class GCrdc : public TObject {
221 public:
223  {
224  fID = -1;
225  fanode = -1;
226  ftac = -1;
227  fdata.clear();
228  fsample.clear();
229  fchannels.clear();
230  }
231  ~GCrdc() { Clear(); };
232  void Clear()
233  {
234  fID = -1;
235  fanode = -1;
236  ftac = -1;
237  fdata.clear();
238  fsample.clear();
239  fchannels.clear();
240  }
241  void SetID(int id) { fID = id; }
242  void SetAnodeTAC(int anode, int tac)
243  {
244  fanode = anode;
245  ftac = tac;
246  }
247  void SetSampleWidth(int width) { fwidth = width; }
248  void Set(Short_t data, Short_t sample, Short_t ch)
249  {
250  fdata.push_back(data);
251  fsample.push_back(sample);
252  fchannels.push_back(ch);
253  }
254  Float_t GetAnode() { return fanode; }
255  Float_t GetTAC() { return ftac; }
256  std::vector<Short_t> GetData() { return fdata; }
257  std::vector<Short_t> GetSample() { return fsample; }
258  std::vector<Short_t> GetChannels() { return fchannels; }
259 
260  Int_t GetID() { return fID; }
261 
262 protected:
263  Int_t fID;
264  Float_t fanode;
265  Float_t ftac;
266  Short_t fwidth;
267  std::vector<Short_t> fdata;
268  std::vector<Short_t> fsample;
269  std::vector<Short_t> fchannels;
270 
272 };
273 
276 class GMultiHitTOF : public TObject {
277 public:
278  GMultiHitTOF() { Clear(); }
279  ~GMultiHitTOF() { Clear(); }
280 
281  void Clear()
282  {
283 
284  fE1Up.clear();
285  fE1Down.clear();
286  fXf.clear();
287  fObj.clear();
288  fGalotte.clear();
289  fRf.clear();
290  fHodoscope.clear();
291  }
292 
293  vector<Float_t> fE1Up;
294  vector<Float_t> fE1Down;
295  vector<Float_t> fXf;
296  vector<Float_t> fObj;
297  vector<Float_t> fGalotte;
298  vector<Float_t> fRf;
299  vector<Float_t> fHodoscope;
300 
302 };
303 
305 class GCrdc_test : public TObject {
306 public:
308  {
309  fdata.clear();
310  memset(raw_crdc, 0, sizeof(raw_crdc));
311  }
312  ~GCrdc_test() { Clear(); };
313  void Clear()
314  {
315  fdata.clear();
316  memset(raw_crdc, 0, sizeof(raw_crdc));
317  }
318 
319  void Set_raw(int n, int q, float val) { raw_crdc[n][q] = val; }
320  std::vector<float> GetData() { return fdata; }
321  float Get_raw(int n, int q) { return raw_crdc[n][q]; }
322 
323 protected:
324  float raw_crdc[2][224];
325  std::vector<float> fdata;
326 
328 };
330 
338 class S800 : public TObject {
339 public:
340  S800() { Clear(); }
341  void Clear()
342  {
343  fMultiHitTOF.Clear();
344  fTof.Clear();
345  fTrigger.Clear();
346  for (int i = 0; i < 3; i++)
347  fScintillator[i].Clear();
348  fIonChamber.Clear();
349  for (int i = 0; i < 2; i++)
350  fCrdc[i].Clear();
351  for (int i = 0; i < 32; i++) {
352  fHodoscope[i].Clear();
353  }
354  fts = -1;
355  }
356  void SetTS(long long int ts) { fts = ts; }
357  void SetInternalTS(long long int ts) { fits = ts; }
358  void SetEvtNr(long long int nr) { fevtnr = nr; }
359  GTimeOfFlight *GetTimeOfFlight() { return &fTof; }
360  GTrigger *GetTrigger() { return &fTrigger; }
361  GScintillator *GetScintillator(int id) { return &fScintillator[id]; }
362  GIonChamber *GetIonChamber() { return &fIonChamber; }
363  GHodoscope *GetHodoscope(int id) { return &fHodoscope[id]; }
364  GCrdc *GetCrdc(int id) { return &fCrdc[id]; }
365  long long int GetTS() { return fts; }
366  long long int GetInternalTS() { return fits; }
367  long long int GetEvtNr() { return fevtnr; }
368 
369  GCrdc_test *GetCrdc_test() { return &fCrdc_test; } // Added Simon
370 
371  GMultiHitTOF *GetMultiHitTOF() { return &fMultiHitTOF; }
372  int DecodeS800(unsigned short *pevent, unsigned short twords);
373 
374 protected:
377  GScintillator fScintillator[3];
379  GHodoscope fHodoscope[32];
380  GCrdc fCrdc[2];
382 
383  GCrdc_test fCrdc_test; // Added Simon
384 
385  long long int fts; // global
386  long long int fits; // internal
387  long long int fevtnr;
388 
389  unsigned short *DecodeS800Crdc(unsigned short *pevent, int id);
390  unsigned short *DecodeS800CrdcRaw(unsigned short *pevent, int id);
391  unsigned short *DecodeS800Scintillator(unsigned short *pevent, unsigned short updown, int id);
392  unsigned short *DecodeS800IonChamber(unsigned short *pevent);
393  unsigned short *DecodeS800TimeOfFlight(unsigned short *pevent);
394  unsigned short *DecodeS800Trigger(unsigned short *pevent);
395  unsigned short *DecodeS800HodoScope(unsigned short *pevent);
396 
397  unsigned short *DecodeS800NewMultiHitTDC(unsigned short *pevent);
398 
400 };
401 
402 #endif
GScintillator::ftime_up
Float_t ftime_up
Definition: S800.h:163
GTrigger::fregistr
Short_t fregistr
Definition: S800.h:110
S800::GetTS
long long int GetTS()
Definition: S800.h:365
GMultiHitTOF::fXf
vector< Float_t > fXf
Definition: S800.h:295
GHodoscope::GetEnergy
Float_t GetEnergy()
Definition: S800.h:177
GTimeOfFlight::ClassDef
ClassDef(GTimeOfFlight, 1)
S800::ClassDef
ClassDef(S800, 1)
GScintillator
Definition: S800.h:122
S800::GetCrdc
GCrdc * GetCrdc(int id)
Definition: S800.h:364
S800::SetInternalTS
void SetInternalTS(long long int ts)
Definition: S800.h:357
GScintillator::GetID
Int_t GetID()
Definition: S800.h:153
GTimeOfFlight
Definition: S800.h:22
GCrdc::ClassDef
ClassDef(GCrdc, 1)
GCrdc::GCrdc
GCrdc()
Definition: S800.h:222
GMultiHitTOF
Definition: S800.h:276
GCrdc_test::Get_raw
float Get_raw(int n, int q)
Definition: S800.h:321
GMultiHitTOF::Clear
void Clear()
Definition: S800.h:281
GTimeOfFlight::GTimeOfFlight
GTimeOfFlight()
Definition: S800.h:24
GCrdc
Definition: S800.h:220
S800::GetScintillator
GScintillator * GetScintillator(int id)
Definition: S800.h:361
GTrigger::Clear
void Clear()
Definition: S800.h:87
GTrigger::GTrigger
GTrigger()
Definition: S800.h:78
GCrdc_test::GCrdc_test
GCrdc_test()
Definition: S800.h:307
GCrdc::fanode
Float_t fanode
Definition: S800.h:264
GTrigger::GetSecondary
Short_t GetSecondary()
Definition: S800.h:107
GTrigger::Set
void Set(int registr, int s800, int external1, int external2, int secondary)
Definition: S800.h:95
GTrigger
Definition: S800.h:76
GTrigger::GetExternal2
Short_t GetExternal2()
Definition: S800.h:106
GHodoscope::~GHodoscope
~GHodoscope()
Definition: S800.h:174
GTrigger::fexternal1
Short_t fexternal1
Definition: S800.h:112
S800::GetInternalTS
long long int GetInternalTS()
Definition: S800.h:366
S800::fTof
GTimeOfFlight fTof
Definition: S800.h:375
GHodoscope::ClassDef
ClassDef(GHodoscope, 1)
GTimeOfFlight::fsi
Short_t fsi
Definition: S800.h:66
GMultiHitTOF::~GMultiHitTOF
~GMultiHitTOF()
Definition: S800.h:279
GMultiHitTOF::fHodoscope
vector< Float_t > fHodoscope
Definition: S800.h:299
GScintillator::fID
Int_t fID
Definition: S800.h:160
GCrdc::Clear
void Clear()
Definition: S800.h:232
S800::GetEvtNr
long long int GetEvtNr()
Definition: S800.h:367
GIonChamber::ClassDef
ClassDef(GIonChamber, 1)
GTimeOfFlight::SetTAC
void SetTAC(Short_t tac_obj, Short_t tac_xfp)
Definition: S800.h:50
GCrdc_test::Clear
void Clear()
Definition: S800.h:313
GIonChamber::GetChannels
std::vector< int > GetChannels()
Definition: S800.h:207
GCrdc::SetID
void SetID(int id)
Definition: S800.h:241
GTrigger::GetExternal1
Short_t GetExternal1()
Definition: S800.h:105
GTrigger::fsecondary
Short_t fsecondary
Definition: S800.h:114
GIonChamber
Definition: S800.h:188
S800::Clear
void Clear()
Definition: S800.h:341
GTrigger::fs800
Short_t fs800
Definition: S800.h:111
S800::SetTS
void SetTS(long long int ts)
Definition: S800.h:356
GScintillator::fde_down
Float_t fde_down
Definition: S800.h:162
GCrdc::SetAnodeTAC
void SetAnodeTAC(int anode, int tac)
Definition: S800.h:242
GCrdc::fsample
std::vector< Short_t > fsample
Definition: S800.h:268
GTimeOfFlight::GetTACOBJ
Short_t GetTACOBJ()
Definition: S800.h:59
GHodoscope::GHodoscope
GHodoscope()
Definition: S800.h:173
GTimeOfFlight::ftac_xfp
Short_t ftac_xfp
Definition: S800.h:68
GTimeOfFlight::fxfp
Short_t fxfp
Definition: S800.h:65
GTimeOfFlight::~GTimeOfFlight
~GTimeOfFlight()
Definition: S800.h:33
GMultiHitTOF::GMultiHitTOF
GMultiHitTOF()
Definition: S800.h:278
S800::GetHodoscope
GHodoscope * GetHodoscope(int id)
Definition: S800.h:363
GMultiHitTOF::fGalotte
vector< Float_t > fGalotte
Definition: S800.h:297
GTimeOfFlight::GetTACXFP
Short_t GetTACXFP()
Definition: S800.h:60
GMultiHitTOF::ClassDef
ClassDef(GMultiHitTOF, 1)
GMultiHitTOF::fObj
vector< Float_t > fObj
Definition: S800.h:296
GHodoscope::SetEnergy
void SetEnergy(Int_t energy)
Definition: S800.h:176
S800
Definition: S800.h:338
GCrdc::fdata
std::vector< Short_t > fdata
Definition: S800.h:267
GTimeOfFlight::GetXFP
Short_t GetXFP()
Definition: S800.h:57
GScintillator::~GScintillator
~GScintillator()
Definition: S800.h:132
S800::GetIonChamber
GIonChamber * GetIonChamber()
Definition: S800.h:362
GCrdc::GetID
Int_t GetID()
Definition: S800.h:260
GMultiHitTOF::fE1Up
vector< Float_t > fE1Up
Definition: S800.h:293
GIonChamber::GIonChamber
GIonChamber()
Definition: S800.h:190
GHodoscope
Definition: S800.h:171
S800::GetCrdc_test
GCrdc_test * GetCrdc_test()
Definition: S800.h:369
GTrigger::fexternal2
Short_t fexternal2
Definition: S800.h:113
GIonChamber::Clear
void Clear()
Definition: S800.h:196
GTrigger::~GTrigger
~GTrigger()
Definition: S800.h:86
GScintillator::ClassDef
ClassDef(GScintillator, 1)
GIonChamber::fdata
std::vector< float > fdata
Definition: S800.h:212
GTimeOfFlight::GetRF
Short_t GetRF()
Definition: S800.h:55
GTimeOfFlight::frf
Short_t frf
Definition: S800.h:63
S800::S800
S800()
Definition: S800.h:340
GScintillator::GetTime_up
Float_t GetTime_up()
Definition: S800.h:155
GScintillator::Clear
void Clear()
Definition: S800.h:133
GTimeOfFlight::GetSi
Short_t GetSi()
Definition: S800.h:58
GTimeOfFlight::ftac_obj
Short_t ftac_obj
Definition: S800.h:67
S800::fits
long long int fits
Definition: S800.h:386
GCrdc::GetChannels
std::vector< Short_t > GetChannels()
Definition: S800.h:258
GMultiHitTOF::fRf
vector< Float_t > fRf
Definition: S800.h:298
GCrdc_test::fdata
std::vector< float > fdata
Definition: S800.h:325
GTimeOfFlight::GetOBJ
Short_t GetOBJ()
Definition: S800.h:56
GScintillator::GetDE_up
Float_t GetDE_up()
Definition: S800.h:154
S800::fts
long long int fts
Definition: S800.h:385
GCrdc::GetData
std::vector< Short_t > GetData()
Definition: S800.h:256
GScintillator::fde_up
Float_t fde_up
Definition: S800.h:161
GTimeOfFlight::fobj
Short_t fobj
Definition: S800.h:64
GCrdc::fwidth
Short_t fwidth
Definition: S800.h:266
GScintillator::GScintillator
GScintillator()
Definition: S800.h:124
GIonChamber::~GIonChamber
~GIonChamber()
Definition: S800.h:195
GTimeOfFlight::Clear
void Clear()
Definition: S800.h:34
GHodoscope::Clear
void Clear()
Definition: S800.h:175
GTrigger::GetRegistr
Short_t GetRegistr()
Definition: S800.h:103
GCrdc_test::~GCrdc_test
~GCrdc_test()
Definition: S800.h:312
GScintillator::ftime_down
Float_t ftime_down
Definition: S800.h:164
GScintillator::GetTime_down
Float_t GetTime_down()
Definition: S800.h:157
GCrdc_test
Definition: S800.h:305
S800::fCrdc_test
GCrdc_test fCrdc_test
Definition: S800.h:383
GTrigger::ClassDef
ClassDef(GTrigger, 1)
S800::GetTrigger
GTrigger * GetTrigger()
Definition: S800.h:360
GCrdc::SetSampleWidth
void SetSampleWidth(int width)
Definition: S800.h:247
GScintillator::SetID
void SetID(int id)
Definition: S800.h:141
GMultiHitTOF::fE1Down
vector< Float_t > fE1Down
Definition: S800.h:294
S800::fIonChamber
GIonChamber fIonChamber
Definition: S800.h:378
GIonChamber::GetData
std::vector< float > GetData()
Definition: S800.h:208
GCrdc_test::GetData
std::vector< float > GetData()
Definition: S800.h:320
S800::fTrigger
GTrigger fTrigger
Definition: S800.h:376
GIonChamber::Set
void Set(int ch, int data)
Definition: S800.h:201
S800::SetEvtNr
void SetEvtNr(long long int nr)
Definition: S800.h:358
GScintillator::Set
void Set(int de_up, int time_up, int de_down, int time_down)
Definition: S800.h:142
S800::fevtnr
long long int fevtnr
Definition: S800.h:387
GCrdc::fID
Int_t fID
Definition: S800.h:263
GCrdc_test::Set_raw
void Set_raw(int n, int q, float val)
Definition: S800.h:319
GCrdc::ftac
Float_t ftac
Definition: S800.h:265
GIonChamber::fchannels
std::vector< int > fchannels
Definition: S800.h:211
S800::GetTimeOfFlight
GTimeOfFlight * GetTimeOfFlight()
Definition: S800.h:359
GCrdc::GetAnode
Float_t GetAnode()
Definition: S800.h:254
S800::GetMultiHitTOF
GMultiHitTOF * GetMultiHitTOF()
Definition: S800.h:371
S800::fMultiHitTOF
GMultiHitTOF fMultiHitTOF
Definition: S800.h:381
GCrdc::fchannels
std::vector< Short_t > fchannels
Definition: S800.h:269
GHodoscope::fenergy
Float_t fenergy
Definition: S800.h:180
GCrdc_test::ClassDef
ClassDef(GCrdc_test, 1)
GTimeOfFlight::Set
void Set(Short_t rf, Short_t obj, Short_t xfp, Short_t si)
Definition: S800.h:43
GTrigger::GetS800
Short_t GetS800()
Definition: S800.h:104
GScintillator::GetDE_down
Float_t GetDE_down()
Definition: S800.h:156
GCrdc::Set
void Set(Short_t data, Short_t sample, Short_t ch)
Definition: S800.h:248
GCrdc::~GCrdc
~GCrdc()
Definition: S800.h:231
GCrdc::GetTAC
Float_t GetTAC()
Definition: S800.h:255
GCrdc::GetSample
std::vector< Short_t > GetSample()
Definition: S800.h:257