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 | // $Id: G4PVReplica.hh,v 1.5 2006/06/29 18:57:36 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // class G4PVReplica |
---|
32 | // |
---|
33 | // Class description: |
---|
34 | // |
---|
35 | // Represents many touchable detector elements differing only in their |
---|
36 | // positioning. The elements' positions are calculated by means of a simple |
---|
37 | // linear formula, and the elements completely fill the containing mother |
---|
38 | // volume. |
---|
39 | // |
---|
40 | // G4PVReplica(const G4String& pName, |
---|
41 | // G4LogicalVolume *pLogical, |
---|
42 | // G4LogicalVolume *pMother, |
---|
43 | // const EAxis pAxis, |
---|
44 | // const G4int nReplicas, |
---|
45 | // const G4double width, |
---|
46 | // const G4double offset=0); |
---|
47 | // |
---|
48 | // Replication may occur along: |
---|
49 | // |
---|
50 | // o Cartesian axes (kXAxis,kYAxis,kZAxis) |
---|
51 | // |
---|
52 | // The replications, of specified width have coordinates of |
---|
53 | // form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 |
---|
54 | // for the case of kXAxis, and are unrotated. |
---|
55 | // |
---|
56 | // o Radial axis (cylindrical polar) (kRho) |
---|
57 | // |
---|
58 | // The replications are cons/tubs sections, centred on the origin |
---|
59 | // and are unrotated. |
---|
60 | // They have radii of width*n+offset to width*(n+1)+offset |
---|
61 | // where n=0..nReplicas-1 |
---|
62 | // |
---|
63 | // o Phi axis (cylindrical polar) (kPhi) |
---|
64 | // The replications are `phi sections' or wedges, and of cons/tubs form |
---|
65 | // They have phi of offset+n*width to offset+(n+1)*width where |
---|
66 | // n=0..nReplicas-1 |
---|
67 | |
---|
68 | // History: |
---|
69 | // 29.07.95 P.Kent First non-stub version |
---|
70 | // 26.10.97 J.Apostolakis Added constructor that takes mother logical volume |
---|
71 | // 16.02.98 J.Apostolakis Added copy number |
---|
72 | // ---------------------------------------------------------------------- |
---|
73 | #ifndef G4PVREPLICA_HH |
---|
74 | #define G4PVREPLICA_HH |
---|
75 | |
---|
76 | #include "G4VPhysicalVolume.hh" |
---|
77 | |
---|
78 | class G4PVReplica : public G4VPhysicalVolume |
---|
79 | { |
---|
80 | public: // with description |
---|
81 | |
---|
82 | G4PVReplica(const G4String& pName, |
---|
83 | G4LogicalVolume* pLogical, |
---|
84 | G4LogicalVolume* pMother, |
---|
85 | const EAxis pAxis, |
---|
86 | const G4int nReplicas, |
---|
87 | const G4double width, |
---|
88 | const G4double offset=0); |
---|
89 | |
---|
90 | public: // without description |
---|
91 | |
---|
92 | G4PVReplica(const G4String& pName, |
---|
93 | G4LogicalVolume* pLogical, |
---|
94 | G4VPhysicalVolume* pMother, |
---|
95 | const EAxis pAxis, |
---|
96 | const G4int nReplicas, |
---|
97 | const G4double width, |
---|
98 | const G4double offset=0); |
---|
99 | |
---|
100 | G4PVReplica(__void__&); |
---|
101 | // Fake default constructor for usage restricted to direct object |
---|
102 | // persistency for clients requiring preallocation of memory for |
---|
103 | // persistifiable objects. |
---|
104 | |
---|
105 | public: // with description |
---|
106 | |
---|
107 | virtual ~G4PVReplica(); |
---|
108 | |
---|
109 | G4bool IsMany() const; |
---|
110 | G4bool IsReplicated() const; |
---|
111 | |
---|
112 | virtual G4int GetCopyNo() const; |
---|
113 | virtual void SetCopyNo(G4int CopyNo); |
---|
114 | virtual G4bool IsParameterised() const; |
---|
115 | virtual G4VPVParameterisation* GetParameterisation() const; |
---|
116 | virtual G4int GetMultiplicity() const; |
---|
117 | virtual void GetReplicationData(EAxis& axis, |
---|
118 | G4int& nReplicas, |
---|
119 | G4double& width, |
---|
120 | G4double& offset, |
---|
121 | G4bool& consuming) const; |
---|
122 | |
---|
123 | // Methods for specialised geometries |
---|
124 | G4bool IsRegularStructure() const; |
---|
125 | G4int GetRegularStructureId() const; |
---|
126 | // return values |
---|
127 | virtual void SetRegularStructureId( G4int Code ); |
---|
128 | // This method must set a unique code for each type |
---|
129 | // of regular structure. |
---|
130 | // - It must be called only during detector construction. |
---|
131 | // - It can also be used to prepare a/any corresponding |
---|
132 | // special navigation 'conditions'. |
---|
133 | private: |
---|
134 | |
---|
135 | void CheckAndSetParameters( |
---|
136 | const EAxis pAxis, |
---|
137 | const G4int nReplicas, |
---|
138 | const G4double width, |
---|
139 | const G4double offset); |
---|
140 | |
---|
141 | G4PVReplica(const G4PVReplica&); |
---|
142 | const G4PVReplica& operator=(const G4PVReplica&); |
---|
143 | |
---|
144 | private: |
---|
145 | G4int fRegularStructureCode; |
---|
146 | |
---|
147 | protected: |
---|
148 | |
---|
149 | EAxis faxis; |
---|
150 | G4int fnReplicas; |
---|
151 | G4double fwidth,foffset; |
---|
152 | |
---|
153 | G4int fcopyNo; |
---|
154 | |
---|
155 | private: |
---|
156 | G4int fRegularVolsId; |
---|
157 | |
---|
158 | }; |
---|
159 | |
---|
160 | #endif |
---|