Geant4  10.01.p02
G4GeneralNNCollision.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 #ifndef G4GeneralNNCollision_h
27 #define G4GeneralNNCollision_h
28 
29 #include "G4CollisionComposite.hh"
30 #include "G4Proton.hh"
31 #include "G4Neutron.hh"
32 #include "G4HadParticleCodes.hh"
33 #include "G4Pair.hh"
34 
36 {
37  public:
38 
39  G4bool
40  IsInCharge(const G4KineticTrack& trk1, const G4KineticTrack& trk2) const
41  {
42  G4bool result = false;
43  const G4ParticleDefinition * aD = trk1.GetDefinition();
44  const G4ParticleDefinition * bD = trk2.GetDefinition();
45  if( (aD==G4Proton::Proton() || aD == G4Neutron::Neutron())
46  &&(bD==G4Proton::Proton() || bD == G4Neutron::Neutron()) ) result = true;
47  return result;
48  }
49 
50  protected:
51 
52  template <int dm, int d0, int dp, int dpp, class channelType>
53  struct MakeNNToNDelta {
54  static void Make(G4CollisionComposite * aC)
55  {
62  typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
65  }};
66 
67  template <int Np, int Nn, class channelType>
69  static void Make(G4CollisionComposite * aC)
70  {
75  typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
78  }};
79 
80  template <class channelType, int Np, int Nn>
82  static void Make(G4CollisionComposite * aC)
83  {
88  typedef GROUP4(theC1, theC2, theC3, theC4) theChannels;
91  }};
92 
93  template <int Np, class channelType, int Nn>
95  static void Make(G4CollisionComposite * aC)
96  {
103  typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels;
106  }};
107 
108  template <int dm, int d0, int dp, int dpp, class channelType>
110  static void Make(G4CollisionComposite * aC)
111  {
122  typedef GROUP10(theC1, theC2, theC3, theC4, theC5, theC6, theC7, theC8, theC9, theC10) theChannels;
125  }};
126 };
127 
128 #endif
static void Apply()
Definition: G4Pair.hh:179
#define GROUP10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
Definition: G4Pair.hh:50
INT4< channelType, NeutronPC, NeutronPC, Delta0PC, Delta0PC > theC1
INT4< channelType, ProtonPC, ProtonPC, DeltapPC, DeltapPC > theC5
static void Make(G4CollisionComposite *aC)
G4bool IsInCharge(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
INT4< channelType, NeutronPC, ProtonPC, DeltamPC, DeltappPC > theC4
INT4< channelType, NeutronPC, ProtonPC, Delta0PC, DeltapPC > theC3
Definition: G4Pair.hh:207
static void Make(G4CollisionComposite *aC)
static void Make(G4CollisionComposite *aC)
bool G4bool
Definition: G4Types.hh:79
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
INT4< channelType, NeutronPC, NeutronPC, DeltamPC, DeltapPC > theC2
#define GROUP4(t1, t2, t3, t4)
Definition: G4Pair.hh:44
typedef GROUP6(theC1, theC2, theC3, theC4, theC5, theC6) theChannels
static void Make(G4CollisionComposite *aC)
static void Make(G4CollisionComposite *aC)
const G4ParticleDefinition * GetDefinition() const
INT4< channelType, ProtonPC, ProtonPC, Delta0PC, DeltappPC > theC6