00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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