GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 AddHit(const SBRHit *hit);
194 
195  void AddEMult(Double_t h, Int_t k = 1)
196  {
197  fETot += h;
198  fMultTot += k;
199  }
200 
201  void SetEMult(Double_t h, Int_t k)
202  {
203  fETot = h;
204  fMultTot = k;
205  }
206 
207  Double_t GetETot() const
208  {
209  return fETot;
210  }
211  Int_t GetMultTot() const
212  {
213  return fMultTot;
214  }
215 
217  virtual void Clear(Option_t *opt);
218 
219  ClassDef( SBREvent , 1 ) // SToGS Basic ROOT Event
220 };
221 
224 class SBRPEvent : public TObject
225 {
226 private:
227  TClonesArray *fHits; //-> Collection of hits
228 
229  Double32_t fETot; // sum energy
230  Int_t fMultTot; // fold
231 
232 public:
233  SBRPEvent();
234  virtual ~SBRPEvent();
235 
237  // void CopyTo(std::vector <SBRPHit *> &ordlist, Option_t *opt = "");
238 
240  Int_t GetNbHits() const
241  {
242  return fHits->GetEntries();
243  }
244 
246  SBRPHit *IsUID(Int_t uid, Int_t *which = 0x0)
247  {
248  TClonesArray &ar = *fHits;
249 
250  SBRPHit *ishit = 0x0; Int_t entries = fHits->GetEntries();
251  for (Int_t j = 0; j < entries; j++) {
252  SBRPHit *hit = (SBRPHit *)ar[j];
253  if ( hit->fUID == uid ) {
254  ishit = hit;
255  if ( which )
256  (*which) = j;
257  break;
258  }
259  }
260  return ishit;
261  }
262 
264  SBRPHit *GetHit(Int_t);
266  SBRPHit *AddHit();
267 
268  void AddEMult(Double_t h, Int_t k = 1)
269  {
270  fETot += h;
271  fMultTot += k;
272  }
273 
274  void SetEMult(Double_t h, Int_t k)
275  {
276  fETot = h;
277  fMultTot = k;
278  }
279 
280  Double_t GetETot() const
281  {
282  return fETot;
283  }
284  Int_t GetMultTot() const
285  {
286  return fMultTot;
287  }
288 
290  virtual void Clear(Option_t *opt);
291 
292  ClassDef( SBRPEvent , 1 ) // SToGS Basic Polarised ROOT Event
293 };
294 
295 
298 class SBROpticalHit : public TObject
299 {
300 public:
301  Double32_t fX; // X position of the last point of the track
302  Double32_t fY; // Y position of the last point of the track
303  Double32_t fZ; // Z position of the last point of the track
304  Double32_t fTA; // arrival time for the last point of the track since event
305  Double32_t fTL; // arrival time for the last point of the track since creation of the photon
306 
307  Double32_t fLength; // length of the trace
308 
309  Int_t fPrimaryID; // Primary ID, in case more that one primary particle is giving scintillation
310  Int_t fSecondaryID; // detector ID where the optical photon is
311  Int_t fNbSteps; // number of steps between start and stop
312 
313 private:
314  void Clear(Option_t *opt);
315 
316 public:
317  SBROpticalHit();
318  SBROpticalHit(const SBROpticalHit &);
319  virtual ~SBROpticalHit();
320 
321  ClassDef( SBROpticalHit , 1 ) // SToGS Optical Hit
322 };
323 
326 class SBROpticalEvent : public TObject
327 {
328 private:
329  TClonesArray *fHits; //-> Collection of optical hits
330 
331 public:
332  SBROpticalEvent();
333  virtual ~SBROpticalEvent();
334 
335  // number of hits in that event
336  Int_t GetNbHits() const
337  {
338  return fHits->GetEntries();
339  }
340 
342  SBROpticalHit *GetHit(Int_t);
345 
346  void Clear(Option_t *opt);
347 
348  ClassDef( SBROpticalEvent , 1 ) // SToGS Optical Event
349 };
350 
351 #endif
352 
SBROpticalHit * GetHit(Int_t)
to get a Hit
void AddEMult(Double_t h, Int_t k=1)
Int_t GetNbHits() const
helper function
SToGS Base Root Polarized Hit.
virtual ~SBRPEvent()
virtual void Clear(Option_t *)
void Clear(Option_t *opt)
Double32_t fZ
SBROpticalHit * AddHit()
add a hit to the current event
Double32_t fE
Double32_t fPZ
SBRPHit * AddHit()
add a hit to the current event
virtual ~SBRHit()
Double32_t fX
Double32_t fPX
Double32_t fT
SBRHit * AddHit()
add a hit to the current event
Int_t GetMultTot() const
Double_t GetETot() const
SBRPHit * IsUID(Int_t uid, Int_t *which=0x0)
Check in the list of hits the one having.
SBRPHit * GetHit(Int_t)
to get a Hit
Double32_t fPY
void AddEMult(Double_t h, Int_t k=1)
SBRHit * GetHit(Int_t)
to get a Hit
virtual void Clear(Option_t *opt)
clear the collection of hits, set H, K to 0
virtual void Clear(Option_t *opt)
clear the collection of hits, set H, K to 0
Int_t GetNbHits() const
Double_t GetETot() const
Int_t GetNbHits() const
helper function
virtual ~SBRPHit()
void Clear(Option_t *opt)
virtual ~SBREvent()
SBRHit * IsUID(Int_t uid, Int_t *which=0x0)
Check in the list of hits the one having.
Int_t GetMultTot() const
void SetEMult(Double_t h, Int_t k)
Double32_t fY
void SetEMult(Double_t h, Int_t k)