Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -38,22 +38,20 @@
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4FastTrack_h
|
||||
#define G4FastTrack_h
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4AffineTransform.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
//---------------------------
|
||||
// For possible future needs:
|
||||
//---------------------------
|
||||
typedef G4Region G4Envelope;
|
||||
|
||||
using G4Envelope = G4Region;
|
||||
|
||||
//-------------------------------------------
|
||||
//
|
||||
@@ -69,116 +67,105 @@ typedef G4Region G4Envelope;
|
||||
// simple access to the position, momentum expressed in the
|
||||
// envelope coordinate system. Using those quantities and the
|
||||
// G4VSolid methods, you can for example easily check how far you
|
||||
// are from the envelope boundary.
|
||||
// are from the envelope boundary.
|
||||
//
|
||||
|
||||
|
||||
class G4FastTrack
|
||||
{
|
||||
public: // without description
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
// Only one Constructor. By default the envelope can
|
||||
// be placed n-Times. If the user is sure that it'll be
|
||||
// placed just one time, the IsUnique flag should be set
|
||||
// TRUE to avoid the G4AffineTransform re-calculations each
|
||||
// time we reach the envelope.
|
||||
G4FastTrack(G4Envelope *anEnvelope,
|
||||
G4bool IsUnique);
|
||||
~G4FastTrack();
|
||||
public: // without description
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
// Only one Constructor. By default the envelope can
|
||||
// be placed n-Times. If the user is sure that it'll be
|
||||
// placed just one time, the IsUnique flag should be set
|
||||
// TRUE to avoid the G4AffineTransform re-calculations each
|
||||
// time we reach the envelope.
|
||||
G4FastTrack(G4Envelope* anEnvelope, G4bool IsUnique);
|
||||
~G4FastTrack() = default;
|
||||
|
||||
//------------------------------------------------------------
|
||||
// The fast simulation manager uses the SetCurrentTrack
|
||||
// method to setup the current G4FastTrack object
|
||||
//------------------------------------------------------------
|
||||
void SetCurrentTrack(const G4Track&, const G4Navigator* a = 0);
|
||||
//------------------------------------------------------------
|
||||
// The fast simulation manager uses the SetCurrentTrack
|
||||
// method to setup the current G4FastTrack object
|
||||
//------------------------------------------------------------
|
||||
void SetCurrentTrack(const G4Track&, const G4Navigator* a = nullptr);
|
||||
|
||||
//------------------------------------------------------------
|
||||
// The fast simulation manager uses the OnTheBoundaryButExiting
|
||||
// method to test if the particle is leaving the envelope.
|
||||
//------------------------------------------------------------
|
||||
G4bool OnTheBoundaryButExiting() const;
|
||||
//------------------------------------------------------------
|
||||
// The fast simulation manager uses the OnTheBoundaryButExiting
|
||||
// method to test if the particle is leaving the envelope.
|
||||
//------------------------------------------------------------
|
||||
G4bool OnTheBoundaryButExiting() const;
|
||||
|
||||
//----------------------------------
|
||||
// Informations useful to the user :
|
||||
// General public get functions.
|
||||
//----------------------------------
|
||||
//----------------------------------
|
||||
// Informations useful to the user :
|
||||
// General public get functions.
|
||||
//----------------------------------
|
||||
|
||||
public: // with Description
|
||||
// Returns the current G4Track.
|
||||
const G4Track* GetPrimaryTrack() const;
|
||||
|
||||
const G4Track* GetPrimaryTrack() const;
|
||||
// Returns the current G4Track.
|
||||
// Returns the Envelope G4Region pointer.
|
||||
G4Envelope* GetEnvelope() const;
|
||||
|
||||
G4Envelope* GetEnvelope() const;
|
||||
// Returns the Envelope G4Region pointer.
|
||||
// Returns the Envelope G4LogicalVolume pointer.
|
||||
G4LogicalVolume* GetEnvelopeLogicalVolume() const;
|
||||
|
||||
G4LogicalVolume* GetEnvelopeLogicalVolume() const;
|
||||
// Returns the Envelope G4LogicalVolume pointer.
|
||||
// Returns the Envelope G4VPhysicalVolume pointer.
|
||||
G4VPhysicalVolume* GetEnvelopePhysicalVolume() const;
|
||||
|
||||
G4VPhysicalVolume* GetEnvelopePhysicalVolume() const;
|
||||
// Returns the Envelope G4VPhysicalVolume pointer.
|
||||
// Returns the Envelope G4VSolid pointer.
|
||||
G4VSolid* GetEnvelopeSolid() const;
|
||||
|
||||
G4VSolid* GetEnvelopeSolid() const;
|
||||
// Returns the Envelope G4VSolid pointer.
|
||||
//-----------------------------------
|
||||
// Primary track informations in the
|
||||
// Envelope coordinate system.
|
||||
//-----------------------------------
|
||||
|
||||
//-----------------------------------
|
||||
// Primary track informations in the
|
||||
// Envelope coordinate system.
|
||||
//-----------------------------------
|
||||
// Returns the particle position in envelope coordinates.
|
||||
G4ThreeVector GetPrimaryTrackLocalPosition() const;
|
||||
|
||||
G4ThreeVector GetPrimaryTrackLocalPosition() const;
|
||||
// Returns the particle position in envelope coordinates.
|
||||
// Returns the particle momentum in envelope coordinates.
|
||||
G4ThreeVector GetPrimaryTrackLocalMomentum() const;
|
||||
|
||||
G4ThreeVector GetPrimaryTrackLocalMomentum() const;
|
||||
// Returns the particle momentum in envelope coordinates.
|
||||
// Returns the particle direction in envelope coordinates.
|
||||
G4ThreeVector GetPrimaryTrackLocalDirection() const;
|
||||
|
||||
G4ThreeVector GetPrimaryTrackLocalDirection() const;
|
||||
// Returns the particle direction in envelope coordinates.
|
||||
// Returns the particle polarization in envelope coordinates.
|
||||
G4ThreeVector GetPrimaryTrackLocalPolarization() const;
|
||||
|
||||
G4ThreeVector GetPrimaryTrackLocalPolarization() const;
|
||||
// Returns the particle polarization in envelope coordinates.
|
||||
|
||||
//------------------------------------
|
||||
// 3D transformation of the envelope:
|
||||
//------------------------------------
|
||||
// Global -> Local
|
||||
//------------------------------------
|
||||
// 3D transformation of the envelope:
|
||||
//------------------------------------
|
||||
|
||||
const G4AffineTransform* GetAffineTransformation() const;
|
||||
// Returns the envelope Global -> Local G4AffineTransform
|
||||
// Returns the envelope Global -> Local G4AffineTransform
|
||||
const G4AffineTransform* GetAffineTransformation() const;
|
||||
|
||||
// Local -> Global
|
||||
const G4AffineTransform* GetInverseAffineTransformation() const;
|
||||
// Returns the envelope Local -> Global G4AffineTransform
|
||||
// Returns the envelope Local -> Global G4AffineTransform
|
||||
const G4AffineTransform* GetInverseAffineTransformation() const;
|
||||
|
||||
//-----------------
|
||||
// Private members
|
||||
//-----------------
|
||||
private:
|
||||
private:
|
||||
//-----------------
|
||||
// Private members
|
||||
//-----------------
|
||||
// Current G4Track pointer
|
||||
const G4Track* fTrack{nullptr};
|
||||
|
||||
// Current G4Track pointer
|
||||
const G4Track* fTrack;
|
||||
|
||||
//------------------------------------------------
|
||||
// Records the Affine/InverseAffine transformation
|
||||
// of the envelope.
|
||||
//------------------------------------------------
|
||||
void FRecordsAffineTransformation(const G4Navigator*);
|
||||
G4bool fAffineTransformationDefined;
|
||||
G4Envelope* fEnvelope;
|
||||
G4bool fIsUnique;
|
||||
G4LogicalVolume* fEnvelopeLogicalVolume;
|
||||
G4VPhysicalVolume* fEnvelopePhysicalVolume;
|
||||
G4VSolid* fEnvelopeSolid;
|
||||
G4ThreeVector fLocalTrackPosition,
|
||||
fLocalTrackMomentum,
|
||||
fLocalTrackDirection,
|
||||
fLocalTrackPolarization;
|
||||
G4AffineTransform fAffineTransformation,
|
||||
fInverseAffineTransformation;
|
||||
//------------------------------------------------
|
||||
// Records the Affine/InverseAffine transformation
|
||||
// of the envelope.
|
||||
//------------------------------------------------
|
||||
void FRecordsAffineTransformation(const G4Navigator*);
|
||||
G4bool fAffineTransformationDefined{false};
|
||||
G4Envelope* fEnvelope;
|
||||
G4bool fIsUnique;
|
||||
G4LogicalVolume* fEnvelopeLogicalVolume{nullptr};
|
||||
G4VPhysicalVolume* fEnvelopePhysicalVolume{nullptr};
|
||||
G4VSolid* fEnvelopeSolid{nullptr};
|
||||
G4ThreeVector fLocalTrackPosition, fLocalTrackMomentum, fLocalTrackDirection,
|
||||
fLocalTrackPolarization;
|
||||
G4AffineTransform fAffineTransformation, fInverseAffineTransformation;
|
||||
};
|
||||
|
||||
|
||||
// -----------------
|
||||
// -- Inline methods
|
||||
// -----------------
|
||||
@@ -238,12 +225,12 @@ inline const G4AffineTransform* G4FastTrack::GetInverseAffineTransformation() co
|
||||
return &fInverseAffineTransformation;
|
||||
}
|
||||
|
||||
inline G4bool G4FastTrack::OnTheBoundaryButExiting() const
|
||||
inline G4bool G4FastTrack::OnTheBoundaryButExiting() const
|
||||
{
|
||||
// tests if particle are on the boundary and leaving.
|
||||
return GetEnvelopeSolid()->
|
||||
DistanceToOut(GetPrimaryTrackLocalPosition(),
|
||||
GetPrimaryTrackLocalDirection())==0.;
|
||||
return GetEnvelopeSolid()->DistanceToOut(GetPrimaryTrackLocalPosition(),
|
||||
GetPrimaryTrackLocalDirection())
|
||||
== 0.;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user