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