Geant4 11.1.1
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)
 
G4bool operator< (const G4CollisionInitialState &right) const
 
G4bool 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)
 
const G4BCActionGetGenerator ()
 
void Print () const
 

Detailed Description

Definition at line 44 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:62

◆ 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 55 of file G4CollisionInitialState.hh.

55{ }

◆ 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 77 of file G4CollisionInitialState.hh.

78 {theTs.push_back(aTarget);}

◆ GetCollisionTime()

G4double G4CollisionInitialState::GetCollisionTime ( void  )
inline

Definition at line 103 of file G4CollisionInitialState.hh.

104 {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()

const G4BCAction * G4CollisionInitialState::GetGenerator ( )
inline

Definition at line 109 of file G4CollisionInitialState.hh.

110 {
111 return theFSGenerator;
112 }

Referenced by G4CollisionManager::Print().

◆ GetPrimary()

G4KineticTrack * G4CollisionInitialState::GetPrimary ( void  )
inline

Definition at line 67 of file G4CollisionInitialState.hh.

68 {return thePrimary;}

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

◆ GetTarget()

G4KineticTrack * G4CollisionInitialState::GetTarget ( void  )
inline

Definition at line 72 of file G4CollisionInitialState.hh.

73 {return theTarget;}

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

◆ GetTargetBaryonNumber()

G4int G4CollisionInitialState::GetTargetBaryonNumber ( )
inline

Definition at line 82 of file G4CollisionInitialState.hh.

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

◆ GetTargetCharge()

G4int G4CollisionInitialState::GetTargetCharge ( )
inline

Definition at line 91 of file G4CollisionInitialState.hh.

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

◆ GetTargetCollection()

G4KineticTrackVector & G4CollisionInitialState::GetTargetCollection ( void  )
inline

Definition at line 79 of file G4CollisionInitialState.hh.

80 {return theTs;}

Referenced by G4CollisionManager::RemoveTracksCollisions().

◆ operator<()

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

Definition at line 60 of file G4CollisionInitialState.hh.

61 {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==()

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

Definition at line 63 of file G4CollisionInitialState.hh.

64 {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:85
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const

◆ SetCollisionTime()

void G4CollisionInitialState::SetCollisionTime ( G4double  value)
inline

Definition at line 105 of file G4CollisionInitialState.hh.

106 {theCollisionTime = value;}

◆ SetPrimary()

void G4CollisionInitialState::SetPrimary ( G4KineticTrack aPrimary)
inline

Definition at line 69 of file G4CollisionInitialState.hh.

70 {thePrimary = aPrimary;}

◆ SetTarget()

void G4CollisionInitialState::SetTarget ( G4KineticTrack aTarget)
inline

Definition at line 74 of file G4CollisionInitialState.hh.

75 {theTarget = aTarget;}

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