Geant4  10.03.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 89688 2015-04-27 10:06:44Z gcosmo $
28 //
29 // $Id: G4CollisionInitialState.hh,v 1.0 1998/06/30
30 // -----------------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // History: first implementation, A. Feliciello, 30th June 1998
34 
35 // -----------------------------------------------------------------------------
36 
37 #ifndef G4CollisionInitialState_hh
38 #define G4CollisionInitialState_hh
39 
40 #include "G4KineticTrack.hh"
41 #include "G4KineticTrackVector.hh"
42 #include "G4HadTmpUtil.hh"
43 
44 class G4BCAction;
45 
47 {
48 
49 public:
52  G4KineticTrack * aTarget);
54  const G4KineticTrackVector & aTarget,
55  G4BCAction * aFSGenerator);
56 
58 
61 
63  {return (theCollisionTime < right.theCollisionTime);}
64 
66  {return (theCollisionTime == right.theCollisionTime);}
67 
68 
70  {return thePrimary;}
71  void SetPrimary(G4KineticTrack * aPrimary)
72  {thePrimary = aPrimary;}
73 
75  {return theTarget;}
76  void SetTarget(G4KineticTrack * aTarget)
77  {theTarget = aTarget;}
78 
79  void AddTarget(G4KineticTrack * aTarget)
80  {theTs.push_back(aTarget);}
82  {return theTs;}
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  }
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  }
102 
103 // -new interface post pion:
104 
106  {return theCollisionTime;}
108  {theCollisionTime = value;}
109 
110 // for debugging only
112  {
113  return theFSGenerator;
114  }
115 
116 
117  void Print() const;
118 
119 // friend std::ostream& operator<<(std::ostream & out, const G4CollisionInitialState & collision){
120 // out=1;
121 // return out;
122 // }
123 
124 
125 private:
126 
127  G4double theCollisionTime;
128  G4KineticTrack * thePrimary;
129  G4KineticTrack * theTarget;
130  G4KineticTrackVector theTs;
131  G4BCAction * theFSGenerator;
132 };
133 
134 #endif
135 
136 
G4double G4ParticleHPJENDLHEData::G4double result
G4KineticTrack * GetPrimary(void)
int G4int
Definition: G4Types.hh:78
G4KineticTrackVector * GetFinalState()
int operator==(const G4CollisionInitialState &right) const
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4KineticTrack * GetTarget(void)
int operator<(const G4CollisionInitialState &right) const
G4KineticTrackVector & GetTargetCollection(void)
void SetTarget(G4KineticTrack *aTarget)
int G4lrint(double ad)
Definition: templates.hh:163
void SetPrimary(G4KineticTrack *aPrimary)
G4CollisionInitialState & operator=(const G4CollisionInitialState &right)
double G4double
Definition: G4Types.hh:76
void AddTarget(G4KineticTrack *aTarget)
const G4BCAction * GetGenerator()
void SetCollisionTime(G4double value)