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 | // Rich advanced example for Geant4 |
---|
27 | // RichTbHit.hh for Rich of LHCb |
---|
28 | // History: |
---|
29 | // Created: Sajan Easo (Sajan.Easo@cern.ch) |
---|
30 | // Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch) |
---|
31 | ///////////////////////////////////////////////////////////////////////////// |
---|
32 | #ifndef RichTbHit_h |
---|
33 | #define RichTbHit_h 1 |
---|
34 | #include "G4VHit.hh" |
---|
35 | #include "G4THitsCollection.hh" |
---|
36 | #include "G4Allocator.hh" |
---|
37 | #include "G4ThreeVector.hh" |
---|
38 | #include "G4Transform3D.hh" |
---|
39 | |
---|
40 | class G4VVisManager; |
---|
41 | class RichTbHit : public G4VHit |
---|
42 | { |
---|
43 | public: |
---|
44 | |
---|
45 | RichTbHit(); |
---|
46 | virtual ~RichTbHit(); |
---|
47 | RichTbHit(const RichTbHit &right); |
---|
48 | const RichTbHit& operator=(const RichTbHit &right); |
---|
49 | int operator==(const RichTbHit &right) const; |
---|
50 | |
---|
51 | |
---|
52 | inline void *operator new(size_t); |
---|
53 | inline void operator delete(void *aHit); |
---|
54 | |
---|
55 | void Draw(); |
---|
56 | void DrawWithVisM(G4VVisManager*); |
---|
57 | void Print(); |
---|
58 | |
---|
59 | private: |
---|
60 | G4double edep; |
---|
61 | G4ThreeVector posAtSilicon; |
---|
62 | G4ThreeVector posAtPhotoCathode; |
---|
63 | G4int CurHpdNum; |
---|
64 | G4int CurSectNum; |
---|
65 | G4int CurPixelNum; |
---|
66 | public: |
---|
67 | inline void SetEdep(G4double de) { edep = de; }; |
---|
68 | inline G4double GetEdep() { return edep; }; |
---|
69 | inline void SetPos(G4ThreeVector xyz) { posAtSilicon = xyz; }; |
---|
70 | inline G4ThreeVector GetPos() { return posAtSilicon; }; |
---|
71 | inline void SetPosPC(G4ThreeVector xyzPC) { posAtPhotoCathode = xyzPC; }; |
---|
72 | inline G4ThreeVector GetPosPC() { return posAtPhotoCathode; }; |
---|
73 | inline void SetCurHpdNum (G4int ihp ) { CurHpdNum = ihp; } ; |
---|
74 | inline G4int GetCurHpdNum() { return CurHpdNum ; }; |
---|
75 | inline void SetCurSectNum (G4int isector ) { CurSectNum = isector; } ; |
---|
76 | inline G4int GetCurSectNum() { return CurSectNum ; }; |
---|
77 | inline void SetCurPixNum (G4int ipx ) { CurPixelNum = ipx; }; |
---|
78 | inline G4int GetCurPixNum() { return CurPixelNum; }; |
---|
79 | inline void AddEdep( G4double addenergy ) { edep += addenergy; } |
---|
80 | }; |
---|
81 | |
---|
82 | typedef G4THitsCollection<RichTbHit> RichTbHitsCollection; |
---|
83 | |
---|
84 | extern G4Allocator<RichTbHit> RichTbHitAllocator; |
---|
85 | |
---|
86 | inline void* RichTbHit::operator new(size_t) |
---|
87 | { |
---|
88 | void *aHit; |
---|
89 | aHit = (void *) RichTbHitAllocator.MallocSingle(); |
---|
90 | return aHit; |
---|
91 | } |
---|
92 | |
---|
93 | inline void RichTbHit::operator delete(void *aHit) |
---|
94 | { |
---|
95 | RichTbHitAllocator.FreeSingle((RichTbHit*) aHit); |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | #endif |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|