Message: Re: cold neutron spin tracking Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: cold neutron spin tracking 

Keywords: spin, neutrons, magnetic field
Forum: Fields: Magnetic and Otherwise
Re: Question cold neutron spin tracking (Emil Frlez)
Date: 22 Nov, 2005
From: Gumplinger Peter <Gumplinger Peter>

Hi Emil

.... and I still haven't written the documentation for spin tracking.

So great, you found the thread on this forum which advertises this functionality in Geant4!

> First thing I notice is that the anomaly is hard-wired for muons. 

Yes, while the class G4Mag_SpinEqRhs constructor

G4Mag_SpinEqRhs::G4Mag_SpinEqRhs( G4MagneticField* MagField )
   : G4Mag_EqRhs( MagField ) 
    anomaly = 1.165923e-3;

sets the muon anomaly, but no, the class also comes with the public method:

inline void SetAnomaly(G4double a) { anomaly = a; }

with which you can set the anomaly to any value you like.

> But then I noticed that my "GetFieldValue" is not called at 

> all for neutron, so there will be no tracking for (presumably)

> any neutral particle. Does that means that the G4 FieldManager

> checks the charge of the tracked particle and quits if it is dealing

> with neutral particle? 

John Apostolakis is the expert here, but I suspect you are correct in that the code is written such that field tracking is done only for particles with non-zero charge. I believe it is in G4Transportation:

   G4double G4Transportation::

   G4ParticleDefinition* pParticleDef   = pParticle->GetDefinition() ;
   G4double              particleCharge = pParticleDef->GetPDGCharge() ; 

   G4FieldManager* fieldMgr=0;
   G4bool          fieldExertsForce = false ;
   if( (particleCharge != 0.0) )
      fieldMgr= fFieldPropagator->FindAndSetFieldManager( track.GetVolume() ); 
      if (fieldMgr != 0) {
         fieldExertsForce = (fieldMgr->GetDetectorField() != 0);

   if( !fieldExertsForce ) 
      G4double linearStepLength ;
      linearStepLength = fLinearNavigator->ComputeStep( .....


> Can this behavior be changed in an elegant way? 

Good point! We should try hard to extend the whole idea of field tracking to include magnetic moments of neutral particles. John ...???

> And are the simple changes I was thinking of, outlined above, only
> ones necessary for the neutron spin tracking?

I think so, and so long as we manage to propagate the neutron straight (zero electric charge) and yet precess its magnetic moment in a magn. field.

> With a rush of cold neutron experiments I find google-ing

> that a number of people are working on the spin tracking

> simulations. If the full machinery already exists in G4

> and an experienced C++ programmer can make the fixes in 10 mins,

> what are those people working on ...;8-?) Or is the whole problem

> more complicated and I am missing something?

I don't know about 10 mins ... but I agree with you, the problem shouldn't be complicated with what's already in place in G4. If is is, then only because magn. moment tracking wasn't considered in the class design from the outset.

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

 Add Message Add Message
to: "Re: cold neutron spin tracking"

 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 ]