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