Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

Location:
trunk/source/processes/hadronic/models/cascade/cascade/include
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4BigBanger.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4BigBanger.hh,v 1.13 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100315  M. Kelsey -- Remove "using" directive and unnecessary #includes.
     29// 20100407  M. Kelsey -- Replace std::vector<> returns with data members.
     30// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     31// 20100517  M. Kelsey -- Inherit from common base class
     32// 20100519  M. Kelsey -- Get rid of proton and neutron masses as arguments!
     33
    2634#ifndef G4BIG_BANGER_HH
    2735#define G4BIG_BANGER_HH
    2836
    29 #include "G4Collider.hh"
     37#include "G4VCascadeCollider.hh"
    3038#include "G4InuclElementaryParticle.hh"
    31 #include "G4InuclSpecialFunctions.hh"
     39#include <vector>
     40
     41class G4CollisionOutput;
    3242
    3343
    34 using namespace G4InuclSpecialFunctions;
     44class G4BigBanger : public G4VCascadeCollider {
     45public:
     46  G4BigBanger();
     47  virtual ~G4BigBanger() {};
    3548
    36 class G4BigBanger {
    37 
    38 public:
    39 
    40   G4BigBanger();
    41 
    42   G4CollisionOutput collide(G4InuclParticle* bullet,
    43                             G4InuclParticle* target);
     49  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     50               G4CollisionOutput& output);
    4451
    4552private:
     53  void generateBangInSCM(G4double etot, G4double a, G4double z);
    4654
    47 G4int verboseLevel;
    48   std::vector<G4InuclElementaryParticle> generateBangInSCM(G4double etot,
    49                                                       G4double a,
    50                                                       G4double z,
    51                                                       G4double mp,
    52                                                       G4double mn) const;
    53 
    54   std::vector<G4double> generateMomentumModules(G4double etot,
    55                                            G4double a,
    56                                            G4double z,
    57                                            G4double mp,
    58                                            G4double mn) const;
     55  void generateMomentumModules(G4double etot, G4double a, G4double z);
    5956
    6057  G4double xProbability(G4double x,
     
    6764                     G4double promax) const;
    6865
     66  // Buffers for big-bang results
     67  std::vector<G4InuclElementaryParticle> particles;
     68  std::vector<G4double> momModules;
    6969};       
    7070
    71 #endif // G4BIG_BANGER_HH
     71#endif /* G4BIG_BANGER_HH */
    7272
    7373
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadParticle.hh

    r1196 r1315  
     1#ifndef G4CASCAD_PARTICLE_HH
     2#define G4CASCAD_PARTICLE_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4CascadParticle.hh,v 1.14 2010/03/16 22:10:26 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4CASCAD_PARTICLE_HH
    27 #define G4CASCAD_PARTICLE_HH
     30// 20100112  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     31// 20100126  M. Kelsey -- Replace vector<G4Double> position with G4ThreeVector,
     32//              move ::print() to .cc file, fix uninitialized data members
    2833
    2934#include "G4InuclElementaryParticle.hh"
     35#include "G4LorentzVector.hh"
     36#include "G4ThreeVector.hh"
     37
    3038
    3139class G4CascadParticle {
    3240
    3341public:
    34 
     42  // NOTE:  Default constructor does not make a functional object!
    3543  G4CascadParticle();
    3644
    3745  G4CascadParticle(const G4InuclElementaryParticle& particle,
    38                    const std::vector<G4double>& pos,
     46                   const G4ThreeVector& pos,
    3947                   G4int izone,
    4048                   G4double cpath,
    4149                   G4int gen)
     50    : verboseLevel(0), theParticle(particle), position(pos),
     51      current_zone(izone), current_path(cpath), movingIn(true),
     52      reflectionCounter(0), reflected(false), generation(gen) {}
    4253
    43     : theParticle(particle),
    44     position(pos),
    45     current_zone(izone),
    46     current_path(cpath) {
    47     current_path = cpath;
    48     movingIn = true;
    49     reflectionCounter = 0;
    50     generation = gen;
    51   };
     54  void updateParticleMomentum(const G4LorentzVector& mom) {
     55    theParticle.setMomentum(mom);
     56  }
    5257
    53   void updateParticleMomentum(const G4CascadeMomentum& mom) {
    54     theParticle.setMomentum(mom);
    55   };
    56 
    57   void updatePosition(const std::vector<G4double>& pos) {
     58  void updatePosition(const G4ThreeVector& pos) {
    5859    position = pos;
    59   };
     60  }
    6061
    6162  void incrementReflectionCounter() {
    6263    reflectionCounter++;
    6364    reflected = true;
    64   };
     65  }
    6566
    6667  void resetReflection() {
    6768    reflected = false;
    68   };
     69  }
    6970
    7071  void incrementCurrentPath(G4double npath) {
    7172    current_path += npath;
    72   };
     73  }
    7374
    7475  void updateZone(G4int izone) {
    7576    current_zone = izone;
    76   };
     77  }
    7778
    7879  G4bool movingInsideNuclei() const {
    7980    return movingIn;
    80   };
     81  }
    8182
    8283  G4double getPathToTheNextZone(G4double rz_in,
    8384                                G4double rz_out);
    8485
    85   const G4CascadeMomentum& getMomentum() const {
     86  G4LorentzVector getMomentum() const {         // Can't return ref; temporary
    8687    return theParticle.getMomentum();
    87   };
     88  }
    8889
    89   G4InuclElementaryParticle getParticle() const {
     90  const G4InuclElementaryParticle& getParticle() const {
    9091    return theParticle;
    91   };
     92  }
    9293
    93   const std::vector<G4double>& getPosition() const {
     94  G4InuclElementaryParticle& getParticle() {
     95    return theParticle;
     96  }
     97
     98  const G4ThreeVector& getPosition() const {
    9499    return position;
    95   };
     100  }
    96101
    97102  G4int getCurrentZone() const {
    98103    return current_zone;
    99   };
     104  }
    100105
    101106  G4int getNumberOfReflections() const {
    102107    return reflectionCounter;
    103   };
     108  }
    104109
    105110  G4bool young(G4double young_path_cut,
    106111               G4double cpath) const {
    107    
    108     if(current_path < 1000.0) {
    109       return cpath < young_path_cut;
    110     }
    111     else {
    112       return false;
    113     };   
    114     // return current_path + cpath < young_path_cut;
    115   };
     112    return ((current_path < 1000.) && (cpath < young_path_cut));
     113  }
    116114
    117115  G4bool reflectedNow() const {
    118116    return reflected;
    119   };
     117  }
    120118
    121119  void propagateAlongThePath(G4double path);
    122120
    123   void print() const {
    124     theParticle.printParticle();
    125     G4cout << " zone " << current_zone << " current_path " << current_path
    126            << " reflectionCounter " << reflectionCounter << G4endl
    127            << " x " << position[0] << " y " << position[1]
    128            << " z " << position[2] << G4endl;
    129   };
     121  void print() const;
    130122
    131123  G4int getGeneration() {
     
    134126   
    135127private:
    136 
    137128  G4int verboseLevel;
    138129  G4InuclElementaryParticle theParticle;
    139   std::vector<G4double> position;
     130  G4ThreeVector position;
    140131  G4int current_zone;
    141132  G4double current_path;
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeChannel.hh,v 1.6 2010/05/15 04:25:17 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100514  M. Kelsey -- All functionality removed except quantum-number
     29//              validation functions.
     30
    2631#ifndef G4_CASCADE_CHANNEL_HH
    2732#define G4_CASCADE_CHANNEL_HH
    2833
    2934#include "globals.hh"
     35#include "G4FastVector.hh"
     36#include "G4ReactionProduct.hh"
    3037#include <vector>
    3138
    32 class G4CascadeChannel {
     39namespace G4CascadeChannel {
     40  std::vector<G4int> getQnums(G4int type);
    3341
    34 public:
    35 
    36   static std::pair<G4int, G4double> interpolateEnergy(G4double ke);
    37   static G4int sampleFlat(std::vector<G4double> const& sigma);
    38   static std::vector<G4int> getQnums(G4int type);
    39 
    40 private:
    41   G4CascadeChannel(); // not implemented
    42 
    43   static const double energyScale[31];
    44 };       
     42  void CheckQnums(const G4FastVector<G4ReactionProduct,256> &vec,
     43                  G4int &vecLen,
     44                  G4ReactionProduct &currentParticle,
     45                  G4ReactionProduct &targetParticle,
     46                  G4double Q, G4double B, G4double S);
     47}
    4548
    4649#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeData.hh

    r967 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeData.hh,v 1.5 2010/05/16 05:18:36 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Use template arguments to dimension const-refs
     29//              to arrays,for use in passing to functions as dimensioned.
     30//              Add two additional optional(!) template args for piN/NN.
     31//              Add new data member "sum" to separate summed xsec values
     32//              from measured inclusive (tot) cross-sections.  Add two
     33//              ctors to pass inclusive xsec array as input (for piN/NN).
     34
    2635#ifndef G4_CASCADE_DATA_HH
    2736#define G4_CASCADE_DATA_HH
    2837
    2938#include "globals.hh"
     39#include "G4CascadeSampler.hh"          /* To get number of energy bins */
    3040
    31 template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs>
     41template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8=0,int N9=0>
    3242struct G4CascadeData
    3343{
    34   G4double *  tot;
     44  // NOTE: Need access to N2 by value to initialize index array
     45  enum { N02=N2, N23=N2+N3, N24=N23+N4, N25=N24+N5, N26=N25+N6, N27=N26+N7,
     46         N28=N27+N8, N29=N28+N9 };
    3547
    36   typedef G4double multiplicities_t[31];
    37   multiplicities_t * multiplicities;
     48  enum { N8D=N8?N8:1, N9D=N9?N9:1 };    // SPECIAL: Can't dimension arrays [0]
    3849
    39   typedef G4int index_t[2];
    40   index_t const * index;
     50  enum { NM=N9?8:N8?7:6, NXS=N29 };     // Multiplicity and cross-section bins
    4151
    42   typedef G4int x2bfs_t[2];
    43   x2bfs_t const * x2bfs;
     52  G4int index[NM+1];                    // Start and stop indices to xsec's
     53  G4double multiplicities[NM][NE];      // Multiplicity distributions
    4454
    45   typedef G4int x3bfs_t[3];
    46   x3bfs_t const * x3bfs;
     55  const G4int (&x2bfs)[N2][2];          // Initialized from file-scope inputs
     56  const G4int (&x3bfs)[N3][3];
     57  const G4int (&x4bfs)[N4][4];
     58  const G4int (&x5bfs)[N5][5];
     59  const G4int (&x6bfs)[N6][6];
     60  const G4int (&x7bfs)[N7][7];
     61  const G4int (&x8bfs)[N8D][8];         // These may not be used if mult==7
     62  const G4int (&x9bfs)[N9D][9];
     63  const G4double (&crossSections)[NXS][NE];
    4764
    48   typedef G4int x4bfs_t[4];
    49   x4bfs_t const * x4bfs;
     65  G4double sum[NE];                     // Summed cross-sections, computed
     66  const G4double (&tot)[NE];            // Inclusive cross-sections (from input)
    5067
    51   typedef G4int x5bfs_t[5];
    52   x5bfs_t const * x5bfs;
     68  static const G4int empty8bfs[1][8];   // For multiplicity==7 case
     69  static const G4int empty9bfs[1][9];
    5370
    54   typedef G4int x6bfs_t[6];
    55   x6bfs_t const * x6bfs;
     71  G4int maxMultiplicity() const { return NM+1; }  // Used by G4CascadeFunctions
    5672
    57   typedef G4int x7bfs_t[7];
    58   x7bfs_t const * x7bfs;
     73  // Constructor for kaon/hyperon channels, with multiplicity <= 7
     74  G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
     75                const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
     76                const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
     77                const G4double (&xsec)[NXS][NE])
     78    : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
     79      x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs),
     80      crossSections(xsec), tot(sum) { initialize(); }
    5981
    60   typedef G4float crossSections_t[31];
    61   crossSections_t const * crossSections;
     82  // Constructor for kaon/hyperon channels, with multiplicity <= 7 and inclusive
     83  G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
     84                const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
     85                const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
     86                const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE])
     87    : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
     88      x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs),
     89      crossSections(xsec), tot(theTot) { initialize(); }
    6290
    63   void initialize();
     91  // Constructor for pion/nuleon channels, with multiplicity > 7
     92  G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
     93                const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
     94                const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
     95                const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9],
     96                const G4double (&xsec)[NXS][NE])
     97    : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
     98      x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs),
     99      crossSections(xsec), tot(sum) { initialize(); }
    64100
    65 //   G4double tot[31];
    66 //   G4double multiplicities[6][31];
    67 
    68 //   G4int index[6][2];
    69 //   G4int x2bfs[n2][2];
    70 //   G4int x3bfs[n3][3];
    71 //   G4int x4bfs[n4][4];
    72 //   G4int x5bfs[n5][5];
    73 //   G4int x6bfs[n6][6];
    74 //   G4int x7bfs[n7][7];
    75 
    76 //   G4float crossSections[nxs][31];
     101  // Constructor for pion/nuleon channels, with multiplicity > 7 and inclusive
     102  G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
     103                const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
     104                const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
     105                const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9],
     106                const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE])
     107    : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
     108      x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs),
     109      crossSections(xsec), tot(theTot) { initialize(); }
     110  void initialize();                    // Fill summed arrays from input
    77111};
    78112
    79 template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs>
    80 inline
    81 void
    82 G4CascadeData<n2, n3, n4, n5, n6, n7, nxs>::initialize()
    83 {
     113template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9> inline
     114void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::initialize() {
     115  // Initialize index offsets for cross-section array (can't do globally)
     116  index[0] = 0;   index[1] = N02; index[2] = N23; index[3] = N24;
     117  index[4] = N25; index[5] = N26; index[6] = N27;
     118  if (NM>6) index[7]=N28;
     119  if (NM>7) index[8]=N29;
     120
    84121  // Initialize multiplicity array
    85  
    86   for (G4int m = 0; m < 6; m++) {
    87     G4int start = index[m][0];
    88     G4int stop = index[m][1];
    89     for (G4int k = 0; k < 31; k++) {
     122  for (G4int m = 0; m < NM; m++) {
     123    G4int start = index[m];
     124    G4int stop = index[m+1];
     125    for (G4int k = 0; k < NE; k++) {
    90126      multiplicities[m][k] = 0.0;
    91127      for (G4int i = start; i < stop; i++) {
     
    96132 
    97133  // Initialize total cross section array
    98  
    99   for (G4int k = 0; k < 31; k++) {
    100     tot[k] = 0.0;
    101     for (G4int m = 0; m < 6; m++) {
    102       tot[k] += multiplicities[m][k];
     134  for (G4int k = 0; k < NE; k++) {
     135    sum[k] = 0.0;
     136    for (G4int m = 0; m < NM; m++) {
     137      sum[k] += multiplicities[m][k];
    103138    }
    104139  }
    105140}
    106141
     142// Dummy arrays for use when optional template arguments are skipped
     143template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
     144const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty8bfs[1][8] = {{0}};
     145
     146template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
     147const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty9bfs[1][9] = {{0}};
     148
    107149#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.hh

    r967 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeFunctions.hh,v 1.5 2010/05/14 21:05:03 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100407  M. Kelsey -- Return particle types std::vector<> by const ref,
     29//              using a static variable in the function as a buffer.
     30// 20100505  M. Kelsey -- Use new interpolator class, drop std::pair<>, move
     31//              sampleFlat(...) from G4CascadeChannel, move functionality
     32//              to new base class, to allow data-member buffers.  Move
     33//              function definitions to .icc file (needed with templating).
     34// 20100510  M. Kelsey -- Use both summed and inclusive cross-sections for
     35//              multiplicity, as done in G4{Pion,Nucleon}Sampler.  Support
     36//              up to 9-body final states.  Add second argument specifying
     37//              which Sampler is used.  Move implementations to .icc file.
     38// 20100511  M. Kelsey -- Pass "kinds" buffer as input to getOutputPartTypes
     39
    2640#ifndef G4_CASCADE_FUNCTIONS_HH
    2741#define G4_CASCADE_FUNCTIONS_HH
    2842
     43#include "globals.hh"
     44#include "Randomize.hh"
    2945#include <vector>
    30 #include "globals.hh"
    31 #include "G4CascadeChannel.hh"
    3246
    33 template <class T>
    34 class G4CascadeFunctions
    35 {
     47
     48template <class DATA, class SAMP>
     49class G4CascadeFunctions : public SAMP {
    3650public:
    37   static G4double getCrossSection(double ke);
     51  static G4double getCrossSection(double ke) {
     52    return instance.findCrossSection(ke, DATA::data.tot);
     53  }
     54
     55  static G4double getCrossSectionSum(double ke) {
     56    return instance.findCrossSection(ke, DATA::data.sum);
     57  }
     58
    3859  static G4int getMultiplicity(G4double ke);
    39   static std::vector<G4int> getOutgoingParticleTypes(G4int mult, G4double ke);
     60
     61  static void
     62  getOutgoingParticleTypes(std::vector<G4int>& kinds, G4int mult, G4double ke);
     63
     64private:
     65  G4CascadeFunctions() : SAMP() {}
     66  static const G4CascadeFunctions<DATA,SAMP> instance;
    4067};
    4168
    42 template <class T>
    43 inline
    44 G4double
    45 G4CascadeFunctions<T>::getCrossSection(double ke)
    46 {
    47   std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke);
    48   G4int k = epair.first;
    49   G4double fraction = epair.second;
    50   return T::data.tot[k] + fraction*(T::data.tot[k+1] - T::data.tot[k]);
    51 }
     69#include "G4CascadeFunctions.icc"
    5270
    53 template <class T>
    54 inline
    55 G4int
    56 G4CascadeFunctions<T>::getMultiplicity(G4double ke)
    57 {
    58   G4double multint(0.0);
    59   std::vector<G4double> sigma;
    60 
    61   std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke);
    62   G4int k = epair.first;
    63   G4double fraction = epair.second;
    64 
    65   for (G4int m = 0; m < 6; ++m)
    66     {
    67       multint = T::data.multiplicities[m][k]
    68         + fraction * (T::data.multiplicities[m][k+1] - T::data.multiplicities[m][k]);
    69       sigma.push_back(multint);
    70     }
    71  
    72   return G4CascadeChannel::sampleFlat(sigma);
    73 }
    74 
    75 template <class T>
    76 inline
    77 std::vector<G4int>
    78 G4CascadeFunctions<T>::getOutgoingParticleTypes(G4int mult, G4double ke)
    79 {
    80   G4int i;
    81   G4double sigint(0.);
    82   std::vector<G4double> sigma;
    83  
    84   std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke);
    85   G4int k = epair.first;
    86   G4double fraction = epair.second;
    87 
    88   G4int start = T::data.index[mult-2][0];
    89   G4int stop = T::data.index[mult-2][1];
    90  
    91   for (i = start; i < stop; i++) {
    92     sigint = T::data.crossSections[i][k]
    93       + fraction*(T::data.crossSections[i][k+1] - T::data.crossSections[i][k]);
    94     sigma.push_back(sigint);
    95   }
    96  
    97   G4int channel = G4CascadeChannel::sampleFlat(sigma);
    98 
    99   std::vector<G4int> kinds;
    100 
    101   if (mult == 2) {
    102     for(i = 0; i < mult; i++) kinds.push_back(T::data.x2bfs[channel][i]);
    103   } else if (mult == 3) {
    104     for(i = 0; i < mult; i++) kinds.push_back(T::data.x3bfs[channel][i]);
    105   } else if (mult == 4) {
    106     for(i = 0; i < mult; i++) kinds.push_back(T::data.x4bfs[channel][i]);
    107   } else if (mult == 5) {
    108     for(i = 0; i < mult; i++) kinds.push_back(T::data.x5bfs[channel][i]);
    109   } else if (mult == 6) {
    110     for(i = 0; i < mult; i++) kinds.push_back(T::data.x6bfs[channel][i]);
    111   } else if (mult == 7) {
    112     for(i = 0; i < mult; i++) kinds.push_back(T::data.x7bfs[channel][i]);
    113   } else {
    114     G4cout << " Illegal multiplicity " << G4endl;
    115   }
    116 
    117   return kinds;
    118 }
    119 
    120 
    121 #endif
     71#endif  /* G4_CASCADE_FUNCTIONS_HH */
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterface.hh

    r1196 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CascadeInterface.hh,v 1.14 2009/09/24 20:48:02 dennis Exp $
     26// $Id: G4CascadeInterface.hh,v 1.16 2010/05/21 18:07:30 mkelsey Exp $
    2727// Defines an interface to Bertini (BERT) cascade
    2828// based on INUCL  intra-nuclear transport.models
    2929// with bullet hadron energy ~< 10 GeV
     30//
     31// 20100405  M. Kelsey -- Fix constness of op== and op!=
     32// 20100519  M. Kelsey -- Remove Collider data members
    3033
    3134#ifndef G4CASCADEINTERFACE_H
    3235#define G4CASCADEINTERFACE_H 1
    3336
     37#include "G4VIntraNuclearTransportModel.hh"
     38#include "G4FragmentVector.hh"
     39#include "G4KineticTrackVector.hh"
    3440#include "G4Nucleon.hh"
    3541#include "G4Nucleus.hh"
    36 #include "G4VIntraNuclearTransportModel.hh"
    37 #include "G4KineticTrackVector.hh"
    38 #include "G4FragmentVector.hh"
    3942#include "G4ParticleChange.hh"
     43#include "G4ReactionProduct.hh"
    4044#include "G4ReactionProductVector.hh"
    41 #include "G4ReactionProduct.hh"
    42 
    43 #include "G4ElementaryParticleCollider.hh"
    44 #include "G4NonEquilibriumEvaporator.hh"
    45 #include "G4EquilibriumEvaporator.hh"
    46 #include "G4Fissioner.hh"
    47 #include "G4BigBanger.hh"
    48 #include "G4IntraNucleiCascader.hh"
    4945
    5046
     
    5652  virtual ~G4CascadeInterface();
    5753
    58   G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
    59 
    60   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus);
     54  G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries,
     55                                     G4V3DNucleus* theNucleus);
     56 
     57  G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     58                                 G4Nucleus& theNucleus);
    6159
    6260private:
    63   G4int operator==(G4CascadeInterface& right) {
     61  G4int operator==(const G4CascadeInterface& right) const {
    6462    return (this == &right);
    6563  }
    6664
    67   G4int operator!=(G4CascadeInterface& right) {
     65  G4int operator!=(const G4CascadeInterface& right) const {
    6866    return (this != &right);
    6967  }
     
    7270
    7371private:
    74 
    75   G4ElementaryParticleCollider colep;
    76   G4NonEquilibriumEvaporator noneq;
    77   G4EquilibriumEvaporator eqil;
    78   G4Fissioner fiss;
    79   G4BigBanger bigb;
    80   G4IntraNucleiCascader inc;
    81 
    8272  G4HadFinalState theResult; 
    83 
    8473};
    8574
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKminusNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKminusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KMINUSN_CHANNEL_HH
    2734#define G4_CASCADE_KMINUSN_CHANNEL_HH
    2835
    29 
    3036#include "G4CascadeData.hh"
    3137#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeKminusNChannelData {
    34   typedef G4CascadeData<5,15,28,42,20,11,121> data_t;
     41  typedef G4CascadeData<31,5,15,28,42,20,11> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeKminusNChannelData> G4CascadeKminusNChannel;
    39 
     45typedef G4CascadeFunctions<G4CascadeKminusNChannelData,G4KaonHypSampler> G4CascadeKminusNChannel;
    4046
    4147#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKminusPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKminusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KMINUSP_CHANNEL_HH
    2734#define G4_CASCADE_KMINUSP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct  G4CascadeKminusPChannelData {
    33   typedef G4CascadeData<8,20,34,48,22,16,148> data_t;
     41  typedef G4CascadeData<31,8,20,34,48,22,16> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeKminusPChannelData> G4CascadeKminusPChannel;
     45typedef G4CascadeFunctions<G4CascadeKminusPChannelData,G4KaonHypSampler> G4CascadeKminusPChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKplusNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKplusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KPLUSN_CHANNEL_HH
    2734#define G4_CASCADE_KPLUSN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeKplusNChannelData {
    33   typedef G4CascadeData<2,5,13,22,32,41,115> data_t;
     41  typedef G4CascadeData<31,2,5,13,22,32,41> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeKplusNChannelData> G4CascadeKplusNChannel;
     45typedef G4CascadeFunctions<G4CascadeKplusNChannelData,G4KaonHypSampler> G4CascadeKplusNChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKplusPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKplusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KPLUSP_CHANNEL_HH
    2734#define G4_CASCADE_KPLUSP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeKplusPChannelData {
    34   typedef G4CascadeData<1,4,10,19,28,38,100> data_t;
     41  typedef G4CascadeData<31,1,4,10,19,28,38> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeKplusPChannelData> G4CascadeKplusPChannel;
     45typedef G4CascadeFunctions<G4CascadeKplusPChannelData,G4KaonHypSampler> G4CascadeKplusPChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroBarNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKzeroBarNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KZEROBARN_CHANNEL_HH
    2734#define G4_CASCADE_KZEROBARN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeKzeroBarNChannelData {
    33   typedef G4CascadeData<8,20,34,48,22,16,148> data_t;
     41  typedef G4CascadeData<31,8,20,34,48,22,16> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeKzeroBarNChannelData> G4CascadeKzeroBarNChannel;
     45typedef G4CascadeFunctions<G4CascadeKzeroBarNChannelData,G4KaonHypSampler> G4CascadeKzeroBarNChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroBarPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKzeroBarPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KZEROBARP_CHANNEL_HH
    2734#define G4_CASCADE_KZEROBARP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
    32 
     38#include "G4KaonHypSampler.hh"
    3339
    3440struct G4CascadeKzeroBarPChannelData {
    35   typedef G4CascadeData<5,15,28,42,20,11,121> data_t;
     41  typedef G4CascadeData<31,5,15,28,42,20,11> data_t;
    3642  static data_t data;
    3743};
    3844
    39 typedef G4CascadeFunctions<G4CascadeKzeroBarPChannelData> G4CascadeKzeroBarPChannel;
     45typedef G4CascadeFunctions<G4CascadeKzeroBarPChannelData,G4KaonHypSampler> G4CascadeKzeroBarPChannel;
    4046
    4147#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKzeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KZERON_CHANNEL_HH
    2734#define G4_CASCADE_KZERON_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeKzeroNChannelData {
    34   typedef G4CascadeData<1,4,10,19,28,38,100> data_t;
     41  typedef G4CascadeData<31,1,4,10,19,28,38> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeKzeroNChannelData> G4CascadeKzeroNChannel;
     45typedef G4CascadeFunctions<G4CascadeKzeroNChannelData,G4KaonHypSampler> G4CascadeKzeroNChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeKzeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_KZEROP_CHANNEL_HH
    2734#define G4_CASCADE_KZEROP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeKzeroPChannelData {
    33   typedef G4CascadeData<2,5,13,22,32,41,115> data_t;
     41  typedef G4CascadeData<31,2,5,13,22,32,41> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeKzeroPChannelData> G4CascadeKzeroPChannel;
     45typedef G4CascadeFunctions<G4CascadeKzeroPChannelData,G4KaonHypSampler> G4CascadeKzeroPChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeLambdaNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeLambdaNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_LAMBDAN_CHANNEL_HH
    2734#define G4_CASCADE_LAMBDAN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeLambdaNChannelData {
    34   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeLambdaNChannelData> G4CascadeLambdaNChannel;
     45typedef G4CascadeFunctions<G4CascadeLambdaNChannelData,G4KaonHypSampler> G4CascadeLambdaNChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeLambdaPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeLambdaPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_LAMBDAP_CHANNEL_HH
    2734#define G4_CASCADE_LAMBDAP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeLambdaPChannelData {
    33   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeLambdaPChannelData> G4CascadeLambdaPChannel;
     45typedef G4CascadeFunctions<G4CascadeLambdaPChannelData,G4KaonHypSampler> G4CascadeLambdaPChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeMomentum.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CascadeMomentum.hh,v 1.1 2008/09/22 10:06:32 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
    28 //
     26// $Id: G4CascadeMomentum.hh,v 1.5 2010/03/16 22:10:26 mkelsey Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2928//
    3029// Class G4CascadeMomentum
     
    3534// std::vector<double> in the cascade mode code, which causes
    3635// problems for performance due to excess memory allocations.
    37 
     36//
     37// NOTE:  The Bertini code does not pass legitimate four-vectors when
     38//        creating new particles; the new getLV() function takes an
     39//        optional mass argument (in Bertini units [GeV]) so that a
     40//        valid G4LorentzVector can be returned.
     41//
    3842// Author: Peter Elmer, Princeton University                  7-Aug-2008
     43// Update: Michael Kelsey, SLAC (support G4LorentzVector)     8-Jan-2010
    3944// --------------------------------------------------------------------
    4045#ifndef G4CASCADE_MOMENTUM_HH
     
    4449
    4550#include "G4Types.hh"
     51#include "G4LorentzVector.hh"
     52#include "G4ThreeVector.hh"
    4653
    4754class G4CascadeMomentum
    4855{
    4956  public:
    50 
    5157    G4CascadeMomentum() {for (int i=0; i<4; ++i) data_[i]=0.0;}
    5258
    53     G4double& operator[](int i)
    54     {
     59    // WARNING!  This metric is (t,x,y,z), DIFFERENT FROM HepLV!
     60    G4CascadeMomentum(const G4LorentzVector& lv) {
     61      setLV(lv);
     62    }
     63
     64    G4double& operator[](int i) {
    5565      assert(i>=0 && i<4);
    5666      return data_[i];
    5767    }
    58     const G4double& operator[](int i) const
    59     {
     68    const G4double& operator[](int i) const {
    6069      assert(i>=0 && i<4);
    6170      return data_[i];
    6271    }
    6372
     73    operator const G4LorentzVector&() const {
     74      return getLV();                   // Casting can't do mass repairs
     75    }
     76
     77    const G4LorentzVector& getLV(G4double mass=-1.) const {
     78      if (mass>=0.) lv.setVectM(get3V(),mass);          // Force input mass!
     79      else lv.set(data_[1],data_[2],data_[3],data_[0]);
     80     
     81      return lv;
     82    }
     83
     84    G4ThreeVector get3V() const {
     85      return getLV().vect();
     86    }
     87
     88    void setLV(const G4LorentzVector& lv) {
     89      data_[0] = lv.t();                // NOTE DIFFERENT METRIC CONVENTION!
     90      data_[1] = lv.x();
     91      data_[2] = lv.y();
     92      data_[3] = lv.z();
     93    }
     94
     95    G4CascadeMomentum& operator=(const G4LorentzVector& lv) {
     96      setLV(lv);
     97      return *this;
     98    }
     99
    64100  private:
     101    G4double data_[4];
     102    mutable G4LorentzVector lv;         // Buffer for conversion operations
     103};
    65104
    66     G4double data_[4];
    67 };
    68105#endif
    69106
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaMinusNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaMinusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAMINUSN_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAMINUSN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeSigmaMinusNChannelData {
    34   typedef G4CascadeData<1,6,20,42,25,17,111> data_t;
     41  typedef G4CascadeData<31,1,6,20,42,25,17> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeSigmaMinusNChannelData> G4CascadeSigmaMinusNChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaMinusNChannelData,G4KaonHypSampler> G4CascadeSigmaMinusNChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaMinusPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaMinusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAMINUSP_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAMINUSP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeSigmaMinusPChannelData {
    34   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeSigmaMinusPChannelData> G4CascadeSigmaMinusPChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaMinusPChannelData,G4KaonHypSampler> G4CascadeSigmaMinusPChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaPlusNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaPlusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAPLUSN_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAPLUSN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeSigmaPlusNChannelData {
    34   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeSigmaPlusNChannelData> G4CascadeSigmaPlusNChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaPlusNChannelData,G4KaonHypSampler> G4CascadeSigmaPlusNChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaPlusPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaPlusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAPLUSP_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAPLUSP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeSigmaPlusPChannelData {
    34   typedef G4CascadeData<1,6,20,42,25,17,111> data_t;
     41  typedef G4CascadeData<31,1,6,20,42,25,17> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeSigmaPlusPChannelData> G4CascadeSigmaPlusPChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaPlusPChannelData,G4KaonHypSampler> G4CascadeSigmaPlusPChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaZeroNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaZeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAZERON_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAZERON_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
    31 
     38#include "G4KaonHypSampler.hh"
    3239
    3340struct G4CascadeSigmaZeroNChannelData {
    34   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3542  static data_t data;
    3643};
    3744
    38 typedef G4CascadeFunctions<G4CascadeSigmaZeroNChannelData> G4CascadeSigmaZeroNChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaZeroNChannelData,G4KaonHypSampler> G4CascadeSigmaZeroNChannel;
    3946
    4047#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaZeroPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeSigmaZeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_SIGMAZEROP_CHANNEL_HH
    2734#define G4_CASCADE_SIGMAZEROP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeSigmaZeroPChannelData {
    33   typedef G4CascadeData<3,12,33,59,30,20,157> data_t;
     41  typedef G4CascadeData<31,3,12,33,59,30,20> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeSigmaZeroPChannelData> G4CascadeSigmaZeroPChannel;
     45typedef G4CascadeFunctions<G4CascadeSigmaZeroPChannelData,G4KaonHypSampler> G4CascadeSigmaZeroPChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiMinusNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeXiMinusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_XIMINUSN_CHANNEL_HH
    2734#define G4_CASCADE_XIMINUSN_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeXiMinusNChannelData {
    33   typedef G4CascadeData<3,18,53,2,2,2,80> data_t;
     41  typedef G4CascadeData<31,3,18,53,2,2,2> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeXiMinusNChannelData> G4CascadeXiMinusNChannel;
     45typedef G4CascadeFunctions<G4CascadeXiMinusNChannelData,G4KaonHypSampler> G4CascadeXiMinusNChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiMinusPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeXiMinusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_XIMINUSP_CHANNEL_HH
    2734#define G4_CASCADE_XIMINUSP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240struct G4CascadeXiMinusPChannelData {
    33   typedef G4CascadeData<6,24,4,4,4,4,46> data_t;
     41  typedef G4CascadeData<31,6,24,4,4,4,4> data_t;
    3442  static data_t data;
    3543};
    3644
    37 typedef G4CascadeFunctions<G4CascadeXiMinusPChannelData> G4CascadeXiMinusPChannel;
     45typedef G4CascadeFunctions<G4CascadeXiMinusPChannelData,G4KaonHypSampler> G4CascadeXiMinusPChannel;
    3846
    3947#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiZeroNChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeXiZeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_XIZERON_CHANNEL_HH
    2734#define G4_CASCADE_XIZERON_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
    3139
    3240
    3341struct G4CascadeXiZeroNChannelData {
    34   typedef G4CascadeData<6,24,4,4,4,4,46> data_t;
     42  typedef G4CascadeData<31,6,24,4,4,4,4> data_t;
    3543  static data_t data;
    3644};
    3745
    38 typedef G4CascadeFunctions<G4CascadeXiZeroNChannelData> G4CascadeXiZeroNChannel;
     46typedef G4CascadeFunctions<G4CascadeXiZeroNChannelData,G4KaonHypSampler> G4CascadeXiZeroNChannel;
    3947
    4048#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiZeroPChannel.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CascadeXiZeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100507  M. Kelsey -- Remove redundant total-bins template argument
     29// 20100510  M. Kelsey -- Add initial "31" template arg.  Add G4CascSampler
     30//              to template for channel typedef
     31// 20100514  M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler.
     32
    2633#ifndef G4_CASCADE_XIZEROP_CHANNEL_HH
    2734#define G4_CASCADE_XIZEROP_CHANNEL_HH
     
    2936#include "G4CascadeData.hh"
    3037#include "G4CascadeFunctions.hh"
     38#include "G4KaonHypSampler.hh"
     39
    3140
    3241struct G4CascadeXiZeroPChannelData {
    33   typedef G4CascadeData<3,18,53,2,2,2,80> data_t;
     42  typedef G4CascadeData<31,3,18,53,2,2,2> data_t;
    3443  static data_t data;
    3544};
    3645
    37 typedef G4CascadeFunctions<G4CascadeXiZeroPChannelData> G4CascadeXiZeroPChannel;
     46typedef G4CascadeFunctions<G4CascadeXiZeroPChannelData,G4KaonHypSampler> G4CascadeXiZeroPChannel;
    3847
    3948#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh

    r1196 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4CollisionOutput.hh,v 1.20 2010/05/21 18:07:30 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     29// 20100407  M. Kelsey -- Replace ::resize(0) with ::clear()
     30// 20100409  M. Kelsey -- Move function code to .cc files, not inlinable
     31// 20100418  M. Kelsey -- Add function to boost output lists to lab frame
     32// 20100520  M. Kelsey -- Add function to rotate Z axis, from G4Casc.Interface
     33
    2634#ifndef G4COLLISION_OUTPUT_HH
    2735#define G4COLLISION_OUTPUT_HH
    2836
    29 #include <iostream>
    30 
    3137#include "G4InuclElementaryParticle.hh"
    3238#include "G4InuclNuclei.hh"
    33 
     39#include "G4LorentzRotation.hh"
    3440#include <algorithm>
    3541#include <vector>
     42
     43class G4LorentzConvertor;
    3644
    3745class G4CollisionOutput {
     
    4351  G4CollisionOutput& operator=(const G4CollisionOutput& right);
    4452
    45   void reset() {
    46     nucleiFragments.resize(0);
    47     outgoingParticles.resize(0);
    48  
    49   };
     53  void reset();
    5054
    5155  void addOutgoingParticle(const G4InuclElementaryParticle& particle) {
    5256    outgoingParticles.push_back(particle);
    53   };
     57  }
    5458
    55   void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles) {
    56     for(G4int i = 0; i < G4int(particles.size()); i++)
    57       outgoingParticles.push_back(particles[i]);
    58   };
     59  void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles);
    5960
    6061  void addTargetFragment(const G4InuclNuclei& nuclei) {
     
    6263  };
    6364
    64   void addTargetFragments(const std::vector<G4InuclNuclei>& nuclea) {
    65     for(G4int i = 0; i < G4int(nuclea.size()); i++)
    66       nucleiFragments.push_back(nuclea[i]);
    67   };
     65  void addTargetFragments(const std::vector<G4InuclNuclei>& nuclea);
    6866
    6967  const std::vector<G4InuclElementaryParticle>& getOutgoingParticles() const {
     
    7977  };
    8078
    81   G4CascadeMomentum getTotalOutputMomentum() const {
    82     G4CascadeMomentum tot_mom;
    83     double eex_r = 0.0;
    84     G4int i(0);
    85     for(i = 0; i < G4int(outgoingParticles.size()); i++) {
    86       const G4CascadeMomentum& mom = outgoingParticles[i].getMomentum();
    87       for(G4int j = 0; j < 4; j++) tot_mom[j] += mom[j];
    88     };
    89     for(i = 0; i < G4int(nucleiFragments.size()); i++) {
    90       const G4CascadeMomentum& mom = nucleiFragments[i].getMomentum();
    91       for(G4int j = 0; j < 4; j++) tot_mom[j] += mom[j];
    92       eex_r += 0.001 * nucleiFragments[i].getExitationEnergy();
    93     };
    94     tot_mom[0] += eex_r;
    95     return tot_mom;
    96   };
     79  G4LorentzVector getTotalOutputMomentum() const;
    9780
    98   void printCollisionOutput() const {
    99     G4cout << " Output: " << G4endl 
    100            << " Outgoing Particles: " << outgoingParticles.size() << G4endl;
    101     G4int i(0);
    102     for(i = 0; i < G4int(outgoingParticles.size()); i++) {
    103       outgoingParticles[i].printParticle();
    104     };
    105     G4cout << " Nuclei fragments: " << nucleiFragments.size() << G4endl;     
    106     for(i = 0; i < G4int(nucleiFragments.size()); i++) {
    107       nucleiFragments[i].printParticle();
    108     };
    109   };
     81  void printCollisionOutput() const;
     82
     83  void boostToLabFrame(const G4LorentzConvertor& convertor);
     84
     85  void rotateEvent(const G4LorentzRotation& rotate);
    11086
    11187  void trivialise(G4InuclParticle* bullet,
    112                   G4InuclParticle* target) {
    113     if(G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {     
    114       nucleiFragments.push_back(*nuclei_target);
    115     }
    116     else {
    117       G4InuclElementaryParticle* particle =
    118         dynamic_cast<G4InuclElementaryParticle*>(target);
    119       outgoingParticles.push_back(*particle);
    120     };
    121     if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {     
    122       nucleiFragments.push_back(*nuclei_bullet);
    123     }
    124     else {
    125       G4InuclElementaryParticle* particle =
    126         dynamic_cast<G4InuclElementaryParticle*>(bullet);
    127       outgoingParticles.push_back(*particle);
    128     };
    129   };
     88                  G4InuclParticle* target);
    13089
    13190  void setOnShell(G4InuclParticle* bullet,
    13291                  G4InuclParticle* target);
    13392
    134   void setRemainingExitationEnergy() {
    135     eex_rest = 0.0;
    136     for(G4int i = 0; i < G4int(nucleiFragments.size()); i++)
    137       eex_rest += 0.001 * nucleiFragments[i].getExitationEnergy();
    138   };
     93  void setRemainingExitationEnergy();
    13994
    14095  double getRemainingExitationEnergy() const {
     
    147102
    148103private:
    149 
    150 G4int verboseLevel;
     104  G4int verboseLevel;
    151105  std::vector<G4InuclElementaryParticle> outgoingParticles;
    152 
    153106  std::vector<G4InuclNuclei> nucleiFragments;
    154 
    155107  G4double eex_rest;
    156108
    157   std::pair<std::pair<G4int, G4int>, G4int> selectPairToTune(G4double de) const;
     109  std::pair<std::pair<G4int,G4int>, G4int> selectPairToTune(G4double de) const;
    158110
    159111  G4bool on_shell;
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4ElementaryParticleCollider.hh

    r1196 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4ElementaryParticleCollider.hh,v 1.31 2010/05/21 17:56:34 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     29// 20100315  M. Kelsey -- Remove "using" directive and unnecessary #includes.
     30// 20100407  M. Kelsey -- Eliminate return-by-value std::vector<> by creating
     31//              three data buffers for particles, momenta, and particle types.
     32//              The following functions now return void and are non-const:
     33//                ::generateSCMfinalState()
     34//                ::generateMomModules() (also remove input vector)
     35//                ::generateStrangeChannelPartTypes()
     36//                ::generateSCMpionAbsorption()
     37// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide(); merge
     38//              public vs. private ::collide() functions.
     39// 20100511  M. Kelsey -- Remove G4PionSampler and G4NucleonSampler.  Expand
     40//              particle-types selector to all modes, not just strangeness.
     41// 20100517  M. Kelsey -- Inherit from common base class, make arrays static
     42
    2643#ifndef G4ELEMENTARY_PARTICLE_COLLIDER_HH
    2744#define G4ELEMENTARY_PARTICLE_COLLIDER_HH
    2845
    29 #include "G4Collider.hh"
     46#include "G4VCascadeCollider.hh"
    3047#include "G4InuclElementaryParticle.hh"
    31 #include "G4InuclSpecialFunctions.hh"
    32 #include "G4CascadSpecialFunctions.hh"
    33 #include "G4LorentzConvertor.hh"
    34 #include "G4NucleonSampler.hh"
    35 #include "G4PionSampler.hh"
     48#include "G4LorentzVector.hh"
     49#include <vector>
    3650
    37  
    38 using namespace G4InuclSpecialFunctions;
    39 using namespace G4CascadSpecialFunctions;
     51class G4LorentzConvertor;
     52class G4CollisionOutput;
    4053
    4154
    42 class G4ElementaryParticleCollider {
    43 
     55class G4ElementaryParticleCollider : public G4VCascadeCollider {
    4456public:
    45 
    4657  G4ElementaryParticleCollider();
    47 
    48   G4CollisionOutput collide(G4InuclParticle* bullet,
    49                             G4InuclParticle* target);
     58  virtual ~G4ElementaryParticleCollider() {};
     59 
     60  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     61               G4CollisionOutput& output);
    5062
    5163private:
    52 
    53   G4int verboseLevel;
    54 
    5564  void initializeArrays();
    5665
    5766  G4int generateMultiplicity(G4int is, G4double ekin) const;
    5867
    59   void collide(G4InuclElementaryParticle* bullet,
    60                G4InuclElementaryParticle* target,
    61                G4CollisionOutput& output);
     68  void generateOutgoingPartTypes(G4int is, G4int mult, G4double ekin);
    6269
    63      
    64   std::vector<G4InuclElementaryParticle>
    65   generateSCMfinalState(G4double ekin, G4double etot_scm, G4double pscm,             
    66                         G4InuclElementaryParticle* particle1,
    67                         G4InuclElementaryParticle* particle2,
    68                         G4LorentzConvertor* toSCM) const;
     70  void generateSCMfinalState(G4double ekin, G4double etot_scm, G4double pscm,
     71                             G4InuclElementaryParticle* particle1,
     72                             G4InuclElementaryParticle* particle2,
     73                             G4LorentzConvertor* toSCM);
     74
     75  void generateSCMpionAbsorption(G4double etot_scm,
     76                                 G4InuclElementaryParticle* particle1,
     77                                 G4InuclElementaryParticle* particle2);
     78
     79  void generateMomModules(G4int mult, G4int is, G4double ekin,
     80                          G4double etot_cm);
     81
     82  // Samples the CM momentum for elastic and charge exchange scattering
     83  //
     84  G4LorentzVector
     85  sampleCMmomentumFor2to2(G4int is, G4int kw, G4double ekin,
     86                          G4double pscm) const;
    6987
    7088
    71   std::vector<G4double>
    72   generateMomModules(const std::vector<G4int>& kinds, G4int mult,
    73                      G4int is, G4double ekin, G4double etot_cm) const;
     89  // Samples cos(theta) in the CM for elastic and charge exchange scattering
     90  //
     91  G4double sampleCMcosFor2to2(G4double pscm, G4double pFrac,
     92                              G4double pA, G4double pC, G4double pCos) const;
    7493
    7594
    76   G4CascadeMomentum
    77   particleSCMmomentumFor2to2(G4int is, G4int kw, G4double ekin,
    78                              G4double pscm) const;
    79 
    80 
    81   G4int getElasticCase(G4int is, G4int kw, G4double ekin) const;
    82 
    83 
    84   std::vector<G4int>
    85   generateStrangeChannelPartTypes(G4int is, G4int mult,
    86                                   G4double ekin) const;
    87 
    88 
    89   G4double
    90   getMomModuleFor2toMany(G4int is, G4int mult, G4int knd,
    91                          G4double ekin) const;
     95  G4double getMomModuleFor2toMany(G4int is, G4int mult, G4int knd,
     96                                  G4double ekin) const;
    9297
    9398
    9499  G4bool satisfyTriangle(const std::vector<G4double>& modules) const;
    95100       
    96   G4CascadeMomentum
     101  G4LorentzVector
    97102  particleSCMmomentumFor2to3(G4int is, G4int knd, G4double ekin,
    98103                             G4double pmod) const;
    99104
    100 
    101   std::pair<G4double, G4double>
    102   adjustIntervalForElastic(G4double ekin, G4double ak, G4double ae,
    103                            G4int k, G4int l, const std::vector<G4double>& ssv,
    104                            G4double st) const;
    105  
    106   std::vector<G4InuclElementaryParticle>
    107   generateSCMpionAbsorption(G4double etot_scm,
    108                             G4InuclElementaryParticle* particle1,
    109                             G4InuclElementaryParticle* particle2) const;
    110 
    111   G4NucleonSampler nucSampler;
    112   G4PionSampler piSampler;
     105  // Internal buffers for lists of secondaries
     106  std::vector<G4InuclElementaryParticle> particles;
     107  std::vector<G4double> modules;
     108  std::vector<G4int> particle_kinds;
    113109
    114110  // Parameter arrays
    115 
    116   G4double rmn[14][10][2];   
    117   G4double ang[4][4][13];
    118   G4double abn[4][4][4];
    119 
     111  static const G4double rmn[14][10][2];   
     112  static const G4double abn[4][4][4];
    120113};
    121114
    122 #endif // G4ELEMENTARY_PARTICLE_COLLIDER_HH
     115#endif  /* G4ELEMENTARY_PARTICLE_COLLIDER_HH */
    123116
    124117
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4EquilibriumEvaporator.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4EquilibriumEvaporator.hh,v 1.11 2010/05/21 17:56:34 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     29// 20100517  M. Kelsey -- Inherit from common base class, make other colliders
     30//              simple data members.  Rename timeToBigBang() to override
     31//              base explosion().
     32
    2633#ifndef G4EQUILIBRIUM_EVAPORATOR_HH
    2734#define G4EQUILIBRIUM_EVAPORATOR_HH
    2835
    29 #include "G4Collider.hh"
    30 #include "G4Fissioner.hh"
    31 #include "G4BigBanger.hh"
    32 #include "G4InuclSpecialFunctions.hh"
     36#include "G4VCascadeCollider.hh"
    3337
    34 using namespace G4InuclSpecialFunctions;
     38class G4CollisionOutput;
     39class G4Fissioner;
     40class G4BigBanger;
     41class G4InuclParticle;
    3542
    36 class G4EquilibriumEvaporator {
     43class G4EquilibriumEvaporator : public G4VCascadeCollider {
     44public:
     45  G4EquilibriumEvaporator();
     46  virtual ~G4EquilibriumEvaporator();
    3747
    38 public:
    39 
    40   G4EquilibriumEvaporator();
    41 
    42   void setFissioner(G4Fissioner* fissioner) {
    43     theFissioner = fissioner;
    44   };
    45 
    46   void setBigBanger(G4BigBanger* banger) {
    47     theBigBanger = banger;
    48   };
    49 
    50   G4CollisionOutput collide(G4InuclParticle* bullet,
    51                             G4InuclParticle* target);
     48  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     49               G4CollisionOutput& output);
    5250
    5351private:
    54 G4int verboseLevel;
     52  // Replace base class verision
     53  virtual G4bool explosion(G4InuclNuclei*) const { return false; }
     54  virtual G4bool explosion(G4double a,
     55                           G4double z,
     56                           G4double e) const;
     57
     58  G4bool goodRemnant(G4double a,
     59                     G4double z) const;
     60
    5561  G4double getE0(G4double A) const;
    5662
    5763  G4double getPARLEVDEN(G4double A,
    5864                        G4double Z) const;
    59 
    60   G4bool timeToBigBang(G4double a,
    61                        G4double z,
    62                        G4double e) const;
    63 
    64   G4bool goodRemnant(G4double a,
    65                      G4double z) const;
    6665
    6766  G4double getQF(G4double x,
     
    7877  G4Fissioner* theFissioner;
    7978  G4BigBanger* theBigBanger;
    80 
    8179};       
    8280
    83 #endif // G4EQUILIBRIUM_EVAPORATOR_HH
     81#endif /* G4EQUILIBRIUM_EVAPORATOR_HH */
    8482
    8583
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4EvaporationInuclCollider.hh

    r962 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EvaporationInuclCollider.hh,v 1.2 2008/06/29 23:56:03 dennis Exp $
     26// $Id: G4EvaporationInuclCollider.hh,v 1.5 2010/05/21 17:56:34 mkelsey Exp $
     27// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
     28//
     29// 20100315  M. Kelsey -- Remove "using" directive and unnecessary #includes.
     30// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     31// 20100517  M. Kelsey -- Inherit from common base class, make other colliders
     32//              simple data members
     33
    2734#ifndef G4EVAPORATIONINUCL_COLLIDER_HH
    2835#define G4EVAPORATIONINUCL_COLLIDER_HH
    2936 
    30 #include "G4Collider.hh"
     37#include "G4VCascadeCollider.hh"
    3138
    32 #include "G4EquilibriumEvaporator.hh"
    33 #include "G4Fissioner.hh"
    34 #include "G4BigBanger.hh"
     39class G4InuclParticle;
     40class G4CollisionOutput;
     41class G4EquilibriumEvaporator;
     42class G4BigBanger;
    3543
    36 #include "G4ElementaryParticleCollider.hh"
    37 #include "G4InteractionCase.hh"
    38 #include "G4InuclNuclei.hh"
    39 #include "G4InuclSpecialFunctions.hh"
    40 #include "G4Analyser.hh"
    41 
    42 using namespace G4InuclSpecialFunctions;
    43 
    44 class G4EvaporationInuclCollider {
    45 
     44class G4EvaporationInuclCollider : public G4VCascadeCollider {
    4645public:
    47 
    4846  G4EvaporationInuclCollider();
    4947
    50   G4EvaporationInuclCollider(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) {
    51 
    52     setEquilibriumEvaporator(eqevaporator, fissioner, bigbanger);
    53   };
    54 
    55   void setEquilibriumEvaporator(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) {
    56     theEquilibriumEvaporator = eqevaporator;
    57     theEquilibriumEvaporator->setFissioner(fissioner);   
    58     theEquilibriumEvaporator->setBigBanger(bigbanger);   
    59   };
    60 
    61   void setBigBanger(G4BigBanger* bigbanger) {
    62 
    63     theBigBanger = bigbanger;   
    64   };
    65  
    66   G4CollisionOutput collide(G4InuclParticle* bullet, G4InuclParticle* target);
     48  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     49               G4CollisionOutput& output);
    6750 
    6851private:
    69 
    70   G4int verboseLevel;
    71 
    72   G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
    73                                       G4InuclParticle* target,
    74                                       G4double ekin) const;
    75 
    76   G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,
    77                                        G4InuclParticle* target) const;
    78 
    79   G4bool explosion(G4InuclNuclei* target) const;
    80        
    8152  G4EquilibriumEvaporator* theEquilibriumEvaporator;
    82   G4BigBanger* theBigBanger;
    83 
    8453};       
    8554
    86 #endif // G4EVAPORATIONINUCL_COLLIDER_HH
     55#endif /* G4EVAPORATIONINUCL_COLLIDER_HH */
    8756
    8857
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4Fissioner.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4Fissioner.hh,v 1.12 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100315  M. Kelsey -- Remove "using" directive and unnecessary #includes.
     29// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     30// 20100517  M. Kelsey -- Inherit from common base class
     31
    2632#ifndef G4FISSIONER_HH
    2733#define G4FISSIONER_HH
    2834
    29 #include "G4Collider.hh"
    30 #include "G4InuclSpecialFunctions.hh"
     35#include "G4VCascadeCollider.hh"
     36#include <vector>
    3137
    32 using namespace G4InuclSpecialFunctions;
     38class G4CollisionOutput;
     39class G4InuclParticle;
    3340
    34 class G4Fissioner {
    3541
     42class G4Fissioner : public G4VCascadeCollider {
    3643public:
     44  G4Fissioner();
     45  virtual ~G4Fissioner() {}
    3746
    38   G4Fissioner();
    39 
    40   G4CollisionOutput collide(G4InuclParticle* bullet,
    41                             G4InuclParticle* target);
     47  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     48               G4CollisionOutput& output);
    4249
    4350private:
    44 G4int verboseLevel;
    4551  G4double getC2(G4double A1,
    4652                 G4double A2,
     
    6672                             std::vector<G4double>& BET1,
    6773                             G4double& R12) const;
    68 
    6974};       
    7075
    71 #endif // G4FISSIONER_HH
     76#endif /* G4FISSIONER_HH */
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InteractionCase.hh

    r819 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4InteractionCase.hh,v 1.11 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100518  M. Kelsey -- Why use std::pair<> at all?  Never exported; just
     29//              store pointers.  Add clear() function.  Move code from
     30//              Colliders' "bulletTargetSetter()" to set().
     31
    2632#ifndef G4INTERACTION_CASE_HH
    2733#define G4INTERACTION_CASE_HH
    2834
    29 //#ifndef G4INUCL_PARTICLE_HH
    30 #include "G4InuclParticle.hh"
    31 //#endif
     35#include "globals.hh"
    3236
    33 #include <algorithm>
     37class G4InuclParticle;
     38
    3439
    3540class G4InteractionCase {
     41public:
     42  G4InteractionCase() : bullet(0), target(0), inter_case(0) {}
    3643
    37 public:
     44  G4InteractionCase(G4InuclParticle* part1, G4InuclParticle* part2) {
     45    set(part1, part2);
     46  }
    3847
    39   G4InteractionCase() {
    40     bultag = std::pair<G4InuclParticle*, G4InuclParticle*>(0, 0);
     48  void set(G4InuclParticle* part1, G4InuclParticle* part2);
     49
     50  void clear() {
     51    bullet = target = 0;
    4152    inter_case = 0;
    42   };
     53  }
    4354
    44   G4InteractionCase(G4InuclParticle* part1,
    45                     G4InuclParticle* part2,
    46                     G4int ic) {
    47     setBulletTarget(part1, part2);
    48     setInterCase(ic);
    49   };
     55  G4InuclParticle* getBullet() const { return bullet; }
     56  G4InuclParticle* getTarget() const { return target; }
    5057
    51   void setBulletTarget(G4InuclParticle* part1,
    52                        G4InuclParticle* part2) {
    53     bultag = std::pair<G4InuclParticle*, G4InuclParticle*>(part1, part2);
    54   };
     58  G4bool valid() const      { return inter_case != 0; }
    5559
    56   void setInterCase(G4int ic) {
    57     inter_case = ic;
    58   };
     60  G4bool twoNuclei() const  { return inter_case == -2; }
     61  G4bool hadNucleus() const { return inter_case == -1; }
     62  G4int  hadrons() const    { return inter_case; }      // "rtype" or "is" code
    5963
    60   G4InuclParticle* getBullet() const {
    61     return bultag.first;
    62   };
    63 
    64   G4InuclParticle* getTarget() const {
    65     return bultag.second;
    66   };
    67 
    68   G4int getInterCase() const {
    69     return inter_case;
    70   };
     64  // For compatibility with G4IntraNucleiCascader code
     65  G4int  code() const { return ((inter_case<0) ? -inter_case : 0); }
    7166
    7267private:
    73 
    74   std::pair<G4InuclParticle*, G4InuclParticle*> bultag;
     68  G4InuclParticle* bullet;
     69  G4InuclParticle* target;
    7570
    7671  G4int inter_case;
    77 
    7872};
    7973
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4IntraNucleiCascader.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4IntraNucleiCascader.hh,v 1.10 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100315  M. Kelsey -- Remove "using" directory and unnecessary #includes.
     29// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     30// 20100517  M. Kelsey -- Inherit from common base class, make other colliders
     31//              simple data members
     32
    2633#ifndef G4INTRA_NUCLEI_CASCADER_HH
    2734#define G4INTRA_NUCLEI_CASCADER_HH
    2835
    29 #include "G4Collider.hh"
    30 #include "G4ElementaryParticleCollider.hh"
    31 #include "G4InuclSpecialFunctions.hh"
    32 #include "G4CascadSpecialFunctions.hh"
    33 #include "G4InuclElementaryParticle.hh"
     36#include "G4VCascadeCollider.hh"
    3437
    35 using namespace G4InuclSpecialFunctions;
    36 using namespace G4CascadSpecialFunctions;
     38class G4CollisionOutput;
     39class G4ElementaryParticleCollider;
     40class G4InuclParticle;
    3741
    38 class G4IntraNucleiCascader {
    3942
     43class G4IntraNucleiCascader : public G4VCascadeCollider {
    4044public:
     45  G4IntraNucleiCascader();
     46  virtual ~G4IntraNucleiCascader();
    4147
    42   G4IntraNucleiCascader();
     48  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     49               G4CollisionOutput& output);
    4350
    44   void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) {
    45     theElementaryParticleCollider = ecollider;   
    46   };
    47  
    48   G4CollisionOutput collide(G4InuclParticle* bullet,
    49                             G4InuclParticle* target);
    50 
     51  // FIXME:  This should come from (or be determined by) G4InteractionCase
    5152  void setInteractionCase(G4int intcase) {
    5253    inter_case = intcase;
     
    5455
    5556private:
    56 G4int verboseLevel;
    5757  G4ElementaryParticleCollider* theElementaryParticleCollider;
    5858
     59  // FIXME:  This should come from (or be determined by) G4InteractionCase
    5960  G4int inter_case;
    6061
    6162  G4bool goodCase(G4double a, G4double z, G4double eexs, G4double ein) const;
    62 
    6363};       
    6464
    65 #endif // G4INTRA_NUCLEI_CASCADER_HH
     65#endif /* G4INTRA_NUCLEI_CASCADER_HH */
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclCollider.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4InuclCollider.hh,v 1.13 2010/05/21 17:56:34 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     29// 20100517  M. Kelsey -- Inherit from common base class, make other colliders
     30//              simple data members
     31
    2632#ifndef G4INUCL_COLLIDER_HH
    2733#define G4INUCL_COLLIDER_HH
    28  
    29 #include "G4Collider.hh"
    30 #include "G4IntraNucleiCascader.hh"
    31 #include "G4NonEquilibriumEvaporator.hh"
    32 #include "G4EquilibriumEvaporator.hh"
    33 #include "G4Fissioner.hh"
    34 #include "G4BigBanger.hh"
    35 #include "G4ElementaryParticleCollider.hh"
    36 #include "G4InteractionCase.hh"
    37 #include "G4InuclNuclei.hh"
    38 #include "G4InuclSpecialFunctions.hh"
    39 #include "G4Analyser.hh"
    4034
    41 using namespace G4InuclSpecialFunctions;
     35#include "G4VCascadeCollider.hh"
    4236
    43 class G4InuclCollider {
     37class G4BigBanger;
     38class G4CollisionOutput;
     39class G4ElementaryParticleCollider;
     40class G4EquilibriumEvaporator;
     41class G4IntraNucleiCascader;
     42class G4InuclParticle;
     43class G4NonEquilibriumEvaporator;
     44
     45
     46class G4InuclCollider : public G4VCascadeCollider {
    4447
    4548public:
    4649
    4750  G4InuclCollider();
     51  virtual ~G4InuclCollider();
    4852
    49   G4InuclCollider(G4ElementaryParticleCollider* ecollider,
    50                   G4IntraNucleiCascader* incascader,
    51                   G4NonEquilibriumEvaporator* noeqevaporator,
    52                   G4EquilibriumEvaporator* eqevaporator,
    53                   G4Fissioner* fissioner,
    54                   G4BigBanger* bigbanger) {
    55 
    56     setElementaryParticleCollider(ecollider);
    57     setIntraNucleiCascader(incascader,ecollider);
    58     setNonEquilibriumEvaporator(noeqevaporator);
    59     setEquilibriumEvaporator(eqevaporator, fissioner, bigbanger);
    60     setBigBanger(bigbanger);
    61 
    62   };
    63 
    64   void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) {
    65 
    66     theElementaryParticleCollider = ecollider;   
    67   };
    68 
    69   void setIntraNucleiCascader(G4IntraNucleiCascader* incascader,
    70                               G4ElementaryParticleCollider* ecollider) {
    71 
    72     theIntraNucleiCascader = incascader;
    73     theIntraNucleiCascader->setElementaryParticleCollider(ecollider);
    74   };
    75 
    76   void setNonEquilibriumEvaporator(G4NonEquilibriumEvaporator* noeqevaporator) {
    77 
    78     theNonEquilibriumEvaporator = noeqevaporator;   
    79   };
    80 
    81   void setEquilibriumEvaporator(G4EquilibriumEvaporator* eqevaporator,
    82                                 G4Fissioner* fissioner,
    83                                 G4BigBanger* bigbanger) {
    84 
    85     theEquilibriumEvaporator = eqevaporator;
    86     theEquilibriumEvaporator->setFissioner(fissioner);   
    87     theEquilibriumEvaporator->setBigBanger(bigbanger);   
    88   };
    89 
    90   void setBigBanger(G4BigBanger* bigbanger) {
    91 
    92     theBigBanger = bigbanger;   
    93   };
    94  
    95   G4CollisionOutput collide(G4InuclParticle* bullet,
    96                             G4InuclParticle* target);
     53  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     54               G4CollisionOutput& output);
    9755
    9856private:
    99 
    100   G4int verboseLevel;
    101 
    102   G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
    103                                       G4InuclParticle* target,
    104                                       G4double ekin) const;
    105 
    106   G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,
    107                                        G4InuclParticle* target) const;
    108 
    109   G4bool explosion(G4InuclNuclei* target) const;
    110        
    11157  G4ElementaryParticleCollider* theElementaryParticleCollider;
    11258  G4IntraNucleiCascader* theIntraNucleiCascader;
     
    11460  G4EquilibriumEvaporator* theEquilibriumEvaporator;
    11561  G4BigBanger* theBigBanger;
    116 
    11762};       
    11863
    119 #endif // G4INUCL_COLLIDER_HH
     64#endif /* G4INUCL_COLLIDER_HH */
    12065
    12166
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclElementaryParticle.hh

    r1196 r1315  
     1#ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
     2#define G4INUCL_ELEMENTARY_PARTICLE_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4InuclElementaryParticle.hh,v 1.22 2010/04/29 19:39:55 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
    27 #define G4INUCL_ELEMENTARY_PARTICLE_HH
     30// 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     31// 20100409  M. Kelsey -- Drop unused string argument from ctors.
     32// 20100429  M. Kelsey -- Change "photon()" to "isPhoton()", use enum names
    2833
    29 
     34#include "G4InuclParticle.hh"
     35#include "G4InuclParticleNames.hh"
    3036#include "globals.hh"
    3137
    32 #ifndef G4INUCL_PARTICLE_HH
    33 #include "G4InuclParticle.hh"
    34 #endif
     38class G4ParticleDefinition;
    3539
    3640class G4InuclElementaryParticle : public G4InuclParticle {
     41public:
     42  G4InuclElementaryParticle()
     43    : G4InuclParticle(), generation(0) {}
    3744
    38 //                     known particle types:
    39 //      1 - proton          11 - k+         111 - quasideuteron PP
    40 //      2 - neutron         13 - k-         112 - quasideuteron PN
    41 //      3 - pi+             15 - k0         122 - quasideuteron NN
    42 //      5 - pi-             17 - k0bar
    43 //      7 - pi 0            21 - lambda
    44 //     10 - photon          23 - sigma+
    45 //                          25 - sigma0
    46 //                          27 - sigma-
    47 //                          29 - xi0
    48 //                          31 - xi-
    49  
    50 public:
     45  explicit G4InuclElementaryParticle(G4int type)
     46    : G4InuclParticle(makeDefinition(type)), generation(0) {}
    5147
    52   G4InuclElementaryParticle() {
    53     particleType = 0;     // DHW: added to keep 4.3 compiler happy
    54     particleMass = 0.;    //            "              "
    55     valid_particle = false;
    56     generation = 0;
    57   };
     48  G4InuclElementaryParticle(const G4LorentzVector& mom,
     49                            G4int type, G4int model=0)
     50    : G4InuclParticle(makeDefinition(type), mom), generation(0) {
     51    setModel(model);
     52  }
    5853
    59   G4InuclElementaryParticle(G4int type)
    60     : particleType(type) {
     54  G4InuclElementaryParticle(G4double ekin, G4int type)
     55    : G4InuclParticle(makeDefinition(type), ekin), generation(0) {}
    6156
    62     particleMass = getParticleMass(type);
    63     valid_particle = false;
    64   };
     57  // Copy and assignment constructors for use with std::vector<>
     58  G4InuclElementaryParticle(const G4InuclElementaryParticle& right)
     59    : G4InuclParticle(right), generation(right.generation) {}
    6560
    66   G4InuclElementaryParticle(const G4CascadeMomentum& mom,
    67                             G4int type)
    68     : G4InuclParticle(mom),
    69       particleType(type) {
     61  G4InuclElementaryParticle& operator=(const G4InuclElementaryParticle& right);
    7062
    71     particleMass = getParticleMass(type);
    72     momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] +
    73                        momentum[3] * momentum[3] + particleMass * particleMass);
    74     valid_particle = true;
    75   };
     63  void setType(G4int ityp);
     64  G4int type() const { return type(getDefinition()); }
    7665
    77  
    78   G4InuclElementaryParticle(const G4CascadeMomentum& mom,
    79                             G4int type, G4int model)
    80     : G4InuclParticle(mom),
    81       particleType(type) {
     66  static G4int type(const G4ParticleDefinition* pd);
    8267
    83     G4InuclParticle::setModel(model);
     68  G4bool isPhoton() const { return (type() == G4InuclParticleNames::photon); }
    8469
    85     particleMass = getParticleMass(type);
    86     momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] +
    87                        momentum[3] * momentum[3] + particleMass * particleMass);
    88     valid_particle = true;
    89   };
     70  G4bool pion() const { return (type()==G4InuclParticleNames::pionPlus ||
     71                                type()==G4InuclParticleNames::pionMinus ||
     72                                type()==G4InuclParticleNames::pionZero); }
    9073
    91   G4InuclElementaryParticle(G4double ekin,
    92                             G4int type)
    93     : particleType(type) {
     74  G4bool nucleon() const { return (type()==G4InuclParticleNames::proton ||
     75                                   type()==G4InuclParticleNames::neutron); }
    9476
    95     particleMass = getParticleMass(type);
    96     momentum[0] = ekin + particleMass;
    97     momentum[3] = std::sqrt(momentum[0] * momentum[0] - particleMass * particleMass);
    98     momentum[1] = momentum[2] = 0.0;
    99     valid_particle = true;
    100   };
     77  G4int baryon() const {                // Can use as a bool (!=0 ==> true)
     78    return getDefinition()->GetBaryonNumber();
     79  }
    10180
    102   void setType(G4int ityp) {
     81  G4bool quasi_deutron() const { return (type() > 100); }
    10382
    104     particleType = ityp;
    105     particleMass = getParticleMass(ityp);
    106   };
    107 
    108   void setMomentum(const G4CascadeMomentum& mom) {
    109 
    110     momentum = mom;
    111     momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] +
    112                        momentum[3] * momentum[3] + particleMass * particleMass);
    113     valid_particle = true;
    114   };
    115 
    116   G4int type() const {
    117 
    118     return particleType;
    119   };
    120 
    121   G4bool photon() const {
    122 
    123     return particleType == 10;
    124   };
    125 
    126   G4bool nucleon() const {
    127     return particleType <= 2;
    128   };
    129 
    130   G4bool baryon() const {
    131     return (particleType == 1  ||
    132             particleType == 2  ||
    133             particleType == 21 ||
    134             particleType == 23 ||
    135             particleType == 25 ||
    136             particleType == 27 ||
    137             particleType == 29 ||
    138             particleType == 31 );
    139   };
    140 
    141   G4bool pion() const {
    142 
    143     return particleType == 3 || particleType == 5 || particleType == 7;
    144   };
    145 
    146   G4bool quasi_deutron() const {
    147 
    148     return particleType > 100;
    149   };
    150 
    151   G4double getMass() const {
    152 
    153     return particleMass;
    154   };
    155 
    156   G4double getParticleMass() const {
    157 
    158     G4double mass;
    159 
    160     switch(particleType) {
    161     case 1: // proton
    162       mass = 0.93827;
    163       break;
    164     case 2: // neutron
    165       mass = 0.93957;
    166       break;
    167     case 3: // pi+
    168       mass = 0.13957;
    169       break;
    170     case 5: // pi-
    171       mass = 0.13957;
    172       break;
    173     case 7: // pi0
    174       mass = 0.13498;
    175       break;
    176     case 10: // photon
    177       mass = 0.0;
    178       break;
    179     case 11: // k+
    180       mass = 0.49368;
    181       break;
    182     case 13: // k-
    183       mass = 0.49368;
    184       break;
    185     case 15: // k0
    186       mass = 0.49767;
    187       break;
    188     case 17: // k0bar
    189       mass = 0.49767;
    190       break;
    191     case 21: // lambda
    192       mass = 1.1157;
    193       break;
    194     case 23: // sigma+
    195       mass = 1.1894;
    196       break;
    197     case 25: // sigma0
    198       mass = 1.1926;
    199       break;
    200     case 27: // sigma-
    201       mass = 1.1974;
    202       break;
    203     case 29: // xi0
    204       mass = 1.3148;
    205       break;
    206     case 31: // xi-
    207       mass = 1.3213;
    208       break;
    209     case 111: // PP
    210       mass = 0.93827 + 0.93827;
    211       break;
    212     case 112: // PN
    213       mass = 0.93827 + 0.93957;
    214       break;
    215     case 122: // NN
    216       mass = 0.93957 + 0.93957;
    217       break;
    218     default:
    219       G4cout << " uups, unknown particle type " << particleType << G4endl;
    220       mass = 0.;
    221     };
    222        
    223     return mass;
    224   };
    225 
    226   G4double getCharge() const {
    227 
    228     G4double charge;
    229 
    230     switch(particleType) {
    231     case 1: // proton
    232       charge = 1.0;
    233       break;
    234     case 2: // neutron
    235       charge = 0.0;
    236       break;
    237     case 3: // pi+
    238       charge = 1.0;
    239       break;
    240     case 5: // pi-
    241       charge = -1.0;
    242       break;
    243     case 7: // pi0
    244       charge = 0.0;
    245       break;
    246     case 10: // photon
    247       charge = 0.0;
    248       break;
    249     case 11: // k+
    250       charge = 1.0;
    251       break;
    252     case 13: // k-
    253       charge = -1.0;
    254       break;
    255     case 15: // k0
    256       charge = 0.0;
    257       break;
    258     case 17: // k0bar
    259       charge = 0.0;
    260       break;
    261     case 21: // lambda
    262       charge = 0.0;
    263       break;
    264     case 23: // sigma+
    265       charge = 1.0;
    266       break;
    267     case 25: // sigma0
    268       charge = 0.0;
    269       break;
    270     case 27: // sigma-
    271       charge = -1.0;
    272       break;
    273     case 29: // xi0
    274       charge = 0.0;
    275       break;
    276     case 31: // xi-
    277       charge = -1.0;
    278       break;
    279     case 111: // PP
    280       charge = 2.0;
    281       break;
    282     case 112: // PN
    283       charge = 1.0;
    284       break;
    285     case 122: // NN
    286       charge = 0.0;
    287       break;
    288     default:
    289       G4cout << " uups, unknown particle type " << particleType << G4endl;
    290       charge = 0.0;
    291     };
    292        
    293     return charge;
    294   };
    295 
    296 
    297   G4double getStrangeness(G4int type) const {
    298 
    299     G4double strangeness;
    300 
    301     switch(type) {
    302     case 1: // proton
    303       strangeness = 0.0;
    304       break;
    305     case 2: // neutron
    306       strangeness = 0.0;
    307       break;
    308     case 3: // pi+
    309       strangeness = 0.0;
    310       break;
    311     case 5: // pi-
    312       strangeness = 0.0;
    313       break;
    314     case 7: // pi0
    315       strangeness = 0.0;
    316       break;
    317     case 10: // photon
    318       strangeness = 0.0;
    319       break;
    320     case 11: // k+
    321       strangeness = 1.0;
    322       break;
    323     case 13: // k-
    324       strangeness = -1.0;
    325       break;
    326     case 15: // k0
    327       strangeness = 1.0;
    328       break;
    329     case 17: // k0bar
    330       strangeness = -1.0;
    331       break;
    332     case 21: // lambda
    333       strangeness = -1.0;
    334       break;
    335     case 23: // sigma+
    336       strangeness = -1.0;
    337       break;
    338     case 25: // sigma0
    339       strangeness = -1.0;
    340       break;
    341     case 27: // sigma-
    342       strangeness = -1.0;
    343       break;
    344     case 29: // xi0
    345       strangeness = -2.0;
    346       break;
    347     case 31: // xi-
    348       strangeness = -2.0;
    349       break;
    350     case 111: // PP
    351       strangeness = 0.0;
    352       break;
    353     case 112: // PN
    354       strangeness = 0.0;
    355       break;
    356     case 122: // NN
    357       strangeness = 0.0;
    358       break;
    359     default:
    360       G4cout << " unknown particle type " << type << G4endl;
    361       strangeness = 0.0;
    362     };
    363        
    364     return strangeness;
    365   };
    366 
    367 
    368   G4double getParticleMass(G4int type) const {
    369 
    370     G4double mass;
    371 
    372     switch(type) {
    373     case 1: // proton
    374       mass = 0.93827;
    375       break;
    376     case 2: // neutron
    377       mass = 0.93957;
    378       break;
    379     case 3: // pi+
    380       mass = 0.13957;
    381       break;
    382     case 5: // pi-
    383       mass = 0.13957;
    384       break;
    385     case 7: // pi0
    386       mass = 0.13498;
    387       break;
    388     case 10: // photon
    389       mass = 0.0;
    390       break;
    391     case 11: // k+
    392       mass = 0.49368;
    393       break;
    394     case 13: // k-
    395       mass = 0.49368;
    396       break;
    397     case 15: // k0
    398       mass = 0.49767;
    399       break;
    400     case 17: // k0bar
    401       mass = 0.49767;
    402       break;
    403     case 21: // lambda
    404       mass = 1.1157;
    405       break;
    406     case 23: // sigma+
    407       mass = 1.1894;
    408       break;
    409     case 25: // sigma0
    410       mass = 1.1926;
    411       break;
    412     case 27: // sigma-
    413       mass = 1.1974;
    414       break;
    415     case 29: // xi0
    416       mass = 1.3148;
    417       break;
    418     case 31: // xi-
    419       mass = 1.3213;
    420       break;
    421     case 111: // PP
    422       mass = 0.93827 + 0.93827;
    423       break;
    424     case 112: // PN
    425       mass = 0.93827 + 0.93957;
    426       break;
    427     case 122: // NN
    428       mass = 0.93957 + 0.93957;
    429       break;
    430     default:
    431       G4cout << " uups, unknown particle type " << type << G4endl;
    432       mass = 0.0;
    433     };
    434        
    435     return mass;
    436   };
    437 
    438   G4double getKineticEnergy() const {
    439 
    440     return momentum[0] - particleMass;
    441   };
    442 
    443   G4double getEnergy() const {
    444 
    445     return momentum[0];
    446   };
    447 
    448   G4bool valid() const {
    449 
    450     return valid_particle;
    451   };
     83  G4bool valid() const { return type()>0; }
    45284
    45385  virtual void printParticle() const {
    454 
    45586    G4InuclParticle::printParticle();
    456 
    457     G4cout << " Particle: type " << particleType << " mass " << particleMass <<
    458       " ekin " << getKineticEnergy() << G4endl;
    459   };
    460 
    461   void setGeneration(G4int gen) {
    462     generation = gen;
     87    G4cout << " Particle: type " << type() << " mass " << getMass()
     88           << " ekin " << getKineticEnergy() << G4endl;
    46389  }
    46490
    465   G4int getGeneration() {
    466     return generation;
    467   }
     91  void setGeneration(G4int gen) { generation = gen; }
     92  G4int getGeneration() const { return generation; }
     93
     94  static G4double getStrangeness(G4int type);
     95  static G4double getParticleMass(G4int type);
     96
     97protected:
     98  // Convert internal type code to standard GEANT4 pointer
     99  static G4ParticleDefinition* makeDefinition(G4int ityp);
    468100
    469101private:
    470 
    471   G4int particleType;
    472 
    473   G4double particleMass;
    474 
    475   G4bool valid_particle;
    476 
    477102  G4int generation;
    478 
    479103};       
    480104
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclEvaporation.hh

    r819 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InuclEvaporation.hh,v 1.5 2007/05/24 23:27:01 miheikki Exp $
     26// $Id: G4InuclEvaporation.hh,v 1.8 2010/05/21 18:07:30 mkelsey Exp $
    2727// Defines an interface to evaporation models of Bertini cascase (BERT)
    2828// based on INUCL code.
    2929//
     30// 20100405  M. Kelsey -- Pass const-ref std::vector<>
     31// 20100517  M. Kelsey -- MakeG4EvaporationInuclCollider a data member.
     32// 20100520  M. Kelsey -- Clean up interface
     33
    3034#ifndef G4INUCLEVAPORATION_h
    3135#define G4INUCLEVAPORATION_h 1
     
    3539#include "G4Fragment.hh"
    3640
    37 //#define DEBUG
     41class G4EvaporationInuclCollider;
     42
    3843
    3944class G4InuclEvaporation : public G4VEvaporation {
     
    4954  G4bool operator!=(const G4InuclEvaporation &right) const;
    5055
    51   void fillResult( std::vector< G4DynamicParticle * > secondaryParticleVector,
    52                    G4FragmentVector * aResult );
    5356public:
    54 
    5557  G4FragmentVector * BreakItUp(const G4Fragment &theNucleus);
    56        
     58     
    5759  void setVerboseLevel( const G4int verbose );
    5860
    5961private:
    6062  G4int verboseLevel;
    61 
    62 #ifdef DEBUG
    63 
    64 #endif
    65 
     63  G4EvaporationInuclCollider* evaporator;
    6664};
    6765
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclNuclei.hh

    r962 r1315  
     1#ifndef G4INUCL_NUCLEI_HH
     2#define G4INUCL_NUCLEI_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4InuclNuclei.hh,v 1.16 2010/04/09 19:33:11 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4INUCL_NUCLEI_HH
    27 #define G4INUCL_NUCLEI_HH
     30// 20100112  Michael Kelsey -- Replace G4CascadeMomentum with G4LorentzVector
     31// 20100301  M. Kelsey -- Add function to create unphysical nuclei for use
     32//           as temporary final-state fragments.
     33// 20100319  M. Kelsey -- Remove "using" directory and unnecessary #includes.
     34// 20100409  M. Kelsey -- Drop unused string argument from ctors.
    2835
    29 #ifndef G4INUCL_PARTICLE_HH
    3036#include "G4InuclParticle.hh"
    31 #endif
    3237#include "G4ExitonConfiguration.hh"
    33 #include "G4InuclSpecialFunctions.hh"
    3438
    35 using namespace G4InuclSpecialFunctions;
     39class G4ParticleDefinition;
    3640
    3741class G4InuclNuclei : public G4InuclParticle {
     42public:
     43  G4InuclNuclei() : G4InuclParticle() {}
    3844
    39 public:
     45  G4InuclNuclei(G4double a, G4double z)
     46    : G4InuclParticle(makeDefinition(a,z)),
     47      exitationEnergy(0.0) {}
    4048
    41   G4InuclNuclei() {};
     49  G4InuclNuclei(const G4LorentzVector& mom, G4double a, G4double z)
     50    : G4InuclParticle(makeDefinition(a,z), mom),
     51      exitationEnergy(0.0) {}
    4252
    43   G4InuclNuclei(G4double a,
    44                 G4double z)
    45     : A(a),
    46       Z(z) {
     53  G4InuclNuclei(G4double ekin, G4double a, G4double z)
     54    : G4InuclParticle(makeDefinition(a,z), ekin),
     55      exitationEnergy(0.0) {}
    4756
    48     setNucleiMass();
    49     exitationEnergy = 0.0;
    50   };
     57  virtual ~G4InuclNuclei() {}
    5158
    52   G4InuclNuclei(const G4CascadeMomentum& mom,
    53                 G4double a,
    54                 G4double z)
    55     : G4InuclParticle(mom),
    56       A(a),
    57       Z(z) {
     59  // Copy and assignment constructors for use with std::vector<>
     60  G4InuclNuclei(const G4InuclNuclei& right)
     61    : G4InuclParticle(right), exitationEnergy(right.exitationEnergy),
     62      theExitonConfiguration(right.theExitonConfiguration) {}
    5863
    59     setNucleiMass(); 
    60     exitationEnergy = 0.0;
    61   };
     64  G4InuclNuclei& operator=(const G4InuclNuclei& right);
    6265
    63   G4InuclNuclei(G4double ekin,
    64                 G4double a,
    65                 G4double z)
    66     : A(a),
    67     Z(z) {
    68 
    69     setNucleiMass();
    70     G4CascadeMomentum mom;
    71     mom[0] = ekin + nucleiMass;
    72     mom[3] = std::sqrt(mom[0] * mom[0] - nucleiMass * nucleiMass);
    73     G4InuclParticle::setMomentum(mom);
    74     exitationEnergy = 0.0;
    75   };
    76        
    77   void setA(G4double a) {
    78 
    79     A = a;
    80   };
    81 
    82   void setZ(G4double z) {
    83 
    84     Z = z;
    85   };
    86 
    87   void setExitationEnergy(G4double e) {
    88 
    89     exitationEnergy = e;
    90   };
    91 
    92   void setEnergy() {
    93 
    94     momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] +
    95                        momentum[3] * momentum[3] + nucleiMass * nucleiMass); 
    96   };
    97 
    98   void setNucleiMass() {
    99 
    100     nucleiMass = 0.93827 * Z + 0.93957 * (A - Z) - 0.001 * bindingEnergy(A, Z);
    101   };
     66  void setExitationEnergy(G4double e) { exitationEnergy = e; }
    10267
    10368  void setExitonConfiguration(const G4ExitonConfiguration& config) {
     69    theExitonConfiguration = config;
     70  }
    10471
    105     theExitonConfiguration = config;
    106   };
     72  G4double getA() const { return getDefinition()->GetAtomicMass(); }
    10773
    108   G4double getA() const {
     74  G4double getZ() const { return getDefinition()->GetAtomicNumber(); }
    10975
    110     return A;
    111   };
    112 
    113   G4double getZ() const {
    114 
    115     return Z;
    116   };
    117 
    118   G4double getExitationEnergy() const {
    119 
    120     return exitationEnergy;
    121   };
     76  G4double getExitationEnergy() const { return exitationEnergy; }
    12277
    12378  G4double getExitationEnergyInGeV() const {
     79    return 0.001 * exitationEnergy;
     80  }
    12481
    125     return 0.001 * exitationEnergy;
    126   };
     82  const G4ExitonConfiguration& getExitonConfiguration() const {
     83    return theExitonConfiguration;
     84  }
    12785
    128   G4ExitonConfiguration getExitonConfiguration() const {
    129 
    130     return theExitonConfiguration;
    131   };
    132 
    133   G4double getMass() const {
    134 
    135     return nucleiMass;
    136   };
    137 
    138   G4double getKineticEnergy() const {
    139 
    140     return momentum[0] - nucleiMass;
    141   };
    142 
    143   G4double getNucleiMass(G4double a,
    144                          G4double z) const {
    145 
    146     return 0.93827 * z + 0.93957 * (a - z) - 0.001 * bindingEnergy(a, z);
    147   };
     86  static G4double getNucleiMass(G4double a, G4double z);
    14887
    14988  virtual void printParticle() const {
     89    G4cout << " A " << getA() << " Z " << getZ() << " mass "
     90           << getMass() << " Eex (MeV) " << exitationEnergy << G4endl;
     91    G4InuclParticle::printParticle();
     92  }
    15093
    151     G4cout << " A " << A << " Z " << Z << " mass " << nucleiMass <<
    152       " Eex (MeV) " << exitationEnergy << G4endl;
     94protected:
     95  // Convert nuclear configuration to standard GEANT4 pointer
     96  static G4ParticleDefinition*
     97  makeDefinition(G4double a, G4double z, G4double exc=0.);
    15398
    154     G4cout << " Px " << momentum[1] << " Py " << momentum[2] << " Pz " << 
    155         momentum[3] <<  " E " << momentum[0] << G4endl;
    156   };
     99  static G4ParticleDefinition*
     100  makeNuclearFragment(G4double a, G4double z, G4double exc=0.);
    157101
    158102private:
    159 
    160   G4double A;
    161   G4double Z;
    162103  G4double exitationEnergy;
    163   G4double nucleiMass;
    164104  G4ExitonConfiguration theExitonConfiguration;
    165 
    166105};       
    167106
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclParticle.hh

    r962 r1315  
     1#ifndef G4INUCL_PARTICLE_HH
     2#define G4INUCL_PARTICLE_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4InuclParticle.hh,v 1.19 2010/05/21 18:07:30 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4INUCL_PARTICLE_HH
    27 #define G4INUCL_PARTICLE_HH
     30// 20100112  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     31// 20100409  M. Kelsey -- Drop unused string argument from ctors.
     32// 20100519  M. Kelsey -- Add public access to G4DynamicParticle content
    2833
    29 #ifndef GLOB
     34#include "G4DynamicParticle.hh"
     35#include "G4LorentzVector.hh"
    3036#include "globals.hh"
    31 #endif
    3237
    33 #include <iostream>
    34 #include <vector>
    35 #include "G4CascadeMomentum.hh"
    36 
    37 // Notice: no cc-file for G4InuclParticle
    3838
    3939class G4InuclParticle {
     40public:
     41  G4InuclParticle() : modelId(0) {}
    4042
    41 public:
    42   G4InuclParticle() {
    43     setModel(0); // default model
    44   };
     43  explicit G4InuclParticle(const G4LorentzVector& mom) : modelId(0) {
     44    pDP.Set4Momentum(mom*GeV/MeV);              // From Bertini to G4 units
     45  }
    4546
    46   virtual ~G4InuclParticle() { };
    47  
    48   G4InuclParticle(const G4CascadeMomentum& mom) {
    49     setMomentum(mom);
    50     setModel(0);
    51   };
     47  virtual ~G4InuclParticle() {}
    5248
    53   void setMomentum(const G4CascadeMomentum& mom) {
    54     momentum = mom;
    55   };
     49  // Copy and assignment constructors for use with std::vector<>
     50  G4InuclParticle(const G4InuclParticle& right)
     51    : pDP(right.pDP), modelId(right.modelId) {}
    5652
     53  G4InuclParticle& operator=(const G4InuclParticle& right);
    5754
    58   const G4CascadeMomentum& getMomentum() const {
    59     return momentum;
    60   };
     55  // This is no longer required, as setMomentum() handles mass adjustment
     56  void setEnergy() { ; }
    6157
    62   G4double getMomModule() const {
    63     return std::sqrt(momentum[1] * momentum[1] +
    64                      momentum[2] * momentum[2] +
    65                      momentum[3] * momentum[3]);
    66   };
    67    
    68   virtual void printParticle() const {
    69     G4cout << " px " << momentum[1] << " py " << momentum[2] <<
    70       " pz " << momentum[3] <<
    71       " pmod " << std::sqrt(momentum[1] * momentum[1] +
    72                             momentum[2] * momentum[2] +
    73                             momentum[3] * momentum[3])
    74            << " E " << momentum[0]
    75            << " creator model " << modelId << G4endl;
    76   };
     58  // These are call-throughs to G4DynamicParticle
     59  void setMomentum(const G4LorentzVector& mom);
    7760
    78   void setModel(G4int model) {
    79     modelId = model;
    80   };
     61  void setMass(G4double mass) { pDP.SetMass(mass*GeV/MeV); }
    8162
    82   G4int getModel() {
    83     return modelId;
    84   };
     63  G4double getMass() const {
     64    return pDP.GetMass()*MeV/GeV;               // From G4 to Bertini units
     65  }
     66
     67  G4double getCharge() const {
     68    return pDP.GetCharge();
     69  }
     70
     71  G4double getKineticEnergy() const {
     72    return pDP.GetKineticEnergy()*MeV/GeV;      // From G4 to Bertini units
     73  }
     74
     75  G4double getEnergy() const {
     76    return pDP.GetTotalEnergy()*MeV/GeV;        // From G4 to Bertini units
     77  }
     78
     79  G4double getMomModule() const {
     80    return pDP.GetTotalMomentum()*MeV/GeV;      // From G4 to Bertini units
     81  }
     82
     83  G4LorentzVector getMomentum() const {
     84    return pDP.Get4Momentum()*MeV/GeV;          // From G4 to Bertini units
     85  }
     86
     87  virtual void printParticle() const;
     88
     89  void setModel(G4int model) { modelId = model; }
     90
     91  G4int getModel() const { return modelId; }
     92
     93  G4ParticleDefinition* getDefinition() const {
     94    return pDP.GetDefinition();
     95  }
     96
     97  const G4DynamicParticle& getDynamicParticle() const {
     98    return pDP;
     99  }
    85100
    86101protected:
    87   G4CascadeMomentum momentum;
     102  //  Special constructors for subclasses to set particle type correctly
     103  explicit G4InuclParticle(G4ParticleDefinition* pd) : modelId(0) {
     104    setDefinition(pd);
     105  }
     106
     107  // FIXME: Bertini code doesn't pass valid 4-vectors, so force mass value
     108  //        from supplied PartDefn, with required unit conversions
     109  G4InuclParticle(G4ParticleDefinition* pd, const G4LorentzVector& mom);
     110
     111  // NOTE:  Momentum forced along Z direction
     112  G4InuclParticle(G4ParticleDefinition* pd, G4double ekin)
     113    : pDP(pd,G4ThreeVector(0.,0.,1.),ekin*GeV/MeV), modelId(0) {}
     114
     115  void setDefinition(G4ParticleDefinition* pd) { pDP.SetDefinition(pd); }
    88116
    89117private:
    90   G4int modelId; // used to indicate model that created instance of G4InuclParticle
     118  G4DynamicParticle pDP;                // Carries all the kinematics and info
    91119
     120  G4int modelId;
     121  // used to indicate model that created instance of G4InuclParticle
    92122  // 0 default
    93123  // 1 bullet
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclSpecialFunctions.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4InuclSpecialFunctions.hh,v 1.16 2010/04/13 05:30:10 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     29// 20100319  M. Kelsey -- Add optional mass argument to generateWithFixedTheta;
     30//              define new generateWithRandomAngles, encapsulating code; define
     31//              cbrt() cube-root function (in math.h, but not in <math>!)
     32// 20100412  M. Kelsey -- Modify paraMaker[Truncated] to take buffer as argument
     33
    2634#ifndef G4INUCL_SPECIAL_FUNC_HH
    2735#define G4INUCL_SPECIAL_FUNC_HH
    2836
    2937#include "globals.hh"
    30 #include <cmath>
    3138#include <algorithm>
    3239#include <vector>
    33 #include "G4CascadeMomentum.hh"
     40#include "G4LorentzVector.hh"
    3441
    3542namespace G4InuclSpecialFunctions {
     
    5158                       G4int ntype);
    5259 
    53   std::pair<std::vector<G4double>, std::vector<G4double> > paraMaker(G4double Z);
     60  void paraMaker(G4double Z, std::pair<std::vector<G4double>, std::vector<G4double> >& parms);
    5461
    55   std::pair<G4double, G4double> paraMakerTruncated(G4double Z);
     62  void paraMakerTruncated(G4double Z, std::pair<G4double, G4double>& parms);
    5663
    5764  G4double getAL(G4double A);
     
    6067
    6168  G4double csPN(G4double e);
     69
     70  G4double G4cbrt(G4double x);  // Can't use "cbrt" name, clashes with <math.h>
    6271
    6372  G4double inuclRndm();
     
    7180  G4double nucleiLevelDensity(G4double a);
    7281
    73   G4CascadeMomentum generateWithFixedTheta(G4double ct,
    74                                           G4double p);
     82  // Optional mass argument will be used to fill G4LorentzVector correctly
     83  G4LorentzVector generateWithFixedTheta(G4double ct, G4double p,
     84                                         G4double m=0.);
     85
     86  G4LorentzVector generateWithRandomAngles(G4double p, G4double m=0.);
    7587}
     88
     89
    7690#endif
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4LorentzConvertor.hh,v 1.15 2010/05/21 17:56:34 mkelsey Exp $
     26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100108  Michael Kelsey -- Use G4LorentzVector internally
     29// 20100120  M. Kelsey -- BUG FIX:  scm_momentum should be G4ThreeVector
     30// 20100126  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
     31// 20100519  M. Kelsey -- Add interfaces to pass G4InuclParticles directly
     32
    2633#ifndef G4LORENTZ_CONVERTOR_HH
    2734#define G4LORENTZ_CONVERTOR_HH
    2835
    29 #ifndef GLOB
    3036#include "globals.hh"
    31 #endif
     37#include "G4LorentzVector.hh"
     38#include "G4ThreeVector.hh"
    3239
    33 #include <vector>
    34 #include "G4CascadeMomentum.hh"
     40class G4InuclParticle;
    3541
    3642class G4LorentzConvertor {
     
    4046  G4LorentzConvertor();
    4147
    42   G4LorentzConvertor(const G4CascadeMomentum& bmom,
    43                      G4double bmass,
    44                      const G4CascadeMomentum& tmom,
    45                      G4double tmass) {
    46 
     48  G4LorentzConvertor(const G4LorentzVector& bmom, G4double bmass,
     49                     const G4LorentzVector& tmom, G4double tmass) {
    4750    setBullet(bmom, bmass);
    4851    setTarget(tmom, tmass);
    49     degenerated = false; 
    50   };
     52  }
    5153
    52   void setBullet(const G4CascadeMomentum& bmom,
    53                  G4double bmass) {
     54  G4LorentzConvertor(const G4InuclParticle* bullet,
     55                     const G4InuclParticle* target) {
     56    setBullet(bullet);
     57    setTarget(target);
     58  }
    5459
    55     bullet_mom = bmom;
    56     bullet_mass = bmass;
    57     //  G4cout << " bullet: e " << bmom[0] << " mass " << bmass << G4endl;
     60  void setVerbose(G4int vb=0) { verboseLevel = vb; }
     61
     62  void setBullet(const G4InuclParticle* bullet);
     63  void setTarget(const G4InuclParticle* target);
     64
     65  void setBullet(const G4InuclParticle& bullet) { setBullet(&bullet); }
     66  void setTarget(const G4InuclParticle& target) { setTarget(&target); }
     67
     68  // Use correct four-vectors as input
     69  void setBullet(const G4LorentzVector& bmom) { bullet_mom = bmom; }
     70  void setTarget(const G4LorentzVector& bmom) { target_mom = bmom; }
     71
     72  // NOTE:  These functions "repair" input 4-vectors using specified mass
     73  void setBullet(const G4LorentzVector& bmom, G4double bmass) {
     74    bullet_mom.setVectM(bmom.vect(), bmass);
     75
     76    //  G4cout << " bullet: e " << bullet_mom.e() << " mass "
     77    //         << bullet_mom.m() << G4endl;
    5878  };
    5979
    60   void setTarget(const G4CascadeMomentum& tmom,
    61                  G4double tmass) {
     80  void setTarget(const G4LorentzVector& tmom, G4double tmass) {
     81    target_mom.setVectM(tmom.vect(), tmass);
    6282
    63     target_mom = tmom;
    64     target_mass = tmass;
    65     //  G4cout << " target: e " << tmom[0] << " mass " << tmass << G4endl;
     83    //  G4cout << " target: e " << target_mom.e() << " mass "
     84    //         << target_mom.m() << G4endl;
    6685  };
    6786
    6887  void toTheCenterOfMass();
    69  
    7088  void toTheTargetRestFrame();
    7189
    72   G4CascadeMomentum backToTheLab(const G4CascadeMomentum& mom) const;
     90  G4LorentzVector backToTheLab(const G4LorentzVector& mom) const;
    7391
    74   G4double getKinEnergyInTheTRS() const {
     92  // Four-vectors of bullet and target in last chosen reference frame
     93  const G4LorentzVector& getBullet() const { return bullet_mom; }
     94  const G4LorentzVector& getTarget() const { return target_mom; }
     95 
     96  G4double getKinEnergyInTheTRS() const;
     97  G4double getTotalSCMEnergy() const { return ecm_tot; }
     98  G4double getSCMMomentum() const { return scm_momentum.rho(); }
     99  G4double getTRSMomentum() const;
    75100
    76     G4double pv = bullet_mom[1] * target_mom[1] +
    77       bullet_mom[2] * target_mom[2] +
    78       bullet_mom[3] * target_mom[3]; 
    79     G4double ekin_trf = (target_mom[0] *
    80                          bullet_mom[0] - pv) / target_mass - bullet_mass;
    81     return ekin_trf;
    82   };
     101  G4LorentzVector rotate(const G4LorentzVector& mom) const;
    83102
    84   G4double getTotalSCMEnergy() const {
    85 
    86     return ecm_tot;
    87   };
    88 
    89   G4double getSCMMomentum() const {
    90 
    91     return pscm;
    92   };
    93 
    94   G4double getTRSMomentum() const {
    95 
    96     return plab;
    97   };
    98  
    99   G4CascadeMomentum rotate(const G4CascadeMomentum& mom) const;
    100 
    101   G4CascadeMomentum rotate(const G4CascadeMomentum& mom1,
    102                             const G4CascadeMomentum& mom) const;
     103  G4LorentzVector rotate(const G4LorentzVector& mom1,
     104                         const G4LorentzVector& mom) const;
    103105
    104106  G4bool reflectionNeeded() const;
    105107
    106   G4bool trivial() const {
    107     return degenerated;
    108   };
     108  G4bool trivial() const { return degenerated; }
    109109
    110110private:
    111 G4int verboseLevel;
    112   G4CascadeMomentum bullet_mom;
    113   G4double bullet_mass;
     111  static const G4double small;
    114112
    115   G4CascadeMomentum target_mom;
    116   G4double target_mass;
     113  G4int verboseLevel;
     114  G4LorentzVector bullet_mom;
     115  G4LorentzVector target_mom;
    117116
    118   std::vector<G4double> velocity;
     117  G4LorentzVector scm_momentum;         // CM momentum relative to target/bullet
    119118
    120   G4CascadeMomentum scm_momentum;
    121 
     119  // Buffer variables for doing ::rotate() calculations
     120  G4ThreeVector velocity;
     121  G4double gamma;
     122  G4double v2;
    122123  G4double ecm_tot;
    123 
    124   G4double pscm;
    125 
    126   G4double plab;
    127 
    128   G4double gamma;
    129 
    130   G4double v2;
    131 
    132124  G4double ga;
    133 
    134125  G4double gb;
    135 
    136126  G4double gbpp;
    137 
    138127  G4double gapp;
    139 
    140128  G4bool degenerated;
    141129};       
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4NonEquilibriumEvaporator.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4NonEquilibriumEvaporator.hh,v 1.10 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100315  M. Kelsey -- Remove "using" directive and unnecessary #includes.
     29// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     30// 20100517  M. Kelsey -- Inherit from common base class
     31
    2632#ifndef G4NON_EQUILIBRIUM_EVAPORATOR_HH
    2733#define G4NON_EQUILIBRIUM_EVAPORATOR_HH
    2834
    29 #include "G4Collider.hh"
    30 #include "G4InuclSpecialFunctions.hh"
     35#include "G4VCascadeCollider.hh"
    3136
    32 using namespace G4InuclSpecialFunctions;
     37class G4CollisionOutput;
     38class G4InuclParticle;
    3339
    34 class G4NonEquilibriumEvaporator {
     40class G4NonEquilibriumEvaporator : public G4VCascadeCollider {
     41public:
     42  G4NonEquilibriumEvaporator();
     43  virtual ~G4NonEquilibriumEvaporator() {}
    3544
    36 public:
    37 
    38   G4NonEquilibriumEvaporator();
    39 
    40   G4CollisionOutput collide(G4InuclParticle* bullet,
    41                                     G4InuclParticle* target);
     45  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     46               G4CollisionOutput& output);
    4247
    4348private:
    44 G4int verboseLevel;
    4549  G4double getMatrixElement(G4double A) const;
    46 
    4750  G4double getE0(G4double A) const;
    48 
    4951  G4double getParLev(G4double A, G4double Z) const;
    50 
    5152};
    5253
    53 #endif // G4NON_EQUILIBRIUM_EVAPORATOR_HH
     54#endif /* G4NON_EQUILIBRIUM_EVAPORATOR_HH */
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4NuclWatcher.hh

    r819 r1315  
     1#ifndef G4NUCL_WATCHER_HH
     2#define G4NUCL_WATCHER_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4NuclWatcher.hh,v 1.13 2010/04/07 18:23:15 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4NUCL_WATCHER_HH
    27 #define G4NUCL_WATCHER_HH
     30// 20100202  M. Kelsey -- Move most code into .cc file
     31// 20100405  M. Kelsey -- Pass const-ref std::vector<>
    2832
    29 #ifndef GLOB
    30 #include "globals.hh"
    31 #endif
     33#include "G4Types.hh"
    3234
    3335#include <algorithm>
     
    3638
    3739class G4NuclWatcher {
     40public:
     41  G4NuclWatcher(G4double z,
     42                const std::vector<G4double>& expa,
     43                const std::vector<G4double>& expcs,
     44                const std::vector<G4double>& experr,
     45                G4bool check,
     46                G4bool nucl);
    3847
    39 public:
     48  ~G4NuclWatcher() {}
    4049
    41   G4NuclWatcher(G4double z,
    42                 std::vector<G4double> expa,
    43                 std::vector<G4double> expcs,
    44                 std::vector<G4double> experr,
    45                 G4bool check,
    46                 G4bool nucl)
    47     : nuclz(z),
    48       checkable(check),
    49       nucleable(nucl)  {
     50  void watch(G4double a, G4double z);
     51  void setInuclCs(G4double csec, G4int nev);
    5052
    51     exper_as = expa;
    52     exper_cs = expcs;
    53     exper_err = experr;
    54   };
     53  G4double getChsq() const { return izotop_chsq; }
     54  G4bool to_check() const { return checkable; }
     55  G4bool look_forNuclei() const { return nucleable; }
     56  G4double getLhood() const { return aver_lhood; }
     57  G4double getNmatched() const { return aver_matched; }
    5558
    56   void watch(G4double a,
    57              G4double z) {
    58 
    59     const G4double small = 0.001;
    60 
    61     if(std::fabs(z - nuclz) < small) {
    62       G4bool here = false;
    63       G4int  simulatedAsSize = simulated_as.size();
    64       for(G4int i = 0; i < simulatedAsSize; i++) {
    65 
    66         if(std::fabs(simulated_as[i] - a) < small) {
    67           simulated_cs[i] += 1.0;
    68           here = true;
    69           break;
    70         };
    71       };
    72       if(!here) {
    73         simulated_as.push_back(a);
    74         simulated_cs.push_back(1.0);
    75       };
    76     };
    77   };
    78 
    79   void setInuclCs(G4double csec,
    80                   G4int nev) {
    81     G4int  simulatedAsSize = simulated_as.size();
    82     for(G4int i = 0; i < simulatedAsSize ; i++) {
    83       double err = std::sqrt(simulated_cs[i]) / simulated_cs[i];
    84 
    85       simulated_prob.push_back(simulated_cs[i] / nev);
    86       simulated_cs[i] *= csec / nev;
    87       simulated_errors.push_back(simulated_cs[i] * err);   
    88     };
    89   };
    90 
    91   G4double getChsq() const {
    92 
    93     return izotop_chsq;
    94   };
     59  std::pair<G4double, G4double> getExpCs() const;
     60  std::pair<G4double, G4double> getInuclCs() const;
    9561
    9662  std::pair<G4double, G4double> getAverageRatio() const {
     63    return std::pair<G4double, G4double>(average_ratio, aver_rat_err);
     64  }
    9765
    98     return std::pair<G4double, G4double>(average_ratio, aver_rat_err);
    99   };
    100 
    101   std::pair<G4double, G4double> getExpCs() const {
    102 
    103     G4double cs = 0.0;
    104     G4double err = 0.0;
    105 
    106     G4int experAsSize = exper_as.size();
    107     for(G4int iz = 0; iz < experAsSize; iz++) {
    108       cs += exper_cs[iz];
    109       err += exper_err[iz];
    110     };
    111 
    112     return std::pair<G4double, G4double>(cs, err);
    113   };
    114 
    115   G4bool to_check() const {
    116 
    117     return checkable;
    118   };
    119 
    120   G4bool look_forNuclei() const {
    121 
    122     return nucleable;
    123   };
    124 
    125   std::pair<G4double, G4double> getInuclCs() const {
    126 
    127     G4double cs = 0.0;
    128     G4double err = 0.0;
    129     G4int  simulatedAsSize = simulated_as.size();
    130     for(G4int iz = 0; iz < simulatedAsSize; iz++) {
    131       cs += simulated_cs[iz];
    132       err += simulated_errors[iz];
    133     };
    134 
    135     return std::pair<G4double, G4double>(cs, err);
    136   };
    137 
    138   void print() {
    139 
    140     const G4double small = 0.001;
    141 
    142     G4cout << G4endl << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
    143            << G4endl;
    144     G4cout << " **** izotop Z **** " << nuclz << G4endl;
    145 
    146     izotop_chsq = 0.0;
    147     average_ratio = 0.0;
    148     aver_rat_err = 0.0;
    149     G4double exp_cs = 0.0;
    150     G4double exp_cs_err = 0.0;
    151     G4double inucl_cs = 0.0;
    152     G4double inucl_cs_err = 0.0;
    153     std::vector<G4bool> not_used(simulated_cs.size(), true);
    154     G4int nmatched = exper_as.size();
    155     G4int nused = simulated_cs.size();
    156     G4double lhood = 0.0;
    157     G4int experAsSize = exper_as.size();
    158     for(G4int iz = 0; iz < experAsSize; iz++) {
    159       G4double a = exper_as[iz];
    160 
    161       exp_cs += exper_cs[iz];
    162       exp_cs_err += exper_err[iz];
    163 
    164       G4bool found = false;
    165     G4int  simulatedAsSize = simulated_as.size();
    166       for(G4int i = 0; i < simulatedAsSize; i++) {
    167 
    168         if(std::fabs(simulated_as[i] - a) < small) {
    169           G4double rat = simulated_cs[i] / exper_cs[iz];
    170 
    171           lhood += std::log10(rat) * std::log10(rat);
    172 
    173           G4double rat_err = std::sqrt(simulated_errors[i] * simulated_errors[i] +
    174                                   exper_err[iz] * exper_err[iz] * rat * rat) / exper_cs[iz];
    175           average_ratio += rat;
    176           aver_rat_err += rat_err;
    177 
    178           G4cout << " A " << a << " exp.cs " << exper_cs[iz] << " err " <<
    179             exper_err[iz] << G4endl <<
    180             " sim. cs " << simulated_cs[i] << " err " << simulated_errors[i] << G4endl
    181                  << " ratio " << rat << " err " << rat_err << G4endl;
    182           G4cout << " simulated production rate " << simulated_prob[i] << G4endl;         
    183 
    184           not_used[i] = false;
    185           izotop_chsq += (rat - 1.0) * (rat - 1.0) / rat_err / rat_err;
    186           found = true;
    187           nused--;
    188           break;
    189         };
    190       };
    191       if(!found) {
    192         G4cout << " not found exper.: A " << a << " exp.cs " << exper_cs[iz]
    193                << " err " << exper_err[iz] << G4endl;
    194       }
    195       else {
    196         nmatched--;
    197       };
    198     };
    199 
    200     G4cout << " not found in simulations " << nmatched << G4endl;
    201     G4cout << " not found in exper: " << nused << G4endl;
    202     G4int  simulatedAsSize = simulated_as.size();
    203     for(G4int i = 0; i < simulatedAsSize; i++) {
    204       inucl_cs += simulated_cs[i];
    205       inucl_cs_err += simulated_errors[i];
    206 
    207       if(not_used[i])
    208         G4cout << " extra simul.: A " << simulated_as[i] <<
    209           " sim. cs " << simulated_cs[i] << " err " << simulated_errors[i] << G4endl;
    210       G4cout << " simulated production rate " << simulated_prob[i] << G4endl;     
    211     };
    212     G4int matched = exper_as.size() - nmatched;
    213 
    214     if(matched > 0) {
    215       aver_lhood = lhood;
    216       aver_matched = matched;   
    217       lhood = std::pow(10.0, std::sqrt(lhood / matched));
    218 
    219       G4cout << " matched " << matched << " CHSQ " << std::sqrt(izotop_chsq) / matched
    220              << G4endl
    221              << " raw chsq " << izotop_chsq << G4endl
    222              << " average ratio " << average_ratio / matched
    223              << " err " << aver_rat_err / matched << G4endl
    224              << " lhood " << lhood << G4endl;
    225     }
    226     else {
    227       izotop_chsq = 0.0;
    228       aver_lhood = 0.0;   
    229     };
    230    
    231     G4cout << " exper. cs " << exp_cs << " err " << exp_cs_err << G4endl
    232            << " inucl. cs " << inucl_cs << " err " << inucl_cs_err << G4endl;
    233     G4cout <<  " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " << G4endl;
    234   };
    235 
    236   G4double getLhood() const {
    237 
    238     return aver_lhood;
    239   };
    240 
    241   G4double getNmatched() const {
    242 
    243     return aver_matched;
    244   };
     66  void print();
    24567
    24668private:
    247 
    24869  G4double nuclz;
    249 
    25070  G4double izotop_chsq;
    251 
    25271  G4double average_ratio;
    253 
    25472  G4double aver_rat_err;
    255 
    25673  G4double aver_lhood;
    257 
    25874  G4double aver_matched;
    259 
    26075  std::vector<G4double> exper_as;
    261 
    26276  std::vector<G4double> exper_cs;
    263 
    26477  std::vector<G4double> exper_err;
    265 
    26678  std::vector<G4double> simulated_as;
    267 
    26879  std::vector<G4double> simulated_cs;
    269 
    27080  std::vector<G4double> simulated_errors;
    271 
    27281  std::vector<G4double> simulated_prob;
    273 
    27482  G4bool checkable;
    275 
    27683  G4bool nucleable;
    277 
    278 };       
     84};
    27985
    28086#endif // G4NUCL_WATCHER_HH
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4NucleiModel.hh

    r1196 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4NucleiModel.hh,v 1.25 2010/05/21 17:44:38 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100319  M. Kelsey -- Remove "using" directory and unnecessary #includes,
     29//              move ctor to .cc file
     30// 20100407  M. Kelsey -- Create "partners thePartners" data member to act
     31//              as buffer between ::generateInteractionPartners() and
     32//              ::generateParticleFate(), and make "outgoing_cparticles" a
     33//              data member returned from the latter by const-ref.  Replace
     34//              return-by-value of initializeCascad() with an input buffer.
     35// 20100409  M. Kelsey -- Add function to sort list of partnerts by pathlen,
     36//              move non-inlinable code to .cc.
     37// 20100421  M. Kelsey -- Move getFermiKinetic() to .cc, no hardwired masses.
     38// 20100517  M. Kelsey -- Change cross-section tables to static arrays.  Move
     39//              absorptionCrossSection() from SpecialFunc.
     40// 20100520  M. Kelsey -- Add function to separate momentum from nucleon
     41
    2642#ifndef G4NUCLEI_MODEL_HH
    2743#define G4NUCLEI_MODEL_HH
    2844
    29 
    30 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
    3145#include "G4InuclElementaryParticle.hh"
    32 #endif
    3346#include "G4CascadParticle.hh"
    34 #include "G4InuclSpecialFunctions.hh"
    35 #include "G4ElementaryParticleCollider.hh"
    36 
    37 
     47#include <algorithm>
    3848#include <vector>
    3949
    4050class G4InuclNuclei;
    41 
    42 using namespace G4InuclSpecialFunctions;
    43 
    44 typedef std::pair<G4InuclElementaryParticle, G4double> partner;
    45 typedef std::vector<partner> partners;
     51class G4ElementaryParticleCollider;
    4652
    4753class G4NucleiModel {
     
    5056
    5157  G4NucleiModel();
    52 
    53   G4NucleiModel(G4InuclNuclei* nuclei) {
    54     generateModel(nuclei->getA(), nuclei->getZ());
    55   }
     58  G4NucleiModel(G4InuclNuclei* nuclei);
    5659
    5760  void generateModel(G4double a, G4double z);
    58 
    5961
    6062  void reset() {
     
    7678  }
    7779
    78 
    79   G4double getFermiKinetic(G4int ip, G4int izone) const {
    80     G4double ekin = 0.0;
    81 
    82     if(ip < 3 && izone < number_of_zones) {
    83       G4double pf = fermi_momenta[ip - 1][izone];
    84       G4double mass = ip == 1 ? 0.93827 : 0.93957;
    85 
    86       ekin = std::sqrt(pf * pf + mass * mass) - mass;
    87     } 
    88     return ekin;
    89   }
    90 
     80  G4double getFermiKinetic(G4int ip, G4int izone) const;
    9181
    9282  G4double getPotential(G4int ip, G4int izone) const {
     
    9888
    9989
    100   std::vector<G4CascadParticle>
     90  const std::vector<G4CascadParticle>&
    10191  generateParticleFate(G4CascadParticle& cparticle,
    10292                       G4ElementaryParticleCollider* theElementaryParticleCollider);
     
    126116
    127117
    128   std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> >
    129   initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target);
     118  typedef std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > modelLists;
     119
     120  void initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target,
     121                        modelLists& output);
    130122
    131123
     
    139131  G4InuclElementaryParticle generateNucleon(G4int type, G4int zone) const;
    140132
     133  G4LorentzVector generateNucleonMomentum(G4int type, G4int zone) const;
     134
     135  G4double absorptionCrossSection(G4double e, G4int type) const;
     136  G4double totalCrossSection(G4double ke, G4int rtype) const;
     137
    141138private:
    142  
    143139  G4int verboseLevel;
    144 
    145   void initTotalCrossSections();
    146   G4double totalCrossSection(G4double e, G4int rtype) const;
    147140
    148141  G4bool passFermi(const std::vector<G4InuclElementaryParticle>& particles,
     
    155148                                                 G4int zone) const;
    156149
    157   partners generateInteractionPartners(G4CascadParticle& cparticle) const;
     150  typedef std::pair<G4InuclElementaryParticle, G4double> partner;
     151
     152  std::vector<partner> thePartners;             // Buffer for output below
     153  void generateInteractionPartners(G4CascadParticle& cparticle);
     154
     155  // Function for std::sort() to use in organizing partners by path length
     156  static G4bool sortPartners(const partner& p1, const partner& p2) {
     157    return (p2.second > p1.second);
     158  }
    158159
    159160  G4double volNumInt(G4double r1, G4double r2, G4double cu,
     
    164165  G4double getRatio(G4int ip) const;
    165166
     167  std::vector<G4CascadParticle> outgoing_cparticles;    // Return buffer
     168
    166169  std::vector<std::vector<G4double> > nucleon_densities;
    167170
     
    191194
    192195  // Total cross sections
    193 
    194   G4double PPtot[30];
    195   G4double NPtot[30];
    196   G4double pipPtot[30];
    197   G4double pimPtot[30];
    198   G4double pizPtot[30];
    199   G4double kpPtot[30];
    200   G4double kpNtot[30];
    201   G4double kmPtot[30];
    202   G4double kmNtot[30];
    203   G4double lPtot[30];
    204   G4double spPtot[30];
    205   G4double smPtot[30];
    206   G4double xi0Ptot[30];
    207   G4double ximPtot[30];
    208 
     196  static const G4double PPtot[30];
     197  static const G4double NPtot[30];
     198  static const G4double pipPtot[30];
     199  static const G4double pimPtot[30];
     200  static const G4double pizPtot[30];
     201  static const G4double kpPtot[30];
     202  static const G4double kpNtot[30];
     203  static const G4double kmPtot[30];
     204  static const G4double kmNtot[30];
     205  static const G4double lPtot[30];
     206  static const G4double spPtot[30];
     207  static const G4double smPtot[30];
     208  static const G4double xi0Ptot[30];
     209  static const G4double ximPtot[30];
    209210};       
    210211
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4ParticleLargerBeta.hh

    r1197 r1315  
     1#ifndef G4ParticleLargerBeta_h
     2#define G4ParticleLargerBeta_h
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4ParticleLargerBeta.hh,v 1.6 2010/05/15 04:25:17 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4ParticleLargerBeta_h
    27 #define G4ParticleLargerBeta_h
     30// 20100112  M. Kelsey -- Add additional operator() which uses pointers,
     31//              also fix bug which returns wrong result
    2832
    29 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
    3033#include "G4InuclElementaryParticle.hh"
    31 #endif
    3234
    3335class G4ParticleLargerBeta {
    34 
    3536public:
    36  
    3737  G4bool operator() (const G4InuclElementaryParticle& part1,
    3838                     const G4InuclElementaryParticle& part2) {
    39 
    40     return part1.getMomModule()/part1.getEnergy() <=
    41            part2.getMomModule()/part2.getEnergy();
     39    return (part1.getMomModule()/part1.getEnergy() >=
     40            part2.getMomModule()/part2.getEnergy()
     41            );
    4242  }
    4343 
     44  G4bool operator() (const G4InuclElementaryParticle* part1,
     45                     const G4InuclElementaryParticle* part2) {
     46    return (part1 && part2 && operator()(*part1, *part2));
     47  }
    4448};
    4549
    46 #endif
     50#endif  /* G4ParticleLargerBeta_h */
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4ParticleLargerEkin.hh

    r819 r1315  
     1#ifndef G4PARTICLE_LARGER_EKIN_HH
     2#define G4PARTICLE_LARGER_EKIN_HH
    13//
    24// ********************************************************************
     
    2325// * acceptance of all terms of the Geant4 Software license.          *
    2426// ********************************************************************
     27// $Id: G4ParticleLargerEkin.hh,v 1.11 2010/05/15 04:25:17 mkelsey Exp $
     28// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
    2529//
    26 #ifndef G4PARTICLE_LARGER_EKIN_HH
    27 #define G4PARTICLE_LARGER_EKIN_HH
     30// Implements a *reverse* sorting: std::sort expects a less-than operator
     31// which returns true if arg1<arg2.  This function returns true if arg1>=arg2.
     32//
     33// 20091125  M. Kelsey -- Add additional operator() which uses pointers
    2834
    29 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
    3035#include "G4InuclElementaryParticle.hh"
     36
     37#ifdef G4CASCADE_DEBUG_SORT
     38#include "G4ios.hh"
    3139#endif
    3240
    3341class G4ParticleLargerEkin {
    34 
    3542public:
    36  
    3743  G4bool operator() (const G4InuclElementaryParticle& part1,
    3844                     const G4InuclElementaryParticle& part2) {
    39 
    40     return part1.getKineticEnergy() >= part2.getKineticEnergy();
    41     //  return part1.getEnergy() >= part2.getEnergy();
    42     //  return part1.getMomModule() >= part2.getMomModule();
    43   };
     45#ifdef G4CASCADE_DEBUG_SORT
     46    G4cout << "part1 @ " << &part1 << ": ";
     47    part1.printParticle();
     48    G4cout << "part2 @ " << &part2 << ": ";
     49    part2.printParticle();
     50    G4cout << G4endl;
     51#endif
     52    return (part1.getKineticEnergy() >= part2.getKineticEnergy());
     53  }
    4454 
     55  G4bool operator() (const G4InuclElementaryParticle* part1,
     56                     const G4InuclElementaryParticle* part2) {
     57    return (part1 && part2 && operator()(*part1, *part2));
     58  }
    4559};
    4660
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4PreCompoundCascadeInterface.hh

    r819 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundCascadeInterface.hh,v 1.1 2007/05/23 14:37:28 miheikki Exp $
     26// $Id: G4PreCompoundCascadeInterface.hh,v 1.3 2010/05/21 18:07:30 mkelsey Exp $
    2727// Defines an interface to Bertini (BERT) INC with exitons. Evaporation is NOT included
     28//
     29// 20100520 M. Kelsey -- Add missing name string to ctor, follow code changes from
     30//              G4CascadeInterface.
    2831
    2932#ifndef G4PRECOMPOUNDCASCADEINTERFACE_H
     
    4245
    4346public:
    44   G4PreCompoundCascadeInterface();
     47  G4PreCompoundCascadeInterface(const G4String& nam="PreCompound Bertini Cascade");
    4548
    4649  ~G4PreCompoundCascadeInterface(){
     
    5255
    5356private:
    54   G4int operator==(G4PreCompoundCascadeInterface& right) {
     57  G4int operator==(const G4PreCompoundCascadeInterface& right) const {
    5558    return (this == &right);
    5659  }
    5760
    58   G4int operator!=(G4PreCompoundCascadeInterface& right) {
     61  G4int operator!=(const G4PreCompoundCascadeInterface& right) const {
    5962    return (this != &right);
    6063  }
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4PreCompoundInuclCollider.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4PreCompoundInuclCollider.hh,v 1.6 2010/05/21 17:56:34 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100315  M. Kelsey -- Remove "using" directive and unneeded #includes.
     29// 20100413  M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
     30// 20100517  M. Kelsey -- Inherit from common base class, make other colliders
     31//              simple data members
     32
    2633#ifndef G4PRECOMPOUNDINUCL_COLLIDER_HH
    2734#define G4PRECOMPOUNDINUCL_COLLIDER_HH
    2835 
    29 #include "G4Collider.hh"
    30 #include "G4IntraNucleiCascader.hh"
    31 #include "G4NonEquilibriumEvaporator.hh"
    32 #include "G4BigBanger.hh"
    33 #include "G4ElementaryParticleCollider.hh"
    34 #include "G4InteractionCase.hh"
    35 #include "G4InuclNuclei.hh"
    36 #include "G4InuclSpecialFunctions.hh"
    37 #include "G4Analyser.hh"
     36#include "G4VCascadeCollider.hh"
    3837
    39 using namespace G4InuclSpecialFunctions;
     38class G4BigBanger;
     39class G4CollisionOutput;
     40class G4ElementaryParticleCollider;
     41class G4IntraNucleiCascader;
     42class G4InuclParticle;
     43class G4NonEquilibriumEvaporator;
    4044
    41 class G4PreCompoundInuclCollider {
    42 
     45class G4PreCompoundInuclCollider : public G4VCascadeCollider {
    4346public:
    44 
    4547  G4PreCompoundInuclCollider();
    46 
    47   G4PreCompoundInuclCollider(G4ElementaryParticleCollider* ecollider,
    48                   G4IntraNucleiCascader* incascader,
    49                   G4NonEquilibriumEvaporator* noeqevaporator,
    50                   G4BigBanger* bigbanger) {
    51 
    52     setElementaryParticleCollider(ecollider);
    53     setIntraNucleiCascader(incascader,ecollider);
    54     setNonEquilibriumEvaporator(noeqevaporator);
    55     setBigBanger(bigbanger);
    56 
    57   };
    58 
    59   void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) {
    60 
    61     theElementaryParticleCollider = ecollider;   
    62   };
    63 
    64   void setIntraNucleiCascader(G4IntraNucleiCascader* incascader,
    65                               G4ElementaryParticleCollider* ecollider) {
    66 
    67     theIntraNucleiCascader = incascader;
    68     theIntraNucleiCascader->setElementaryParticleCollider(ecollider);
    69   };
    70 
    71   void setNonEquilibriumEvaporator(G4NonEquilibriumEvaporator* noeqevaporator) {
    72 
    73     theNonEquilibriumEvaporator = noeqevaporator;   
    74   };
    75 
    76   void setBigBanger(G4BigBanger* bigbanger) {
    77 
    78     theBigBanger = bigbanger;   
    79   };
     48  virtual ~G4PreCompoundInuclCollider();
    8049 
    81   G4CollisionOutput collide(G4InuclParticle* bullet,
    82                             G4InuclParticle* target);
     50  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
     51               G4CollisionOutput& globalOutput);
    8352
    8453private:
    85   G4int verboseLevel;
    86 
    87   G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
    88                                       G4InuclParticle* target,
    89                                       G4double ekin) const;
    90 
    91   G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,
    92                                        G4InuclParticle* target) const;
    93 
    94   G4bool explosion(G4InuclNuclei* target) const;
    95        
    9654  G4ElementaryParticleCollider* theElementaryParticleCollider;
    9755  G4IntraNucleiCascader* theIntraNucleiCascader;
    9856  G4NonEquilibriumEvaporator* theNonEquilibriumEvaporator;
    9957  G4BigBanger* theBigBanger;
    100 
    10158};       
    10259
    103 #endif // G4PRECOMPOUNDINUCL_COLLIDER_HH
     60#endif /* G4PRECOMPOUNDINUCL_COLLIDER_HH */
    10461
    10562
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4WatcherGun.hh

    r819 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// $Id: G4WatcherGun.hh,v 1.9 2010/04/08 15:48:00 mkelsey Exp $
     26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
    2527//
     28// 20100407  M. Kelsey -- Return const-ref to avoid copy overhead.
     29
    2630#ifndef G4WATCHER_GUN_HH
    2731#define G4WATCHER_GUN_HH
     
    3741  void setWatchers();
    3842
    39   std::vector<G4NuclWatcher> getWatchers() const {
     43  const std::vector<G4NuclWatcher>& getWatchers() const {
    4044    return watchers;
    4145  };
Note: See TracChangeset for help on using the changeset viewer.