Changeset 1196 for trunk/source/track


Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

Location:
trunk/source/track
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/track/History

    r921 r1196  
    1 $Id: History,v 1.102 2008/10/24 08:22:20 kurasige Exp $
     1$Id: History,v 1.107 2009/10/19 09:37:00 kurasige Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19Oct. 19, 2009 Hisaya Kurashige (track-V09-02-04)
     20added a string prooperty to indicate type of UserTrackInformation
     21
     22
     23June 18, 2009 Hisaya Kurashige (track-V09-02-03)
     24added SetLowEnergyLimit method (Vladimir)
     25
     26
     27May.  27, 2009 Hisaya Kurashige (track-V09-02-02)
     28- Add lowEnergyLimit = 1 eV in lowEnergyLimit = 1 eV (Vladimir)
     29
     30Apr.  2, 2009 Hisaya Kurashige (track-V09-02-01)
     31- Add protection for the case mass==0 and T==0 in GetVelocity
     32
     33Apr.  2, 2009 Hisaya Kurashige (track-V09-02-00)
     34- Modify GetVelocity to improve performance
     35
    1936Oct. 24, 2008 Hisaya Kurashige (track-V09-01-02)
    2037- change fpCreatorProcess and fpLCAtVertex in G4Track to  'const' pointer   
  • trunk/source/track/include/G4ParticleChangeForLoss.hh

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleChangeForLoss.hh,v 1.20 2008/01/11 19:57:12 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleChangeForLoss.hh,v 1.22 2009/06/17 17:25:57 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    4242//                         and ProposeWeight for PostStep
    4343//   07.06.06 V.Ivanchenko RemoveProposedMomentumDirection from AlongStep
    44 //   28.08.06 V.Ivanchenko Add access to current track and polarizaion
     44//   28.08.06 V.Ivanchenko Added access to current track and polarizaion
     45//   17.06.09 V.Ivanchenko Added SetLowEnergyLimit method
    4546//
    4647// ------------------------------------------------------------
     
    108109  const G4Track* GetCurrentTrack() const;
    109110
     111  void SetLowEnergyLimit(G4double elimit);
     112
    110113  virtual void DumpInfo() const;
    111114
     
    125128  G4double proposedKinEnergy;
    126129  //  The final kinetic energy of the current particle.
     130
     131  G4double lowEnergyLimit;
     132  //  The limit kinetic energy below which particle is stopped
    127133
    128134  G4double currentCharge;
     
    263269
    264270  // update kinetic energy and charge
    265   if (kinEnergy < DBL_MIN) {
     271  if (kinEnergy < lowEnergyLimit) {
    266272    theLocalEnergyDeposit += kinEnergy;
    267273    kinEnergy = 0.0;
     
    311317}
    312318
     319inline void G4ParticleChangeForLoss::SetLowEnergyLimit(G4double elimit)
     320{
     321  lowEnergyLimit = elimit;
     322}
     323
    313324#endif
    314325
  • trunk/source/track/include/G4VUserTrackInformation.hh

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4VUserTrackInformation.hh,v 1.6 2006/06/29 21:14:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4VUserTrackInformation.hh,v 1.8 2009/10/19 17:11:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5757#define G4VUserTrackInformation_H 1
    5858
     59#include "globals.hh"
     60
    5961class G4VUserTrackInformation
    60 {
    61   public:
     62{ 
     63  public: // With Description
    6264    G4VUserTrackInformation();
     65    G4VUserTrackInformation(const G4String& infoType);
     66    // String is provided to indicate Type of UserTrackInfo class 
     67    // User is recommended to set the type of his/her class 
     68
    6369    virtual ~G4VUserTrackInformation();
    6470
    65   public:
    6671    virtual void Print() const = 0;
     72   
     73    const G4String& GetType() const;
     74    // get Type of this UserTrackInfo     
     75 
     76  protected:
     77    G4String fType;   
    6778};
    6879
     80inline
     81 const G4String& G4VUserTrackInformation::GetType() const
     82{
     83  return fType;
     84}
     85   
    6986#endif
    7087
  • trunk/source/track/src/G4ParticleChange.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleChange.cc,v 1.30 2007/03/30 01:03:53 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleChange.cc,v 1.31 2009/04/02 02:22:30 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    454454  G4bool itsOKforMomentum = true; 
    455455  if ( theEnergyChange >0.) {
    456     accuracy = std::abs(theMomentumDirectionChange.mag2()-1.0);
     456    accuracy = std::fabs(theMomentumDirectionChange.mag2()-1.0);
    457457    if (accuracy > accuracyForWarning) {
    458458#ifdef G4VERBOSE
  • trunk/source/track/src/G4ParticleChangeForLoss.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleChangeForLoss.cc,v 1.16 2006/08/28 16:10:29 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleChangeForLoss.cc,v 1.17 2009/05/26 13:19:41 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    4949#include "G4ExceptionSeverity.hh"
    5050
    51 G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
     51G4ParticleChangeForLoss::G4ParticleChangeForLoss()
     52  :G4VParticleChange(), lowEnergyLimit(1.0*eV)
    5253{
    5354  theSteppingControlFlag = NormalCondition;
  • trunk/source/track/src/G4ParticleChangeForMSC.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleChangeForMSC.cc,v 1.13 2006/06/29 21:15:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleChangeForMSC.cc,v 1.14 2009/04/02 02:22:30 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    165165
    166166  // MomentumDirection should be unit vector
    167   accuracy = std::abs(theMomentumDirection.mag2()-1.0);
     167  accuracy = std::fabs(theMomentumDirection.mag2()-1.0);
    168168  if (accuracy > accuracyForWarning) {
    169169#ifdef G4VERBOSE
  • trunk/source/track/src/G4Track.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4Track.cc,v 1.30 2007/10/02 00:46:21 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Track.cc,v 1.32 2009/04/08 08:07:24 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    3838//   Modification for G4TouchableHandle             22 Oct. 2001  R.Chytracek//
    3939//   Fix GetVelocity (bug report #741)   Horton-Smith Apr 14 2005
     40//   Remove massless check in  GetVelocity   02 Apr. 09 H.Kurashige
    4041
    4142#include "G4Track.hh"
     
    170171  G4double mass = fpDynamicParticle->GetMass();
    171172
    172   // mass less particle 
    173   if( mass == 0. ){
    174     velocity = c_light ;
    175 
    176     // special case for photons
    177     if ( (fOpticalPhoton !=0)  &&
    178          (fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
    179 
    180        G4Material* mat=0;
    181        G4bool update_groupvel = false;
    182        if ( this->GetStep() ){
    183           mat= this->GetMaterial();         //   Fix for repeated volumes
    184        }else{
    185           if (fpTouchable!=0){
    186             mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
    187           }
    188         }
    189        // check if previous step is in the same volume
    190        //  and get new GROUPVELOVITY table if necessary
    191        if ((mat != prev_mat)||(groupvel==0)) {
    192          groupvel = 0;
    193          if(mat->GetMaterialPropertiesTable() != 0)
    194            groupvel = mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL");
    195          update_groupvel = true;
    196        }
    197        prev_mat = mat;
    198        
    199        if  (groupvel != 0 ) {
    200          // light velocity = c/(rindex+d(rindex)/d(log(E_phot)))
    201          // values stored in GROUPVEL material properties vector
    202          velocity =  prev_velocity;
     173  velocity = c_light ;
     174
     175  // special case for photons
     176  if (  (fOpticalPhoton !=0)  &&
     177        (fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
     178
     179    G4Material* mat=0;
     180    G4bool update_groupvel = false;
     181    if ( this->GetStep() ){
     182      mat= this->GetMaterial();         //   Fix for repeated volumes
     183    }else{
     184      if (fpTouchable!=0){
     185        mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
     186      }
     187    }
     188    // check if previous step is in the same volume
     189    //  and get new GROUPVELOVITY table if necessary
     190    if ((mat != prev_mat)||(groupvel==0)) {
     191        groupvel = 0;
     192        if(mat->GetMaterialPropertiesTable() != 0)
     193          groupvel = mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL");
     194        update_groupvel = true;
     195    }
     196    prev_mat = mat;
     197     
     198    if  (groupvel != 0 ) {
     199        // light velocity = c/(rindex+d(rindex)/d(log(E_phot)))
     200        // values stored in GROUPVEL material properties vector
     201        velocity =  prev_velocity;
    203202         
    204          // check if momentum is same as in the previous step
    205          //  and calculate group velocity if necessary
    206          if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) {
    207            velocity =
    208              groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum());
     203        // check if momentum is same as in the previous step
     204        //  and calculate group velocity if necessary
     205        if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) {
     206          velocity =
     207            groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum());
    209208           prev_velocity = velocity;
    210            prev_momentum = fpDynamicParticle->GetTotalMomentum();
    211          }
    212        }
    213      }
     209          prev_momentum = fpDynamicParticle->GetTotalMomentum();
     210        }
     211    }
    214212
    215213  } else {
    216     G4double T = fpDynamicParticle->GetKineticEnergy();
    217     velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass);
     214    if (mass<DBL_MIN) {
     215      velocity = c_light;
     216    } else {
     217      G4double T = fpDynamicParticle->GetKineticEnergy();
     218      velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass);
     219    }
    218220  }
    219221                                                                               
  • trunk/source/track/src/G4VParticleChange.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4VParticleChange.cc,v 1.20 2007/03/25 22:54:52 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4VParticleChange.cc,v 1.21 2009/04/02 02:22:30 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    288288  // MomentumDirection should be unit vector
    289289  G4bool itsOKforMomentum = true; 
    290   accuracy = std::abs((aTrack.GetMomentumDirection()).mag2()-1.0);
     290  accuracy = std::fabs((aTrack.GetMomentumDirection()).mag2()-1.0);
    291291  if (accuracy > accuracyForWarning) {
    292292#ifdef G4VERBOSE
  • trunk/source/track/src/G4VUserTrackInformation.cc

    r1058 r1196  
    2525//
    2626//
    27 // $Id: G4VUserTrackInformation.cc,v 1.2 2006/06/29 21:15:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4VUserTrackInformation.cc,v 1.3 2009/10/19 09:37:00 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    3434
    3535G4VUserTrackInformation::G4VUserTrackInformation()
     36  : fType("NONE")
    3637{;}
     38
     39G4VUserTrackInformation::G4VUserTrackInformation(const G4String& infoType)
     40  : fType(infoType)
     41{;}
     42
    3743G4VUserTrackInformation::~G4VUserTrackInformation()
    3844{;}
Note: See TracChangeset for help on using the changeset viewer.