|
||||
File indexing completed on 2025-01-18 09:59:12
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // G4TouchableHistory 0027 // 0028 // Class description: 0029 // 0030 // Object representing a touchable detector element, and its history in the 0031 // geometrical hierarchy, including its net resultant local->global transform. 0032 // 0033 // Touchables are objects capable of maintaining an 0034 // association between parts of the geometrical hierarchy (volumes 0035 // &/or solids) and their resultant transformation. 0036 // 0037 // Utilisation: 0038 // ----------- 0039 // A touchable is a geometrical volume (solid) which has a unique 0040 // placement in a detector description. It is an abstract base class which 0041 // can be implemented in a variety of ways. Each way must provide the 0042 // capabilities of obtaining the transformation and solid that is described 0043 // by the touchable. 0044 // 0045 // All touchable implementations must respond to the two following "requests": 0046 // 0047 // 1) GetTranslation and GetRotation that return the components of the 0048 // volume's transformation. 0049 // 0050 // 2) GetSolid that gives the solid of this touchable. 0051 // 0052 // 0053 // Additional capabilities are available from implementations with more 0054 // information. These have a default implementation that causes an exception. 0055 // 0056 // Several capabilities are available from touchables with physical volumes: 0057 // 0058 // 3) GetVolume gives the physical volume. 0059 // 0060 // 4) GetReplicaNumber or GetCopyNumber gives the copy number of the 0061 // physical volume, either if it is replicated or not. 0062 // 0063 // Touchables that store volume hierarchy (history) have the whole stack of 0064 // parent volumes available. Thus it is possible to add a little more state 0065 // in order to extend its functionality. We add a "pointer" to a level and a 0066 // member function to move the level in this stack. Then calling the above 0067 // member functions for another level, the information for that level can be 0068 // retrieved. 0069 // 0070 // The top of the history tree is, by convention, the world volume. 0071 // 0072 // 5) GetHistoryDepth gives the depth of the history tree. 0073 // 0074 // 6) GetReplicaNumber/GetCopyNumber, GetVolume, GetTranslation and 0075 // GetRotation each can be called with a depth argument. 0076 // They return the value of the respective level of the touchable. 0077 // 0078 // 7) MoveUpHistory(num) moves the current pointer inside the touchable 0079 // to point "num" levels up the history tree. Thus, eg, calling 0080 // it with num=1 will cause the internal pointer to move to the mother 0081 // of the current volume. 0082 // NOTE: this method MODIFIES the touchable. 0083 // 0084 // An update method, with different arguments is available, so that the 0085 // information in a touchable can be updated: 0086 // 0087 // 8) UpdateYourself takes a physical volume pointer and can additionally 0088 // take a NavigationHistory. 0089 0090 // Created: Paul Kent, August 1996 0091 // ---------------------------------------------------------------------- 0092 #ifndef G4TOUCHABLEHISTORY_HH 0093 #define G4TOUCHABLEHISTORY_HH 0094 0095 #include "G4NavigationHistory.hh" 0096 #include "G4Allocator.hh" 0097 #include "G4LogicalVolume.hh" 0098 #include "G4ThreeVector.hh" 0099 #include "G4RotationMatrix.hh" 0100 0101 #include "geomwdefs.hh" 0102 0103 class G4TouchableHistory 0104 { 0105 public: 0106 0107 G4TouchableHistory(); 0108 // The default constructor produces a touchable-history of 0109 // 'zero-depth', ie an "unphysical" and not very unusable one. 0110 // It is for initialisation only. 0111 0112 G4TouchableHistory( const G4NavigationHistory& history ); 0113 // Copy constructor 0114 0115 virtual ~G4TouchableHistory(); 0116 // Destructor 0117 0118 inline virtual G4VPhysicalVolume* GetVolume( G4int depth = 0 ) const; 0119 inline virtual G4VSolid* GetSolid( G4int depth = 0 ) const; 0120 virtual const G4ThreeVector& GetTranslation( G4int depth = 0 ) const; 0121 virtual const G4RotationMatrix* GetRotation( G4int depth = 0 ) const; 0122 0123 inline virtual G4int GetReplicaNumber( G4int depth = 0 ) const; 0124 inline G4int GetCopyNumber( G4int depth = 0 ) const; 0125 inline virtual G4int GetHistoryDepth() const; 0126 virtual G4int MoveUpHistory( G4int num_levels = 1 ); 0127 // Access methods for touchables with history 0128 0129 virtual void UpdateYourself( G4VPhysicalVolume* pPhysVol, 0130 const G4NavigationHistory* history = nullptr ); 0131 // Update methods for touchables with history 0132 0133 inline virtual const G4NavigationHistory* GetHistory() const; 0134 // Internal: used in G4Navigator::LocateGlobalPointAndSetup(). 0135 0136 inline void* operator new(std::size_t); 0137 inline void operator delete(void* aTH); 0138 // Override "new" and "delete" to use "G4Allocator". 0139 0140 private: 0141 0142 inline G4int CalculateHistoryIndex( G4int stackDepth ) const; 0143 0144 G4RotationMatrix frot; 0145 G4ThreeVector ftlate; 0146 G4NavigationHistory fhistory; 0147 }; 0148 0149 #include "G4TouchableHistory.icc" 0150 0151 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |