source: trunk/source/digits_hits/utils/test/test2/include/Test2PhantomHit.hh

Last change on this file was 1350, checked in by garnier, 15 years ago

update to last version 4.9.4

File size: 4.8 KB
Line 
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 Test2PhantomHit_h
28#define Test2PhantomHit_h 1
29
30#include "globals.hh"
31#include "G4VHit.hh"
32#include "G4THitsCollection.hh"
33#include "G4Allocator.hh"
34#include "G4ParticleDefinition.hh"
35
36
37class Test2PhantomHit : public G4VHit {
38public:
39 Test2PhantomHit();
40 Test2PhantomHit(G4int & x, G4int & y, G4int & z,G4int segment[3]);
41 ~Test2PhantomHit();
42 Test2PhantomHit(const Test2PhantomHit & right);
43 const Test2PhantomHit & operator=(const Test2PhantomHit & right);
44 G4int operator==(const Test2PhantomHit & right) const;
45
46 inline void * operator new(size_t);
47 inline void operator delete(void * aHit);
48
49 void Print();
50
51private:
52 G4int fXCellID, fYCellID, fZCellID;
53 G4int fSegment[3];
54 G4double fEdep;
55 G4double fDose;
56 G4double fTrackLength;
57 G4String fParticleName;
58
59 G4double flatSurfCurr;
60 G4double passageCellCurr;
61 G4double flatSurfaceFlux;
62 G4double cellFlux;
63 G4double passageCellFlux;
64 G4double noOfSecondary;
65 G4double cellCharge;
66
67public:
68 inline void SetCellID(G4int x, G4int y, G4int z) {
69 fXCellID = x;
70 fYCellID = y;
71 fZCellID = z;
72 }
73 inline G4int GetX() { return fXCellID; }
74 inline G4int GetY() { return fYCellID; }
75 inline G4int GetZ() { return fZCellID; }
76 inline G4int GetID();
77 inline void SetEdep(G4double de) { fEdep = de; }
78 inline void AddEdep(G4double de) { fEdep += de; }
79 inline G4double GetEdep() { return fEdep; }
80 inline void SetDose(G4double dose) { fDose = dose; }
81 inline void AddDose(G4double dose) { fDose += dose; }
82 inline G4double GetDose() { return fDose; }
83 inline void SetTrackLength(G4double tl) { fTrackLength = tl; }
84 inline void AddTrackLength(G4double tl) { fTrackLength += tl; }
85 inline G4double GetTrackLength() { return fTrackLength; }
86 inline void SetParticleName(G4String pn) { fParticleName = pn; }
87 inline G4String GetParticleName() { return fParticleName; }
88
89 inline void SetFlatSurfaceCurrent(G4double v){ flatSurfCurr=v; }
90 inline void SetPassageCellCurrent(G4double v){ passageCellCurr=v;}
91 inline void SetFlatSurfaceFlux(G4double v){ flatSurfaceFlux=v; }
92 inline void SetCellFlux(G4double v) { cellFlux=v; }
93 inline void SetPassageCellFlux(G4double v){ passageCellFlux=v; }
94 inline void SetNofSecondary(G4double v){ noOfSecondary=v; }
95 inline void SetCellCharge(G4double v){ cellCharge=v; }
96
97 inline G4double GetFlatSurfaceCurrent(){ return flatSurfCurr; }
98 inline G4double GetPassageCellCurrent(){ return passageCellCurr;}
99 inline G4double GetFlatSurfaceFlux(){ return flatSurfaceFlux; }
100 inline G4double GetCellFlux() { return cellFlux; }
101 inline G4double GetPassageCellFlux(){ return passageCellFlux; }
102 inline G4double GetNofSecondary(){ return noOfSecondary; }
103 inline G4double GetCellCharge(){ return cellCharge; }
104};
105
106typedef G4THitsCollection<Test2PhantomHit> Test2PhantomHitsCollection;
107
108extern G4Allocator<Test2PhantomHit> Test2PhantomHitAllocator;
109
110inline void* Test2PhantomHit::operator new(size_t) {
111 void *aHit;
112 aHit = (void *) Test2PhantomHitAllocator.MallocSingle();
113 return aHit;
114}
115
116inline void Test2PhantomHit::operator delete(void *aHit) {
117 Test2PhantomHitAllocator.FreeSingle((Test2PhantomHit*) aHit);
118}
119
120inline G4int Test2PhantomHit::GetID(){
121 return fXCellID*fSegment[1]*fSegment[2]+fYCellID*fSegment[2]+fZCellID;
122}
123#endif
124
125
Note: See TracBrowser for help on using the repository browser.