File indexing completed on 2025-01-18 09:58:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #ifndef G4MaterialCutsCouple_hh
0044 #define G4MaterialCutsCouple_hh 1
0045
0046 #include "globals.hh"
0047 #include "G4ios.hh"
0048 #include "G4ProductionCuts.hh"
0049
0050 class G4Material;
0051
0052 class G4MaterialCutsCouple
0053 {
0054 public:
0055
0056 G4MaterialCutsCouple();
0057 G4MaterialCutsCouple(const G4Material*, G4ProductionCuts* cut = nullptr);
0058
0059
0060 virtual ~G4MaterialCutsCouple();
0061
0062
0063 G4MaterialCutsCouple(const G4MaterialCutsCouple& right);
0064 G4MaterialCutsCouple& operator=(const G4MaterialCutsCouple& right);
0065
0066
0067 G4bool operator==(const G4MaterialCutsCouple& right) const;
0068 G4bool operator!=(const G4MaterialCutsCouple& right) const;
0069
0070
0071 void SetMaterial(const G4Material*);
0072
0073
0074 const G4Material* GetMaterial() const;
0075
0076
0077 void SetProductionCuts(G4ProductionCuts*);
0078
0079
0080 G4ProductionCuts* GetProductionCuts() const;
0081
0082
0083 G4bool IsRecalcNeeded() const;
0084
0085
0086
0087 void PhysicsTableUpdated();
0088
0089
0090 void SetIndex(G4int idx);
0091 G4int GetIndex() const;
0092
0093
0094 void SetUseFlag(G4bool flg = true);
0095 G4bool IsUsed() const;
0096
0097 private:
0098
0099 G4bool isMaterialModified = false;
0100 const G4Material* fMaterial = nullptr;
0101 G4ProductionCuts* fCuts = nullptr;
0102 G4int indexNumber = -1;
0103 G4bool isUsedInGeometry = false;
0104 };
0105
0106
0107
0108
0109
0110 inline
0111 void G4MaterialCutsCouple::SetIndex(G4int idx)
0112 {
0113 indexNumber = idx;
0114 }
0115
0116 inline
0117 G4int G4MaterialCutsCouple::GetIndex() const
0118 {
0119 return indexNumber;
0120 }
0121
0122 inline
0123 void G4MaterialCutsCouple::SetUseFlag(G4bool flg)
0124 {
0125 isUsedInGeometry = flg;
0126 }
0127
0128 inline
0129 G4bool G4MaterialCutsCouple::IsUsed() const
0130 {
0131 return isUsedInGeometry;
0132 }
0133
0134 inline
0135 void G4MaterialCutsCouple::SetProductionCuts(G4ProductionCuts* aCut)
0136 {
0137 fCuts = aCut;
0138 }
0139
0140 inline
0141 G4ProductionCuts* G4MaterialCutsCouple::GetProductionCuts() const
0142 {
0143 return fCuts;
0144 }
0145
0146 inline
0147 G4bool G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple& right) const
0148 {
0149 return (this == &right);
0150 }
0151
0152 inline
0153 G4bool G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple& right) const
0154 {
0155 return (this != &right);
0156 }
0157
0158 inline
0159 void G4MaterialCutsCouple::SetMaterial(const G4Material* material)
0160 {
0161 fMaterial = material;
0162 isMaterialModified = true;
0163 }
0164
0165 inline
0166 const G4Material* G4MaterialCutsCouple::GetMaterial() const
0167 {
0168 return fMaterial;
0169 }
0170
0171 inline
0172 G4bool G4MaterialCutsCouple::IsRecalcNeeded() const
0173 {
0174 G4bool isCutModified = false;
0175 if (fCuts != nullptr ) isCutModified = fCuts->IsModified();
0176 return (isMaterialModified || isCutModified);
0177 }
0178
0179 inline
0180 void G4MaterialCutsCouple::PhysicsTableUpdated()
0181 {
0182 if (fCuts != nullptr ) fCuts->PhysicsTableUpdated();
0183 isMaterialModified = false;
0184 }
0185
0186 #endif