SToGS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SToGS_BaseROOTEvents.h
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
27 #ifndef SToGS_BaseROOTEvents_h
28 #define SToGS_BaseROOTEvents_h 1
29 
30 #include "TObject.h"
31 #include "TClonesArray.h"
32 
33 #include <list>
34 
77 class SBRHit : public TObject
78 {
79 public:
80  Double32_t fE; // energy
81  //
82  Int_t fPDG; // PDG of the particle giving this Hit
83  //
84  Double32_t fX; // X position
85  Double32_t fY; // Y position
86  Double32_t fZ; // Z position
87  Double32_t fT; // time of flight
88  //
89  Int_t fFlag; // a flag
90  Int_t fUID; // a universal ID
91 
92 public:
93  virtual void Clear(Option_t * /*opt*/)
94  {
95  fE = 0;
96  fPDG = -1;
97  fX = 0.0;
98  fY = 0.0;
99  fZ = 0.0;
100  fT = 0.0;
101  fFlag = 0;
102  fUID = -1;
103  }
104 
105 public:
106  SBRHit();
107  SBRHit(const SBRHit &);
108  virtual ~SBRHit();
109 
110  ClassDef( SBRHit , 1 ) // SToGS Basic ROOT Hit
111 };
112 
114 
116 class SBRPHit : public SBRHit
117 {
118 public:
119  //
120  Double32_t fPX; // X Direction
121  Double32_t fPY; // Y Direction
122  Double32_t fPZ; // Z Direction
123 
124 public:
125  void Clear(Option_t *opt)
126  {
127  SBRHit::Clear(opt);
128  fPX = 0.0;
129  fPY = 0.0;
130  fPZ = 0.0;
131  }
132 
133 public:
134  SBRPHit(): SBRHit(), fPX(0.0), fPY(0.0), fPZ(0.0)
135  {
136  ;
137  }
138  SBRPHit(const SBRPHit &);
139  virtual ~SBRPHit()
140  {
141  ;
142  }
143 
144  ClassDef( SBRPHit , 1 ) // SToGS Basic Polarized ROOT Hit
145 };
146 
149 class SBREvent : public TObject
150 {
151 private:
152  TClonesArray *fHits; //-> Collection of hits
153 
154  Double32_t fETot; // sum energy
155  Int_t fMultTot; // fold
156 
157 public:
158  SBREvent();
159  virtual ~SBREvent();
160 
162  // void CopyTo(std::vector <SBRHit *> &ordlist, Option_t *opt = "");
163 
165  Int_t GetNbHits() const
166  {
167  return fHits->GetEntries();
168  }
169 
171  SBRHit *IsUID(Int_t uid, Int_t *which = 0x0)
172  {
173  TClonesArray &ar = *fHits;
174 
175  SBRHit *ishit = 0x0; Int_t entries = fHits->GetEntries();
176  for (Int_t j = 0; j < entries; j++) {
177  SBRHit *hit = (SBRHit *)ar[j];
178  if ( hit->fUID == uid ) {
179  ishit = hit;
180  if ( which )
181  (*which) = j;
182  break;
183  }
184  }
185  return ishit;
186  }
187 
189  SBRHit *GetHit(Int_t);
191  SBRHit *AddHit();
192 
193  void AddEMult(Double_t h, Int_t k = 1)
194  {
195  fETot += h;
196  fMultTot += k;
197  }
198 
199  void SetEMult(Double_t h, Int_t k)
200  {
201  fETot = h;
202  fMultTot = k;
203  }
204 
205  Double_t GetETot() const
206  {
207  return fETot;
208  }
209  Int_t GetMultTot() const
210  {
211  return fMultTot;
212  }
213 
215  virtual void Clear(Option_t *opt);
216 
217  ClassDef( SBREvent , 1 ) // SToGS Basic ROOT Event
218 };
219 
222 class SBRPEvent : public TObject
223 {
224 private:
225  TClonesArray *fHits; //-> Collection of hits
226 
227  Double32_t fETot; // sum energy
228  Int_t fMultTot; // fold
229 
230 public:
231  SBRPEvent();
232  virtual ~SBRPEvent();
233 
235  // void CopyTo(std::vector <SBRPHit *> &ordlist, Option_t *opt = "");
236 
238  Int_t GetNbHits() const
239  {
240  return fHits->GetEntries();
241  }
242 
244  SBRPHit *IsUID(Int_t uid, Int_t *which = 0x0)
245  {
246  TClonesArray &ar = *fHits;
247 
248  SBRPHit *ishit = 0x0; Int_t entries = fHits->GetEntries();
249  for (Int_t j = 0; j < entries; j++) {
250  SBRPHit *hit = (SBRPHit *)ar[j];
251  if ( hit->fUID == uid ) {
252  ishit = hit;
253  if ( which )
254  (*which) = j;
255  break;
256  }
257  }
258  return ishit;
259  }
260 
262  SBRPHit *GetHit(Int_t);
264  SBRPHit *AddHit();
265 
266  void AddEMult(Double_t h, Int_t k = 1)
267  {
268  fETot += h;
269  fMultTot += k;
270  }
271 
272  void SetEMult(Double_t h, Int_t k)
273  {
274  fETot = h;
275  fMultTot = k;
276  }
277 
278  Double_t GetETot() const
279  {
280  return fETot;
281  }
282  Int_t GetMultTot() const
283  {
284  return fMultTot;
285  }
286 
288  virtual void Clear(Option_t *opt);
289 
290  ClassDef( SBRPEvent , 1 ) // SToGS Basic Polarised ROOT Event
291 };
292 
293 
296 class SBROpticalHit : public TObject
297 {
298 public:
299  Double32_t fX; // X position of the last point of the track
300  Double32_t fY; // Y position of the last point of the track
301  Double32_t fZ; // Z position of the last point of the track
302  Double32_t fTA; // arrival time for the last point of the track since event
303  Double32_t fTL; // arrival time for the last point of the track since creation of the photon
304 
305  Double32_t fLength; // length of the trace
306 
307  Int_t fPrimaryID; // Primary ID, in case more that one primary particle is giving scintillation
308  Int_t fSecondaryID; // detector ID where the optical photon is
309  Int_t fNbSteps; // number of steps between start and stop
310 
311 private:
312  void Clear(Option_t *opt);
313 
314 public:
315  SBROpticalHit();
316  SBROpticalHit(const SBROpticalHit &);
317  virtual ~SBROpticalHit();
318 
319  ClassDef( SBROpticalHit , 1 ) // SToGS Optical Hit
320 };
321 
324 class SBROpticalEvent : public TObject
325 {
326 private:
327  TClonesArray *fHits; //-> Collection of optical hits
328 
329 public:
330  SBROpticalEvent();
331  virtual ~SBROpticalEvent();
332 
333  // number of hits in that event
334  Int_t GetNbHits() const
335  {
336  return fHits->GetEntries();
337  }
338 
340  SBROpticalHit *GetHit(Int_t);
343 
344  void Clear(Option_t *opt);
345 
346  ClassDef( SBROpticalEvent , 1 ) // SToGS Optical Event
347 };
348 
349 #endif
350 
virtual void Clear(Option_t *opt)
clear the collection of hits, set H, K to 0
void AddEMult(Double_t h, Int_t k=1)
SBROpticalHit * AddHit()
add a hit to the current event
SToGS Base Root Polarized Hit.
SBRHit * GetHit(Int_t)
to get a Hit
virtual ~SBRPHit()
Double32_t fPY
virtual void Clear(Option_t *)
SBRHit * IsUID(Int_t uid, Int_t *which=0x0)
Check in the list of hits the one having.
Int_t GetNbHits() const
helper function
void SetEMult(Double_t h, Int_t k)
SBRPHit * AddHit()
add a hit to the current event
Double32_t fPZ
SBRPHit * IsUID(Int_t uid, Int_t *which=0x0)
Check in the list of hits the one having.
void SetEMult(Double_t h, Int_t k)
Int_t GetNbHits() const
Double32_t fX
Double32_t fT
Int_t GetMultTot() const
virtual ~SBRPEvent()
Double_t GetETot() const
SBRHit * AddHit()
add a hit to the current event
virtual void Clear(Option_t *opt)
clear the collection of hits, set H, K to 0
virtual ~SBREvent()
Double32_t fZ
Int_t GetNbHits() const
helper function
void Clear(Option_t *opt)
Int_t GetMultTot() const
SBROpticalHit * GetHit(Int_t)
to get a Hit
Double32_t fY
Double32_t fPX
SBRPHit * GetHit(Int_t)
to get a Hit
void Clear(Option_t *opt)
Double_t GetETot() const
void AddEMult(Double_t h, Int_t k=1)
virtual ~SBRHit()
Double32_t fE