Geant4  10.01.p03
HadrontherapyDetectorHit.hh
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 // This is the *BASIC* version of Hadrontherapy, a Geant4-based application
27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
28 //
29 // Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request
30 // the *COMPLETE* version of this program, together with its documentation;
31 // Hadrontherapy (both basic and full version) are supported by the Italian INFN
32 // Institute in the framework of the MC-INFN Group
33 //
34 
35 #ifndef HadrontherapyDetectorHit_h
36 #define HadrontherapyDetectorHit_h 1
37 
38 
39 #include "G4VHit.hh"
40 #include "G4THitsCollection.hh"
41 #include "G4Allocator.hh"
42 
43 
45 {
46 public:
49  virtual ~HadrontherapyDetectorHit();
50 
51 
53 
55 
56 //******************************MT
57 inline void* operator new(size_t);
58 inline void operator delete(void*);
59 //******************************MT
60 
61 private:
62  G4int xHitID; // Hit x voxel
63  G4int zHitID; // Hit z voxel
64  G4int yHitID; // Hit y voxel
65  G4double energyDeposit; // Energy deposit associated with the hit
66 
67 public:
68  // Methods to get the information - energy deposit and associated
69  // position in the phantom - of the hits stored in the hits collection
70 
71  inline G4int GetXID() // Get x index of the voxel
72  {return xHitID;}
73 
74  inline G4int GetZID() // Get y index of the voxel
75  {return zHitID;}
76 
77  inline G4int GetYID() // Get z index of the voxel
78  {return yHitID;}
79 
80  inline G4double GetEdep() // Get energy deposit
81  {return energyDeposit;}
82 
83  // Methods to store the information of the hit ( energy deposit, position in the phantom )
84  // in the hits collection
85 
86  inline void SetEdepAndPosition(G4int xx, G4int yy, G4int zz, G4double eDep)
87  {
88  xHitID = xx;
89  yHitID = yy;
90  zHitID = zz;
91  energyDeposit = eDep;
92  }
93 };
94 
96 //******************************MT
98 //******************************MT
99 
100 inline void* HadrontherapyDetectorHit::operator new(size_t)
101 {
102 
103 
106  void *aHit;
107 
108  aHit = (void *) HadrontherapyDetectorHitAllocator->MallocSingle();
109  return aHit;
110 
111 }
112 
113 inline void HadrontherapyDetectorHit::operator delete(void *aHit)
114 {
117 
119 }
120 
121 #endif
void SetEdepAndPosition(G4int xx, G4int yy, G4int zz, G4double eDep)
Definition: G4VHit.hh:48
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
G4THitsCollection< HadrontherapyDetectorHit > HadrontherapyDetectorHitsCollection
G4ThreadLocal G4Allocator< HadrontherapyDetectorHit > * HadrontherapyDetectorHitAllocator
double G4double
Definition: G4Types.hh:76
G4int operator==(const HadrontherapyDetectorHit &) const
const HadrontherapyDetectorHit & operator=(const HadrontherapyDetectorHit &)