Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ElementaryParticleCollider.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 // $Id$
27 //
28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
29 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes.
30 // 20100407 M. Kelsey -- Eliminate return-by-value std::vector<> by creating
31 // three data buffers for particles, momenta, and particle types.
32 // The following functions now return void and are non-const:
33 // ::generateSCMfinalState()
34 // ::generateMomModules() (also remove input vector)
35 // ::generateStrangeChannelPartTypes()
36 // ::generateSCMpionAbsorption()
37 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide(); merge
38 // public vs. private ::collide() functions.
39 // 20100511 M. Kelsey -- Remove G4PionSampler and G4NucleonSampler. Expand
40 // particle-types selector to all modes, not just strangeness.
41 // 20100517 M. Kelsey -- Inherit from common base class, make arrays static
42 // 20100714 M. Kelsey -- Switch to new G4CascadeColliderBase class
43 // 20100726 M. Kelsey -- Move remaining std::vector<> buffers here
44 // 20100804 M. Kelsey -- Add printFinalStateTables() function.
45 // 20110923 M. Kelsey -- Add optional stream& to printFinalStateTables().
46 
47 #ifndef G4ELEMENTARY_PARTICLE_COLLIDER_HH
48 #define G4ELEMENTARY_PARTICLE_COLLIDER_HH
49 
50 #include "G4CascadeColliderBase.hh"
52 #include "G4LorentzVector.hh"
53 #include <iosfwd>
54 #include <vector>
55 
56 class G4LorentzConvertor;
57 class G4CollisionOutput;
58 
59 
61 public:
64 
66  G4CollisionOutput& output);
67 
68 private:
69  void initializeArrays();
70 
71  G4int generateMultiplicity(G4int is, G4double ekin) const;
72 
73  void generateOutgoingPartTypes(G4int is, G4int mult, G4double ekin);
74 
75  void generateSCMfinalState(G4double ekin, G4double etot_scm, G4double pscm,
76  G4InuclElementaryParticle* particle1,
77  G4InuclElementaryParticle* particle2,
78  G4LorentzConvertor* toSCM);
79 
80  void generateSCMpionAbsorption(G4double etot_scm,
81  G4InuclElementaryParticle* particle1,
82  G4InuclElementaryParticle* particle2);
83 
84  void generateMomModules(G4int mult, G4int is, G4double ekin,
85  G4double etot_cm);
86 
87  // Samples the CM momentum for elastic and charge exchange scattering
88  //
90  sampleCMmomentumFor2to2(G4int is, G4int kw, G4double ekin,
91  G4double pscm) const;
92 
93 
94  // Samples cos(theta) in the CM for elastic and charge exchange scattering
95  //
96  G4double sampleCMcosFor2to2(G4double pscm, G4double pFrac,
97  G4double pA, G4double pC, G4double pCos) const;
98 
99 
100  G4double getMomModuleFor2toMany(G4int is, G4int mult, G4int knd,
101  G4double ekin) const;
102 
103 
104  G4bool satisfyTriangle(const std::vector<G4double>& modules) const;
105 
107  particleSCMmomentumFor2to3(G4int is, G4int knd, G4double ekin,
108  G4double pmod) const;
109 
110  void printFinalStateTables(std::ostream& os=G4cout) const;
111 
112  // Internal buffers for lists of secondaries
113  std::vector<G4InuclElementaryParticle> particles;
114  std::vector<G4LorentzVector> scm_momentums;
115  std::vector<G4double> modules;
116  std::vector<G4double> masses2;
117  std::vector<G4int> particle_kinds;
118 
119  // Parameter arrays
120  static const G4double rmn[14][10][2];
121  static const G4double abn[4][4][4];
122 };
123 
124 #endif /* G4ELEMENTARY_PARTICLE_COLLIDER_HH */
125 
126