BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Data Structures | Public Member Functions | Private Member Functions | Private Attributes
BDSPTCOneTurnMap Class Reference

Class to load and use PTC 1 turn map. More...

#include <BDSPTCOneTurnMap.hh>

Collaboration diagram for BDSPTCOneTurnMap:
Collaboration graph

Data Structures

struct  PTCMapTerm
 

Public Member Functions

 BDSPTCOneTurnMap ()=delete
 Default constructor.
 
 BDSPTCOneTurnMap (const BDSPTCOneTurnMap &other)=default
 Copy constructor.
 
 BDSPTCOneTurnMap (BDSPTCOneTurnMap &&other) noexcept=default
 Move constructor.
 
virtual ~BDSPTCOneTurnMap ()
 Destructor. More...
 
 BDSPTCOneTurnMap (const G4String &maptableFile, const BDSParticleDefinition *designParticle)
 Main constructor with path to maptable file. More...
 
G4bool ShouldApplyToPrimary (G4double momentum, G4int turnstaken)
 Decides whether or not this should be applied. Can add more. More...
 
void SetInitialPrimaryCoordinates (const BDSParticleCoordsFullGlobal &coords, G4bool offsetS0)
 Load initial coordinates where the beam started and convert to PTC coordinates. More...
 
void UpdateCoordinates (G4ThreeVector localPosition, G4ThreeVector localMomentum, G4int turnstaken)
 Update coordinates if the last turn is greater than the number of turns taken. More...
 
void GetThisTurn (G4double &x, G4double &px, G4double &y, G4double &py, G4double &pz, G4int turnstaken)
 Return the coordinates for this turn. More...
 

Private Member Functions

G4double Evaluate (std::vector< PTCMapTerm > &terms, G4double x, G4double px, G4double y, G4double py, G4double deltaP) const
 

Private Attributes

G4double initialPrimaryMomentum
 
G4bool beamOffsetS0
 
G4double referenceMomentum
 
G4double mass
 
std::set< G4int > turnsScattered
 
G4int lastTurnNumber
 
G4double xLastTurn
 
G4double pxLastTurn
 
G4double yLastTurn
 
G4double pyLastTurn
 
G4double deltaPLastTurn
 
std::vector< PTCMapTermxTerms
 
std::vector< PTCMapTermyTerms
 
std::vector< PTCMapTermpxTerms
 
std::vector< PTCMapTermpyTerms
 
std::vector< PTCMapTermdeltaPTerms
 

Detailed Description

Class to load and use PTC 1 turn map.

This class uses PTC units internally for calculating the result of the map.

Author
Stuart Walker.

Definition at line 40 of file BDSPTCOneTurnMap.hh.

Constructor & Destructor Documentation

◆ ~BDSPTCOneTurnMap()

virtual BDSPTCOneTurnMap::~BDSPTCOneTurnMap ( )
inlinevirtual

Destructor.

Definition at line 56 of file BDSPTCOneTurnMap.hh.

◆ BDSPTCOneTurnMap()

BDSPTCOneTurnMap::BDSPTCOneTurnMap ( const G4String &  maptableFile,
const BDSParticleDefinition designParticle 
)

Main constructor with path to maptable file.

Definition at line 38 of file BDSPTCOneTurnMap.cc.

References BDS::GetFullPath(), BDSParticleDefinition::Mass(), and BDSParticleDefinition::Momentum().

Here is the call graph for this function:

Member Function Documentation

◆ Evaluate()

G4double BDSPTCOneTurnMap::Evaluate ( std::vector< PTCMapTerm > &  terms,
G4double  x,
G4double  px,
G4double  y,
G4double  py,
G4double  deltaP 
) const
private

Definition at line 247 of file BDSPTCOneTurnMap.cc.

◆ GetThisTurn()

void BDSPTCOneTurnMap::GetThisTurn ( G4double &  x,
G4double &  px,
G4double &  y,
G4double &  py,
G4double &  pz,
G4int  turnstaken 
)

Return the coordinates for this turn.

Definition at line 127 of file BDSPTCOneTurnMap.cc.

◆ SetInitialPrimaryCoordinates()

void BDSPTCOneTurnMap::SetInitialPrimaryCoordinates ( const BDSParticleCoordsFullGlobal coords,
G4bool  offsetS0 
)

Load initial coordinates where the beam started and convert to PTC coordinates.

Definition at line 107 of file BDSPTCOneTurnMap.cc.

References BDSGlobalConstants::Instance().

Referenced by BDSPrimaryGeneratorAction::GeneratePrimaries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShouldApplyToPrimary()

G4bool BDSPTCOneTurnMap::ShouldApplyToPrimary ( G4double  momentum,
G4int  turnstaken 
)

Decides whether or not this should be applied. Can add more.

Definition at line 267 of file BDSPTCOneTurnMap.cc.

References BDSTrajectoryPrimary::hasScatteredThisTurn.

◆ UpdateCoordinates()

void BDSPTCOneTurnMap::UpdateCoordinates ( G4ThreeVector  localPosition,
G4ThreeVector  localMomentum,
G4int  turnstaken 
)

Update coordinates if the last turn is greater than the number of turns taken.

Definition at line 320 of file BDSPTCOneTurnMap.cc.

Field Documentation

◆ beamOffsetS0

G4bool BDSPTCOneTurnMap::beamOffsetS0
private

Definition at line 91 of file BDSPTCOneTurnMap.hh.

◆ deltaPLastTurn

G4double BDSPTCOneTurnMap::deltaPLastTurn
private

Definition at line 102 of file BDSPTCOneTurnMap.hh.

◆ deltaPTerms

std::vector<PTCMapTerm> BDSPTCOneTurnMap::deltaPTerms
private

Definition at line 108 of file BDSPTCOneTurnMap.hh.

◆ initialPrimaryMomentum

G4double BDSPTCOneTurnMap::initialPrimaryMomentum
private

Definition at line 90 of file BDSPTCOneTurnMap.hh.

◆ lastTurnNumber

G4int BDSPTCOneTurnMap::lastTurnNumber
private

Definition at line 97 of file BDSPTCOneTurnMap.hh.

◆ mass

G4double BDSPTCOneTurnMap::mass
private

Definition at line 93 of file BDSPTCOneTurnMap.hh.

◆ pxLastTurn

G4double BDSPTCOneTurnMap::pxLastTurn
private

Definition at line 99 of file BDSPTCOneTurnMap.hh.

◆ pxTerms

std::vector<PTCMapTerm> BDSPTCOneTurnMap::pxTerms
private

Definition at line 106 of file BDSPTCOneTurnMap.hh.

◆ pyLastTurn

G4double BDSPTCOneTurnMap::pyLastTurn
private

Definition at line 101 of file BDSPTCOneTurnMap.hh.

◆ pyTerms

std::vector<PTCMapTerm> BDSPTCOneTurnMap::pyTerms
private

Definition at line 107 of file BDSPTCOneTurnMap.hh.

◆ referenceMomentum

G4double BDSPTCOneTurnMap::referenceMomentum
private

Definition at line 92 of file BDSPTCOneTurnMap.hh.

◆ turnsScattered

std::set<G4int> BDSPTCOneTurnMap::turnsScattered
private

Definition at line 95 of file BDSPTCOneTurnMap.hh.

◆ xLastTurn

G4double BDSPTCOneTurnMap::xLastTurn
private

Definition at line 98 of file BDSPTCOneTurnMap.hh.

◆ xTerms

std::vector<PTCMapTerm> BDSPTCOneTurnMap::xTerms
private

Definition at line 104 of file BDSPTCOneTurnMap.hh.

◆ yLastTurn

G4double BDSPTCOneTurnMap::yLastTurn
private

Definition at line 100 of file BDSPTCOneTurnMap.hh.

◆ yTerms

std::vector<PTCMapTerm> BDSPTCOneTurnMap::yTerms
private

Definition at line 105 of file BDSPTCOneTurnMap.hh.


The documentation for this class was generated from the following files: