G4ReplicatedSlice.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4ReplicatedSlice.hh 69784 2013-05-15 09:16:06Z gcosmo $
00028 // 
00029 // class G4ReplicatedSlice
00030 //
00031 // Class description:
00032 //
00033 // G4ReplicatedSlice represents many touchable detector elements differing
00034 // only in their positioning. The elements' positions are calculated by means
00035 // of a simple linear formula.
00036 // 
00037 // Division may occur along:
00038 //
00039 // o Cartesian axes (kXAxis,kYAxis,kZAxis)
00040 //
00041 //   The divisions, of specified width have coordinates of
00042 //   form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1
00043 //   for the case of kXAxis, and are unrotated.
00044 //
00045 // o Radial axis (cylindrical polar) (kRho)
00046 //
00047 //   The divisions are cons/tubs sections, centred on the origin
00048 //   and are unrotated.
00049 //   They have radii of width*n+offset to width*(n+1)+offset
00050 //                      where n=0..nReplicas-1
00051 //
00052 // o Phi axis (cylindrical polar) (kPhi)
00053 //   The divisions are `phi sections' or wedges, and of cons/tubs form
00054 //   They have phi of offset+n*width to offset+(n+1)*width where
00055 //   n=0..nReplicas-1
00056 
00057 // History:
00058 // -------
00059 // Apr/20/2010 - Initial version extended from G4PVDivision
00060 // ----------------------------------------------------------------------
00061 #ifndef G4ReplicatedSlice_HH 
00062 #define G4ReplicatedSlice_HH 1
00063 
00064 #include "geomdefs.hh"
00065 #include "G4VPhysicalVolume.hh"
00066 #include "G4VDivisionParameterisation.hh"
00067 
00068 class G4LogicalVolume;
00069 class G4VSolid;
00070 
00071 class G4ReplicatedSlice : public G4VPhysicalVolume
00072 {
00073   public:  // with description
00074     
00075     G4ReplicatedSlice(const G4String& pName,
00076                             G4LogicalVolume* pLogical,
00077                             G4LogicalVolume* pMotherLogical,
00078                       const EAxis pAxis,
00079                       const G4int nReplicas,
00080                       const G4double width,
00081                       const G4double half_gap,
00082                       const G4double offset );
00083       // Constructor with number of divisions and width
00084 
00085     G4ReplicatedSlice(const G4String& pName,
00086                             G4LogicalVolume* pLogical,
00087                             G4LogicalVolume* pMotherLogical,
00088                       const EAxis pAxis,
00089                       const G4int nReplicas,
00090                       const G4double half_gap,
00091                       const G4double offset );
00092       // Constructor with number of divisions 
00093 
00094     G4ReplicatedSlice(const G4String& pName,
00095                             G4LogicalVolume* pLogical,
00096                             G4LogicalVolume* pMotherLogical,
00097                       const EAxis pAxis,
00098                       const G4double width,
00099                       const G4double half_gap,
00100                       const G4double offset );
00101       // Constructor with width
00102 
00103   public:  // without description
00104 
00105     G4ReplicatedSlice(const G4String& pName,
00106                             G4LogicalVolume* pLogical,
00107                             G4VPhysicalVolume* pMotherPhysical,
00108                       const EAxis pAxis,
00109                       const G4int nReplicas,
00110                       const G4double width,
00111                       const G4double half_gap,
00112                       const G4double offset);
00113       // Constructor in mother physical volume
00114 
00115     G4ReplicatedSlice(const G4String& pName,
00116                             G4LogicalVolume* pLogical,
00117                             G4VPhysicalVolume* pMotherPhysical,
00118                       const EAxis pAxis,
00119                       const G4int nReplicas,
00120                       const G4double half_gap,
00121                       const G4double offset );
00122       // Constructor with number of divisions 
00123 
00124     G4ReplicatedSlice(const G4String& pName,
00125                             G4LogicalVolume* pLogical,
00126                             G4VPhysicalVolume* pMotherPhysical,
00127                       const EAxis pAxis,
00128                       const G4double width,
00129                       const G4double half_gap,
00130                       const G4double offset );
00131       // Constructor with width
00132 
00133   public:  // with description
00134 
00135     virtual ~G4ReplicatedSlice();
00136 
00137     virtual G4bool IsMany() const;
00138     virtual G4int GetCopyNo() const;
00139     virtual void  SetCopyNo(G4int CopyNo);
00140     virtual G4bool IsReplicated() const;
00141     virtual G4VPVParameterisation* GetParameterisation() const;
00142     virtual void GetReplicationData( EAxis& axis,
00143                                      G4int& nReplicas,
00144                                      G4double& width,
00145                                      G4double& offset,
00146                                      G4bool& consuming ) const;
00147     EAxis  GetDivisionAxis() const;
00148     G4bool IsParameterised() const;
00149 
00150   public:  // without description
00151 
00152     G4bool IsRegularStructure() const; 
00153     G4int  GetRegularStructureId() const; 
00154       // Methods to identify volume that can apply 'regular' navigation.
00155       // Currently divisions do not qualify for this.
00156 
00157   private:
00158 
00159     void CheckAndSetParameters( const EAxis pAxis,
00160                                 const G4int nDivs,
00161                                 const G4double width,
00162                                 const G4double half_gap,
00163                                 const G4double offset, 
00164                                       DivisionType divType,
00165                                       G4LogicalVolume* pMotherLogical,
00166                                 const G4LogicalVolume* pLogical );
00167 
00168     void SetParameterisation(       G4LogicalVolume* motherLogical,
00169                               const EAxis pAxis,
00170                               const G4int nReplicas,
00171                               const G4double width,
00172                               const G4double half_gap,
00173                               const G4double offset, 
00174                                     DivisionType divType );
00175 
00176     void ErrorInAxis( EAxis axis, G4VSolid* solid );
00177 
00178   private:
00179 
00180     G4ReplicatedSlice(const G4ReplicatedSlice&);
00181     const G4ReplicatedSlice& operator=(const G4ReplicatedSlice&);
00182       // Private copy constructor and assignment operator.
00183 
00184   protected:
00185 
00186     EAxis faxis;             // axis of optimisation
00187     EAxis fdivAxis;          // axis of division
00188     G4int fnReplicas;
00189     G4double fwidth,foffset;
00190     G4int    fcopyNo;
00191     G4VDivisionParameterisation *fparam; 
00192 };
00193 
00194 #endif

Generated on Mon May 27 17:49:43 2013 for Geant4 by  doxygen 1.4.7