Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** >> 22 // >> 23 // >> 24 // $Id: G4PVPlacement.hh,v 1.5 2005/11/11 22:39:00 japost Exp $ >> 25 // GEANT4 tag $Name: geant4-08-00-patch-01 $ >> 26 // 25 // 27 // 26 // G4PVPlacement << 28 // class G4PVPlacement 27 // 29 // 28 // Class description: 30 // Class description: 29 // 31 // 30 // Class representing a single volume position 32 // Class representing a single volume positioned within and relative 31 // to a mother volume. 33 // to a mother volume. 32 34 33 // 24.07.95 P.Kent, First non-stub version. << 35 // History: >> 36 // 24.07.95 P.Kent First non-stub version >> 37 // 25.07.96 P.Kent Modified interface for new `Replica' capable geometry >> 38 // 28.08.96 P.Kent Tidied + transform replaced by rotmat+vector >> 39 // 28.02.97 J.Apostolakis Added 2nd constructor with G4Transform3D of solid. >> 40 // 11.07.97 J.Apostolakis Added 3rd constructor with pMotherLogical >> 41 // 11.05.98 J.Apostolakis Added 4th constructor with G4Transform3D & pMotherLV 34 // ------------------------------------------- 42 // ---------------------------------------------------------------------- 35 #ifndef G4PVPLACEMENT_HH 43 #ifndef G4PVPLACEMENT_HH 36 #define G4PVPLACEMENT_HH 1 << 44 #define G4PVPLACEMENT_HH 37 45 38 #include "G4VPhysicalVolume.hh" 46 #include "G4VPhysicalVolume.hh" 39 #include "G4Transform3D.hh" 47 #include "G4Transform3D.hh" 40 48 41 class G4PVPlacement : public G4VPhysicalVolume 49 class G4PVPlacement : public G4VPhysicalVolume 42 { 50 { 43 public: << 51 public: // with description 44 52 45 G4PVPlacement(G4RotationMatrix* pRot, << 53 G4PVPlacement(G4RotationMatrix *pRot, 46 const G4ThreeVector& tlate, << 54 const G4ThreeVector &tlate, 47 G4LogicalVolume* pCurrentLog << 55 G4LogicalVolume *pCurrentLogical, 48 const G4String& pName, 56 const G4String& pName, 49 G4LogicalVolume* pMotherLogi << 57 G4LogicalVolume *pMotherLogical, 50 G4bool pMany, 58 G4bool pMany, 51 G4int pCopyNo, 59 G4int pCopyNo, 52 G4bool pSurfChk = false); << 60 G4bool pSurfChk=false); 53 // Initialise a single volume, positione 61 // Initialise a single volume, positioned in a frame which is rotated by 54 // *pRot and traslated by tlate, relativ 62 // *pRot and traslated by tlate, relative to the coordinate system of the 55 // mother volume pMotherLogical. 63 // mother volume pMotherLogical. 56 // If pRot=nullptr the volume is unrotat << 64 // If pRot=0 the volume is unrotated with respect to its mother. 57 // The physical volume is added to the m 65 // The physical volume is added to the mother's logical volume. 58 // Arguments particular to G4PVPlacement 66 // Arguments particular to G4PVPlacement: 59 // pMany Currently NOT used. For futur 67 // pMany Currently NOT used. For future use to identify if the volume 60 // is meant to be considered an 68 // is meant to be considered an overlapping structure, or not. 61 // pCopyNo should be set to 0 for the 69 // pCopyNo should be set to 0 for the first volume of a given type. 62 // pSurfChk if true activates check fo 70 // pSurfChk if true activates check for overlaps with existing volumes. 63 // This is a very natural way of definin 71 // This is a very natural way of defining a physical volume, and is 64 // especially useful when creating subde 72 // especially useful when creating subdetectors: the mother volumes are 65 // not placed until a later stage of the 73 // not placed until a later stage of the assembly program. 66 74 67 G4PVPlacement(const G4Transform3D& Transfo << 75 G4PVPlacement(const G4Transform3D &Transform3D, 68 G4LogicalVolume* pCurr << 76 G4LogicalVolume *pCurrentLogical, 69 const G4String& pName, 77 const G4String& pName, 70 G4LogicalVolume* pMoth << 78 G4LogicalVolume *pMotherLogical, 71 G4bool pMany, 79 G4bool pMany, 72 G4int pCopyNo, 80 G4int pCopyNo, 73 G4bool pSurfChk = fals << 81 G4bool pSurfChk=false); 74 // Additional constructor, which expects 82 // Additional constructor, which expects a G4Transform3D that represents 75 // the direct rotation and translation o 83 // the direct rotation and translation of the solid (NOT of the frame). 76 // The G4Transform3D argument should be 84 // The G4Transform3D argument should be constructed by: 77 // i) First rotating it to align the so 85 // i) First rotating it to align the solid to the system of 78 // reference of its mother volume *p 86 // reference of its mother volume *pMotherLogical, and 79 // ii) Then placing the solid at the loc 87 // ii) Then placing the solid at the location Transform3D.getTranslation(), 80 // with respect to the origin of the 88 // with respect to the origin of the system of coordinates of the 81 // mother volume. 89 // mother volume. 82 // [ This is useful for the people who p 90 // [ This is useful for the people who prefer to think in terms 83 // of moving objects in a given refere 91 // of moving objects in a given reference frame. ] 84 // All other arguments are the same as f 92 // All other arguments are the same as for the previous constructor. 85 93 86 G4PVPlacement(G4RotationMatrix* pRot, << 94 public: // without description 87 const G4ThreeVector& tlate, << 95 88 const G4String& pName, << 96 G4PVPlacement(G4RotationMatrix *pRot, 89 G4LogicalVolume* pLogical, << 97 const G4ThreeVector &tlate, 90 G4VPhysicalVolume* pMother, << 98 const G4String &pName, >> 99 G4LogicalVolume *pLogical, >> 100 G4VPhysicalVolume *pMother, 91 G4bool pMany, 101 G4bool pMany, 92 G4int pCopyNo, 102 G4int pCopyNo, 93 G4bool pSurfChk = false); << 103 G4bool pSurfChk=false); 94 // A simple variation of the 1st constru 104 // A simple variation of the 1st constructor, only specifying the 95 // mother volume as a pointer to its phy 105 // mother volume as a pointer to its physical volume instead of its 96 // logical volume. The effect is exactly 106 // logical volume. The effect is exactly the same. 97 107 98 G4PVPlacement(const G4Transform3D& Transfo << 108 G4PVPlacement(const G4Transform3D &Transform3D, 99 const G4String& pName, << 109 const G4String &pName, 100 G4LogicalVolume* pLogi << 110 G4LogicalVolume *pLogical, 101 G4VPhysicalVolume* pMo << 111 G4VPhysicalVolume *pMother, 102 G4bool pMany, 112 G4bool pMany, 103 G4int pCopyNo, 113 G4int pCopyNo, 104 G4bool pSurfChk = fals << 114 G4bool pSurfChk=false); 105 // Utilises both variations above (from 115 // Utilises both variations above (from 2nd and 3rd constructor). 106 // The effect is the same as for the 2nd 116 // The effect is the same as for the 2nd constructor. 107 117 108 ~G4PVPlacement() override; << 118 public: // with description 109 // Default destructor. << 110 119 111 inline G4int GetCopyNo() const override { << 120 virtual ~G4PVPlacement(); >> 121 // Default destructor. 112 122 113 void SetCopyNo(G4int CopyNo) override; << 123 G4int GetCopyNo() const; >> 124 void SetCopyNo(G4int CopyNo); 114 // Gets and sets the copy number of the 125 // Gets and sets the copy number of the volume. 115 126 116 G4bool CheckOverlaps(G4int res = 1000, G4d << 127 G4bool CheckOverlaps(G4int res=1000); 117 G4bool verbose = true << 118 // Verifies if the placed volume is over 128 // Verifies if the placed volume is overlapping with existing 119 // daughters or with the mother volume. 129 // daughters or with the mother volume. Provides default resolution 120 // for the number of points to be genera 130 // for the number of points to be generated and verified. 121 // A tolerance for the precision of the << 122 // by default it is set to maximum preci << 123 // Reports a maximum of overlaps errors << 124 // Returns true if the volume is overlap 131 // Returns true if the volume is overlapping. 125 132 >> 133 public: // without description >> 134 126 G4PVPlacement(__void__&); 135 G4PVPlacement(__void__&); 127 // Fake default constructor for usage re 136 // Fake default constructor for usage restricted to direct object 128 // persistency for clients requiring pre 137 // persistency for clients requiring preallocation of memory for 129 // persistifiable objects. 138 // persistifiable objects. 130 139 131 G4PVPlacement(const G4PVPlacement&) = dele << 140 G4bool IsMany() const; 132 G4PVPlacement& operator=(const G4PVPlaceme << 141 G4bool IsReplicated() const; 133 // Copy constructor and assignment opera << 142 G4bool IsParameterised() const; 134 << 143 G4VPVParameterisation* GetParameterisation() const; 135 G4bool IsMany() const override; << 136 G4bool IsReplicated() const override; << 137 G4bool IsParameterised() const override; << 138 G4VPVParameterisation* GetParameterisation << 139 void GetReplicationData(EAxis& axis, 144 void GetReplicationData(EAxis& axis, 140 G4int& nReplicas, 145 G4int& nReplicas, 141 G4double& width, 146 G4double& width, 142 G4double& offset, 147 G4double& offset, 143 G4bool& consuming) << 148 G4bool& consuming) const; 144 G4bool IsRegularStructure() const override << 149 G4bool IsRegularStructure() const; 145 G4int GetRegularStructureId() const overri << 150 G4int GetRegularStructureId() const; 146 151 147 EVolume VolumeType() const override; << 148 << 149 private: 152 private: 150 153 151 static G4RotationMatrix* NewPtrRotMatrix(c << 154 static G4RotationMatrix* NewPtrRotMatrix(const G4RotationMatrix &RotMat); 152 // Auxiliary function for 2nd constructo 155 // Auxiliary function for 2nd constructor (one with G4Transform3D). 153 // Creates a new RotMatrix on the heap ( 156 // Creates a new RotMatrix on the heap (using "new") and copies 154 // its argument into it. 157 // its argument into it. 155 158 >> 159 G4PVPlacement(const G4PVPlacement&); >> 160 G4PVPlacement& operator=(const G4PVPlacement&); >> 161 // Private copy constructor and assignment operator. >> 162 156 private: 163 private: 157 164 158 G4bool fmany = false; // flag for overla << 165 G4bool fmany; // flag for overlapping structure - not used 159 G4bool fallocatedRotM = false; // flag fo << 166 G4bool fallocatedRotM; // flag for allocation of Rotation Matrix 160 G4int fcopyNo = 0; // for identificat << 167 G4int fcopyNo; // for identification >> 168 161 }; 169 }; 162 170 163 #endif 171 #endif >> 172 164 173