Changeset 1347 for trunk/source/event/include/G4SPSEneDistribution.hh
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/event/include/G4SPSEneDistribution.hh
r1315 r1347 144 144 #include "G4SPSRandomGenerator.hh" 145 145 146 class G4SPSEneDistribution 147 { 146 class G4SPSEneDistribution { 148 147 public: 149 G4SPSEneDistribution (); 150 ~G4SPSEneDistribution (); 151 152 void SetEnergyDisType(G4String); 153 inline G4String GetEnergyDisType() {return EnergyDisType;}; 154 void SetEmin(G4double); 155 inline G4double GetEmin() {return Emin;} ; 156 inline G4double GetArbEmin() {return ArbEmin;} ; 157 void SetEmax(G4double); 158 inline G4double GetEmax() {return Emax;} ; 159 inline G4double GetArbEmax() {return ArbEmax;}; 160 void SetMonoEnergy(G4double); 161 void SetAlpha(G4double); 162 void SetTemp(G4double); 163 void SetBeamSigmaInE(G4double); 164 void SetEzero(G4double); 165 void SetGradient(G4double); 166 void SetInterCept(G4double); 167 void UserEnergyHisto(G4ThreeVector); 168 void ArbEnergyHisto(G4ThreeVector); 169 void EpnEnergyHisto(G4ThreeVector); 170 171 void InputEnergySpectra(G4bool); 172 void InputDifferentialSpectra(G4bool); 173 void ArbInterpolate(G4String); 174 inline G4String GetIntType() {return IntType;}; 175 void Calculate(); 176 // 177 void SetBiasRndm(G4SPSRandomGenerator* a) {eneRndm = a; }; 178 // method to re-set the histograms 179 void ReSetHist(G4String); 180 // Set the verbosity level. 181 void SetVerbosity(G4int a) {verbosityLevel = a; } ; 182 //x 183 184 G4double GetMonoEnergy () {return MonoEnergy; }; //Mono-energteic energy 185 G4double GetSE() {return SE;}; // Standard deviation for Gaussion distrbution in energy 186 G4double Getalpha () {return alpha;}; // alpha (pow) 187 G4double GetEzero() {return Ezero;}; // E0 (exp) 188 G4double GetTemp() {return Temp;}; // Temp (bbody,brem) 189 G4double Getgrad() {return grad;}; // gradient and intercept for linear spectra 190 G4double Getcept() {return cept;}; 191 192 inline G4PhysicsOrderedFreeVector GetUserDefinedEnergyHisto(){return UDefEnergyH;}; 193 inline G4PhysicsOrderedFreeVector GetArbEnergyHisto(){return ArbEnergyH;}; 194 195 G4double GenerateOne(G4ParticleDefinition*); 196 148 G4SPSEneDistribution(); 149 ~G4SPSEneDistribution(); 150 151 void SetEnergyDisType(G4String); 152 inline G4String GetEnergyDisType() { 153 return EnergyDisType; 154 } 155 ; 156 void SetEmin(G4double); 157 inline G4double GetEmin() { 158 return Emin; 159 } 160 ; 161 inline G4double GetArbEmin() { 162 return ArbEmin; 163 } 164 ; 165 void SetEmax(G4double); 166 inline G4double GetEmax() { 167 return Emax; 168 } 169 ; 170 inline G4double GetArbEmax() { 171 return ArbEmax; 172 } 173 ; 174 void SetMonoEnergy(G4double); 175 void SetAlpha(G4double); 176 void SetBiasAlpha(G4double); 177 void SetTemp(G4double); 178 void SetBeamSigmaInE(G4double); 179 void SetEzero(G4double); 180 void SetGradient(G4double); 181 void SetInterCept(G4double); 182 void UserEnergyHisto(G4ThreeVector); 183 void ArbEnergyHisto(G4ThreeVector); 184 void ArbEnergyHistoFile(G4String); 185 void EpnEnergyHisto(G4ThreeVector); 186 187 void InputEnergySpectra(G4bool); 188 void InputDifferentialSpectra(G4bool); 189 void ArbInterpolate(G4String); 190 inline G4String GetIntType() { 191 return IntType; 192 } 193 ; 194 void Calculate(); 195 // 196 void SetBiasRndm(G4SPSRandomGenerator* a) { 197 eneRndm = a; 198 } 199 ; 200 // method to re-set the histograms 201 void ReSetHist(G4String); 202 // Set the verbosity level. 203 void SetVerbosity(G4int a) { 204 verbosityLevel = a; 205 } 206 ; 207 //x 208 G4double GetWeight() { 209 return weight; 210 } 211 212 G4double GetMonoEnergy() { 213 return MonoEnergy; 214 } 215 ; //Mono-energteic energy 216 G4double GetSE() { 217 return SE; 218 } 219 ; // Standard deviation for Gaussion distrbution in energy 220 G4double Getalpha() { 221 return alpha; 222 } 223 ; // alpha (pow) 224 G4double GetEzero() { 225 return Ezero; 226 } 227 ; // E0 (exp) 228 G4double GetTemp() { 229 return Temp; 230 } 231 ; // Temp (bbody,brem) 232 G4double Getgrad() { 233 return grad; 234 } 235 ; // gradient and intercept for linear spectra 236 G4double Getcept() { 237 return cept; 238 } 239 ; 240 241 inline G4PhysicsOrderedFreeVector GetUserDefinedEnergyHisto() { 242 return UDefEnergyH; 243 } 244 ; 245 inline G4PhysicsOrderedFreeVector GetArbEnergyHisto() { 246 return ArbEnergyH; 247 } 248 ; 249 250 G4double GenerateOne(G4ParticleDefinition*); 251 G4double GetProbability (G4double); 252 253 197 254 private: 198 void LinearInterpolation(); 199 void LogInterpolation(); 200 void ExpInterpolation(); 201 void SplineInterpolation(); 202 void CalculateCdgSpectrum(); 203 void CalculateBbodySpectrum(); 204 205 // The following methods generate energies according to the spectral 206 // parameters defined above. 207 void GenerateMonoEnergetic(); 208 void GenerateLinearEnergies(G4bool); 209 void GeneratePowEnergies(G4bool); 210 void GenerateExpEnergies(G4bool ); 211 void GenerateGaussEnergies(); 212 void GenerateBremEnergies(); 213 void GenerateBbodyEnergies(); 214 void GenerateCdgEnergies(); 215 void GenUserHistEnergies(); 216 void GenEpnHistEnergies(); 217 void GenArbPointEnergies(); 218 // converts energy per nucleon to energy. 219 void ConvertEPNToEnergy(); 255 void LinearInterpolation(); 256 void LogInterpolation(); 257 void ExpInterpolation(); 258 void SplineInterpolation(); 259 void CalculateCdgSpectrum(); 260 void CalculateBbodySpectrum(); 261 262 // The following methods generate energies according to the spectral 263 // parameters defined above. 264 void GenerateMonoEnergetic(); 265 void GenerateLinearEnergies(G4bool); 266 void GeneratePowEnergies(G4bool); 267 void GenerateBiasPowEnergies(); 268 void GenerateExpEnergies(G4bool); 269 void GenerateGaussEnergies(); 270 void GenerateBremEnergies(); 271 void GenerateBbodyEnergies(); 272 void GenerateCdgEnergies(); 273 void GenUserHistEnergies(); 274 void GenEpnHistEnergies(); 275 void GenArbPointEnergies(); 276 // converts energy per nucleon to energy. 277 void ConvertEPNToEnergy(); 278 220 279 221 280 private: 222 281 223 G4String EnergyDisType; // energy dis type Variable - Mono,Lin,Exp,etc 224 G4double MonoEnergy; //Mono-energteic energy 225 G4double SE ; // Standard deviation for Gaussion distrbution in energy 226 G4double Emin, Emax; // emin and emax 227 G4double alpha, Ezero, Temp; // alpha (pow), E0 (exp) and Temp (bbody,brem) 228 G4double grad, cept; // gradient and intercept for linear spectra 229 G4bool EnergySpec; // true - energy spectra, false - momentum spectra 230 G4bool DiffSpec; // true - differential spec, false integral spec 231 G4bool ApplyRig; // false no rigidity cutoff, true then apply one 232 G4double ERig; // energy of rigidity cutoff 233 G4PhysicsOrderedFreeVector UDefEnergyH; // energy hist data 234 G4PhysicsOrderedFreeVector IPDFEnergyH; 235 G4bool IPDFEnergyExist, IPDFArbExist, Epnflag; 236 G4PhysicsOrderedFreeVector ArbEnergyH; // Arb x,y histogram 237 G4PhysicsOrderedFreeVector IPDFArbEnergyH; // IPDF for Arb 238 G4PhysicsOrderedFreeVector EpnEnergyH; 239 G4double CDGhist[3]; // cumulative histo for cdg 240 G4double BBHist[10001], Bbody_x[10001]; 241 G4String IntType; // Interpolation type 242 G4double Arb_grad[1024], Arb_cept[1024]; // grad and cept for 1024 segments 243 G4double Arb_alpha[1024], Arb_Const[1024]; // alpha and constants 244 G4double Arb_ezero[1024]; // ezero 245 G4double ArbEmin, ArbEmax; // Emin and Emax for the whole arb distribution used primarily for debug. 246 247 G4double particle_energy; 248 G4ParticleDefinition* particle_definition; 249 250 G4SPSRandomGenerator* eneRndm; 251 252 // Verbosity 253 G4int verbosityLevel; 254 255 G4PhysicsOrderedFreeVector ZeroPhysVector ; // for re-set only 256 257 G4DataInterpolation *SplineInt; // holds Spline stuff 282 G4String EnergyDisType; // energy dis type Variable - Mono,Lin,Exp,etc 283 G4double weight; // particle weight 284 G4double MonoEnergy; //Mono-energteic energy 285 G4double SE; // Standard deviation for Gaussion distrbution in energy 286 G4double Emin, Emax; // emin and emax 287 G4double alpha, Ezero, Temp; // alpha (pow), E0 (exp) and Temp (bbody,brem) 288 G4double biasalpha; // biased power index 289 G4double grad, cept; // gradient and intercept for linear spectra 290 G4double prob_norm; // normalisation factor use in calculate the probability 291 G4bool Biased; // true - biased to power-law 292 G4bool EnergySpec; // true - energy spectra, false - momentum spectra 293 G4bool DiffSpec; // true - differential spec, false integral spec 294 G4bool ApplyRig; // false no rigidity cutoff, true then apply one 295 G4double ERig; // energy of rigidity cutoff 296 G4PhysicsOrderedFreeVector UDefEnergyH; // energy hist data 297 G4PhysicsOrderedFreeVector IPDFEnergyH; 298 G4bool IPDFEnergyExist, IPDFArbExist, Epnflag; 299 G4PhysicsOrderedFreeVector ArbEnergyH; // Arb x,y histogram 300 G4PhysicsOrderedFreeVector IPDFArbEnergyH; // IPDF for Arb 301 G4PhysicsOrderedFreeVector EpnEnergyH; 302 G4double CDGhist[3]; // cumulative histo for cdg 303 G4double BBHist[10001], Bbody_x[10001]; 304 G4String IntType; // Interpolation type 305 G4double Arb_grad[1024], Arb_cept[1024]; // grad and cept for 1024 segments 306 G4double Arb_alpha[1024], Arb_Const[1024]; // alpha and constants 307 G4double Arb_ezero[1024]; // ezero 308 G4double ArbEmin, ArbEmax; // Emin and Emax for the whole arb distribution used primarily for debug. 309 310 G4double particle_energy; 311 G4ParticleDefinition* particle_definition; 312 313 G4SPSRandomGenerator* eneRndm; 314 315 // Verbosity 316 G4int verbosityLevel; 317 318 G4PhysicsOrderedFreeVector ZeroPhysVector; // for re-set only 319 320 G4DataInterpolation *SplineInt[1024]; // holds Spline stuff required for sampling 321 G4DataInterpolation *Splinetemp; // holds a temp Spline used for calculating area 258 322 259 323 }; 260 324 261 262 325 #endif 263 326 264 265 266
Note: See TracChangeset
for help on using the changeset viewer.