Message: fill velocity in root file? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question fill velocity in root file? 

Forum: Analysis
Date: 30 Mar, 2013
From: Summit <Summit>

Hello,

To calculate the velocity of the charged particle with depth, I modified TrackingAction.cc in example TestEm7 (Geant4.9.5) as:

void TrackingAction::PostUserTrackingAction(const G4Track* track)
{
  // extract Projected Range of primary particle
  if (track->GetTrackID() == 1) {
    G4double x = track->GetPosition().x() + 0.5*detector->GetAbsorSizeX();
    G4double vel = track->GetVelocity();

     if(vel>0.0){
     G4cout<<vel/(m/s)<<" m/sec  at  "<< x/mm <<" mm\n";
     histoManager->FillHisto(3, x, vel/(m/s));
	}

    if(x > 0.0) runAction->AddProjRange(x);

  }  
}

In this case, G4cout prints the velocity of the order of 10^8, while root file results only 10^6. Can anyone suggest me something to sort out this problem.

Thanks,

With regards,

Summit

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2013/03/30/07.08-48287-Canvas_1.png

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

1 None: Re: fill velocity in root file?   (michel maire - 04 Apr, 2013)
(_ Question: Re: fill velocity in root file?   (Summit - 04 Apr, 2013)
(_ None: Re: fill velocity in root file?   (michel maire - 06 Apr, 2013)
 Add Message Add Message
to: "fill velocity in root file?"

 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 ]