Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id: G4CollisionInitialState.hh 69856 2013-05-16 13:32:36Z gcosmo $
28 // GEANT4 tag $Name: not supported by cvs2svn $
29 //
30 // $Id: G4CollisionInitialState.hh,v 1.0 1998/06/30
31 // -----------------------------------------------------------------------------
32 // GEANT 4 class header file
33 //
34 // History: first implementation, A. Feliciello, 30th June 1998
35 
36 // -----------------------------------------------------------------------------
37 
38 #ifndef G4CollisionInitialState_hh
39 #define G4CollisionInitialState_hh
40 
41 #include "G4KineticTrack.hh"
42 #include "G4KineticTrackVector.hh"
43 #include "G4HadTmpUtil.hh"
44 
45 class G4BCAction;
46 
48 {
49 
50 public:
53  G4KineticTrack * aTarget);
55  const G4KineticTrackVector & aTarget,
56  G4BCAction * aFSGenerator);
57 
59 
62 
64  {return (theCollisionTime < right.theCollisionTime);}
65 
67  {return (theCollisionTime == right.theCollisionTime);}
68 
69 
71  {return thePrimary;}
72  void SetPrimary(G4KineticTrack * aPrimary)
73  {thePrimary = aPrimary;}
74 
76  {return theTarget;}
77  void SetTarget(G4KineticTrack * aTarget)
78  {theTarget = aTarget;}
79 
80  void AddTarget(G4KineticTrack * aTarget)
81  {theTs.push_back(aTarget);}
83  {return theTs;}
86  {
87  G4double result=0;
88  for(size_t i=0; i<theTs.size(); i++)
89  {
90  result += theTs[i]->GetDefinition()->GetBaryonNumber();
91  }
92  return G4lrint(result);
93  }
95  {
96  G4double result=0;
97  for(size_t i=0; i<theTs.size(); i++)
98  {
99  result += theTs[i]->GetDefinition()->GetPDGCharge();
100  }
101  return G4lrint(result);
102  }
103 
104 // -new interface post pion:
105 
107  {return theCollisionTime;}
109  {theCollisionTime = value;}
110 
111 // for debugging only
113  {
114  return theFSGenerator;
115  }
116 
117 
118  void Print() const;
119 
120 // friend std::ostream& operator<<(std::ostream & out, const G4CollisionInitialState & collision){
121 // out=1;
122 // return out;
123 // }
124 
125 
126 private:
127 
128  G4double theCollisionTime;
129  G4KineticTrack * thePrimary;
130  G4KineticTrack * theTarget;
131  G4KineticTrackVector theTs;
132  G4BCAction * theFSGenerator;
133 };
134 
135 #endif
136 
137