ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CascadeFinalStateAlgorithm.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4CascadeFinalStateAlgorithm.hh
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 // Author: Michael Kelsey (SLAC)
27 // Date: 15 April 2013
28 //
29 // Description: Subclass of models/util G4VHadDecayAlgorithm which uses
30 // old INUCL parametrizations for momentum and angular
31 // distributions.
32 //
33 
34 #ifndef G4CascadeFinalStateAlgorithm_hh
35 #define G4CascadeFinalStateAlgorithm_hh 1
36 
37 #include "globals.hh"
38 #include "G4VHadDecayAlgorithm.hh"
39 #include "G4LorentzConvertor.hh"
40 
44 class G4VMultiBodyMomDst;
45 class G4VTwoBodyAngDst;
46 
47 
49 public:
52 
53  virtual void SetVerboseLevel(G4int verbose); // Pass through to factories
54 
55  // Select appropriate distributions based on interaction
58  const std::vector<G4int>& particle_kinds);
59 
60 protected:
61  // Two-body generation uses angular-distribution function
62  virtual void GenerateTwoBody(G4double initialMass,
63  const std::vector<G4double>& masses,
64  std::vector<G4LorentzVector>& finalState);
65 
66  // N-body generation uses momentum-modulus distribution, computed angles
67  virtual void GenerateMultiBody(G4double initialMass,
68  const std::vector<G4double>& masses,
69  std::vector<G4LorentzVector>& finalState);
70 
71  // Compute kinematic quantities needed for distributions
74 
75  // Select generator based on initial and final state
76  void ChooseGenerators(G4int is, G4int fs);
77 
78  // Generate momentum magnitudes and validate for use
79  void FillMagnitudes(G4double initialMass,
80  const std::vector<G4double>& masses);
81 
82  G4bool satisfyTriangle(const std::vector<G4double>& pmod) const;
83 
84  // Generate momentum directions into final state
85  void FillDirections(G4double initialMass,
86  const std::vector<G4double>& masses,
87  std::vector<G4LorentzVector>& finalState);
88 
89  void FillDirThreeBody(G4double initialMass,
90  const std::vector<G4double>& masses,
91  std::vector<G4LorentzVector>& finalState);
92 
93  void FillDirManyBody(G4double initialMass,
94  const std::vector<G4double>& masses,
95  std::vector<G4LorentzVector>& finalState);
96 
97  G4double GenerateCosTheta(G4int ptype, G4double pmod) const;
98 
99  // SPECIAL: Generate N-body phase space using Kopylov algorithm
100  void FillUsingKopylov(G4double initialMass,
101  const std::vector<G4double>& masses,
102  std::vector<G4LorentzVector>& finalState);
103 
104  G4double BetaKopylov(G4int K) const; // Copied from G4HadPhaseSpaceKopylov
105 
106 private:
107  const G4VMultiBodyMomDst* momDist; // Buffers for selected distributions
108  const G4VTwoBodyAngDst* angDist; // Will be NULL for 3+body channels
109 
110  std::vector<G4int> kinds; // Copy of particle_kinds list
111  G4int multiplicity; // Final state size, for convenience
112  G4double bullet_ekin; // Kinematics needed for distributions
113  G4LorentzConvertor toSCM; // Handles complex rotations/transforms
114 
115  std::vector<G4double> modules; // Buffers for generating momenta
117 
118  static const G4double maxCosTheta; // Cut for valid polar angle generation
119  static const G4double oneOverE; // Numeric value of 1/e for calculations
120  static const G4double small; // Cut for momentum/kinematics
121  static const G4int itry_max; // Maximum number of generation attempts
122 };
123 
124 #endif /* G4CascadeFinalStateAlgorithm_hh */