File indexing completed on 2025-01-18 09:58:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 #ifndef G4COLLISION_OUTPUT_HH
0050 #define G4COLLISION_OUTPUT_HH
0051
0052 #include "G4Fragment.hh"
0053 #include "G4InuclElementaryParticle.hh"
0054 #include "G4InuclNuclei.hh"
0055 #include "G4LorentzRotation.hh"
0056 #include "G4ReactionProductVector.hh"
0057 #include "G4ios.hh"
0058 #include <iosfwd>
0059 #include <algorithm>
0060 #include <vector>
0061
0062 class G4CascadParticle;
0063 class G4LorentzConvertor;
0064
0065 class G4CollisionOutput
0066 {
0067 public:
0068
0069 G4CollisionOutput();
0070 G4CollisionOutput& operator=(const G4CollisionOutput& right);
0071
0072 void setVerboseLevel(G4int verbose) { verboseLevel = verbose; };
0073
0074
0075
0076 void reset();
0077
0078 void add(const G4CollisionOutput& right);
0079
0080 void addOutgoingParticle(const G4InuclElementaryParticle& particle) {
0081 outgoingParticles.push_back(particle);
0082 }
0083
0084 void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles);
0085
0086 void addOutgoingNucleus(const G4InuclNuclei& nuclei) {
0087 outgoingNuclei.push_back(nuclei);
0088 };
0089
0090 void addOutgoingNuclei(const std::vector<G4InuclNuclei>& nuclea);
0091
0092
0093 void addOutgoingParticle(const G4CascadParticle& cparticle);
0094 void addOutgoingParticles(const std::vector<G4CascadParticle>& cparticles);
0095
0096 void addOutgoingParticles(const G4ReactionProductVector* rproducts);
0097
0098
0099 void addRecoilFragment(const G4Fragment* aFragment) {
0100 if (aFragment) addRecoilFragment(*aFragment);
0101 }
0102
0103 void addRecoilFragment(const G4Fragment& aFragment) {
0104 recoilFragments.push_back(aFragment);
0105 }
0106
0107
0108
0109 void removeOutgoingParticle(G4int index);
0110 void removeOutgoingParticle(const G4InuclElementaryParticle& particle);
0111 void removeOutgoingParticle(const G4InuclElementaryParticle* particle) {
0112 if (particle) removeOutgoingParticle(*particle);
0113 }
0114
0115 void removeOutgoingNucleus(G4int index);
0116 void removeOutgoingNucleus(const G4InuclNuclei& nuclei);
0117 void removeOutgoingNucleus(const G4InuclNuclei* nuclei) {
0118 if (nuclei) removeOutgoingNucleus(*nuclei);
0119 }
0120
0121 void removeRecoilFragment(G4int index=-1);
0122
0123
0124
0125 G4int numberOfOutgoingParticles() const { return (G4int)outgoingParticles.size(); }
0126
0127 const std::vector<G4InuclElementaryParticle>& getOutgoingParticles() const {
0128 return outgoingParticles;
0129 };
0130
0131 std::vector<G4InuclElementaryParticle>& getOutgoingParticles() {
0132 return outgoingParticles;
0133 };
0134
0135 G4int numberOfOutgoingNuclei() const { return (G4int)outgoingNuclei.size(); };
0136
0137 const std::vector<G4InuclNuclei>& getOutgoingNuclei() const {
0138 return outgoingNuclei;
0139 };
0140
0141 std::vector<G4InuclNuclei>& getOutgoingNuclei() { return outgoingNuclei; };
0142
0143 G4int numberOfFragments() const { return (G4int)recoilFragments.size(); }
0144
0145 const G4Fragment& getRecoilFragment(G4int index=0) const;
0146
0147 const std::vector<G4Fragment>& getRecoilFragments() const {
0148 return recoilFragments;
0149 };
0150
0151 std::vector<G4Fragment>& getRecoilFragments() { return recoilFragments; };
0152
0153
0154
0155 G4LorentzVector getTotalOutputMomentum() const;
0156 G4int getTotalCharge() const;
0157 G4int getTotalBaryonNumber() const;
0158 G4int getTotalStrangeness() const;
0159
0160 void printCollisionOutput(std::ostream& os=G4cout) const;
0161
0162
0163
0164 void boostToLabFrame(const G4LorentzConvertor& convertor);
0165 G4LorentzVector boostToLabFrame(G4LorentzVector mom,
0166 const G4LorentzConvertor& convertor) const;
0167
0168 void rotateEvent(const G4LorentzRotation& rotate);
0169 void trivialise(G4InuclParticle* bullet, G4InuclParticle* target);
0170 void setOnShell(G4InuclParticle* bullet, G4InuclParticle* target);
0171 void setRemainingExitationEnergy();
0172
0173 G4double getRemainingExitationEnergy() const { return eex_rest; };
0174 G4bool acceptable() const { return on_shell; };
0175
0176 private:
0177
0178 G4int verboseLevel;
0179
0180 std::vector<G4InuclElementaryParticle> outgoingParticles;
0181 std::vector<G4InuclNuclei> outgoingNuclei;
0182 std::vector<G4Fragment> recoilFragments;
0183 static const G4Fragment emptyFragment;
0184
0185 std::pair<std::pair<G4int,G4int>, G4int> selectPairToTune(G4double de) const;
0186 G4bool tuneSelectedPair(G4LorentzVector& mom1, G4LorentzVector& mom2,
0187 G4int mom_index) const;
0188
0189 G4double eex_rest;
0190 G4LorentzVector mom_non_cons;
0191 G4bool on_shell;
0192 };
0193
0194 #endif
0195