Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef G4GeneralNNCollision_h
0027 #define G4GeneralNNCollision_h
0028 
0029 #include "G4CollisionComposite.hh"
0030 #include "G4Proton.hh"
0031 #include "G4Neutron.hh"
0032 #include "G4HadParticleCodes.hh"
0033 #include "G4Pair.hh"
0034 
0035 class G4GeneralNNCollision : public G4CollisionComposite
0036 {
0037   public:
0038 
0039   G4bool 
0040   IsInCharge(const G4KineticTrack& trk1, const G4KineticTrack& trk2) const
0041   {
0042     G4bool result = false;
0043     const G4ParticleDefinition * aD = trk1.GetDefinition();
0044     const G4ParticleDefinition * bD = trk2.GetDefinition();
0045     if(  (aD==G4Proton::Proton() || aD == G4Neutron::Neutron())
0046        &&(bD==G4Proton::Proton() || bD == G4Neutron::Neutron()) ) result = true;
0047     return result;
0048   }
0049   
0050   protected:
0051 
0052   template <int dm, int d0, int dp, int dpp, class channelType> 
0053   struct MakeNNToNDelta {
0054   static void Make(G4CollisionComposite * aC)
0055   {
0056     typedef INT4<channelType, NeutronPC, NeutronPC, NeutronPC, d0>  theC1;
0057     typedef INT4<channelType, NeutronPC, NeutronPC, ProtonPC,  dm>  theC2;
0058     typedef INT4<channelType, NeutronPC, ProtonPC,  ProtonPC,  d0>  theC3;
0059     typedef INT4<channelType, NeutronPC, ProtonPC,  NeutronPC, dp>  theC4;
0060     typedef INT4<channelType, ProtonPC,  ProtonPC,  NeutronPC, dpp> theC5;
0061     typedef INT4<channelType, ProtonPC,  ProtonPC,  ProtonPC,  dp>  theC6;
0062     typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
0063     G4CollisionComposite::Resolve aR;
0064     G4ForEach<theChannels>::Apply(&aR, aC); 
0065   }};
0066 
0067   template <int Np, int Nn, class channelType> 
0068   struct MakeNNToNNStar{
0069   static void Make(G4CollisionComposite * aC)
0070   {
0071     typedef INT4<channelType, NeutronPC, NeutronPC, NeutronPC, Nn>  theC1;
0072     typedef INT4<channelType, ProtonPC,  ProtonPC,  ProtonPC,  Np>  theC2;
0073     typedef INT4<channelType, NeutronPC, ProtonPC,  NeutronPC, Np>  theC3;
0074     typedef INT4<channelType, NeutronPC, ProtonPC,  ProtonPC,  Nn>  theC4;
0075     typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
0076     G4CollisionComposite::Resolve aR;
0077     G4ForEach<theChannels>::Apply(&aR, aC); 
0078   }};
0079   
0080   template <class channelType, int Np, int Nn> 
0081   struct MakeNNStarToNN{
0082   static void Make(G4CollisionComposite * aC)
0083   {
0084     typedef INT4<channelType, Nn, NeutronPC, NeutronPC, NeutronPC>  theC1;
0085     typedef INT4<channelType, Np, ProtonPC,  ProtonPC,  ProtonPC>   theC2;
0086     typedef INT4<channelType, Np, NeutronPC, NeutronPC, ProtonPC>   theC3;
0087     typedef INT4<channelType, Nn, ProtonPC, NeutronPC, ProtonPC>    theC4;
0088     typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
0089     G4CollisionComposite::Resolve aR;
0090     G4ForEach<theChannels>::Apply(&aR, aC); 
0091   }};
0092   
0093   template <int Np, class channelType, int Nn> 
0094   struct MakeNNToDeltaNstar{
0095   static void Make(G4CollisionComposite * aC)
0096   {
0097     typedef INT4<channelType, NeutronPC, NeutronPC, D1232::D0,  Nn>  theC1;
0098     typedef INT4<channelType, NeutronPC, NeutronPC, D1232::Dm,  Np>  theC2;
0099     typedef INT4<channelType, ProtonPC,  ProtonPC,  D1232::Dp,  Np>  theC3;
0100     typedef INT4<channelType, ProtonPC,  ProtonPC,  D1232::Dpp, Nn>  theC4;
0101     typedef INT4<channelType, NeutronPC, ProtonPC,  D1232::D0,  Np>  theC5;
0102     typedef INT4<channelType, NeutronPC, ProtonPC,  D1232::Dp,  Nn>  theC6;
0103     typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
0104     G4CollisionComposite::Resolve aR;
0105     G4ForEach<theChannels>::Apply(&aR, aC); 
0106   }};
0107   
0108   template <int dm, int d0, int dp, int dpp, class channelType> 
0109   struct MakeNNToDeltaDelta{
0110   static void Make(G4CollisionComposite * aC)
0111   {
0112     typedef INT4<channelType, NeutronPC, NeutronPC, DeltamPC, dp>  theC1;
0113     typedef INT4<channelType, NeutronPC, NeutronPC, Delta0PC, d0>  theC2;
0114     typedef INT4<channelType, NeutronPC, NeutronPC, DeltapPC, dm>  theC3;
0115     typedef INT4<channelType, NeutronPC, ProtonPC, DeltapPC, d0>  theC4;
0116     typedef INT4<channelType, NeutronPC, ProtonPC, Delta0PC, dp>  theC5;
0117     typedef INT4<channelType, NeutronPC, ProtonPC, DeltamPC, dpp>  theC6;
0118     typedef INT4<channelType, NeutronPC, ProtonPC, DeltappPC, dm>  theC7;
0119     typedef INT4<channelType, ProtonPC, ProtonPC, Delta0PC, dpp>  theC8;
0120     typedef INT4<channelType, ProtonPC, ProtonPC, DeltapPC, dp>  theC9;
0121     typedef INT4<channelType, ProtonPC, ProtonPC, DeltappPC, d0>  theC10;
0122     typedef GROUP10(theC1, theC2, theC3, theC4, theC5, theC6, theC7, theC8, theC9, theC10) theChannels;
0123     G4CollisionComposite::Resolve aR;
0124     G4ForEach<theChannels>::Apply(&aR, aC); 
0125   }};
0126 };
0127 
0128 #endif