Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:00

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Author:  Michael Kelsey (SLAC)
0027 // Date:    15 April 2013
0028 //
0029 // Description: Subclass of models/util G4VHadDecayAlgorithm which uses
0030 //      old INUCL parametrizations for momentum and angular
0031 //      distributions.
0032 //
0033 
0034 #ifndef G4CascadeFinalStateAlgorithm_hh
0035 #define G4CascadeFinalStateAlgorithm_hh 1
0036 
0037 #include "globals.hh"
0038 #include "G4VHadDecayAlgorithm.hh"
0039 #include "G4LorentzConvertor.hh"
0040 
0041 class G4InuclElementaryParticle;
0042 class G4MultiBodyMomentumDist;
0043 class G4TwoBodyAngularDist;
0044 class G4VMultiBodyMomDst;
0045 class G4VTwoBodyAngDst;
0046 
0047 
0048 class G4CascadeFinalStateAlgorithm : public G4VHadDecayAlgorithm {
0049 public:
0050   G4CascadeFinalStateAlgorithm();
0051   virtual ~G4CascadeFinalStateAlgorithm();
0052 
0053   virtual void SetVerboseLevel(G4int verbose);  // Pass through to factories
0054 
0055   // Select appropriate distributions based on interaction
0056   void Configure(G4InuclElementaryParticle* bullet,
0057          G4InuclElementaryParticle* target,
0058          const std::vector<G4int>& particle_kinds);
0059 
0060 protected:
0061   // Two-body generation uses angular-distribution function
0062   virtual void GenerateTwoBody(G4double initialMass,
0063                    const std::vector<G4double>& masses,
0064                    std::vector<G4LorentzVector>& finalState);
0065 
0066   // N-body generation uses momentum-modulus distribution, computed angles
0067   virtual void GenerateMultiBody(G4double initialMass,
0068                  const std::vector<G4double>& masses,
0069                  std::vector<G4LorentzVector>& finalState);
0070 
0071   // Compute kinematic quantities needed for distributions
0072   void SaveKinematics(G4InuclElementaryParticle* bullet,
0073               G4InuclElementaryParticle* target);
0074 
0075   // Select generator based on initial and final state
0076   void ChooseGenerators(G4int is, G4int fs);
0077 
0078   // Generate momentum magnitudes and validate for use
0079   void FillMagnitudes(G4double initialMass,
0080               const std::vector<G4double>& masses);
0081 
0082   G4bool satisfyTriangle(const std::vector<G4double>& pmod) const;
0083 
0084   // Generate momentum directions into final state
0085   void FillDirections(G4double initialMass,
0086               const std::vector<G4double>& masses,
0087               std::vector<G4LorentzVector>& finalState);
0088 
0089   void FillDirThreeBody(G4double initialMass,
0090             const std::vector<G4double>& masses,
0091             std::vector<G4LorentzVector>& finalState);
0092 
0093   void FillDirManyBody(G4double initialMass,
0094                const std::vector<G4double>& masses,
0095                std::vector<G4LorentzVector>& finalState);
0096 
0097   G4double GenerateCosTheta(G4int ptype, G4double pmod) const;
0098 
0099   // SPECIAL:  Generate N-body phase space using Kopylov algorithm
0100   void FillUsingKopylov(G4double initialMass,
0101             const std::vector<G4double>& masses,
0102             std::vector<G4LorentzVector>& finalState);
0103 
0104   G4double BetaKopylov(G4int K) const;  // Copied from G4HadPhaseSpaceKopylov
0105 
0106 private:
0107   const G4VMultiBodyMomDst* momDist;    // Buffers for selected distributions
0108   const G4VTwoBodyAngDst* angDist;  // Will be NULL for 3+body channels
0109 
0110   std::vector<G4int> kinds;     // Copy of particle_kinds list
0111   G4int multiplicity;           // Final state size, for convenience
0112   G4double bullet_ekin;         // Kinematics needed for distributions
0113   G4LorentzConvertor toSCM;     // Handles complex rotations/transforms
0114 
0115   std::vector<G4double> modules;    // Buffers for generating momenta
0116   G4ThreeVector mom;
0117 
0118   static const G4double maxCosTheta;    // Cut for valid polar angle generation
0119   static const G4double oneOverE;   // Numeric value of 1/e for calculations
0120   static const G4double small;      // Cut for momentum/kinematics
0121   static const G4int itry_max;      // Maximum number of generation attempts
0122 };
0123 
0124 #endif  /* G4CascadeFinalStateAlgorithm_hh */