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5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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"
 61 #include "G4VDivisionParameterisation.hh"
 62 
 63 class G4LogicalVolume;
 64 class G4VSolid;
 65 
 66 class G4ReplicatedSlice : public G4PVReplica
 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     ~G4ReplicatedSlice() override;
127 
128     G4ReplicatedSlice(const G4ReplicatedSlice&) = delete;
129     G4ReplicatedSlice& operator=(const G4ReplicatedSlice&) = delete;
130 
131     G4bool IsMany() const override;
132     G4bool IsReplicated() const override;
133     G4int GetMultiplicity() const override;
134     G4VPVParameterisation* GetParameterisation() const override;
135     void GetReplicationData( EAxis& axis,
136                              G4int& nReplicas,
137                              G4double& width,
138                              G4double& offset,
139                              G4bool& consuming ) const override;
140     EAxis  GetDivisionAxis() const;
141     G4bool IsParameterised() const override;
142    
143     EVolume VolumeType() const final;
144       // Characterise the type of volume - normal/replicated/parameterised.
145 
146     G4bool IsRegularStructure() const override; 
147     G4int  GetRegularStructureId() const override; 
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
176     G4int fnReplicas = 0;
177     G4double fwidth = 0.0, foffset = 0.0;
178     G4VDivisionParameterisation* fparam = nullptr; 
179 };
180 
181 #endif
182