Message: Re: Get vector component Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Get vector component 

Forum: Documentation and Examples
Re: None Get vector component (Mikhail)
Date: 13 May, 2013
From: Zach Hartwig <Zach Hartwig>

Mikhail,

A G4ThreeVector is simply a C++ typedef for standard CLHEP 3Vector (CLHEP is a general purpose C++ class library packaged with Geant4 with a lot of extremely useful classes for particle/nuclear/detector physics). You can find the full class documentation for CLHEP::3Vector (including all the public access methods) online here.

To get the X component simply use the CLHEP::3Vector::x() method, e.g.

G4ThreeVector Position(1,2,3);
G4int xComponent = Position.x();

Hope this helps

~ZSH

 Add Message Add Message
to: "Re: Get vector component"

 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 ]