00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef G4ProductionCuts_h
00044 #define G4ProductionCuts_h 1
00045
00046 #include "globals.hh"
00047 #include "G4ios.hh"
00048 #include <vector>
00049 #include "G4ParticleDefinition.hh"
00050
00051 enum G4ProductionCutsIndex
00052 {
00053 idxG4GammaCut =0,
00054 idxG4ElectronCut,
00055 idxG4PositronCut,
00056
00057 idxG4ProtonCut,
00058
00059 NumberOfG4CutIndex
00060 };
00061
00062 class G4ProductionCuts
00063 {
00064 public:
00065
00066 G4ProductionCuts();
00067
00068
00069 G4ProductionCuts(const G4ProductionCuts &right);
00070
00071 G4ProductionCuts & operator=(const G4ProductionCuts &right);
00072
00073 public:
00074
00075 virtual ~G4ProductionCuts();
00076
00077
00078 G4int operator==(const G4ProductionCuts &right) const;
00079 G4int operator!=(const G4ProductionCuts &right) const;
00080
00081 public:
00082
00083 void SetProductionCut(G4double cut, G4int index = -1);
00084 void SetProductionCut(G4double cut, G4ParticleDefinition* ptcl);
00085 void SetProductionCut(G4double cut, const G4String& pName);
00086
00087
00088
00089 G4double GetProductionCut(G4int index) const;
00090
00091
00092 G4double GetProductionCut(const G4String& name) const;
00093
00094
00095 void SetProductionCuts(std::vector<G4double>&);
00096
00097
00098 const std::vector<G4double>& GetProductionCuts() const;
00099
00100
00101 G4bool IsModified() const;
00102
00103
00104
00105 void PhysicsTableUpdated();
00106
00107
00108 public:
00109 static G4int GetIndex(const G4String& name);
00110 static G4int GetIndex(const G4ParticleDefinition* ptcl);
00111
00112 protected:
00113 std::vector<G4double> fRangeCuts;
00114 G4bool isModified;
00115
00116 private:
00117 static const G4ParticleDefinition* gammaDef;
00118 static const G4ParticleDefinition* electDef;
00119 static const G4ParticleDefinition* positDef;
00120
00121 static const G4ParticleDefinition* protonDef;
00122
00123 };
00124
00125
00126 inline
00127 void G4ProductionCuts::SetProductionCut(G4double cut, G4int index)
00128 {
00129 if (index<0) {
00130 for(G4int i = 0; i < NumberOfG4CutIndex; i++) {
00131 fRangeCuts[i] = cut;
00132 }
00133 isModified = true;
00134
00135 } else if (index < NumberOfG4CutIndex) {
00136 fRangeCuts[index] = cut;
00137 isModified = true;
00138 }
00139 }
00140
00141 inline
00142 void G4ProductionCuts::SetProductionCut(G4double cut, G4ParticleDefinition* ptcl)
00143 {
00144 G4int idx = -1;
00145 if(ptcl) idx = GetIndex(ptcl);
00146 if(idx>=0) SetProductionCut(cut,idx);
00147 }
00148
00149 inline
00150 void G4ProductionCuts::SetProductionCut(G4double cut, const G4String& pName)
00151 {
00152 G4int idx = GetIndex(pName);
00153 if(idx>=0) SetProductionCut(cut,idx);
00154 }
00155
00156 inline
00157 G4double G4ProductionCuts::GetProductionCut(G4int index) const
00158 {
00159 G4double cut=-1.0;
00160 if ( (index>=0) && (index<NumberOfG4CutIndex) ) {
00161 cut = fRangeCuts[index];
00162 }
00163 return cut;
00164 }
00165
00166 inline
00167 G4double G4ProductionCuts::GetProductionCut(const G4String& name) const
00168 {
00169 return GetProductionCut(GetIndex(name));
00170 }
00171
00172
00173 inline
00174 const std::vector<G4double>& G4ProductionCuts::GetProductionCuts() const
00175 {
00176 return fRangeCuts;
00177 }
00178
00179 inline
00180 G4bool G4ProductionCuts::IsModified() const
00181 {
00182 return isModified;
00183 }
00184
00185 inline
00186 void G4ProductionCuts::PhysicsTableUpdated()
00187 {
00188 isModified = false;
00189 }
00190
00191 #endif
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202