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