Message: Track lengths of secondaries according to volume of creation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Track lengths of secondaries according to volume of creation 

Forum: Event and Track Management
Date: 07 Jul, 2017
From: Patrick Asenov <Patrick Asenov>

Greetings, friends and colleagues!

I'm throwing a primary particle to a series of detectors (volumes). I'm trying to calculate the total track lengths of those secondaries that have been produced inside the detectors and ONLY. My intention is to find the track of each step, to search for the beginning of that track through GetVertexPosition, and if that vertex position is inside some of the detectors, to save the total track length. My commands inside SteppingAction.cc are the following:

void SteppingAction::UserSteppingAction(const G4Step* step)
{
   [...]

  //get track length and track's current vertex position of the current step
  G4Track* track = step->GetTrack();
  G4double length = track->GetTrackLength();
  G4ThreeVector pos = track->GetVertexPosition();

  //check vertex position's volume
  G4Navigator* aNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
  G4VPhysicalVolume* aVolume = aNavigator->LocateGlobalPointAndSetup(pos);

[...]

    if ((aVolume == fDetectorconstruction->GetDet1()) || (aVolume == fDetectorconstruction->GetDet2()))  {
      fRunaction->AddSecTrackLength(length);
    }
  }
[...]
}

However an error strikes when running the program due to the usage of G4Navigator.

Accuracy error or slightly inaccurate position shift.
     The Step's starting point has moved 25 mm 
     since the last call to a Locate method.
     This has resulted in moving 1e-07 mm  from the last point at which the safety      was calculated 
     which is more than the computed safety= 0 mm  at that point.
     This difference is 1e-07 mm.
     The tolerated accuracy is 1e-06 mm. 

Any idea what's wrong, comrades? Thank you in advance!

 Add Message Add Message
to: "Track lengths of secondaries according to volume of creation"

 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 ]