Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

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

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmModel.hh,v 1.75 2010/05/26 10:41:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    150150
    151151  // Compute effective ion charge square
     152  virtual G4double ChargeSquareRatio(const G4Track&);
     153
     154  // Compute effective ion charge square
    152155  virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*,
    153156                                        const G4Material*,
     
    228231                                             G4double maxEnergy = DBL_MAX);
    229232
     233  // select isotope in order to have precise mass of the nucleus
     234  inline G4int SelectIsotopeNumber(const G4Element*);
     235
    230236  // atom can be selected effitiantly if element selectors are initialised
    231237  inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*,
     
    236242
    237243  // to select atom cross section per volume is recomputed for each element
    238   inline const G4Element* SelectRandomAtom(const G4Material*,
    239                                            const G4ParticleDefinition*,
    240                                            G4double kineticEnergy,
    241                                            G4double cutEnergy = 0.0,
    242                                            G4double maxEnergy = DBL_MAX);
    243 
    244   // select isotope in order to have precise mass of the nucleus
    245   inline G4int SelectIsotopeNumber(const G4Element*);
     244  const G4Element* SelectRandomAtom(const G4Material*,
     245                                    const G4ParticleDefinition*,
     246                                    G4double kineticEnergy,
     247                                    G4double cutEnergy = 0.0,
     248                                    G4double maxEnergy = DBL_MAX);
    246249
    247250  //------------------------------------------------------------------------
     
    291294  inline void SetCurrentCouple(const G4MaterialCutsCouple*);
    292295
     296  inline const G4Element* GetCurrentElement() const;
     297
    293298protected:
    294299
     
    296301
    297302  inline void SetCurrentElement(const G4Element*);
    298 
    299   inline const G4Element* GetCurrentElement() const;
    300303
    301304private:
     
    341344};
    342345
    343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     346// ======== Run time inline methods ================
     347
     348inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
     349{
     350  currentCouple = p;
     351}
     352
     353//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     354
     355inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
     356{
     357  return currentCouple;
     358}
     359
     360//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     361
     362inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
     363{
     364  currentElement = elm;
     365}
     366
     367//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     368
     369inline const G4Element* G4VEmModel::GetCurrentElement() const
     370{
     371  return currentElement;
     372}
     373
     374//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     375
     376inline
     377G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
     378{
     379  return MaxSecondaryEnergy(dynPart->GetDefinition(),
     380                            dynPart->GetKineticEnergy());
     381}
     382
    344383//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    345384
     
    375414  G4double mfp = DBL_MAX;
    376415  G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
    377   if (cross > DBL_MIN) mfp = 1./cross;
     416  if (cross > DBL_MIN) { mfp = 1./cross; }
    378417  return mfp;
    379418}
     
    415454//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    416455
    417 inline
    418 const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
    419                                               const G4ParticleDefinition* pd,
    420                                               G4double kinEnergy,
    421                                               G4double tcut,
    422                                               G4double tmax)
    423 {
    424   const G4ElementVector* theElementVector = material->GetElementVector();
    425   G4int n = material->GetNumberOfElements() - 1;
    426   currentElement = (*theElementVector)[n];
    427   if (n > 0) {
    428     G4double x = G4UniformRand()*
    429                  G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
    430     for(G4int i=0; i<n; i++) {
    431       if (x <= xsec[i]) {
    432         currentElement = (*theElementVector)[i];
    433         break;
    434       }
    435     }
    436   }
    437   return currentElement;
    438 }
    439 
    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    441 
    442456inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
    443457{
     
    450464      G4double* ab = elm->GetRelativeAbundanceVector();
    451465      G4double x = G4UniformRand();
    452       for(; idx<ni; idx++) {
     466      for(; idx<ni; ++idx) {
    453467        x -= ab[idx];
    454         if (x <= 0.0) break;
     468        if (x <= 0.0) { break; }
    455469      }
    456       if(idx >= ni) idx = ni - 1;
     470      if(idx >= ni) { idx = ni - 1; }
    457471    }
    458472    N = elm->GetIsotope(idx)->GetN();
     
    461475}
    462476
    463 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     477// ======== Get/Set inline methods used at initialisation ================
    464478
    465479inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
     
    578592{
    579593  nuclearStopping = val;
    580 }
    581 
    582 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    583 
    584 inline
    585 G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
    586 {
    587   return MaxSecondaryEnergy(dynPart->GetDefinition(),
    588                             dynPart->GetKineticEnergy());
    589594}
    590595
     
    601606                                          G4VEmFluctuationModel* f = 0)
    602607{
    603   if(p && pParticleChange != p) pParticleChange = p;
     608  if(p && pParticleChange != p) { pParticleChange = p; }
    604609  fluc = f;
    605610}
     
    607612//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    608613
    609 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
    610 {
    611   currentCouple = p;
    612 }
    613 
    614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    615 
    616 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
    617 {
    618   return currentCouple;
    619 }
    620 
    621 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    622 
    623 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
    624 {
    625   currentElement = elm;
    626 }
    627 
    628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    629 
    630 inline const G4Element* G4VEmModel::GetCurrentElement() const
    631 {
    632   return currentElement;
    633 }
    634 
    635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    636 
    637614#endif
    638615
Note: See TracChangeset for help on using the changeset viewer.