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

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/decay/src/G4DecayWithSpin.cc

    r819 r961  
    2929//      History:
    3030//      17 August 2004  P. Gumplinger, T. MacPhail
     31//      11 April  2008  Kamil Sedlak (PSI), Toni Shiroka (PSI)
    3132// ------------------------------------------------------------
    3233//
     
    4748#include "G4Transform3D.hh"
    4849
    49 G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName){}
     50G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName)
     51{
     52  // set Process Sub Type   
     53  SetProcessSubType(static_cast<int>(DECAY_WithSpin));
     54
     55}
    5056
    5157G4DecayWithSpin::~G4DecayWithSpin(){}
     
    97103    if(fieldMgr)field = fieldMgr->GetDetectorField();
    98104
    99     if (field && !(fieldMgr->DoesFieldChangeEnergy())) {
     105    if (field) {
    100106
    101107       G4double point[4];
     
    105111       point[3] = aTrack.GetGlobalTime();
    106112
    107        G4double fieldValue[3];
     113       G4double fieldValue[6];
    108114       field -> GetFieldValue(point,fieldValue);
    109115
    110116       G4ThreeVector B(fieldValue[0],fieldValue[1],fieldValue[2]);
    111117
    112        parent_polarization = Spin_Precession(aStep,B,fRemainderLifeTime);
     118       // Call the spin precession only for non-zero mag. field
     119       if (B.mag2() > 0.) parent_polarization =
     120                                 Spin_Precession(aStep,B,fRemainderLifeTime);
    113121
    114122    }
Note: See TracChangeset for help on using the changeset viewer.