G4GeneralNNCollision.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 #ifndef G4GeneralNNCollision_h
00027 #define G4GeneralNNCollision_h
00028 
00029 #include "G4CollisionComposite.hh"
00030 #include "G4Proton.hh"
00031 #include "G4Neutron.hh"
00032 #include "G4HadParticleCodes.hh"
00033 #include "G4Pair.hh"
00034 
00035 class G4GeneralNNCollision : public G4CollisionComposite
00036 {
00037   public:
00038 
00039   G4bool 
00040   IsInCharge(const G4KineticTrack& trk1, const G4KineticTrack& trk2) const
00041   {
00042     G4bool result = false;
00043     G4ParticleDefinition * aD = trk1.GetDefinition();
00044     G4ParticleDefinition * bD = trk2.GetDefinition();
00045     if(  (aD==G4Proton::Proton() || aD == G4Neutron::Neutron())
00046        &&(bD==G4Proton::Proton() || bD == G4Neutron::Neutron()) ) result = true;
00047     return result;
00048   }
00049   
00050   protected:
00051 
00052   template <int dm, int d0, int dp, int dpp, class channelType> 
00053   struct MakeNNToNDelta {
00054   static void Make(G4CollisionComposite * aC)
00055   {
00056     typedef INT4<channelType, NeutronPC, NeutronPC, NeutronPC, d0>  theC1;
00057     typedef INT4<channelType, NeutronPC, NeutronPC, ProtonPC,  dm>  theC2;
00058     typedef INT4<channelType, NeutronPC, ProtonPC,  ProtonPC,  d0>  theC3;
00059     typedef INT4<channelType, NeutronPC, ProtonPC,  NeutronPC, dp>  theC4;
00060     typedef INT4<channelType, ProtonPC,  ProtonPC,  NeutronPC, dpp> theC5;
00061     typedef INT4<channelType, ProtonPC,  ProtonPC,  ProtonPC,  dp>  theC6;
00062     typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
00063     G4CollisionComposite::Resolve aR;
00064     G4ForEach<theChannels>::Apply(&aR, aC); 
00065   }};
00066 
00067   template <int Np, int Nn, class channelType> 
00068   struct MakeNNToNNStar{
00069   static void Make(G4CollisionComposite * aC)
00070   {
00071     typedef INT4<channelType, NeutronPC, NeutronPC, NeutronPC, Nn>  theC1;
00072     typedef INT4<channelType, ProtonPC,  ProtonPC,  ProtonPC,  Np>  theC2;
00073     typedef INT4<channelType, NeutronPC, ProtonPC,  NeutronPC, Np>  theC3;
00074     typedef INT4<channelType, NeutronPC, ProtonPC,  ProtonPC,  Nn>  theC4;
00075     typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
00076     G4CollisionComposite::Resolve aR;
00077     G4ForEach<theChannels>::Apply(&aR, aC); 
00078   }};
00079   
00080   template <class channelType, int Np, int Nn> 
00081   struct MakeNNStarToNN{
00082   static void Make(G4CollisionComposite * aC)
00083   {
00084     typedef INT4<channelType, Nn, NeutronPC, NeutronPC, NeutronPC>  theC1;
00085     typedef INT4<channelType, Np, ProtonPC,  ProtonPC,  ProtonPC>   theC2;
00086     typedef INT4<channelType, Np, NeutronPC, NeutronPC, ProtonPC>   theC3;
00087     typedef INT4<channelType, Nn, ProtonPC, NeutronPC, ProtonPC>    theC4;
00088     typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
00089     G4CollisionComposite::Resolve aR;
00090     G4ForEach<theChannels>::Apply(&aR, aC); 
00091   }};
00092   
00093   template <int Np, class channelType, int Nn> 
00094   struct MakeNNToDeltaNstar{
00095   static void Make(G4CollisionComposite * aC)
00096   {
00097     typedef INT4<channelType, NeutronPC, NeutronPC, D1232::D0,  Nn>  theC1;
00098     typedef INT4<channelType, NeutronPC, NeutronPC, D1232::Dm,  Np>  theC2;
00099     typedef INT4<channelType, ProtonPC,  ProtonPC,  D1232::Dp,  Np>  theC3;
00100     typedef INT4<channelType, ProtonPC,  ProtonPC,  D1232::Dpp, Nn>  theC4;
00101     typedef INT4<channelType, NeutronPC, ProtonPC,  D1232::D0,  Np>  theC5;
00102     typedef INT4<channelType, NeutronPC, ProtonPC,  D1232::Dp,  Nn>  theC6;
00103     typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
00104     G4CollisionComposite::Resolve aR;
00105     G4ForEach<theChannels>::Apply(&aR, aC); 
00106   }};
00107   
00108   template <int dm, int d0, int dp, int dpp, class channelType> 
00109   struct MakeNNToDeltaDelta{
00110   static void Make(G4CollisionComposite * aC)
00111   {
00112     typedef INT4<channelType, NeutronPC, NeutronPC, DeltamPC, dp>  theC1;
00113     typedef INT4<channelType, NeutronPC, NeutronPC, Delta0PC, d0>  theC2;
00114     typedef INT4<channelType, NeutronPC, NeutronPC, DeltapPC, dm>  theC3;
00115     typedef INT4<channelType, NeutronPC, ProtonPC, DeltapPC, d0>  theC4;
00116     typedef INT4<channelType, NeutronPC, ProtonPC, Delta0PC, dp>  theC5;
00117     typedef INT4<channelType, NeutronPC, ProtonPC, DeltamPC, dpp>  theC6;
00118     typedef INT4<channelType, NeutronPC, ProtonPC, DeltappPC, dm>  theC7;
00119     typedef INT4<channelType, ProtonPC, ProtonPC, Delta0PC, dpp>  theC8;
00120     typedef INT4<channelType, ProtonPC, ProtonPC, DeltapPC, dp>  theC9;
00121     typedef INT4<channelType, ProtonPC, ProtonPC, DeltappPC, d0>  theC10;
00122     typedef GROUP10(theC1, theC2, theC3, theC4, theC5, theC6, theC7, theC8, theC9, theC10) theChannels;
00123     G4CollisionComposite::Resolve aR;
00124     G4ForEach<theChannels>::Apply(&aR, aC); 
00125   }};
00126 };
00127 
00128 #endif

Generated on Mon May 27 17:48:21 2013 for Geant4 by  doxygen 1.4.7