source: trunk/examples/extended/parameterisations/gflash/include/ExGflashHit.hh@ 812

Last change on this file since 812 was 807, checked in by garnier, 17 years ago

update

File size: 3.7 KB
RevLine 
[807]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#ifndef ExGflashHit_h
27#define ExGflashHit_h 1
28
29#include "G4VHit.hh"
30#include "G4THitsCollection.hh"
31#include "G4Allocator.hh"
32#include "G4ThreeVector.hh"
33#include "G4LogicalVolume.hh"
34#include "G4Transform3D.hh"
35#include "G4RotationMatrix.hh"
36
37class ExGflashHit : public G4VHit
38{
39 public:
40
41 ExGflashHit();
42 ExGflashHit(G4LogicalVolume* logVol);
43 ~ExGflashHit();
44 ExGflashHit(const ExGflashHit &right);
45 const ExGflashHit& operator=(const ExGflashHit &right);
46 int operator==(const ExGflashHit &right) const;
47
48
49 inline void *operator new(size_t);
50 inline void operator delete(void *aHit);
51 void *operator new(size_t,void*p){return p;}
52#ifndef G4NOT_ISO_DELETES
53 void operator delete(void *aHit,void*){}
54#endif
55
56 void Draw();
57 void Print();
58
59 private:
60 G4double edep;
61 G4ThreeVector pos;
62 G4int crystalnumber;
63 G4ThreeVector start;
64 G4RotationMatrix rot;
65 const G4LogicalVolume* pLogV;
66
67 public:
68 inline void SetEdep(G4double de)
69 { edep = de; };
70 inline void AddEdep(G4double de)
71 { edep += de; };
72 inline G4double GetEdep()
73 { return edep; };
74 inline void SetPos(G4ThreeVector xyz)
75 { pos = xyz; };
76 inline G4int GetCrystalNum()
77 { return crystalnumber; };
78 inline void SetCrystalNum(G4int num)
79 { crystalnumber=num; };
80 inline G4ThreeVector GetPos()
81 { return pos; };
82 inline void SetStart(G4ThreeVector xyz)
83 { start = xyz; };
84 inline G4ThreeVector GetStart()
85 { return start; };
86
87 inline void SetRot(G4RotationMatrix rmat)
88 { rot = rmat; };
89 inline G4RotationMatrix GetRot()
90 { return rot; };
91 inline const G4LogicalVolume * GetLogV()
92 { return pLogV; };
93
94};
95
96typedef G4THitsCollection<ExGflashHit> ExGflashHitsCollection;
97
98extern G4Allocator<ExGflashHit> ExGflashHitAllocator;
99
100inline void* ExGflashHit::operator new(size_t)
101{
102 void *aHit;
103 aHit = (void *) ExGflashHitAllocator.MallocSingle();
104 return aHit;
105}
106
107inline void ExGflashHit::operator delete(void *aHit)
108{
109 ExGflashHitAllocator.FreeSingle((ExGflashHit*) aHit);
110}
111
112#endif
113
114
115
116
117
Note: See TracBrowser for help on using the repository browser.