Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CollisionInitialState Class Reference

#include <G4CollisionInitialState.hh>

Public Member Functions

 G4CollisionInitialState ()
 
 G4CollisionInitialState (G4double time, G4KineticTrack *aPrimary, G4KineticTrack *aTarget)
 
 G4CollisionInitialState (G4double time, G4KineticTrack *aPrimary, const G4KineticTrackVector &aTarget, G4BCAction *aFSGenerator)
 
 ~G4CollisionInitialState ()
 
 G4CollisionInitialState (const G4CollisionInitialState &right)
 
G4CollisionInitialStateoperator= (const G4CollisionInitialState &right)
 
int operator< (const G4CollisionInitialState &right) const
 
int operator== (const G4CollisionInitialState &right) const
 
G4KineticTrackGetPrimary (void)
 
void SetPrimary (G4KineticTrack *aPrimary)
 
G4KineticTrackGetTarget (void)
 
void SetTarget (G4KineticTrack *aTarget)
 
void AddTarget (G4KineticTrack *aTarget)
 
G4KineticTrackVectorGetTargetCollection (void)
 
G4KineticTrackVectorGetFinalState ()
 
G4int GetTargetBaryonNumber ()
 
G4int GetTargetCharge ()
 
G4double GetCollisionTime (void)
 
void SetCollisionTime (G4double value)
 
G4BCActionGetGenerator ()
 
void Print () const
 

Detailed Description

Definition at line 46 of file G4CollisionInitialState.hh.

Constructor & Destructor Documentation

◆ G4CollisionInitialState() [1/4]

G4CollisionInitialState::G4CollisionInitialState ( )

Definition at line 38 of file G4CollisionInitialState.cc.

38 :
39 theCollisionTime(DBL_MAX), thePrimary(0), theTarget(0), theFSGenerator(0)
40{
41}
#define DBL_MAX
Definition: templates.hh:83

◆ G4CollisionInitialState() [2/4]

G4CollisionInitialState::G4CollisionInitialState ( G4double  time,
G4KineticTrack aPrimary,
G4KineticTrack aTarget 
)

Definition at line 44 of file G4CollisionInitialState.cc.

46{
47 theCollisionTime = time;
48 thePrimary = aPrimary;
49 theTarget = aTarget;
50 theTs.clear();
51 theFSGenerator = 0;
52}

◆ G4CollisionInitialState() [3/4]

G4CollisionInitialState::G4CollisionInitialState ( G4double  time,
G4KineticTrack aPrimary,
const G4KineticTrackVector aTarget,
G4BCAction aFSGenerator 
)

Definition at line 55 of file G4CollisionInitialState.cc.

58{
59 theCollisionTime = time;
60 thePrimary = aPrimary;
61 theTarget = 0;
62 for (size_t i=0; i<aTarget.size(); i++) theTs.push_back(aTarget[i]);
63 theFSGenerator = aFSGenerator;
64}

◆ ~G4CollisionInitialState()

G4CollisionInitialState::~G4CollisionInitialState ( )
inline

Definition at line 57 of file G4CollisionInitialState.hh.

57{ }

◆ G4CollisionInitialState() [4/4]

G4CollisionInitialState::G4CollisionInitialState ( const G4CollisionInitialState right)

Definition at line 68 of file G4CollisionInitialState.cc.

69{
70 theCollisionTime = right.theCollisionTime;
71 thePrimary = right.thePrimary;
72 theTarget = right.theTarget;
73 for (size_t i=0; i<right.theTs.size(); i++) theTs.push_back(right.theTs[i]);
74 theFSGenerator = right.theFSGenerator;
75}

Member Function Documentation

◆ AddTarget()

void G4CollisionInitialState::AddTarget ( G4KineticTrack aTarget)
inline

Definition at line 79 of file G4CollisionInitialState.hh.

80 {theTs.push_back(aTarget);}

◆ GetCollisionTime()

G4double G4CollisionInitialState::GetCollisionTime ( void  )
inline

Definition at line 105 of file G4CollisionInitialState.hh.

106 {return theCollisionTime;}

Referenced by G4CollisionManager::Print(), and G4BinaryCascade::Propagate().

◆ GetFinalState()

G4KineticTrackVector * G4CollisionInitialState::GetFinalState ( )

Definition at line 94 of file G4CollisionInitialState.cc.

96 {
97// G4cerr << "what is the FS generator? "
98// << typeid(*theFSGenerator).name()
99// <<G4endl;
100 return theFSGenerator->GetFinalState(thePrimary, theTs);
101 }
virtual G4KineticTrackVector * GetFinalState(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &theTargets)=0

◆ GetGenerator()

G4BCAction * G4CollisionInitialState::GetGenerator ( )
inline

Definition at line 111 of file G4CollisionInitialState.hh.

112 {
113 return theFSGenerator;
114 }

Referenced by G4CollisionManager::Print().

◆ GetPrimary()

G4KineticTrack * G4CollisionInitialState::GetPrimary ( void  )
inline

Definition at line 69 of file G4CollisionInitialState.hh.

70 {return thePrimary;}

Referenced by G4CollisionManager::Print(), and G4CollisionManager::RemoveTracksCollisions().

◆ GetTarget()

G4KineticTrack * G4CollisionInitialState::GetTarget ( void  )
inline

Definition at line 74 of file G4CollisionInitialState.hh.

75 {return theTarget;}

Referenced by G4CollisionManager::Print(), and G4CollisionManager::RemoveTracksCollisions().

◆ GetTargetBaryonNumber()

G4int G4CollisionInitialState::GetTargetBaryonNumber ( )
inline

Definition at line 84 of file G4CollisionInitialState.hh.

85 {
86 G4double result=0;
87 for(size_t i=0; i<theTs.size(); i++)
88 {
89 result += theTs[i]->GetDefinition()->GetBaryonNumber();
90 }
91 return G4lrint(result);
92 }
double G4double
Definition: G4Types.hh:64
int G4lrint(double ad)
Definition: templates.hh:163

◆ GetTargetCharge()

G4int G4CollisionInitialState::GetTargetCharge ( )
inline

Definition at line 93 of file G4CollisionInitialState.hh.

94 {
95 G4double result=0;
96 for(size_t i=0; i<theTs.size(); i++)
97 {
98 result += theTs[i]->GetDefinition()->GetPDGCharge();
99 }
100 return G4lrint(result);
101 }

◆ GetTargetCollection()

G4KineticTrackVector & G4CollisionInitialState::GetTargetCollection ( void  )
inline

Definition at line 81 of file G4CollisionInitialState.hh.

82 {return theTs;}

Referenced by G4CollisionManager::RemoveTracksCollisions().

◆ operator<()

int G4CollisionInitialState::operator< ( const G4CollisionInitialState right) const
inline

Definition at line 62 of file G4CollisionInitialState.hh.

63 {return (theCollisionTime < right.theCollisionTime);}

◆ operator=()

G4CollisionInitialState & G4CollisionInitialState::operator= ( const G4CollisionInitialState right)

Definition at line 77 of file G4CollisionInitialState.cc.

78{
79 if (this != &right)
80 {
81 theCollisionTime = right.theCollisionTime;
82 thePrimary = right.thePrimary;
83 theTarget = right.theTarget;
84 for (size_t i=0; i<right.theTs.size(); i++)
85 theTs.push_back(right.theTs[i]);
86 theFSGenerator = right.theFSGenerator;
87 }
88
89 return *this;
90}

◆ operator==()

int G4CollisionInitialState::operator== ( const G4CollisionInitialState right) const
inline

Definition at line 65 of file G4CollisionInitialState.hh.

66 {return (theCollisionTime == right.theCollisionTime);}

◆ Print()

void G4CollisionInitialState::Print ( ) const

Definition at line 105 of file G4CollisionInitialState.cc.

106{
107 G4int tgtPdg=theTarget ?
108 theTarget->GetDefinition()->GetPDGEncoding() : 0;
109 G4cout << " collision " << this << " time: "
110 << theCollisionTime/second << " proj: "
111 << thePrimary << "/pdg=" << thePrimary->GetDefinition()->GetPDGEncoding()
112 << " tgt: " << theTarget << "/pdg=" << tgtPdg
113 << " Collision type: "<< typeid(*theFSGenerator).name();
114
115}
int G4int
Definition: G4Types.hh:66
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const

◆ SetCollisionTime()

void G4CollisionInitialState::SetCollisionTime ( G4double  value)
inline

Definition at line 107 of file G4CollisionInitialState.hh.

108 {theCollisionTime = value;}

◆ SetPrimary()

void G4CollisionInitialState::SetPrimary ( G4KineticTrack aPrimary)
inline

Definition at line 71 of file G4CollisionInitialState.hh.

72 {thePrimary = aPrimary;}

◆ SetTarget()

void G4CollisionInitialState::SetTarget ( G4KineticTrack aTarget)
inline

Definition at line 76 of file G4CollisionInitialState.hh.

77 {theTarget = aTarget;}

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