G4PVPlacement.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$
00028 //
00029 // 
00030 // class G4PVPlacement
00031 //
00032 // Class description:
00033 //
00034 // Class representing a single volume positioned within and relative
00035 // to a mother volume.
00036 
00037 // History:
00038 // 24.07.95 P.Kent   First non-stub version
00039 // 25.07.96 P.Kent   Modified interface for new `Replica' capable geometry
00040 // 28.08.96 P.Kent   Tidied + transform replaced by rotmat+vector
00041 // 28.02.97 J.Apostolakis Added 2nd constructor with G4Transform3D of solid.
00042 // 11.07.97 J.Apostolakis Added 3rd constructor with pMotherLogical 
00043 // 11.05.98 J.Apostolakis Added 4th constructor with G4Transform3D & pMotherLV
00044 // ----------------------------------------------------------------------
00045 #ifndef G4PVPLACEMENT_HH
00046 #define G4PVPLACEMENT_HH
00047 
00048 #include "G4VPhysicalVolume.hh"
00049 #include "G4Transform3D.hh"
00050 
00051 class G4PVPlacement : public G4VPhysicalVolume
00052 {
00053   public:  // with description
00054 
00055     G4PVPlacement(G4RotationMatrix *pRot,
00056             const G4ThreeVector &tlate,
00057                   G4LogicalVolume *pCurrentLogical,
00058             const G4String& pName,
00059                   G4LogicalVolume *pMotherLogical,
00060                   G4bool pMany,
00061                   G4int  pCopyNo,
00062                   G4bool pSurfChk=false);
00063       // Initialise a single volume, positioned in a frame which is rotated by
00064       // *pRot and traslated by tlate, relative to the coordinate system of the
00065       // mother volume pMotherLogical.
00066       // If pRot=0 the volume is unrotated with respect to its mother.
00067       // The physical volume is added to the mother's logical volume.
00068       // Arguments particular to G4PVPlacement:
00069       //   pMany Currently NOT used. For future use to identify if the volume
00070       //         is meant to be considered an overlapping structure, or not.
00071       //   pCopyNo should be set to 0 for the first volume of a given type.
00072       //   pSurfChk if true activates check for overlaps with existing volumes.
00073       // This is a very natural way of defining a physical volume, and is
00074       // especially useful when creating subdetectors: the mother volumes are
00075       // not placed until a later stage of the assembly program.
00076 
00077     G4PVPlacement(const G4Transform3D &Transform3D,
00078                         G4LogicalVolume *pCurrentLogical,
00079                   const G4String& pName,
00080                         G4LogicalVolume *pMotherLogical,
00081                         G4bool pMany,
00082                         G4int pCopyNo,
00083                         G4bool pSurfChk=false);
00084       // Additional constructor, which expects a G4Transform3D that represents 
00085       // the direct rotation and translation of the solid (NOT of the frame).  
00086       // The G4Transform3D argument should be constructed by:
00087       //  i) First rotating it to align the solid to the system of 
00088       //     reference of its mother volume *pMotherLogical, and 
00089       // ii) Then placing the solid at the location Transform3D.getTranslation(),
00090       //     with respect to the origin of the system of coordinates of the
00091       //     mother volume.  
00092       // [ This is useful for the people who prefer to think in terms 
00093       //   of moving objects in a given reference frame. ]
00094       // All other arguments are the same as for the previous constructor.
00095 
00096   public:  // without description
00097 
00098     G4PVPlacement(G4RotationMatrix *pRot,
00099             const G4ThreeVector &tlate,
00100             const G4String &pName,
00101                   G4LogicalVolume *pLogical,
00102                   G4VPhysicalVolume *pMother,
00103                   G4bool pMany,
00104                   G4int pCopyNo,
00105                   G4bool pSurfChk=false);
00106       // A simple variation of the 1st constructor, only specifying the
00107       // mother volume as a pointer to its physical volume instead of its
00108       // logical volume. The effect is exactly the same.
00109 
00110     G4PVPlacement(const G4Transform3D &Transform3D,
00111                   const G4String &pName,
00112                         G4LogicalVolume *pLogical,
00113                         G4VPhysicalVolume *pMother,
00114                         G4bool pMany,
00115                         G4int pCopyNo,
00116                         G4bool pSurfChk=false);
00117       // Utilises both variations above (from 2nd and 3rd constructor).
00118       // The effect is the same as for the 2nd constructor.
00119 
00120   public:  // with description
00121 
00122     virtual ~G4PVPlacement();
00123       // Default destructor.
00124 
00125     G4int GetCopyNo() const;
00126     void  SetCopyNo(G4int CopyNo);
00127       // Gets and sets the copy number of the volume.
00128 
00129     G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true);
00130       // Verifies if the placed volume is overlapping with existing
00131       // daughters or with the mother volume. Provides default resolution
00132       // for the number of points to be generated and verified.
00133       // A tolerance for the precision of the overlap check can be specified,
00134       // by default it is set to maximum precision.
00135       // Returns true if the volume is overlapping.
00136 
00137   public:  // without description
00138 
00139     G4PVPlacement(__void__&);
00140       // Fake default constructor for usage restricted to direct object
00141       // persistency for clients requiring preallocation of memory for
00142       // persistifiable objects.
00143 
00144     G4bool IsMany() const;
00145     G4bool IsReplicated() const;
00146     G4bool IsParameterised() const;
00147     G4VPVParameterisation* GetParameterisation() const;
00148     void GetReplicationData(EAxis& axis,
00149                             G4int& nReplicas,
00150                             G4double& width,
00151                             G4double& offset,
00152                             G4bool& consuming) const;
00153     G4bool  IsRegularStructure() const; 
00154     G4int  GetRegularStructureId() const; 
00155 
00156   private:
00157 
00158     static G4RotationMatrix* NewPtrRotMatrix(const G4RotationMatrix &RotMat);
00159       // Auxiliary function for 2nd constructor (one with G4Transform3D).
00160       // Creates a new RotMatrix on the heap (using "new") and copies 
00161       // its argument into it.
00162 
00163     G4PVPlacement(const G4PVPlacement&);
00164     G4PVPlacement& operator=(const G4PVPlacement&);
00165       // Private copy constructor and assignment operator.
00166 
00167   private:
00168 
00169     G4bool fmany;           // flag for overlapping structure - not used
00170     G4bool fallocatedRotM;  // flag for allocation of Rotation Matrix
00171     G4int fcopyNo;          // for identification
00172 
00173 };
00174 
00175 #endif
00176 

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