Geant4 Cross Reference |
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 // G4MaterialCutsCouple << 27 // 26 // 28 // Class description: << 29 // 27 // 30 // The same material can be used in regions wi << 28 // 31 // and physics processes must prepare several << 29 // ------------------------------------------------------------ 32 // for that material. << 30 // GEANT 4 class header file 33 // The G4ProductionCutsTable has G4MaterialCut << 31 // 34 // which consists of a material paired with a << 32 // 35 // G4MaterialCutsCouples objects are numbered << 33 // Class Description 36 // same as the index of a G4PhysicsVector for << 34 // This class is 37 // G4MaterialCutsCouple in the G4PhysicsTable. << 35 // 38 // The list of G4MaterialCutsCouple objects us << 36 // ------------------------------------------------------------ 39 // is updated before starting the event loop i << 37 // First Implementation 17 Sep. 2002 H.Kurahige 40 << 38 // ------------------------------------------------------------ 41 // Author: H.Kurashige, 17 September 2002 - Fi << 39 42 // ------------------------------------------- << 40 #ifndef G4MaterialCutsCouple_h 43 #ifndef G4MaterialCutsCouple_hh << 41 #define G4MaterialCutsCouple_h 1 44 #define G4MaterialCutsCouple_hh 1 << 45 42 46 #include "globals.hh" 43 #include "globals.hh" 47 #include "G4ios.hh" 44 #include "G4ios.hh" 48 #include "G4ProductionCuts.hh" << 49 45 50 class G4Material; 46 class G4Material; >> 47 #include "G4ProductionCuts.hh" 51 48 52 class G4MaterialCutsCouple 49 class G4MaterialCutsCouple 53 { 50 { 54 public: << 51 public: // with description >> 52 // constructor >> 53 G4MaterialCutsCouple(); >> 54 G4MaterialCutsCouple(const G4Material*, G4ProductionCuts* cut=0); 55 55 56 G4MaterialCutsCouple(); << 56 // copy constructor 57 G4MaterialCutsCouple(const G4Material*, G4 << 57 G4MaterialCutsCouple(const G4MaterialCutsCouple &right); 58 // Constructors << 59 58 60 virtual ~G4MaterialCutsCouple(); << 59 G4MaterialCutsCouple & operator=(const G4MaterialCutsCouple &right); 61 // Destructor << 62 60 63 G4MaterialCutsCouple(const G4MaterialCutsC << 61 public: 64 G4MaterialCutsCouple& operator=(const G4Ma << 62 // destructor 65 // Copy constructor & assignment operato << 63 virtual ~G4MaterialCutsCouple(); 66 64 67 G4bool operator==(const G4MaterialCutsCoup << 65 // equal opperators 68 G4bool operator!=(const G4MaterialCutsCoup << 66 G4bool operator==(const G4MaterialCutsCouple &right) const; 69 // Equality operators << 67 G4bool operator!=(const G4MaterialCutsCouple &right) const; 70 68 71 void SetMaterial(const G4Material*); << 69 public: // with description 72 // Set pointer to material << 70 void SetMaterial(const G4Material*); >> 71 // Set pointer to material 73 72 74 const G4Material* GetMaterial() const; << 73 const G4Material* GetMaterial() const; 75 // Get pointer to material << 74 // Get pointer to material 76 75 77 void SetProductionCuts(G4ProductionCuts*); << 76 void SetProductionCuts(G4ProductionCuts*); 78 // Set pointer to production cuts << 77 // Set pointer to production cuts 79 78 80 G4ProductionCuts* GetProductionCuts() cons << 79 G4ProductionCuts* GetProductionCuts() const; 81 // Get pointer to production cuts << 80 // Get pointer to production cuts 82 81 83 G4bool IsRecalcNeeded() const; << 82 G4bool IsRecalcNeeded() const; 84 // Return true if cut and/or material ha << 83 // return true if cut and/or material has been modified 85 // after last calculation of PhysicsTabl << 84 // after last calculation of PhysicsTable 86 85 87 void PhysicsTableUpdated(); << 86 void PhysicsTableUpdated(); 88 // Inform end of calculation of Physics << 87 // inform end of calculation of PhysicsTable 89 88 90 void SetIndex(G4int idx); << 89 void SetIndex(G4int idx); 91 G4int GetIndex() const; << 90 G4int GetIndex() const; 92 // Set/Get the index number in G4Product << 91 // Set/Get the index number in G4ProductionCutsTable 93 92 94 void SetUseFlag(G4bool flg = true); << 93 void SetUseFlag(G4bool flg=true); 95 G4bool IsUsed() const; << 94 G4bool IsUsed() const; 96 95 97 private: 96 private: 98 << 97 G4bool isMaterialModified; 99 G4bool isMaterialModified = fal << 98 const G4Material* fMaterial; 100 const G4Material* fMaterial = nullptr; << 99 G4ProductionCuts* fCuts; 101 G4ProductionCuts* fCuts = nullptr; << 100 G4int indexNumber; 102 G4int indexNumber = -1; << 101 G4bool isUsedInGeometry; 103 G4bool isUsedInGeometry = false << 104 }; 102 }; 105 103 106 // ------------------ << 104 #include "G4ProductionCuts.hh" 107 // Inline methods << 108 // ------------------ << 109 << 110 inline 105 inline 111 void G4MaterialCutsCouple::SetIndex(G4int idx) << 106 void G4MaterialCutsCouple::SetIndex(G4int idx) 112 { << 107 { indexNumber = idx; } 113 indexNumber = idx; << 114 } << 115 108 116 inline 109 inline 117 G4int G4MaterialCutsCouple::GetIndex() const << 110 G4int G4MaterialCutsCouple::GetIndex() const 118 { << 111 { return indexNumber; } 119 return indexNumber; << 120 } << 121 112 122 inline 113 inline 123 void G4MaterialCutsCouple::SetUseFlag(G4bool f << 114 void G4MaterialCutsCouple::SetUseFlag(G4bool flg) 124 { << 115 { isUsedInGeometry = flg; } 125 isUsedInGeometry = flg; << 126 } << 127 116 128 inline 117 inline 129 G4bool G4MaterialCutsCouple::IsUsed() const << 118 G4bool G4MaterialCutsCouple::IsUsed() const 130 { << 119 { return isUsedInGeometry; } 131 return isUsedInGeometry; << 132 } << 133 120 134 inline 121 inline 135 void G4MaterialCutsCouple::SetProductionCuts(G << 122 void G4MaterialCutsCouple::SetProductionCuts(G4ProductionCuts* aCut) 136 { << 123 { fCuts = aCut; } 137 fCuts = aCut; << 138 } << 139 124 140 inline 125 inline 141 G4ProductionCuts* G4MaterialCutsCouple::GetPro << 126 G4ProductionCuts* G4MaterialCutsCouple::GetProductionCuts() const 142 { << 127 { return fCuts; } 143 return fCuts; << 144 } << 145 128 146 inline 129 inline 147 G4bool G4MaterialCutsCouple::operator==(const << 130 G4bool G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple &right) const 148 { 131 { 149 return (this == &right); 132 return (this == &right); 150 } 133 } 151 134 152 inline 135 inline 153 G4bool G4MaterialCutsCouple::operator!=(const << 136 G4bool G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple &right) const 154 { 137 { 155 return (this != &right); 138 return (this != &right); 156 } 139 } 157 140 158 inline 141 inline 159 void G4MaterialCutsCouple::SetMaterial(const << 142 void G4MaterialCutsCouple::SetMaterial(const G4Material* material) 160 { 143 { 161 fMaterial = material; 144 fMaterial = material; 162 isMaterialModified = true; 145 isMaterialModified = true; 163 } 146 } 164 147 165 inline 148 inline 166 const G4Material* G4MaterialCutsCouple::GetMat << 149 const G4Material* G4MaterialCutsCouple::GetMaterial() const 167 { 150 { 168 return fMaterial; 151 return fMaterial; 169 } 152 } 170 153 171 inline 154 inline 172 G4bool G4MaterialCutsCouple::IsRecalcNeeded() 155 G4bool G4MaterialCutsCouple::IsRecalcNeeded() const 173 { 156 { 174 G4bool isCutModified = false; 157 G4bool isCutModified = false; 175 if (fCuts != nullptr ) isCutModified = fCuts << 158 if (fCuts !=0 ) isCutModified = fCuts->IsModified(); 176 return (isMaterialModified || isCutModified) 159 return (isMaterialModified || isCutModified); 177 } 160 } 178 161 179 inline 162 inline 180 void G4MaterialCutsCouple::PhysicsTableUpdated << 163 void G4MaterialCutsCouple::PhysicsTableUpdated() 181 { 164 { 182 if (fCuts != nullptr ) fCuts->PhysicsTableUp << 165 if (fCuts !=0 ) fCuts->PhysicsTableUpdated(); 183 isMaterialModified = false; 166 isMaterialModified = false; 184 } 167 } 185 168 >> 169 186 #endif 170 #endif >> 171 >> 172 >> 173 >> 174 >> 175 >> 176 187 177