G4PVDivision.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: G4PVDivision.hh 69784 2013-05-15 09:16:06Z gcosmo $
00028 // 
00029 // class G4PVDivision
00030 //
00031 // Class description:
00032 //
00033 // Represents many touchable detector elements differing only in their
00034 // positioning. The elements' positions are calculated by means of a simple
00035 // linear formula.
00036 // 
00037 // G4PVDivision(const G4String& pName,
00038 //                    G4LogicalVolume* pLogical,
00039 //                    G4LogicalVolume* pMother,
00040 //              const EAxis pAxis,
00041 //              const G4int nReplicas,
00042 //              const G4double width,
00043 //              const G4double offset=0)
00044 //
00045 // Division may occur along:
00046 //
00047 // o Cartesian axes (kXAxis,kYAxis,kZAxis)
00048 //
00049 //   The divisions, of specified width have coordinates of
00050 //   form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1
00051 //   for the case of kXAxis, and are unrotated.
00052 //
00053 // o Radial axis (cylindrical polar) (kRho)
00054 //
00055 //   The divisions are cons/tubs sections, centred on the origin
00056 //   and are unrotated.
00057 //   They have radii of width*n+offset to width*(n+1)+offset
00058 //                      where n=0..nReplicas-1
00059 //
00060 // o Phi axis (cylindrical polar) (kPhi)
00061 //   The divisions are `phi sections' or wedges, and of cons/tubs form
00062 //   They have phi of offset+n*width to offset+(n+1)*width where
00063 //   n=0..nReplicas-1
00064 
00065 // History:
00066 // -------
00067 // 09.05.01 - P.Arce, Initial version
00068 // ----------------------------------------------------------------------
00069 #ifndef G4PVDIVISION_HH
00070 #define G4PVDIVISION_HH
00071 
00072 #include "geomdefs.hh"
00073 #include "G4VPhysicalVolume.hh"
00074 #include "G4VDivisionParameterisation.hh"
00075 
00076 class G4LogicalVolume;
00077 class G4VSolid;
00078 
00079 class G4PVDivision : public G4VPhysicalVolume
00080 {
00081   public:  // with description
00082     
00083     G4PVDivision(const G4String& pName,
00084                        G4LogicalVolume* pLogical,
00085                        G4LogicalVolume* pMother,
00086                  const EAxis pAxis,
00087                  const G4int nReplicas,
00088                  const G4double width,
00089                  const G4double offset );
00090       // Constructor with number of divisions and width
00091 
00092     G4PVDivision(const G4String& pName,
00093                        G4LogicalVolume* pLogical,
00094                        G4LogicalVolume* pMotherLogical,
00095                  const EAxis pAxis,
00096                  const G4int nReplicas,
00097                  const G4double offset );
00098       // Constructor with number of divisions 
00099 
00100     G4PVDivision(const G4String& pName,
00101                        G4LogicalVolume* pLogical,
00102                        G4LogicalVolume* pMotherLogical,
00103                  const EAxis pAxis,
00104                  const G4double width,
00105                  const G4double offset );
00106       // Constructor with width
00107 
00108   public:  // without description
00109 
00110     G4PVDivision(const G4String& pName,
00111                        G4LogicalVolume* pLogical,
00112                        G4VPhysicalVolume* pMother,
00113                  const EAxis pAxis,
00114                  const G4int nReplicas,
00115                  const G4double width,
00116                  const G4double offset);
00117       // Constructor in mother physical volume
00118 
00119   public:  // with description
00120 
00121     virtual ~G4PVDivision();
00122 
00123     virtual G4bool IsMany() const;
00124     virtual G4int GetCopyNo() const;
00125     virtual void  SetCopyNo(G4int CopyNo);
00126     virtual G4bool IsReplicated() const;
00127     virtual G4VPVParameterisation* GetParameterisation() const;
00128     virtual void GetReplicationData( EAxis& axis,
00129                                      G4int& nReplicas,
00130                                      G4double& width,
00131                                      G4double& offset,
00132                                      G4bool& consuming ) const;
00133     EAxis  GetDivisionAxis() const;
00134     G4bool IsParameterised() const;
00135 
00136   public:  // without description
00137 
00138     G4bool IsRegularStructure() const; 
00139     G4int  GetRegularStructureId() const; 
00140       // Methods to identify volume that can have revised 'regular' navigation.
00141       // Currently divisions do not qualify for this.
00142 
00143   private:
00144 
00145     void CheckAndSetParameters( const EAxis pAxis,
00146                                 const G4int nDivs,
00147                                 const G4double width,
00148                                 const G4double offset, 
00149                                       DivisionType divType,
00150                                 const G4LogicalVolume* pMotherLogical );
00151 
00152     G4PVDivision(const G4PVDivision&);
00153     const G4PVDivision& operator=(const G4PVDivision&);
00154 
00155     void SetParameterisation( G4LogicalVolume* motherLogical,
00156                         const EAxis pAxis,
00157                         const G4int nReplicas,
00158                         const G4double width,
00159                         const G4double offset, 
00160                               DivisionType divType );
00161     void ErrorInAxis( EAxis axis, G4VSolid* solid );
00162 
00163   protected:
00164 
00165     EAxis faxis;             // axis of optimisation
00166     EAxis fdivAxis;          // axis of division
00167     G4int fnReplicas;
00168     G4double fwidth,foffset;
00169     G4int    fcopyNo;
00170     G4VDivisionParameterisation *fparam; 
00171 };
00172 
00173 #endif

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