//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
//             LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION   Geant4 SIMULATION
//  ID    : LEMuSRTrackingAction.cc , v 1.0
//  AUTHOR: Taofiq PARAISO
//  DATE  : 2004-07-07 11:15
//                   
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
//
//  &           &&&&&&&&&&                            &&&&&&&         &&&&&&&&
//  &           &                                   &&      &&       &       &&
//  &           &                   &      &       &                &       &&
//  &           &&&&&&&            &      &         &&&&&&         &&&&&&&&  
//  &           &                 &      &&                &      &      &&
//  &           &                &&     &  &     &&      &&      &        &
//  &&&&&&&&&&  &&&&&&&&&&      &  &&&&&    &&    &&&&&&&       &        &&   
//                             &
//                            &
//                           &
//                         &  
//                           TRACKING ACTION.CC
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//

#include"LEMuSRTrackingAction.hh"
#include"G4VProcess.hh"
#include"G4PrimaryParticle.hh"
#include"G4UnitsTable.hh"
#include"LEMuSRMuonDecayChannel.hh"

//! \ct
LEMuSRTrackingAction ::LEMuSRTrackingAction()
{
  pointer=this  ;
  tMgr=new G4TrackingManager();
}



LEMuSRTrackingAction*  LEMuSRTrackingAction::pointer=0;

//! Returns  pointer to the tracking action.
LEMuSRTrackingAction*  LEMuSRTrackingAction::GetInstance()
{ 
  return pointer;
}


//! \dt
LEMuSRTrackingAction:: ~LEMuSRTrackingAction()
{
  delete tMgr;
}

//! Actions to take at the beginning of a track.
void LEMuSRTrackingAction::PreUserTrackingAction(const G4Track* theTrack)
{
  //   G4cout << theTrack->GetDefinition()->GetParticleName()<<G4endl;
  GyroMagRatio=GyroMagFactor=0;
  if(theTrack->GetDefinition()->GetPDGMass()!=0)
    {
      GyroMagRatio=theTrack->GetDefinition()->GetGyromagneticRatio();  
      GyroMagFactor=theTrack->GetDefinition()->GetGyromagneticFactor();  
    }
  //   G4cout <<"g ratio [Hz]/[G]"<<GyroMagRatio*s/gauss<<G4endl;

}


void LEMuSRTrackingAction::Collect_datas(const G4Track* theTrack)
{

   
}



//! Actions to take at the end of a track.
void LEMuSRTrackingAction::PostUserTrackingAction(const G4Track*)
{
  ;
}

