Message: Re: Double_t against G4double Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Double_t against G4double 

Keywords: ROOT casting
Forum: Analysis
Re: Question Double_t against G4double (Sara Vecchio)
Re: None Re: Double_t against G4double (Klaus Grimm)
Date: 09 Jan, 2006
From: Sara Vecchio <sara.vecchio@pi.infn.it>

User Klaus Grimm wrote:

>> A simple solution would be if you divide your Geant4 variables by 
their units, e.g.

I did it. This is the related part of code inside DoPETStackingAction::ClassifyNewTrack(const G4Track * track) :

***************************************************************
if (lifetime > 0.) //list only unstable nuclei!
	{
	 G4double Z = ion->GetAtomicNumber();
         G4int A = ion->GetAtomicMass();
         G4ThreeVector position = track->GetPosition();
	 G4cout<<"Z "<<Z<<", A "<<A<<", position "<<position<<";"<<G4endl;

	 fEvent->Event=(Double_t) (event_id/MeV);     
	 fEvent->Nz = (Double_t) (Z/MeV);
	 fEvent->Na = (Double_t) (A/MeV);
	 fEvent->x  = (Double_t) (position.x()/MeV);
	 fEvent->y  = (Double_t) (position.y()/MeV);
	 fEvent->z  = (Double_t) (position.z()/MeV);

	 tree->Fill();
	}

***************************************************************

The result on my screen is: Z 4, A 8, position (-181.86205,0.83498924,0.069129021); Z 4, A 8, position (-197.93016,1.0865305,1.0587331); Z 4, A 8, position (-193.38001,-1.030061,-1.0510456);

The result inside the tree for the same variables is:

*************************************************************
*        Nz *        Na *         x *         y *         z *
*************************************************************
* 1.251e-14 * 4.624e-44 * 7.616e-34 * 2.478e-33 * 2.522e-44 *
* 1.251e-14 * 4.624e-44 * 7.616e-34 * 2.478e-33 * 2.466e-43 *
* 1.251e-14 * 4.624e-44 * 7.616e-34 * 2.478e-33 * 2.494e-43 *
*************************************************************

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

1 Warning: Re: Double_t against G4double   (Sara Vecchio - 09 Jan, 2006)
 Add Message Add Message
to: "Re: Double_t against G4double"

 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 ]