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