Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 //---------------------------------------------------------------------------
0028 //
0029 // ClassName:    G4CRCoalescence   ("CR" stands for "Cosmic Ray")
0030 //
0031 // Author:       2020 Alberto Ribon , based on code written by
0032 //               Diego Mauricio Gomez Coral for the GAPS Collaboration
0033 //
0034 // Description:  This class can be optionally used in the method:
0035 //
0036 //                 G4TheoFSGenerator::ApplyYourself
0037 //
0038 //               to coalesce pairs of proton-neutron and antiproton-antineutron
0039 //               into deuterons and antideuterons, respectively, from the list
0040 //               of secondaries produced by a string model.
0041 //               This class can be useful in particular for Cosmic Ray (CR)
0042 //               applications.
0043 //               By default, this class is not used.
0044 //               However, it can be enabled via the UI command:
0045 //
0046 //                 /process/had/enableCRCoalescence true
0047 //
0048 //               It is assumed that the candidate proton-neutron and
0049 //               antiproton-antideuteron pairs originate from the same
0050 //               spatial position, so the condition for coalescence takes
0051 //               into account only their closeness in momentum space.
0052 //
0053 //               This class is based entirely on code written by
0054 //               Diego Mauricio Gomez Coral for the GAPS Collaboration.
0055 //               The main application of this work is for cosmic ray physics.
0056 //
0057 //               Notes:
0058 //               -  In its current version, coalescence can occur only for
0059 //                  proton projectile (because the coalescence parameters
0060 //                  for deuteron and antideuteron are set to non-null values
0061 //                  only for the case of proton projectile).
0062 //               -  This class is not meant be used for secondaries produces
0063 //                  by intranuclear cascade models - such as BERT, BIC and
0064 //                  INCL - which should have already a coalescence phase.
0065 //
0066 // Modified:
0067 //
0068 //----------------------------------------------------------------------------
0069 //
0070 #ifndef G4CRCoalescence_h
0071 #define G4CRCoalescence_h 1
0072 
0073 #include "G4ReactionProductVector.hh"
0074 #include "G4HadProjectile.hh"
0075 #include "G4HadronicInteraction.hh"
0076 
0077 class G4CRCoalescence : public G4HadronicInteraction {
0078   public:
0079   
0080     explicit G4CRCoalescence();
0081     ~G4CRCoalescence() override;
0082     G4CRCoalescence( const G4CRCoalescence &right ) = delete;
0083     const G4CRCoalescence & operator=( const G4CRCoalescence &right ) = delete;
0084     G4bool operator==( const G4CRCoalescence &right ) const = delete;
0085     G4bool operator!=( const G4CRCoalescence &right ) const = delete;
0086 
0087     // Set the parameter used in the coalescence condition
0088     void SetP0Coalescence( const G4HadProjectile &thePrimary, G4String /* model */ );
0089 
0090     // Main method: form deuterons and antideuterons by coalescence of, respectively,
0091     //              proton-neutron and antiproton-antineutron pairs with close momenta
0092     void GenerateDeuterons( G4ReactionProductVector* result );
0093 
0094   private:
0095  
0096     // Utility methods
0097     void PushDeuteron( const G4ThreeVector &p1, const G4ThreeVector &p2, G4int charge,
0098                G4ReactionProductVector* result );
0099     G4int FindPartner( const G4ThreeVector &p1, G4double m1,
0100                std::vector< std::pair< G4int, G4ThreeVector > > &neutron,
0101                G4double m2, G4int charge );
0102     G4bool Coalescence( const G4ThreeVector &p1, G4double m1,
0103             const G4ThreeVector &p2, G4double m2, G4int charge );
0104     G4bool Coalescence( G4double p1x, G4double p1y, G4double p1z, G4double m1,
0105                         G4double p2x, G4double p2y, G4double p2z, G4double m2, G4int charge );
0106     G4double GetPcm( const G4ThreeVector& p1, G4double m1,
0107              const G4ThreeVector& p2, G4double m2 );
0108     G4double GetPcm( G4double p1x, G4double p1y, G4double p1z, G4double m1,
0109              G4double p2x, G4double p2y, G4double p2z, G4double m2 );
0110     G4double GetS( G4double p1x, G4double p1y, G4double p1z, G4double m1,
0111            G4double p2x, G4double p2y, G4double p2z, G4double m2 );
0112   
0113     G4double fP0_d;     // Coalescence parameter for deuterons
0114     G4double fP0_dbar;  // Coalescence parameter for antideuterons
0115 
0116     G4int secID;  // Creator model ID for the secondaries created by this model 
0117 };
0118 
0119 #endif