Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CollisionInitialState.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//
28// -----------------------------------------------------------------------------
29// GEANT 4 class header file
30//
31// History: first implementation, A. Feliciello, 30th June 1998
32
33// -----------------------------------------------------------------------------
34
35#ifndef G4CollisionInitialState_hh
36#define G4CollisionInitialState_hh
37
38#include "G4KineticTrack.hh"
40#include "G4HadTmpUtil.hh"
41
42class G4BCAction;
43
45{
46
47public:
50 G4KineticTrack * aTarget);
52 const G4KineticTrackVector & aTarget,
53 G4BCAction * aFSGenerator);
54
56
59
61 {return (theCollisionTime < right.theCollisionTime);}
62
64 {return (theCollisionTime == right.theCollisionTime);}
65
66
68 {return thePrimary;}
69 void SetPrimary(G4KineticTrack * aPrimary)
70 {thePrimary = aPrimary;}
71
73 {return theTarget;}
74 void SetTarget(G4KineticTrack * aTarget)
75 {theTarget = aTarget;}
76
77 void AddTarget(G4KineticTrack * aTarget)
78 {theTs.push_back(aTarget);}
80 {return theTs;}
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 }
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 }
100
101// -new interface post pion:
102
104 {return theCollisionTime;}
106 {theCollisionTime = value;}
107
108// for debugging only
110 {
111 return theFSGenerator;
112 }
113
114
115 void Print() const;
116
117// friend std::ostream& operator<<(std::ostream & out, const G4CollisionInitialState & collision){
118// out=1;
119// return out;
120// }
121
122
123private:
124
125 G4double theCollisionTime;
126 G4KineticTrack * thePrimary;
127 G4KineticTrack * theTarget;
129 G4BCAction * theFSGenerator;
130};
131
132#endif
133
134
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void SetPrimary(G4KineticTrack *aPrimary)
G4KineticTrackVector & GetTargetCollection(void)
G4KineticTrackVector * GetFinalState()
G4bool operator<(const G4CollisionInitialState &right) const
void SetTarget(G4KineticTrack *aTarget)
const G4BCAction * GetGenerator()
G4bool operator==(const G4CollisionInitialState &right) const
G4KineticTrack * GetTarget(void)
void SetCollisionTime(G4double value)
G4KineticTrack * GetPrimary(void)
G4CollisionInitialState & operator=(const G4CollisionInitialState &right)
void AddTarget(G4KineticTrack *aTarget)
int G4lrint(double ad)
Definition: templates.hh:134