Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/management/include/G4LogicalVolume.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.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 ]

Diff markup

Differences between /geometry/management/include/G4LogicalVolume.hh (Version 11.3.0) and /geometry/management/include/G4LogicalVolume.hh (Version 10.4.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4LogicalVolume                             <<  26 //
                                                   >>  27 // $Id: G4LogicalVolume.hh 103096 2017-03-15 15:21:33Z gcosmo $
                                                   >>  28 //
                                                   >>  29 // 
                                                   >>  30 // class G4LogicalVolume
 27 //                                                 31 //
 28 // Class description:                              32 // Class description:
 29 //                                                 33 //
 30 // Represents a leaf node or unpositioned subt     34 // Represents a leaf node or unpositioned subtree in the geometry hierarchy.
 31 // Logical volumes are named, and may have dau     35 // Logical volumes are named, and may have daughters ascribed to them.
 32 // They are responsible for retrieval of the p     36 // They are responsible for retrieval of the physical and tracking attributes
 33 // of the physical volume that it represents:      37 // of the physical volume that it represents: solid, material, magnetic field,
 34 // and optionally, user limits, sensitive dete     38 // and optionally, user limits, sensitive detectors, regions, biasing weights.
 35 //                                                 39 //
 36 // Get and Set functionality is provided for a     40 // Get and Set functionality is provided for all attributes, but note that
 37 // most set functions should not be used  when     41 // most set functions should not be used  when the geometry is `closed'.
 38 // As a  further development, `Guard' checks c     42 // As a  further development, `Guard' checks can be added to ensure
 39 // only legal operations at tracking time.         43 // only legal operations at tracking time.
 40 //                                                 44 //
 41 // On construction, solid, material and name m     45 // On construction, solid, material and name must be specified.
 42 //                                                 46 //
 43 // Daughters are ascribed and managed by means     47 // Daughters are ascribed and managed by means of a simple
 44 // GetNoDaughters,Get/SetDaughter(n),AddDaught     48 // GetNoDaughters,Get/SetDaughter(n),AddDaughter interface.
 45 //                                                 49 //
 46 // Smart voxels as used for tracking optimisat     50 // Smart voxels as used for tracking optimisation. They're also an attribute.
 47 //                                                 51 //
 48 // Logical volumes self register to the logica     52 // Logical volumes self register to the logical volume Store on construction,
 49 // and deregister on destruction.                  53 // and deregister on destruction.
 50 //                                                 54 //
 51 // NOTE: This class is currently *NOT* subclas     55 // NOTE: This class is currently *NOT* subclassed, since not meant to
 52 //       act as a base class. Therefore, the d     56 //       act as a base class. Therefore, the destructor is NOT virtual.
 53 //                                                 57 //
 54 // Data members:                                   58 // Data members:
 55 //                                                 59 //
 56 //    std::vector<G4VPhysicalVolume*> fDaughte     60 //    std::vector<G4VPhysicalVolume*> fDaughters
 57 //    - Vector of daughters. Given initial siz     61 //    - Vector of daughters. Given initial size of 0.
 58 //    G4FieldManager* fFieldManager                62 //    G4FieldManager* fFieldManager
 59 //    - Pointer (possibly 0) to (magnetic or o     63 //    - Pointer (possibly 0) to (magnetic or other) field manager object.
 60 //    G4Material* fMaterial                        64 //    G4Material* fMaterial
 61 //    - Pointer to material at this node.          65 //    - Pointer to material at this node.
 62 //    G4String fName                               66 //    G4String fName
 63 //    - Name of logical volume.                    67 //    - Name of logical volume.
 64 //    G4VSensitiveDetector *fSensitiveDetector     68 //    G4VSensitiveDetector *fSensitiveDetector
 65 //    - Pointer (possibly 0) to `Hit' object.      69 //    - Pointer (possibly 0) to `Hit' object.
 66 //    G4VSolid* fSolid                             70 //    G4VSolid* fSolid
 67 //    - Pointer to solid.                          71 //    - Pointer to solid.
 68 //    G4UserLimits* fUserLimits                    72 //    G4UserLimits* fUserLimits
 69 //    - Pointer (possibly 0) to user Step limi     73 //    - Pointer (possibly 0) to user Step limit object for this node.
 70 //    G4SmartVoxelHeader* fVoxel                   74 //    G4SmartVoxelHeader* fVoxel
 71 //    - Pointer (possibly 0) to optimisation i     75 //    - Pointer (possibly 0) to optimisation info objects.
 72 //    G4bool fOptimise                             76 //    G4bool fOptimise
 73 //    - Flag to identify if optimisation shoul     77 //    - Flag to identify if optimisation should be applied or not.
 74 //    G4bool fRootRegion                           78 //    G4bool fRootRegion
 75 //    - Flag to identify if the logical volume     79 //    - Flag to identify if the logical volume is a root region.
 76 //    G4double fSmartless                          80 //    G4double fSmartless
 77 //    - Quality for optimisation, average numb     81 //    - Quality for optimisation, average number of voxels to be spent
 78 //      per content.                               82 //      per content.
 79 //    const G4VisAttributes* fVisAttributes        83 //    const G4VisAttributes* fVisAttributes
 80 //    - Pointer (possibly 0) to visualization      84 //    - Pointer (possibly 0) to visualization attributes.
 81 //    G4Region* fRegion                            85 //    G4Region* fRegion
 82 //    - Pointer to the cuts region (if any)        86 //    - Pointer to the cuts region (if any)
 83 //    G4MaterialCutsCouple* fCutsCouple            87 //    G4MaterialCutsCouple* fCutsCouple
 84 //    - Pointer (possibly 0) to associated pro     88 //    - Pointer (possibly 0) to associated production cuts.
 85 //    G4double fBiasWeight                         89 //    G4double fBiasWeight
 86 //    - Weight used in the event biasing techn     90 //    - Weight used in the event biasing technique.
 87 //                                                 91 //
 88 // Following data members has been moved to G4     92 // Following data members has been moved to G4Region - M.Asai (Aug/18/2005)
 89 //    G4FastSimulationManager* fFastSimulation     93 //    G4FastSimulationManager* fFastSimulationManager
 90 //    - Pointer (possibly 0) to G4FastSimulati     94 //    - Pointer (possibly 0) to G4FastSimulationManager object.
 91 //    G4bool fIsEnvelope                           95 //    G4bool fIsEnvelope
 92 //    - Flags if the Logical Volume is an enve     96 //    - Flags if the Logical Volume is an envelope for a FastSimulationManager.
 93                                                    97 
                                                   >>  98 // History:
                                                   >>  99 // 19.10.16 M.Asai: Added virtual keyword to the destructor
 94 // 15.01.13 G.Cosmo, A.Dotti: Modified for thr    100 // 15.01.13 G.Cosmo, A.Dotti: Modified for thread-safety for MT
 95 // 12.11.04 G.Cosmo: Added GetMass() method fo    101 // 12.11.04 G.Cosmo: Added GetMass() method for computing mass of the tree
 96 // 24.09.02 G.Cosmo: Added flags and accessors    102 // 24.09.02 G.Cosmo: Added flags and accessors for region cuts handling
 97 // 17.05.02 G.Cosmo: Added IsToOptimise() meth    103 // 17.05.02 G.Cosmo: Added IsToOptimise() method and related flag
 98 // 18.04.01 G.Cosmo: Migrated to STL vector       104 // 18.04.01 G.Cosmo: Migrated to STL vector
 99 // 12.02.99 S.Giani: Added user defined optimi    105 // 12.02.99 S.Giani: Added user defined optimisation quality
                                                   >> 106 // 09.11.98 J.Apostolakis:  Changed G4MagneticField to G4FieldManager
100 // 09.11.98 M.Verderi, J.Apostolakis: Added Bi    107 // 09.11.98 M.Verderi, J.Apostolakis: Added BiasWeight member and accessors
101 // 10.20.97 P.M.DeFreitas, J.Apostolakis: Adde << 108 // 10.20.97 P.M.DeFreitas: Added pointer to a FastSimulation
102 // 11.07.95 P.Kent: Initial version            << 109 //          J.Apostolakis: & flag to indicate if it is an Envelope for it
                                                   >> 110 // 19.11.96 J.Allison: Replaced G4Visible with explicit const G4VisAttributes*
                                                   >> 111 // 19.08.96 P.Kent: Split -> hh/icc/cc files; G4VSensitiveDetector change
                                                   >> 112 // 11.07.95 P.Kent: Initial version.
103 // -------------------------------------------    113 // ------------------------------------------------------------------------
104 #ifndef G4LOGICALVOLUME_HH                        114 #ifndef G4LOGICALVOLUME_HH
105 #define G4LOGICALVOLUME_HH 1                   << 115 #define G4LOGICALVOLUME_HH
106                                                   116 
107 #include <vector>                                 117 #include <vector>
108 #include <memory>                              << 
109                                                   118 
110 #include "G4Types.hh"                             119 #include "G4Types.hh"
111 #include "G4Region.hh"           // Required b    120 #include "G4Region.hh"           // Required by inline methods
112 #include "G4VPhysicalVolume.hh"  // Need opera    121 #include "G4VPhysicalVolume.hh"  // Need operator == for vector fdaughters
113 #include "G4GeomSplitter.hh"     // Needed for    122 #include "G4GeomSplitter.hh"     // Needed for MT RW data splitting
114 #include "G4Threading.hh"                         123 #include "G4Threading.hh"
115                                                   124 
116 // Forward declarations                           125 // Forward declarations
117 //                                                126 //
118 class G4FieldManager;                             127 class G4FieldManager;
119 class G4Material;                                 128 class G4Material;
120 class G4VSensitiveDetector;                       129 class G4VSensitiveDetector;
121 class G4VSolid;                                   130 class G4VSolid;
122 class G4UserLimits;                               131 class G4UserLimits;
123 class G4SmartVoxelHeader;                         132 class G4SmartVoxelHeader;
                                                   >> 133 class G4VisAttributes;
124 class G4FastSimulationManager;                    134 class G4FastSimulationManager;
125 class G4MaterialCutsCouple;                       135 class G4MaterialCutsCouple;
126 class G4VisAttributes;                         << 
127                                                   136 
128 class G4LVData                                    137 class G4LVData
129 {                                                 138 {
130   // Encapsulates the fields associated to the    139   // Encapsulates the fields associated to the class
131   // G4LogicalVolume that may not be read-only    140   // G4LogicalVolume that may not be read-only. 
132                                                   141 
133   public:                                         142   public:
134                                                << 
135     G4LVData();                                   143     G4LVData();
136     void initialize()                             144     void initialize()
137     {                                             145     {
138       fSolid = nullptr;                        << 146       fSolid = 0;
139       fSensitiveDetector = nullptr;            << 147       fSensitiveDetector = 0;
140       fFieldManager = nullptr;                 << 148       fFieldManager = 0;
141       fMaterial = nullptr;                     << 149       fMaterial = 0;
142       fMass = 0.0;                                150       fMass = 0.0;
143       fCutsCouple = nullptr;                   << 151       fCutsCouple = 0;
144     }                                             152     }
145                                                   153 
146   public:                                         154   public:
147                                                   155 
148     G4VSolid* fSolid = nullptr;                << 156     G4VSolid* fSolid;
149       // Pointer to solid.                        157       // Pointer to solid.
150     G4VSensitiveDetector* fSensitiveDetector = << 158     G4VSensitiveDetector* fSensitiveDetector;
151       // Pointer to sensitive detector.           159       // Pointer to sensitive detector.
152     G4FieldManager* fFieldManager = nullptr;   << 160     G4FieldManager* fFieldManager;
153       // Pointer (possibly nullptr) to (magnet << 161       // Pointer (possibly 0) to (magnetic or other) field manager object.
154     G4Material* fMaterial = nullptr;           << 162     G4Material* fMaterial;
155       // Pointer to material at this node.        163       // Pointer to material at this node.
156     G4double fMass = 0.0;                      << 164     G4double fMass;
157       // Mass of the logical volume tree.         165       // Mass of the logical volume tree.
158     G4MaterialCutsCouple* fCutsCouple = nullpt << 166     G4MaterialCutsCouple* fCutsCouple;
159       // Pointer (possibly nullptr) to associa << 167       // Pointer (possibly 0) to associated production cuts.
160 };                                                168 };
161                                                   169 
162 // The type G4LVManager is introduced to encap    170 // The type G4LVManager is introduced to encapsulate the methods used by
163 // both the master thread and worker threads t    171 // both the master thread and worker threads to allocate memory space for
164 // the fields encapsulated by the class G4LVDa    172 // the fields encapsulated by the class G4LVData. When each thread
165 // initializes the value for these fields, it     173 // initializes the value for these fields, it refers to them using a macro
166 // definition defined below. For every G4Logic    174 // definition defined below. For every G4LogicalVolume instance, there is
167 // a corresponding G4LVData instance. All G4LV    175 // a corresponding G4LVData instance. All G4LVData instances are organized
168 // by the class G4LVManager as an array.          176 // by the class G4LVManager as an array.
169 // The field "int instanceID" is added to the     177 // The field "int instanceID" is added to the class G4LogicalVolume.
170 // The value of this field in each G4LogicalVo    178 // The value of this field in each G4LogicalVolume instance is the subscript
171 // of the corresponding G4LVData instance.        179 // of the corresponding G4LVData instance.
172 // In order to use the class G4LVManager, we a    180 // In order to use the class G4LVManager, we add a static member in the class
173 // G4LogicalVolume as follows: "static G4LVMan    181 // G4LogicalVolume as follows: "static G4LVManager subInstanceManager".
174 // For the master thread, the array for G4LVDa    182 // For the master thread, the array for G4LVData instances grows dynamically
175 // along with G4LogicalVolume instances are cr    183 // along with G4LogicalVolume instances are created. For each worker thread,
176 // it copies the array of G4LVData instances f    184 // it copies the array of G4LVData instances from the master thread.
177 // In addition, it invokes a method similiar t    185 // In addition, it invokes a method similiar to the constructor explicitly
178 // to achieve the partial effect for each inst    186 // to achieve the partial effect for each instance in the array.
179 //                                                187 //
180 using G4LVManager = G4GeomSplitter<G4LVData>;  << 188 typedef G4GeomSplitter<G4LVData>  G4LVManager;
181                                                   189 
182 class G4LogicalVolume                             190 class G4LogicalVolume
183 {                                                 191 {
184   public:                                      << 192   typedef std::vector<G4VPhysicalVolume*> G4PhysicalVolumeList;
                                                   >> 193 
                                                   >> 194   public:  // with description
185                                                   195     
186     G4LogicalVolume(G4VSolid* pSolid,             196     G4LogicalVolume(G4VSolid* pSolid,
187                     G4Material* pMaterial,        197                     G4Material* pMaterial,
188               const G4String& name,               198               const G4String& name,
189                     G4FieldManager* pFieldMgr  << 199                     G4FieldManager* pFieldMgr=0,
190                     G4VSensitiveDetector* pSDe << 200                     G4VSensitiveDetector* pSDetector=0,
191                     G4UserLimits* pULimits = n << 201                     G4UserLimits* pULimits=0,
192                     G4bool optimise = true);   << 202                     G4bool optimise=true);
193       // Constructor. The solid and material p    203       // Constructor. The solid and material pointer must be non null.
194       // The parameters for field, detector an    204       // The parameters for field, detector and user limits are optional.
195       // The volume also enters itself into th    205       // The volume also enters itself into the logical volume Store.
196       // Optimisation of the geometry (voxelis    206       // Optimisation of the geometry (voxelisation) for the volume
197       // hierarchy is applied by default. For     207       // hierarchy is applied by default. For parameterised volumes in
198       // the hierarchy, optimisation is -alway    208       // the hierarchy, optimisation is -always- applied.
199                                                   209 
200     virtual ~G4LogicalVolume();                   210     virtual ~G4LogicalVolume();
201       // Destructor. Removes the logical volum    211       // Destructor. Removes the logical volume from the logical volume Store.
202       // This class is NOT meant to act as bas    212       // This class is NOT meant to act as base class, except for exceptional
203       // circumstances of extended types used     213       // circumstances of extended types used in the kernel.
204                                                   214 
205     G4LogicalVolume(const G4LogicalVolume&) =  << 
206     G4LogicalVolume& operator=(const G4Logical << 
207       // Copy-constructor and assignment opera << 
208                                                << 
209     inline const G4String& GetName() const;       215     inline const G4String& GetName() const;
210     void SetName(const G4String& pName);       << 216     inline void SetName(const G4String& pName);
211       // Returns and sets the name of the logi    217       // Returns and sets the name of the logical volume.
212                                                   218 
213     inline std::size_t GetNoDaughters() const; << 219     inline G4int GetNoDaughters() const;
214       // Returns the number of daughters (0 to    220       // Returns the number of daughters (0 to n).
215     inline G4VPhysicalVolume* GetDaughter(cons << 221     inline G4VPhysicalVolume* GetDaughter(const G4int i) const;
216       // Returns the ith daughter. Note number    222       // Returns the ith daughter. Note numbering starts from 0,
217       // and no bounds checking is performed.     223       // and no bounds checking is performed.
218     void AddDaughter(G4VPhysicalVolume* p);       224     void AddDaughter(G4VPhysicalVolume* p);
219       // Adds the volume p as a daughter of th    225       // Adds the volume p as a daughter of the current logical volume.
220     inline G4bool IsDaughter(const G4VPhysical    226     inline G4bool IsDaughter(const G4VPhysicalVolume* p) const;
221       // Returns true if the volume p is a dau    227       // Returns true if the volume p is a daughter of the current
222       // logical volume.                          228       // logical volume.
223     G4bool IsAncestor(const G4VPhysicalVolume*    229     G4bool IsAncestor(const G4VPhysicalVolume* p) const;
224       // Returns true if the volume p is part     230       // Returns true if the volume p is part of the hierarchy of
225       // volumes established by the current lo    231       // volumes established by the current logical volume. Scans
226       // recursively the volume tree.             232       // recursively the volume tree.
227     void RemoveDaughter(const G4VPhysicalVolum    233     void RemoveDaughter(const G4VPhysicalVolume* p);
228       // Removes the volume p from the List of    234       // Removes the volume p from the List of daughter of the current
229       // logical volume.                          235       // logical volume.
230     void ClearDaughters();                        236     void ClearDaughters();
231       // Clears the list of daughters. Used by    237       // Clears the list of daughters. Used by the phys-volume store when
232       // the geometry tree is cleared, since m    238       // the geometry tree is cleared, since modified at run-time.
233     G4int TotalVolumeEntities() const;            239     G4int TotalVolumeEntities() const;
234       // Returns the total number of physical     240       // Returns the total number of physical volumes (replicated or placed)
235       // in the tree represented by the curren    241       // in the tree represented by the current logical volume.
236     inline EVolume CharacteriseDaughters() con    242     inline EVolume CharacteriseDaughters() const;
237       // Characterise the daughters of this lo    243       // Characterise the daughters of this logical volume.
238     inline EVolume DeduceDaughtersType() const << 244 
239       // Used by CharacteriseDaughters().      << 
240                                                << 
241     G4VSolid* GetSolid() const;                   245     G4VSolid* GetSolid() const;
242     void SetSolid(G4VSolid* pSolid);           << 246     void SetSolid(G4VSolid *pSolid);
243       // Gets and sets the current solid.         247       // Gets and sets the current solid.
244                                                   248 
245     G4Material* GetMaterial() const;              249     G4Material* GetMaterial() const;
246     void SetMaterial(G4Material* pMaterial);   << 250     void SetMaterial(G4Material *pMaterial);
247       // Gets and sets the current material.      251       // Gets and sets the current material.
248     void UpdateMaterial(G4Material* pMaterial) << 252     void UpdateMaterial(G4Material *pMaterial);
249       // Sets material and corresponding Mater    253       // Sets material and corresponding MaterialCutsCouple.
250       // This method is invoked by G4Navigator    254       // This method is invoked by G4Navigator while it is navigating through 
251       // material parameterization.               255       // material parameterization.
252     G4double GetMass(G4bool forced = false, G4 << 256     G4double GetMass(G4bool forced=false, G4bool propagate=true,
253                      G4Material* parMaterial = << 257                      G4Material* parMaterial=0);
254       // Returns the mass of the logical volum    258       // Returns the mass of the logical volume tree computed from the
255       // estimated geometrical volume of each     259       // estimated geometrical volume of each solid and material associated
256       // to the logical volume and (by default    260       // to the logical volume and (by default) to its daughters.
257       // NOTE: the computation may require a c    261       // NOTE: the computation may require a considerable amount of time,
258       //       depending from the complexity o    262       //       depending from the complexity of the geometry tree.
259       //       The returned value is cached an    263       //       The returned value is cached and can be used for successive
260       //       calls (default), unless recompu    264       //       calls (default), unless recomputation is forced by providing
261       //       'true' for the boolean argument    265       //       'true' for the boolean argument in input. Computation should
262       //       be forced if the geometry setup    266       //       be forced if the geometry setup has changed after the previous
263       //       call. By setting the 'propagate    267       //       call. By setting the 'propagate' boolean flag to 'false' the 
264       //       method returns the mass of the     268       //       method returns the mass of the present logical volume only 
265       //       (subtracted for the volume occu    269       //       (subtracted for the volume occupied by the daughter volumes).
266       //       An optional argument to specify    270       //       An optional argument to specify a material is also provided.
267     void ResetMass();                             271     void ResetMass(); 
268       // Ensure that cached value of Mass is i    272       // Ensure that cached value of Mass is invalidated - due to change in 
269       //  state, e.g. change of size of Solid,    273       //  state, e.g. change of size of Solid, change of type of solid,
270       //              or the addition/deletion    274       //              or the addition/deletion of a daughter volume. 
271                                                   275  
272     G4FieldManager* GetFieldManager() const;      276     G4FieldManager* GetFieldManager() const;
273       // Gets current FieldManager.               277       // Gets current FieldManager.
274     void SetFieldManager(G4FieldManager* pFiel << 278     void SetFieldManager(G4FieldManager *pFieldMgr, G4bool forceToAllDaughters); 
275       // Sets FieldManager and propagates it:     279       // Sets FieldManager and propagates it:
276       //  i) only to daughters with G4FieldMan << 280       //  i) only to daughters with G4FieldManager = 0
277       //     if forceToAllDaughters=false         281       //     if forceToAllDaughters=false
278       // ii) to all daughters                     282       // ii) to all daughters
279       //     if forceToAllDaughters=true          283       //     if forceToAllDaughters=true
280                                                   284 
281     G4VSensitiveDetector* GetSensitiveDetector    285     G4VSensitiveDetector* GetSensitiveDetector() const;
282       // Gets current SensitiveDetector.          286       // Gets current SensitiveDetector.
283     void SetSensitiveDetector(G4VSensitiveDete << 287     void SetSensitiveDetector(G4VSensitiveDetector *pSDetector);
284       // Sets SensitiveDetector (can be nullpt << 288       // Sets SensitiveDetector (can be 0).
285                                                   289 
286     inline G4UserLimits* GetUserLimits() const    290     inline G4UserLimits* GetUserLimits() const;
287     inline void SetUserLimits(G4UserLimits *pU    291     inline void SetUserLimits(G4UserLimits *pULimits);
288       // Gets and sets current UserLimits.        292       // Gets and sets current UserLimits.
289                                                   293 
290     inline G4SmartVoxelHeader* GetVoxelHeader(    294     inline G4SmartVoxelHeader* GetVoxelHeader() const;
291     inline void SetVoxelHeader(G4SmartVoxelHea    295     inline void SetVoxelHeader(G4SmartVoxelHeader *pVoxel);
292       // Gets and sets current VoxelHeader.       296       // Gets and sets current VoxelHeader.
293                                                   297     
294     inline G4double GetSmartless() const;         298     inline G4double GetSmartless() const;
295     inline void SetSmartless(G4double s);         299     inline void SetSmartless(G4double s);
296       // Gets and sets user defined optimisati    300       // Gets and sets user defined optimisation quality.
297                                                   301 
298     inline G4bool IsToOptimise() const;           302     inline G4bool IsToOptimise() const;
299       // Replies if geometry optimisation (vox    303       // Replies if geometry optimisation (voxelisation) is to be
300       // applied for this volume hierarchy.       304       // applied for this volume hierarchy.
301     inline void SetOptimisation(G4bool optim);    305     inline void SetOptimisation(G4bool optim);
302       // Specifies if to apply or not geometry    306       // Specifies if to apply or not geometry optimisation to this
303       // volume hierarchy. Note that for param    307       // volume hierarchy. Note that for parameterised volumes in the
304       // hierarchy, optimisation is always app    308       // hierarchy, optimisation is always applied. 
305                                                   309 
306     inline G4bool IsRootRegion() const;           310     inline G4bool IsRootRegion() const;
307       // Replies if the logical volume represe    311       // Replies if the logical volume represents a root region or not.
308     inline void SetRegionRootFlag(G4bool rreg)    312     inline void SetRegionRootFlag(G4bool rreg);
309       // Sets/unsets the volume as a root regi    313       // Sets/unsets the volume as a root region for cuts.
310     inline G4bool IsRegion() const;               314     inline G4bool IsRegion() const;
311       // Replies if the logical volume is part    315       // Replies if the logical volume is part of a cuts region or not.
312     inline void SetRegion(G4Region* reg);         316     inline void SetRegion(G4Region* reg);
313       // Sets/unsets the volume as cuts region    317       // Sets/unsets the volume as cuts region.
314     inline G4Region* GetRegion() const;           318     inline G4Region* GetRegion() const;
315       // Return the region to which the volume    319       // Return the region to which the volume belongs, if any.
316     inline void PropagateRegion();                320     inline void PropagateRegion();
317       // Propagates region pointer to daughter    321       // Propagates region pointer to daughters.
318                                                   322 
319     const G4MaterialCutsCouple* GetMaterialCut    323     const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
320     void SetMaterialCutsCouple(G4MaterialCutsC    324     void SetMaterialCutsCouple(G4MaterialCutsCouple* cuts);
321       // Accessors for production cuts.           325       // Accessors for production cuts.
322                                                   326 
323     G4bool operator == (const G4LogicalVolume&    327     G4bool operator == (const G4LogicalVolume& lv) const;
324       // Equality defined by address only.        328       // Equality defined by address only.
325       // Returns true if objects are at same a    329       // Returns true if objects are at same address, else false.
326                                                   330 
327     const G4VisAttributes* GetVisAttributes () << 331     inline const G4VisAttributes* GetVisAttributes () const;
328     void SetVisAttributes (const G4VisAttribut << 332     inline void  SetVisAttributes (const G4VisAttributes* pVA);
329     void SetVisAttributes (const G4VisAttribut << 333     void  SetVisAttributes (const G4VisAttributes& VA);
330       // Gets and sets visualization attribute << 334       // Gets and sets visualization attributes. A copy of 'VA' on the heap
331       // Arguments are converted to shared_ptr << 335       // will be made in the case the call with a const reference is used.
332                                                   336 
333     inline G4FastSimulationManager* GetFastSim    337     inline G4FastSimulationManager* GetFastSimulationManager () const;
334       // Gets current FastSimulationManager po    338       // Gets current FastSimulationManager pointer if exists, otherwise null.
335                                                   339 
336     inline void SetBiasWeight (G4double w);       340     inline void SetBiasWeight (G4double w);
337     inline G4double GetBiasWeight() const;        341     inline G4double GetBiasWeight() const;
338       // Sets and gets bias weight.               342       // Sets and gets bias weight.
339                                                   343 
340   public:                                      << 344   public:  // without description
341                                                   345 
342     G4LogicalVolume(__void__&);                   346     G4LogicalVolume(__void__&);
343       // Fake default constructor for usage re    347       // Fake default constructor for usage restricted to direct object
344       // persistency for clients requiring pre    348       // persistency for clients requiring preallocation of memory for
345       // persistifiable objects.                  349       // persistifiable objects.
346                                                   350 
347     virtual G4bool IsExtended() const;            351     virtual G4bool IsExtended() const;
348       // Return true if it is not a base-class    352       // Return true if it is not a base-class object.
349                                                   353 
350     inline G4FieldManager* GetMasterFieldManag    354     inline G4FieldManager* GetMasterFieldManager() const;
351       // Gets current FieldManager for the mas    355       // Gets current FieldManager for the master thread.
352     inline G4VSensitiveDetector* GetMasterSens    356     inline G4VSensitiveDetector* GetMasterSensitiveDetector() const;
353       // Gets current SensitiveDetector for th    357       // Gets current SensitiveDetector for the master thread.
354     inline G4VSolid* GetMasterSolid() const;      358     inline G4VSolid* GetMasterSolid() const;
355       // Gets current Solid for the master thr    359       // Gets current Solid for the master thread.
356                                                   360   
357     inline G4int GetInstanceID() const;           361     inline G4int GetInstanceID() const;
358       // Returns the instance ID.                 362       // Returns the instance ID.
359                                                   363 
360     static const G4LVManager& GetSubInstanceMa    364     static const G4LVManager& GetSubInstanceManager();
361       // Returns the private data instance man    365       // Returns the private data instance manager.
362                                                   366 
363     static void Clean();                          367     static void Clean();
364       // Clear memory allocated by sub-instanc    368       // Clear memory allocated by sub-instance manager.
365                                                   369 
366     inline void Lock();                           370     inline void Lock();
367       // Set lock identifier for final deletio    371       // Set lock identifier for final deletion of entity.
368                                                   372 
369     void InitialiseWorker(G4LogicalVolume* ptr << 373     void InitialiseWorker(G4LogicalVolume *ptrMasterObject,
370                           G4VSolid* pSolid, G4    374                           G4VSolid* pSolid, G4VSensitiveDetector* pSDetector);
371       // This method is similar to the constru    375       // This method is similar to the constructor. It is used by each worker
372       // thread to achieve the partial effect     376       // thread to achieve the partial effect as that of the master thread.
373                                                   377 
374     void TerminateWorker(G4LogicalVolume* ptrM << 378     void TerminateWorker(G4LogicalVolume *ptrMasterObject);
375       // This method is similar to the destruc    379       // This method is similar to the destructor. It is used by each worker
376       // thread to achieve the partial effect     380       // thread to achieve the partial effect as that of the master thread.
377                                                   381 
378     void AssignFieldManager(G4FieldManager* fl << 382     void AssignFieldManager( G4FieldManager *fldMgr);
379       // Set the FieldManager - only at this l    383       // Set the FieldManager - only at this level (do not push down hierarchy)
380                                                   384   
381     static G4VSolid* GetSolid(G4LVData& instLV << 385     static G4VSolid* GetSolid(G4LVData &instLVdata) ; // const;
382     static void SetSolid(G4LVData& instLVdata, << 386     static void SetSolid(G4LVData &instLVdata, G4VSolid *pSolid);
383       // Optimised Methods - passing thread in    387       // Optimised Methods - passing thread instance of worker data
384                                                   388 
385     G4bool ChangeDaughtersType(EVolume atype); << 
386       // Change the type of the daughters volu << 
387       // Meant for the user who wants to use t << 
388       // the contents of a volume.             << 
389       // Returns: success (true) or failure (f << 
390                                                << 
391   private:                                        389   private:
392                                                   390 
393     using G4PhysicalVolumeList = std::vector<G << 391     G4LogicalVolume(const G4LogicalVolume&);
                                                   >> 392     G4LogicalVolume& operator=(const G4LogicalVolume&);
                                                   >> 393       // Private copy-constructor and assignment operator.
394                                                   394 
395     G4GEOM_DLL static G4LVManager subInstanceM << 395   private:
396       // This new field helps to use the class << 396 
                                                   >> 397     // Data members:   
397                                                   398 
398     G4PhysicalVolumeList fDaughters;              399     G4PhysicalVolumeList fDaughters;
399       // Vector of daughters. Given initial si    400       // Vector of daughters. Given initial size of 0.
400     G4String fName;                               401     G4String fName;
401       // Name of logical volume.                  402       // Name of logical volume.
402     G4UserLimits* fUserLimits = nullptr;       << 403       // Pointer (possibly 0) to `Hit' object.
403       // Pointer (possibly nullptr) to user St << 404 
404     G4SmartVoxelHeader* fVoxel = nullptr;      << 405     G4UserLimits* fUserLimits;
405       // Pointer (possibly nullptr) to optimis << 406       // Pointer (possibly 0) to user Step limit object for this node.
406     G4double fSmartless = 2.0;                 << 407     G4SmartVoxelHeader* fVoxel;
                                                   >> 408       // Pointer (possibly 0) to optimisation info objects.
                                                   >> 409     G4bool fOptimise;
                                                   >> 410       // Flag to identify if optimisation should be applied or not.
                                                   >> 411     G4bool fRootRegion;
                                                   >> 412       // Flag to identify if the logical volume is a root region.
                                                   >> 413     G4bool fLock;
                                                   >> 414       // Flag to identify if entity is locked for final deletion.
                                                   >> 415     G4double fSmartless;
407       // Quality for optimisation, average num    416       // Quality for optimisation, average number of voxels to be spent
408       // per content.                             417       // per content.
409     G4Region* fRegion = nullptr;               << 418     const G4VisAttributes* fVisAttributes;
410       // Pointer to the cuts region (if any).  << 419       // Pointer (possibly 0) to visualization attributes.
411     G4double fBiasWeight = 1.0;                << 420     G4Region* fRegion;
                                                   >> 421       // Pointer to the cuts region (if any)
                                                   >> 422     G4double fBiasWeight;
412       // Weight used in the event biasing tech    423       // Weight used in the event biasing technique.
413     std::shared_ptr<const G4VisAttributes> fVi << 424   
414       // Pointer to visualization attributes.  << 425     G4int instanceID;
                                                   >> 426       // This new field is used as instance ID.
                                                   >> 427     G4GEOM_DLL static G4LVManager subInstanceManager;
                                                   >> 428       // This new field helps to use the class G4LVManager introduced above.    
415                                                   429 
416     // Shadow of master pointers.                 430     // Shadow of master pointers.
417     // Each worker thread can access this fiel    431     // Each worker thread can access this field from the master thread
418     // through these pointers.                    432     // through these pointers.
419     //                                            433     //
420     G4VSolid* fSolid = nullptr;                << 434     G4VSolid* fSolid;
421     G4VSensitiveDetector* fSensitiveDetector = << 435     G4VSensitiveDetector* fSensitiveDetector;
422     G4FieldManager* fFieldManager = nullptr;   << 436     G4FieldManager* fFieldManager;
423     G4LVData* lvdata = nullptr;  // For use of << 437     G4LVData* lvdata;  // For use of object persistency
424                                                << 
425     G4int instanceID;                          << 
426       // This new field is used as instance ID << 
427     EVolume fDaughtersVolumeType;              << 
428       // Are contents of volume placements, re << 
429     G4bool fOptimise = true;                   << 
430       // Flag to identify if optimisation shou << 
431     G4bool fRootRegion = false;                << 
432       // Flag to identify if the logical volum << 
433     G4bool fLock = false;                      << 
434       // Flag to identify if entity is locked  << 
435 };                                                438 };
436                                                   439 
437 #include "G4LogicalVolume.icc"                    440 #include "G4LogicalVolume.icc"
438                                                   441 
439 #endif                                            442 #endif
440                                                   443