Ignore:
Timestamp:
Apr 17, 2009, 12:17:14 PM (15 years ago)
Author:
garnier
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh

    r961 r991  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.hh,v 1.66 2009/02/19 09:57:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565// 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio,
    6666//          CorrectionsAlongStep, ActivateNuclearStopping (VI)
    67 // 16-02-09 Move implementations of virtual methods to source (VI)
    6867//
    6968// Class Description:
     
    121120  //------------------------------------------------------------------------
    122121
     122  // dEdx per unit length
     123  virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
     124                               const G4ParticleDefinition*,
     125                               G4double kineticEnergy,
     126                               G4double cutEnergy = DBL_MAX);
     127
    123128  // main method to compute dEdx
    124129  virtual G4double ComputeDEDXPerVolume(const G4Material*,
     
    126131                                        G4double kineticEnergy,
    127132                                        G4double cutEnergy = DBL_MAX);
     133
     134  // cross section per volume
     135  virtual G4double CrossSection(const G4MaterialCutsCouple*,
     136                                const G4ParticleDefinition*,
     137                                G4double kineticEnergy,
     138                                G4double cutEnergy = 0.0,
     139                                G4double maxEnergy = DBL_MAX);
    128140
    129141  // main method to compute cross section per Volume
     
    163175                                    G4double length);
    164176
    165   // sample PIXE deexcitation
    166   virtual void SampleDeexcitationAlongStep(const G4Material*,
    167                                            const G4Track&,
    168                                            G4double& eloss);
    169 
    170177protected:
    171178
     
    205212                                  const G4DataVector&);
    206213
    207   // dEdx per unit length
    208   inline G4double ComputeDEDX(const G4MaterialCutsCouple*,
    209                               const G4ParticleDefinition*,
    210                               G4double kineticEnergy,
    211                               G4double cutEnergy = DBL_MAX);
    212 
    213   // cross section per volume
    214   inline G4double CrossSection(const G4MaterialCutsCouple*,
    215                                 const G4ParticleDefinition*,
    216                                 G4double kineticEnergy,
    217                                 G4double cutEnergy = 0.0,
    218                                 G4double maxEnergy = DBL_MAX);
    219 
    220214  // compute mean free path via cross section per volume
    221   inline G4double ComputeMeanFreePath(const G4ParticleDefinition*,
    222                                       G4double kineticEnergy,
    223                                       const G4Material*,   
    224                                       G4double cutEnergy = 0.0,
    225                                       G4double maxEnergy = DBL_MAX);
     215  G4double ComputeMeanFreePath(const G4ParticleDefinition*,
     216                               G4double kineticEnergy,
     217                               const G4Material*,   
     218                               G4double cutEnergy = 0.0,
     219                               G4double maxEnergy = DBL_MAX);
    226220
    227221  // generic cross section per element
     
    239233                                           G4double maxEnergy = DBL_MAX);
    240234
    241   // to select atom cross section per volume is recomputed for each element
     235  // this method can be used only in the case if generic method to compute
     236  // cross section per volume is used and not overwritten in derived class
    242237  inline const G4Element* SelectRandomAtom(const G4Material*,
    243238                                           const G4ParticleDefinition*,
     
    265260  inline G4bool LPMFlag() const;
    266261
    267   inline G4bool DeexcitationFlag() const;
    268 
    269262  inline void SetHighEnergyLimit(G4double);
    270263
     
    277270  inline void SetLPMFlag(G4bool val);
    278271
    279   inline void SetDeexcitationFlag(G4bool val);
    280 
    281272  inline void ActivateNuclearStopping(G4bool);
    282273
     
    287278  inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
    288279
    289   inline void SetCurrentCouple(const G4MaterialCutsCouple*);
    290 
    291280protected:
    292281
    293   inline const G4MaterialCutsCouple* CurrentCouple() const;
     282  inline const G4Element* GetCurrentElement() const;
    294283
    295284  inline void SetCurrentElement(const G4Element*);
    296 
    297   inline const G4Element* GetCurrentElement() const;
    298285
    299286private:
     
    328315private:
    329316
    330   const G4MaterialCutsCouple* currentCouple;
    331   const G4Element*            currentElement;
    332 
     317  const G4Element* currentElement;
    333318  G4int                  nsec;
    334   G4bool                 flagDeexcitation;
    335319  std::vector<G4double>  xsec;
    336320
     
    340324//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    341325
    342 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
    343                                         const G4ParticleDefinition* p,
    344                                         G4double kinEnergy,
    345                                         G4double cutEnergy)
    346 {
    347   currentCouple = c;
    348   return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
    349 }
    350 
    351 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    352 
    353 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
    354                                          const G4ParticleDefinition* p,
    355                                          G4double kinEnergy,
    356                                          G4double cutEnergy,
    357                                          G4double maxEnergy)
    358 {
    359   currentCouple = c;
    360   return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy);
    361 }
    362 
    363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    364 
    365 inline G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
    366                                                 G4double ekin,
    367                                                 const G4Material* material,     
    368                                                 G4double emin,
    369                                                 G4double emax)
    370 {
    371   G4double mfp = DBL_MAX;
    372   G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
    373   if (cross > DBL_MIN) mfp = 1./cross;
    374   return mfp;
     326inline G4double G4VEmModel::HighEnergyLimit() const
     327{
     328  return highLimit;
     329}
     330
     331//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     332
     333inline G4double G4VEmModel::LowEnergyLimit() const
     334{
     335  return lowLimit;
     336}
     337
     338//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     339
     340inline G4double G4VEmModel::PolarAngleLimit() const
     341{
     342  return polarAngleLimit;
     343}
     344
     345//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     346
     347inline G4double G4VEmModel::SecondaryThreshold() const
     348{
     349  return secondaryThreshold;
     350}
     351
     352//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     353
     354inline G4bool G4VEmModel::LPMFlag() const
     355{
     356  return theLPMflag;
     357}
     358
     359//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     360
     361inline void G4VEmModel::SetHighEnergyLimit(G4double val)
     362{
     363  highLimit = val;
     364}
     365
     366//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     367
     368inline void G4VEmModel::SetLowEnergyLimit(G4double val)
     369{
     370  lowLimit = val;
     371}
     372
     373//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     374
     375inline void G4VEmModel::SetPolarAngleLimit(G4double val)
     376{
     377  polarAngleLimit = val;
     378}
     379
     380//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     381
     382inline void G4VEmModel::SetSecondaryThreshold(G4double val)
     383{
     384  secondaryThreshold = val;
     385}
     386
     387//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     388
     389inline void G4VEmModel::SetLPMFlag(G4bool val)
     390{
     391  theLPMflag = val;
     392}
     393
     394//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     395
     396inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
     397{
     398  nuclearStopping = val;
    375399}
    376400
     
    391415//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    392416
     417inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 
     418                                          G4VEmFluctuationModel* f = 0)
     419{
     420  if(p && pParticleChange != p) pParticleChange = p;
     421  fluc = f;
     422}
     423
     424//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     425
     426
     427inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
     428{
     429  return fluc;
     430}
     431
     432//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     433
     434inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
     435                                         const G4MaterialCutsCouple*)
     436{
     437  return 0.0;
     438}
     439
     440//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     441
     442inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
     443                                                 const G4Material*, G4double)
     444{
     445  G4double q = p->GetPDGCharge()/CLHEP::eplus;
     446  return q*q;
     447}
     448
     449//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     450
     451inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
     452                                              const G4Material*, G4double)
     453{
     454  return p->GetPDGCharge();
     455}
     456
     457//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     458
     459inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
     460                                             const G4DynamicParticle*,
     461                                             G4double&,G4double&,G4double)
     462{}
     463
     464//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     465
     466inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
     467                                                 const G4ParticleDefinition*,
     468                                                 G4double,G4double)
     469{
     470  return 0.0;
     471}
     472
     473//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     474
     475inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
     476                                        const G4ParticleDefinition* p,
     477                                        G4double kinEnergy,
     478                                        G4double cutEnergy)
     479{
     480  return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
     481}
     482
     483//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     484
     485inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
     486                                         const G4ParticleDefinition* p,
     487                                         G4double kinEnergy,
     488                                         G4double cutEnergy,
     489                                         G4double maxEnergy)
     490{
     491  return CrossSectionPerVolume(c->GetMaterial(),p,
     492                               kinEnergy,cutEnergy,maxEnergy);
     493}
     494
     495//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     496
     497inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
     498                                         const G4ParticleDefinition*,
     499                                         G4double, G4double, G4double,
     500                                         G4double, G4double)
     501{
     502  return 0.0;
     503}
     504
     505//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     506
    393507inline
    394508const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple,
     
    398512                                              G4double maxEnergy)
    399513{
    400   currentCouple = couple;
    401514  if(nSelectors > 0) {
    402515    currentElement =
     
    458571//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    459572
    460 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
    461 {
    462   return fluc;
    463 }
    464 
    465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    466 
    467 inline G4double G4VEmModel::HighEnergyLimit() const
    468 {
    469   return highLimit;
    470 }
    471 
    472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    473 
    474 inline G4double G4VEmModel::LowEnergyLimit() const
    475 {
    476   return lowLimit;
    477 }
    478 
    479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    480 
    481 inline G4double G4VEmModel::PolarAngleLimit() const
    482 {
    483   return polarAngleLimit;
    484 }
    485 
    486 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    487 
    488 inline G4double G4VEmModel::SecondaryThreshold() const
    489 {
    490   return secondaryThreshold;
    491 }
    492 
    493 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    494 
    495 inline G4bool G4VEmModel::LPMFlag() const
    496 {
    497   return theLPMflag;
    498 }
    499 
    500 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    501 
    502 inline G4bool G4VEmModel::DeexcitationFlag() const
    503 {
    504   return flagDeexcitation;
    505 }
    506 
    507 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    508 
    509 inline void G4VEmModel::SetHighEnergyLimit(G4double val)
    510 {
    511   highLimit = val;
    512 }
    513 
    514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    515 
    516 inline void G4VEmModel::SetLowEnergyLimit(G4double val)
    517 {
    518   lowLimit = val;
    519 }
    520 
    521 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    522 
    523 inline void G4VEmModel::SetPolarAngleLimit(G4double val)
    524 {
    525   polarAngleLimit = val;
    526 }
    527 
    528 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    529 
    530 inline void G4VEmModel::SetSecondaryThreshold(G4double val)
    531 {
    532   secondaryThreshold = val;
    533 }
    534 
    535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    536 
    537 inline void G4VEmModel::SetLPMFlag(G4bool val)
    538 {
    539   theLPMflag = val;
    540 }
    541 
    542 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    543 
    544 inline void G4VEmModel::SetDeexcitationFlag(G4bool val)
    545 {
    546   flagDeexcitation = val;
    547 }
    548 
    549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    550 
    551 inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
    552 {
    553   nuclearStopping = val;
     573inline const G4Element* G4VEmModel::GetCurrentElement() const
     574{
     575  return currentElement;
     576}
     577
     578//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     579
     580inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
     581{
     582  currentElement = elm;
    554583}
    555584
     
    565594//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    566595
     596inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     597                                               G4double kineticEnergy)
     598{
     599  return kineticEnergy;
     600}
     601
     602//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     603
    567604inline const G4String& G4VEmModel::GetName() const
    568605{
     
    571608
    572609//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    573 
    574 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 
    575                                           G4VEmFluctuationModel* f = 0)
    576 {
    577   if(p && pParticleChange != p) pParticleChange = p;
    578   fluc = f;
    579 }
    580 
    581 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    582 
    583 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
    584 {
    585   currentCouple = p;
    586 }
    587 
    588 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    589 
    590 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
    591 {
    592   return currentCouple;
    593 }
    594 
    595 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    596 
    597 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
    598 {
    599   currentElement = elm;
    600 }
    601 
    602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    603 
    604 inline const G4Element* G4VEmModel::GetCurrentElement() const
    605 {
    606   return currentElement;
    607 }
     610// Methods for msc simulation
     611//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     612
     613inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double)
     614{}
     615
     616//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     617
     618inline G4double G4VEmModel::ComputeTruePathLengthLimit(
     619                                const G4Track&,
     620                                G4PhysicsTable*,
     621                                G4double)
     622{
     623  return DBL_MAX;
     624}
     625
     626//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     627
     628inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)
     629{
     630  return truePathLength;
     631}
     632
     633//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     634
     635inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)
     636{
     637  return geomPathLength;
     638}
     639
     640//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     641
     642inline void G4VEmModel::DefineForRegion(const G4Region*)
     643{}
     644
     645//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     646
     647inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
     648                                         const G4Material*, G4double)
     649{}
    608650
    609651//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset for help on using the changeset viewer.