Message: Error: local time goes back!! Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Error: local time goes back!! 

Forum: Event and Track Management
Date: 16 Jun, 2016
From: Soman <Soman>

Hi,

I want to change the direction of photons after passing through a certain volume. So I wrote a separate G4 physics process class in which I changed the momentum direction of photons when exiting the given volume. But when I run my program while calling this process, it shows this error many times:

=============================================================================
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : TRACK003
      issued by : G4ParticleChange::CheckIt
momentum, energy, and/or time was illegal
*** Event Must Be Aborted ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

  G4ParticleChange::CheckIt    : the local time goes back  !!  Difference:  0.0027982[ns] 
gamma E=0 pos=-2.46698e-05, 3.15671e-05, -0.00691964 global time=1.183e+07 local time=0.0230814 proper time=0
      -----------------------------------------------
        G4ParticleChange Information  
      -----------------------------------------------
        # of 2ndaries       :                    0
      -----------------------------------------------
        Energy Deposit (MeV):                    0
        Non-ionizing Energy Deposit (MeV):                    0
        Track Status        :                Alive
        True Path Length (mm) :                    0
        Stepping Control      :                    0
        Mass (GeV)   :                    0
        Charge (eplus)   :                    0
        MagneticMoment   :                    0
                :  =                    0*[e hbar]/[2 m]
        Position - x (mm)   :                    0
        Position - y (mm)   :                    0
        Position - z (mm)   :                    0
        Time (ns)           :               0.0203
        Proper Time (ns)    :                    0
        Momentum Direct - x :                    0
        Momentum Direct - y :                    0
        Momentum Direct - z :                    0
        Kinetic Energy (MeV):                    0
        Velocity  (/c):                    0
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0

==============================================================================

When I donīt call this process, everything is fine and I get my output. I donīt know if my physics process is wrong or I should consider some other physical parameters with momentum (e.g. conservation laws, etc). Could someone please tell me how can I implement this simple process correctly? Iīve included the part of implementing the process in my code (Xdiff.cc class) bellow.

Thanks in advance, Soman

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // PostStepDoIt // -------------

G4VParticleChange*
  G4XDiff::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
{

   G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
   G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();  

   G4TouchableHandle touchpre = pPreStepPoint->GetTouchableHandle();
   G4VPhysicalVolume* volumepre = touchpre->GetVolume();

   G4String namepre = volumepre->GetName();

   // Check if this point is in the slit volumes, returns 

   if ((namepre == "slit1") || (namepre == "slit2"))
 {

     // Check if this step is the last step in that
     // volume, if so, initiate the XDiff Process, otherwise leave this
     // process

      if (pPostStepPoint->GetStepStatus() == fGeomBoundary)
    {

      aParticleChange.Initialize(aTrack);

      const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();

              G4double x_ang = aParticle->GetMomentumDirection().x();
              G4double y_ang = aParticle->GetMomentumDirection().y();
              G4double z_ang = aParticle->GetMomentumDirection().z();

              G4double theta_ang = fAngleValue;
              G4double phi_ang = atan((y_ang)/(x_ang));

     // Change photon momentum direction vector according to the new random
     // polar angle and keep the azimuthal angle 
              G4double px = sin(theta_ang)*cos(phi_ang);
              G4double py = sin(theta_ang)*sin(phi_ang);
              G4double pz = cos(theta_ang);

              G4ThreeVector direction(px, py, pz); 
              pPostStepPoint->SetMomentumDirection(direction);
        }
    }

return pParticleChange; } +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Error: local time goes back!!   (Gumplinger Peter - 16 Jun, 2016)
(_ Feedback: Re: Error: local time goes back!!   (Soman - 16 Jun, 2016)
(_ Feedback: Re: Error: local time goes back!!   (Gumplinger Peter - 17 Jun, 2016)
(_ Feedback: Re: Error: local time goes back!!   (Soman - 19 Jun, 2016)
(_ Feedback: Re: Error: local time goes back!!   (Gumplinger Peter - 20 Jun, 2016)
(_ Feedback: Re: Error: local time goes back!!   (Soman - 20 Jun, 2016)
 Add Message Add Message
to: "Error: local time goes back!!"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]