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.cc 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 | #include "RichTbHit.hh" |
---|
33 | #include "G4VVisManager.hh" |
---|
34 | #include "G4Circle.hh" |
---|
35 | #include "G4Colour.hh" |
---|
36 | #include "G4VisAttributes.hh" |
---|
37 | #include "G4Transform3D.hh" |
---|
38 | #include "G4LogicalVolume.hh" |
---|
39 | #include "G4Transform3D.hh" |
---|
40 | |
---|
41 | G4Allocator<RichTbHit> RichTbHitAllocator; |
---|
42 | |
---|
43 | RichTbHit::RichTbHit() |
---|
44 | {;} |
---|
45 | |
---|
46 | RichTbHit::~RichTbHit() |
---|
47 | {;} |
---|
48 | |
---|
49 | RichTbHit::RichTbHit(const RichTbHit &right) |
---|
50 | : G4VHit(right) |
---|
51 | { |
---|
52 | edep = right.edep; |
---|
53 | posAtSilicon = right.posAtSilicon; |
---|
54 | posAtPhotoCathode=right.posAtPhotoCathode; |
---|
55 | CurHpdNum=right.CurHpdNum; |
---|
56 | CurSectNum=right.CurSectNum; |
---|
57 | CurPixelNum=right.CurPixelNum; |
---|
58 | } |
---|
59 | |
---|
60 | const RichTbHit& RichTbHit::operator=(const RichTbHit &right) |
---|
61 | { |
---|
62 | edep = right.edep; |
---|
63 | posAtSilicon = right.posAtSilicon; |
---|
64 | posAtPhotoCathode=right.posAtPhotoCathode; |
---|
65 | CurHpdNum=right.CurHpdNum; |
---|
66 | CurSectNum=right.CurSectNum; |
---|
67 | CurPixelNum=right.CurPixelNum; |
---|
68 | |
---|
69 | return *this; |
---|
70 | } |
---|
71 | |
---|
72 | int RichTbHit::operator==(const RichTbHit &right) const |
---|
73 | { |
---|
74 | return (this==&right) ? 1 : 0; |
---|
75 | } |
---|
76 | |
---|
77 | void RichTbHit::Draw() |
---|
78 | { |
---|
79 | |
---|
80 | // The folowing does not work anymore .. SE 26-04-01 |
---|
81 | // Do not understand ................... John Allison 3/5/05 |
---|
82 | G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); |
---|
83 | if(pVVisManager) |
---|
84 | { |
---|
85 | |
---|
86 | G4Transform3D dummy; |
---|
87 | |
---|
88 | G4Circle circle(posAtPhotoCathode); |
---|
89 | circle.SetScreenSize(0.04); |
---|
90 | circle.SetFillStyle(G4Circle::filled); |
---|
91 | G4Colour colour(1.0,0.0,0.0); |
---|
92 | G4VisAttributes attribs(colour); |
---|
93 | circle.SetVisAttributes(attribs); |
---|
94 | pVVisManager->Draw(circle,dummy); |
---|
95 | } |
---|
96 | } |
---|
97 | void RichTbHit::DrawWithVisM(G4VVisManager* pVisManager) |
---|
98 | { |
---|
99 | |
---|
100 | G4VVisManager* pVVisManager = pVisManager; |
---|
101 | if(pVVisManager) |
---|
102 | { |
---|
103 | G4Transform3D dummy2; |
---|
104 | G4Circle circle(posAtPhotoCathode); |
---|
105 | circle.SetScreenSize(0.04); |
---|
106 | circle.SetFillStyle(G4Circle::filled); |
---|
107 | G4Colour colour(1.0,0.0,0.0); |
---|
108 | G4VisAttributes attribs(colour); |
---|
109 | circle.SetVisAttributes(attribs); |
---|
110 | pVVisManager->Draw(circle,dummy2); |
---|
111 | } |
---|
112 | } |
---|
113 | void RichTbHit::Print() |
---|
114 | {;} |
---|
115 | |
---|
116 | |
---|
117 | // This is a forward declarations of an instantiated G4Allocator<Type> object. |
---|
118 | // It has been added in order to make code portable for the GNU g++ |
---|
119 | // (release 2.7.2) compiler. |
---|
120 | // Whenever a new Type is instantiated via G4Allocator, it has to be forward |
---|
121 | // declared to make object code (compiled with GNU g++) link successfully. |
---|
122 | // |
---|
123 | #ifdef GNU_GCC |
---|
124 | template class G4Allocator<RichTbHit>; |
---|
125 | #endif |
---|
126 | |
---|
127 | |
---|