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 | // GEANT 4 class implementation file |
---|
29 | // |
---|
30 | // History: first implementation, A. Feliciello, 30th June 1998 |
---|
31 | // ----------------------------------------------------------------------------- |
---|
32 | |
---|
33 | #include "G4CollisionInitialState.hh" |
---|
34 | #include "G4BCAction.hh" |
---|
35 | // Class G4CollisionInitialState |
---|
36 | |
---|
37 | G4CollisionInitialState::G4CollisionInitialState() : |
---|
38 | theCollisionTime(DBL_MAX), thePrimary(0), theTarget(0), theFSGenerator(0) |
---|
39 | { |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | G4CollisionInitialState::G4CollisionInitialState(G4double time, |
---|
44 | G4KineticTrack * aPrimary, G4KineticTrack * aTarget) |
---|
45 | { |
---|
46 | theCollisionTime = time; |
---|
47 | thePrimary = aPrimary; |
---|
48 | theTarget = aTarget; |
---|
49 | theTs.clear(); |
---|
50 | theFSGenerator = 0; |
---|
51 | } |
---|
52 | |
---|
53 | // +new interface post pion: |
---|
54 | G4CollisionInitialState::G4CollisionInitialState(G4double time, |
---|
55 | G4KineticTrack * aPrimary, const G4KineticTrackVector & aTarget, |
---|
56 | G4BCAction * aFSGenerator) |
---|
57 | { |
---|
58 | theCollisionTime = time; |
---|
59 | thePrimary = aPrimary; |
---|
60 | theTarget = 0; |
---|
61 | for (size_t i=0; i<aTarget.size(); i++) theTs.push_back(aTarget[i]); |
---|
62 | theFSGenerator = aFSGenerator; |
---|
63 | } |
---|
64 | // -new interface post pion: |
---|
65 | |
---|
66 | |
---|
67 | G4CollisionInitialState::G4CollisionInitialState(G4CollisionInitialState & right) |
---|
68 | { |
---|
69 | if (this != &right) |
---|
70 | { |
---|
71 | theCollisionTime = right.theCollisionTime; |
---|
72 | thePrimary = right.thePrimary; |
---|
73 | theTarget = right.theTarget; |
---|
74 | for (size_t i=0; i<right.theTs.size(); i++) theTs.push_back(right.theTs[i]); |
---|
75 | theFSGenerator = right.theFSGenerator; |
---|
76 | } |
---|
77 | } |
---|
78 | |
---|
79 | const G4CollisionInitialState & G4CollisionInitialState:: |
---|
80 | operator=(const G4CollisionInitialState& right) |
---|
81 | { |
---|
82 | if (this != &right) |
---|
83 | { |
---|
84 | theCollisionTime = right.theCollisionTime; |
---|
85 | thePrimary = right.thePrimary; |
---|
86 | theTarget = right.theTarget; |
---|
87 | for (size_t i=0; i<right.theTs.size(); i++) |
---|
88 | theTs.push_back(right.theTs[i]); |
---|
89 | theFSGenerator = right.theFSGenerator; |
---|
90 | } |
---|
91 | |
---|
92 | return *this; |
---|
93 | } |
---|
94 | |
---|
95 | //#include <typeinfo> |
---|
96 | |
---|
97 | G4KineticTrackVector * G4CollisionInitialState:: |
---|
98 | GetFinalState() |
---|
99 | { |
---|
100 | // G4cerr << "what is the FS generator? " |
---|
101 | // << typeid(*theFSGenerator).name() |
---|
102 | // <<G4endl; |
---|
103 | return theFSGenerator->GetFinalState(thePrimary, theTs); |
---|
104 | } |
---|
105 | |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | |
---|