Geant4  10.01.p03
G4ReplicatedSlice.hh
Go to the documentation of this file.
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: G4ReplicatedSlice.hh 66356 2012-12-18 09:02:32Z gcosmo $
28 //
29 // class G4ReplicatedSlice
30 //
31 // Class description:
32 //
33 // G4ReplicatedSlice represents many touchable detector elements differing
34 // only in their positioning. The elements' positions are calculated by means
35 // of a simple linear formula.
36 //
37 // Division may occur along:
38 //
39 // o Cartesian axes (kXAxis,kYAxis,kZAxis)
40 //
41 // The divisions, of specified width have coordinates of
42 // form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1
43 // for the case of kXAxis, and are unrotated.
44 //
45 // o Radial axis (cylindrical polar) (kRho)
46 //
47 // The divisions are cons/tubs sections, centred on the origin
48 // and are unrotated.
49 // They have radii of width*n+offset to width*(n+1)+offset
50 // where n=0..nReplicas-1
51 //
52 // o Phi axis (cylindrical polar) (kPhi)
53 // The divisions are `phi sections' or wedges, and of cons/tubs form
54 // They have phi of offset+n*width to offset+(n+1)*width where
55 // n=0..nReplicas-1
56 
57 // History:
58 // -------
59 // Apr/20/2010 - Initial version extended from G4PVDivision
60 // ----------------------------------------------------------------------
61 #ifndef G4ReplicatedSlice_HH
62 #define G4ReplicatedSlice_HH 1
63 
64 #include "geomdefs.hh"
65 #include "G4VPhysicalVolume.hh"
67 
68 class G4LogicalVolume;
69 class G4VSolid;
70 
72 {
73  public: // with description
74 
75  G4ReplicatedSlice(const G4String& pName,
76  G4LogicalVolume* pLogical,
77  G4LogicalVolume* pMotherLogical,
78  const EAxis pAxis,
79  const G4int nReplicas,
80  const G4double width,
81  const G4double half_gap,
82  const G4double offset );
83  // Constructor with number of divisions and width
84 
85  G4ReplicatedSlice(const G4String& pName,
86  G4LogicalVolume* pLogical,
87  G4LogicalVolume* pMotherLogical,
88  const EAxis pAxis,
89  const G4int nReplicas,
90  const G4double half_gap,
91  const G4double offset );
92  // Constructor with number of divisions
93 
94  G4ReplicatedSlice(const G4String& pName,
95  G4LogicalVolume* pLogical,
96  G4LogicalVolume* pMotherLogical,
97  const EAxis pAxis,
98  const G4double width,
99  const G4double half_gap,
100  const G4double offset );
101  // Constructor with width
102 
103  public: // without description
104 
105  G4ReplicatedSlice(const G4String& pName,
106  G4LogicalVolume* pLogical,
107  G4VPhysicalVolume* pMotherPhysical,
108  const EAxis pAxis,
109  const G4int nReplicas,
110  const G4double width,
111  const G4double half_gap,
112  const G4double offset);
113  // Constructor in mother physical volume
114 
115  G4ReplicatedSlice(const G4String& pName,
116  G4LogicalVolume* pLogical,
117  G4VPhysicalVolume* pMotherPhysical,
118  const EAxis pAxis,
119  const G4int nReplicas,
120  const G4double half_gap,
121  const G4double offset );
122  // Constructor with number of divisions
123 
124  G4ReplicatedSlice(const G4String& pName,
125  G4LogicalVolume* pLogical,
126  G4VPhysicalVolume* pMotherPhysical,
127  const EAxis pAxis,
128  const G4double width,
129  const G4double half_gap,
130  const G4double offset );
131  // Constructor with width
132 
133  public: // with description
134 
135  virtual ~G4ReplicatedSlice();
136 
137  virtual G4bool IsMany() const;
138  virtual G4int GetCopyNo() const;
139  virtual void SetCopyNo(G4int CopyNo);
140  virtual G4bool IsReplicated() const;
142  virtual void GetReplicationData( EAxis& axis,
143  G4int& nReplicas,
144  G4double& width,
145  G4double& offset,
146  G4bool& consuming ) const;
147  EAxis GetDivisionAxis() const;
148  G4bool IsParameterised() const;
149 
150  public: // without description
151 
152  G4bool IsRegularStructure() const;
153  G4int GetRegularStructureId() const;
154  // Methods to identify volume that can apply 'regular' navigation.
155  // Currently divisions do not qualify for this.
156 
157  private:
158 
159  void CheckAndSetParameters( const EAxis pAxis,
160  const G4int nDivs,
161  const G4double width,
162  const G4double half_gap,
163  const G4double offset,
164  DivisionType divType,
165  G4LogicalVolume* pMotherLogical,
166  const G4LogicalVolume* pLogical );
167 
168  void SetParameterisation( G4LogicalVolume* motherLogical,
169  const EAxis pAxis,
170  const G4int nReplicas,
171  const G4double width,
172  const G4double half_gap,
173  const G4double offset,
174  DivisionType divType );
175 
176  void ErrorInAxis( EAxis axis, G4VSolid* solid );
177 
178  private:
179 
182  // Private copy constructor and assignment operator.
183 
184  protected:
185 
186  EAxis faxis; // axis of optimisation
187  EAxis fdivAxis; // axis of division
192 };
193 
194 #endif
virtual void SetCopyNo(G4int CopyNo)
G4bool IsParameterised() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const
G4bool IsRegularStructure() const
#define width
int G4int
Definition: G4Types.hh:78
G4VDivisionParameterisation * fparam
virtual G4int GetCopyNo() const
G4ReplicatedSlice(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double half_gap, const G4double offset)
G4int GetRegularStructureId() const
bool G4bool
Definition: G4Types.hh:79
void ErrorInAxis(EAxis axis, G4VSolid *solid)
void CheckAndSetParameters(const EAxis pAxis, const G4int nDivs, const G4double width, const G4double half_gap, const G4double offset, DivisionType divType, G4LogicalVolume *pMotherLogical, const G4LogicalVolume *pLogical)
virtual G4bool IsMany() const
void SetParameterisation(G4LogicalVolume *motherLogical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double half_gap, const G4double offset, DivisionType divType)
EAxis
Definition: geomdefs.hh:54
virtual G4VPVParameterisation * GetParameterisation() const
double G4double
Definition: G4Types.hh:76
const G4ReplicatedSlice & operator=(const G4ReplicatedSlice &)
virtual G4bool IsReplicated() const
EAxis GetDivisionAxis() const