Ignore:
Timestamp:
May 28, 2009, 4:26:57 PM (17 years ago)
Author:
garnier
Message:

maj sur la beta de geant 4.9.3

Location:
trunk/source/processes/hadronic/models
Files:
243 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/cascade/History

    r1007 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1715 Apr 2009 Dennis Wright (hadr-casc-V09-02-02)
     18-----------------------------------------------
     19- previous tag no longer used.  Bring hadr-casc-V09-02-00 back to
     20  HEAD and re-tag
     21
     2221 Feb 2009 Dennis Wright (hadr-casc-V09-02-01)
     23-----------------------------------------------
     24- add printCrossSection method to G4CascadSpecialFunctions
     25- in GeElementaryParticleCollider, add high energy flag to distinguish
     26  "string-like" behavior
     27- G4IntraNucleiCascader.cc - allow secondaries from HE interaction to
     28  leave nucleus without interacting
     29- G4NucleiModel - get high_energy_interaction flag value from G4ElementaryParticleCollider
     30
     3111 Feb 2009 V.Ivanchenko (hadr-casc-V09-02-00)
     32-----------------------------------------------
     33- set absorption coefficient 1.0 instead of 0.2 inside
     34  G4CascadSpecialFunctions (D.Wright)
    1635
    173625 Nov 2008 Dennis Wright (hadr-casc-V09-01-10)
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadSpecialFunctions.cc

    r1007 r1055  
    113113  }
    114114
    115   const G4double corr_fac = 0.2;
     115  // was 0.2 since the beginning
     116  const G4double corr_fac = 1.0;
    116117  G4double csec = 0.0;
    117118 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/History

    r962 r1055  
    44       ==========================================================
    55
    6         History file for hadronic/models/chiral_inv_phase_space/interface
     6History file for  hadronic/models/chiral_inv_phase_space/body  directory.
    77       
    8 This file should be used to summarize modifications introduced in the
    9 code and to keep track of all tags.
     8Summarize all code modifications & keep track of all tags in this file.
    109
    11      ---------------------------------------------------------------
    12      * Please list in reverse chronological order (last date on top)
    13      ---------------------------------------------------------------
     10****************************************************************************
     11*** Geant4 developers can not make changes in this directory or make the ***
     12*** History records without permision of M.Kosov: Mikhail.Kossov@cern.ch ***
     13****************************************************************************
    1414
    15 31-Mar-2008 Dennis Wright               (hadr-chips-body-V09-01-04)
    16 -------------------------------------------------------------------
    17 - add more parentheses around && within || to satisfy gcc-4.3 compiler
    18   files affected:
    19     G4QChipolino.cc
    20     G4QEnvironment.cc
    21     G4QNucleus.cc
    22     G4Quasmon.cc
     15     -----------------------------------------------------------------
     16     * Please list in reverse chronological order (last date on top) *
     17     -----------------------------------------------------------------
    2318
    24 19-Mar-2008 Dennis Wright               (hadr-chips-body-V09-01-03)
    25 -------------------------------------------------------------------
    26 - add parentheses around && within || to satisfy gcc-4.3 compiler
    27   files affected:
    28     G4QChipolino.cc
    29     G4QContent.cc
    30     G4QEnvironment.cc
    31     G4QNucleus.cc
    32     G4QPDGCode.cc
    33     G4Quasmon.cc
    3419
    35 - add braces and ; for empty while blocks to satisfy gcc-4.3
    36   files affected:
    37     G4QHadron.cc
     2026-May-2009 M.Kosov                              (hadr-chips-body-V09-02-06)
     21----------------------------------------------------------------------------
     22Safety check of nDelta in the hadronization probability calculations (G4Quasmon)
     23to avoid /zero
    3824
    39 18-Mar-2008 Vladimir Ivanchenko         (hadr-chips-body-V09-01-02)
    40 - G4QNucleus - fixed compillation warnings at Windows for constructors
     2526-May-2009 M.Kosov                              (hadr-chips-body-V09-02-05)
     26----------------------------------------------------------------------------
     27In low energy nHe and pHe reactions, when only elastic scattering is possible,
     28the inelastic application makes a complain, while it is making the elastic
     29scattering (with very low cross-section). *** The complain is closed ***
     30
     3115-May-2009 M.Kosov                              (hadr-chips-body-V09-02-04)
     32----------------------------------------------------------------------------
     33For rare cases of the output hadron mass below the GS mass instead of Exception
     34in the G4QEnvironment class a fill As Is for the hadron is used with appropriate
     35warning. If this case can be reproduced, it should be debugged in future.
     36
     3729-Apr-2009 M.Kosov                              (hadr-chips-body-V09-02-03)
     38----------------------------------------------------------------------------
     39The rare situation was Found by Alberto. It is improved in G4QEnvironment.
     40When the Hypernucleus can not decay in the residual nucleus and pion, then
     41now it is decayed in the residual nucleus and gamma.
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QBesIKJY.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QBesIKJY.hh,v 1.2 2006/06/29 20:05:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QBesIKJY.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QBesIKJY ----------------
     
    3232//  class header for Bessel I0/I1 and K0/K1 functions in CHIPS Model
    3333// --------------------------------------------------------------------
    34 
     34// Short description: CHIPS bessel functions for mass and scattering
     35// integrals.
     36// --------------------------------------------------------------------
    3537#ifndef G4QBesIKJY_h
    3638#define G4QBesIKJY_h 1
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QCHIPSWorld.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QCHIPSWorld.hh,v 1.25 2006/06/29 20:05:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QCHIPSWorld.hh,v 1.26 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCHIPSWorld ----------------
     
    3232//  class header for CHIPS World of particles in CHIPS Model
    3333// ------------------------------------------------------------
     34// Short description: The CHIPS World is a world of elementary particles
     35// and nuclear fragments. This class is a singletone, but without fixed
     36// limits. E.g. the nuclear fragments as possible G4Candidates can be
     37// initialized in the CHIPS World only up to Be8 od C12 or other bigger
     38// nuclear fragment. If one need the heavy fragment production then the
     39// the CHIPS World must be initialized up to these fragments (see the
     40// CHIPS Manual), but the price in performans will be big, because in
     41// each act of the fragmentation competition these numerous candidates
     42// take place in the competition and the hadronization probability is
     43// calculated each time for each of them, so the Be8 limit (Be8->alpha+
     44// alpha decays very fast and contribute to the alpha-spectrum) is the
     45// most optimal.
     46// -------------------------------------------------------------------
    3447
    3548#ifndef G4QCHIPSWorld_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QCandidate.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QCandidate.hh,v 1.28 2006/06/29 20:05:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QCandidate.hh,v 1.29 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidate ----------------
     
    3232//  class header for Quasmon initiated Candidates used by the CHIPS Model
    3333// ----------------------------------------------------------------------
     34// Short description: A candidate for hadronization. The candidates
     35// (hadrons or nuclear fragments) are competative, each quark of a
     36// Quasmon select which candidate to use for hadronization
     37// ------------------------------------------------------------------
    3438
    3539#ifndef G4QCandidate_h
     
    8185  void SetNBMass(G4double newMass);         // Set mass bounded to Total Nucleus
    8286
    83 // Body                                                                    
     87// Body             
    8488private:
    8589  G4bool   possible;                // permission/forbiding preFlag to be a hadron/fragment
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QCandidateVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QCandidateVector.hh,v 1.21 2006/06/29 20:06:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QCandidateVector.hh,v 1.22 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for Quasmon initiated Candidates used by CHIPS model
    3333// -----------------------------------------------------------------
     34// Short description: A candidate for hadronization. The candidates
     35// (hadrons or nuclear fragments) are competative, each quark of a
     36// Quasmon select which candidate to use for hadronization
     37// ------------------------------------------------------------------
    3438
    3539#ifndef G4QCandidateVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QChipolino.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QChipolino.hh,v 1.23 2006/06/29 20:06:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QChipolino.hh,v 1.24 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QChipolino ----------------
     
    3232//  class header for Chipolino (Double Hadron) in CHIPS Model
    3333// ----------------------------------------------------------
     34// Short description: In the CHIPS model not only hadrons are considered,
     35// but the di-hadrons, which can not be convereged to the quark content
     36// of only one hadron (e.g. pi+pi+, K+p, Delta++p etc). This kind of
     37// hadronic states, which can be easily decayed in two hadrons, is called
     38// Chipolino-particle in the model.
     39// ----------------------------------------------------------------------
    3440
    3541#ifndef G4QChipolino_h
     
    5662
    5763  // Selectors
    58   G4double              GetMass();            // Get mass of the Chipolino (MinDoubleHadronMass)
     64  G4double              GetMass();            // Get ChipolinoMass (MinDoubleHadronMass)
    5965  G4double              GetMass2();           // Get mass^2 of the Chipolino
    6066  G4QPDGCode            GetQPDG1();           // Get 1-st QPDG of the Chipolino
     
    6672  // Modifiers
    6773  void SetHadronQPDG(const G4QPDGCode& QPDG); // Set QPDG of 1-st Hadron of the Chipolino
    68   void SetHadronPDGCode(const G4int& PDGCode);// Set PDGCode of 1-st Hadron of the Chipolino
    69   void SetHadronQCont(const G4QContent& QC);  // Set QContent of 1-st Hadron of the Chipolino
     74  void SetHadronPDGCode(const G4int& PDGCode);// Set PDGCode of 1st Hadron of the Chipolino
     75  void SetHadronQCont(const G4QContent& QC);  // Set QContent of 1st Hadron of theChipolino
    7076
    7177private: 
    7278  G4QPDGCode            theQPDG1;             // QPDG of the 1-st Hadron of the Chipolino
    7379  G4QPDGCode            theQPDG2;             // QPDG of the 2-nd Hadron of the Chipolino
    74   G4QContent            theQCont;             // Quark Content of the whole Chipolino
    75   G4QContent            theQCont1;            // Quark Content of the 1-st Hadron of Chipolino
     80  G4QContent            theQCont;             // QuarkContent of the whole Chipolino
     81  G4QContent            theQCont1;            // QuarkCont. of the 1st Hadron of Chipolino
    7682  G4double              minM;                 // Minimal Mass of Chipolino
    7783};
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QContent.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QContent.hh,v 1.28 2006/06/29 20:06:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QContent.hh,v 1.29 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QContent ----------------
     
    3232//  class header for Quasmon initiated Contents used by the CHIPS Model
    3333// ----------------------------------------------------------------------
     34// Short description: This is the basic class of the CHIPS model. It
     35// describes the quark content of the Quasmon, which is a generalized
     36// hadronic state. All Quasmons are bags, characterized by the quark
     37// Content (QContent), but the spin is not fixed and only light (u,d,s)
     38// quarks are considered (SU(3)). The hadrons are the ground states for
     39// the corresponding quasmons. The Chipolino (G4QChipolino) or nuclear
     40// cluster are examples for another Quark Content.
     41// --------------------------------------------------------------------
     42// @@ In future total spin & c,b,t of the Hadron can be added @@ M.K.@@
     43// --------------------------------------------------------------------
    3444
    3545#ifndef G4QContent_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QDecayChan.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QDecayChan.hh,v 1.23 2006/06/29 20:06:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QDecayChan.hh,v 1.24 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QDecayChan ----------------
     
    3232//  class header for Decay Channel definition in CHIPS Model
    3333// ------------------------------------------------------------
     34// Short description: In the CHIPS World the particles (G4QParticle)
     35// are defined. For unstable particles there is a G4QDecayChannelVector
     36// which describes different channels of decay for the particular
     37// particle. So the G4QDecayChannel class is the class for the description
     38// of such a decay channel in two or three particles (the secondaries can
     39// be unstable too and have firther decay).
     40// -------------------------------------------------------------------
    3441
    3542#ifndef G4QDecayChan_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QDecayChanVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QDecayChanVector.hh,v 1.19 2006/06/29 20:06:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QDecayChanVector.hh,v 1.20 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for Decay Channel Vector in CHIPS model
    3333// --------------------------------------------------------------
     34// Short description: In the CHIPS World the particles (G4QParticle)
     35// are defined. For unstable particles there is a G4QDecayChannelVector
     36// which describes different channels of decay for the particular
     37// particle. So the G4QDecayChannel class is the class for the description
     38// of such a decay channel in two or three particles (the secondaries can
     39// be unstable too and have firther decay).
     40// -------------------------------------------------------------------
    3441
    3542#ifndef G4QDecayChanVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QEnvironment.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QEnvironment.hh,v 1.32 2007/10/07 13:31:41 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QEnvironment.hh,v 1.33 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QEnvironment ----------------
     
    3232//      header for Multy Quasmon Environment in the CHIPS Model
    3333// ------------------------------------------------------------
     34// Short description: The G4QEnvironment class corresponds to the nuclear
     35// environment,  containing excited nucleons or nuclear clusters
     36// (G4Quasmons). In the constructer the nucleus (G4QNucleus) is clusterized
     37// and then the projectile hadron (or hadrons) can create one (or a few)
     38// Quasmons, which are fragmented by the Fragment member function. As a
     39// result a vector of G4QHadrons is created, which can include the residual
     40// nucleus in the ground state.
     41//---------------------------------------------------------------------
    3442
    3543#ifndef G4QEnvironment_h
     
    8290  void             EvaporateResidual(G4QHadron* h);// Final Evaporation of a nucl. fragment
    8391  void             DecayBaryon(G4QHadron* dB);     // Decay baryon (gamma+N or Delta->N+Pi)
     92  void             DecayAntistrange(G4QHadron* aS);// Decay Antistrange nucleus
    8493  G4bool           CheckGroundState(G4Quasmon* quasm,G4bool corFlag=false);//as G4Q for QHV
    8594  G4bool           DecayInEnvQ(G4Quasmon* quasm);  // Use befor evaporation in PANIC case
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QException.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QException.hh,v 1.10 2006/06/29 20:06:13 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QException.hh,v 1.11 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QException ----------------
     
    3232//  header of the class for an Exception used by the CHIPS Model
    3333// ---------------------------------------------------------------
     34// Short description: Just an internal CHIPS Exception Messenger
     35// -------------------------------------------------------------
    3436
    3537#ifndef G4QException_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QFragmentation.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QFragmentation.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QFragmentation.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    3838//     G4QGSModels
    3939//     G4ExcitedStringDecay
     40// -----------------------------------------------------------------------------
     41// Short description: CHIPS string fragmentation class
    4042// -----------------------------------------------------------------------------
    4143//
     
    7072  void Init(G4double theZ, G4double theA)
    7173  {
    72            if(!theNucleus) theNucleus = new G4QNucleus(G4int(theZ),G4int(theA-theZ+.0001));
    73            theNucleus->InitByPDG(90000000+G4int(theZ)*1000+G4int(theA-theZ+.0001));
     74    if(!theNucleus) theNucleus = new G4QNucleus(G4int(theZ),G4int(theA-theZ+.0001));
     75    theNucleus->InitByPDG(90000000+G4int(theZ)*1000+G4int(theA-theZ+.0001));
    7476  }
    7577     
     
    116118  static G4double theNucleonRadius;
    117119  // Parameters of diffractional fragmentation
    118          static G4double widthOfPtSquare;         // width^2 of pt for string excitation
    119          static G4double minExtraMass;       // minimum excitation mass
    120          static G4double minmass;                 // mean pion transverse mass; used for Xmin
     120  static G4double widthOfPtSquare;   // width^2 of pt for string excitation
     121  static G4double minExtraMass;      // minimum excitation mass
     122  static G4double minmass;           // mean pion transverse mass; used for Xmin
    121123
    122                 // Body
     124  // Body
    123125  G4QInteractionVector theInteractions;
    124126  G4QHadronVector      theTargets;
     
    134136
    135137#endif
    136 
    137 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QHadron.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QHadron.hh,v 1.36 2008/01/09 09:37:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QHadron.hh,v 1.37 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QHadron ----------------
     
    3232//  class header for Hadrons generated by the CHIPS Model
    3333// ------------------------------------------------------
     34// Short description: In CHIPS all particles are G4QHadrons, while they
     35// can be leptons, gammas or nuclei. The G4QPDGCode makes the difference.
     36// In addition the 4-momentum is a basic value, so the mass can be
     37// different from the GS mass (e.g. for the virtual gamma).
     38// -------------------------------------------------------------------
    3439
    3540#ifndef G4QHadron_h
     
    205210}
    206211#endif
    207 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QHadronBuilder.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QHadronBuilder.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QHadronBuilder.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    3636//     For comparison mirror member functions are taken from G4 class:
    3737//     G4HadronBuilder
     38// -----------------------------------------------------------------------------
     39// Short description: A CHIPS class for the builder of the G4QHadron, which is a
     40// resulting object for the string fragmentation. the G4QHadron has specific
     41// parameters, which are not included in the G4QParticle from the CHIPS World,
     42// but necessary for the string fragmentation. When the G4QHadron is created
     43// (builded), it is converted to the CHIPS particle.
    3844// -----------------------------------------------------------------------------
    3945//
     
    5864  G4QHadron* Meson(G4QParton* black, G4QParton* white, Spin spin);
    5965  G4QHadron* Baryon(G4QParton* black,G4QParton* white, Spin spin);
    60                 // Body
     66  // Body
    6167  G4double mesonSpinMix;
    6268  G4double baryonSpinMix;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QHadronVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QHadronVector.hh,v 1.22 2006/11/16 11:36:09 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QHadronVector.hh,v 1.23 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for a Vector of Hadrons - output of CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: In CHIPS all particles are G4QHadrons, while they
     35// can be leptons, gammas or nuclei. The G4QPDGCode makes the difference.
     36// In addition the 4-momentum is a basic value, so the mass can be
     37// different from the GS mass (e.g. for the virtual gamma). This class
     38// is made for the output list of hadrons.
     39// -------------------------------------------------------------------
    3440
    3541#ifndef G4QHadronVector_h
    3642#define G4QHadronVector_h 1
    3743//
    38 // $Id: G4QHadronVector.hh,v 1.22 2006/11/16 11:36:09 mkossov Exp $
    39 // GEANT4 tag $Name: geant4-09-02 $
     44// $Id: G4QHadronVector.hh,v 1.23 2009/02/23 09:49:24 mkossov Exp $
     45// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    4046//
    4147// ------------------------------------------------------------
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QInteraction.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QInteraction.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QInteraction.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030
     
    4141//   G4InteractionContent
    4242// -------------------------------------------------------------------
     43//  Short description: Classify the interaction in soft/hard/diffractive
     44//  parts for firther treatment by the QGS algorithm.
     45// ---------------------------------------------------------------------
    4346
    4447#include "globals.hh"
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QInteractionVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QInteractionVector.hh,v 1.1 2006/10/30 10:40:34 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QInteractionVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3737
    3838//
    39 // $Id: G4QInteractionVector.hh,v 1.1 2006/10/30 10:40:34 mkossov Exp $
    40 // GEANT4 tag $Name: geant4-09-02 $
     39// $Id: G4QInteractionVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     40// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    4141//
    4242// ------------------------------------------------------------------
     
    4747//   class for a storing colliding particles in PartonString Models
    4848// -------------------------------------------------------------------
     49//  Short description: Classify the interaction in soft/hard/diffractive
     50//  parts for firther treatment by the QGS algorithm.
     51// ---------------------------------------------------------------------
    4952
    5053#include "G4QInteraction.hh"
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QIsotope.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QIsotope.hh,v 1.5 2006/06/29 20:06:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QIsotope.hh,v 1.6 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333//  Header of the G4QIsotope class of the CHIPS Simulation Branch in GEANT4
    3434// ----------------------------------------------------------------------------
    35 //  It contains information about natural abundances of stable and long living
    36 //  isotopes and a NEW "Element" can be initialised for any isotope set.
    37 //  Randomization of isotopes of the Natural Elements is hardwired and fast
    38 //  Randomization of isotopes of the user defined Elements is a bit slower
     35//  Short descriptionIt contains information about natural abundances of stable
     36//  and long living isotopes and a NEW "Element" can be initialised for any
     37//  isotope set. Randomization of isotopes of the Natural Elements is hardwired and
     38//  fast randomization of isotopes of the user defined Elements is a bit slower
    3939//  CrossSectionWeighted randomisation of isotopes is slow (same for Nat and New)
    4040// -------------------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QNucleus.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNucleus.hh,v 1.33 2007/10/31 13:23:07 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNucleus.hh,v 1.34 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QNucleus ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    32 //  class header for Quasmon initiated Candidates used by the CHIPS Model
    33 // ----------------------------------------------------------------------
     32//  class header for the nuclei and nuclear environment of the CHIPS Model
     33// -----------------------------------------------------------------------
     34//  Short description: a class describing properties of nuclei, which
     35//  are necessary for the CHIPS Model.
     36// -----------------------------------------------------------------------
    3437
    3538#ifndef G4QNucleus_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPDGCode.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPDGCode.hh,v 1.26 2006/06/29 20:06:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPDGCode.hh,v 1.27 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QPDGCode ----------------
     
    3232//  class header for Hadron definition in CHIPS Model
    3333// ------------------------------------------------------------
     34// Short description: The PDG Code is made on the basis of the Quark
     35// Content (G4QuarkContent) of the hadronic state (including nuclear
     36// fragments). The PDG code of the ground state (e.g. pi, N, etc.) is
     37// calculated. It includes a complicated algortithm of the G.S. mass
     38// calculation for nuclear fragments (now it is synchronised with the
     39// G4 nuclear massess).
     40// -------------------------------------------------------------------
    3441
    3542#ifndef G4QPDGCode_h
     
    265272
    266273#endif
    267 
    268 
    269 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPDGCodeVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPDGCodeVector.hh,v 1.19 2006/06/29 20:06:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPDGCodeVector.hh,v 1.20 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for Hadron definition in CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: The PDG Code is made on the basis of the Quark
     35// Content (G4QuarkContent) of the hadronic state (including nuclear
     36// fragments). The PDG code of the ground state (e.g. pi, N, etc.) is
     37// calculated. It includes a complicated algortithm of the G.S. mass
     38// calculation for nuclear fragments (now it is synchronised with the
     39// G4 nuclear massess).
     40// -------------------------------------------------------------------
    3441
    3542#ifndef G4QPDGCodeVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPDGToG4Particle.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QPDGToG4Particle.hh,v 1.4 2006/06/29 20:06:27 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QPDGToG4Particle.hh,v 1.5 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QPDGToG4Particle header ----------------
     
    3535// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3636// ****************************************************************************************
     37// Short description: This is a helper class, which converts the PDG-defined
     38// G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones.
     39// -----------------------------------------------------------------------------
    3740
    3841#ifndef G4QPDGToG4Particle_hh
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QParentCluster.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParentCluster.hh,v 1.23 2006/06/29 20:06:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParentCluster.hh,v 1.24 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QParentCluster ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//  class header for a Parent nuclear cluster in the CHIPS Model
    33 // -------------------------------------------------------------
     33// -------------------------------------------------------------------
     34// Short description: The parent cluster is the cluster, which can be
     35// used for the nuclear fragment production. Different clusters csn be
     36// used as the parent cluser for the particular G4QCandidate (nuclear
     37// fragment), e.g. t and He3 for the t-fragment production. So the
     38// G4QParentClusterVector is needed.
     39// -------------------------------------------------------------------
    3440
    3541#ifndef G4QParentCluster_h
     
    5763
    5864  // Selectors
    59   G4int      GetPDGCode()      const;  // Get PDG code of the Parent Cluster
    60   G4double   GetProbability()  const;  // Get a probability of hadronization on it
    61   G4int      GetNQPart2()      const;  // Get n-2 for the fragment
    62   G4QContent GetTransQC()      const;  // Get QuarkCont of a Pseudo Exchange Meson
    63   G4double   GetLow()          const;  // Get a low limit for randomization
    64   G4double   GetHigh()         const;  // Get a high limit for randomization
    65   G4double   GetEBMass()       const;  // Get a Nuclear Bounded mass of the parent cluster
    66   G4double   GetEBind()        const;   // Get Environment Binding energy for the parent cluster
    67   G4double   GetNBMass()       const;   // Get an Environmental bounded mass of the parent cluster
    68   G4double   GetNBind()        const;   // Get Total Nucleus Binding energy for the parent cluster
     65  G4int      GetPDGCode()     const; // Get PDG code of the Parent Cluster
     66  G4double   GetProbability() const; // Get a probability of hadronization on it
     67  G4int      GetNQPart2()     const; // Get n-2 for the fragment
     68  G4QContent GetTransQC()     const; // Get QuarkCont of a Pseudo Exchange Meson
     69  G4double   GetLow()         const; // Get a low limit for randomization
     70  G4double   GetHigh()        const; // Get a high limit for randomization
     71  G4double   GetEBMass()      const; // Get a Nuclear Bounded mass of the parent cluster
     72  G4double   GetEBind()       const; // Get Environment BindingEnergy for the parentCluster
     73  G4double   GetNBMass()      const; // Get Environmental BoundedMass of the parent Cluster
     74  G4double   GetNBind()       const; // Get TotalNucleusBindingEnergy for the parentCluster
    6975
    7076  // Modifiers
    71   void  SetPDGCode(G4int newPDGCode);                // Set PDG code of the Parent Cluster
    72   void  SetProbability(G4double probab);             // Set probab. to hadronize on this cluster
    73   void  SetNQPart2(G4int nm2);                       // Get n-2 for the fragment
    74   void  SetTransQC(G4QContent newTrans);             // Set QuarkCont of a Pseudo Exchange Meson
    75   void  SetLow(G4double loLim);                      // Set a low limit for hadronization
    76   void  SetHigh(G4double hiLim);                     // Set a high limit for hadronization
    77   void  SetEBMass(G4double bMass);                   // Set a bounded mass of the parent cluster in E
    78   void  SetEBind(G4double bEn);                      // Set binding energy of the parent cluster in E
    79   void  SetNBMass(G4double bMass);                   // Set a bounded mass of the parent cluster in N
    80   void  SetNBind(G4double bEn);                      // Set binding energy of the parent cluster in N
     77  void  SetPDGCode(G4int newPDGCode);    // Set PDG code of the Parent Cluster
     78  void  SetProbability(G4double probab); // Set probab. to hadronize on this cluster
     79  void  SetNQPart2(G4int nm2);           // Get n-2 for the fragment
     80  void  SetTransQC(G4QContent newTrans); // Set QuarkCont of a Pseudo Exchange Meson
     81  void  SetLow(G4double loLim);          // Set a low limit for hadronization
     82  void  SetHigh(G4double hiLim);         // Set a high limit for hadronization
     83  void  SetEBMass(G4double bMass);       // Set a bounded mass of the parent cluster in E
     84  void  SetEBind(G4double bEn);          // Set binding energy of the parent cluster in E
     85  void  SetNBMass(G4double bMass);       // Set a bounded mass of the parent cluster in N
     86  void  SetNBind(G4double bEn);          // Set binding energy of the parent cluster in N
    8187
    8288  // General
     
    9197  // Secondary
    9298  G4int               nQPart2;
    93   G4QContent          transQC;                         // Quark Content of pseudo exchange meson
     99  G4QContent          transQC;           // Quark Content of the pseudo exchange meson
    94100  G4double            lowLimit;
    95101  G4double            highLimit;
     
    104110std::ostream&   operator<<(std::ostream& lhs, const G4QParentCluster& rhs);
    105111
    106 inline G4bool G4QParentCluster::operator==(const G4QParentCluster& rhs) const {return this==&rhs;}
    107 inline G4bool G4QParentCluster::operator!=(const G4QParentCluster& rhs) const {return this!=&rhs;}
     112inline G4bool G4QParentCluster::operator==(const G4QParentCluster& rhs) const
     113                                                                       {return this==&rhs;}
     114inline G4bool G4QParentCluster::operator!=(const G4QParentCluster& rhs) const
     115                                                                       {return this!=&rhs;}
    108116 
    109117inline G4int      G4QParentCluster::GetPDGCode()     const {return thePDGCode;}
     
    118126inline G4double   G4QParentCluster::GetNBind()       const {return theNucBindingEnergy;}
    119127
    120 inline void  G4QParentCluster::SetPDGCode(G4int newPDGCode)    {thePDGCode      = newPDGCode;}
    121 inline void  G4QParentCluster::SetProbability(G4double prob)   {theProbability  = prob;}
    122 inline void  G4QParentCluster::SetNQPart2(G4int nm2)           {nQPart2         = nm2;}
    123 inline void  G4QParentCluster::SetTransQC(G4QContent newTrans) {transQC=newTrans;}
    124 inline void  G4QParentCluster::SetHigh(G4double hiLim)         {highLimit       = hiLim;}
    125 inline void  G4QParentCluster::SetLow(G4double loLim)          {lowLimit        = loLim;}
    126 inline void  G4QParentCluster::SetEBMass(G4double bMass)       {theEnvBoundedMass  = bMass;}
    127 inline void  G4QParentCluster::SetNBMass(G4double bMass)       {theNucBoundedMass  = bMass;}
     128inline void  G4QParentCluster::SetPDGCode(G4int newPDGCode)    {thePDGCode   = newPDGCode;}
     129inline void  G4QParentCluster::SetProbability(G4double prob)   {theProbability = prob;}
     130inline void  G4QParentCluster::SetNQPart2(G4int nm2)           {nQPart2        = nm2;}
     131inline void  G4QParentCluster::SetTransQC(G4QContent newTrans) {transQC        = newTrans;}
     132inline void  G4QParentCluster::SetHigh(G4double hiLim)         {highLimit      = hiLim;}
     133inline void  G4QParentCluster::SetLow(G4double loLim)          {lowLimit       = loLim;}
     134inline void  G4QParentCluster::SetEBMass(G4double bMass)       {theEnvBoundedMass = bMass;}
     135inline void  G4QParentCluster::SetNBMass(G4double bMass)       {theNucBoundedMass = bMass;}
    128136inline void  G4QParentCluster::SetEBind(G4double bEn)          {theEnvBindingEnergy= bEn;}
    129137inline void  G4QParentCluster::SetNBind(G4double bEn)          {theNucBindingEnergy= bEn;}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QParentClusterVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParentClusterVector.hh,v 1.18 2006/06/29 20:06:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParentClusterVector.hh,v 1.19 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition of Parent nuclear cluster Vector in CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: The parent cluster is the cluster, which can be
     35// used for the nuclear fragment production. Different clusters csn be
     36// used as the parent cluser for the particular G4QCandidate (nuclear
     37// fragment), e.g. t and He3 for the t-fragment production. So the
     38// G4QParentClusterVector is needed.
     39// -------------------------------------------------------------------
    3440
    3541#ifndef G4QParentClusterVector_h
     
    4349
    4450#endif
    45 
    46 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QParticle.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParticle.hh,v 1.24 2006/06/29 20:06:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParticle.hh,v 1.25 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QParticle ----------------
     
    3232//  class header for Particles in the CHIPS Model
    3333// ---------------------------------------------------
     34// Short description: The G4QParticle is a part of the CHIPS World. It is
     35// characterized by the quark content, spin, mass, width and a vector of
     36// the decay channels (G4QDecayCannelVector).
     37// -----------------------------------------------------------------------
    3438
    3539#ifndef G4QParticle_h
     
    117121    min=aDecay[0]->GetMinMass();
    118122    if(nCh>1) for(G4int j=1; j<nCh; j++)
    119         {
     123    {
    120124      G4double next=aDecay[j]->GetMinMass();
    121125      if(next<min) min=next;
    122         }
     126    }
    123127  }
    124128  G4double w=GetWidth();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QParticleVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParticleVector.hh,v 1.19 2006/06/29 20:06:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParticleVector.hh,v 1.20 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for Decay Channel Vector in CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: The G4QParticle is a part of the CHIPS World. It is
     35// characterized by the quark content, spin, mass, width and a vector of
     36// the decay channels (G4QDecayCannelVector).
     37// -----------------------------------------------------------------------
    3438
    3539#ifndef G4QParticleVector_h
     
    6165  {
    6266    std::for_each(begin(),end(),DeleteQParticle());
    63         clear();
     67    clear();
    6468  }
    6569};
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QParton.hh

    r1007 r1055  
    2828#define G4QParton_h 1
    2929
    30 // $Id: G4QParton.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    31 // GEANT4 tag $Name: geant4-09-02 $
     30// $Id: G4QParton.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     31// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3232//
    3333// ------------------------------------------------------------
     
    4040//   G4Parton
    4141// -----------------------------------------------------------------
     42// Short description: The Quark-Gluon String consists of the partons, which
     43// are quarks and some times gluons.
     44// ------------------------------------------------------------------------
    4245
    4346#include "globals.hh"
     
    5760    // Random Flavor/Colour/Spin definition for default constructor (with .3 s-suppresion)
    5861    PDGencoding=(G4int)(2.3*G4UniformRand())+1; //@@ What about antiquarks? (M.K.)
    59         theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
    60         // random colour (1,2,3)=(R,G,B) for quarks and (-1,-2,-3)=(aR,aG,aB) for anti-quarks
     62    theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
     63    // random colour (1,2,3)=(R,G,B) for quarks and (-1,-2,-3)=(aR,aG,aB) for anti-quarks
    6164    theColour = (G4int)(3*G4UniformRand())+1;
    6265    if(theColour>3) theColour = 3;
     
    6467    theSpinZ = (G4int)(2*G4UniformRand()) - 0.5;
    6568  }
    66                 G4QParton(G4int PDGencoding);                            // Collor/Spin are still random
     69  G4QParton(G4int PDGencoding);                            // Collor/Spin are still random
    6770  G4QParton(const G4QParton &right);
    6871  G4QParton(const G4QParton* right);
     
    7376  // Operators
    7477  const G4QParton& operator=(const G4QParton &right);
    75   G4int operator==(const G4QParton &right) const      {return this==&right;}   
    76   G4int operator!=(const G4QParton &right) const      {return this!=&right;}   
     78  G4int operator==(const G4QParton &right) const      {return this==&right;} 
     79  G4int operator!=(const G4QParton &right) const      {return this!=&right;} 
    7780
    7881  // Modifiers
     
    97100  G4String GetParticleSubType()               {return theDefinition->GetParticleSubType();}
    98101 private:
    99                 // Body
     102  // Body
    100103  G4int                 PDGencoding;
    101104  G4ParticleDefinition* theDefinition;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPartonPair.hh

    r1007 r1055  
    2727#define G4QPartonPair_h 1
    2828//
    29 // $Id: G4QPartonPair.hh,v 1.1 2006/10/30 10:40:34 mkossov Exp $
    30 // GEANT4 tag $Name: geant4-09-02 $
     29// $Id: G4QPartonPair.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     30// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3131//
    3232// ------------------------------------------------------------
     
    3737// class for PartonPair (hadron) used by Parton String Models
    3838// ------------------------------------------------------------
     39// Short description: Each Quasmon String has a pair of partons
     40// (quark/diquark-partons) on its ends. During the hadronization
     41// procedure the rapidity gap between partons shrinks, but the
     42// parton pair still exists, while it is converted to the final
     43// meson (quaek-antiquark) or baryon (quark-diquark).
     44// --------------------------------------------------------------
    3945//
    4046#include "globals.hh"
     
    5359  G4int operator==(const G4QPartonPair &right) const
    5460  {
    55     return (CollisionType == right.CollisionType && *Parton1 == *right.Parton1 &&
    56                                                     *Parton2 == *right.Parton2) ? 1: 0;
     61    return (CollisionType == right.CollisionType &&
     62            *Parton1 == *right.Parton1 && *Parton2 == *right.Parton2) ? 1: 0;
    5763  }
    5864  G4int operator!=(const G4QPartonPair &right) const
    5965  {
    60     return (CollisionType == right.CollisionType && *Parton1 == *right.Parton1 &&
    61                                                     *Parton2 == *right.Parton2) ? 0: 1;
     66    return (CollisionType == right.CollisionType &&
     67            *Parton1 == *right.Parton1 && *Parton2 == *right.Parton2) ? 0: 1;
    6268  }
    6369  // Modifiers
     
    6571  void  SetCollisionType(G4int Type)             {CollisionType = Type;}
    6672  // Selectors
    67   G4int GetCollisionType()                       {return CollisionType;}
     73  G4int      GetCollisionType()                  {return CollisionType;}
    6874  G4QParton* GetParton1()                        {return Parton1;}
    6975  G4QParton* GetParton2()                        {return Parton2;}
     
    7480  G4QParton* Parton1; 
    7581  G4QParton* Parton2; 
    76   G4int     CollisionType;
    77   G4int     Direction;
     82  G4int      CollisionType;
     83  G4int      Direction;
    7884};
    7985
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPartonPairVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPartonPairVector.hh,v 1.1 2006/11/16 11:36:09 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPartonPairVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for a Vector of PartonPairs of CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: Each Quasmon String has a pair of partons
     35// (quark/diquark-partons) on its ends. During the hadronization
     36// procedure the rapidity gap between partons shrinks, but the
     37// parton pair still exists, while it is converted to the final
     38// meson (quaek-antiquark) or baryon (quark-diquark).
     39// --------------------------------------------------------------
    3440
    3541#ifndef G4QPartonPairVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPartonVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPartonVector.hh,v 1.1 2006/10/30 10:40:34 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPartonVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidateVector ----------------
     
    3232// Type defenition for a Vector of Partons - output of CHIPS model
    3333// ---------------------------------------------------------------
     34// Short description: The Quark-Gluon String consists of the partons, which
     35// are quarks and some times gluons.
     36// ------------------------------------------------------------------------
    3437
    3538#ifndef G4QPartonVector_h
    3639#define G4QPartonVector_h 1
    3740//
    38 // $Id: G4QPartonVector.hh,v 1.1 2006/10/30 10:40:34 mkossov Exp $
    39 // GEANT4 tag $Name: geant4-09-02 $
     41// $Id: G4QPartonVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     42// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    4043//
    4144// ------------------------------------------------------------
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QPomeron.hh

    r1007 r1055  
    2727#define G4QPomeron_h 1
    2828//
    29 // $Id: G4QPomeron.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    30 // GEANT4 tag $Name: geant4-09-02 $
     29// $Id: G4QPomeron.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     30// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3131//
    3232// ------------------------------------------------------------
     
    3939//   G4PomeronCrossSection
    4040// ------------------------------------------------------------
     41// Short description: Pomeron is one of the possible vacuum pole (the
     42// second is Oderon, but they are identical in the present model), by
     43// which particle exchang in the ellastic scattering process. Strings,
     44// which appear as a cut of the Pomeron (optic theorem connects the
     45// amplitude of scattering at zero angle with the total inelastic
     46// cross-section), describe most of the processes at high energies.
     47// ------------------------------------------------------------------
    4148
    4249#include "globals.hh"
     
    6471  G4double GetTotalProbability(const G4double s, const G4double imp2)
    6572        {return 2*(1-std::exp(-Eikonal(s,imp2)))/pomeron_C*(1-std::exp(-Eikonal(s,imp2)));}
    66   G4double GetDiffractiveProbability(const G4double s,  const G4double imp2)
     73  G4double GetDiffractiveProbability(const G4double s, const G4double imp2)
    6774                  {return (pomeron_C-1.)/pomeron_C*(GetTotalProbability(s,imp2) -
    6875                                                    GetNondiffractiveProbability(s,imp2));}
    69   G4double GetNondiffractiveProbability(const G4double s,       const G4double imp2)
     76  G4double GetNondiffractiveProbability(const G4double s, const G4double imp2)
    7077                                      {return (1.-std::exp(-2*Eikonal(s,imp2)))/pomeron_C;}
    7178  G4double GetElasticProbability(const G4double s, const G4double imp2)
     
    94101  void InitForKaon();
    95102  void InitForGamma();
    96        
     103 
    97104  G4double Expand(G4double z);
    98105  G4double Z(const G4double Scms)    {return 2*pomeron_C*Power(s)/Lambda(Scms);}
    99106  G4double SigP(const G4double Scms) {return 8*pi*hbarc_squared*Power(Scms);}
    100107  G4double Power(const G4double Scms)
    101                         {return pomeron_Gamma*std::pow(Scms/pomeron_S,pomeron_Alpha-1);}
     108                           {return pomeron_Gamma*std::pow(Scms/pomeron_S,pomeron_Alpha-1);}
    102109  G4double Lambda(const G4double s)
    103110                         {return pomeron_Rsquare+pomeron_Alphaprime*std::log(s/pomeron_S);}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QSplitter.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QSplitter.hh,v 1.2 2006/06/29 20:06:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QSplitter.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QSplitter ----------------
     
    3232// header for Hadron-Hadron Splitter in parton pairs of the CHIPS Model
    3333// --------------------------------------------------------------------
     34// Short description: the hadron befor the interaction must be splitted
     35// in partons: quark-antiquark (mesons) or quark-diquark (baryon) parts
     36// (some time in more than two parts, e.g. baryon in three quarks or a
     37// few quark-antiquark pairs can be added for the splitting). Then each
     38// projectile parton can create a parton pair (G4QPartonPair) with the
     39// target parton. This pair with the big rapidity difference on the ends
     40// creates a planar Quark-Gluon String (a pole). A pair of the projectile
     41// partons with a pair of the target partons can create a cylindrical
     42// string (doubled string in the algorithm - a cut). 
     43// -------------------------------------------------===------------------
    3444
    3545#ifndef G4QSplitter_h
     
    4757  // projectile Hadron (probably as a part of proj Nucleus) colliding with nuclear Cluster
    4858  G4QSplitter(G4QHadron projHadron, const G4bool projEnvFlag, const G4int targPDG,
    49                                                                                                                 const G4bool targEnvFlag);   // Cluster can have target nuclear environment
     59              const G4bool targEnvFlag);   // Cluster can have target nuclear environment
    5060  // projectile Cluster (probably as a part of proj Nucleus) colliding with nuclear target
    5161  //G4QSplitter(G4QNucleus projCluster, const G4bool projEnvFlag, const G4int targPDG);
    5262  // projectile Cluster (probably as a part of proj Nucleus) colliding with nuclear Cluster
    5363  //G4QSplitter(G4QNucleus projCluster, const G4bool projEnvFlag, const G4int targPDG,
    54                 //                                                                                              const G4bool targEnvFlag);   // Cluster can have target nuclear environment
     64  //            const G4bool targEnvFlag);   // Cluster can have target nuclear environment
    5565  G4QSplitter(const G4QSplitter& right);   // Copy the splitted system by value
    5666  G4QSplitter(G4QSplitter* right);         // Copy the splitted system by pointer
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QString.hh

    r1007 r1055  
    2626//
    2727//
    28 // $Id: G4QString.hh,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
     28// $Id: G4QString.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3030
    3131#ifndef G4QString_h
     
    4343//
    4444// ------------------------------------------------------------
     45// Short description: If partons from the G4QPartonPair are close in
     46// rapidity, they create Quasmons, but if they are far in the rapidity
     47// space, they can not interact directly. Say the bottom parton (quark)
     48// has rapidity 0, and the top parton (antiquark) has rapidity 8, then
     49// the top quark splits in two by radiating gluon, and each part has
     50// rapidity 4, then the gluon splits in quark-antiquark pair (rapidity
     51// 2 each), and then the quark gadiates anothe gluon and reachs rapidity
     52// 1. Now it can interact with the bottom antiquark, creating a Quasmon
     53// or a hadron. The intermediate partons is the string ladder.
     54// ---------------------------------------------------------------------
    4555
    4656#include "G4ios.hh"
     
    5969 public:
    6070
    61                 enum {PROJECTILE  = 1, TARGET  = -1}; // The same as in quark-pair (@@ ? M.K.)
     71  enum {PROJECTILE  = 1, TARGET  = -1}; // The same as in quark-pair (@@ ? M.K.)
    6272
    6373  G4QString(); // formal creation of the string with future excitation
     
    154164  static G4double SmoothParam;       // QGS model parameter
    155165  static G4double StrangeSuppress;   // Strangeness suppression parameter
    156          static G4double widthOfPtSquare;         // width^2 of pt for string excitation
     166  static G4double widthOfPtSquare;   // width^2 of pt for string excitation
    157167  static G4int StringLoopInterrupt;  // String fragmentation LOOP limit
    158168  static G4int ClusterLoopInterrupt; // Cluster fragmentation LOOP limit
    159169
    160170  // Body
    161   G4int         theDirection;  // must be 1 or -1 (PROJECTILE or TARGET)
    162   G4ThreeVector thePosition;   // Defined by the first quark position
    163   G4QPartonVector thePartons;  // would like initial capacity for 3 Partons (? M.K.)
    164   G4QHadronBuilder* hadronizer;// Hadronizer of hodrons out of partons
    165   G4ThreeVector Ptleft,Ptright;// Pt (px,py) for partons (pz ignored!)
    166   G4double Pplus, Pminus;      // p-, p+ of string, Plus is assigned to Left!
    167   G4QParton* theStableParton;  // Parton on the stable side of the string
    168   G4QParton* theDecayParton;   // Parton on the decaying part of the string
    169   enum DecaySide {None, Left, Right}; // @@ To have two         @@ Leav   :  1=Left
    170   DecaySide decaying;                 // @@   it's too much     @@  only  :  0=Unknown
    171   G4int     SideOfDecay;              // @@     of a good thing @@   one! : -1=Right
     171  G4int         theDirection;        // must be 1 or -1 (PROJECTILE or TARGET)
     172  G4ThreeVector thePosition;         // Defined by the first quark position
     173  G4QPartonVector thePartons;        // would like initial capacity for 3 Partons (? M.K.)
     174  G4QHadronBuilder* hadronizer;      // Hadronizer of hodrons out of partons
     175  G4ThreeVector Ptleft,Ptright;      // Pt (px,py) for partons (pz ignored!)
     176  G4double Pplus, Pminus;            // p-, p+ of string, Plus is assigned to Left!
     177  G4QParton* theStableParton;        // Parton on the stable side of the string
     178  G4QParton* theDecayParton;         // Parton on the decaying part of the string
     179  enum DecaySide {None, Left, Right};// @@ To have two         @@ Leav   :  1=Left
     180  DecaySide decaying;                // @@   it's too much     @@  only  :  0=Unknown
     181  G4int     SideOfDecay;             // @@     of a good thing @@   one! : -1=Right
    172182};
    173183
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QStringVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QStringVector.hh,v 1.1 2006/10/30 10:40:35 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QStringVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QStringVector ----------------
     
    3232// Type definition for a Vector of QStrings - output of CHIPS model
    3333// ----------------------------------------------------------------
     34// Short description: If partons from the G4QPartonPair are close in
     35// rapidity, they create Quasmons, but if they are far in the rapidity
     36// space, they can not interact directly. Say the bottom parton (quark)
     37// has rapidity 0, and the top parton (antiquark) has rapidity 8, then
     38// the top quark splits in two by radiating gluon, and each part has
     39// rapidity 4, then the gluon splits in quark-antiquark pair (rapidity
     40// 2 each), and then the quark gadiates anothe gluon and reachs rapidity
     41// 1. Now it can interact with the bottom antiquark, creating a Quasmon
     42// or a hadron. The intermediate partons is the string ladder.
     43// ---------------------------------------------------------------------
    3444
    3545#ifndef G4QStringVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4Quasmon.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4Quasmon.hh,v 1.39 2007/08/09 13:07:47 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4Quasmon.hh,v 1.41 2009/03/23 14:14:35 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4Quasmon ----------------
     
    3232//      class for a Quasmon used by the CHIPS Model
    3333// ------------------------------------------------------------
     34// Short description: If partons from the G4QPartonPair are close in
     35// rapidity, they create Quasmons, but if they are far in the rapidity
     36// space, they can not interact directly. Say the bottom parton (quark)
     37// has rapidity 0, and the top parton (antiquark) has rapidity 8, then
     38// the top quark splits in two by radiating gluon, and each part has
     39// rapidity 4, then the gluon splits in quark-antiquark pair (rapidity
     40// 2 each), and then the quark gadiates anothe gluon and reachs rapidity
     41// 1. Now it can interact with the bottom antiquark, creating a Quasmon
     42// or a hadron. The intermediate partons is the string ladder.
     43// ---------------------------------------------------------------------
    3444
    3545#ifndef G4Quasmon_h
     
    92102  void              InitQuasmon(const G4QContent& qQCont, const G4LorentzVector& q4M);
    93103  void              IncreaseBy(const G4Quasmon* pQuasm); // as operator+= but by pointer
     104  void              IncreaseBy(G4QContent& qQCont, const G4LorentzVector& q4M);
    94105  void              ClearQuasmon();                   // Clear Quasmon (status=0)
    95106  void              KillQuasmon();                    // Kill Quasmon (status=0)
     
    170181  status= 3;
    171182}
     183inline void G4Quasmon::IncreaseBy(G4QContent& qQCont, const G4LorentzVector& q4M)
     184{
     185  valQ  += qQCont;
     186  q4Mom += q4M;
     187  status= 3;
     188}
    172189
    173190inline void G4Quasmon::InitQuasmon(const G4QContent& qQCont, const G4LorentzVector& q4M)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QuasmonString.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QuasmonString.hh,v 1.4 2006/06/29 20:06:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QuasmonString.hh,v 1.5 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QuasmonString ----------------
    3131//             by Mikhail Kossov, October 2004.
    3232//      header for Hadron-Hadron String Interaction in the CHIPS Model
     33// -------------------------------------------------------------------
     34// Short description: The Quark-Gluon String can fragment in hadrons
     35// (QGS), small hadronic clusters (HERWIG) or in unlimited in mass
     36// Quasmons, defined by the G4QPartonPair. This class is made to
     37// simulate the string fragmentation in Quasmons, which hadronize in
     38// vacuuum or in nuclear environment.
    3339// -------------------------------------------------------------------
    3440
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QuasmonVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QuasmonVector.hh,v 1.19 2006/06/29 20:06:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QuasmonVector.hh,v 1.20 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QuasmonVector ----------------
     
    3232// Type definition for a Vector of Quasmons - output of CHIPS model
    3333// ----------------------------------------------------------------
     34// Short description: If partons from the G4QPartonPair are close in
     35// rapidity, they create Quasmons, but if they are far in the rapidity
     36// space, they can not interact directly. Say the bottom parton (quark)
     37// has rapidity 0, and the top parton (antiquark) has rapidity 8, then
     38// the top quark splits in two by radiating gluon, and each part has
     39// rapidity 4, then the gluon splits in quark-antiquark pair (rapidity
     40// 2 each), and then the quark gadiates anothe gluon and reachs rapidity
     41// 1. Now it can interact with the bottom antiquark, creating a Quasmon
     42// or a hadron. The intermediate partons is the string ladder.
     43// ---------------------------------------------------------------------
    3444
    3545#ifndef G4QuasmonVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QBesIKJY.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QBesIKJY.cc,v 1.2 2006/06/29 20:06:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QBesIKJY.cc,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QBesIKJY ----------------
     
    3232//      class  for Bessel I0/I1 and K0/K1 functions in CHIPS Model
    3333// -------------------------------------------------------------------
    34 
     34// Short description: Bessel functions class (can be substituted)
     35// -------------------------------------------------------------------
    3536//#define debug
    3637//#define pdebug
     
    4344  ex=false;
    4445  switch (type)
    45                 {
    46                   case BessI0:
     46  {
     47    case BessI0:
    4748      nu=0;
    4849      ik=true;
    4950      ij=true;
    50                                                 break;
    51                   case BessI1:
     51      break;
     52    case BessI1:
    5253      nu=1;
    5354      ik=true;
    5455      ij=true;
    55                                                 break;
    56                   case EBessI0:
     56      break;
     57    case EBessI0:
    5758      nu=0;
    5859      ex=true;
    5960      ik=true;
    6061      ij=true;
    61                                                 break;
    62                   case EBessI1:
     62      break;
     63    case EBessI1:
    6364      nu=1;
    6465      ex=true;
    6566      ik=true;
    6667      ij=true;
    67                                                 break;
    68                   case BessJ0:
     68      break;
     69    case BessJ0:
    6970      nu=0;
    7071      ik=true;
    7172      ij=false;
    72                                                 break;
    73                   case BessJ1:
     73      break;
     74    case BessJ1:
    7475      nu=1;
    7576      ik=true;
    7677      ij=false;
    77                                                 break;
    78                   case BessK0:
     78      break;
     79    case BessK0:
    7980      nu=0;
    8081      ik=false;
    8182      ij=true;
    82                                                 break;
    83                   case BessK1:
     83      break;
     84    case BessK1:
    8485      nu=1;
    8586      ik=false;
    8687      ij=true;
    87                                                 break;
    88                   case EBessK0:
     88      break;
     89    case EBessK0:
    8990      nu=0;
    9091      ex=true;
    9192      ik=false;
    9293      ij=true;
    93                                                 break;
    94                   case EBessK1:
     94      break;
     95    case EBessK1:
    9596      nu=1;
    9697      ex=true;
    9798      ik=false;
    9899      ij=true;
    99                                                 break;
    100                   case BessY0:
     100      break;
     101    case BessY0:
    101102      nu=0;
    102103      ik=false;
    103104      ij=false;
    104                                                 break;
    105                   case BessY1:
     105      break;
     106    case BessY1:
    106107      nu=1;
    107108      ik=false;
    108109      ij=false;
    109                                                 break;
     110      break;
    110111  }
    111112}
     
    126127  static const G4double EPS = 1.E-15;
    127128  static const G4double Z1  = 1.;
    128                 static const G4double HF  = Z1/2;
    129                 static const G4double R8  = HF/4;
    130                 static const G4double R32 = R8/4;
     129  static const G4double HF  = Z1/2;
     130  static const G4double R8  = HF/4;
     131  static const G4double R32 = R8/4;
    131132  static const G4double PI  = 3.14159265358979324;
    132133  static const G4double CE  = 0.57721566490153286;
     
    139140  static const G4double CI0[npi]={+1.00829205458740032E0,
    140141             +.00845122624920943E0,+.00012700630777567E0,+.00007247591099959E0,
    141                                                        +.00000513587726878E0,+.00000056816965808E0,+.00000008513091223E0,
    142                                                        +.00000001238425364E0,+.00000000029801672E0,-.00000000078956698E0,
    143                                                        -.00000000033127128E0,-.00000000004497339E0,+.00000000001799790E0,
    144                                                        +.00000000000965748E0,+.00000000000038604E0,-.00000000000104039E0,
    145                                                        -.00000000000023950E0,+.00000000000009554E0,+.00000000000004443E0,
    146                                                        -.00000000000000859E0,-.00000000000000709E0,+.00000000000000087E0,
    147                                                               +.00000000000000112E0,-.00000000000000012E0,-.00000000000000018E0};
     142             +.00000513587726878E0,+.00000056816965808E0,+.00000008513091223E0,
     143             +.00000001238425364E0,+.00000000029801672E0,-.00000000078956698E0,
     144             -.00000000033127128E0,-.00000000004497339E0,+.00000000001799790E0,
     145             +.00000000000965748E0,+.00000000000038604E0,-.00000000000104039E0,
     146             -.00000000000023950E0,+.00000000000009554E0,+.00000000000004443E0,
     147             -.00000000000000859E0,-.00000000000000709E0,+.00000000000000087E0,
     148             +.00000000000000112E0,-.00000000000000012E0,-.00000000000000018E0};
    148149
    149150  static const G4double CI1[npi]={+.975800602326285926E0,
     
    215216
    216217  static const G4double EE[npk]={-.040172946544414076E0,-.444447147630558063E0,
    217                                       -.022719244428417736E0,+.206644541017490520E0,-.086671697056948524E0,
    218                                       +.017636703003163134E0,-.002235619294485095E0,+.000197062302701541E0,
    219                                       -.000012885853299241E0,+.000000652847952359E0,-.000000026450737175E0,
    220                                       +.000000000878030117E0,-.000000000024343279E0,+.000000000000572612E0,
    221                                       -.000000000000011578E0,+.000000000000000203E0,-.000000000000000003E0};
     218          -.022719244428417736E0,+.206644541017490520E0,-.086671697056948524E0,
     219          +.017636703003163134E0,-.002235619294485095E0,+.000197062302701541E0,
     220          -.000012885853299241E0,+.000000652847952359E0,-.000000026450737175E0,
     221          +.000000000878030117E0,-.000000000024343279E0,+.000000000000572612E0,
     222          -.000000000000011578E0,+.000000000000000203E0,-.000000000000000003E0};
    222223
    223224  static const G4complex CF[npj]={
     
    244245  // -------------------------------------------------------------------------------------
    245246  G4double H=0.;                     // Prototype of the result
    246                 if (ij)                            // I/K Bessel functions
     247  if (ij)                            // I/K Bessel functions
    247248  {
    248249    if (ik)                          // I0/I1/EI0/EI1 Bessel functions (symmetric)
     
    263264        G4double A1=1.+DY/(XLI*V3);
    264265        G4double A2=1.+Y*(4.+(DY+Y)/(XLD*XL))/(W1*V3);
    265                                     G4double B0=1.;
    266                                     G4double    B1=1.-Y/XLI;
     266        G4double B0=1.;
     267        G4double B1=1.-Y/XLI;
    267268        G4double B2=1.-Y*(1.-Y/(XLD+XLD))/W1;
    268269        G4int    V1=3-XL;
    269270        G4double V2=V3+V3;
    270271        G4double C=0.;
    271                                     for (G4int N=3; N<=30; N++)
     272        for (G4int N=3; N<=30; N++)
    272273        {
    273274          G4double C0=C;
     
    279280          G4int    W5=W4-1;
    280281          G4int    W6=W5-1;
    281                                                              V1=V1+1;
     282                   V1=V1+1;
    282283                   V2=V2+1;
    283284                   V3=V3+1;
    284                                                     G4double U1=FN*W4;
     285          G4double U1=FN*W4;
    285286          G4double E=V3/(U1*W3);
    286                                                     G4double U2=E*Y;
     287          G4double U2=E*Y;
    287288          G4double F1=1.+Y*V1/(U1*W1);
    288289          G4double F2=(1.+Y*V2/(V3*W2*W5))*U2;
     
    290291          G4double A=F1*A2+F2*A1+F3*A0;
    291292          G4double B=F1*B2+F2*B1+F3*B0;
    292                                                              C=A/B;
    293                                                     if (std::abs(C0-C) < EPS*std::abs(C)) break;
    294                                                     A0=A1; A1=A2; A2=A; B0=B1; B1=B2; B2=B;
     293                   C=A/B;
     294          if (std::abs(C0-C) < EPS*std::abs(C)) break;
     295          A0=A1; A1=A2; A2=A; B0=B1; B1=B2; B2=B;
    295296        }
    296297        H=C;
     
    301302      {
    302303        G4double P=16./V-1.;
    303                                     G4double ALFA=P+P;
    304                                     G4double B1=0.;
     304        G4double ALFA=P+P;
     305        G4double B1=0.;
    305306        G4double B2=0.;
    306                                                   for (G4int I=npil; I>=0; I--)
     307        for (G4int I=npil; I>=0; I--)
    307308        {
    308309          if (!nu) CJ=CI0[I];
    309310          else     CJ=CI1[I];
    310                                                     G4double B0=CJ+ALFA*B1-B2;
    311                                                              B2=B1;
    312                                                              B1=B0;
    313         }
    314                                     H=std::sqrt(RPI2/V)*(B1-P*B2);
    315                                     if (nu && X < 0.) H=-H;
    316                                     if (!ex) H*=std::exp(V);
    317                                   }
     311          G4double B0=CJ+ALFA*B1-B2;
     312                   B2=B1;
     313                   B1=B0;
     314        }
     315        H=std::sqrt(RPI2/V)*(B1-P*B2);
     316        if (nu && X < 0.) H=-H;
     317        if (!ex) H*=std::exp(V);
     318      }
    318319    }
    319320    else                             // K0/K1/EK0/EK1 Bessel functions
    320                   {
     321    {
    321322#ifdef debug
    322323      G4cout<<"G4BesIKJY: >>>>>>>>>>>>>> K is called, X="<<X<<",n="<<nu<<",E="<<ex<<G4endl;
     
    339340        G4double Q=HF;
    340341        G4double C=1.;
    341                                                   G4double D=B*B;
     342        G4double D=B*B;
    342343        G4double BK1=P;
    343344        for (G4int N=1; N<=nat1; N++)  // @@ "nat" can be increased
     
    349350                   C*=D/FN;
    350351          G4double G=C*(P-FN*F);
    351                         G4double R=C*F;
     352          G4double R=C*F;
    352353                   BK=BK+R;
    353354                   BK1=BK1+G;
    354                                                                   if (BK1*R+std::abs(G)*BK < EPS*BK*BK1) break;
     355          if (BK1*R+std::abs(G)*BK < EPS*BK*BK1) break;
    355356        }
    356357        if (nu==1) H=BK1/B;
     
    358359        if (ex) H*=std::exp(X);
    359360      }
    360                                   else if (X < 5.)
     361      else if (X < 5.)
    361362      {
    362363#ifdef debug
     
    368369        G4double XN=DNUS+DNUS;
    369370        G4double A=9.-XN;
    370                                                   G4double B=25.-XN;
     371        G4double B=25.-XN;
    371372        G4double C=768*X*X;
    372                                                   G4double HX=16*X;
    373                                                   G4double C0=HX+HX+HX;;
     373        G4double HX=16*X;
     374        G4double C0=HX+HX+HX;;
    374375        G4double A0=1.;
    375376        G4double A1=(HX+7.+XN)/A;
     
    378379        G4double B1=(HX+9.-XN)/A;
    379380        G4double B2=(C+C0*B)/(A*B)+1.;
    380                                                            C=0.;
    381                                                   for (G4int N=3; N<=nat2; N++)
     381                 C=0.;
     382        for (G4int N=3; N<=nat2; N++)
    382383        {
    383384          C0=C;
     
    389390          G4double FN3=FN1/(FN2-3.);
    390391          G4double FN4=12*FN*FN-(1.-XN);
    391                                                                   G4double FN5=16*FN1*X;
     392          G4double FN5=16*FN1*X;
    392393          G4double RAN=1./(FNP*FNP-XN);
    393                                                                   G4double F1=FN3*(FN4-20*FN)+FN5;
     394          G4double F1=FN3*(FN4-20*FN)+FN5;
    394395          G4double F2=28*FN-FN4-8.+FN5;
    395396          G4double F3=FN3*(FNM*FNM-XN);
    396                                                                                         A=(F1*A2+F2*A1+F3*A0)*RAN;
     397                   A=(F1*A2+F2*A1+F3*A0)*RAN;
    397398                   B=(F1*B2+F2*B1+F3*B0)*RAN;
    398399                   C=A/B;
    399                                                     if (std::abs(C0-C) < EPS*std::abs(C)) break;
    400                                                                   A0=A1;        A1=A2;  A2=A;   B0=B1;  B1=B2;  B2=B;
    401         }
    402                                                   H=C/std::sqrt(RPIH*X);
     400          if (std::abs(C0-C) < EPS*std::abs(C)) break;
     401          A0=A1; A1=A2; A2=A; B0=B1; B1=B2; B2=B;
     402        }
     403        H=C/std::sqrt(RPIH*X);
    403404        if (!ex) H*=std::exp(-X);
    404                                   }
     405      }
    405406      else
    406407      {
     
    410411        G4double P=10./X-1.;
    411412        G4double ALFA=P+P;
    412                                                         G4double B1=0.;
    413                                                         G4double B2=0.;
     413        G4double B1=0.;
     414        G4double B2=0.;
    414415#ifdef debug
    415416        G4cout<<"G4BesIKJY: >>> [ X >= 5 ] is called, X="<<X<<",n="<<nu<<",E="<<ex<<G4endl;
    416417#endif
    417                                                   for (G4int I=npkl; I>=0; I--)
     418        for (G4int I=npkl; I>=0; I--)
    418419        {
    419420          if (!nu) CK=CK0[I];
     
    422423                   B2=B1;
    423424                   B1=B0;
    424                                                   }
     425        }
    425426        H=std::sqrt(PIH/X)*(B1-P*B2);
    426427        if (!ex) H*=std::exp(-X);
    427428      }
    428                   }
     429    }
    429430  }
    430431  else
    431                 {
     432  {
    432433    if (!ik && X < 0.)
    433434    {
     
    455456          B1=0.;
    456457          B2=0.;
    457                                                                                 for (G4int JT=npkl; JT>=0; JT--)
     458          for (G4int JT=npkl; JT>=0; JT--)
    458459          {
    459460            G4double B0=CB[JT]+ALFA*B1-B2;
     
    463464          H=RPIH*(CE+std::log(HF*X))*H+B1-P*B2;
    464465        }
    465                                                 }
     466      }
    466467      else
    467                                                 {
    468                                                                 G4double P=10./V-1.;
    469                                                                 G4double ALFA=P+P;
    470                                                                 G4complex CB1(0.,0.);
    471                                                                 G4complex CB2(0.,0.);
    472                                                         for (G4int IT=npjl; IT>=0; IT--)
     468      {
     469        G4double P=10./V-1.;
     470        G4double ALFA=P+P;
     471        G4complex CB1(0.,0.);
     472        G4complex CB2(0.,0.);
     473        for (G4int IT=npjl; IT>=0; IT--)
    473474        {
    474475          G4complex CB0=CC[IT]+ALFA*CB1-CB2;
    475476                    CB2=CB1;
    476477                    CB1=CB0;
    477                                                                 }
     478        }
    478479        CB1=std::sqrt(RPIH/V)*std::exp(CI*(V-PI4))*(CB1-P*CB2);
    479                                                                 if (ik) H=real(CB1);
     480        if (ik) H=real(CB1);
    480481        else    H=real(-CI*CB1);
    481                                                 }
     482      }
    482483    }
    483484    else                          // J1/Y1 Bessel functions
     
    494495        {
    495496          G4double B0=CD[IT]+ALFA*B1-B2;
    496                                                                                          B2=B1;
     497                   B2=B1;
    497498                   B1=B0;
    498499        }
     
    510511          H=RPIH*((CE+std::log(HF*X))*H-1./X)+Y*(B1-B2);
    511512        }
    512                                                 }
     513      }
    513514      else
    514                                                 {
     515      {
    515516        G4double P=10./V-1.;
    516517        G4double ALFA=P+P;
     
    520521        {
    521522          G4complex CB0=CF[IT]+ALFA*CB1-CB2;
    522                                                                                           CB2=CB1;
     523                    CB2=CB1;
    523524                    CB1=CB0;
    524525        }
     
    526527        if (ik) H=real(CB1);
    527528        else    H=real(-CI*CB1);
    528                                                 }
     529      }
    529530      if (X < 0.) H=-H;
    530531    }
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QCHIPSWorld.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QCHIPSWorld.cc,v 1.32 2006/06/29 20:06:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QCHIPSWorld.cc,v 1.33 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCHIPSWorld ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for the CHIPS World definition in CHIPS Model
     33// -------------------------------------------------------------------
     34// Short description: The CHIPS World is a world of elementary particles
     35// and nuclear fragments. This class is a singletone, but without fixed
     36// limits. E.g. the nuclear fragments as possible G4Candidates can be
     37// initialized in the CHIPS World only up to Be8 od C12 or other bigger
     38// nuclear fragment. If one need the heavy fragment production then the
     39// the CHIPS World must be initialized up to these fragments (see the
     40// CHIPS Manual), but the price in performans will be big, because in
     41// each act of the fragmentation competition these numerous candidates
     42// take place in the competition and the hadronization probability is
     43// calculated each time for each of them, so the Be8 limit (Be8->alpha+
     44// alpha decays very fast and contribute to the alpha-spectrum) is the
     45// most optimal.
    3346// -------------------------------------------------------------------
    3447
     
    114127      {
    115128#ifdef debug
    116                 G4cout<<"G4QCHIPSWorld::GetParticles: Create particle QCode="<<i<<G4endl;
     129        G4cout<<"G4QCHIPSWorld::GetParticles: Create particle QCode="<<i<<G4endl;
    117130#endif
    118131        G4QParticle* curPart = new G4QParticle(cf,i); // Created with QCode=i
    119132#ifdef debug
    120                 G4cout<<"G4QCHIPSWorld::GetParticles: Particle QCode="<<i<<" is created."<<G4endl;
     133        G4cout<<"G4QCHIPSWorld::GetParticles: Particle QCode="<<i<<" is created."<<G4endl;
    121134#endif
    122135        //curPart->InitQParticle(i);             //
     
    135148  return &GetQWorld();
    136149}
    137 
    138 
    139 
    140 
    141 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QCandidate.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QCandidate.cc,v 1.34 2006/11/27 10:44:53 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QCandidate.cc,v 1.35 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QCandidate ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Quasmon initiated Candidates used by CHIPS Model
     33// ------------------------------------------------------------------
     34// Short description: A candidate for hadronization. The candidates
     35// (hadrons or nuclear fragments) are competative, each quark of a
     36// Quasmon select which candidate to use for hadronization
    3337// ------------------------------------------------------------------
    3438
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QChipolino.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QChipolino.cc,v 1.34 2008/03/31 20:29:33 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QChipolino.cc,v 1.35 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QChipolino ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Quasmon initiated Chipolinos generated by CHIPS Model
    33 // ------------------------------------------------------------------
     33// --------------------------------------------------------------------
     34// Short description: In the CHIPS model not only hadrons are considered,
     35// but the di-hadrons, which can not be convereged to the quark content
     36// of only one hadron (e.g. pi+pi+, K+p, Delta++p etc). This kind of
     37// hadronic states, which can be easily decayed in two hadrons, is called
     38// Chipolino-particle in the model.
     39// ----------------------------------------------------------------------
    3440
    3541//#define debug
     
    5359    QCont.IncQAQ(1,0.); // Add quark-pair
    5460
    55   G4QContent rQC=QCont;       // Copy for possible reduction ("annihilation" of q-qbar pairs)
     61  G4QContent rQC=QCont;       // Copy for possible reduction ("annihilation" of q-aq pairs)
    5662  tot=rQC.GetTot();           // New total number of quarks in QC  (temporary)
    5763  if   (tot%2)rQC.DecQAQ(-tban-2); // Reduce pairs, keep only 5 quarks  (baryon case)
     
    9298      G4QContent oQC=rQC-cQC;
    9399#ifdef debug
    94           cout<<"G4QChipolino: aQC="<<aQC<<", cQC="<<cQC<<", oQC="<<oQC<<G4endl;
     100   cout<<"G4QChipolino: aQC="<<aQC<<", cQC="<<cQC<<", oQC="<<oQC<<G4endl;
    95101#endif
    96102      G4QPDGCode oQPDG(oQC);
     
    99105      G4double m=M1+M2;
    100106#ifdef debug
    101           cout<<"G4QChipolino: c="<<cQPDG<<",cM="<<M1<<",o="<<oQPDG<<",oM="<<M2
     107   cout<<"G4QChipolino: c="<<cQPDG<<",cM="<<M1<<",o="<<oQPDG<<",oM="<<M2
    102108          <<",cM+0M="<<m<<", curMinM="<<minM<<G4endl;
    103109#endif
     
    117123    G4bool fl=nA>nQ;               // Flag of antibaryon case
    118124#ifdef pdebug
    119         cout<<"G4QChipolino: Baryon case nQ="<<nQ<<",nA="<<nA<<",QC="<<rQC
     125 cout<<"G4QChipolino: Baryon case nQ="<<nQ<<",nA="<<nA<<",QC="<<rQC
    120126        <<",fl="<<fl<<G4endl;
    121127#endif
     
    145151    }
    146152#ifdef pdebug
    147         cout<<"G4QChipolino: Baryon case minM="<<minM<<", M="<<theQCont1<<theQPDG1
     153 cout<<"G4QChipolino: Baryon case minM="<<minM<<", M="<<theQCont1<<theQPDG1
    148154        <<", B="<<theQPDG2<<G4endl;
    149155#endif
     
    152158  {
    153159    if(ban)
    154         {
     160    {
    155161      G4int nQ=rQC.GetQ();
    156162      G4int nA=rQC.GetAQ();
    157163      G4bool fl=nA>nQ;             // Flag of anti-dibaryon case
    158164#ifdef debug
    159           cout<<"G4QChipolino: Di-Baryon case nQ="<<nQ<<",nA="<<nA<<",QC="<<rQC<<",fl="<<fl<<G4endl;
     165   cout<<"G4QChipolino: Di-Bar. case nQ="<<nQ<<",nA="<<nA<<",QC="<<rQC<<",fl="<<fl<<G4endl;
    160166#endif
    161167      for (int i=0; i<4; i++)
     
    189195              theQPDG2  = oQPDG;
    190196            }
    191                   }
    192             }
     197          }
     198        }
    193199      }
    194200    }
    195201    else                       // Baryon-AntiBaryon
    196         {
     202    {
    197203      theQCont1 = rQC.IndQ(0)+rQC.IndQ(1)+rQC.IndQ(2);
    198204      theQPDG1.InitByQCont(theQCont1);
    199205      theQPDG2.InitByQCont(rQC.IndAQ(0)+rQC.IndAQ(1)+rQC.IndAQ(2));
    200         }
     206    }
    201207  }
    202208  else if(((rQC.GetU() )>(rQC.GetS() -4) && (rQC.GetD() )>(rQC.GetS() -4)) ||
     
    213219    G4bool fl=nA>nQ;           // Flag of anti-fragment case
    214220#ifdef debug
    215         cout<<"G4QChipolino: NucFragment case nQ="<<nQ<<",nAQ="<<nA<<", QC="<<rQC<<",fl="<<fl<<G4endl;
    216 #endif
    217         if((fl&&kS>1)||(!fl&&mS>1))
     221    G4cout<<"G4QChipolino: NucFragment case nQ="<<nQ<<",nAQ="<<nA<<", QC="<<rQC<<",fl="<<fl
     222          <<G4endl;
     223#endif
     224 if((fl&&kS>1)||(!fl&&mS>1))
    218225    {
    219226      G4cerr<<"***G4QChipolino: ***Overfowed by strange quarks*** rQC="<<rQC<<G4endl;
    220           //throw G4QException("G4QChipolino: NuclearFragment is overflowed by the strange quarks");
     227      //throw G4QException("G4QChipolino: NuclearFragment is overflowed by strangeQuarks");
    221228    }
    222229    else if(fl)                // ===> Anti-fragment
    223         {
     230    {
    224231      //G4cerr<<"***G4QChipolino: ***Anti-nuclear fragments*** rQC="<<rQC<<G4endl;
    225           //throw G4QException("G4QChipolino: Antinuclear fragments are not yet supported");
    226       if(!mS)                                                           // No strange quarks
    227           {
    228         G4int nI=mU-mD;                                                 // Isotopic shift
     232      //throw G4QException("G4QChipolino: Antinuclear fragments are not yet supported");
     233      if(!mS)                                                      // No strange quarks
     234      {
     235        G4int nI=mU-mD;                                            // Isotopic shift
    229236        G4int nN=(mU+mD-nI*3)/6;
    230         if(!kS)                                                         // No kaons
    231                 {
    232           if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                           // Delta isn't necessary
    233           {
    234             if(nI>0)                                                    // Excess of antiprotons
    235             {
    236               theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI-1)+nN));     // A Fragment-AProton
    237               theQPDG2 = G4QPDGCode(-2212);                             // An Anti-Proton
    238             }
    239             else                                                        // Excess of a-neutrons
    240             {
    241               theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI)+nN-1));     // A Fragment-ANeutron
    242               theQPDG2 = G4QPDGCode(-2112);                             // An Anti-Neutron
    243             }
    244               }
    245           else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                     // Delta can be a part
    246                   {
    247             if(nI>0)                                                    // Excess of au-quarks
    248             {
    249               theQPDG1=G4QPDGCode(-(90000000+1000*(nN+nI-2)+nN+1));     // A Fragment-AProton
    250               theQPDG2=G4QPDGCode(-2224);                               // An Anti-Delta++
    251             }
    252             else                                                        // Excess of ad-quarks
    253             {
    254               theQPDG1=G4QPDGCode(-(90000000+1000*(nN+nI+1)+nN-2));     // A Fragment-ANeutron
    255               theQPDG2=G4QPDGCode(-1114);                               // An Anti-Delta-
    256             }
    257                   }
     237        if(!kS)                                                    // No kaons
     238        {
     239          if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                      // Delta isn't necessary
     240          {
     241            if(nI>0)                                               // Excess of antiprotons
     242            {
     243              theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI-1)+nN));// A Fragment-AProton
     244              theQPDG2 = G4QPDGCode(-2212);                        // An Anti-Proton
     245            }
     246            else                                                   // Excess of a-neutrons
     247            {
     248              theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI)+nN-1));// A Fragment-ANeutron
     249              theQPDG2 = G4QPDGCode(-2112);                        // An Anti-Neutron
     250            }
     251          }
     252          else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                // Delta can be a part
     253          {
     254            if(nI>0)                                               // Excess of au-quarks
     255            {
     256              theQPDG1=G4QPDGCode(-(90000000+1000*(nN+nI-2)+nN+1));// A Fragment-AProton
     257              theQPDG2=G4QPDGCode(-2224);                          // An Anti-Delta++
     258            }
     259            else                                                   // Excess of ad-quarks
     260            {
     261              theQPDG1=G4QPDGCode(-(90000000+1000*(nN+nI+1)+nN-2));// A Fragment-ANeutron
     262              theQPDG2=G4QPDGCode(-1114);                          // An Anti-Delta-
     263            }
     264          }
    258265          else
    259                   {
    260             G4cerr<<"***G4QChipolino: **A**Isotopic asymmetry (without S)*** rQC="<<rQC<<G4endl;
    261                 //throw G4QException("G4QChipolino: IsotopicAsymmety of AntiMultyBaryon Quasmon");
    262                   }
    263         }
    264         else if(kS<2)                                                   // NucFrag+K is possible
    265                 {
     266          {
     267            G4cerr<<"***G4QChipolino:**A**IsotopicAsymmetry (without S),rQC="<<rQC<<G4endl;
     268            //throw G4QException("G4QChipolino: IsotopicAsymmety of AntiMultyBar Quasmon");
     269          }
     270        }
     271        else if(kS<2)                                              // NucFrag+K is possible
     272        {
    266273          G4int    nN =(mU+mD-4-nI*3)/6;
    267           if(nI>0)                                                      // Excess of au-quarks
     274          if(nI>0)                                                 // Excess of au-quarks
    268275          {
    269276            nN+=1;
    270             theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI-1)+nN));       // An Anti-Fragment
    271             theQPDG2 = G4QPDGCode(-321);                                // A K- meson
    272                   }
     277            theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI-1)+nN));  // An Anti-Fragment
     278            theQPDG2 = G4QPDGCode(-321);                           // A K- meson
     279          }
    273280          else
    274                   {
    275             theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI+1)+nN));       // An AntiFragment
    276             theQPDG2 = G4QPDGCode(-311);                                // An Anti-K0 meson
    277           }
    278                 }
     281          {
     282            theQPDG1 = G4QPDGCode(-(90000000+1000*(nN+nI+1)+nN));  // An AntiFragment
     283            theQPDG2 = G4QPDGCode(-311);                           // An Anti-K0 meson
     284          }
     285        }
    279286        else
    280             {
     287        {
    281288          G4cerr<<"***G4QChipolino: ***Too many kaons are needed*** rQC="<<rQC<<G4endl;
    282               //throw G4QException("G4QChipolino: Too many Kaons are needed for the AntiNucFragm");
    283                 }
    284           }
     289          //throw G4QException("G4QChipolino: Too Many Kaons are needed for AntiNucFragm");
     290        }
     291      }
    285292      else                     // Fragment with strangeness
    286           {
     293      {
    287294        if(mS<=mU&&mS<=mD)     // Fragment consisting of Neutrons, Protons & Lambrdas only
    288                 {
    289           G4int nI=mU-mD;                                               // Isotopic shift
     295      {
     296          G4int nI=mU-mD;                                          // Isotopic shift
    290297          G4int nN=(mU+mD-mS-mS-nI*3)/6;
    291           if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                           // Delta isn't necessary
    292           {
    293             if(nI>0)                                                    // Excess of protons
    294             {
    295               theQPDG1 = G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI-1)+nN));// A Fragment-AProton
    296               theQPDG2 = G4QPDGCode(-2212);                             // An Anti-Proton
    297             }
    298             else                                                        // Excess of neutrons
    299             {
    300               theQPDG1 = G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI)+nN-1));//A Fragment-ANeutron
    301               theQPDG2 = G4QPDGCode(-2112);                             // An Anti-Neutron
    302             }
    303                   }
    304           else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                     // Delta can be a part
    305                   {
    306             if(nI>0)                                                    // Excess of au-quarks
    307             {
    308               theQPDG1=G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI-2)+nN+1));// A Fragment-AProton
    309               theQPDG2=G4QPDGCode(-2224);                               // An Anti-Delta++
    310             }
    311             else                                                        // Excess of ad-quarks
    312             {
    313               theQPDG1=G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI+1)+nN-2));//A Fragment-ANeutron
    314               theQPDG2=G4QPDGCode(-1114);                               // An Anti-Delta-
    315             }
    316                   }
     298          if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                      // Delta isn't necessary
     299          {
     300            if(nI>0)                                               // Excess of protons
     301            {
     302              theQPDG1 = G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI-1)+nN));// Fragm-AProton
     303              theQPDG2 = G4QPDGCode(-2212);                        // An Anti-Proton
     304            }
     305            else                                                   // Excess of neutrons
     306            {
     307              theQPDG1 = G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI)+nN-1));//Fragm-ANeutron
     308              theQPDG2 = G4QPDGCode(-2112);                        // An Anti-Neutron
     309            }
     310          }
     311          else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                // Delta can be a part
     312          {
     313            if(nI>0)                                               // Excess of au-quarks
     314            {
     315              theQPDG1=G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI-2)+nN+1));//Fragm-AProton
     316              theQPDG2=G4QPDGCode(-2224);                          // An Anti-Delta++
     317            }
     318            else                                                   // Excess of ad-quarks
     319            {
     320              theQPDG1=G4QPDGCode(-(90000000+1000*(kS*1000+nN+nI+1)+nN-2));//Fragm-ANeutron
     321              theQPDG2=G4QPDGCode(-1114);                          // An Anti-Delta-
     322            }
     323          }
    317324          else
    318                   {
    319             G4cerr<<"***G4QChipolino: **A**Isotopic assimetry (with S)*** rQC="<<rQC<<G4endl;
    320                 //throw G4QException("G4QChipolino: Isotopics of Strange AntiMultyBaryon Quasmon");
    321                   }
    322                 }
    323         else                                                            // Excess of s-quarks
    324                 {
    325           G4int       lam=mU;                                           // A#of Anti-Lambdas
     325          {
     326            G4cerr<<"***G4QChipolino:**A**IsotopicAssimetry (with S)*** rQC="<<rQC<<G4endl;
     327            //throw G4QException("G4QChipolino: Isotopics of Strange AntiMultyBarQuasmon");
     328          }
     329        }
     330        else                                                       // Excess of s-quarks
     331        {
     332          G4int       lam=mU;                                      // A#of Anti-Lambdas
    326333          if (lam>mD) lam=mD;
    327           G4int lD=mD-lam;                                              // Residual ad-quarks
    328           G4int lU=mU-lam;                                              // Residual au-quarks
    329           G4int lS=mS-lam;                                              // Residual as-quarks
     334          G4int lD=mD-lam;                                         // Residual ad-quarks
     335          G4int lU=mU-lam;                                         // Residual au-quarks
     336          G4int lS=mS-lam;                                         // Residual as-quarks
    330337          if(lD+lU+lS!=3||lD<0||lU<0||lS<0)
    331                   {
    332             G4cerr<<"***G4QChipolino:*AntiFragm* rQC="<<rQC<<",s="<<lS<<",u="<<lU<<",d"<<lD<<G4endl;
    333                 //throw G4QException("G4QChipolino: Exotic superstrange AntiMultyBaryon");
    334                   }
    335           if     ( !lD && lU==2) theQPDG2=G4QPDGCode(-3222);            // Anti-Sigma+
    336           else if( !lU && lD==2) theQPDG2=G4QPDGCode(-3112);            // Anti-Sigma-
    337           else if( !lD && lU==1) theQPDG2=G4QPDGCode(-3322);            // Anti-Ksi0
    338           else if( !lU && lD==1) theQPDG2=G4QPDGCode(-3312);            // Anti-Ksi-
    339           else                   theQPDG2=G4QPDGCode(-3334);            // Anti-Omega-
    340           theQPDG1=G4QPDGCode(-(90+lam)*1000000);                       // Anti Strange Matter
    341                 }
    342         theQCont1  = rQC-theQPDG2.GetQuarkContent();                    // QCont of Fragment-H
    343         theQCont   = rQC;                                               // QCont of Chipolino
    344           }
    345         }
    346         else                       // ===> Nuclear Fragment
    347         {
    348       if(!kS)                                                           // No strange quarks
    349           {
    350         G4int nI=kU-kD;                                                 // Isotopic shift
     338          {
     339            G4cerr<<"***G4QChipolino:*AntiFragment* rQC="<<rQC<<",s="<<lS<<",u="<<lU<<",d"
     340                  <<lD<<G4endl;
     341            //throw G4QException("G4QChipolino: Exotic superstrange AntiMultyBaryon");
     342          }
     343          if     ( !lD && lU==2) theQPDG2=G4QPDGCode(-3222);       // Anti-Sigma+
     344          else if( !lU && lD==2) theQPDG2=G4QPDGCode(-3112);       // Anti-Sigma-
     345          else if( !lD && lU==1) theQPDG2=G4QPDGCode(-3322);       // Anti-Ksi0
     346          else if( !lU && lD==1) theQPDG2=G4QPDGCode(-3312);       // Anti-Ksi-
     347          else                   theQPDG2=G4QPDGCode(-3334);       // Anti-Omega-
     348          theQPDG1=G4QPDGCode(-(90+lam)*1000000);                  // Anti Strange Matter
     349        }
     350        theQCont1  = rQC-theQPDG2.GetQuarkContent();               // QCont of Fragment-H
     351        theQCont   = rQC;                                          // QCont of Chipolino
     352      }
     353    }
     354    else                       // ===> Nuclear Fragment
     355    {
     356      if(!kS)                                                      // No strange quarks
     357      {
     358        G4int nI=kU-kD;                                            // Isotopic shift
    351359        G4int nN=(kU+kD-nI*3)/6;
    352         if(!mS)                                                         // No kaons
    353                 {
    354           if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                           // Delta isn't necessary
    355           {
    356             if(nI>0)                                                    // Excess of protons
    357             {
    358               theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI-1)+nN);        // A Fragment-Proton
    359               theQPDG2 = G4QPDGCode(2212);                              // A Proton
    360             }
    361             else                                                        // Excess of neutrons
    362             {
    363               theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI)+nN-1);        // A Fragment-Neutron
    364               theQPDG2 = G4QPDGCode(2112);                              // A Neutron
    365             }
    366               }
    367           else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                     // Delta can be a part
    368                   {
    369             if(nI>0)                                                    // Excess of u-quarks
    370             {
    371               theQPDG1=G4QPDGCode(90000000+1000*(nN+nI-2)+nN+1);        // A Fragment-Proton
    372               theQPDG2=G4QPDGCode(2224);                                // A Delta++
    373             }
    374             else                                                        // Excess of d-quarks
    375             {
    376               theQPDG1=G4QPDGCode(90000000+1000*(nN+nI+1)+nN-2);        // A Fragment-Neutron
    377               theQPDG2=G4QPDGCode(1114);                                // A Delta-
    378             }
    379                   }
     360        if(!mS)                                                    // No kaons
     361        {
     362          if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                      // Delta isn't necessary
     363          {
     364            if(nI>0)                                               // Excess of protons
     365            {
     366              theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI-1)+nN);   // A Fragment-Proton
     367              theQPDG2 = G4QPDGCode(2212);                         // A Proton
     368            }
     369            else                                                   // Excess of neutrons
     370            {
     371              theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI)+nN-1);   // A Fragment-Neutron
     372              theQPDG2 = G4QPDGCode(2112);                         // A Neutron
     373            }
     374          }
     375          else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                // Delta can be a part
     376          {
     377            if(nI>0)                                               // Excess of u-quarks
     378            {
     379              theQPDG1=G4QPDGCode(90000000+1000*(nN+nI-2)+nN+1);   // A Fragment-Proton
     380              theQPDG2=G4QPDGCode(2224);                           // A Delta++
     381            }
     382            else                                                   // Excess of d-quarks
     383            {
     384              theQPDG1=G4QPDGCode(90000000+1000*(nN+nI+1)+nN-2);   // A Fragment-Neutron
     385              theQPDG2=G4QPDGCode(1114);                           // A Delta-
     386            }
     387          }
    380388          else
    381                   {
    382             G4cerr<<"***G4QChipolino: ***Isotopic assimetry (without S)*** rQC="<<rQC<<G4endl;
    383                 //throw G4QException("G4QChipolino: Exotic Isotopic assimety of MultyBaryon Quasmon");
    384                   }
    385         }
    386         else if(mS<2)                                                   // NucFrag+K is possible
    387                 {
     389          {
     390            G4cerr<<"***G4QChipolino:***Isotopic assimetry (without S), rQC="<<rQC<<G4endl;
     391            //throw G4QException("G4QChipolino:ExoticIsotopicAssimety of MultyBarQuasmon");
     392          }
     393        }
     394        else if(mS<2)                                              // NucFrag+K is possible
     395        {
    388396          G4int    nN =(kU+kD-4-nI*3)/6;
    389           if(nI>0)                                                      // Excess of u-quarks
     397          if(nI>0)                                                 // Excess of u-quarks
    390398          {
    391399            nN+=1;
    392             theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI-1)+nN);          // A Fragment
    393             theQPDG2 = G4QPDGCode(321);                                 // A K+ meson
    394                   }
     400            theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI-1)+nN);     // A Fragment
     401            theQPDG2 = G4QPDGCode(321);                            // A K+ meson
     402          }
    395403          else
    396                   {
    397             theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI+1)+nN);            // A Fragment
    398             theQPDG2 = G4QPDGCode(311);                                 // A K0 meson
    399           }
    400                 }
     404          {
     405            theQPDG1 = G4QPDGCode(90000000+1000*(nN+nI+1)+nN);     // A Fragment
     406            theQPDG2 = G4QPDGCode(311);                            // A K0 meson
     407          }
     408        }
    401409        else
    402             {
     410        {
    403411          G4cerr<<"***G4QChipolino: ***Too many kaons are needed*** rQC="<<rQC<<G4endl;
    404               //throw G4QException("G4QChipolino: More than one Kaon is needed for the NuclFragm");
    405                 }
    406           }
     412          //throw G4QException("G4QChipolino: More than one Kaon is needed for NuclFragm");
     413        }
     414      }
    407415      else                     // Fragment with strangeness
    408           {
     416      {
    409417        if(kS<=kU&&kS<=kD)     // Fragment consisting of Neutrons, Protons & Lambrdas only
    410                 {
    411           G4int nI=kU-kD;                                               // Isotopic shift
     418        {
     419          G4int nI=kU-kD;                                          // Isotopic shift
    412420          G4int nN=(kU+kD-kS-kS-nI*3)/6;
    413           if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                           // Delta isn't necessary
    414           {
    415             if(nI>0)                                                    // Excess of protons
    416             {
    417               theQPDG1 = G4QPDGCode(90000000+1000*(kS*1000+nN+nI-1)+nN);// A Fragment-Proton
    418               theQPDG2 = G4QPDGCode(2212);                              // A Proton
    419             }
    420             else                                                        // Excess of neutrons
    421             {
    422               theQPDG1 = G4QPDGCode(90000000+1000*(kS*1000+nN+nI)+nN-1);// A Fragment-Neutron
    423               theQPDG2 = G4QPDGCode(2112);                              // A Neutron
    424             }
    425                   }
    426           else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                     // Delta can be a part
    427                   {
    428             if(nI>0)                                                    // Excess of u-quarks
    429             {
    430               theQPDG1=G4QPDGCode(90000000+1000*(kS*1000+nN+nI-2)+nN+1);// A Fragment-Proton
    431               theQPDG2=G4QPDGCode(2224);                                // A Delta++
    432             }
    433             else                                                        // Excess of d-quarks
    434             {
    435               theQPDG1=G4QPDGCode(90000000+1000*(kS*1000+nN+nI+1)+nN-2);// A Fragment-Neutron
    436               theQPDG2=G4QPDGCode(1114);                                // A Delta-
    437             }
    438                   }
     421          if((nI>=0&&nN>=0)||(nI<0&&nN>=-nI))                      // Delta isn't necessary
     422          {
     423            if(nI>0)                                               // Excess of protons
     424            {
     425              theQPDG1 = G4QPDGCode(90000000+1000*(kS*1000+nN+nI-1)+nN);// Fragment-Proton
     426              theQPDG2 = G4QPDGCode(2212);                         // A Proton
     427            }
     428            else                                                   // Excess of neutrons
     429            {
     430              theQPDG1 = G4QPDGCode(90000000+1000*(kS*1000+nN+nI)+nN-1);// Fragment-Neutron
     431              theQPDG2 = G4QPDGCode(2112);                         // A Neutron
     432            }
     433          }
     434          else if((nI>=0&&nN>-2)||(nI<0&&nN>-nI-2))                // Delta can be a part
     435          {
     436            if(nI>0)                                               // Excess of u-quarks
     437            {
     438              theQPDG1=G4QPDGCode(90000000+1000*(kS*1000+nN+nI-2)+nN+1);// Fragment-Proton
     439              theQPDG2=G4QPDGCode(2224);                           // A Delta++
     440            }
     441            else                                                   // Excess of d-quarks
     442            {
     443              theQPDG1=G4QPDGCode(90000000+1000*(kS*1000+nN+nI+1)+nN-2);// Fragment-Neutron
     444              theQPDG2=G4QPDGCode(1114);                           // A Delta-
     445            }
     446          }
    439447          else
    440                   {
     448          {
    441449            G4cerr<<"***G4QChipolino: ***Isotopic assimetry (with S)*** rQC="<<rQC<<G4endl;
    442                 //throw G4QException("G4QChipolino: IsotopicAssimety of StrangeMultyBaryon Quasmon");
    443                   }
    444                 }
    445         else                                                            // Excess of s-quarks
    446                 {
    447           G4int       lam=kU;                                           // A#of Lambda
     450            //throw G4QException("G4QChipolino:IsotopicAssimety of StrangeMultyBar Quasm");
     451          }
     452        }
     453        else                                                       // Excess of s-quarks
     454        {
     455          G4int       lam=kU;                                      // A#of Lambda
    448456          if (lam>kD) lam=kD;
    449           G4int lD=kD-lam;                                              // Residual d-quarks
    450           G4int lU=kU-lam;                                              // Residual u-quarks
    451           G4int lS=kS-lam;                                              // Residual s-quarks
     457          G4int lD=kD-lam;                                         // Residual d-quarks
     458          G4int lU=kU-lam;                                         // Residual u-quarks
     459          G4int lS=kS-lam;                                         // Residual s-quarks
    452460          if(lD+lU+lS!=3||lD<0||lU<0||lS<0)
    453                   {
    454             G4cerr<<"***G4QChipolino:*Fragment*rQC="<<rQC<<",s="<<lS<<",u="<<lU<<",d"<<lD<<G4endl;
    455                 //throw G4QException("G4QChipolino: Exotic superstrange Multy Baryon");
    456                   }
    457           if     ( !lD && lU==2) theQPDG2=G4QPDGCode(3222);             // Sigma+
    458           else if( !lU && lD==2) theQPDG2=G4QPDGCode(3112);             // Sigma-
    459           else if( !lD && lU==1) theQPDG2=G4QPDGCode(3322);             // Ksi0
    460           else if( !lU && lD==1) theQPDG2=G4QPDGCode(3312);             // Ksi-
    461           else                   theQPDG2=G4QPDGCode(3334);             // Omega-
    462           theQPDG1=G4QPDGCode((90+lam)*1000000);                        // A Strange Matter
    463                 }
    464         theQCont1  = rQC-theQPDG2.GetQuarkContent();                    // QCont of Fragment-H
    465         theQCont   = rQC;                                               // QCont of Chipolino
    466           }
    467         }
     461          {
     462            G4cerr<<"***G4QChipolino:*Fragment*rQC="<<rQC<<",s="<<lS<<",u="<<lU<<",d"
     463                  <<lD<<G4endl;
     464            //throw G4QException("G4QChipolino: Exotic superstrange Multy Baryon");
     465          }
     466          if     ( !lD && lU==2) theQPDG2=G4QPDGCode(3222);        // Sigma+
     467          else if( !lU && lD==2) theQPDG2=G4QPDGCode(3112);        // Sigma-
     468          else if( !lD && lU==1) theQPDG2=G4QPDGCode(3322);        // Ksi0
     469          else if( !lU && lD==1) theQPDG2=G4QPDGCode(3312);        // Ksi-
     470          else                   theQPDG2=G4QPDGCode(3334);        // Omega-
     471          theQPDG1=G4QPDGCode((90+lam)*1000000);                   // Strange Matter
     472        }
     473        theQCont1  = rQC-theQPDG2.GetQuarkContent();               // QCont of Fragment-H
     474        theQCont   = rQC;                                          // QCont of Chipolino
     475      }
     476    }
    468477  }
    469478  else
    470479  {
    471480    G4cerr<<"***G4QChipolino: ***Exotics*** rQC="<<rQC<<G4endl;
    472         //throw G4QException("G4QChipolino: can not be constructed for the exotic baryon or meson");
     481    //throw G4QException("G4QChipolino: can't be constructed for exotic baryon or meson");
    473482  }
    474483}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QContent.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QContent.cc,v 1.44 2008/03/20 20:11:37 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QContent.cc,v 1.45 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QContent ----------------
     
    3232//      class for Quasmon initiated Contents used by CHIPS Model
    3333// --------------------------------------------------------------------
     34// Short description: This is the basic class of the CHIPS model. It
     35// describes the quark content of the Quasmon, which is a generalized
     36// hadronic state. All Quasmons are bags, characterized by the quark
     37// Content (QContent), but the spin is not fixed and only light (u,d,s)
     38// quarks are considered (SU(3)). The hadrons are the ground states for
     39// the corresponding quasmons. The Chipolino (G4QChipolino) or nuclear
     40// cluster are examples for another Quark Content.
     41// --------------------------------------------------------------------
    3442// @@ In future total spin & c,b,t of the Hadron can be added @@ M.K.@@
     43// --------------------------------------------------------------------
    3544
    3645//#define debug
     
    93102    nAD = right.nAD;
    94103    nAS = right.nAS;
    95                 }
     104  }
    96105  return *this;
    97106}
     
    135144    G4int dAU=rAU-nAU;
    136145    if(dU>0||dAU>0)
    137         {
     146    {
    138147      G4int kU=dU;
    139148      if(kU<dAU) kU=dAU;                  // Get biggest difference
     
    141150      if(rAU<mU) mU=rAU;                  // Get a#of possible SS pairs
    142151      if(kU<=mU)                          // Total compensation
    143              {
     152      {
    144153        rU-=kU;
    145154        rAU-=kU;
     
    158167    G4int dAD=rAD-nAD;
    159168    if(dD>0||dAD>0)
    160            {
     169    {
    161170      G4int kD=dD;
    162171      if(kD<dAD) kD=dAD;                  // Get biggest difference
     
    164173      if(rAD<mD) mD=rAD;                  // Get a#of possible SS pairs
    165174      if(kD<=mD)                          // Total compensation
    166              {
     175      {
    167176        rD-=kD;
    168177        rAD-=kD;
     
    190199      rU +=1;
    191200      rAU+=1;
    192            }
     201    }
    193202    else
    194203    {
    195204      rD +=1;
    196205      rAD+=1;
    197            }
     206    }
    198207  }
    199208  nD -= rD;
     
    258267    G4int dAU=rAU-nAU;
    259268    if(dU>0||dAU>0)
    260            {
     269    {
    261270      G4int kU=dU;
    262271      if(kU<dAU) kU=dAU;                  // Get biggest difference
     
    264273      if(rAU<mU) mU=rAU;                  // Get a#of possible SS pairs
    265274      if(kU<=mU)                          // Total compensation
    266              {
     275      {
    267276        rU-=kU;
    268277        rAU-=kU;
     
    281290    G4int dAD=rAD-nAD;
    282291    if(dD>0||dAD>0)
    283            {
     292    {
    284293      G4int kD=dD;
    285294      if(kD<dAD) kD=dAD;                  // Get biggest difference
     
    287296      if(rAD<mD) mD=rAD;                  // Get a#of possible SS pairs
    288297      if(kD<=mD)                          // Total compensation
    289              {
     298      {
    290299        rD-=kD;
    291300        rAD-=kD;
     
    310319      rU +=1;
    311320      rAU+=1;
    312            }
     321    }
    313322    else
    314323    {
    315324      rD +=1;
    316325      rAD+=1;
    317            }
     326    }
    318327  }
    319328  nD -= rD;
     
    507516  if((tot!=4||q!=2) && (tot!=5||(q!=1&&aq!=1)) && (tot!=6||abs(b)!=2))
    508517  {
    509            //#ifdef erdebug
     518    //#ifdef erdebug
    510519    G4cerr<<"***G4QCont::SplitChipo: QC="<<GetThis()<<G4endl;
    511            //#endif
     520    //#endif
    512521  }
    513522  else if(tot==4)      // Mesonic (eight possibilities)
     
    519528    else
    520529    {
    521              //#ifdef debug
     530      //#ifdef debug
    522531      G4cerr<<"***G4QCont::SplitChipo:MesTot="<<tot<<",b="<<b<<",q="<<q<<",a="<<aq<<G4endl;
    523              //#endif
     532      //#endif
    524533    }
    525534  }
     
    527536  {
    528537    if(nU==3)
    529            {
     538    {
    530539      r.SetU(1);
    531540      r+=IndAQ();
    532541    }
    533542    else if(nD==3)
    534            {
     543    {
    535544      r.SetD(1);
    536545      r+=IndAQ();
    537546    }
    538547    else if(nS==3)
    539            {
     548    {
    540549      r.SetS(1);
    541550      r+=IndAQ();
    542551    }
    543552    else if(nAU==3)
    544            {
     553    {
    545554      r.SetAU(1);
    546555      r+=IndQ();
    547556    }
    548557    else if(nAD==3)
    549            {
     558    {
    550559      r.SetAD(1);
    551560      r+=IndQ();
    552561    }
    553562    else if(nAS==3)
    554            {
     563    {
    555564      r.SetAS(1);
    556565      r+=IndQ();
    557566    }
    558567    else if(q==1&&nU)
    559            {
     568    {
    560569      r.SetU(1);
    561570      if(nAU) r.SetAU(1);
     
    563572    }
    564573    else if(q==1&&nD)
    565            {
     574    {
    566575      r.SetD(1);
    567576      if(nAD) r.SetAD(1);
     
    569578    }
    570579    else if(q==1&&nS)
    571            {
     580    {
    572581      r.SetS(1);
    573582      if(nAS) r.SetAS(1);
     
    575584    }
    576585    else if(aq==1&&nAU)
    577            {
     586    {
    578587      r.SetAU(1);
    579588      if(nU) r.SetU(1);
     
    581590    }
    582591    else if(aq==1&&nAD)
    583            {
     592    {
    584593      r.SetAD(1);
    585594      if(nD) r.SetD(1);
     
    587596    }
    588597    else if(aq==1&&nAS)
    589            {
     598    {
    590599      r.SetAS(1);
    591600      if(nS) r.SetS(1);
     
    594603    else
    595604    {
    596              //#ifdef erdebug
     605      //#ifdef erdebug
    597606      G4cerr<<"***G4QCont::SplitChipo: Baryonic tot=5,b=1,qCont="<<GetThis()<<G4endl;
    598607      //#endif
     
    603612    r=GetThis();
    604613    if (bn>0)                // baryonium
    605            {
     614    {
    606615      G4QContent la(1,1,1,0,0,0);
    607616      G4QContent nt(2,1,0,0,0,0);
     
    621630        else
    622631        {
    623           //#ifdef erdebug
     632          //#ifdef erdebug
    624633          G4cerr<<"***G4QCont::SplitChipo:Dibar (1) tot=6, b=2, qCont="<<GetThis()<<G4endl;
    625634          //#endif
     
    635644        else
    636645        {
    637             //#ifdef erdebug
     646          //#ifdef erdebug
    638647          G4cerr<<"***G4QContent::SplitChipo:Dib(2) tot=6, b=2, qCont="<<GetThis()<<G4endl;
    639648          //#endif
     
    649658        else
    650659        {
    651             //#ifdef erdebug
     660          //#ifdef erdebug
    652661          G4cerr<<"***G4QContent::SplitChipo:Dib(3) tot=6, b=2, qCont="<<GetThis()<<G4endl;
    653662          //#endif
    654663        }
    655664      }
    656            }
     665    }
    657666    else                     // Anti-baryonium
    658            {
     667    {
    659668      G4QContent la(0,0,0,1,1,1);
    660669      G4QContent pr(0,0,0,1,2,0);
     
    674683        else
    675684        {
    676             //#ifdef erdebug
     685          //#ifdef erdebug
    677686          G4cerr<<"***G4QContent::SplitChipo:ADib(1) tot=6,b=2, qCont="<<GetThis()<<G4endl;
    678687          //#endif
     
    688697        else
    689698        {
    690             //#ifdef erdebug
     699          //#ifdef erdebug
    691700          G4cerr<<"***G4QContent::SplitChipo:ADib(2) tot=6,b=2, qCont="<<GetThis()<<G4endl;
    692701          //#endif
     
    702711        else
    703712        {
    704             //#ifdef erdebug
     713          //#ifdef erdebug
    705714          G4cerr<<"***G4QContent::SplitChipo:ADib(3) tot=6,b=2, qCont="<<GetThis()<<G4endl;
    706715          //#endif
    707716        }
    708717      }
    709            }
     718    }
    710719  }
    711720  else // More than Dibaryon (@@ can use the same algorithm as for dibaryon)
     
    779788    G4int res=tot+nQAQ;
    780789#ifdef pdebug
    781         G4cout<<"G4QC::DecQC: tot="<<tot<<", nTP="<<nTotP<<", res="<<res<<G4endl;
     790 G4cout<<"G4QC::DecQC: tot="<<tot<<", nTP="<<nTotP<<", res="<<res<<G4endl;
    782791#endif
    783792    if(res<0)
     
    810819    G4int j = static_cast<int>(base*G4UniformRand());       // Random integer "SortOfQuark"
    811820    if (nUP && j<nUP && (nRet>2 || nUP>1 || (nD<2 && nS<2)))// --- U-Ubar pair
    812            {
     821    {
    813822#ifdef pdebug
    814823      G4cout<<"G4QC::DecQC: decrementing UAU pair UP="<<nUP<<", QC="<<GetThis()<<G4endl;
     
    819828      nLP--;
    820829      nTotP--;
    821            }
     830    }
    822831    else if (nDP && j<nLP && (nRet>2 || nDP>1 || (nU<2 && nS<2)))// --- D-Ubar pair
    823            {
     832    {
    824833#ifdef pdebug
    825834      G4cout<<"G4QC::DecQC: decrementing DAD pair DP="<<nDP<<", QC="<<GetThis()<<G4endl;
     
    830839      nLP--;
    831840      nTotP--;
    832            }
     841    }
    833842    else if (nSP&& (nRet>2 || nSP>1 || (nU<2 && nD<2)))          // --- S-Sbar pair
    834            {
     843    {
    835844#ifdef pdebug
    836845      G4cout<<"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<", QC="<<GetThis()<<G4endl;
     
    840849      nSP--;
    841850      nTotP--;
    842            }
     851    }
    843852    else if (nUP)                                  // --- U-Ubar pair cancelation (final)
    844            {
     853    {
    845854#ifdef pdebug
    846855      G4cout<<"G4QC::DecQC:Decrement UAU pair (final) UP="<<nUP<<",QC="<<GetThis()<<G4endl;
     
    851860      nLP--;
    852861      nTotP--;
    853            }
     862    }
    854863    else if (nDP)                                 // --- D-Ubar pair cancelation (final)
    855            {
     864    {
    856865#ifdef pdebug
    857866      G4cout<<"G4QC::DecQC:Decrement DAD pair (final) DP="<<nDP<<",QC="<<GetThis()<<G4endl;
     
    862871      nLP--;
    863872      nTotP--;
    864            }
     873    }
    865874    else if (nSP)                                 // --- S-Sbar pair cancelation (final)
    866            {
     875    {
    867876#ifdef pdebug
    868877      G4cout<<"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<", QC="<<GetThis()<<G4endl;
     
    872881      nSP--;
    873882      nTotP--;
    874            }
     883    }
    875884    else G4cout<<"***G4QC::DecQC:i="<<i<<",j="<<j<<",D="<<nDP<<",U="<<nUP<<",S="<<nSP
    876885               <<",T="<<nTotP<<",nRet="<<nRet<<", QC="<<GetThis()<<G4endl;
     
    894903#endif
    895904    //if      (!j)
    896            if      ( !j && (nU<=nD || nU<=nS))
     905    if      ( !j && (nU<=nD || nU<=nS))
    897906    {
    898907      nU++;
    899908      nAU++;
    900909      tot+=2;
    901            }
     910    }
    902911    //else if (j==1)
    903            else if (j==1 && (nD<=nU || nD<=nS))
    904            {
     912    else if (j==1 && (nD<=nU || nD<=nS))
     913    {
    905914      nD++;
    906915      nAD++;
    907916      tot+=2;
    908            }
     917    }
    909918    //else
    910            else if (j>1&& (nS<=nU || nS<=nD))
     919    else if (j>1&& (nS<=nU || nS<=nD))
    911920    {
    912921      nS++;
    913922      nAS++;
    914923      tot+=2;
    915            }
     924    }
    916925    else if (!j)
    917            {
     926    {
    918927      nD++;
    919928      nAD++;
    920929      tot+=2;
    921            }
     930    }
    922931    else if (j==1)
    923            {
     932    {
    924933      nU++;
    925934      nAU++;
     
    931940      nAS++;
    932941      tot+=2;
    933            }
     942    }
    934943    //else if (nD<=nU)
    935            //{
     944    //{
    936945    //  nD++;
    937946    //  nAD++;
    938947    //  tot+=2;
    939            //}
     948    //}
    940949    //else
    941            //{
     950    //{
    942951    //  nU++;
    943952    //  nAU++;
     
    10861095    G4int dD=nD+nD;
    10871096    if(n>dD)
    1088           {
     1097    {
    10891098      mD=0;
    10901099      n-=dD;
    1091            }
     1100    }
    10921101    else if (n==dD)
    1093           {
     1102    {
    10941103      mD=2;
    10951104      n=2;
    1096            }
     1105    }
    10971106    else
    10981107    {
     
    11071116    G4int dU=nU+nU;
    11081117    if(n>dU)
    1109            {
     1118    {
    11101119      mU=0;
    11111120      n-=dU;
    1112            }
     1121    }
    11131122    else if (n==dU)
    1114           {
     1123    {
    11151124      mU=2;
    11161125      n=2;
    1117            }
     1126    }
    11181127    else
    11191128    {
     
    11281137    G4int dS=nS+nS;
    11291138    if(n>dS)
    1130            {
     1139    {
    11311140      mS=0;
    11321141      n-=dS;
    1133            }
     1142    }
    11341143    else if (n==dS)
    1135           {
     1144    {
    11361145      mS=2;
    11371146      n=2;
    1138            }
     1147    }
    11391148    else
    11401149    {
     
    11561165    G4int ab=abs(b);
    11571166    if(ab>=2 && n>=6)                            // Multi-Baryonium (NuclearFragment)
    1158            {
     1167    {
    11591168      G4int mI=nU-nAU-nD+nAD;
    11601169      //if     (abs(mI)>3||mS>3||(b>0&&s<-1)||(b<0&&s>1)) return  0;
     
    11651174                           || (b < 0 && s > 0)) return GetZNSPDGCode();
    11661175      else if(mU>=mS&&mD>=mS&&mU+mD+mS==3*b)     // Possible Unary Nuclear Cluster
    1167              {
     1176      {
    11681177        G4int mZ=(mU+mD-mS-mS+3*mI)/6;
    11691178        p = 90000000+1000*(1000*mS+mZ)+mZ-mI;
    11701179        if(b>0) return  p;
    11711180        else    return -p;
    1172              }
     1181      }
    11731182      else return 10;
    1174            }
     1183    }
    11751184    // Normal One Baryon States: Heavy quark should come first
    11761185    if(n>5) return GetZNSPDGCode();            //B+M+M Tripolino etc
    11771186    if(n==5) return 10;                        //B+M Chipolino
    11781187    if(mS>0)                                   // Strange Baryons
    1179            {
     1188    {
    11801189      p=3002;
    11811190      if      (mS==3)            p+=332;       // Decuplet
     
    11851194        else if (mU==0 && mD==1) p+=310;
    11861195        else
    1187                       {
     1196        {
    11881197#ifdef debug
    11891198          G4cout<<"**G4QC::SPDG:ExoticBSS,U="<<mU<<",D="<<mD<<",S="<<mS<<GetThis()<<G4endl;
     
    11911200          return GetZNSPDGCode();
    11921201        }
    1193              }
     1202      }
    11941203      else if (mS==1)
    11951204      {
     
    12041213          return GetZNSPDGCode();
    12051214        }
    1206              }
     1215      }
    12071216      else                                     // Superstrange case
    12081217      {
     
    12121221        return GetZNSPDGCode();
    12131222      }
    1214            }
     1223    }
    12151224    else if (mU>0)                               // Not Strange Baryons
    1216            {
     1225    {
    12171226      p=2002;
    12181227      if      (mU==3 && mD==0) p+=222;           // Decuplet
     
    12261235        return GetZNSPDGCode();
    12271236      }
    1228            }
     1237    }
    12291238    else if (mD==3) p=1114;                      // Decuplet
    12301239    else
     
    12341243#endif
    12351244      return GetZNSPDGCode();
    1236            }
     1245    }
    12371246    if (b<0) p=-p;
    12381247  }
     
    12481257#endif
    12491258      return 0;
    1250            }
     1259    }
    12511260    if(n==4) return 10;                          // M+M Chipolino
    12521261    if(abs(s)>1)
    1253            {
     1262    {
    12541263#ifdef debug
    12551264      G4cout<<"**G4QC::SPDG:Stran="<<s<<",QC="<<GetThis()<<" - Superstrange Meson"<<G4endl;
    12561265#endif
    12571266      return 0;
    1258            }
     1267    }
    12591268    // Heavy quark should come first
    12601269    if(mS>0)                                     // Strange Mesons
    1261            {
     1270    {
    12621271      p=301;
    12631272      if      (mS==2)
     
    12761285        return 0;
    12771286      }
    1278            }
     1287    }
    12791288    else if (mU>0)                               // Isotopic Mesons
    1280            {
     1289    {
    12811290      p=201;
    12821291      //if      (mU==2 && mD==0) p=221; // Performance problems
     
    12841293      else if (mU==1 && mD==1) p+=10;
    12851294      else
    1286              {
     1295      {
    12871296#ifdef debug
    12881297        G4cout<<"*G4QC::SPDG:ExMU U="<<mU<<",D="<<mD<<",S="<<mS<<",QC="<<GetThis()<<G4endl;
     
    12901299        return 0;
    12911300      }
    1292            }
     1301    }
    12931302    else if (mD==2) p=111;
    12941303    else
     
    13301339    if (j<=0) return 0;
    13311340    if(mD>1||j>1) for (int i=1; i<=mD; i++)
    1332            {
     1341    {
    13331342      if(!j) return 0;
    13341343      c*=j/i;
    13351344      j--;
    13361345    }
    1337   };
     1346  }
    13381347  if(mU>0)
    13391348  {
     
    13411350    if (j<=0) return 0;
    13421351    if(mU>1||j>1) for (int i=1; i<=mU; i++)
    1343            {
     1352    {
    13441353      if(!j) return 0;
    13451354      c*=j/i;
    13461355      j--;
    13471356    }
    1348   };
     1357  }
    13491358  if(mS>0)
    13501359  {
     
    13521361    if (j<=0) return 0;
    13531362    if(mS>1||j>1) for (int i=1; i<=mS; i++)
    1354            {
     1363    {
    13551364      if(!j) return 0;
    13561365      c*=j/i;
    13571366      j--;
    13581367    }
    1359   };
     1368  }
    13601369  if(mAD>0)
    13611370  {
     
    13631372    if (j<=0) return 0;
    13641373    if(mAD>1||j>1) for (int i=1; i<=mAD; i++)
    1365            {
     1374    {
    13661375      if(!j) return 0;
    13671376      c*=j/i;
    13681377      j--;
    13691378    }
    1370   };
     1379  }
    13711380  if(mAU>0)
    13721381  {
     
    13741383    if (j<=0) return 0;
    13751384    if(mAU>1||j>1) for (int i=1; i<=mAU; i++)
    1376            {
     1385    {
    13771386      if(!j) return 0;
    13781387      c*=j/i;
    13791388      j--;
    13801389    }
    1381   };
     1390  }
    13821391  if(mAS>0)
    13831392  {
     
    13851394    if (j<=0) return 0;
    13861395    if(mAS>1||j>1) for (int i=1; i<=mAS; i++)
    1387            {
     1396    {
    13881397      if(!j) return 0;
    13891398      c*=j/i;
    13901399      j--;
    13911400    }
    1392   };
    1393  
     1401  }
    13941402  return c;
    13951403}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QDecayChan.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QDecayChan.cc,v 1.27 2006/11/27 10:44:54 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QDecayChan.cc,v 1.28 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QDecayChan ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Decay Channels of Hadrons in CHIPS Model
     33// -------------------------------------------------------------------
     34// Short description: In the CHIPS World the particles (G4QParticle)
     35// are defined. For unstable particles there is a G4QDecayChannelVector
     36// which describes different channels of decay for the particular
     37// particle. So the G4QDecayChannel class is the class for the description
     38// of such a decay channel in two or three particles (the secondaries can
     39// be unstable too and have firther decay).
    3340// -------------------------------------------------------------------
    3441 
     
    5865  }
    5966#ifdef debug
    60   cout<<"G4QDecayChan is defined with pL="<<pLev<<",1="<<PDG1<<",2="<<PDG2<<",3="<<PDG3
    61       <<",m1="<<firstPDG->GetMass()<<",m2="<<secondPDG->GetMass()<<",minM="<<theMinMass<<endl;
     67  G4cout<<"G4QDecayChan is defined with pL="<<pLev<<",1="<<PDG1<<",2="<<PDG2<<",3="<<PDG3
     68      <<",m1="<<firstPDG->GetMass()<<",m2="<<secondPDG->GetMass()<<",minM="<<theMinMass<<G4endl;
    6269#endif
    6370}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QEnvironment.cc

    r1007 r1055  
    2828//
    2929//
    30 // $Id: G4QEnvironment.cc,v 1.137 2008/03/31 20:30:00 dennis Exp $
    31 // GEANT4 tag $Name: geant4-09-02 $
     30// $Id: G4QEnvironment.cc,v 1.144 2009/05/26 14:40:20 mkossov Exp $
     31// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3232//
    3333//      ---------------- G4QEnvironment ----------------
     
    3535//  class for Multy Quasmon Environment used by the CHIPS Model
    3636// ------------------------------------------------------------
     37// Short description: The G4QEnvironment class corresponds to the nuclear
     38// environment,  containing excited nucleons or nuclear clusters
     39// (G4Quasmons). In the constructer the nucleus (G4QNucleus) is clusterized
     40// and then the projectile hadron (or hadrons) can create one (or a few)
     41// Quasmons, which are fragmented by the Fragment member function. As a
     42// result a vector of G4QHadrons is created, which can include the residual
     43// nucleus in the ground state.
     44//---------------------------------------------------------------------
    3745 
    3846//#define debug
     
    6674  tot4Mom=G4LorentzVector(0.,0.,0.,envM);
    6775#ifdef debug
    68                 G4cout<<"G4QEnviron::Const: t4M="<<tot4Mom<<",tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
     76  G4cout<<"G4QEnviron::Const: t4M="<<tot4Mom<<",tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
    6977#endif
    7078}
     
    8896    //throw G4QException("***G4QEnvironment: There is no one projectile or vacuum target");
    8997    if(nHadrons)                             // The projectiles are copied to the output
    90            {
     98    {
    9199      for(G4int ih=0; ih<nHadrons; ih++)
    92100      {
     
    99107        theProjectiles.push_back(curQH);      // Remenber it for the error message
    100108      }
    101            }
     109    }
    102110    else if(targPDG!=90000000)               // No projHadrons,fill targetNucleus to output
    103111    {
     
    165173#endif
    166174    if(nHadrons==1)
    167            {
     175    {
    168176      G4QHadron* opHad=projHadrons[0];
    169177      G4int opPDG=opHad->GetPDGCode();
     
    172180#endif
    173181      if(opPDG==22)                           // *** Check photon's NuclearSplitThreshold
    174              {
     182      {
    175183        G4double exMass=tot4Mom.m();
    176184#ifdef pdebug
     
    178186#endif     
    179187        if(exMass<targM+135.977) // Nucleus is below the pion production threshold
    180                {
     188        {
    181189          G4QNucleus exEnviron(tot4Mom,targPDG);
    182190          // @@ One can put here the pbpt= (M.K.) @@ What about d,t,alpha splitting?
    183191          if(targM>999.&&!exEnviron.SplitBaryon())//Nucleus is below SplitFragmentThreshold
    184                         {
     192          {
    185193#ifdef pdebug
    186194            G4cout<<"G4QEnv::Const:Photon's added to Output, Env="<<theEnvironment<<G4endl;
     
    192200            theQHadrons.push_back(photon);      // (delete equivalent)
    193201            return;
    194                         }
     202          }
    195203          else if(targM<=999.)                  // Target is a nucleon
    196                  {
     204          {
    197205            G4LorentzVector prot4m(0.,0.,0.,targM); // Prototype of secondary proton 4mom
    198206            G4LorentzVector gam4m(0.,0.,0.,0.);     // Prototype for secondary gamma 4mom
     
    222230      }
    223231      else if(opPDG==13 || opPDG==15)
    224              {
     232      {
    225233        G4int         nuPDG=14;
    226234        if(opPDG==15) nuPDG=16;
    227                       G4LorentzVector mu4m=opHad->Get4Momentum();
     235        G4LorentzVector mu4m=opHad->Get4Momentum();
    228236        //G4double qpen=-180.*log(G4UniformRand()); // Energy of target-quark-parton(T=180)
    229237        G4double qpen=465.*sqrt(sqrt(G4UniformRand())); // UniformDistr for 3-q nucleon
     
    268276          G4cout<<"--G4QEnv::Const:M="<<tm<<",GSM=="<<fnm<<G4endl;
    269277#endif
    270                       }
    271                       fnN.Set4Momentum(fn4m);
     278        }
     279        fnN.Set4Momentum(fn4m);
    272280        // (mu,q->nu,q) reaction succeded and Neutrino can be pushed to Output
    273281        G4QHadron* neutrino = 0;              // NeutrinoPrototype to be filled to Output
     
    276284#endif     
    277285        if(tm<fnm)                            // Final Nucleus is below the GS threshold
    278                       {
     286        {
    279287          qf4m=G4LorentzVector(0.,0.,0.,fnm); // Final nucleus 4M for the final decay
    280288          qt4m=tg4m+mu4m;
     
    303311        theQHadrons.push_back(neutrino);      // (delete equivalent)
    304312        if(tm<fnm+135.98)                     // FinalNucleus is below thePionThreshold(HE)
    305                {
     313        {
    306314          if(!fnN.SplitBaryon()) // Final Nucleus is below the splittingFragmentThreshold
    307                         {
     315          {
    308316#ifdef mudebug
    309317            G4cout<<"G4QEnv::Const: impossible to split nucleon after mu->nu"<<G4endl;
     
    331339            theEnvironment.InitByPDG(90000000);// Create nuclear environment
    332340            return;
    333                                                                                 }
    334                }
     341          }
     342        }
    335343        // At this poin it is possible to convert mu- to pi-
    336344        fn4m=qf4m-qi4m;
     
    351359#endif
    352360      if(!hNFrag&&ch4M.e()>0.)                // => "Final hadron" case
    353              {
     361      {
    354362        G4int envPDG=theEnvironment.GetPDG();
    355363        if(envPDG==90000000||(theEnvironment.Get4Momentum().m2())<1.) // ==>"Vacuum"
     
    367375            G4int hQ = curHadr->GetQCode();  // One more check for valid of the QHadron
    368376            if(hQ<0)
    369                    {
     377            {
    370378              //G4cerr<<"--Warning--G4QEnv::Constructor:Q<0, PDG=("<<ih<<")"<<hPDG<<G4endl;
    371379              //throw G4QException("***G4QEnvironment::Constructor:theInputHadron is bad");
    372                    }
     380            }
    373381            else
    374382            {
     
    393401        }
    394402        else                                  // Nuclear Environment still exists
    395                       {
     403        {
    396404          G4QContent      hQC   = curHadr->GetQC();
    397405#ifdef pdebug
     
    400408#endif
    401409          CreateQuasmon(hQC, ch4M,fake);
    402                       } // End of Existing Nuclear Environment case
    403              } // End of final hadron case
     410        } // End of Existing Nuclear Environment case
     411      } // End of final hadron case
    404412    } // End of the LOOP over input hadrons
    405413  } // End of nuclear target case (including neutron=90000001 & proton=90001000)
     
    419427      G4int hQ = curHadr->GetQCode();         // One more check for valid of the QHadron
    420428      if(hQ<0)
    421              {
     429      {
    422430        G4cout<<"---Warning---G4QEnviron::Constructor:Vacuum,Q<0, 1st HPDG="<<hPDG<<G4endl;
    423431        //throw G4QException("***G4QEnvironment::Constructor:theFirstInputHadron's wrong");
    424              }
     432      }
    425433      else                                // Now we can get 4Mom &  QC of incedent particle
    426434      {
     
    431439        G4int           tQ    = tQPDG.GetQCode();
    432440        if(tQ<0||targPDG==10)
    433                       {
     441        {
    434442          G4cout<<"---Warning---G4QEnv::Constructor:TrgQC<0, Chipo?,PDG="<<targPDG<<G4endl;
    435443          //throw G4QException("***G4QEnvironment::Constructor: Target is wrong");
    436                       }
     444        }
    437445        else                                 // Now we can create a unique Quasmon
    438                       {
     446        {
    439447          h4Mom+=G4LorentzVector(0.,0.,0.,tQPDG.GetMass()); //Projectile + TargetHadron
    440448          hQC+=tQPDG.GetQuarkContent();
     
    444452          G4Quasmon* curQuasmon = new G4Quasmon(hQC, h4Mom);
    445453          theQuasmons.push_back(curQuasmon); // Insert Quasmon or hadron/gamma (del. eq.)
    446                       }
     454        }
    447455      } // End of Q-Code check
    448456    } // End of proper PDG for i-th Hadron
    449457    if(nHadrons>1) for(G4int ih=0; ih<nHadrons; ih++) // fill other Hadrons to Output
    450            {
     458    {
    451459      G4QHadron* newHadr = new G4QHadron(curHadr);
    452460#ifdef pdebug
     
    454462#endif
    455463      theQHadrons.push_back(newHadr);        // Fill existing hadron (delete equivalent)
    456            }
     464    }
    457465  } // End of Unique Hadron target treatment
    458466#ifdef chdebug
     
    684692{//=======================================================================================
    685693  static const G4double third=1./3.;
    686   //static const G4double mNeut= G4QPDGCode(2112).GetMass();
    687   //static const G4double mProt= G4QPDGCode(2212).GetMass();
     694  static const G4double mNeut= G4QPDGCode(2112).GetMass();
     695  static const G4double mNeu2 = mNeut*mNeut;
     696  static const G4double mProt= G4QPDGCode(2212).GetMass();
     697  static const G4double mPro2 = mProt*mProt;
    688698  //static const G4double mLamb= G4QPDGCode(3122).GetMass();
    689699  static const G4double mPi  = G4QPDGCode(211).GetMass();
     
    704714  G4LorentzVector proj4M=pro4M;             // Fake equivalence to avoid & const
    705715  G4double  projE=proj4M.e();               // energy of the projectile
    706   G4int projPDG=projQC.GetSPDGCode();     // Minimum hadron for the projectile QC
     716  G4int projPDG=projQC.GetSPDGCode();       // Minimum hadron for the projectile QC
    707717  if(projE<0.)
    708718  {
     
    712722  }
    713723  G4double  projM2=proj4M.m2();             // projectile's squared mass (print & v.gamma)
     724  G4bool Pr1 = theProjectiles.size() == 1;  // A#ofHadronsInTheInputVector = 1 condition
     725  if(Pr1 && std::fabs(G4QPDGCode(projPDG).GetMass2()-projM2) > .1 ) Pr1=false; // MassShell
    714726  G4int     targPDG=theEnvironment.GetPDG();// PDG Code of the target nucleus
    715727  if(targPDG>80000000&&targPDG!=90000000&&(theEnvironment.Get4Momentum().m2())>1.)//Nucleus
     
    730742    else if(nCl<9) nBarClust=2;
    731743    else
    732            {
     744    {
    733745      G4int v=nCl-9;
    734746      G4int d=v/15;
     
    738750    }
    739751#ifdef pdebug
    740            G4cout<<"G4QE::CrQ:TNuc:Z="<<envZ<<",N="<<envN<<",nC="<<nBarClust<<",tC="
     752    G4cout<<"G4QE::CrQ:TNuc:Z="<<envZ<<",N="<<envN<<",nC="<<nBarClust<<",tC="
    741753          <<totCharge<<", tB="<<totBaryoN<<G4endl;
    742754#endif
     
    751763    nBarClust=theEnvironment.UpdateClusters(din); // Cluster Probabilities upto maxClust
    752764#ifdef pdebug
    753            G4cout<<"G4QEnv::CreateQ: Nucleus("<<targPDG<<") is created ("<<nBarClust<<" clast's)";
     765    G4cout<<"G4QEnv::CreateQ: Nucleus("<<targPDG<<") is created ("<<nBarClust<<" clast's)";
    754766    for(G4int ic=0;ic<nBarClust;ic++)
    755767      G4cout<<" #"<<ic<<"("<<theEnvironment.GetProbability(ic)<<")";
     
    759771    G4QNucleus memEnviron=theEnvironment;
    760772#ifdef pdebug
    761            G4cout<<"G4QE::CrQ:ClusterProbabCalculation tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
     773    G4cout<<"G4QE::CrQ:ClusterProbabCalculation tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
    762774#endif
    763775    G4bool efFlag=false;                    // EnergyFlowFlag=FALSE (@@=DEFOLT=@@ make par)
     
    767779    G4LorentzVector ef4Mom(0.,0.,0.,0.);    // Summed 4-momentum of Energy Flux
    768780    G4double proj3M=proj4M.rho();
    769     //   ---   Pbar     ---    Nbar  -------  LAMBDAbar  ----  SIGMA-bar  ---  SIGMA0bar
     781    // --- P-antibar ---  N-antibar  -- LAMBDA-antibar - SIGMA-antibar - SIGMA0-antibar
    770782    if((projPDG==-2212||projPDG==-2112||projPDG==-3122||projPDG==-3112||projPDG==-3212||
    771783        projPDG==-3222) && envBN>1 && proj3M<10.) // OnlyForAtRestReactions(@@to Interface)
    772            //  ^^^^^  SIGMA+bar
    773            {
     784    // ^ SIGMA+ antibar
     785    {
    774786      // @@ Annihilation on one baryon is implemented (no annihilation on clusters! @@?) @@
    775787#ifdef pdebug
     
    787799        targNPDG = 90000001;
    788800        targQC   = neutQC;
    789              }
     801      }
    790802      else
    791                                                 //     if(rnd<=zpn)                      // Proton is a Periferal Target
     803      //     if(rnd<=zpn)                      // Proton is a Periferal Target
    792804      {
    793805        targNPDG = 90001000;
    794806        targQC   = protQC;
    795              }
     807      }
    796808      //else                                  // Deuteron as a Periferal Target
    797809      //{
    798810      //  targNPDG = 90001001;
    799811      //  targQC   = deutQC;
    800              //}
     812      //}
    801813      //else                                  // Lambda is a Periferal Target (?)
    802814      //{
    803815      //  targNPDG = 91000000;
    804816      //  targQC   = lambQC;
    805              //}
     817      //}
    806818      theEnvironment.Reduce(targNPDG);      // Subtract periferal baryon from Nucleus
    807819#ifdef pdebug
     
    832844      G4Quasmon::OpenElectromagneticDecays();  // Parameter for multihadronFragmentatation^
    833845#ifdef pdebug
    834              G4cout<<"G4QE::CrQ:>>AnnihilationIsDone,C="<<totCharge<<",B="<<totBaryoN<<G4endl;// ^
     846      G4cout<<"G4QE::CrQ:>>AnnihilationIsDone,C="<<totCharge<<",B="<<totBaryoN<<G4endl;// ^
    835847#endif
    836848      delete pan;                              // The N-NbarQuasmon is deleted A.S.A.P.   ^
     
    842854      G4double ra=std::pow(G4double(totBaryoN),third);  //                              ^ ^
    843855#ifdef pdebug
    844              G4cout<<"G4QE::CQ:N="<<tNH<<",T="<<totCharge<<","<<totBaryoN<<",A="<<ra<<G4endl;//^ ^
     856      G4cout<<"G4QE::CQ:N="<<tNH<<",T="<<totCharge<<","<<totBaryoN<<",A="<<ra<<G4endl;//^ ^
    845857#endif
    846858      for (G4int ind=0; ind<tNH; ind++)        // Loop over annihilation  QHadrons      ^ ^
     
    855867        G4double        shMOM= sh4m.rho();              // Momentum of the projectile   ^ ^
    856868#ifdef pdebug
    857                       G4cout<<"G4QE::CrQ:"<<ind<<","<<shDFL<<",PDG="<<shPDG<<",4M="<<sh4m<<G4endl; // ^ ^
     869        G4cout<<"G4QE::CrQ:"<<ind<<","<<shDFL<<",PDG="<<shPDG<<",4M="<<sh4m<<G4endl; // ^ ^
    858870#endif
    859871        G4double solAnCut=SolidAngle;                   // Proto ChargeDependantSolAngle^ ^
     
    867879        //G4double solAnCut=SolidAngle+20*shCHG*sqrt(1.*envZ)/shMOM;//ChargeDepSolAngle ^ ^
    868880#ifdef pdebug
    869                       G4cout<<"G4QE::CrQ: PDG="<<shPDG<<", p="<<shMOM<<", r="<<ra<<G4endl; //         ^ ^
     881        G4cout<<"G4QE::CrQ: PDG="<<shPDG<<", p="<<shMOM<<", r="<<ra<<G4endl; //         ^ ^
    870882#endif
    871883        if(!shDFL)                                      // Final(notDecayed) hadrons    ^ ^
    872                       {
    873 #ifdef pdebug
    874                         G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<G4endl; // ^ ^
    875 #endif
    876                         //if((dir.dot(shDIR)>solAnCut||shMOM<120.) && abs(shPDG)>99) // Absorb mesons ^ ^
    877                         if(dir.dot(shDIR)>solAnCut && abs(shPDG)>99) // Absorb mesons                 ^ ^
    878                         {
    879 #ifdef pdebug
    880                                                                                                 G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<", P="// ^ ^
    881                                                                                                                                                 <<shMOM<<" < 120"<<G4endl;                           //               ^ ^
     884        {
     885#ifdef pdebug
     886          G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<G4endl; // ^ ^
     887#endif
     888          //if((dir.dot(shDIR)>solAnCut||shMOM<120.) && abs(shPDG)>99) // Absorb mesons ^ ^
     889          if(dir.dot(shDIR)>solAnCut && abs(shPDG)>99) // Absorb mesons                 ^ ^
     890          {
     891#ifdef pdebug
     892            G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<", P="// ^ ^
     893                  <<shMOM<<" < 120"<<G4endl;                           //               ^ ^
    882894#endif
    883895            if(efFlag)                           // => Case of "Energy Flux approach"   ^ ^
    884                           {
     896            {
    885897              G4QContent shQC = curHadr->GetQC();// QuarkContent of the Current Hadron  ^ ^
    886898              ef4Mom+=sh4m;
     
    890902              G4int hPDG=curHadr->GetPDGCode();    // Only for gebug printing           ^ ^
    891903              G4LorentzVector h4M = curHadr->Get4Momentum();  // Only for gebug printing^ ^
    892                                    G4cout<<"G4QE::CrQ:#"<<efCounter<<", PDG="<<hPDG<<", h4M="<<h4M<<G4endl;//^ ^
    893 #endif
    894                           }
    895                           else                                   //=>"MultyQuasFragmentation"(!efFlag)^ ^
    896                           {
     904              G4cout<<"G4QE::CrQ:#"<<efCounter<<", PDG="<<hPDG<<", h4M="<<h4M<<G4endl;//^ ^
     905#endif
     906            }
     907            else                                   //=>"MultyQuasFragmentation"(!efFlag)^ ^
     908            {
    897909              G4QHadron* mqHadron = new G4QHadron(curHadr);
    898910              input.push_back(mqHadron);           // Fill hadron-copy (del equiv)  <...^ ^
     
    900912              G4int hPDG=curHadr->GetPDGCode();    // Only for debug printing           ^ ^
    901913              G4LorentzVector h4M = curHadr->Get4Momentum(); // Only for gebug printing ^ ^
    902                             G4cout<<"G4QE::CrQ:Absorb#"<<ind<<", PDG="<<hPDG<<", h4M="<<h4M<<G4endl;//^ ^
    903 #endif
    904                           }                                      //                                   ^ ^
    905                         }                                        //                                   ^ ^
    906                         else                                     // DirectFilling of the output vector^ ^
    907                         {                                        //                                   ^ ^
     914              G4cout<<"G4QE::CrQ:Absorb#"<<ind<<", PDG="<<hPDG<<", h4M="<<h4M<<G4endl;//^ ^
     915#endif
     916            }                                      //                                   ^ ^
     917          }                                        //                                   ^ ^
     918          else                                     // DirectFilling of the output vector^ ^
     919          {                                        //                                   ^ ^
    908920#ifdef pdebug
    909921            G4int hPDG=curHadr->GetPDGCode();      // Only for gebug printing           ^ ^
    910922            G4LorentzVector h4M = curHadr->Get4Momentum(); // Only for gebug printing   ^ ^
    911                           G4cout<<"G4QE::CrQ: Fill OUT #"<<ind<<",PDG="<<hPDG<<",h4M="<<h4M<<G4endl;//^ ^
     923            G4cout<<"G4QE::CrQ: Fill OUT #"<<ind<<",PDG="<<hPDG<<",h4M="<<h4M<<G4endl;//^ ^
    912924#endif
    913925            // Just fill a hadron to the output stack (One should make EM decays elsewhere)
     
    915927            theQHadrons.push_back(curHadron);      // TheQHadrs are filled as new Hadrs ^ ^
    916928          }
    917                       } // End of the IF over projectiles                                             ^ ^
    918              } // End of LOOP over "output" of annihilation                                    ^ ^
     929        } // End of the IF over projectiles                                             ^ ^
     930      } // End of LOOP over "output" of annihilation                                    ^ ^
    919931      for_each(output->begin(), output->end(), DeleteQHadron());     //DESTRUCT output>-^-^
    920932      output->clear();                             //                                   ^ ^
    921933      delete output;                               // ==================================^=^
    922934      if(!efFlag)                                  // =>NotEnergyFlux=MultyQuasmon Case ^
    923              {
     935      {
    924936        G4int noh = theQHadrons.size();            // a#oh hadrons in Output UpToNow    ^
    925937        if(noh) for(G4int kh=0; kh<noh; kh++)      // One can escape it but...          ^
    926                                                                 {                                          //                                   ^
     938        {                                          //                                   ^
    927939#ifdef pdebug
    928940          G4cout<<"G4QE::CreateQ:H#"<<kh<<", QC="<<theQHadrons[kh]->GetQC() //          ^
     
    935947          tmpQHadVec->clear();                     //                                 ^ ^
    936948          delete tmpQHadVec;           // who calls DecayQHadron must clear & delete  ^ ^
    937                       }                                          //                                 ^ ^
     949        }                                          //                                 ^ ^
    938950        theQHadrons.clear(); // deletedWhenDecayed // Now theQHadrons is EmptyVector->^ ^
    939951#ifdef pdebug
    940952        G4int nInH=intQHadrons.size();             // Resulting #of hadrons after decay ^
    941                G4cout<<"G4QE::CrQ:nH="<<nInH<<",C="<<totCharge<<",B="<<totBaryoN<<G4endl;//    ^
     953        G4cout<<"G4QE::CrQ:nH="<<nInH<<",C="<<totCharge<<",B="<<totBaryoN<<G4endl;//    ^
    942954#endif
    943955        if(!(input.size()))                        // *RETURN* Without Quasmon creation-^
    944                       {                                          //                                   ^
    945 #ifdef pdebug
    946                  G4cout<<"*G4QEnv::CrQ:AnnihStack tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^
    947 #endif
    948                         return;                                  // Do not clear and delete objects --^
     956        {                                          //                                   ^
     957#ifdef pdebug
     958          G4cout<<"*G4QEnv::CrQ:AnnihStack tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^
     959#endif
     960          return;                                  // Do not clear and delete objects --^
    949961        }                                          //                                   ^
    950962#ifdef pdebug
    951                G4cout<<"G4QE::CrQ:fakeQ, restPars tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^
     963        G4cout<<"G4QE::CrQ:fakeQ, restPars tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^
    952964#endif
    953965        G4Quasmon::SetParameters(QTemper,QSOverU,QEtaSup);//RecoverQParam's after anihil^
     
    956968        G4QEnvironment* muq = new G4QEnvironment(input,theEnvironment.GetPDG());//<--+  ^
    957969#ifdef pdebug
    958                G4cout<<"G4QE::CrQ:befCl&Dest tC="<<totCharge<<", tB="<<totBaryoN<<G4endl; //^  ^
     970        G4cout<<"G4QE::CrQ:befCl&Dest tC="<<totCharge<<", tB="<<totBaryoN<<G4endl; //^  ^
    959971#endif
    960972        for_each(input.begin(), input.end(), DeleteQHadron());     //DESTROING inp >-^--^
     
    969981#endif
    970982        if(noh) for(G4int nh=0; nh<noh; nh++)      // One can escape it but...          ^ ^
    971                                                                 {                                          //                                   ^ ^
     983        {                                          //                                   ^ ^
    972984#ifdef pdebug
    973985          G4cout<<"G4QE::CreateQ: NotIntQH#"<<nh<<", QC="<<(*outH)[nh]->GetQC()  //     ^ ^
     
    980992          tmpQHadVec->clear();                     //                                 ^ ^ ^
    981993          delete tmpQHadVec;           // who calls DecayQHadron must clear & delete->+ ^ ^
    982                       }                                          //                                   ^ ^
     994        }                                          //                                   ^ ^
    983995        outH->clear();                             //                                   ^ ^
    984996        delete outH;                               // >---->---->---->---->---->---->---^-+
    985                G4int nMQ = outQ->size();                  // A#ofQuasmons in MultyQuasmonOutput^
     997        G4int nMQ = outQ->size();                  // A#ofQuasmons in MultyQuasmonOutput^
    986998#ifdef pdebug
    987999        G4LorentzVector eLorV=theEnvironment.Get4Momentum(); //                         ^
    988                G4cout<<"G4QE::CrQ:nMQ="<<nMQ<<",tC="<<totCharge<<", tB="<<totBaryoN<<G4endl;// ^
    989                G4cout<<"G4QE::CrQ:Env4M="<<eLorV<<G4endl; //                                   ^
     1000        G4cout<<"G4QE::CrQ:nMQ="<<nMQ<<",tC="<<totCharge<<", tB="<<totBaryoN<<G4endl;// ^
     1001        G4cout<<"G4QE::CrQ:Env4M="<<eLorV<<G4endl; //                                   ^
    9901002        G4LorentzVector contr4M=eLorV; //                                               ^
    9911003#endif
    9921004        if(nMQ) for(G4int mh=0; mh<nMQ; mh++)      // Can escape CreationDistruct but...^
    993                                                                 {                                          //                                   ^
     1005        {                                          //                                   ^
    9941006          G4Quasmon* curQ = new G4Quasmon((*outQ)[mh]);// Copy to destroy TMP(?)        ^
    9951007#ifdef pdebug
    9961008          G4LorentzVector qLorV=curQ->Get4Momentum(); //                                ^
    997                  G4cout<<"G4QE::CrQ:Q#"<<mh<<",4M="<<qLorV<<curQ->GetQC()<<G4endl; //          ^
     1009          G4cout<<"G4QE::CrQ:Q#"<<mh<<",4M="<<qLorV<<curQ->GetQC()<<G4endl; //          ^
    9981010          contr4M+=qLorV; //                                                            ^
    9991011#endif
    10001012          theQuasmons.push_back(curQ);             // Fill QuasmonCopies in theQuasmons ^
    1001                }                                          //                                   ^
     1013        }                                          //                                   ^
    10021014        for_each(outQ->begin(), outQ->end(), DeleteQuasmon()); // >---------------------^
    10031015        outQ->clear();                             //                                   ^
     
    10051017#ifdef pdebug
    10061018        G4int nsHadr  = theQHadrons.size();      // Update the value of OUTPUT entries
    1007                G4cout<<"G4QEnvironment::CreateQ: before return nH="<<nsHadr<<G4endl;
     1019        G4cout<<"G4QEnvironment::CreateQ: before return nH="<<nsHadr<<G4endl;
    10081020        if(nsHadr) for(G4int jso=0; jso<nsHadr; jso++)// LOOP over output hadrons
    10091021        {
    10101022          G4int hsNF  = theQHadrons[jso]->GetNFragments(); // A#of secondary fragments
    10111023          if(!hsNF)                                        // Add only final hadrons
    1012                                                                                 {
     1024          {
    10131025            G4LorentzVector hLorV=theQHadrons[jso]->Get4Momentum();
    10141026            G4int           hPDGC=theQHadrons[jso]->GetPDGCode();
    1015                         G4cout<<"G4QE::CrQ: H#"<<jso<<",4M="<<hLorV<<hPDGC<<G4endl;
     1027            G4cout<<"G4QE::CrQ: H#"<<jso<<",4M="<<hLorV<<hPDGC<<G4endl;
    10161028            contr4M+=hLorV;
    10171029          }
     
    10191031            G4cout<<"G4Q::CrQ:"<<jso<<"NF=0,4M="<<theQHadrons[jso]->Get4Momentum()<<G4endl;
    10201032        }
    1021                G4cout<<"G4QEnvironment::CreateQ: before return tot4M="<<contr4M<<G4endl;
     1033        G4cout<<"G4QEnvironment::CreateQ: before return tot4M="<<contr4M<<G4endl;
    10221034#endif
    10231035        return;                                    // *** RETURN ***
    10241036      }
    10251037      else                                         // ==> Energy Flux case
    1026              {
     1038      {
    10271039        if (!efCounter) return;                    // ***RETURN*** Without Quasmon creation
    1028              }
    1029            }                                              // End of Hyperon annihilation case
     1040      }
     1041    }                                              // End of Hyperon annihilation case
    10301042    else EnFlQC=projQC;                            // For notAntiBar, don't use EnergyFlux
    10311043    G4double EnFlP=ef4Mom.rho();                   // Mom. of EnergyFlow forClusterCreation
     
    10331045    G4int nCandid = theQCandidates.size();
    10341046#ifdef pdebug
    1035            G4cout<<"G4QEnvironment::CrQ: InteractionProbabilities are done, nC="<<nCandid<<G4endl;
     1047    G4cout<<"G4QEnvironment::CrQ: InteractionProbabilities are done, nC="<<nCandid<<G4endl;
    10361048#endif
    10371049    G4double maxP = theQCandidates[nCandid-1]->GetIntegProbability();
     
    10391051    G4QContent    curQC;                           // Quark Content of the selected cluster
    10401052    if(nCandid<=0)
    1041            {
    1042              G4cout<<"---Warning---G4QEnv::CreaQ:nC="<<nCandid<<",maxP="<<maxP<<",E="
     1053    {
     1054      G4cout<<"---Warning---G4QEnv::CreaQ:nC="<<nCandid<<",maxP="<<maxP<<",E="
    10431055            <<theEnvironment<<G4endl;
    10441056      //throw G4QException("G4QEnvironment::CreateQ: Can not select a cluster");
    1045            }
     1057    }
    10461058    if(nCandid==1||maxP==0.)
    1047            {
    1048 #ifdef pdebug
    1049              G4cout<<"***G4QEnv::CrQ:MaxP=0||nCand=1: Use all Env., Env="<<theEnvironment<<G4endl;
     1059    {
     1060#ifdef pdebug
     1061      G4cout<<"***G4QEnv::CrQ:MaxP=0||nCand=1: Use all Env., Env="<<theEnvironment<<G4endl;
    10501062#endif
    10511063      curQC=theEnvironment.GetQCZNS();
     
    10561068      G4double totP = maxP * G4UniformRand();
    10571069#ifdef pdebug
    1058              G4cout<<"G4QEnvironment::CrQ:nC="<<nCandid<<", maxP="<<maxP<<", totP="<<totP<<G4endl;
     1070      G4cout<<"G4QEnvironment::CrQ:nC="<<nCandid<<", maxP="<<maxP<<", totP="<<totP<<G4endl;
    10591071#endif
    10601072      while(theQCandidates[i]->GetIntegProbability()<totP) i++;
     
    10641076      G4double clMass=targClust.GetGSMass();    // Mass of residual nuclear environment
    10651077#ifdef cldebug
    1066              G4cout<<"G4QEnv::CrQ:Cl#"<<i<<"(of "<<nCandid<<"),QC="<<curQC<<",M="<<clMass<<G4endl;
     1078      G4cout<<"G4QEnv::CrQ:Cl#"<<i<<"(of "<<nCandid<<"),QC="<<curQC<<",M="<<clMass<<G4endl;
    10671079#endif
    10681080      G4LorentzVector pq4M=proj4M+G4LorentzVector(0.,0.,0.,clMass);
    10691081      if(pq4M.m()>=clMass)
    1070              {
    1071 #ifdef pdebug
    1072                G4cout<<"G4QEnv::CQ:#"<<i<<"("<<targClust<<curQC<<") Env="<<theEnvironment<<G4endl;
     1082      {
     1083#ifdef pdebug
     1084        G4cout<<"G4QEnv::CQ:#"<<i<<"("<<targClust<<curQC<<") Env="<<theEnvironment<<G4endl;
    10731085#endif
    10741086        theEnvironment.Reduce(targClust.GetPDG());// Subtract selected cluster from Nucleus
    1075              }
     1087      }
    10761088      else
    1077              {
     1089      {
    10781090        G4double teMass=theEnvironment.GetGSMass(); //Mass of theResidualNuclearEnvironment
    10791091        G4LorentzVector te4M=proj4M+G4LorentzVector(0.,0.,0.,teMass);
    10801092        if(te4M.m()>=teMass)
    1081                {
    1082 #ifdef pdebug
    1083                  G4cout<<"***G4QEnv::CrQ: Deep virtual, use all Env,Env="<<theEnvironment<<G4endl;
     1093        {
     1094#ifdef pdebug
     1095          G4cout<<"***G4QEnv::CrQ: Deep virtual, use all Env,Env="<<theEnvironment<<G4endl;
    10841096#endif
    10851097          curQC=theEnvironment.GetQCZNS();
     
    10871099        }
    10881100        else
    1089                       {
     1101        {
    10901102          G4QHadron* projH = new G4QHadron(projQC,proj4M);
    10911103          theQHadrons.push_back(projH);
    1092                  G4cout<<"---Warning---G4QE::CrQ:Fill Proj asItIs QC/4m="<<projQC<<proj4M<<G4endl;
     1104          G4cout<<"---Warning---G4QE::CrQ:Fill Proj asItIs QC/4m="<<projQC<<proj4M<<G4endl;
    10931105          return;
    10941106        }
    1095              }
    1096            }
     1107      }
     1108    }
    10971109    G4double envMass=theEnvironment.GetGSMass();   // Mass of residual nuclear environment
    1098     if(projPDG==22&&projE<PiPrThresh+(M2ShiftVir+projM2)/DiNuclMass) // Gam+quark Interact
     1110    // @@ Pr1 condition (individual particle) can be taken out of brackets for all if's
     1111    if(Pr1&&projPDG==22&&projE<PiPrThresh+(M2ShiftVir+projM2)/DiNuclMass) // ==> Gamma+q
    10991112    //if(2>3)                                      //@@ TMP:PhotoAbsorbtion by q is closed
    1100            {
     1113    {
    11011114      q4Mom=G4LorentzVector(0.,0.,0.,tgMass-envMass);// PhotoInteracts with BoundedCluster
    11021115      valQ=curQC;
     
    11061119      G4Quasmon* curQuasmon = new G4Quasmon(valQ, q4Mom, proj4M);//Interaction gam+q inside
    11071120      theQuasmons.push_back(curQuasmon);  // Insert Quasmon without incid. gamma (del.eq.)
    1108            }
    1109     else if((projM2-mPi2<.00001&&projE-mPi<0.1)&&projPDG==-211&&!fake)
     1121    }
     1122    else if(Pr1&&(std::fabs(projM2-mPi2)<.00001 && projE-mPi<0.1) && projPDG==-211 &&!fake)
    11101123    //if(2>3)                                //@@ ***TMP*** PionAbsorbAtRest by q is closed
    1111            {
     1124    {
    11121125      q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass);// PION + BoundCluster
    11131126      valQ=EnFlQC+curQC;
     
    11181131      G4Quasmon* curQuasmon = new G4Quasmon(valQ, q4Mom, -proj4M);//Interact gam+q inside
    11191132      theQuasmons.push_back(curQuasmon);  // Insert Quasmon without incid. gamma (del.eq.)
    1120            }
    1121     else if(projPDG==2212 && G4UniformRand()>.5) // Bad for ions! Only for baryons !
    1122     //else if(2>3)                          // free flying proton is closed
    1123            {
    1124       q4Mom=proj4M;       // 4M: QUASMON=Projectile
    1125       valQ=EnFlQC;        // qc: QUASMON=Projectile
     1133    }
     1134    //else if(Pr1&&projPDG==2212&&G4UniformRand()<.6+.4*std::exp(-envMass/8192))// keepProj
     1135    else if(2>3)                          // free flying projectile is closed
     1136    {
     1137      q4Mom=proj4M;                       // 4M: QUASMON=Projectile
     1138      valQ=EnFlQC;                        // qc: QUASMON=Projectile
    11261139      theEnvironment=memEnviron;
     1140#ifdef pdebug
     1141      G4cout<<"G4QEnv::CreQAll: Q="<<q4Mom<<valQ<<", QEnv="<<theEnvironment<<G4endl;
     1142#endif
     1143      G4Quasmon* curQuasmon = new G4Quasmon(valQ, q4Mom);
     1144      theQuasmons.push_back(curQuasmon);  // Insert Quasmon (even hadron/gamma) (del.eq.)
     1145    }
     1146    else if(Pr1&&projPDG==2212&&G4UniformRand()>15./(proj4M.e()-mProt))//ExcitatedCluster
     1147    //else if(2>3)                          // No excitation of a cluster by projScattering
     1148    {
     1149      G4double prM=mProt;                 // mass of the projectile (M) (for future gener.)
     1150      G4double prM2=mPro2;                // squared mass of the projectile (M^2)
     1151      G4double scM=mProt;                 // mass of the scattered projectile (M')
     1152      G4double scM2=mPro2;                // squared mass of the scatteredProjectile (M'^2)
     1153      G4QContent scQC=projQC;             // QC of the scattered projectile
     1154      G4QContent chQC(0,0,0,0,0,0);       // Change of the Quasmon QC
     1155      if(G4UniformRand()<.5*envN/envBN)   // (u->u,d, d->d)? in future make it universal
     1156      {
     1157        scM=mNeut;                        // Charge exchange reaction
     1158        scM2=mNeu2;
     1159        scQC=neutQC;
     1160        chQC=projQC-scQC;                 // Charge of the created Quasmon must be changed
     1161      }
     1162      G4double tnM=tgMass-envMass;        // minimal mass of the target cluster (m)
     1163      G4double tnM2=tnM*tnM;              // squared mass of the target cluster (m^2)
     1164      G4double dtnM=tnM+tnM;              // doubled mass of the target cluster (2*m)
     1165      G4double prE=proj4M.e();            // enrgy of the projectile (E)
     1166      G4double mu2=tnM2+dtnM*(prE-scM);   // max squared mass of the excited cluster (mu^2)
     1167      //G4double mu=std::sqrt(mu2);         // max mass of the excited cluster (mu)
     1168      G4double B=.00001;                  // (parameter) slope of the diffraction cone
     1169      G4double rmu2=0.;                   // Chosen sqMass of excitedClust (Prototype)
     1170      G4double tmax=0.;                   // max -t for scattering (Prototype)
     1171      G4double rt=0.;                     // Chosen -t (Prototype)
     1172      G4double om=0.;                     // Energy of the excited cluster (Prototype)
     1173      G4double ep=0.;                     // Energy of the scattered projectile (eps Proto)
     1174      if (prE<prM)G4cout<<"-Warn-G4QEnv::CreQAll:(scat w ex)E="<<prE<<" < M="<<prM<<G4endl;
     1175      G4double Pi=std::sqrt(prE*prE-prM2); // Proj momentum (P)
     1176      G4double po=0.;                      // Scat momentum (p) (Prototype)
     1177      G4double cost=2.;                    // cos(theta) for the scattered proj (Prototype)
     1178      G4int cct=0;                         // Counter of cost attempts (@@ can be limited)
     1179      while ( std::fabs(cost) > 1. )
     1180      {
     1181        cct++;
     1182#ifdef debug
     1183        G4cout<<"-Warning-G4QEnv::CreQAll: c="<<cct<<" (scat w ex) cost="<<cost<<G4endl;
     1184#endif
     1185        rmu2=tnM2*pow(mu2/tnM2,G4UniformRand()); // Chosen SqMass of excitedClust (MMA)
     1186        tmax=mu2-rmu2;                    // max -t for scattering
     1187        rt=-std::log(1.-G4UniformRand()*(1.-std::exp(-B*tmax)))/B; // Chosem -t
     1188        om=(tnM2+rmu2+rt)/dtnM;           // Energy of the excited cluster
     1189        ep=prE+tnM-om;                    // Energy of the scattered projectile (epsilon)
     1190#ifdef pdebug
     1191        G4cout<<"G4QEnv::CreQAll: m2="<<tnM2<<" < mu2="<<rmu2<<" < "<<mu2<<"=Max2"<<G4endl;
     1192        G4cout<<"G4QEnv::CreQAll: -t="<<rt<<" < "<<tmax<<"=tmax"<<G4endl;
     1193        G4cout<<"G4QEnv::CreQAl: om="<<om<<" > m="<<tnM<<", ep="<<ep<<" > M="<<prM<<G4endl;
     1194#endif
     1195        if(ep<scM)G4cout<<"+Warn-G4QEnv::CreQAl:(scat w ex)Eo="<<prE<<" < M="<<prM<<G4endl;
     1196        po=std::sqrt(ep*ep-scM2);   // Scat momentum (p)
     1197        cost=(prE*ep-0.5*(rt+prM2+scM2))/Pi/po; // cos(theta) for the scattered
     1198      }
     1199      G4double om2=om*om;
     1200      if(om2<rmu2)G4cout<<"-Warn-G4QEnv::CreQA:(scat w ex)e2="<<om<<" < mu2="<<tnM<<G4endl;
     1201#ifdef pdebug
     1202      G4cout<<"G4QEnv::CreQAll: ct="<<cost<<",pio="<<Pi*po<<",()="<<cost*Pi*po<<G4endl;
     1203      G4double ps=std::sqrt(om2-rmu2);    // Momentum of the excited cluster (p)
     1204#endif
     1205      G4double pfc=po*cost;               // Longitudinal projection of the scattered proj
     1206      G4double pfs=po*std::sqrt(1.-cost*cost); // Transversal projection of scattered proj
     1207      // ---- @@ From here can be a MF for QF nucleon extraction (if used by others)
     1208      G4ThreeVector vdir = proj4M.vect(); // 3-Vector in the projectile direction
     1209      G4ThreeVector vx(0.,0.,1.);         // ProtoOrt in the direction of the projectile
     1210      G4ThreeVector vy(0.,1.,0.);         // First ProtoOrt orthogonal to the direction
     1211      G4ThreeVector vz(1.,0.,0.);         // Second ProtoOrt orthoganal to the direction
     1212      if(vdir.mag2() > 0.)                // the projectile isn't at rest
     1213      {
     1214        vx = vdir.unit();                 // Ort in the direction of the projectile
     1215        G4ThreeVector vv= vx.orthogonal();// Not normed orthogonal vector (!)
     1216        vy = vv.unit();                   // First ort orthogonal to the proj. direction
     1217        vz = vx.cross(vy);                // Second ort orthoganal to the proj. direction
     1218      }
     1219      // ---- @@ End of possible MF (Similar is in G4QCollision)
     1220      G4double phi=twopi*G4UniformRand(); // Phi of the Fermi-Mom
     1221      G4ThreeVector fp=pfc*vx+pfs*(std::sin(phi)*vy+std::cos(phi)*vz);
     1222      G4LorentzVector s4M(fp,ep);
     1223#ifdef pdebug
     1224      G4cout<<"G4QEnv::CreQA:ps="<<po<<"="<<fp.mag()<<",sM="<<prM<<"="<<s4M.m()<<G4endl;
     1225      G4cout<<"G4QEnv::CreQA:Ee="<<prE*ep<<" =? "<<(prM2+rt/2-Pi*po*cost)<<G4endl;
     1226#endif
     1227      if(std::fabs(s4M.m()-scM)>.001)G4cout<<"-W-G4QE::CQA:M="<<prM<<"#"<<s4M.m()<<G4endl;
     1228      G4LorentzVector c4M=proj4M+G4LorentzVector(0.,0.,0.,tnM)-s4M;
     1229#ifdef pdebug
     1230      G4cout<<"G4QEnv::CreQA: ec="<<om<<" = "<<c4M.e()<<", pc="<<ps<<" = "
     1231            <<c4M.rho()<<", mc2="<<rmu2<<" = "<<c4M.m2()<<G4endl;
     1232      G4cout<<"G4QEnv::CQA:ht="<<(tnM2+rmu2)/2-tnM*om<<"="<<prM2-prE*ep+Pi*po*cost<<G4endl;
     1233#endif
     1234      if(std::fabs(c4M.m2()-rmu2)>.1)
     1235        G4cout<<"-W-G4QE::CrQ:m2="<<rmu2<<"#"<<c4M.m2()<<",P="<<proj4M<<",M="<<tnM<<G4endl;
     1236      G4QHadron* projH = new G4QHadron(scQC,s4M); // Create scattered Projectile Hadron
     1237      theQHadrons.push_back(projH);       // Fill it to the output vector
     1238      G4Quasmon* curQuasmon = new G4Quasmon(curQC+chQC, c4M); // Q=ExcitedCluster
     1239      theQuasmons.push_back(curQuasmon); // Insert Quasmon (even hadron/gamma) (del.eq.)
     1240    }
     1241    else
     1242    {
     1243      q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass); // Projectile + BoundCluster
     1244      valQ=EnFlQC+curQC;
    11271245#ifdef pdebug
    11281246      G4cout<<"G4QEnv::CreQAll: Q="<<q4Mom<<valQ<<", QEnv="<<theEnvironment<<G4endl;
     
    11301248      G4Quasmon* curQuasmon = new G4Quasmon(valQ, q4Mom);
    11311249      theQuasmons.push_back(curQuasmon); // Insert Quasmon (even hadron/gamma) (del.eq.)
    1132            }
    1133     else
    1134            {
    1135       q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass);//Projectile + BoundCluster
    1136       valQ=EnFlQC+curQC;
    1137 #ifdef pdebug
    1138       G4cout<<"G4QEnv::CreQAll: Q="<<q4Mom<<valQ<<", QEnv="<<theEnvironment<<G4endl;
    1139 #endif
    1140       G4Quasmon* curQuasmon = new G4Quasmon(valQ, q4Mom);
    1141       theQuasmons.push_back(curQuasmon); // Insert Quasmon (even hadron/gamma) (del.eq.)
    1142            }
     1250    }
    11431251  }
    11441252  else
     
    11671275    G4int cCH  = curCand->GetCharge();             // Charge of the candidate
    11681276#ifdef sdebug
    1169            G4cout<<"G4QE::PIP:=====> #"<<index<<", cPDG="<<cPDG<<",S="<<cST<<G4endl;
     1277    G4cout<<"G4QE::PIP:=====> #"<<index<<", cPDG="<<cPDG<<",S="<<cST<<G4endl;
    11701278#endif
    11711279    if(cPDG>80000000&&cPDG!=90000000&&!cST&&cCH>0&&cBN>0&&cCH<=cBN) // ===> Nuclear cluster
    1172            {
     1280    {
    11731281      G4int zc = cCH;                              // "Z" of the cluster
    11741282      G4int nc = cBN-cCH;                          // "N" of the cluster
     
    11761284      G4double dOfCl=curCand->GetDenseProbability();// A number of clusters in dense region
    11771285#ifdef sdebug
    1178                                                 G4cout<<"G4QE::PIP:Z="<<zc<<",N="<<nc<<",nC="<<nOfCl<<",dC="<<dOfCl<<G4endl;
     1286      G4cout<<"G4QE::PIP:Z="<<zc<<",N="<<nc<<",nC="<<nOfCl<<",dC="<<dOfCl<<G4endl;
    11791287#endif
    11801288      if(cPDG==91000000||cPDG==90001000||cPDG==90000001)
    1181              {
     1289      {
    11821290        allB+=nOfCl;
    11831291        denseB+=dOfCl;
    1184              }
     1292      }
    11851293      G4QContent pQC=curCand->GetQC();             // Quark Content of the candidate
    11861294      ////////////G4int pC   = projQC.GetCharge();   // Charge of the projectile
     
    12201328      G4double charge= qQC.GetCharge();
    12211329      G4double dq= abs(baryn-charge-charge);
    1222              G4cout<<"G4QE::PIP:P="<<probab<<",ac="<<cBN<<",dq="<<dq<<",f="<<fact<<",qC="
     1330      G4cout<<"G4QE::PIP:P="<<probab<<",ac="<<cBN<<",dq="<<dq<<",f="<<fact<<",qC="
    12231331            <<qC<<",rPDG="<<rPDG<<",pPDG="<<pPDG<<",nCP="<<nOfCl<<",dCP="<<dOfCl<<G4endl;
    12241332#endif
    1225            }
     1333    }
    12261334    else probab=0.;
    12271335    sum+=probab;
     
    12431351    G4int clustQCode = i+90; // Q-code of the cluster in the CHIPS World "IsoNuclei"
    12441352#ifdef sdebug
    1245            G4cout<<"G4QEnvironment::InitClustersVector: Before Init Q ="<<clustQCode<<G4endl;
     1353    G4cout<<"G4QEnvironment::InitClustersVector: Before Init Q ="<<clustQCode<<G4endl;
    12461354#endif
    12471355    G4QPDGCode clustQPDG(true,clustQCode);
     
    12501358    G4int clustB=clustQPDG.GetBaryNum();
    12511359#ifdef sdebug
    1252            G4cout<<"G4QEnvironment::InitClustersVector: Before insert ="<<clusterPDG<<G4endl;
    1253 #endif
    1254            //theQCandidates.push_back(new G4QCandidate(clusterPDG)); // (delete equivalent)
    1255            if(clustB<=maxA) theQCandidates.push_back(new G4QCandidate(clusterPDG)); // (del.eq.)
     1360    G4cout<<"G4QEnvironment::InitClustersVector: Before insert ="<<clusterPDG<<G4endl;
     1361#endif
     1362    //theQCandidates.push_back(new G4QCandidate(clusterPDG)); // (delete equivalent)
     1363    if(clustB<=maxA) theQCandidates.push_back(new G4QCandidate(clusterPDG)); // (del.eq.)
    12561364#ifdef sdebug
    12571365    G4cout<<"G4QEnvironment::InitClustersVector: Cluster # "<<i<<" with code = "
     
    12721380  static const G4QContent SiPQC(0,2,1,0,0,0);
    12731381  static const G4QContent SiMQC(2,0,1,0,0,0);
     1382  static const G4QContent protQC(1,2,0,0,0,0);
     1383  static const G4QContent neutQC(2,1,0,0,0,0);
    12741384  //static const G4QContent alQC(6,6,0,0,0,0);
    12751385  static const G4QPDGCode nQPDG(2112);
     
    13281438    G4int nPDG = theEnvironment.GetPDG();    // PDG code of the residual Nucl.Environ.
    13291439#ifdef pdebug
    1330            G4cout<<"G4QE::HQE:***NO QUASMONS***Env="<<nPDG<<theEnvironment.Get4Momentum()<<G4endl;
     1440    G4cout<<"G4QE::HQE:***NO QUASMONS***Env="<<nPDG<<theEnvironment.Get4Momentum()<<G4endl;
    13311441#endif
    13321442    if(nPDG==90000000) return theQHadrons;
    13331443    if(nPDG>80000000)
    1334            {
     1444    {
    13351445      G4QHadron* rNucleus = new G4QHadron(theEnvironment); // Create HadronEnvironment
    13361446      theQHadrons.push_back(rNucleus);       // Fill GS - no further decay (del. equiv.)
    13371447#ifdef fdebug
    1338              G4cout<<"G4QEnv::HadrQE: >>>> Fill Environment="<<theEnvironment<<G4endl;
    1339 #endif
    1340            }
     1448      G4cout<<"G4QEnv::HadrQE: >>>> Fill Environment="<<theEnvironment<<G4endl;
     1449#endif
     1450    }
    13411451    return theQHadrons;
    13421452  }
     
    13471457    G4int totInC=0;
    13481458    G4LorentzVector totIn4M(0.,0.,0.,0.);
    1349            for (G4int is=0; is<nQuasmons; is++)     // Sum4mom's of Quasmons for the comparison
    1350            {
    1351              G4Quasmon*      pQ = theQuasmons[is];
     1459    for (G4int is=0; is<nQuasmons; is++)     // Sum4mom's of Quasmons for the comparison
     1460    {
     1461      G4Quasmon*      pQ = theQuasmons[is];
    13521462      G4LorentzVector Q4M= pQ->Get4Momentum();
    13531463      totIn4M           += Q4M;
    13541464      totInC            += pQ->GetQC().GetCharge();
    1355            } // End of TotInitial4Momentum summation LOOP over Quasmons
     1465    } // End of TotInitial4Momentum summation LOOP over Quasmons
    13561466    G4int nsHadr  = theQHadrons.size();      // Update the value of OUTPUT entries
    13571467    if(nsHadr) for(G4int jso=0; jso<nsHadr; jso++)// LOOP over output hadrons
     
    13681478    G4QNucleus vE(90000000);
    13691479    G4int     nlq = 0;                       // Prototype of a#of Living Quasmons
    1370            if(nQuasmons) for(G4int lq=0; lq<nQuasmons; lq++)if(theQuasmons[lq]->GetStatus())nlq++;
    1371            if(nQuasmons) for(G4int iq=0; iq<nQuasmons; iq++)
    1372            {
     1480    if(nQuasmons) for(G4int lq=0; lq<nQuasmons; lq++)if(theQuasmons[lq]->GetStatus())nlq++;
     1481    if(nQuasmons) for(G4int iq=0; iq<nQuasmons; iq++)
     1482    {
    13731483#ifdef chdebug
    13741484      G4int f1Charge=theEnvironment.GetCharge();
     
    14041514      G4int ist=theQuasmons[iq]->GetStatus();// Status of the Quasmon before fragmentation
    14051515      if(ist)
    1406              {
     1516      {
    14071517        G4QHadronVector* output=theQuasmons[iq]->Fragment(vE,1);//!!!DESTROY!!! <---------+
    14081518        G4int ast=theQuasmons[iq]->GetStatus();  // Quasmon's Status after fragmentation  ^
     
    14131523#endif
    14141524        if(nHadrons>0)                           // Copy QHadrons-Quasmon to Output       ^
    1415                {
    1416              for (G4int ih=0; ih<nHadrons; ih++)    // LOOP over QHadrons of the Quasmon     ^
     1525        {
     1526          for (G4int ih=0; ih<nHadrons; ih++)    // LOOP over QHadrons of the Quasmon     ^
    14171527          {
    14181528            //G4QHadron* curH=new G4QHadron(output->operator[](ih));// (Del 7 lines below)^
     
    14241534            theQHadrons.push_back(curH);         // Fill hadron-copy (delete equivalent)  ^
    14251535          }
    1426                }                                        //                                       ^
     1536        }                                        //                                       ^
    14271537        else                                     // => "Quasmon can't decay" case         ^
    1428                                                                 {                                        //                                       ^
     1538        {                                        //                                       ^
    14291539          G4QContent totQC=theQuasmons[iq]->GetQC();//                                    ^
    14301540          G4int     tQBN=totQC.GetBaryonNumber();// Baryon Number of not decayed Quasmon  ^
     
    14341544          G4double totQM=tot4M.m();              // Real Mass of Quasmon                  ^
    14351545          if(tQBN>0&&totQM>gsM)                  // => "Try Quasmon evaporation" case     ^
    1436                                                                                 {                                      //                                       ^
     1546          {                                      //                                       ^
    14371547            G4QHadron* nuclQ = new G4QHadron(totQC,tot4M); //                             ^
    14381548#ifdef fdebug
     
    14421552            theQuasmons[iq]->KillQuasmon();      // Kill evaporated Quasmon               ^
    14431553            nlq--;                               //                                       ^
    1444                         }
     1554          }
    14451555          else if(iq+1<nQuasmons&&nlq>1)         // => "Try to merge with next" case      ^
    1446                         {
     1556          {
    14471557            G4int s=theQuasmons[iq+1]->GetStatus();//Status of the next Quasmon           ^
    14481558            theQuasmons[iq+1]->IncreaseBy(theQuasmons[iq]);// Merge with the next Quasmon ^
    14491559            theQuasmons[iq]->KillQuasmon();      // Kill the week Quasmon                 ^
    14501560            if(s) nlq--;                         // Reduce a number of "living Quasmons"  ^
    1451                         }
     1561          }
    14521562          else if(iq+1==nQuasmons&&iq&&nlq>1)    // => "Quasmon stack is exhosted" case   ^
    1453                         {
     1563          {
    14541564            G4int s=theQuasmons[0]->GetStatus(); // Status of the first Quasmon           ^
    14551565            theQuasmons[0]->IncreaseBy(theQuasmons[iq]);// Merge with the first Quasmon   ^
    14561566            theQuasmons[iq]->KillQuasmon();      // Kill the week Quasmon                 ^
    14571567            if(s) nlq--;                         // Reduce a number of "living Quasmons"  ^
    1458                         }
    1459                         else                                   // "Have a chance to recover" case       ^
    1460                         {                                      //                                       ^
    1461 #ifdef pdebug
    1462                           G4cout<<"***G4QE::HQE:"<<iq<<",n="<<nHadrons<<",Tot="<<totQC<<totQM<<G4endl;//^
    1463                           for (G4int kq=0; kq<nQuasmons; kq++) // LOOP over Quasmons for DEBUG PRINTING ^
    1464                                                                                                                 G4cout<<kq<<",St/QC="<<theQuasmons[kq]->GetStatus()<<theQuasmons[kq] //     ^
     1568          }
     1569          else                                   // "Have a chance to recover" case       ^
     1570          {                                      //                                       ^
     1571#ifdef pdebug
     1572            G4cout<<"***G4QE::HQE:"<<iq<<",n="<<nHadrons<<",Tot="<<totQC<<totQM<<G4endl;//^
     1573            for (G4int kq=0; kq<nQuasmons; kq++) // LOOP over Quasmons for DEBUG PRINTING ^
     1574              G4cout<<kq<<",St/QC="<<theQuasmons[kq]->GetStatus()<<theQuasmons[kq] //     ^
    14651575                    ->GetQC()<<",M="<<theQuasmons[kq]->Get4Momentum().m()<<G4endl; //     ^
    14661576#endif
     
    14691579            G4bool corrf = true;                 // False when corrected & needs to quit  ^
    14701580            while(nOfOUT && corrf)               // LOOP over all existing QHadrons       ^
    1471                                  {                                    //                                       ^
     1581            {                                    //                                       ^
    14721582              G4QHadron*     theLast = theQHadrons[nOfOUT-1];     //  Remember            ^
    14731583              G4LorentzVector last4M = theLast->Get4Momentum();   //  all                 ^
     
    14771587              G4int           nFr    = theLast->GetNFragments();  //  Last  // if()       ^
    14781588              G4int           gam    = theLast->GetPDGCode();     //        //            ^
    1479                                    if(gam!=22&&!nFr&&lastS<0&&lastS+totS<0&&nOfOUT>1)//=> Skip K,gam & decayed ^
     1589              if(gam!=22&&!nFr&&lastS<0&&lastS+totS<0&&nOfOUT>1)//=> Skip K,gam & decayed ^
    14801590              {                                  //                                       ^
    14811591                G4QHadron* thePrev = theQHadrons[nOfOUT-2];// Kill Prev & make Last->Prev ^
     
    14871597                last4M = theLast->Get4Momentum();// 4Mom of the previouse Quasmon         ^
    14881598                lastQC = theLast->GetQC();       // Quark Content of the previouse Quasmon^
    1489                                    }                                  //                                       ^
     1599              }                                  //                                       ^
    14901600              else                               // Just Clear and destroy theLast        ^
    1491                                    {                                  //                                       ^
     1601              {                                  //                                       ^
    14921602                theQHadrons.pop_back();          // theLastQHadron is excluded from OUTPUT^
    14931603                delete         theLast;          // theLastQHadron is deleated as instance^
    1494                                    }                                  //                                       ^
     1604              }                                  //                                       ^
    14951605              totQC+=lastQC;                     // Update (increase) the total QC        ^
    14961606              tot4M+=last4M;                     // Update (increase) the total 4-momentum^
     
    15001610              dM = totQM-gsM;                    // Escitation energy for the Quasmon     ^
    15011611              if(dM>0)                           // "Mass of Q is big enough" case        ^
    1502                                    {                                  //                                       ^
     1612              {                                  //                                       ^
    15031613                theQuasmons[iq]->InitQuasmon(totQC,tot4M);// Update the week Quasmon      ^
    15041614                G4QHadronVector* curout=theQuasmons[iq]->Fragment(vE,1);//!DESTROY! <---+ ^
     
    15101620#endif
    15111621                if(nHadrons>0)                   // => "QHadrons from Quasmon to Output"^ ^
    1512                                             {                                //                                     ^ ^
    1513                      for (G4int ih=0; ih<nHadrons; ih++) // LOOP over Hadrons of theQuasmon^ ^
    1514                                               {                              //                                     ^ ^
     1622                {                                //                                     ^ ^
     1623                  for (G4int ih=0; ih<nHadrons; ih++) // LOOP over Hadrons of theQuasmon^ ^
     1624                  {                              //                                     ^ ^
    15151625                    //G4QHadron* curH = new G4QHadron(curout->operator[](ih)); //       ^ ^
    15161626                    G4QHadron* curH = new G4QHadron((*curout)[ih]); //                  ^ ^
     
    15201630#endif
    15211631                    totQC-=curH->GetQC();        // totQC recalculation                 ^ ^
    1522                                                        tot4M-=curH->Get4Momentum(); // tot4M recalculation                 ^ ^
     1632                    tot4M-=curH->Get4Momentum(); // tot4M recalculation                 ^ ^
    15231633                    theQHadrons.push_back(curH); // Fill hadron-copy (delete equivalent)^ ^
    15241634                    //delete curout->operator[](ih);//>-Necessary to delete instances*>-^ ^
     
    15291639                  corrf = false;                 // Corrected: go out of the while loop ^ ^
    15301640                  //break;                       // @@ ??                               ^ ^
    1531                        } // End of check for existing output Hadrons in the Quasmon            ^ ^
     1641                } // End of check for existing output Hadrons in the Quasmon            ^ ^
    15321642                else                             //                                     ^ ^
    1533                                             {                                //                                     ^ ^
     1643                {                                //                                     ^ ^
    15341644                  for_each(curout->begin(), curout->end(), DeleteQHadron()); // >-------^ ^
    15351645                  curout->clear();               //                                     ^ ^
    15361646                  delete curout;                 //>*Necessary to delete VectPointers>--^ ^
    1537                                             }                                //                                       ^
    1538                                    }                                  //                                       ^
     1647                }                                //                                       ^
     1648              }                                  //                                       ^
    15391649              nOfOUT  = theQHadrons.size();      // Update the value of OUTPUT entries    ^
    15401650#ifdef rdebug
    15411651              G4int tC=totInC;                   // Vacuum: No ResidualEnvironCharge      ^
    15421652              G4LorentzVector t4M=totIn4M;       // Vacuum: No ResidualEnvironment 4-Mom  ^
    1543                      for (G4int js=0; js<nQuasmons; js++) // Subtract 4mom's of Quasmons from dif^
    1544                                    {                                  //                                       ^
    1545                        G4Quasmon*      pQ = theQuasmons[js]; //                                  ^
     1653              for (G4int js=0; js<nQuasmons; js++) // Subtract 4mom's of Quasmons from dif^
     1654              {                                  //                                       ^
     1655                G4Quasmon*      pQ = theQuasmons[js]; //                                  ^
    15461656                if(pQ->GetStatus())              // Subtract only if Quasmon is alive     ^
    1547                                             {                                //                                       ^
     1657                {                                //                                       ^
    15481658                  G4LorentzVector Q4M= pQ->Get4Momentum(); //                             ^
    15491659                  t4M               -= Q4M;                //                             ^
     
    15511661                }                                //                                       ^
    15521662                else G4cout<<"G4QE::HQ:SUM-4-Mom s("<<js<<")="<<pQ->GetStatus()<<G4endl;//^
    1553                      } // End of Quasmons4Momentum subtractions                                  ^
     1663              } // End of Quasmons4Momentum subtractions                                  ^
    15541664              if(nOfOUT) for(G4int jpo=0; jpo<nOfOUT; jpo++)// LOOP over output hadrons   ^
    1555                                    {                                  //                                       ^
     1665              {                                  //                                       ^
    15561666                G4int hsNF  = theQHadrons[jpo]->GetNFragments();//A#of secondary fragments^
    15571667                if(!hsNF)                                   // Subtract only final hadrons^
     
    15641674              G4cout<<"G4QE::HQ:|||Vacuum|||4-MomCHECK|||d4M="<<t4M<<",dC="<<tC<<G4endl;//^
    15651675#endif
    1566                           }                                    // End of the WHILE LOOP                 ^
    1567                           //if(!nOfOUT&&nQuasmons==1)          // TRY TO EVAPORATE THE TOTAL SYSTEM     ^
    1568                           if((!nOfOUT&&nQuasmons==1)||theEnvironment.GetPDGCode()==NUCPDG)//EvaporTotal ^
    1569                                  {                                    //                                       ^
     1676            }                                    // End of the WHILE LOOP                 ^
     1677            //if(!nOfOUT&&nQuasmons==1)          // TRY TO EVAPORATE THE TOTAL SYSTEM     ^
     1678            if((!nOfOUT&&nQuasmons==1)||theEnvironment.GetPDGCode()==NUCPDG)//EvaporTotal ^
     1679            {                                    //                                       ^
    15701680              G4int totS=totQC.GetStrangeness(); //  Total Strangeness                    ^
    15711681              //G4int totBN=totQC.GetBaryonNumber();// Total Baryon Number                ^
     
    15731683              if(totS) totPDG-=totS*999999;      // @@ ??                                 ^
    15741684#ifdef fdebug
    1575                             G4cout<<"G4QE::HQE: totPDG="<<totPDG<<",totM="<<totQM<<G4endl; //           ^
     1685              G4cout<<"G4QE::HQE: totPDG="<<totPDG<<",totM="<<totQM<<G4endl; //           ^
    15761686#endif
    15771687              G4QHadron* evH = new G4QHadron(totQC,tot4M); // Create a Hadron-ResidualNucl^
     
    15831693              return theQHadrons;                //                                       ^
    15841694            }                                    //                                       ^
    1585                           else if(!nOfOUT)                     // Still remain not used Quasmons        ^
    1586                                  {                                    //                                       ^
    1587                             G4cerr<<"***G4QE::HQ:T="<<tot4M<<totQC<<",M="<<totQM<<"< gsM=" //           ^
     1695            else if(!nOfOUT)                     // Still remain not used Quasmons        ^
     1696            {                                    //                                       ^
     1697              G4cerr<<"***G4QE::HQ:T="<<tot4M<<totQC<<",M="<<totQM<<"< gsM=" //           ^
    15881698                    <<gsM<<",d="<<dM<<",Env="<<theEnvironment<<G4endl; //                 ^
    15891699              throw G4QException("G4QEnvironment::HadronizeQEnv: Can't decay Quasmon");// ^
    1590                    }                                    //                                       ^
    1591                         } // End of PANIC treatment                                                     ^
    1592                       } // End of trouble handling with Quasmon decay in Vacuum                         ^
     1700            }                                    //                                       ^
     1701          } // End of PANIC treatment                                                     ^
     1702        } // End of trouble handling with Quasmon decay in Vacuum                         ^
    15931703        for_each(output->begin(), output->end(), DeleteQHadron());  // >------------------^
    15941704        output->clear();                         //                                       ^
    15951705        delete output;                           // >=====================================^
    1596              } // End of check for the already decayed Quasmon
    1597            } // End of the LOOP over Quasmons
     1706      } // End of check for the already decayed Quasmon
     1707    } // End of the LOOP over Quasmons
    15981708  }
    15991709  else                                           // ==> "Nuclear environment" case
     
    16031713    G4int totInC=theEnvironment.GetZ();
    16041714    G4LorentzVector totIn4M=theEnvironment.Get4Momentum();
    1605            for (G4int is=0; is<nQuasmons; is++) // Sum 4mom's of Quasmons for comparison
    1606            {
    1607              G4Quasmon*      pQ = theQuasmons[is];
     1715    for (G4int is=0; is<nQuasmons; is++) // Sum 4mom's of Quasmons for comparison
     1716    {
     1717      G4Quasmon*      pQ = theQuasmons[is];
    16081718      G4LorentzVector Q4M= pQ->Get4Momentum();
    16091719      totIn4M           += Q4M;
    16101720      totInC            += pQ->GetQC().GetCharge();
    1611            } // End of TotInitial4Momentum summation LOOP over Quasmons
     1721    } // End of TotInitial4Momentum summation LOOP over Quasmons
    16121722    G4int nsHadr  = theQHadrons.size();        // Update the value of OUTPUT entries
    16131723    if(nsHadr) for(G4int jso=0; jso<nsHadr; jso++)// LOOP over output hadrons
     
    16491759    //G4int nCnMax = 9;                      // MaxCounterOfHadrFolts for shortCutSolutions
    16501760    G4bool first=true;                     // Flag of the first interaction (only NucMedia)
     1761    G4int cAN=0;                           // Counter of the nucleon absorptions
     1762    G4int mcAN=3;                          // Max for the counter of nucleon absorptions
    16511763    while (sumstat||totC<totCM)            // ===***=== The MAIN "FOREVER" LOOP ===***===
    1652            {
     1764    {
    16531765#ifdef chdebug
    16541766      G4int f2Charge=0;
     
    16881800#endif
    16891801      totC++;
    1690       if(nQuasmons==1&&sumstat==3) cbR++;
     1802      if( nQuasmons==1 && sumstat==3 ) cbR++;    // Counter of dead solutions for nQ=1
    16911803      else cbR=0;
    16921804      G4QContent envQC=theEnvironment.GetQCZNS();// QuarkCont of current NuclearEnvironment
     
    16991811      G4int     nCount=0;                        // Counter of notsuccessful fragmentations
    17001812      G4int     fCount=0;                        // Counter of successful(notFinal) fragm's
    1701              G4int     eCount=0;                        // Counter of not yet decayed Quasmons
    1702              for (G4int iq=0; iq<nQuasmons; iq++)       // Sum up Quasmons for making a decision
    1703              {
    1704                G4Quasmon*      pQ = theQuasmons[iq];
     1813      G4int     eCount=0;                        // Counter of not yet decayed Quasmons
     1814      for (G4int iq=0; iq<nQuasmons; iq++)       // Sum up Quasmons for making a decision
     1815      {
     1816        G4Quasmon*      pQ = theQuasmons[iq];
    17051817        G4QContent      QQC= pQ->GetQC();
    17061818        totQC             += QQC;
     
    17121824        sumstat           += Qst;
    17131825#ifdef pdebug
    1714                G4cout<<"G4QEnv::HadrQE:#"<<iq<<", Qst="<<Qst<<", Q="<<Q4M<<Q4M.m()<<QQC<<", Env="
     1826        G4cout<<"G4QEnv::HadrQE:#"<<iq<<", Qst="<<Qst<<", Q="<<Q4M<<Q4M.m()<<QQC<<", Env="
    17151827              <<theEnvironment<<G4endl;
    17161828#endif
     
    17211833        }
    17221834        if(Qst>0)                  eCount++;     // Incr. counter of existing Quasmons
    1723              } // End of summation LOOP over Quasmons
     1835      } // End of summation LOOP over Quasmons
    17241836      G4int      totS  =totQC.GetStrangeness();  // Total Strangeness of the Total System
    17251837      G4int      totBN =totQC.GetBaryonNumber(); // Total Baryon Number of the Total System
    17261838      G4int      totPDG=0;                       // Total PDG Code for the Current compound
    17271839      G4double   totM  =0.;                      // min(GroundSt)Mass of theResidualSystem
    1728       if(totBN<2) 
    1729              {
     1840      if(totBN < 2)                              // Solution for the light nucleus 
     1841      {
    17301842        totPDG=totQC.GetSPDGCode();              // Min totPDGCode for theCurrentCompound
    17311843        if(totPDG) totM=G4QPDGCode(totPDG).GetMass(); // min Mass of the Residual System
     
    17331845      }
    17341846      else
    1735              {
     1847      {
    17361848        G4QNucleus totN(totQC,tot4M);            // Excited nucleus for theResidualSystem
    17371849        totM=totN.GetMZNS();                     // min(GroundSt)Mass of theResidualSystem
    17381850        totPDG=totN.GetPDG();                    // Total PDG Code for the Current compound
    1739              }
     1851      }
    17401852#ifdef fdebug
    1741              G4cout<<"G4QEnv::HadrQE:totC="<<totC<<"<totCM="<<totCM<<",ss="<<sumstat<<G4endl;
    1742 #endif
    1743       if(totC>=totCM||cbR>cbRM)
     1853      G4cout<<"G4QEnv::HadrQE:totC="<<totC<<"<totCM="<<totCM<<",ss="<<sumstat<<G4endl;
     1854#endif
     1855      if ( totC >= totCM || cbR > cbRM)
    17441856      {
    17451857        CleanUp();
     
    17471859        EvaporateResidual(evH);             // Try to evaporate residual (del. equiv.)
    17481860        return theQHadrons;
    1749              }
     1861      }
    17501862      // === Now we should be prepared for evaporation ===
    17511863      G4int      totChg=totQC.GetCharge();    // Total Electric Charge of the Total System
    17521864#ifdef pdebug
    17531865      if(totPDG==90999999||totPDG==90999000||totPDG==90000999||totPDG==89999001)
    1754                     G4cout<<"***G4QEnv::HadrQEnv: Meson (1) PDG="<<totPDG<<", M="<<tot4M.m()<<G4endl;
     1866      G4cout<<"***G4QEnv::HadrQEnv: Meson (1) PDG="<<totPDG<<", M="<<tot4M.m()<<G4endl;
    17551867      G4int           nOH=theQHadrons.size(); // A#of output hadrons
    17561868      G4LorentzVector s4M=tot4M;              // Total 4-momentum (@@ only for checking)
    17571869      if(nOH) for(G4int ih=0; ih<nOH; ih++) s4M+=theQHadrons[ih]->Get4Momentum();     
    1758              G4cout<<"G4QEnv::HadrQE:tBN="<<totBN<<",s="<<sumstat<<",fC="<<fCount<<",eC="<<eCount
     1870      G4cout<<"G4QEnv::HadrQE:tBN="<<totBN<<",s="<<sumstat<<",fC="<<fCount<<",eC="<<eCount
    17591871            <<",En="<<theEnvironment<<",nH="<<nOH<<",tLV="<<s4M<<totQC<<nCount<<G4endl;
    17601872#endif
     
    17671879        else if(totPDG==2224) totM=mProt+mPi;
    17681880        else if(totPDG==10)
    1769                       {
     1881        {
    17701882          G4QChipolino totChip(totQC);        // define the residual as a Chipolino
    17711883          totM  =totChip.GetQPDG1().GetMass()+totChip.GetQPDG2().GetMass();
    1772                       }
     1884        }
    17731885        else
    1774                       {
     1886        {
    17751887          G4cerr<<"***G4QEnv::HadrQE:totPDG="<<totPDG<<", totQC="<<totQC<<G4endl;
    17761888          throw G4QException("G4QEnvironment::HadronizeQEnvir: ImpossibleHadron in CHIPS");
    1777                       }
    1778              }
     1889        }
     1890      }
    17791891      G4double totMass = tot4M.m();           // Total effective Mass
    1780       G4bool   Premium = eCount&&premC&&envM; // Premium condition
    1781       G4int    count3  =0;
    1782       if(sumstat&&(fCount||Premium)&&!force&&count3<c3Max)//=>"Still try to decay Quasmons"
    1783              {
     1892      G4bool   Premium = eCount && premC && envM; // Premium condition
     1893      G4int    count3  = 0;
     1894      if(sumstat && (fCount||Premium) && !force && count3<c3Max)//=>"Force Quasmons decay"
     1895      {
    17841896        if(!fCount) premC--;                  // Reduce premium efforts counter
    1785                if(nQuasmons) for (G4int jq=0; jq<nQuasmons; jq++)//FragmentationLOOP over Quasmons
    1786                {
    1787                  G4Quasmon* pQ     = theQuasmons[jq];// Pointer to the CurrentQuasmon <--<--<--+
     1897        if(nQuasmons) for (G4int jq=0; jq<nQuasmons; jq++)//FragmentationLOOP over Quasmons
     1898        {
     1899          G4Quasmon* pQ     = theQuasmons[jq];// Pointer to the CurrentQuasmon <--<--<--+
    17881900          G4int      status = pQ->GetStatus();// Old status of the Quasmon              ^
    17891901#ifdef pdebug
    1790                  G4cout<<"G4QE::HQE:Status of Q#"<<jq<<" (before Fragment)="<<status<<G4endl;//^
     1902          G4cout<<"G4QE::HQE:Status of Q#"<<jq<<" (before Fragment)="<<status<<G4endl;//^
    17911903#endif
    17921904          if(status)                          // Skip dead Quasmons                     ^
     
    17941906            G4int nQuas=eCount;
    17951907            if(nQuas==1&&first) nQuas=-nQuas;
    1796                   G4QHadronVector* output=pQ->Fragment(theEnvironment,nQuas);//<DESTRUCT<--<--^-+
    1797 #ifdef pdebug
    1798                    G4cout<<"G4QE::HQE:Q#"<<jq<<",*afterFragm* Env="<<theEnvironment<<G4endl;// ^ ^
     1908            G4QHadronVector* output=pQ->Fragment(theEnvironment,nQuas);//<DESTRUCT<--<--^-+
     1909#ifdef pdebug
     1910            G4cout<<"G4QE::HQE:Q#"<<jq<<",*afterFragm* Env="<<theEnvironment<<G4endl;// ^ ^
    17991911#endif
    18001912            envM =theEnvironment.GetMass();   // new mass of Nuclear Environment        ^ ^
     
    18031915            G4int nHadrons = output->size();  //                                        ^ ^
    18041916#ifdef rdebug
    1805                    G4cout<<"G4QE::HQE:**AfterFragmAttempt**#"<<jq<<",stat="<<status<<", Q4M="//^ ^
     1917            G4cout<<"G4QE::HQE:**AfterFragmAttempt**#"<<jq<<",stat="<<status<<", Q4M="//^ ^
    18061918                  <<pQ->Get4Momentum()<<", Env="<<theEnvironment<<",nH="<<nHadrons //   ^ ^
    18071919                  <<",c3="<<count3<<" < "<<c3Max<<",eC="<<eCount<<G4endl;          //   ^ ^
    18081920            G4int tC=totInC-theEnvironment.GetZ(); // Subtract theResidualEnvironCharge ^ ^
    18091921            G4LorentzVector t4M=totIn4M;      // Compare with the total                 ^ ^
    1810                                  G4LorentzVector theEnv4m=theEnvironment.Get4Momentum(); // Environment 4Mom ^ ^
    1811                                  t4M-=theEnv4m;                    // Subtract the Environment 4-momentum    ^ ^
     1922            G4LorentzVector theEnv4m=theEnvironment.Get4Momentum(); // Environment 4Mom ^ ^
     1923            t4M-=theEnv4m;                    // Subtract the Environment 4-momentum    ^ ^
    18121924            G4cout<<"G4QEnv::HadrQE:SUM-4Mom e4M="<<theEnv4m<<theEnvironment<<G4endl;// ^ ^
    1813                    for (G4int js=0; js<nQuasmons; js++)// Subtract 4mom's of Quasmons (compare)^ ^
     1925            for (G4int js=0; js<nQuasmons; js++)// Subtract 4mom's of Quasmons (compare)^ ^
    18141926            {                                 //                                        ^ ^
    1815                      G4Quasmon*      prQ = theQuasmons[js];//                                  ^ ^
     1927              G4Quasmon*      prQ = theQuasmons[js];//                                  ^ ^
    18161928              if(prQ->GetStatus())            // Subtract only if Quasmon is alive      ^ ^
    18171929              {                               //                                        ^ ^
     
    18211933                t4M          -= Q4M;          //                                        ^ ^
    18221934                tC           -= prQ->GetQC().GetCharge(); //                            ^ ^
    1823                                    }                               //                                        ^ ^
     1935              }                               //                                        ^ ^
    18241936              else G4cout<<"G4QE::HQE:SUM-4M,st("<<js<<")="<<prQ->GetStatus()<<G4endl;//^ ^
    1825                    } // End of Quasmons4Momentum subtractions                                  ^ ^
     1937            } // End of Quasmons4Momentum subtractions                                  ^ ^
    18261938            G4int nsbHadr=theQHadrons.size(); // Update the value of OUTPUT entries     ^ ^
    18271939            if(nsbHadr) for(G4int jpo=0; jpo<nsbHadr; jpo++)// LOOP over output hadrons ^ ^
    1828                                  {                                 //                                        ^ ^
     1940            {                                 //                                        ^ ^
    18291941              G4int hsNF  = theQHadrons[jpo]->GetNFragments();// A#of out fragments     ^ ^
    18301942              if(!hsNF)                       // Subtract only final hadrons            ^ ^
     
    18351947                t4M          -= hs4Mom;       //                                        ^ ^
    18361948                tC           -= theQHadrons[jpo]->GetCharge(); //                       ^ ^
    1837                                  }                               // End of the "FinalHadron" IF            ^ ^
     1949              }                               // End of the "FinalHadron" IF            ^ ^
    18381950            }                                 // End of the LOOP over output hadrons    ^ ^
    18391951            if(nHadrons) for(G4int kpo=0; kpo<nHadrons; kpo++)//LOOP over out QHadrons  ^ ^
    18401952            {                                 //                                        ^ ^
    1841                                  //G4QHadron* insH =output->operator[](kpo);// Pointer to theOutputQHadron ^ ^
    1842                                  G4QHadron* insH = (*output)[kpo];// Pointer to the Output QHadron         ^ ^
     1953              //G4QHadron* insH =output->operator[](kpo);// Pointer to theOutputQHadron ^ ^
     1954              G4QHadron* insH = (*output)[kpo];// Pointer to the Output QHadron         ^ ^
    18431955              G4int qhsNF  = insH->GetNFragments(); // A#of secondary fragments         ^ ^
    18441956              if(!qhsNF)                      // Subtract only final hadrons            ^ ^
    1845                                    {                               //                                        ^ ^
     1957              {                               //                                        ^ ^
    18461958                G4LorentzVector qhs4Mom = insH->Get4Momentum();// 4M of theOutputQHadron^ ^
    18471959                G4int hPDG = insH->GetPDGCode(); //  PDG Code of the Q-output Hadron    ^ ^
     
    18491961                t4M          -= qhs4Mom;      //                                        ^ ^
    18501962                tC           -= insH->GetCharge(); //                                   ^ ^
    1851                                    }                               //                                        ^ ^
     1963              }                               //                                        ^ ^
    18521964            }                                 // End of the LOOP over output QHadrons   ^ ^
    18531965            G4cout<<"G4QEnv::HadrQE:|||||4-MomCHECK||||d4M="<<t4M<<",dC="<<tC<<G4endl;//^ ^
     
    18581970              if(nHadrons>0)                  // Transfer QHadrons from Quasm to Output ^ ^
    18591971              {                               //                                        ^ ^
    1860                    for (G4int ih=0; ih<nHadrons; ih++) // LOOP over Q-output QHadrons      ^ ^
     1972                for (G4int ih=0; ih<nHadrons; ih++) // LOOP over Q-output QHadrons      ^ ^
    18611973                {                             //                                        ^ ^
    1862                                               //G4QHadron* inpH = output->operator[](ih); //                        ^ ^
    1863                                               G4QHadron* inpH = (*output)[ih]; //                                   ^ ^
     1974                  //G4QHadron* inpH = output->operator[](ih); //                        ^ ^
     1975                  G4QHadron* inpH = (*output)[ih]; //                                   ^ ^
    18641976                  G4int hC=inpH->GetCharge(); // Charge of the Hadron                   ^ ^
    18651977                  G4int hF=inpH->GetNFragments();// Number of fragments                 ^ ^
     
    18771989                    hCB=theEnvironment.CoulombBarrier(hC,hB); //                        ^ ^
    18781990                    hKE=hLV.e()-hLV.m();      //                                        ^ ^
    1879                                               }                           //                                        ^ ^
    1880                   if(can&&hKE<hCB)            // => "Suck Hadron in Quasm or Env" case ^ ^
    1881                                               {                           //                                        ^ ^
    1882                     if(status)                // => "Suck in the existing Quasmon" case ^ ^
     1991                  }                           //                                        ^ ^
     1992                  if(can&&hKE<hCB)            // => "Suck Hadron into Quas or Env" case ^ ^
     1993                  {                           //                                        ^ ^
     1994                    if(status)                // => "Suck into existing Quasmon" case  ^ ^
    18831995                    {                         //                                        ^ ^
    18841996                      G4QContent tQC=inpH->GetQC()+pQ->GetQC();  //                     ^ ^
     
    18861998                      pQ->InitQuasmon(tQC,tLV); // Reinitialize the current Quasmon     ^ ^
    18871999#ifdef pdebug
    1888                              G4cout<<"G4QE::HQE:Medium, H#"<<ih<<", QPDG="<<inpH->GetQPDG() // ^ ^
     2000                      G4cout<<"G4QE::HQE:Medium, H#"<<ih<<", QPDG="<<inpH->GetQPDG() // ^ ^
    18892001                            <<",4M="<<inpH->Get4Momentum()<<" is suckedInQ"<<G4endl; // ^ ^
    18902002#endif
    1891                                                 }                         //                                        ^ ^
     2003                    }                         //                                        ^ ^
    18922004                    else                      // => "Suck in the existing Quasmon" case ^ ^
    18932005                    {                         //                                        ^ ^
     
    18962008                      theEnvironment=G4QNucleus(tQC,tLV); // Reinit currentEnvironment  ^ ^
    18972009#ifdef pdebug
    1898                              G4cout<<"G4QE::HQE:Med,H#"<<ih<<",PDG="<<inpH->GetQPDG()<<",4M="//^ ^
     2010                      G4cout<<"G4QE::HQE:Med,H#"<<ih<<",PDG="<<inpH->GetQPDG()<<",4M="//^ ^
    18992011                            <<inpH->Get4Momentum()<<" is suckedInEnvironment"<<G4endl;//^ ^
    19002012#endif
    1901                                                 }                         // End of the STATUS IF                   ^ ^
    1902                                               }                           // End of the E/Q suck Hdron IF           ^ ^
     2013                    }                         // End of the STATUS IF                   ^ ^
     2014                  }                           // End of the E/Q suck Hdron IF           ^ ^
    19032015                  else if(!hF)                // => "Hadron can go out" case            ^ ^
    19042016                  {                           //                                        ^ ^
     
    19102022                    G4double phZ=ph4M.z();    // p_x of the hadron                      ^ ^
    19112023                    G4double phCost=phZ/sqrt(phX*phX+phY*phY+phZ*phZ);// Hadr cos(theta)^ ^
    1912                            G4cout<<"G4QEnv::HadrQE:Medium, H#"<<ih<<",QPDG="<<curH->GetQPDG()//^ ^
     2024                    G4cout<<"G4QEnv::HadrQE:Medium, H#"<<ih<<",QPDG="<<curH->GetQPDG()//^ ^
    19132025                          <<", 4M="<<ph4M<<", ct="<<phCost<<G4endl; //                  ^ ^
    19142026#endif
     
    19162028                    totQC-=curH->GetQC();     //                                        ^ ^
    19172029                    tot4M-=curH->Get4Momentum(); //                                     ^ ^
    1918                                               }                           //                                        ^ ^
    1919                                             }                             // ==> End of the LOOP over outQHadrons   ^ ^
     2030                  }                           //                                        ^ ^
     2031                }                             // ==> End of the LOOP over outQHadrons   ^ ^
    19202032                pQ->ClearOutput();            // Hadrons are filled, Clear Frag-out <-<-^ ^
    19212033                count3=0;                     // Reset counter of empty hadronizations    ^
    19222034                //c3Max=1;                    // Reduce repetition Max to accelerate      ^
    19232035                first=false;                  // First hadronization is for sure is over  ^
    1924                      }                               //                                          ^
     2036              }                               //                                          ^
    19252037              else count3++;                  // Increment counter of empty hadronizations^
    1926                                  }                                 //                                          ^
     2038            }                                 //                                          ^
    19272039            else if(status<0||status==2)      // => "PANIC or NOTHING was done" case      ^
    19282040            {                                 //                                          ^
    19292041#ifdef pdebug
    1930                      G4cout<<"G4QE::HQE:***PANIC***,status="<<status<<",nC="<<nCount<<G4endl; // ^
    1931 #endif
    1932                                                                                                                 nCount++;                       //                                          ^
     2042              G4cout<<"G4QE::HQE:***PANIC***,status="<<status<<",nC="<<nCount<<G4endl; // ^
     2043#endif
     2044              nCount++;                       //                                          ^
    19332045              if(eCount==1 && status<0 && CheckGroundState(pQ,true))// Correct & Finish   ^
    19342046              {                               //                                          ^
     
    19432055              else if(status<0&&nHadrons)     // This is just a confusion in the status...^
    19442056              {                               //                                          ^
    1945                               G4cerr<<"***G4QEnv::HadrQE: nH="<<nHadrons<<"< status="<<status<<G4endl;//^
     2057                G4cerr<<"***G4QEnv::HadrQE: nH="<<nHadrons<<"< status="<<status<<G4endl;//^
    19462058                for_each(output->begin(), output->end(), DeleteQHadron()); // -->-->-->---^
    19472059                output->clear();              //                                          ^
    19482060                delete output;                // >========================================^
    19492061                throw G4QException("G4QEnvironment::HadronizeQEnvironment:DoNothingEr");//^
    1950                                    }                               //                                          ^
     2062              }                               //                                          ^
     2063              else if(status==2 && eCount==1 && cAN<mcAN && envM>500.)// Add N from E to Q^
     2064              {                               //                                          ^
     2065#ifdef pdebug
     2066                    G4cout<<"G4QE::HQE:E="<<theEnvironment<<",M="<<envM<<",c="<<cAN<<G4endl;//^
     2067#endif
     2068                cAN++;                        // Increment the counter of absorptions     ^
     2069                G4int envPDG = theEnvironment.GetPDG(); // PDGCode of the NuclQEnvironment^
     2070                G4LorentzVector env4M=theEnvironment.Get4Momentum(); // 4mom of the NucEnv^
     2071                G4int envN=theEnvironment.GetN();                    // N of Env          ^
     2072                G4int envZ=theEnvironment.GetZ();                    // Z of Env          ^
     2073                G4int resPDG=envPDG-1;        // Residual for the neutron (prototype)     ^
     2074                G4QContent nucQC=neutQC;      // Nucleon Quark Content                    ^
     2075                if ( envN && (envN+envZ)*G4UniformRand() > envZ ) // Change to a proton   ^
     2076                {                             //                                          ^
     2077                  resPDG=envPDG-1000;         // new PDG for the Environment              ^
     2078                  nucQC=protQC;               // proton QContent                          ^
     2079                }                             //                                          ^
     2080#ifdef pdebug
     2081                    G4cout<<"G4QE::HQE:P,eZ="<<envZ<<",eN="<<envN<<",rPDG="<<resPDG<<G4endl;//^
     2082#endif
     2083                G4QNucleus resNuc(resPDG);    // Create the residual nucleus (future Env) ^
     2084                G4double resM=resNuc.GetGSMass();       // Mass of the residual nucleus   ^
     2085                G4double eM=theEnvironment.GetGSMass(); // Mass of the current environment^
     2086                G4double nucM=eM-resM;                  // Effective mass of theNucleon   ^
     2087                G4LorentzVector res4M(0.,0.,0.,resM);   // Prototype of newEnv4M (at rest)^
     2088                G4LorentzVector nuc4M(0.,0.,0.,nucM);   // Prototype of newEnv4M (at rest)^
     2089                if(std::fabs(env4M.e()-eM) > 0.001)     // the Environment is not at rest ^
     2090                {                                       //                                ^
     2091                  res4M=(resM/eM)*env4M;                // Proportional 4M for residEnv   ^
     2092                  nuc4M=(nucM/eM)*env4M;                // Proportional 4M for effNucleon ^
     2093                }                                       //                                ^
     2094                theEnvironment=G4QNucleus(res4M,resPDG);// Update the Environment         ^
     2095                theQuasmons[0]->IncreaseBy(nucQC,nuc4M);// Update the Only Quasmon        ^
     2096#ifdef pdebug
     2097                    G4cout<<"G4QE::HQE:P,Q="<<nucQC<<nuc4M<<",env="<<theEnvironment<<G4endl;//^
     2098#endif
     2099              }                                         //                                ^
    19512100              else if(status==2&&nCount>nCnMax)// Treat PANIC for stat=2 (NothingWasDone) ^
    19522101              {                               //                                          ^
     2102#ifdef pdebug
     2103                    G4cout<<"G4QE::HQE:PANIC,nC="<<nCount<<">"<<nCnMax<<G4endl; //            ^
     2104#endif
    19532105                G4QContent qQC=pQ->GetQC();   // QuarkContent of the Quasmon              ^
    19542106                G4int      pqC=qQC.GetCharge(); // Charge (nP) of the Current Quasmon     ^
     
    19592111                G4double fqMass=G4QPDGCode(22).GetNuclMass(pqC,pqB-pqC-pqS,pqS);//CQ FreeM^
    19602112#ifdef edebug
    1961                           G4cout<<"G4QEnv::HQE:M="<<cqMass<<">fM="<<fqMass<<",S="<<pqS<<",C="<<pqC//^
     2113                G4cout<<"G4QEnv::HQE:M="<<cqMass<<">fM="<<fqMass<<",S="<<pqS<<",C="<<pqC//^
    19622114                      <<",ePDG="<<theEnvironment.GetPDG()<<",qQC="<<qQC<<",eC="<<eCount //^
    19632115                      <<G4endl;                                                     //    ^
    19642116#endif
    19652117                if(pqB>0&&pqS<0&&cqMass>fqMass)// "AntiStrangeNucleus-Chipolino" case     ^
    1966                                             {                             //                                          ^
     2118                {                             //                                          ^
    19672119                  G4QHadron* nuclQ = new G4QHadron(qQC,cq4M);// Hadron for AntiStrangeNuc.^
    19682120                  theEnvironment.DecayAntiStrange(nuclQ,&theQHadrons);// AntiStrange(D.E.)^
    19692121                  pQ->KillQuasmon();          // If BackFusion succeeded, kill theQuasmon ^
    19702122#ifdef edebug
    1971                            G4cout<<"G4QEnv::HQE:Status after kill (#"<<jq<<")="<<pQ->GetStatus()// ^
     2123                  G4cout<<"G4QEnv::HQE:Status after kill (#"<<jq<<")="<<pQ->GetStatus()// ^
    19722124                        <<", nH="<<theQHadrons.size()<<G4endl;                         // ^
    19732125#endif
     
    19772129                }                             //                                          ^
    19782130                else if(theEnvironment.GetPDG()!=NUCPDG) // ==> "NuclearEnvironment" case ^
    1979                                             {                             //                                          ^
     2131                {                             //                                          ^
    19802132                  if(eCount>1)                //                                          ^
    1981                                                                                                                                                 {                           //                                          ^
     2133                  {                           //                                          ^
    19822134#ifdef fdebug
    1983                                   G4cout<<"G4QE::HQE:TOTEVAP tPDG="<<totPDG<<",t4M="<<tot4M<<G4endl; // ^
     2135                    G4cout<<"G4QE::HQE:TOTEVAP tPDG="<<totPDG<<",t4M="<<tot4M<<G4endl; // ^
    19842136#endif
    19852137                    G4QHadron* evH = new G4QHadron(totQC,tot4M); // Create Hadron-ResidNuc^
     
    19982150                  G4double   curM=curE.GetGSMass();// min mass of the Total System        ^
    19992151#ifdef edebug
    2000                             G4cout<<"G4QEnv::HQE:Q#"<<jq<<",tM="<<tM<<">gsM="<<curM<<curE<<G4endl;//^
     2152                  G4cout<<"G4QEnv::HQE:Q#"<<jq<<",tM="<<tM<<">gsM="<<curM<<curE<<G4endl;//^
    20012153#endif
    20022154                  if(tM<curM)                 //                                          ^
     
    20052157                    G4double qMass=G4QPDGCode(qPDG).GetMass(); // GroundStM of theQuasmon ^
    20062158#ifdef edebug
    2007                               G4cout<<"G4QE::HQE:nQ="<<nQuasmons<<",eC="<<eCount<<",qPDG="<<qPDG // ^
     2159                    G4cout<<"G4QE::HQE:nQ="<<nQuasmons<<",eC="<<eCount<<",qPDG="<<qPDG // ^
    20082160                          <<",qM="<<qMass<<",eM="<<envM<<",tM="<<tM<<",Q+E="<<qMass+envM//^
    20092161                          <<G4endl;           //                                          ^
    20102162#endif
    20112163                    if(eCount==1&&qPDG&&qMass&&tM>qMass+envM)//==> Q+E decay for one Quasm^
    2012                                                        //if(nQuasmons==1 && qPDG && qMass && tM>qMass+envM) // ==> Q+E decay ^
     2164                    //if(nQuasmons==1 && qPDG && qMass && tM>qMass+envM) // ==> Q+E decay ^
    20132165                    {                         //                                          ^
    20142166                      G4int envPDG = theEnvironment.GetPDG(); // PDGCode of the NuclQEnv. ^
    20152167#ifdef edebug
    2016                                     G4cout<<"G4QEnv::HadrQEnv: Q+E decay, nQ=1, qPDG=="<<qPDG<<G4endl;//^
     2168                      G4cout<<"G4QEnv::HadrQEnv: Q+E decay, nQ=1, qPDG=="<<qPDG<<G4endl;//^
    20172169#endif
    20182170                      // => "Quasmon-Chipolino or Environment-Dibaryon" case              ^
    20192171                      if(qPDG==10 || qPDG==92000000 || qPDG==90002000 || qPDG==90000002)//^
    2020                                                                                                                                                                                 {                          //                                       ^
     2172                      {                          //                                       ^
    20212173                        G4QPDGCode h1QPDG=nQPDG; // QPDG of the first hadron              ^
    20222174                        G4double   h1M   =mNeut; // Mass of the first hadron              ^
     
    20242176                        G4double   h2M   =mNeut; // Mass of the second hadron             ^
    20252177                        if(qPDG==10)             // CHIPOLINO decay case                  ^
    2026                                                                   {                     //                                          ^
     2178                        {                     //                                          ^
    20272179                          G4QChipolino QChip(qQC);// define the Quasmon as a Chipolino    ^
    20282180                          h1QPDG=QChip.GetQPDG1();// QPDG of the first hadron             ^
     
    20302182                          h2QPDG=QChip.GetQPDG2();// QPDG of the second hadron            ^
    20312183                          h2M   =h2QPDG.GetMass();// Mass of the second hadron            ^
    2032                                              }                     //                                          ^
    2033                                              else if(qPDG==90002000) // DiProton decay case                    ^
     2184                        }                     //                                          ^
     2185                        else if(qPDG==90002000) // DiProton decay case                    ^
    20342186                        {                     //                                          ^
    20352187                          h1QPDG=pQPDG;       // QPDG of the first hadron                 ^
     
    20372189                          h2QPDG=h1QPDG;      // QPDG of the second hadron                ^
    20382190                          h2M   =mProt;       // Mass of the second hadron                ^
    2039                                              }                     //                                          ^
    2040                                              else if(qPDG==92000000) // Two lambdas case                       ^
     2191                        }                     //                                          ^
     2192                        else if(qPDG==92000000) // Two lambdas case                       ^
    20412193                        {                     //                                          ^
    20422194                          h1QPDG=lQPDG;       // QPDG of the first hadron                 ^
     
    20462198                          G4double ddMass=totMass-envM; // Free CM energy                 ^
    20472199                          if(ddMass>mSigZ+mSigZ) // Sigma0+Sigma0 is possible             ^
    2048                                                                     {                   // @@ Only two particles PS is used         ^
     2200                          {                   // @@ Only two particles PS is used         ^
    20492201                            G4double dd2=ddMass*ddMass; // Squared free energy            ^
    20502202                            G4double sma=mLamb+mLamb; // Lambda+Lambda sum                ^
     
    20542206                            G4double smi=mSigZ-mLamb; // Sigma0-Lambda difference         ^
    20552207                            G4double pr2=pr1;         // Prototype of +L+S0 PS            ^
    2056                                                                                                                                                                                                                                 if(ddMass>sma&&ddMass>smi) //                                 ^
    2057                                                                                                                                                                                                                                         pr2+=sqrt((dd2-sma*sma)*(dd2-smi*smi)); //                  ^
     2208                            if(ddMass>sma&&ddMass>smi) //                                 ^
     2209                              pr2+=sqrt((dd2-sma*sma)*(dd2-smi*smi)); //                  ^
    20582210                            sma=mSigZ+mSigZ;          // Sigma0+Sigma0 sum                ^
    20592211                            G4double pr3=pr2;         // Prototype of +Sigma0+Sigma0 PS   ^
     
    20742226                          }                   //                                          ^
    20752227                          else if(ddMass>mSigZ+mLamb) // Lambda+Sigma0 is possible        ^
    2076                                                                     {                   // @@ Only two particles PS is used         ^
     2228                          {                   // @@ Only two particles PS is used         ^
    20772229                            G4double dd2=ddMass*ddMass; // Squared free energy            ^
    20782230                            G4double sma=mLamb+mLamb; // Lambda+Lambda sum                ^
     
    20832235                            G4double pr2=pr1;         //+L+S0 PS                          ^
    20842236                            if(ddMass>sma && ddMass>smi) //                               ^
    2085                                                                                                                                                                                                                                                 pr2+=sqrt((dd2-sma*sma)*(dd2-smi*smi)); //                  ^
     2237                              pr2+=sqrt((dd2-sma*sma)*(dd2-smi*smi)); //                  ^
    20862238                            if(pr2*G4UniformRand()>pr1) // --> "ENnv+Sigma0+Lambda" case  ^
    20872239                            {                 //                                          ^
     
    20902242                            }                 //                                          ^
    20912243                          }                   //                                          ^
    2092                                              }                     //                                          ^
     2244                        }                     //                                          ^
    20932245                        if(h1M+h2M+envM<totMass) // => "Three parts decay" case           ^
    20942246                        {                     //                                          ^
     
    20982250                          if(!G4QHadron(tot4M).DecayIn3(h14M,h24M,e4M)) //                ^
    20992251                          {                   //                                          ^
    2100                                                         G4cerr<<"***G4QE::HQE:(0)tM="<<tot4M.m()<<"->h1="<<h1QPDG //  ^
     2252                            G4cerr<<"***G4QE::HQE:(0)tM="<<tot4M.m()<<"->h1="<<h1QPDG //  ^
    21012253                                  <<"("<<h1M<<")+h2="<<h1QPDG<<"("<<h2M<<")+envM="<<envM//^
    21022254                                  <<"=="<<h1M+h2M+envM<<G4endl; //                        ^
    2103                                                         throw G4QException("**G4QE::HadrQEnv:QChip+E DecIn3 error");//^
    2104                                                }                   //                                          ^
     2255                            throw G4QException("**G4QE::HadrQEnv:QChip+E DecIn3 error");//^
     2256                          }                   //                                          ^
    21052257                          G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M); //    ^
    21062258                          theQHadrons.push_back(h1H);        // (delete equivalent)       ^
    21072259#ifdef pdebug
    2108                                                                     G4cout<<"G4QE::HQE:(1) H1="<<h1QPDG<<h14M<<G4endl;        //    ^
     2260                          G4cout<<"G4QE::HQE:(1) H1="<<h1QPDG<<h14M<<G4endl;        //    ^
    21092261#endif
    21102262                          G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M); //    ^
     
    21182270                          G4cout<<"G4QE::HQE:(1) QEnv="<<envPDG<<e4M<<G4endl;       //    ^
    21192271#endif
    2120                                              }                     //                                          ^
    2121                                              else                  // Try to recover                           ^
     2272                        }                     //                                          ^
     2273                        else                  // Try to recover                           ^
    21222274                        {                     //                                          ^
    21232275                          //if(eCount==1&&CheckGroundState(pQ,true)) // @@ BackFusion     ^
    21242276                          if(eCount==1&&CheckGroundState(pQ))// BackFusion attempt        ^
    2125                                                                     {                   //                                          ^
     2277                          {                   //                                          ^
    21262278                            pQ->KillQuasmon();// ??                                       ^
    21272279                            eCount--;         // Reduce a#of theLivingQuasmons            ^
     
    21382290                                <<"(M="<<h1M<<")+h2="<<h1QPDG<<"(M="<<h2M<<")+EM="<<envM//^
    21392291                                <<"="<<h1M+h2M+envM<<G4endl; //                           ^
    2140                                                //throw G4QException("G4QEnv::HQE:(0)Chi+Env mass > totMass");//^
     2292                          //throw G4QException("G4QEnv::HQE:(0)Chi+Env mass > totMass");//^
    21412293#endif
    21422294                          CleanUp();          //                                          ^
     
    21442296                          EvaporateResidual(evH);  // Evaporate residual (del. equiv.)    ^
    21452297                          return theQHadrons; //                                          ^
    2146                                              }                     //                                          ^
    2147                                     }                       //                                          ^
     2298                        }                     //                                          ^
     2299                      }                       //                                          ^
    21482300                      else                    // => "Two particles decay" case            ^
    21492301                      {                       //                                          ^
     
    21572309                          output->clear();    // -->-->-->-->-->-->-->-->-->-->-->-->-->--^
    21582310                          delete output;      // >========================================^
    2159                                                       throw G4QException("***G4QEnv::HadrQEnv: Q+Env DecIn2 error");//^
    2160                                              }                     //                                          ^
     2311                          throw G4QException("***G4QEnv::HadrQEnv: Q+Env DecIn2 error");//^
     2312                        }                     //                                          ^
    21612313                        G4QHadron* qH = new G4QHadron(qPDG,fq4M);// the out going Quasmon ^
    21622314                        theQHadrons.push_back(qH); // (delete equivalent)                 ^
    21632315#ifdef pdebug
    2164                                                                   G4cout<<"G4QE::HQE:QuasmH="<<qPDG<<fq4M<<G4endl;         //       ^
     2316                        G4cout<<"G4QE::HQE:QuasmH="<<qPDG<<fq4M<<G4endl;         //       ^
    21652317#endif
    21662318                        G4QHadron* qeH = new G4QHadron(envPDG,qe4M);//theRecoilEnvironment^
    21672319#ifdef pdebug
    2168                                                                   G4cout<<"G4QE::HQE:EnvironH="<<envPDG<<qe4M<<G4endl;     //       ^
     2320                        G4cout<<"G4QE::HQE:EnvironH="<<envPDG<<qe4M<<G4endl;     //       ^
    21692321#endif
    21702322                        if(envPDG==92000000||envPDG==90002000||envPDG==90000002) //       ^
    21712323                          theEnvironment.DecayDibaryon(qeH,&theQHadrons);        //       ^
    21722324                        else theQHadrons.push_back(qeH);// (del.equiv.) *** this too ***  ^
    2173                                     }                       //                                          ^
     2325                      }                       //                                          ^
    21742326                      for_each(output->begin(),output->end(),DeleteQHadron());//-->-->-->-^
    21752327                      output->clear();        //                                          ^
     
    21812333                  }                           //                                          ^
    21822334                  else if(eCount>1&&(nCount>nCnMax||theEnvironment.GetA()<2))// 2Quasmons ^
    2183                                                                                                                                                 {                                  //                                   ^
     2335                  {                                  //                                   ^
    21842336                    theEnvironment.InitByPDG(NUCPDG);// KillEnvironment(@@ Q's? CleanUp)) ^
    21852337#ifdef fdebug
    2186                                                        G4cout<<"G4QEnv::HQE:Evaporate Env+Quasm Env="<<curE<<G4endl;//       ^
     2338                    G4cout<<"G4QEnv::HQE:Evaporate Env+Quasm Env="<<curE<<G4endl;//       ^
    21872339#endif
    21882340                    G4QHadron* nucQE = new G4QHadron(curQC,t4M);// Hadron for Quasm+Envir.^
     
    21902342                    pQ->KillQuasmon();        // If BackFusion succeeded, kill theQuasmon ^
    21912343#ifdef edebug
    2192                              G4cout<<"G4QEnv::HQE:StatusAfterKill (#"<<jq<<")="<<pQ->GetStatus()// ^
     2344                    G4cout<<"G4QEnv::HQE:StatusAfterKill (#"<<jq<<")="<<pQ->GetStatus()// ^
    21932345                          <<", nH="<<theQHadrons.size()<<G4endl;                       // ^
    21942346#endif
     
    21992351                  if(eCount==1 && tM>=curM)   //==>for one Quasmon evaporate ResTotN      ^
    22002352                  {                           //                                          ^
    2201                     theEnvironment.InitByPDG(NUCPDG); // Cancele the Environment          ^
     2353                    theEnvironment.InitByPDG(NUCPDG);// Cancele the Environment           ^
    22022354                    G4int ttPDG=totQC.GetSPDGCode(); // Total PDG Code (10 - Chipolino)   ^
    22032355#ifdef pcdebug
     
    22102362                    G4int ttBN=totQC.GetBaryonNumber(); //                                ^
    22112363                    if(ttPDG==10&&ttBN<2)     // Chipolino case                           ^
    2212                                                        {                         //                                          ^
     2364                    {                         //                                          ^
    22132365                      G4QChipolino QCh(totQC);// define the TotalResidual as a Chipolino  ^
    22142366                      G4QPDGCode   h1QPDG=QCh.GetQPDG1();  // QPDG of the first hadron    ^
     
    22232375                        if(!G4QHadron(tot4M).DecayIn2(h14M,h24M)) //                      ^
    22242376                        {                     //                                          ^
    2225                                                       G4cerr<<"***G4QE::HQE:tM="<<ttM<<"->h1="<<h1QPDG<<"("<<h1M //   ^
     2377                          G4cerr<<"***G4QE::HQE:tM="<<ttM<<"->h1="<<h1QPDG<<"("<<h1M //   ^
    22262378                                <<")+h2="<<h1QPDG<<"("<<h2M<<"="<<h1M+h2M<<G4endl;   //   ^
    2227                                                       throw G4QException("**G4QE::HadrQEnv:QChip (1) DecIn2 error");//^
    2228                                              }                     //                                          ^
     2379                          throw G4QException("**G4QE::HadrQEnv:QChip (1) DecIn2 error");//^
     2380                        }                     //                                          ^
    22292381                        G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M);    //   ^
    22302382                        theQHadrons.push_back(h1H);               // (delete equivalent)  ^
    22312383#ifdef pdebug
    2232                                                                   G4cout<<"G4QE::HQE: QCip-> H1="<<h1QPDG<<h14M<<G4endl;       //   ^
     2384                        G4cout<<"G4QE::HQE: QCip-> H1="<<h1QPDG<<h14M<<G4endl;       //   ^
    22332385#endif
    22342386                        G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M);    //   ^
     
    22402392                      else                    //                                          ^
    22412393                      {                       //                                          ^
    2242                                                     G4cerr<<"***G4QE::HQE:tM="<<ttM<<totQC<<"->h1="<<h1QPDG<<"(" //   ^
     2394                        G4cerr<<"***G4QE::HQE:tM="<<ttM<<totQC<<"->h1="<<h1QPDG<<"(" //   ^
    22432395                              <<h1M<<")+h2="<<h1QPDG<<"("<<h2M<<"="<<h1M+h2M<<G4endl;//   ^
    2244                                                     throw G4QException("***G4QE::HadrQEnv:QChip (2) DecIn2 error");// ^
    2245                                            }                       //                                          ^
     2396                        throw G4QException("***G4QE::HadrQEnv:QChip (2) DecIn2 error");// ^
     2397                      }                       //                                          ^
    22462398                    }                         //                                          ^
    22472399                    else                      //                                          ^
    2248                                                        {                         //                                          ^
     2400                    {                         //                                          ^
    22492401#ifdef edebug
    22502402                      if(ttPDG<80000000&&ttBN<1) //                                       ^
     
    22722424                  G4int PDGQ=QPDGQ.GetPDGCode();  // PDG Code of the QUASMON              ^
    22732425#ifdef edebug
    2274                                               G4cout<<"G4QEnv::HadrQEnv: vacuum PDGQ="<<PDGQ<<G4endl; //              ^
     2426                  G4cout<<"G4QEnv::HadrQEnv: vacuum PDGQ="<<PDGQ<<G4endl; //              ^
    22752427#endif
    22762428                  if(!PDGQ) status=-1;        // Unknown Quasmon in Vaquum - PANIC        ^
     
    22792431                  {                           //                                          ^
    22802432#ifdef edebug
    2281                                                 G4cout<<"G4QEnv::HadrQEnv:Sigma Mass="<<cqMass<<G4endl;      //       ^
     2433                    G4cout<<"G4QEnv::HadrQEnv:Sigma Mass="<<cqMass<<G4endl;      //       ^
    22822434#endif
    22832435                    G4double hyM=mNeut;       // Prototype of the hyperon mass            ^
     
    22862438                    G4int    pigPDG=-211;     // Prototype of the gamma/pion PDG Code     ^
    22872439                    if(PDGQ==3112||PDGQ==90999001) // --> "Sigma-" case                   ^
    2288                                                        { //                                                                  ^
     2440                    { //                                                                  ^
    22892441                      if(cqMass>mPi+mLamb)    // "Lambda + Pi- is possible" case          ^
    2290                                                          { //                                                                ^
     2442                      { //                                                                ^
    22912443                        hyM   = mLamb;        // Lambda mass                              ^
    22922444                        hyPDG = 3122;         // Lambda PDG Code                          ^
    2293                                                          } //                                                                ^
     2445                      } //                                                                ^
    22942446                      else if(cqMass>mSigM)   // "Sigma- gamma decay" case                ^
    2295                                                          { //                                                                ^
     2447                      { //                                                                ^
    22962448                        hyM=mSigM;            // Sigma- mass                              ^
    22972449                        hyPDG=3112;           // Sigma- PDG Code                          ^
    22982450                        pigM=0.;              // Gamma mass                               ^
    22992451                        pigPDG=22;            // Gamma PDG Code                           ^
    2300                                                          } //                                                                ^
     2452                      } //                                                                ^
    23012453                    } //                                                                  ^
    23022454                    else if(PDGQ==3222||PDGQ==91000999) // --> "Sigma+" case              ^
    2303                                                        { //                                                                  ^
     2455                    { //                                                                  ^
    23042456                      pigPDG= 211;            // Pi+ PDG Code                             ^
    23052457                      if(cqMass>mPi+mLamb)    // --- "Lambda + Pi+ is possible" case      ^
    2306                                                          { //                                                                ^
     2458                      { //                                                                ^
    23072459                        hyM   = mLamb;        // Lambda mass                              ^
    23082460                        hyPDG = 3122;         // Lambda PDG Code                          ^
     
    23112463                      } //                                                                ^
    23122464                      else if(cqMass>mSigP)   // "Sigma- gamma decay" case                ^
    2313                                                          { //                                                                ^
     2465                      { //                                                                ^
    23142466                        hyM=mSigP;            // Sigma+ mass                              ^
    23152467                        hyPDG=3222;           // Sigma+ PDG Code                          ^
    23162468                        pigM=0.;              // Gamma mass                               ^
    23172469                        pigPDG=22;            // Gamma PDG Code                           ^
    2318                                                          } //                                                                ^
     2470                      } //                                                                ^
    23192471                      else if(cqMass>mPi0+mProt&&G4UniformRand()>.5) // "P + Pi0" case    ^
    2320                                                          { //                                                                ^
     2472                      { //                                                                ^
    23212473                        hyM   = mProt;        // Proton mass                              ^
    23222474                        hyPDG = 2212;         // Proton PDG Code                          ^
    23232475                        pigM  = mPi0;         // Pi0 mass                                 ^
    23242476                        pigPDG= 111;          // Pi0 PDG Code                             ^
    2325                                                          } //                                                                ^
     2477                      } //                                                                ^
    23262478                      else if(cqMass<mPi+mNeut)// "P+gamma" case as "N+Pi+" is impossible ^
    2327                                                          { //                                                                ^
     2479                      { //                                                                ^
    23282480                        hyM   = mProt;        // Proton mass                              ^
    23292481                        hyPDG = 2212;         // Proton PDG Code                          ^
    23302482                        pigM=0.;              // Gamma mass                               ^
    23312483                        pigPDG=22;            // Gamma PDG Code                           ^
    2332                                                          } //                                                                ^
     2484                      } //                                                                ^
    23332485                      // othing should be done for "N + P+" case                          ^
    23342486                    } //                                                                  ^
     
    23362488                    G4LorentzVector m4Mom(0.,0.,0.,pigM);// pion/gamma mass               ^
    23372489                    if(!G4QHadron(cq4M).DecayIn2(b4Mom, m4Mom)) // "DecayIn2 failed" case ^
    2338                                                        { //                                                                  ^
     2490                    { //                                                                  ^
    23392491                      G4cout<<"---Warning---G4QE::HQE:H="<<hyPDG<<"(m="<<hyM<<")+G/Pi=" //^
    2340                                                                              <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
     2492                            <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
    23412493                      G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC             ^
    23422494                      CleanUp();              //                                          ^
    2343                                     if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
    2344                                                          { //                                                                ^
     2495                      if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
     2496                      { //                                                                ^
    23452497                        G4QHadron* hadr = new G4QHadron(totQC,tot4M); //                  ^
    23462498                        theQHadrons.push_back(hadr);    // Cor or fill as It Is           ^
     
    23482500                        G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^
    23492501#endif
    2350                            //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
     2502                        //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
    23512503                      } //                                                                ^
    23522504                      delete quasH;          // Delete the temporary fake Quasmon         ^
     
    23542506                    } //                                                                  ^
    23552507#ifdef pdebug
    2356                            G4cout<<"G4QEnv::HadronizeQEnv: Sigma="<<PDGQ<<cq4M<<" -> Hyperon="// ^
     2508                    G4cout<<"G4QEnv::HadronizeQEnv: Sigma="<<PDGQ<<cq4M<<" -> Hyperon="// ^
    23572509                          <<hyPDG<<b4Mom<<" + Gamma/Pi="<<pigPDG<<m4Mom<<G4endl; //       ^
    23582510#endif
     
    23652517                    totQC-=qQC;               // Update total residual QC of HadrPr.      ^
    23662518                    eCount--;                 // Reduce a#of the living Quasmons          ^
    2367                                               }                           //                                          ^
     2519                  }                           //                                          ^
    23682520                  else if(PDGQ==90999002||PDGQ==91001999) // pS+/nS-                      ^
    23692521                  {                           //                                          ^
    23702522#ifdef edebug
    2371                                                 G4cout<<"G4QEnv::HadrQEnv: Nucleon+Sigma Mass="<<cqMass<<G4endl; //   ^
     2523                    G4cout<<"G4QEnv::HadrQEnv: Nucleon+Sigma Mass="<<cqMass<<G4endl; //   ^
    23722524#endif
    23732525                    G4bool dinFlag = false;   // Di-nucleon flag                          ^
     
    23772529                    G4int    pigPDG=2112;     // Prototype of the nucleon PDG Code        ^
    23782530                    if     (PDGQ==90999002)   // --> "n+Sigma-" case                      ^
    2379                                                        {                         //                                          ^
     2531                    {                         //                                          ^
    23802532                      if(cqMass<mNeut+mSigM)  // ----> "DiNeutron+Pi-" case               ^
    2381                                                          { //                                                                ^
     2533                      { //                                                                ^
    23822534                        dinFlag = true;       // For the final decay                      ^
    23832535                        hyM=mNeut+mNeut;      // Di-neutron                               ^
     
    23852537                        pigM=mPi;             // Pi- mass                                 ^
    23862538                        pigPDG=-211;          // Pi- PDG Code                             ^
    2387                                                          } //                                                                ^
     2539                      } //                                                                ^
    23882540                    } //                                                                  ^
    23892541                    else if(PDGQ==91001999)   // --> "p+Sigma+" case                      ^
    2390                                                        { //                                                                  ^
     2542                    { //                                                                  ^
    23912543                      hyM=mSigP;              // Sigma+                                   ^
    23922544                      hyPDG=3222;             // PDG Code of Sigma+                       ^
     
    23942546                      pigPDG=2212;            // PDG Code of proton                       ^
    23952547                      if(cqMass<mProt+mSigP)  // ----> "Proton+Proton" case               ^
    2396                                                          { //                                                                ^
     2548                      { //                                                                ^
    23972549                        hyM=mProt;            // Proton mass                              ^
    23982550                        hyPDG=2212;           // Proton PDG Code                          ^
    23992551                        pigM=mProt;           // Proton mass                              ^
    24002552                        pigPDG=2212;          // Proton PDG Code                          ^
    2401                                                          } //                                                                ^
     2553                      } //                                                                ^
    24022554                    } //                                                                  ^
    24032555                    G4LorentzVector b4Mom(0.,0.,0.,hyM); // Hyperon (di-nucleon) mass     ^
    24042556                    G4LorentzVector m4Mom(0.,0.,0.,pigM);// Nucleon (pion) mass           ^
    24052557                    if(!G4QHadron(cq4M).DecayIn2(b4Mom, m4Mom)) // "DecayIn2 failed" case ^
    2406                                                        { //                                                                  ^
     2558                    { //                                                                  ^
    24072559                      G4cout<<"--Warning--G4QE::HQE:S/D="<<hyPDG<<"(m="<<hyM<<")+N/Pi=" //^
    2408                                                                              <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
     2560                            <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
    24092561                      G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC             ^
    24102562                      CleanUp();              //                                          ^
    2411                                     if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
    2412                                                          { //                                                                ^
     2563                      if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
     2564                      { //                                                                ^
    24132565                        G4QHadron* hadr = new G4QHadron(totQC,tot4M); //                  ^
    24142566                        theQHadrons.push_back(hadr);    // Cor or fill as It Is           ^
     
    24162568                        G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^
    24172569#endif
    2418                            //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
     2570                        //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
    24192571                      } //                                                                ^
    24202572                      delete quasH;          // Delete the temporary fake Quasmon         ^
     
    24222574                    } //                                                                  ^
    24232575#ifdef pdebug
    2424                            G4cout<<"G4QEnv::HadronizeQEnv: NSigma="<<PDGQ<<cq4M<<"-> Sigma/dN="//^
     2576                    G4cout<<"G4QEnv::HadronizeQEnv: NSigma="<<PDGQ<<cq4M<<"-> Sigma/dN="//^
    24252577                          <<hyPDG<<b4Mom<<" + N/Pi="<<pigPDG<<m4Mom<<G4endl; //           ^
    24262578#endif
     
    24292581                    theQHadrons.push_back(curBar); // Fill the Hyperon (delete equivalent)^
    24302582                    if(dinFlag)               //                                          ^
    2431                                                        {                         //                                          ^
     2583                    {                         //                                          ^
    24322584                      G4QHadron* secBar = new G4QHadron(hyPDG,b4Mom);// Cre. 2-nd nucleon ^
    24332585                      theQHadrons.push_back(secBar);// Fill 2-nd nucleon (delete equiv.)  ^
     
    24392591                    totQC-=qQC;               // Update total residual QC of HadrPr.      ^
    24402592                    eCount--;                 // Reduce a#of the living Quasmons          ^
    2441                                               }                           //                                          ^
     2593                  }                           //                                          ^
    24422594                  else if(PDGQ==90999003||PDGQ==91002999) // ppS+/nnS-                    ^
    24432595                  {                           //                                          ^
    24442596#ifdef edebug
    2445                                                 G4cout<<"G4QEnv::HadrQEnv: DiNucleon+Sigma Mass="<<cqMass<<G4endl; // ^
     2597                    G4cout<<"G4QEnv::HadrQEnv: DiNucleon+Sigma Mass="<<cqMass<<G4endl; // ^
    24462598#endif
    24472599                    G4bool dinFlag = false;   // Di-nucleon flag                          ^
     
    24512603                    G4int    pigPDG=2112;     // Prototype of the nucleon PDG Code        ^
    24522604                    if     (PDGQ==90999003)   // --> "n+Sigma-" case                      ^
    2453                                                        {                         //                                          ^
     2605                    {                         //                                          ^
    24542606                      if(cqMass<pigM+mSigM)   // ----> "DiNeutron+Pi-" case               ^
    2455                                                          { //                                                                ^
     2607                      { //                                                                ^
    24562608                        dinFlag = true;       // For the final decay                      ^
    24572609                        pigM=mNeut+mNeut+mNeut;// Tri-neutron                             ^
     
    24592611                        hyM=mPi;              // Pi- mass                                 ^
    24602612                        hyPDG=-211;           // Pi- PDG Code                             ^
    2461                                                          } //                                                                ^
     2613                      } //                                                                ^
    24622614                    } //                                                                  ^
    24632615                    else if(PDGQ==91002999)   // --> "p+Sigma+" case                      ^
    2464                                                        { //                                                                  ^
     2616                    { //                                                                  ^
    24652617                      hyM=mSigP;              // Sigma+                                   ^
    24662618                      hyPDG=3222;             // PDG Code of Sigma+                       ^
     
    24682620                      pigPDG=2212;            // PDG Code of proton                       ^
    24692621                      if(cqMass<pigM+mSigP)   // ----> "DiProton+Pi+" case                ^
    2470                                                          { //                                                                ^
     2622                      { //                                                                ^
    24712623                        dinFlag = true;       // For the final decay                      ^
    24722624                        pigM=mProt+mProt+mProt;// Tri-proton                              ^
     
    24742626                        hyM=mPi;             // Pi+ mass                                  ^
    24752627                        hyPDG=211;           // Pi+ PDG Code                              ^
    2476                                                          } //                                                                ^
     2628                      } //                                                                ^
    24772629                    } //                                                                  ^
    24782630                    G4LorentzVector b4Mom(0.,0.,0.,hyM); // Hyperon (di-nucleon) mass     ^
    24792631                    G4LorentzVector m4Mom(0.,0.,0.,pigM);// Nucleon (pion) mass           ^
    24802632                    if(!G4QHadron(cq4M).DecayIn2(b4Mom, m4Mom)) // "DecayIn2 failed" case ^
    2481                                                        { //                                                                  ^
     2633                    { //                                                                  ^
    24822634                      G4cout<<"--Warning--G4QE::HQE:S/Pi="<<hyPDG<<"(m="<<hyM<<")+D/T=" //^
    2483                                                                              <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
     2635                            <<pigPDG<<"(m="<<pigM<<")="<<hyM+pigM<<">"<<cqMass<<G4endl; //^
    24842636                      G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC             ^
    24852637                      CleanUp();              //                                          ^
    2486                                     if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
    2487                                                          { //                                                                ^
     2638                      if(!CheckGroundState(quasH,true)) // Last posibility to correct     ^
     2639                      { //                                                                ^
    24882640                        G4QHadron* hadr = new G4QHadron(totQC,tot4M); //                  ^
    24892641                        theQHadrons.push_back(hadr);    // Cor or fill as It Is           ^
     
    24912643                        G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^
    24922644#endif
    2493                            //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
     2645                        //throw G4QException("G4QEnvironment::HadronizeQEnv:Sig error");//^
    24942646                      } //                                                                ^
    24952647                      delete quasH;          // Delete the temporary fake Quasmon         ^
     
    24972649                    } //                                                                  ^
    24982650#ifdef pdebug
    2499                            G4cout<<"G4QEnv::HadronizeQEnv:2NSigma="<<PDGQ<<cq4M<<"-> Sigma/Pi="//^
     2651                    G4cout<<"G4QEnv::HadronizeQEnv:2NSigma="<<PDGQ<<cq4M<<"-> Sigma/Pi="//^
    25002652                          <<hyPDG<<b4Mom<<" + 2N/3N="<<pigPDG<<m4Mom<<dinFlag<<G4endl; // ^
    25012653#endif
     
    25092661                    theQHadrons.push_back(secBar); // Fill the gam/pi (delete equivalent) ^
    25102662                    if(dinFlag)               //                                          ^
    2511                                                        {                         //                                          ^
     2663                    {                         //                                          ^
    25122664                      G4QHadron* triBar = new G4QHadron(pigPDG,m4Mom);// Cre. 3-d nucleon ^
    25132665                      theQHadrons.push_back(triBar);// Fill 3-d nucleon (delete equival.) ^
     
    25172669                    totQC-=qQC;               // Update total residual QC of HadrPr.      ^
    25182670                    eCount--;                 // Reduce a#of the living Quasmons          ^
    2519                                               }                           //                                          ^
     2671                  }                           //                                          ^
    25202672                  else if (PDGQ!=10)          // @@ Chipolino can wait @@                 ^
    25212673                  {                           //                                          ^
     
    25232675                    G4double gsM=QPDGQ.GetMass(); // GSmass of the Quasmon                ^
    25242676#ifdef edebug
    2525                               G4cout<<"G4QEnv::HadrQEnv:#"<<jq<<",qM="<<qM<<">gsM="<<gsM<<G4endl;// ^
    2526 #endif
    2527                                                        if(fabs(qM-gsM)<0.0001)    // "Fill & Kill" Case                       ^
     2677                    G4cout<<"G4QEnv::HadrQEnv:#"<<jq<<",qM="<<qM<<">gsM="<<gsM<<G4endl;// ^
     2678#endif
     2679                    if(fabs(qM-gsM)<0.0001)   // "Fill & Kill" Case                       ^
    25282680                    {                         //                                          ^
    25292681                      G4QHadron* resQ = new G4QHadron(PDGQ,cq4M); // GSM hadron for CurQ  ^
    25302682#ifdef pdebug
    2531                                                          G4cout<<"G4QEnv::HadrQEnv:ResQ="<<PDGQ<<cq4M<<G4endl;         //    ^
     2683                      G4cout<<"G4QEnv::HadrQEnv:ResQ="<<PDGQ<<cq4M<<G4endl;         //    ^
    25322684#endif
    25332685                      theQHadrons.push_back(resQ); // @@ Check Dibarions @@ (del.equiv.)  ^
     
    25362688                      totQC-=qQC;             // Update total residual QC of HadrPr.      ^
    25372689                      eCount--;               // Reduce a#of the living Quasmons          ^
    2538                                                        }                         //                                          ^
    2539                                                        else if(eCount==1 && qM<gsM && CheckGroundState(pQ,true))// Cor.& Fin.^
     2690                    }                         //                                          ^
     2691                    else if(eCount==1 && qM<gsM && CheckGroundState(pQ,true))// Cor.& Fin.^
    25402692                    {                         //                                          ^
    25412693#ifdef edebug
    2542                                                          G4cout<<"G4QEnv::HadrQEnv:**>>** CGS Correction **>>**"<<G4endl; // ^
     2694                      G4cout<<"G4QEnv::HadrQEnv:**>>** CGS Correction **>>**"<<G4endl; // ^
    25432695#endif
    25442696                      for_each(output->begin(), output->end(), DeleteQHadron()); //-->-->-^
     
    25492701                      return theQHadrons;     //                                          ^
    25502702                    }                         //                                          ^
    2551                                                 else if(qM<gsM&&(pQ->GetQC().GetSPDGCode()==1114     //               ^
    2552                                                                                                     || pQ->GetQC().GetSPDGCode()==2224) //               ^
     2703                    else if(qM<gsM&&(pQ->GetQC().GetSPDGCode()==1114     //               ^
     2704                                     || pQ->GetQC().GetSPDGCode()==2224) //               ^
    25532705                          &&qM>theWorld->GetQParticle(QPDGQ)->MinMassOfFragm())//Del&Kill ^
    25542706                    {                         //                                          ^
    25552707#ifdef edebug
    2556                                                          G4cout<<"G4QEnv::HadrQEnv:**||** Copy&Decay **||**"<<G4endl; //     ^
     2708                      G4cout<<"G4QEnv::HadrQEnv:**||** Copy&Decay **||**"<<G4endl; //     ^
    25572709#endif
    25582710                      G4QHadronVector* decHV=pQ->DecayQuasmon();//Dec.Quasm & fill decHV=*^
     
    25622714                      pQ->KillQuasmon();      // Make done the current Quasmon            ^
    25632715                      eCount--;               // Reduce a#of the living Quasmons          ^
    2564                                                        }                         //                                          ^
    2565                                               }                           //                                          ^
    2566                                             }                             // End of the Medium/Vacuum IF              ^
    2567                                    }                               // End of the status ELSE IF                ^
     2716                    }                         //                                          ^
     2717                  }                           //                                          ^
     2718                }                             // End of the Medium/Vacuum IF              ^
     2719              }                               // End of the status ELSE IF                ^
    25682720              else if(status==3) count3++;    //                                          ^
    25692721              if(status<0)                    // Panic: Quasmon is below theMassShell     ^
     
    25812733                G4int    nRQ=0;                 // Prot. of a#of additionalRealQuasmons   ^
    25822734#ifdef edebug
    2583                           G4cout<<"G4QEnv::HadrQEnv: ***PANIC*** for jq="<<jq<<G4endl; //           ^
     2735                G4cout<<"G4QEnv::HadrQEnv: ***PANIC*** for jq="<<jq<<G4endl; //           ^
    25842736#endif
    25852737                G4ThreeVector vp= pQ->Get4Momentum().vect(); // PANICQuasmon momentum     ^
    25862738                G4double dpm=1.e+30;            // Big number (dot product of momenta)    ^
    2587                        if(nQuasmons>1) for(G4int ir=0; ir<nQuasmons; ir++)// Search for partner  ^
     2739                if(nQuasmons>1) for(G4int ir=0; ir<nQuasmons; ir++)// Search for partner  ^
    25882740                {                               //                                        ^
    25892741                  if(ir!=jq)                    // Skip the current (PANIC) Quasmon itself^
    25902742                  {                             //                                        ^
    2591                            G4Quasmon* rQ = theQuasmons[ir]; //                                   ^
     2743                    G4Quasmon* rQ = theQuasmons[ir]; //                                   ^
    25922744                    G4int Qst = rQ->GetStatus();// Status of a Quasmon                    ^
    25932745#ifdef edebug
    2594                                                        G4cout<<"G4QEnv::HadrQEnv: ir="<<ir<<",Qstatus="<<Qst<<G4endl; //     ^
     2746                    G4cout<<"G4QEnv::HadrQEnv: ir="<<ir<<",Qstatus="<<Qst<<G4endl; //     ^
    25952747#endif
    25962748                    if(Qst>0)                   // Skip the dead Quasmon                  ^
    2597                                                 {
    2598                                                          nRQ++;                    // Increment real-Quasmon-counter         ^
     2749                    {
     2750                      nRQ++;                    // Increment real-Quasmon-counter         ^
    25992751                      G4double dp=vp.dot(rQ->Get4Momentum().vect()); //                   ^
    26002752                      if(dp<dpm)                // Search for the "moving in thesameDir"  ^
     
    26022754                        ppm=ir;                 // Remember the index of MinProj Quasmon  ^
    26032755                        dpm=dp;                 // Remember the value of theMinProjection ^
    2604                                                          }                         //                                        ^
    2605                                                 }                           //                                        ^
    2606                                               } // End of the Quasmon LOOP
     2756                      }                         //                                        ^
     2757                    }                           //                                        ^
     2758                  } // End of the Quasmon LOOP
    26072759                } // End of the partner-search-for-the-PANIC-Quasmon LOOP                 ^
    26082760                if(nRQ)                         // Merge with theBestPartnerQuasmonCandid ^
    26092761                {                               //                                        ^
    2610                          G4Quasmon*      rQ = theQuasmons[ppm];   //                             ^
     2762                  G4Quasmon*      rQ = theQuasmons[ppm];   //                             ^
    26112763                  G4QContent      rQC= rQ->GetQC();        //                             ^
    26122764                  G4LorentzVector r4M= rQ->Get4Momentum(); //                             ^
     
    26152767                  rQ->InitQuasmon(rQC, r4M);    // Make new Quasmon                       ^
    26162768#ifdef edebug
    2617                                 G4cout<<"G4QE::HQE:"<<pQ->GetQC()<<"+"<<rQ->GetQC()<<"="<<rQC<<G4endl;//^
     2769                  G4cout<<"G4QE::HQE:"<<pQ->GetQC()<<"+"<<rQ->GetQC()<<"="<<rQC<<G4endl;//^
    26182770#endif
    26192771                  pQ->KillQuasmon();            // Delete old Quasmon                     ^
    26202772                  eCount--;                     // Decrement counter of living Quasmons   ^
    2621                                      }                               //                                        ^
     2773                }                               //                                        ^
    26222774                else // No candidate to resolve PANIC was found                           ^
    26232775                {                               //                                        ^
    26242776#ifdef edebug
    2625                                 G4cout<<"G4QEnv::HQE: No Q-cand. nRQ="<<nRQ<<",eC="<<eCount<<G4endl; // ^
     2777                  G4cout<<"G4QEnv::HQE: No Q-cand. nRQ="<<nRQ<<",eC="<<eCount<<G4endl; // ^
    26262778#endif
    26272779                  //if(eCount==1 && CheckGroundState(pQ,true)) //  BackFusion attempt     ^
     
    26332785                    pQ->KillQuasmon();          //                                        ^
    26342786                    eCount--;                   // Reduce a#of the living Quasmons        ^
    2635                                                        return theQHadrons;         //                                        ^
     2787                    return theQHadrons;         //                                        ^
    26362788                  }                             //                                        ^
    26372789#ifdef fdebug
    2638                                 G4cout<<"G4QEnv::HadrQEnv:NO PANICsolution,t="<<tot4M<<totQC<<G4endl;// ^
     2790                  G4cout<<"G4QEnv::HadrQEnv:NO PANICsolution,t="<<tot4M<<totQC<<G4endl;// ^
    26392791#endif
    26402792                  totQC=theEnvironment.GetQC(); //                                        ^
    26412793                  tot4M=theEnvironment.Get4Momentum(); //                                 ^
    2642                          if(nQuasmons) for(G4int jr=0; jr<nQuasmons; jr++) // Search for partner ^
     2794                  if(nQuasmons) for(G4int jr=0; jr<nQuasmons; jr++) // Search for partner ^
    26432795                  {                             //                                        ^
    2644                            G4Quasmon* rQ = theQuasmons[jr]; // Pointer to the Quasmon            ^
     2796                    G4Quasmon* rQ = theQuasmons[jr]; // Pointer to the Quasmon            ^
    26452797                    G4int Qst = rQ->GetStatus();// Status of a Quasmon                    ^
    26462798                    if(jr==jq)                  //                                        ^
    2647                                                        {                           //                                        ^
     2799                    {                           //                                        ^
    26482800                      totQC+=rQ->GetQC();       // QuarkContent of the Quasmon            ^
    26492801                      tot4M+=rQ->Get4Momentum();// QuarkContent of the Quasmon            ^
     
    26532805                      totQC+=rQ->GetQC();       // QuarkContent of the Quasmon            ^
    26542806                      tot4M+=rQ->Get4Momentum();// QuarkContent of the Quasmon            ^
    2655                                                        }                           //                                        ^
     2807                    }                           //                                        ^
    26562808                  } // End of the "No candidate to resolve PANIC" ELSE                    ^
    26572809                  pQ->KillQuasmon();            // Kill the only Quasmon                  ^
     
    26652817                  force=true;                   // Make the force decision                ^
    26662818                  break;                        // Out of the fragmentation loop >->+     ^
    2667                                      }                               //                                  |     ^
    2668                                    }                                 //                                  |     ^
    2669                                  }                                   //                                  |     ^
     2819                }                               //                                  |     ^
     2820              }                                 //                                  |     ^
     2821            }                                   //                                  |     ^
    26702822            for_each(output->begin(), output->end(), DeleteQHadron()); // ->-->-->--|-----^
    26712823            output->clear();                    //                                  |     ^
    26722824            delete output;                      // >================================|=====^
    2673                         } // End of skip of the dead Quasmons                                     |
    2674 #ifdef pdebug
    2675                  G4cout<<"G4QE::HQE:QStat("<<jq<<"="<<status<<pQ->Get4Momentum()<<G4endl;//|
    2676 #endif
    2677                } // End of fragmentation LOOP over Quasmons (jq) <--------<----------<-----+
     2825          } // End of skip of the dead Quasmons                                     |
     2826#ifdef pdebug
     2827          G4cout<<"G4QE::HQE:QStat("<<jq<<"="<<status<<pQ->Get4Momentum()<<G4endl;//|
     2828#endif
     2829        } // End of fragmentation LOOP over Quasmons (jq) <--------<----------<-----+
     2830        cAN=0;
    26782831      }
    26792832      else if(totMass>totM+.001)                // ==> "Try Evaporate or decay" case
    2680              {
     2833      {
    26812834#ifdef edebug
    2682                       G4cout<<"G4QEnv::HadrQE: NQ="<<nQuasmons<<",tM="<<totMass<<",tPDG="<<totPDG<<",tB="
     2835        G4cout<<"G4QEnv::HadrQE: NQ="<<nQuasmons<<",tM="<<totMass<<",tPDG="<<totPDG<<",tB="
    26832836              <<totBN<<",GSM="<<totM<<",dM="<<totMass-totM<<",totQC="<<totQC<<G4endl;
    26842837#endif
    2685                       //if(nQuasmons==1)
     2838        //if(nQuasmons==1)
    26862839        if(2>3)                                 // ** closed, because doesn't make a diff
    2687                       {
     2840        {
    26882841          G4QContent quasQC=totQC-envQC;        // Total QuarkContent of the Only Quasmon
    26892842          G4int resQPDG=quasQC.GetSPDGCode();   // GS mass for the Only Quasmon-hadron
     
    26962849          G4double de=totMass-envM-resQM-qCB;
    26972850#ifdef debug
    2698                         G4cout<<"G4QEnv::HadrQE:NQ==1,tM="<<totMass<<",qM="<<resQM<<",eM="<<envM<<",CB="
     2851          G4cout<<"G4QEnv::HadrQE:NQ==1,tM="<<totMass<<",qM="<<resQM<<",eM="<<envM<<",CB="
    26992852                <<qCB<<",dE="<<totMass-envM-resQM-qCB<<G4endl;
    27002853#endif
     
    27042857            G4LorentzVector fe4M=env4M;         // Prototype for outEnvironment
    27052858            G4LorentzVector dir4M=tot4M-env4M;  // Internall quasmon 4-momentum
    2706                    if(!G4QHadron(tot4M).RelDecayIn2(fe4M,fq4M,dir4M,1.,1.))
     2859            if(!G4QHadron(tot4M).RelDecayIn2(fe4M,fq4M,dir4M,1.,1.))
    27072860            {
    27082861              G4cerr<<"***G4QEnv::HadrQE: Can't decay Q+E, t4M="<<tot4M<<",d="<<de<<G4endl;
     
    27152868              theQHadrons.push_back(hEnv);      // Fill the hadron-environ (delete equiv.)
    27162869#ifdef debug
    2717                                    G4cout<<"G4QEnv::HadrQEnv:fQ="<<resQPDG<<fq4M<<", fE="<<envPDG<<fe4M<<G4endl;
     2870              G4cout<<"G4QEnv::HadrQEnv:fQ="<<resQPDG<<fq4M<<", fE="<<envPDG<<fe4M<<G4endl;
    27182871#endif
    27192872              return theQHadrons;
     
    27212874        }
    27222875#ifdef debug
    2723                       G4cout<<"G4QEnv::HadrQE: M="<<totMass<<",PDG="<<totPDG<<",B="<<totBN<<",GSM="<<totM
     2876        G4cout<<"G4QEnv::HadrQE: M="<<totMass<<",PDG="<<totPDG<<",B="<<totBN<<",GSM="<<totM
    27242877              <<",dM="<<totMass-totM<<",totQC="<<totQC<<G4endl;
    27252878#endif
    27262879        if(totBN<2)                             // ==> "Baryon/Meson residual Quasmon" case
    2727                       {
     2880        {
    27282881          if(totPDG==90999999||totPDG==90999000||totPDG==90000999||totPDG==89999001)//"M"ca
    2729                         {
    2730                           G4cout<<"---Warning---G4QE::HQE:Meson(2) PDG="<<totPDG<<",M="<<totMass<<G4endl;
    2731                         }
     2882          {
     2883            G4cout<<"---Warning---G4QE::HQE:Meson(2) PDG="<<totPDG<<",M="<<totMass<<G4endl;
     2884          }
    27322885          else if(totPDG==1114||totPDG==2224)   //==> "DELTA- or DELTA++" case (?antiDELTA)
    2733                         {
     2886          {
    27342887            G4double   mBar=mProt;
    2735                                  G4int      bPDG=2212;
     2888            G4int      bPDG=2212;
    27362889            G4double   mMes=mPi;
    2737                                  G4int      mPDG=211;
     2890            G4int      mPDG=211;
    27382891            if(totPDG==1114)                    // "DELTA-" case
    2739                                  {
     2892            {
    27402893              mBar=mNeut;
    27412894              bPDG=2112;
    27422895              mPDG=-211;
    2743                           }
     2896            }
    27442897            if(totMass<mBar+mMes)
    2745                                  {
    2746                             G4cout<<"--Warning--G4QE::HQE:tM="<<totMass<<"<GSM+mPi0="<<totM+mPi0<<G4endl;
     2898            {
     2899              G4cout<<"--Warning--G4QE::HQE:tM="<<totMass<<"<GSM+mPi0="<<totM+mPi0<<G4endl;
    27472900              G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    27482901              CleanUp();
    2749                             if(!CheckGroundState(quasH,true))
     2902              if(!CheckGroundState(quasH,true))
    27502903              {
    27512904                G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    27582911              delete quasH; 
    27592912              return theQHadrons;
    2760                                  }
     2913            }
    27612914            else
    2762                                  {
     2915            {
    27632916              //G4QHadron* delta = new G4QHadron(totQC,tot4M);
    27642917              //delta->SetNFragments(2);           // Put a#of Fragments=2
     
    27722925              {
    27732926                G4cout<<"---Warning---G4QEnv::HadronizeQE:B="<<bPDG<<"(m="<<mBar<<") + M="
    2774                                                          <<mPDG<<"(m="<<mMes<<")="<<mBar+mMes<<" > mDel="<<totMass<<G4endl;
     2927                      <<mPDG<<"(m="<<mMes<<")="<<mBar+mMes<<" > mDel="<<totMass<<G4endl;
    27752928                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    27762929                CleanUp();
    2777                               if(!CheckGroundState(quasH,true))
     2930                if(!CheckGroundState(quasH,true))
    27782931                {
    27792932                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    27822935                  G4cout<<"***G4QE::HQE:FillAsIs(-3),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    27832936#endif
    2784                      //throw G4QException("G4QEnvironment::HadronizeQEnv:Del->Bar+Mes error");
     2937                  //throw G4QException("G4QEnvironment::HadronizeQEnv:Del->Bar+Mes error");
    27852938                }
    27862939                delete quasH; 
     
    27882941              }
    27892942#ifdef pdebug
    2790                      G4cout<<"G4QEnv::HadronizeQEnv: DELTA="<<totPDG<<tot4M<<" -> Bar="
     2943              G4cout<<"G4QEnv::HadronizeQEnv: DELTA="<<totPDG<<tot4M<<" -> Bar="
    27912944                    <<bPDG<<b4Mom<<" + Mes="<<mPDG<<m4Mom<<G4endl;
    27922945#endif
     
    27942947              theQHadrons.push_back(curBar);     // Fill the baryon (delete equivalent)
    27952948#ifdef edebug
    2796                                    G4cout<<"G4QEnv::HadrQEnv:BaryonH="<<bPDG<<b4Mom<<G4endl;
     2949              G4cout<<"G4QEnv::HadrQEnv:BaryonH="<<bPDG<<b4Mom<<G4endl;
    27972950#endif
    27982951              G4QHadron* curMes = new G4QHadron(mPDG,m4Mom);
    27992952              theQHadrons.push_back(curMes);     // Fill the meson (delete equivalent)
    28002953#ifdef edebug
    2801                                    G4cout<<"G4QEnv::HadrQEnv:MesonH="<<mPDG<<m4Mom<<G4endl;
     2954              G4cout<<"G4QEnv::HadrQEnv:MesonH="<<mPDG<<m4Mom<<G4endl;
    28022955#endif
    28032956              return theQHadrons;
    2804                                  }
    2805                         }
     2957            }
     2958          }
    28062959          else if(totPDG==10)                    // ==> "Chipolino" case
    2807                         {
     2960          {
    28082961            G4QChipolino resChip(totQC);         // define Residual as Chipolino
    28092962            G4QPDGCode h1QPDG=resChip.GetQPDG1();// QPDG of the first hadron
     
    28182971            {
    28192972              G4cout<<"---Warning---G4QEnv::HadronizeQE:h1="<<h1PDG<<"(m="<<h1M<<") + h2="
    2820                                                 <<h2PDG<<"(m="<<h2M<<")="<<h1M+h2M<<" > mChipo="<<totMass<<G4endl;
     2973                    <<h2PDG<<"(m="<<h2M<<")="<<h1M+h2M<<" > mChipo="<<totMass<<G4endl;
    28212974              G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    28222975              CleanUp();
    2823                             if(!CheckGroundState(quasH,true))
     2976              if(!CheckGroundState(quasH,true))
    28242977              {
    28252978                G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    28282981                G4cout<<"***G4QE::HQE:FillAsIs(-2),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    28292982#endif
    2830                    //throw G4QException("G4QEnvironment::HadrQEnv: Chipo->1+2 decay failed");
     2983                //throw G4QException("G4QEnvironment::HadrQEnv: Chipo->1+2 decay failed");
    28312984              }
    28322985              delete quasH; 
     
    28342987            }
    28352988#ifdef pdebug
    2836                    G4cout<<"G4QEnv::HadronizeQEnv: Chipo="<<tot4M<<" -> h1="
     2989            G4cout<<"G4QEnv::HadronizeQEnv: Chipo="<<tot4M<<" -> h1="
    28372990                  <<h1PDG<<h14Mom<<" + Mes="<<h2PDG<<h24Mom<<G4endl;
    28382991#endif
     
    28402993            theQHadrons.push_back(curH1);        // Fill the curH1 (delete equivalent)
    28412994#ifdef edebug
    2842                                  G4cout<<"G4QEnv::HadrQEnv:HadronH="<<h1PDG<<h14Mom<<G4endl;
     2995            G4cout<<"G4QEnv::HadrQEnv:HadronH="<<h1PDG<<h14Mom<<G4endl;
    28432996#endif
    28442997            G4QHadron* curH2 = new G4QHadron(h2PDG,h24Mom);
    28452998            theQHadrons.push_back(curH2);        // Fill the curH2 (delete equivalent)
    28462999#ifdef edebug
    2847                                  G4cout<<"G4QEnv::HadrQEnv:MesAsHadrPartnerH="<<h2PDG<<h24Mom<<G4endl;
     3000            G4cout<<"G4QEnv::HadrQEnv:MesAsHadrPartnerH="<<h2PDG<<h24Mom<<G4endl;
    28483001#endif
    28493002            return theQHadrons;
    2850                         }
     3003          }
    28513004          else if(totBN<2&&totPDG&&totMass<totM+mPi0+.001)// ==> "Meson/Baryon+gamma" case
    2852                         {
     3005          {
    28533006            G4LorentzVector h4Mom(0.,0.,0.,totM);
    28543007            G4LorentzVector g4Mom(0.,0.,0.,0.);
     
    28593012              G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    28603013              CleanUp();
    2861                             if(!CheckGroundState(quasH,true))
     3014              if(!CheckGroundState(quasH,true))
    28623015              {
    28633016                G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    28663019                G4cout<<"***G4QE::HQE:FillAsIs(-1),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    28673020#endif
    2868                 //throw G4QException("G4QEnvironment::HadronizeQEnv:Gamma Decay failed");
     3021                //throw G4QException("G4QEnvironment::HadronizeQEnv:Gamma Decay failed");
    28693022              }
    28703023              delete quasH; 
     
    28723025            }
    28733026#ifdef pdebug
    2874                    G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<totPDG<<h4Mom<<" + gamma="<<g4Mom<<G4endl;
     3027            G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<totPDG<<h4Mom<<" + gamma="<<g4Mom<<G4endl;
    28753028#endif
    28763029            G4QHadron* curG = new G4QHadron(22,g4Mom);
    28773030            theQHadrons.push_back(curG);         // Fill the gamma (delete equivalent)
    28783031#ifdef edebug
    2879                                  G4cout<<"G4QEnv::HadrQEnv:PhotonH="<<g4Mom<<G4endl;
     3032            G4cout<<"G4QEnv::HadrQEnv:PhotonH="<<g4Mom<<G4endl;
    28803033#endif
    28813034            G4QHadron* curH = new G4QHadron(totPDG,h4Mom);
    28823035#ifdef edebug
    2883                                  G4cout<<"G4QEnv::HadrQEnv:GamPartnerH="<<totPDG<<h4Mom<<G4endl;
     3036            G4cout<<"G4QEnv::HadrQEnv:GamPartnerH="<<totPDG<<h4Mom<<G4endl;
    28843037#endif
    28853038            if(totPDG==92000000||totPDG==90002000||totPDG==90000002)
     
    28873040            else theQHadrons.push_back(curH);    // Fill the baryon (delete equivalent)
    28883041            return theQHadrons;
    2889                         }
     3042          }
    28903043          else if(totBN<2&&totPDG)               // ==> "Meson/Baryon+pi" case
    2891                         {
     3044          {
    28923045            G4int piPDG=111;
    28933046            G4double mpi=mPi0;
     
    28953048            G4double mbm=totM;
    28963049            if(totPDG==1114)
    2897                                  {
    2898                                    piPDG=-211;
     3050            {
     3051              piPDG=-211;
    28993052              mpi=mPi;
    29003053              mbPDG=2112;
     
    29023055            }
    29033056            else if(totPDG==2224)
    2904                                  {
    2905                                    piPDG=211;
     3057            {
     3058              piPDG=211;
    29063059              mpi=mPi;
    29073060              mbPDG=2212;
     
    29093062            }
    29103063            else if(totPDG==113)
    2911                                  {
    2912                                    piPDG=-211;
     3064            {
     3065              piPDG=-211;
    29133066              mpi=mPi;
    29143067              mbPDG=211;
     
    29233076              G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    29243077              CleanUp();
    2925                             if(!CheckGroundState(quasH,true))
     3078              if(!CheckGroundState(quasH,true))
    29263079              {
    29273080                G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    29303083                G4cout<<"***G4QE::HQE:FillAsIs(0),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    29313084#endif
    2932                 //throw G4QException("G4QEnvironment::HadronizeQE: DecIn2 mB+nPi failed");
     3085                //throw G4QException("G4QEnvironment::HadronizeQE: DecIn2 mB+nPi failed");
    29333086              }
    29343087              delete quasH; 
     
    29363089            }
    29373090#ifdef pdebug
    2938                    G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<mbPDG<<h4Mom<<"+p="<<piPDG<<g4Mom<<G4endl;
     3091            G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<mbPDG<<h4Mom<<"+p="<<piPDG<<g4Mom<<G4endl;
    29393092#endif
    29403093            G4QHadron* curH = new G4QHadron(mbPDG,h4Mom);
     
    29443097            G4QHadron* curG = new G4QHadron(piPDG,g4Mom);
    29453098#ifdef edebug
    2946                                  G4cout<<"G4QEnv::HadrQEnv:Gamma/Pi0H="<<piPDG<<g4Mom<<G4endl;
     3099            G4cout<<"G4QEnv::HadrQEnv:Gamma/Pi0H="<<piPDG<<g4Mom<<G4endl;
    29473100#endif
    29483101            theQHadrons.push_back(curG);         // Fill the pi0 (delete equivalent)
    29493102            return theQHadrons;
    2950                         }
     3103          }
    29513104          else                                   // ==> "|B|<2 new Quasmon" case
    2952                         {
     3105          {
    29533106            G4Quasmon* resid = new G4Quasmon(totQC,tot4M); // delete is 3 lines below <-+
    29543107            G4QNucleus vacuum(90000000);         //                                     ^
    2955                   G4QHadronVector* curout=resid->Fragment(vacuum,1);//**!!DESTROY!!** <-<-+   ^
     3108            G4QHadronVector* curout=resid->Fragment(vacuum,1);//**!!DESTROY!!** <-<-+   ^
    29563109            G4int rest = resid->GetStatus();     // New status after fragm attempt  ^   ^
    29573110            if(!rest) eCount--;                  // Dec ExistingQuasmonsCounter     ^   ^
     
    29593112            G4int nHadrons = curout->size();     // a#of Hadrons in the outHV       ^
    29603113            if(nHadrons>0)                       // Transfer QHadrons to Output     ^
    2961                    {
    2962                  for (G4int ih=0; ih<nHadrons; ih++)// LOOP over output QHadrons       ^
    2963                                    {                                  //                                 ^
    2964 #ifdef pdebug
    2965                                             G4cout<<"G4QEnv::HadrQE:NewB<2, H#"<<ih //                          ^
     3114            {
     3115              for (G4int ih=0; ih<nHadrons; ih++)// LOOP over output QHadrons       ^
     3116              {                                  //                                 ^
     3117#ifdef pdebug
     3118                G4cout<<"G4QEnv::HadrQE:NewB<2, H#"<<ih //                          ^
    29663119                      <<", QPDG="<<(*curout)[ih]->GetQPDG() //                      ^
    29673120                      <<", 4M="<<(*curout)[ih]->Get4Momentum()<<G4endl; //          ^
     
    29693122                //theQHadrons.push_back(curout->operator[](ih));//(delete equ.) <-<-^
    29703123                theQHadrons.push_back((*curout)[ih]);          // (delete equ.) <-<-^
    2971                                    }                                  //                                 ^
    2972                    }                                    //                                 ^
    2973                                  else                                 //                                 ^
    2974                                                                                                 {                                    //                                 ^
     3124              }                                  //                                 ^
     3125            }                                    //                                 ^
     3126            else                                 //                                 ^
     3127            {                                    //                                 ^
    29753128              G4cerr<<"***G4QEnv::HadrQEnv:MQ="<<tot4M.m()<<",QC="<<totQC<<G4endl;//^
    2976                                    throw G4QException("G4QEnvironment::HadronizeQEnv: Quasmon decay?");//^
    2977                                  }                                    // *** Do not destroy instances ***^
     3129              throw G4QException("G4QEnvironment::HadronizeQEnv: Quasmon decay?");//^
     3130            }                                    // *** Do not destroy instances ***^
    29783131            curout->clear();                     // The instances are filled above  ^
    29793132            delete curout;                       // >===============================^
    29803133            return theQHadrons;
    2981                         }
    2982                       }
     3134          }
     3135        }
    29833136        else
    2984                       {
     3137        {
    29853138          G4QContent tQC    =totQC;              // Not subtracted copy for error prints
    29863139          G4int      NSi    =0;                  // a#of additional Sigma
     
    29943147          G4double   MPi    =0.;                 // Total Mass of additional pions
    29953148          if    (totBN>0&&totS<0&&totChg+totChg>=totBN)// => "additional K+" case
    2996                  {
     3149          {
    29973150            aKPDG=321;
    29983151            NaK=-totS;
     
    30013154            totChg+=totS;                        // Charge reduction (totS<0!)
    30023155            totS=0;                              // Anti-strangness goes to anti-Kaons
    3003                  }
     3156          }
    30043157          else if (totBN>0&&totS<0)              // => "additional aK0" case
    3005                  {
     3158          {
    30063159            aKPDG=311;
    30073160            NaK=-totS;
     
    30093162            tQC+=totS*K0QC;
    30103163            totS=0;                              // Anti-strangness goes to anti-Kaons
    3011                  }
     3164          }
    30123165          else if (totBN>1&&totS>0&&(totChg<0||totChg>totBN-totS))//=>"additional Sigma"
    3013                  {
     3166          {
    30143167            NSi=totS;                            // Prototype of a#of Sigmas
    30153168            if(totChg<0)                         // Negative Sigmas
    3016                                  {
     3169            {
    30173170              SiPDG=3112;
    30183171              if(-totChg<NSi) NSi=-totChg;       // A#of Sigma- is restricted by charge
     
    30223175            }
    30233176            else
    3024                                  {
     3177            {
    30253178              SiPDG=3222;                        // Positive Sigmas
    30263179              G4int exChg=totChg-totBN+totS;     // Excesive positive charge
     
    30323185            totS-=NSi;                           // Reduce the TotalResidualStrangeness
    30333186            totBN-=NSi;                          // A#of excessive pions is added below
    3034                  }
     3187          }
    30353188          else if (totBN>0&&totS>totBN&&totBN<totS+totChg)// => "additional K0" case
    3036                  {// @@ Here Ksi0 check should be added totS=2>totBN=1&&totBN=1<totS=2+totChg=0
     3189          {// @@ Here Ksi0 check should be added totS=2>totBN=1&&totBN=1<totS=2+totChg=0
    30373190            aKPDG=-311;
    30383191            NaK=totS-totBN;
     
    30403193            tQC+=NaK*K0QC;
    30413194            totS-=NaK;                           // Reduce residualstrangeness
    3042                  }
     3195          }
    30433196          else if (totBN>0&&totS>totBN&&totChg<0)// => "additional K-" case
    3044                  {// @@ Here Ksi- check should be added totS=2>totBN=1&&totChg=-1<0
     3197          {// @@ Here Ksi- check should be added totS=2>totBN=1&&totChg=-1<0
    30453198            aKPDG=-321;
    30463199            NaK=totS-totBN;
     
    30493202            totChg+=NaK;                         // Increase residual charge
    30503203            totS-=NaK;                           // Reduce residual strangeness
    3051                  }
     3204          }
    30523205          // === Now residual DELTAS should be subtracted ===
    30533206          if      (totBN>0&&totChg>totBN-totS)   // => "additional PI+" case
    3054                  {// @@ Here Sigma+ check should be added totChg=1>totBn=1-totS=1
     3207          {// @@ Here Sigma+ check should be added totChg=1>totBn=1-totS=1
    30553208            PiPDG=211;
    30563209            NPi=totChg-totBN+totS;
     
    30583211            tQC-=NPi*PiQC;
    30593212            totChg-=NPi;
    3060                  }
     3213          }
    30613214          else if (totBN>0&&totChg<0)            // => "additional PI-" case
    3062                  {// @@ Here Sigma- check should be added totChg<0
     3215          {// @@ Here Sigma- check should be added totChg<0
    30633216            PiPDG=-211;
    30643217            NPi=-totChg;
     
    30663219            tQC+=NPi*PiQC;                       // Now anti-Pions must be subtracted
    30673220            totChg+=NPi;
    3068                  }
     3221          }
    30693222          else if (!totBN&&totChg>1-totS)        // => "additional PI+" case
    3070                  {// @@ Here Sigma+ check should be added totChg=1>totBn=1-totS=1
     3223          {// @@ Here Sigma+ check should be added totChg=1>totBn=1-totS=1
    30713224            PiPDG=211;
    30723225            NPi=totChg+totS-1;
     
    30743227            tQC-=NPi*PiQC;
    30753228            totChg-=NPi;
    3076                  }
     3229          }
    30773230          else if (!totBN&&totChg<-1-totS)       // => "additional PI-" case
    3078                  {// @@ Here Sigma- check should be added totChg<0
     3231          {// @@ Here Sigma- check should be added totChg<0
    30793232            PiPDG=-211;
    30803233            NPi-=totChg+totS+1;
     
    30823235            tQC+=NPi*PiQC;                       // Now anti-Pions must be subtracted
    30833236            totChg+=NPi;
    3084                  }
     3237          }
    30853238          G4double      totRM=0.;                // min (GS) Mass of the Residual System
    30863239          if(totBN<2)                            // Calculate totPDG & totRM
    3087                  {
     3240          {
    30883241            totPDG=tQC.GetSPDGCode();            // MinPDGCode for the Residual compound
    30893242            if(totPDG==10&&tQC.GetBaryonNumber()>0) totPDG=tQC.GetZNSPDGCode();
     
    30963249          }
    30973250          else
    3098                  {
     3251          {
    30993252            G4QNucleus totN(tQC,tot4M);          // Excited nucleus for the Residual System
    31003253            totRM=totN.GetMZNS();                // min (GS) Mass of the Residual System
    31013254            totPDG=totN.GetPDG();                // Total PDG Code for the Current compound
    3102                  }
     3255          }
    31033256          if(NaK)                                // ==> "Decay in K0 or K+ + NPi" case
    3104                  {//@@ Can (must) be moved to EvaporateResidual ??
     3257          {//@@ Can (must) be moved to EvaporateResidual ??
    31053258            if(!NPi)                             // ==> "Only anti-strange K" case
    3106                           {
     3259            {
    31073260              G4LorentzVector m4Mom(0.,0.,0.,MaK);
    31083261              G4LorentzVector n4Mom(0.,0.,0.,totRM);
    31093262              G4double sum=MaK+totRM;
    31103263              if(fabs(totMass-sum)<eps)
    3111                                    {
     3264              {
    31123265                m4Mom=tot4M*(MaK/sum);
    31133266                n4Mom=tot4M*(totRM/sum);
     
    31213274                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    31223275                CleanUp();
    3123                               if(!CheckGroundState(quasH,true))
     3276                if(!CheckGroundState(quasH,true))
    31243277                {
    31253278                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    31343287              }
    31353288#ifdef pdebug
    3136                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M="
     3289              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M="
    31373290                    <<aKPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<totQC<<G4endl;
    31383291#endif
     
    31403293              if(NaK>1) oneK = m4Mom/NaK;        // 4-mom of one kaon 
    31413294              for (G4int jp=0; jp<NaK; jp++)
    3142                                    {
     3295              {
    31433296                G4QHadron* curK = new G4QHadron(aKPDG,oneK);
    31443297                theQHadrons.push_back(curK);     // Fill the curK (delete equivalent)
     
    31463299              G4QHadron* curN = new G4QHadron(totPDG,n4Mom); // @@ Use DecayDib then Evap
    31473300              EvaporateResidual(curN);           // Try to evaporate residual (del.eq.)
    3148                           }
     3301            }
    31493302            else                                 // ==> "Anti-strange K's + DELTA's" case
    3150                           {
     3303            {
    31513304              G4LorentzVector m4Mom(0.,0.,0.,MPi);
    31523305              G4LorentzVector k4Mom(0.,0.,0.,MaK);
     
    31583311                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    31593312                CleanUp();
    3160                               if(!CheckGroundState(quasH,true))
     3313                if(!CheckGroundState(quasH,true))
    31613314                {
    31623315                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    31653318                  G4cout<<"***G4QEnv::HQE:FillAsItIs(2),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    31663319#endif
    3167                    //throw G4QException("G4QEnvironment::HadronizeQE:2AntiS-Nucl(1) error");
     3320                  //throw G4QException("G4QEnvironment::HadronizeQE:2AntiS-Nucl(1) error");
    31683321                }
    31693322                delete quasH; 
     
    31713324              }
    31723325#ifdef fdebug
    3173                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> nK="<<aKPDG<<k4Mom
     3326              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> nK="<<aKPDG<<k4Mom
    31743327                    <<" + nPi="<<PiPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<G4endl;
    31753328#endif
     
    31773330              if(NPi>1) onePi = m4Mom/NPi;       // 4-mom of one pion 
    31783331              for (G4int ip=0; ip<NPi; ip++)
    3179                                    {
     3332              {
    31803333                G4QHadron* curP = new G4QHadron(PiPDG,onePi);
    31813334#ifdef pdebug
    3182                                      G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl;
     3335                G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl;
    31833336#endif
    31843337                theQHadrons.push_back(curP);     // Fill the curM (delete equivalent)
    3185                                   }
     3338              }
    31863339              G4LorentzVector oneK=k4Mom;        // 4-mom of one kaon 
    31873340              if(NaK>1) oneK = k4Mom/NaK;        // 4-mom of one kaon 
    31883341              for (G4int jp=0; jp<NaK; jp++)
    3189                                    {
     3342              {
    31903343                G4QHadron* curP = new G4QHadron(aKPDG,oneK);
    31913344#ifdef pdebug
    3192                                      G4cout<<"G4QEnv::HadrQEnv:Kaon#"<<jp<<",H="<<aKPDG<<oneK<<G4endl;
     3345                G4cout<<"G4QEnv::HadrQEnv:Kaon#"<<jp<<",H="<<aKPDG<<oneK<<G4endl;
    31933346#endif
    31943347                theQHadrons.push_back(curP);     // Fill the curM (delete equivalent)
    3195                                   }
     3348              }
    31963349              G4QHadron* curN = new G4QHadron(totPDG,n4Mom);
    31973350              EvaporateResidual(curN);           // Try to evaporate residual (del.equiv.)
    3198                           }
     3351            }
    31993352            return theQHadrons;
    32003353          }
    32013354          else if(NSi)                           // ==> "Decay in Sig+ or Sig- + NPi" case
    3202                  {//@@ Can (must) be moved to EvaporateResidual ??
     3355          {//@@ Can (must) be moved to EvaporateResidual ??
    32033356            if(!NPi)                             // ==> "Only Sigma's" case
    3204                           {
     3357            {
    32053358              G4LorentzVector m4Mom(0.,0.,0.,MSi);
    32063359              G4LorentzVector n4Mom(0.,0.,0.,totRM);
    32073360              G4double sum=MSi+totRM;
    32083361              if(fabs(totMass-sum)<eps)
    3209                                    {
     3362              {
    32103363                m4Mom=tot4M*(MSi/sum);
    32113364                n4Mom=tot4M*(totRM/sum);
     
    32193372                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    32203373                CleanUp();
    3221                               if(!CheckGroundState(quasH,true))
     3374                if(!CheckGroundState(quasH,true))
    32223375                {
    32233376                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    32323385              }
    32333386#ifdef pdebug
    3234                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> Sig="
     3387              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> Sig="
    32353388                    <<SiPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<totQC<<G4endl;
    32363389#endif
     
    32383391              if(NSi>1) oneS = m4Mom/NSi;        // 4-mom of one sigma 
    32393392              for (G4int jp=0; jp<NSi; jp++)
    3240                                    {
     3393              {
    32413394                G4QHadron* curS = new G4QHadron(SiPDG,oneS);
    32423395                theQHadrons.push_back(curS);     // Fill the curS (delete equivalent)
     
    32443397              G4QHadron* curN = new G4QHadron(totPDG,n4Mom); // @@ Use DecayDib then Evap
    32453398              EvaporateResidual(curN);           // Try to evaporate residual (del.eq.)
    3246                           }
     3399            }
    32473400            else                                 // ==> "Sigma's + DELTA's" case
    3248                           {
     3401            {
    32493402              G4LorentzVector m4Mom(0.,0.,0.,MPi);
    32503403              G4LorentzVector k4Mom(0.,0.,0.,MSi);
     
    32563409                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    32573410                CleanUp();
    3258                               if(!CheckGroundState(quasH,true))
     3411                if(!CheckGroundState(quasH,true))
    32593412                {
    32603413                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    32633416                  G4cout<<"***G4QEnv::HQE:FillAsItIs(3),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    32643417#endif
    3265                   //throw G4QException("G4QEnvironment::HadronizeQE:2Sigma-Nucl(1) error");
     3418                  //throw G4QException("G4QEnvironment::HadronizeQE:2Sigma-Nucl(1) error");
    32663419                }
    32673420                delete quasH; 
     
    32693422              }
    32703423#ifdef fdebug
    3271                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> nS="<<SiPDG<<k4Mom
     3424              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> nS="<<SiPDG<<k4Mom
    32723425                    <<" + nPi="<<PiPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<G4endl;
    32733426#endif
     
    32753428              if(NPi>1) onePi = m4Mom/NPi;       // 4-mom of one pion 
    32763429              for (G4int ip=0; ip<NPi; ip++)
    3277                                    {
     3430              {
    32783431                G4QHadron* curP = new G4QHadron(PiPDG,onePi);
    32793432#ifdef pdebug
    3280                                      G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl;
     3433                G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl;
    32813434#endif
    32823435                theQHadrons.push_back(curP);     // Fill the curM (delete equivalent)
    3283                                   }
     3436              }
    32843437              G4LorentzVector oneS=k4Mom;        // 4-mom of the only kaon 
    32853438              if(NSi>1) oneS = k4Mom/NSi;        // 4-mom of one kaon 
    32863439              for (G4int jp=0; jp<NSi; jp++)
    3287                                    {
     3440              {
    32883441                G4QHadron* curP = new G4QHadron(SiPDG,oneS);
    32893442#ifdef pdebug
    3290                                      G4cout<<"G4QEnv::HadrQEnv:Sigma#"<<jp<<",H="<<SiPDG<<oneS<<G4endl;
     3443                G4cout<<"G4QEnv::HadrQEnv:Sigma#"<<jp<<",H="<<SiPDG<<oneS<<G4endl;
    32913444#endif
    32923445                theQHadrons.push_back(curP);     // Fill the curM (delete equivalent)
    3293                                   }
     3446              }
    32943447              G4QHadron* curN = new G4QHadron(totPDG,n4Mom);
    32953448              EvaporateResidual(curN);           // Try to evaporate residual (del.equiv.)
    3296                           }
     3449            }
    32973450            return theQHadrons;
    3298                         }
     3451          }
    32993452          else if(NPi)                           // ==> "Decay in Pi+ or Pi-" case
    3300                  {
     3453          {
    33013454            if(NPi==1)                           // ==> "One isobar" case
    3302                           {
     3455            {
    33033456              G4LorentzVector m4Mom(0.,0.,0.,MPi);
    33043457              G4LorentzVector n4Mom(0.,0.,0.,totRM);
     
    33063459              {
    33073460                G4cout<<"---Warning---G4QEnv::HadronizeQEnv:M="<<PiPDG<<"(m="<<MPi<<")+N="
    3308                                                   <<totPDG<<"(m="<<totRM<<")="<<MPi+totRM<<" > mSN="<<totMass<<G4endl;
     3461                      <<totPDG<<"(m="<<totRM<<")="<<MPi+totRM<<" > mSN="<<totMass<<G4endl;
    33093462                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    33103463                CleanUp();
    3311                               if(!CheckGroundState(quasH,true))
     3464                if(!CheckGroundState(quasH,true))
    33123465                {
    33133466                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    33163469                  G4cout<<"***G4QEnv::HQE:FillAsItIs(5),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    33173470#endif
    3318                      //throw G4QException("G4QEnvironment::HadronizeQEnv:Iso-Nucleus error");
     3471                  //throw G4QException("G4QEnvironment::HadronizeQEnv:Iso-Nucleus error");
    33193472                }
    33203473                delete quasH; 
     
    33223475              }
    33233476#ifdef pdebug
    3324                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M="<<PiPDG<<m4Mom<<" + N="
     3477              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M="<<PiPDG<<m4Mom<<" + N="
    33253478                    <<totPDG<<n4Mom<<totQC<<G4endl;
    33263479#endif
     
    33293482              G4QHadron* curN = new G4QHadron(totPDG,n4Mom);
    33303483              EvaporateResidual(curN);           // Evaporate residual (delete equivalent)
    3331                           }
    3332                           else                                 // ==> "Many Isobars" case
    3333                           {
     3484            }
     3485            else                                 // ==> "Many Isobars" case
     3486            {
    33343487              G4int N1Pi = NPi/2;                // First pion cluster
    33353488              G4int N2Pi = NPi-N1Pi;             // Second pion cluster
     
    33463499                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    33473500                CleanUp();
    3348                               if(!CheckGroundState(quasH,true))
     3501                if(!CheckGroundState(quasH,true))
    33493502                {
    33503503                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    33533506                  G4cout<<"***G4QEnv::HQE:FillAsItIs(5),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    33543507#endif
    3355                   //throw G4QException("G4QEnvironment::HadronizeQE:ManyIsoNucleus error");
     3508                  //throw G4QException("G4QEnvironment::HadronizeQE:ManyIsoNucleus error");
    33563509                }
    33573510                delete quasH; 
     
    33593512              }
    33603513#ifdef pdebug
    3361                      G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> N*PI="<<PiPDG
     3514              G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> N*PI="<<PiPDG
    33623515                    <<" (4M1="<<m4Mom<<" + 4M2="<<k4Mom<<") + N="<<totPDG<<n4Mom<<G4endl;
    33633516#endif
     
    33653518              if(N1Pi>1) one1=m4Mom/N1Pi;        // 4-mom of the 1st cluster one pion 
    33663519              for (G4int ip=0; ip<N1Pi; ip++)
    3367                                    {
     3520              {
    33683521                G4QHadron* curP = new G4QHadron(PiPDG,one1);
    33693522                theQHadrons.push_back(curP);     // Fill the curP (delete equivalent)
    3370                                   }
     3523              }
    33713524              G4LorentzVector one2=k4Mom;        // 4-mom of the 2nd cluster only pion 
    33723525              if(N2Pi>1) one2=k4Mom/N2Pi;        // 4-mom of the 2nd cluster one pion 
    33733526              for (G4int jp=0; jp<N2Pi; jp++)
    3374                                    {
     3527              {
    33753528                G4QHadron* curP = new G4QHadron(PiPDG,one2);
    33763529                theQHadrons.push_back(curP);     // Fill the curP (delete equivalent)
    3377                                   }
     3530              }
    33783531              G4QHadron* curN = new G4QHadron(totPDG,n4Mom);
    33793532              EvaporateResidual(curN);           // Try to evaporate residual (del.equiv.)
    3380                           }
     3533            }
    33813534            return theQHadrons;
    3382                         }
    3383                       }
     3535          }
     3536        }
    33843537#ifdef fdebug
    3385                       G4cout<<"G4QE::HadrQEnv: Try FinalEvaporation t4M="<<tot4M<<",tQC="<<totQC<<G4endl;
     3538        G4cout<<"G4QE::HadrQEnv: Try FinalEvaporation t4M="<<tot4M<<",tQC="<<totQC<<G4endl;
    33863539#endif
    33873540        CleanUp();
     
    33893542        EvaporateResidual(evH);                  // Try to evaporate residual (del.equiv.)
    33903543        return theQHadrons;
    3391              }
     3544      }
    33923545      else                                       // ==> "Only GSEnvironment exists" case
    33933546      {
    33943547        if(totPDG==90000000 || fabs(totMass)<0.000001)
    3395                       {
     3548        {
    33963549          CleanUp();
    33973550          return theQHadrons;
    3398                       }
     3551        }
    33993552        G4double dM=totMass-totM;
    34003553#ifdef pdebug
    3401                       G4cout<<"G4QEnv::HadrQEnv:GroundState tM-GSM="<<dM<<",GSM="<<totM<<",tPDG="<<totPDG
     3554        G4cout<<"G4QEnv::HadrQEnv:GroundState tM-GSM="<<dM<<",GSM="<<totM<<",tPDG="<<totPDG
    34023555              <<",nQ="<<nQuasmons<<G4endl;
    34033556#endif
    3404                G4Quasmon*       pQ = theQuasmons[0];    // Pointer to the first Quasmon         
     3557        G4Quasmon*       pQ = theQuasmons[0];    // Pointer to the first Quasmon         
    34053558        G4QPDGCode    QQPDG = pQ->GetQPDG();     // QPDG of the Quasmon
    34063559        G4int          QPDG = QQPDG.GetPDGCode();
     
    34083561        G4int          spbRN=totRN.SplitBaryon();// PossibilityToSplit baryon from Residual
    34093562        if(dM>-0.001)
    3410                       {
     3563        {
    34113564#ifdef fdebug
    3412                         G4cout<<"G4QE::HadrQE:ExcitedNucleus, dM="<<dM<<">0,tBN="<<totBN<<",nQ="<<G4endl;
     3565          G4cout<<"G4QE::HadrQE:ExcitedNucleus, dM="<<dM<<">0,tBN="<<totBN<<",nQ="<<G4endl;
    34133566#endif
    34143567          CleanUp();
    34153568          G4QHadron* evH = new G4QHadron(totQC,tot4M);// Create a Hadron for ResidualNucl
    34163569          EvaporateResidual(evH);                // Try to evaporate residual (del. equiv.)
    3417                       }
     3570        }
    34183571        else if(nQuasmons==1&&QPDG!=22&&QPDG!=111)// => "Decay Quasmon or Q+Environ" case
    3419                       {
     3572        {
    34203573          G4int envPDG = theEnvironment.GetPDG();// PDGCode of the NuclQEnvironment
    34213574#ifdef pdebug
    3422                         G4cout<<"G4QEnv::HadrQEnv: nQ=1, QPDG=="<<QPDG<<G4endl;
     3575          G4cout<<"G4QEnv::HadrQEnv: nQ=1, QPDG=="<<QPDG<<G4endl;
    34233576#endif
    34243577          if(!QPDG)
    3425                         {
    3426                                  G4cerr<<"***G4QEnv::HadrQE: Quasmon is an unknown QHadron: PDG="<<QPDG<<G4endl;
    3427                                  throw G4QException("G4QEnvironment::HadronizeQEnvironment:(2)Cann'tDecayQEnv");
    3428                         }
     3578          {
     3579            G4cerr<<"***G4QEnv::HadrQE: Quasmon is an unknown QHadron: PDG="<<QPDG<<G4endl;
     3580            throw G4QException("G4QEnvironment::HadronizeQEnvironment:(2)Cann'tDecayQEnv");
     3581          }
    34293582          // => "Quasmon-Chipolino or Environment-Dibaryon" case
    34303583          else if(QPDG==10||QPDG==92000000||QPDG==90002000||QPDG==90000002)
    3431                         {
     3584          {
    34323585            G4QContent QQC = pQ->GetQC();        // Quark Content of the Quasmon
    34333586            G4QPDGCode h1QPDG=nQPDG;             // QPDG of the first hadron
     
    34423595              h2QPDG=QChip.GetQPDG2();           // QPDG of the second hadron
    34433596              h2M   =h2QPDG.GetMass();           // Mass of the second hadron
    3444                                  }
    3445                                  else if(QPDG==90002000)
    3446                                  {
     3597            }
     3598            else if(QPDG==90002000)
     3599            {
    34473600              h1QPDG=pQPDG;                      // QPDG of the first hadron
    34483601              h1M   =mProt;                      // Mass of the first hadron
    34493602              h2QPDG=h1QPDG;                     // QPDG of the second hadron
    34503603              h2M   =mProt;                      // Mass of the second hadron
    3451                                  }
    3452                                  else if(QPDG==92000000)
    3453                                  {
     3604            }
     3605            else if(QPDG==92000000)
     3606            {
    34543607              h1QPDG=lQPDG;                      // QPDG of the first hadron
    34553608              h1M   =mLamb;                      // Mass of the first hadron
     
    34583611              G4double ddMass=totMass-envM;      // Free CM energy
    34593612              if(ddMass>mSigZ+mSigZ)             // Sigma0+Sigma0 is possible
    3460                                    {                                  // @@ Only two particles PS is used
     3613              {                                  // @@ Only two particles PS is used
    34613614                G4double dd2=ddMass*ddMass;      // Squared free energy
    34623615                G4double sma=mLamb+mLamb;        // Lambda+Lambda sum
     
    34853638              }                                  //
    34863639              else if(ddMass>mSigZ+mLamb)        // Lambda+Sigma0 is possible
    3487                                    {                                  // @@ Only two particles PS is used
     3640              {                                  // @@ Only two particles PS is used
    34883641                G4double dd2=ddMass*ddMass;      // Squared free energy
    34893642                G4double sma=mLamb+mLamb;        // Lambda+Lambda sum
     
    35003653                }                                //
    35013654              }                                  //
    3502                                  }                                    //
     3655            }                                    //
    35033656            if(h1M+h2M+envM<totMass)             // => "Three parts decay" case
    3504                                  {
     3657            {
    35053658              G4LorentzVector h14M(0.,0.,0.,h1M);
    35063659              G4LorentzVector h24M(0.,0.,0.,h2M);
    35073660              G4LorentzVector e4M(0.,0.,0.,envM);
    35083661              if(!G4QHadron(tot4M).DecayIn3(h14M,h24M,e4M))
    3509                                    {
    3510                                             G4cout<<"Warning->G4QE::HQE:M="<<tot4M.m()<<","<<totMass<<"->"<<h1QPDG<<"("
    3511                                                          <<h1M<<")+"<<h1QPDG<<"("<<h2M<<")+"<<envM<<"="<<h1M+h2M+envM<<G4endl;
     3662              {
     3663                G4cout<<"Warning->G4QE::HQE:M="<<tot4M.m()<<","<<totMass<<"->"<<h1QPDG<<"("
     3664                      <<h1M<<")+"<<h1QPDG<<"("<<h2M<<")+"<<envM<<"="<<h1M+h2M+envM<<G4endl;
    35123665                G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    35133666                CleanUp();
    3514                               if(!CheckGroundState(quasH,true))
     3667                if(!CheckGroundState(quasH,true))
    35153668                {
    35163669                  G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    35193672                  G4cout<<"***G4QEnv::HQE:FillAsItIs(6),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    35203673#endif
    3521                                               //throw G4QException("G4QEnv::HadrQEnv:QChipo+Environment DecIn3 Error");
     3674                  //throw G4QException("G4QEnv::HadrQEnv:QChipo+Environment DecIn3 Error");
    35223675                }
    35233676                delete quasH; 
    35243677                return theQHadrons;
    35253678
    3526                                    }
     3679              }
    35273680              G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M);
    35283681              theQHadrons.push_back(h1H);        // (delete equivalent)
    35293682#ifdef pdebug
    3530                                    G4cout<<"G4QE::HQE:(2) H1="<<h1QPDG<<h14M<<G4endl;
     3683              G4cout<<"G4QE::HQE:(2) H1="<<h1QPDG<<h14M<<G4endl;
    35313684#endif
    35323685              G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M);
     
    35403693              G4cout<<"G4QE::HQE:(2) QEenv="<<envPDG<<e4M<<G4endl;
    35413694#endif
    3542                                  }
     3695            }
    35433696#ifdef fdebug
    35443697            G4cout<<"***G4QEnv::HadQEnv:tM="<<tot4M.m()<<totQC<<"< h1="<<h1QPDG<<"(M="<<h1M
    35453698                  <<")+h2="<<h1QPDG<<"(M="<<h2M<<")+eM="<<envM<<"="<<h1M+h2M+envM<<G4endl;
    3546                                  //throw G4QException("G4QEnv::HadrQEnv:QChipo+Env mass > than decaying mass");
     3699            //throw G4QException("G4QEnv::HadrQEnv:QChipo+Env mass > than decaying mass");
    35473700#endif
    35483701            CleanUp();
     
    35503703            EvaporateResidual(evH);            // Try to evaporate residual (del. equiv.)
    35513704            return theQHadrons;
    3552                         }
     3705          }
    35533706        }
    35543707        else if(spbRN)// => "Join all quasmons to the residual compound and evaporate" case
    3555                       {
     3708        {
    35563709#ifdef fdebug
    35573710          G4cout<<"***G4QEnv::HadQEnv: Evaporate the total residual tRN="<<totRN<<G4endl;
     
    35613714          EvaporateResidual(evH);               // Try to evaporate residual (del.equiv.)
    35623715          return theQHadrons;
    3563                       }
     3716        }
    35643717        //else if(nQuasmons<3||theQHadrons.size()<12)//"Try to correct" case (change cond)
    35653718        else if(2>3)  // "Try to correct" case (change condition)
    3566                       {
    3567 #ifdef pdebug
    3568                         G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl;
     3719        {
     3720#ifdef pdebug
     3721          G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl;
    35693722#endif
    35703723          G4int          nOfOUT  = theQHadrons.size();
     
    35783731            G4int           nFr    = theLast->GetNFragments();
    35793732            G4int           gam    = theLast->GetPDGCode();
    3580                           if(gam!=22&&!nFr&&lastS<0&&lastS+totS<0&&nOfOUT>1) // => "Skip K,gam & decayed"
    3581                           {
     3733            if(gam!=22&&!nFr&&lastS<0&&lastS+totS<0&&nOfOUT>1) // => "Skip K,gam & decayed"
     3734            {
    35823735              G4QHadron* thePrev = theQHadrons[nOfOUT-2];
    35833736              theQHadrons.pop_back();         // the last QHadron is excluded from OUTPUT
     
    35883741              last4M = theLast->Get4Momentum();
    35893742              lastQC = theLast->GetQC();
    3590                           }
     3743            }
    35913744            else
    35923745            {
     
    36013754            if(totPDG==10&&totQC.GetBaryonNumber()>0) totPDG=totQC.GetZNSPDGCode();
    36023755            if(bn>1)
    3603                           {
     3756            {
    36043757              totS  =totQC.GetStrangeness();  // Total Strangeness of this System
    36053758              if(totS>=0)                     // => "This is a normal nucleus" case
    3606                                    {
     3759              {
    36073760                G4QNucleus newN(totQC,tot4M);
    36083761                totPDG=newN.GetPDG();
    36093762                totM  =newN.GetMZNS();           // Calculate new minimum (GS) mass
    3610                                    }
     3763              }
    36113764              else if(totS==-1)                  // => "Try to decay in K+/aK0 and finish"
    3612                                    {
     3765              {
    36133766                G4double m1=mK;         
    36143767                G4int  PDG1=321;
     
    36193772                G4double m3=newN0.GetMZNS();
    36203773                if (m3+mK0<m2+mK)                // => "aK0+ResA is better" case
    3621                        {
     3774                {
    36223775                  m1  =mK0;
    36233776                  PDG1=311;
    36243777                  m2  =m3;
    36253778                  PDG2=newN0.GetPDG();
    3626                        }
     3779                }
    36273780                if(totMass>m1+m2)                // => "can decay" case
    36283781                {
     
    36303783                  G4LorentzVector qe4M(0.,0.,0.,m2);
    36313784                  if(!G4QHadron(tot4M).DecayIn2(fq4M,qe4M))
    3632                                        {
     3785                  {
    36333786                    G4cout<<"---Warning---G4QE::HadQE:tM="<<tot4M.m()<<"->aK="<<PDG1<<"(M="
    36343787                          <<m1<<")+ResA="<<PDG2<<"(M="<<m2<<")="<<m1+m2<<G4endl;
    36353788                    G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    36363789                    CleanUp();
    3637                                   if(!CheckGroundState(quasH,true))
     3790                    if(!CheckGroundState(quasH,true))
    36383791                    {
    36393792                      G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    36423795                      G4cout<<"***G4QE::HQE:FillAsIs(7),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    36433796#endif
    3644                                                 //throw G4QException("G4QEnv::HadrQEnv: aK+ResA DecayIn2 error");
     3797                      //throw G4QException("G4QEnv::HadrQEnv: aK+ResA DecayIn2 error");
    36453798                    }
    36463799                    delete quasH; 
    36473800                    return theQHadrons;
    3648                                        }
     3801                  }
    36493802                  G4QHadron* H1 = new G4QHadron(PDG1,fq4M);
    36503803#ifdef pdebug
     
    36583811                  theQHadrons.push_back(H2);     // (delete equivalent)
    36593812                  break;
    3660                                      }
     3813                }
    36613814                else totM=250000.;               // => "Continue reversion" case
    3662                                    }
     3815              }
    36633816              else if(totS==-2)                  //=>"Try to decay in 2(K+/aK0) and finish"
    3664                                  {
     3817              {
    36653818                G4double m1=mK;         
    36663819                G4int  PDG1=321;
     
    36753828                G4double m5=newNpp.GetMZNS();    // M-2*K^+
    36763829                if (m4+mK0+mK0<m3+mK+mK0 && m4+mK0+mK0<=m5+mK+mK) //=>"2K0+ResA is theBest"
    3677                        {
     3830                {
    36783831                  m1  =mK0;
    36793832                  PDG1=311;
    36803833                  m3  =m4;
    36813834                  PDG3=newN00.GetPDG();
    3682                        }
     3835                }
    36833836                else if(m5+mK+mK<m3+mK+mK0 && m5+mK+mK<=m4+mK0+mK0)//=>"2Kp+ResA isTheBest"
    3684                        {
     3837                {
    36853838                  m2  =mK;
    36863839                  PDG1=321;
    36873840                  m3  =m5;
    36883841                  PDG3=newNpp.GetPDG();
    3689                        }
     3842                }
    36903843                if(totMass>m1+m2+m3)             // => "can decay" case
    36913844                {
     
    36943847                  G4LorentzVector ra4M(0.,0.,0.,m3);
    36953848                  if(!G4QHadron(tot4M).DecayIn3(k14M,k24M,ra4M))
    3696                                        {
     3849                  {
    36973850                    G4cout<<"--Warning--G4QE::HQE:tM="<<tot4M.m()<<"->aK="<<PDG1<<"(M="<<m1
    36983851                          <<")+K2="<<PDG2<<"(M="<<m2<<")+A="<<PDG3<<"(M="<<m3<<")"<<G4endl;
    36993852                    G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    37003853                    CleanUp();
    3701                                   if(!CheckGroundState(quasH,true))
     3854                    if(!CheckGroundState(quasH,true))
    37023855                    {
    37033856                      G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    37063859                      G4cout<<"***G4QE::HQE:FillAsIs(8),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    37073860#endif
    3708                                                   //throw G4QException("G4QEnv::HadrQE:2K+ResidNucleus DecIn3 Error");
     3861                      //throw G4QException("G4QEnv::HadrQE:2K+ResidNucleus DecIn3 Error");
    37093862                    }
    37103863                    delete quasH; 
    37113864                    return theQHadrons;
    3712                                        }
     3865                  }
    37133866                  G4QHadron* H1 = new G4QHadron(PDG1,k14M);
    37143867                  theQHadrons.push_back(H1);     // (delete equivalent)
     
    37273880#endif
    37283881                  break;
    3729                                      }
     3882                }
    37303883                else totM=270000.;               // => "Continue reversion" case
    3731                                    }
     3884              }
    37323885              else totM=300000.;                 // => "Continue reversion" case
    3733                                  }
     3886            }
    37343887            else
    3735                                  {
     3888            {
    37363889              if     (totPDG==1114||totPDG==2224||totPDG==10) // Decay right now and finish
    3737                                    {
     3890              {
    37383891                G4double m1=mNeut;
    37393892                G4int  PDG1=2112;
    37403893                G4double m2=mPi;
    37413894                G4int  PDG2=-211;
    3742                                             if(totPDG==2224)
    3743                                             {
     3895                if(totPDG==2224)
     3896                {
    37443897                  m1=mProt;
    37453898                  PDG1=2212;
    37463899                  m2=mPi;
    37473900                  PDG2=211;
    3748                                             }
     3901                }
    37493902                else if(totPDG==10)              // "Chipolino" case
    3750                                             {
     3903                {
    37513904                  G4QChipolino resChip(totQC);   // define the residual as a Chipolino
    37523905                  G4QPDGCode h1=resChip.GetQPDG1();
     
    37563909                  PDG2=h2.GetPDGCode();          // PDG code of the second hadron
    37573910                  m2  =h2.GetMass();             // Mass of the second hadron
    3758                                             }
     3911                }
    37593912                if(totMass>m1+m2)
    3760                                             {
     3913                {
    37613914                  G4LorentzVector fq4M(0.,0.,0.,m1);
    37623915                  G4LorentzVector qe4M(0.,0.,0.,m2);
    37633916                  if(!G4QHadron(tot4M).DecayIn2(fq4M,qe4M))
    3764                                        {
     3917                  {
    37653918                    G4cout<<"---Warning---G4QE::HaQE:tM="<<tot4M.m()<<"-> h1="<<PDG1<<"(M="
    3766                                                              <<m1<<") + h2="<<PDG2<<"(M="<<m2<<")="<<m1+m2<<G4endl;
     3919                          <<m1<<") + h2="<<PDG2<<"(M="<<m2<<")="<<m1+m2<<G4endl;
    37673920                    G4Quasmon* quasH = new G4Quasmon(totQC,tot4M); // totQC not tQC!
    37683921                    CleanUp();
    3769                                   if(!CheckGroundState(quasH,true))
     3922                    if(!CheckGroundState(quasH,true))
    37703923                    {
    37713924                      G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC!
     
    37743927                      G4cout<<"***G4QE::HQE:FillAsIs(9),QC="<<totQC<<",4M="<<tot4M<<G4endl;
    37753928#endif
    3776                                                   //throw G4QException("G4QEnv::HadrQEnv: h1+h2 DecayIn2 Error");
     3929                      //throw G4QException("G4QEnv::HadrQEnv: h1+h2 DecayIn2 Error");
    37773930                    }
    37783931                    delete quasH; 
    37793932                    return theQHadrons;
    3780                                        }
     3933                  }
    37813934                  G4QHadron* H1 = new G4QHadron(PDG1,fq4M);
    37823935                  theQHadrons.push_back(H1);     // (delete equivalent)
     
    37903943                  theQHadrons.push_back(H2);     // (delete equivalent)
    37913944                  break;
    3792                                             }
     3945                }
    37933946                else totM=350000.;
    3794                                    }
    3795                                    else if(totPDG) totM=G4QPDGCode(totPDG).GetMass();
     3947              }
     3948              else if(totPDG) totM=G4QPDGCode(totPDG).GetMass();
    37963949              else totM=400000.;
    3797                                  }
     3950            }
    37983951            totBN=totQC.GetBaryonNumber();      // The BaryNum after addition
    37993952            totS=totQC.GetStrangeness();        // The Strangeness after addition
    38003953            G4double dM=totMass-totM;
    38013954#ifdef fdebug
    3802                           G4cout<<"G4QEnv::HadrQE: Add H="<<last4M<<lastQC<<",tM="<<tot4M<<totM<<totQC
     3955            G4cout<<"G4QEnv::HadrQE: Add H="<<last4M<<lastQC<<",tM="<<tot4M<<totM<<totQC
    38033956                  <<",dM="<<dM<<", tB="<<totBN<<", tS="<<totS<<G4endl;
    38043957#endif
    38053958            if(dM>-0.001&&totPDG)
    3806                           {
     3959            {
    38073960              CleanUp();
    38083961              G4QHadron* evH = new G4QHadron(totPDG,tot4M);//Create Hadron for ResidNucleus
    38093962              EvaporateResidual(evH);           // Evaporate ResNuc (del.equiv)
    38103963              break;
    3811                           }
     3964            }
    38123965            nOfOUT  = theQHadrons.size();       // Update the value of OUTPUT entries
    3813                         } // End of WHILE(nOfOUT)
     3966          } // End of WHILE(nOfOUT)
    38143967          nOfOUT  = theQHadrons.size();         // Update the value of OUTPUT entries
    3815                         if(!nOfOUT)
    3816                         {
    3817                           G4cout<<"---Warning---G4QEnv::HadrQE:M="<<totMass<<"<gsM="<<totM<<",dM="<<dM
     3968          if(!nOfOUT)
     3969          {
     3970            G4cout<<"---Warning---G4QEnv::HadrQE:M="<<totMass<<"<gsM="<<totM<<",dM="<<dM
    38183971                  <<", tPDG="<<totPDG<<", t4M="<<tot4M<<G4endl;
    3819                                  // throw G4QException("G4QEnvironment::HadronizeQEnv:Can't decayExhostedQEnv");
     3972            // throw G4QException("G4QEnvironment::HadronizeQEnv:Can't decayExhostedQEnv");
    38203973            CleanUp();
    38213974            G4QHadron* evH = new G4QHadron(totPDG,tot4M);// Create Hadron for ResidNucleus
    38223975            EvaporateResidual(evH);             // Evaporate ResidNucl (del.equiv)
    3823                  }
    3824                       }
     3976          }
     3977        }
    38253978        else                                    // "Last decay was fatal" case @@ buggy ?MK
    3826                       {
    3827 #ifdef pdebug
    3828                         G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl;
     3979        {
     3980#ifdef pdebug
     3981          G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl;
    38293982#endif
    38303983          G4Quasmon* quasH = new G4Quasmon(totQC,tot4M);
    38313984          CleanUp();
    3832                         if(!CheckGroundState(quasH,true))
     3985          if(!CheckGroundState(quasH,true))
    38333986          {
    38343987            G4QHadron* hadr = new G4QHadron(totQC,tot4M);
     
    38413994        }
    38423995        CleanUp();
    3843              }
    3844            } // End of "infinit" WHILE LOOP
     3996      }
     3997    } // End of "infinit" WHILE LOOP
    38453998  } // End of the "Nuclear Environment" case
    38463999  return theQHadrons;
     
    38724025  G4int thePDG = qH->GetPDGCode();           // Get PDG code of the Residual Nucleus
    38734026  G4int theBN  = qH->GetBaryonNumber();      // A (Baryon number of the nucleus)
     4027  G4QContent  theQC  = qH->GetQC();          // Quark Content of the hadron
     4028  G4int theS=theQC.GetStrangeness();         // S (Strangeness of the nucleus)
    38744029#ifdef pdebug
    38754030  G4cout<<"G4QE::EvaporateRes:Called for PDG="<<thePDG<<",4M="<<qH->Get4Momentum()<<G4endl;
    38764031#endif
    3877   if(theBN==1)
     4032  if(theS<0)                                 // Antistrange nucleus
     4033  {
     4034#ifdef pdebug
     4035    G4cout<<"G4QE::EvaporateRes: AntistrangeNucleus="<<thePDG<<qH->Get4Momentum()<<G4endl;
     4036#endif
     4037    DecayAntistrange(qH);                    // (delete equivalent)
     4038    return;
     4039  }
     4040  else if(theBN==1)
    38784041  {
    38794042#ifdef pdebug
    38804043    G4cout<<"G4QE::EvaporateRes: Baryon="<<thePDG<<qH->Get4Momentum()<<G4endl;
    38814044#endif
    3882     DecayBaryon(qH);                     // (delete equivalent)
    3883 #ifdef qdebug
    3884     qH=0;
    3885 #endif
     4045    DecayBaryon(qH);                         // (delete equivalent)
    38864046    return;
    38874047  }
     
    38954055    //DecayMeson(qH);                        // @@
    38964056    theQHadrons.push_back(qH);
    3897 #ifdef qdebug
    3898     qH=0;
    3899 #endif
    39004057    return;
    39014058  }
    3902   G4QContent  theQC  = qH->GetQC();          // Quark Content of the hadron
    39034059  G4int theC=theQC.GetCharge();              // P
    3904   G4int theS=theQC.GetStrangeness();         // S
    39054060  if(!thePDG) thePDG = theQC.GetSPDGCode();  // If there is no PDG code, get it from QC
    39064061  if(thePDG==10&&theQC.GetBaryonNumber()>0) thePDG=theQC.GetZNSPDGCode();
     
    39254080  {
    39264081    theQHadrons.push_back(qH);               // fill As It Is
    3927 #ifdef qdebug
    3928      qH=0;
    3929 #endif
    39304082  }
    39314083  else if(totMass>totGSM)
     
    39724124} // End of EvaporateResidual
    39734125
    3974 //The public Hadronisation function with the Exception treatment (del respons. of User !)
     4126//Public Hadronisation function with Exception treatment (del is responsibility of User!)
    39754127G4QHadronVector* G4QEnvironment::Fragment()
    39764128{//              ==========================
     
    40394191    {
    40404192      RepFlag=false;                      // If OK - go out of the while
    4041       theFragments = FSInteraction();     //InterClass creation. User must delet QHadrons.
     4193      theFragments = FSInteraction();     // InterClass creation. User must delet QHadrons.
    40424194    }
    40434195    catch (G4QException& error)
     
    40554207        G4QHadron* cH = theQHadrons[ph];
    40564208        dif-=cH->Get4Momentum();
    4057                       G4cout<<"***G4QEnvir::Fr:H"<<ph<<"="<<cH->Get4Momentum()<<cH->GetPDGCode()<<G4endl;
     4209        G4cout<<"***G4QEnvir::Fr:H"<<ph<<"="<<cH->Get4Momentum()<<cH->GetPDGCode()<<G4endl;
    40584210      }
    40594211      for(G4int pq=0; pq<nQp; pq++)
     
    41104262    G4int nProj=theProjectiles.size();
    41114263    if(nProj) for(G4int ipr=0; ipr<nProj; ipr++)
    4112            {
     4264    {
    41134265      G4QHadron* prH = theProjectiles[ipr];
    41144266      G4cerr<<"G4QE::F:#"<<ipr<<",PDG/4M="<<prH->GetPDGCode()<<prH->Get4Momentum()<<G4endl;
    41154267    }
    4116            throw G4QException("G4QEnvironment::Fragment:This reaction caused the CHIPSException");
     4268    throw G4QException("G4QEnvironment::Fragment:This reaction caused the CHIPSException");
    41174269    //G4Exception("G4QEnvironment::Fragment","027",FatalException,"GeneralCHIPSException");
    41184270  }
     
    41214273  if(tmpS)
    41224274  {
    4123     tmpS=theFragments->size();
    4124     intQHadrons.resize(tmpS+intQHadrons.size()); // Resize intQHadrons
    4125     copy(theFragments->begin(), theFragments->end(), intQHadrons.end()-tmpS);
    4126     tmpS=intQHadrons.size();
    4127     theFragments->resize(tmpS); // Resize theFragments
    4128     copy(intQHadrons.begin(), intQHadrons.end(), theFragments->begin());
     4275    //tmpS=theFragments->size();
     4276    //intQHadrons.resize(tmpS+intQHadrons.size());
     4277    //copy(theFragments->begin(), theFragments->end(), intQHadrons.end()-tmpS);
     4278    //tmpS=intQHadrons.size();
     4279    //theFragments->resize(tmpS);  // Resize theFragments
     4280    //copy(intQHadrons.begin(), intQHadrons.end(), theFragments->begin());
     4281    // Can be like this, but by performance it is closer to FNAL (but better than it)
     4282    //copy(theFragments->begin(), theFragments->end(), back_inserter(intQHadrons));
     4283    //theFragments->resize(intQHadrons.size());  // Resize theFragments
     4284    //copy(intQHadrons.begin(), intQHadrons.end(), theFragments->begin());
     4285    // The following (istead of all above) has worse performance !
     4286    theFragments->insert(theFragments->begin(), intQHadrons.begin(), intQHadrons.end() );
    41294287    intQHadrons.clear();
    41304288  }
     
    42004358  for (G4int is=0; is<nQuasmons; is++) // Sum 4mom's of Quasmons for comparison
    42014359  {
    4202            G4Quasmon*      pQ = theQuasmons[is];
     4360    G4Quasmon*      pQ = theQuasmons[is];
    42034361    G4LorentzVector Q4M= pQ->Get4Momentum();
    42044362    G4cout<<"G4QE::FSI: Quasmon ("<<is<<") is added, 4M="<<Q4M<<G4endl;
     
    42624420  for (G4int js=0; js<nQuasmons; js++)    // Subtract 4mom's of Quasmons (compare)
    42634421  {                                       //                                       
    4264            G4Quasmon*      prQ = theQuasmons[js];//                                 
     4422    G4Quasmon*      prQ = theQuasmons[js];//                                 
    42654423    if(prQ->GetStatus())                  // Subtract only if Quasmon is alive     
    42664424    {                                     //                                       
     
    42704428      t4M          -= Q4M;                // Subtract 4-momentum of the Quasmon       
    42714429      tC           -= prQ->GetQC().GetCharge(); //                           
    4272            }                                     //                                       
     4430    }                                     //                                       
    42734431    else G4cout<<"G4QE::FSI:Dead Quasmon("<<js<<")="<<prQ->GetStatus()<<G4endl;
    42744432  } // End of Quasmons4Momentum subtractions                                 
     
    42844442      t4M          -= hs4Mom;           //                                       
    42854443      tC           -= theQHadrons[jpo]->GetCharge(); // Subtract charge of the OutHadron
    4286            }                                   // End of the "FinalHadron" IF           
     4444    }                                   // End of the "FinalHadron" IF           
    42874445  }                                     // End of the LOOP over output hadrons   
    42884446  G4cout<<"G4QEnv::FSI:|||||4-MomCHECK||||d4M="<<t4M<<",dCharge="<<tC<<G4endl;
     
    42924450  {
    42934451    G4cout<<"---Warning---G4QEnvironment::FSInteraction: nHadrons="<<nHadr<<G4endl;
    4294         //throw G4QException("G4QEnvironment::FSInteraction: No hadrons in the output");
     4452    //throw G4QException("G4QEnvironment::FSInteraction: No hadrons in the output");
    42954453    return theFragments;
    42964454  }
     
    43274485      if(!CheckGroundState(quasH,true))// Try to correct with other hadrons
    43284486      {
     4487#ifdef pdebug
     4488        // M.K. Fake complain in the low energy nHe/pHe reactions, while everything is OK
    43294489        G4cout<<"---Warning---G4QEnv::FSI:Correction error LeaveAsItIs h4m="<<lh4M<<G4endl;
     4490#endif
    43304491        theQHadrons.push_back(curHadr);// Fill theResidualNucleus asItIs(delete equivalent)
    4331                //throw G4QException("G4QEnv::FSI: STOP at Correction Error");
     4492        //throw G4QException("G4QEnv::FSI: STOP at Correction Error");
    43324493      }
    43334494      else
     
    43864547#endif
    43874548    if(hBN>lHadr) // Current Hadron is the Biggest fragment -> Swap with theLast Hadron
    4388            {
     4549    {
    43894550      G4QHadron* theLast = theCurr;          // Prototype of the pointer to the Last Hadron
    43904551      G4QHadron* curHadr = new G4QHadron(theCurr);// Remember CurrentHadron for evaporation
     
    44064567      sBN  = theCurr->GetStrangeness();
    44074568      hPDG = theCurr->GetPDGCode();
    4408            }
     4569    }
    44094570    if(hPDG==89002000||hPDG==89001001||hPDG==89000002)// 2pt dec. of anti-strange (3pt dec)
    44104571    {
     
    44214582      G4double tM = 0.;
    44224583      if(hPDG==89002000)                     // Use the prototypes above
    4423              {
     4584      {
    44244585        if(hMi<mKmP)
    4425                       {
     4586        {
    44264587          if(hMi>mProt+mPi+mPi0)
    4427                         {
     4588          {
    44284589            sPDG=211;
    44294590            sM  =mPi;
     
    44324593          }
    44334594          else if(hMi>mProt+mPi) // @@ Does not conserve strangeness (Week decay)
    4434                         {
     4595          {
    44354596#ifdef pdebug
    44364597            G4cout<<"**G4QE::FSI:ANTISTRANGE*++*STRANGENESS,PDG="<<hPDG<<",M="<<hM<<G4endl;
     
    44424603        }
    44434604      }
    4444              else if(hPDG==89001001)
    4445              {
     4605      else if(hPDG==89001001)
     4606      {
    44464607        fQPDG= nQPDG;
    44474608        fM   = mNeut;
     
    44554616          sM   = mK0;
    44564617        }
    4457                       else if(hMi<mKmN)
    4458                       {
     4618        else if(hMi<mKmN)
     4619        {
    44594620          if(hMi>mProt+mPi0+mPi0)
    4460                         {
     4621          {
    44614622            fQPDG= pQPDG;
    44624623            fM   = mProt;
     
    44664627            tM   = mPi0;
    44674628            if(hMi>mNeut+mPi+mPi0&&G4UniformRand()>.67)
    4468                           {
     4629            {
    44694630              fQPDG= nQPDG;
    44704631              fM   = mNeut;
     
    44734634            }
    44744635            if(hMi>mProt+mPi+mPi&&G4UniformRand()>.5)
    4475                           {
     4636            {
    44764637              sPDG = 211;
    44774638              sM   = mPi;
     
    44814642          }
    44824643          else if(hMi>mProt+mPi0) // @@ Does not conserve strangeness (Week decay)
    4483                         {
     4644          {
    44844645#ifdef pdebug
    44854646            G4cout<<"**G4QE::FSI:*ANTISTRANGE*+*STRANGENESS*PDG="<<hPDG<<",M="<<hM<<G4endl;
     
    44934654        }
    44944655      }
    4495              else if(hPDG==89000002)
    4496              {
     4656      else if(hPDG==89000002)
     4657      {
    44974658        fQPDG= nQPDG;
    44984659        fM   = mNeut;
     
    45004661        sM   = mK0;
    45014662        if(hMi<mK0mN)
    4502                       {
     4663        {
    45034664          if(hMi>mNeut+mPi+mPi)
    4504                         {
     4665          {
    45054666            sPDG = 211;
    45064667            sM   = mPi;
     
    45094670          }
    45104671          if(hMi>mProt+mPi+mPi0)
    4511                         {
     4672          {
    45124673            fQPDG= pQPDG;
    45134674            fM   = mProt;
     
    45184679          }
    45194680          else if(hMi>mProt+mPi) // @@ Does not conserve strangeness (Week decay)
    4520                         {
     4681          {
    45214682#ifdef pdebug
    45224683            G4cout<<"**G4QE::FSI:**ANTISTRANGE*0*STRANGENE**PDG="<<hPDG<<",M="<<hM<<G4endl;
     
    45294690          else sPDG=0;      // @@ Still can try to decay in gamma+neutron (electromagnetic)
    45304691        }
    4531              }
     4692      }
    45324693      if(!sPDG)
    4533              {
     4694      {
    45344695#ifdef pdebug
    45354696        G4cout<<"***G4QE::FSI:***ANTISTRANGE***CANN'T DECAY,PDG="<<hPDG<<",M="<<hM<<G4endl;
     
    45434704        G4double sum=fM+sM;
    45444705        if(fabs(hM-sum)<=eps)
    4545                       {
     4706        {
    45464707          f4M=h4Mom*(fM/sum);
    45474708          s4M=h4Mom*(sM/sum);
    4548                       }
     4709        }
    45494710        else if(hM<sum || !G4QHadron(h4Mom).DecayIn2(f4M,s4M))
    4550                {
     4711        {
    45514712          G4cout<<"---Warning---G4QE::FSI: Still try(2),M="<<hM<<"->"<<fM<<"("<<fQPDG<<")+"
    45524713                <<sM<<"("<<sPDG<<")="<<sum<<G4endl;
     
    45884749            //           7. Forbid the decay
    45894750            fOK=false;
    4590                         }
     4751          }
    45914752          else
    45924753          {
    45934754            G4cerr<<"***G4QEnv::FSI: No recovery (1) Env="<<theEnvironment<<G4endl;
    4594                    throw G4QException("G4QEnv::FSI:ANTISTRANGE DecayIn2 did not succeed");
     4755            throw G4QException("G4QEnv::FSI:ANTISTRANGE DecayIn2 did not succeed");
    45954756          }
    4596                }
     4757        }
    45974758        if(fOK)
    45984759        {
     
    46024763          theQHadrons.push_back(sH);               // (delete equivalent)
    46034764        }
    4604              }
     4765      }
    46054766      else
    46064767      {
     
    46114772        G4double sum=fM+sM+tM;
    46124773        if(fabs(hM-sum)<=eps)
    4613                       {
     4774        {
    46144775          f4M=h4Mom*(fM/sum);
    46154776          s4M=h4Mom*(sM/sum);
    46164777          t4M=h4Mom*(tM/sum);
    4617                       }
     4778        }
    46184779        else if(hM<sum || !G4QHadron(h4Mom).DecayIn3(f4M,s4M,t4M))
    4619                {
     4780        {
    46204781          G4cout<<"---Warning---G4QE::FSI: Still try(3), M"<<hM<<"->"<<fM<<"("<<fQPDG<<")+"
    46214782                <<sM<<"("<<sPDG<<")+"<<tM<<"("<<tPDG<<")="<<sum<<G4endl;
     
    46494810            delete quasH;
    46504811            fOK=false;
    4651                         }
     4812          }
    46524813          else
    46534814          {
    46544815            G4cout<<"***G4QEnv::FSI: No recovery (2) Env="<<theEnvironment<<G4endl;
    4655                    throw G4QException("G4QEnv::FSI:ANTISTRANGE DecayIn3 did not succeed");
     4816            throw G4QException("G4QEnv::FSI:ANTISTRANGE DecayIn3 did not succeed");
    46564817          }
    4657                }
     4818        }
    46584819        if(fOK)
    46594820        {
     
    46654826          theQHadrons.push_back(tH);               // (delete equivalent)
    46664827        }
    4667              }
     4828      }
    46684829      nHadr=theQHadrons.size();
    4669            }
     4830    }
    46704831    else if(hPDG==89999003||hPDG==90002999||hPDG==90000003||hPDG==90003000||
    46714832            hPDG==90999002||hPDG==91001999) // "3-particles decays of dibaryons and 3N"
     
    46824843      G4double tM   = mPi;
    46834844      if(hPDG==90002999)       // p,p,pi+
    4684              {
     4845      {
    46854846        nuQPDG = pQPDG;        // Substitute p for the first n
    46864847        nucM   = mProt;
     
    46884849        barM   = mProt;
    46894850        tPDG   = 211;          // Substitute pi+ for the first pi-
    4690              }
     4851      }
    46914852      else if(hPDG==90003000)  // 3p
    4692              {
     4853      {
    46934854        nuQPDG = pQPDG;        // Substitute p for the first n
    46944855        nucM   = mProt;
     
    46974858        tPDG   = 2212;         // Substitute p for pi-
    46984859        tM     = mProt;
    4699              }
     4860      }
    47004861      else if(hPDG==90999002)  // n,Lambda,pi-/n,Sigma0,pi-/n,Sigma-,gamma(@@)
    4701              {
     4862      {
    47024863        if(hM>mSigZ+mNeut+mPi)
    4703                       {
     4864        {
    47044865          G4double ddMass=hM-mPi;          // Free CM energy
    47054866          G4double dd2=ddMass*ddMass;      // Squared free energy
     
    47204881            barPDG = 3122;     // Substitute Lambda for the second n
    47214882            barM   = mLamb;
    4722                         }
     4883          }
    47234884        }
    47244885        else if(hM>mLamb+mNeut+mPi)
     
    47344895          tM     = 0;
    47354896        }
    4736              }
     4897      }
    47374898      else if(hPDG==91001999)  // p,Lambda,pi+/p,Sigma0,pi+/p,Sigma+,gamma(@@)
    4738              {
     4899      {
    47394900        nuQPDG = pQPDG;        // Substitute p for the first n
    47404901        nucM   = mProt;
    47414902        tPDG   = 211;          // Substitute pi+ for the first pi-
    47424903        if(hM>mSigZ+mProt+mPi)
    4743                       {
     4904        {
    47444905          G4double ddMass=hM-mPi;          // Free CM energy
    47454906          G4double dd2=ddMass*ddMass;      // Squared free energy
     
    47604921            barPDG = 3122;     // Substitute Lambda for the second n
    47614922            barM   = mLamb;
    4762                         }
     4923          }
    47634924        }
    47644925        if(hM>mLamb+mProt+mPi)
     
    47744935          tM     = 0;
    47754936        }
    4776              }
     4937      }
    47774938      else if(hPDG==90000003)  // 3n
    4778              {
     4939      {
    47794940        tPDG   = 2112;         // Substitute n for pi-
    47804941        tM     = mNeut;
    4781              }
     4942      }
    47824943      G4bool fOK=true;
    47834944      G4LorentzVector nu4M(0.,0.,0.,nucM);
     
    47864947      G4double sum=nucM+barM+tM;
    47874948      if(fabs(hM-sum)<=eps)
    4788              {
     4949      {
    47894950        nu4M=h4Mom*(nucM/sum);
    47904951        ba4M=h4Mom*(barM/sum);
    47914952        pi4M=h4Mom*(tM/sum);
    4792              }
     4953      }
    47934954      if(hM<sum || !G4QHadron(h4Mom).DecayIn3(nu4M,ba4M,pi4M))
    4794              {
     4955      {
    47954956#ifdef pdebug
    47964957        G4int eA=theEnvironment.GetA();
     
    48144975            else theCurr->SetQC(theLast->GetQC());// CurHadrPDG instead of LastHadrPDG
    48154976#ifdef pdebug
    4816                                  G4cout<<"---Warning---G4QE::FSI:l#"<<nhd1<<",4M="<<l4M<<",PDG="<<lQP<<G4endl;
     4977            G4cout<<"---Warning---G4QE::FSI:l#"<<nhd1<<",4M="<<l4M<<",PDG="<<lQP<<G4endl;
    48174978#endif
    48184979            theCurr->Set4Momentum(theLast->Get4Momentum()); // ... 4Momentum substitution
     
    48384999          delete quasH;
    48395000          fOK=false;
    4840                       //}
    4841                       //else
    4842                       //{
     5001        //}
     5002        //else
     5003        //{
    48435004        //  G4cerr<<"***G4QEnv::FSI:NoRec(3)E="<<theEnvironment<<eA<<",PDG="<<hPDG<<G4endl;
    4844                //  throw G4QException("G4QEnv::FSI:ISO-dibaryon or 3n/3p DecayIn3 error");
    4845                     //}
    4846              }
     5005        //  throw G4QException("G4QEnv::FSI:ISO-dibaryon or 3n/3p DecayIn3 error");
     5006      //}
     5007      }
    48475008      if(fOK)
    48485009      {
     
    48555016        nHadr=theQHadrons.size();
    48565017      }
    4857            }
     5018    }
    48585019    else if(hBN>1 && !sBN && (cBN<0 || cBN>hBN)) // "nN+mD- or nP+mD++ decay"
    48595020    {
     
    48715032      G4int    nPi  = -cBN;    // a#of Pi-'s
    48725033      if( cBN>hBN)             // reinitialization for the "(n+m)*P,m*pi+" case
    4873              {
     5034      {
    48745035        nuQPDG = pQPDG;        // Substitute p for the first n
    48755036        nucM   = mProt;
     
    48875048      G4double sum=nucM+barM+tM;
    48885049      if(fabs(hM-sum)<=eps)
    4889              {
     5050      {
    48905051        nu4M=h4Mom*(nucM/sum);
    48915052        ba4M=h4Mom*(barM/sum);
    48925053        pi4M=h4Mom*(tM/sum);
    4893              }
     5054      }
    48945055      if(hM<sum || !G4QHadron(h4Mom).DecayIn3(nu4M,ba4M,pi4M))
    4895              {
     5056      {
    48965057#ifdef pdebug
    48975058        G4cout<<"***G4QEnv::FSI:IsN M="<<hM<<","<<hPDG<<"->N="<<nuQPDG<<"(M="<<nucM<<")+"
     
    49305091          delete quasH;
    49315092          fOK=false;
    4932                       }
     5093        }
    49335094        else
    49345095        {
    49355096          G4cout<<"***G4QEnv::FSI:IN,NoRec(4) Env="<<theEnvironment<<",PDG="<<hPDG<<G4endl;
    4936                  throw G4QException("G4QEnv::FSI:IN Multy ISO-dibaryon DecayIn3 did not succeed");
    4937         }
    4938              }
     5097          throw G4QException("G4QEnv::FSI:IN Multy ISO-dibaryon DecayIn3 did not succeed");
     5098        }
     5099      }
    49395100      if(fOK)
    49405101      {
     
    50275188        G4double     tM =mPi;
    50285189        if(hPDG==90002999)
    5029                       {
     5190        {
    50305191          fQPDG=pQPDG;
    50315192          fM   =mProt;
     
    50405201        G4double sum=fM+sM+tM;
    50415202        if(fabs(hM-sum)<=eps)
    5042                       {
     5203        {
    50435204          f4M=h4Mom*(fM/sum);
    50445205          s4M=h4Mom*(sM/sum);
    50455206          t4M=h4Mom*(tM/sum);
    5046                       }
     5207        }
    50475208        else if(hM<sum || !G4QHadron(h4Mom).DecayIn3(f4M,s4M,t4M))
    5048                {
     5209        {
    50495210          G4cout<<"---WARNING---G4QE::FSI: Still trying, NDM="<<hM<<"->"<<fM<<"("<<fQPDG
    50505211                <<")+"<<sM<<"("<<sPDG<<")+"<<tM<<"("<<tPDG<<")="<<sum<<G4endl;
     
    50765237            delete quasH;
    50775238            fOK=false;
    5078                         }
     5239          }
    50795240          else
    50805241          {
    50815242            G4cout<<"***G4QEnv::FSI: No ND recovery Env="<<theEnvironment<<G4endl;
    5082                    throw G4QException("G4QEnv::FSI:ND DecayIn3 did not succeed");
     5243            throw G4QException("G4QEnv::FSI:ND DecayIn3 did not succeed");
    50835244          }
    5084                }
     5245        }
    50855246        if(fOK)
    50865247        {
     
    50955256        hQPDG= G4QPDGCode(hPDG);
    50965257        hGSM = hQPDG.GetMass();                  // Change GroundStateMass of theFirstFragm
    5097              }
     5258      }
    50985259      nHadr=theQHadrons.size();
    50995260      if(hPDG==89001001||hPDG==89002000||hPDG==89000002)
     
    51075268        G4double     sM =mK0;
    51085269        if(hPDG==89000002)
    5109                       {
     5270        {
    51105271          fQPDG=pQPDG;
    51115272          fM   =mProt;
     
    51145275        }
    51155276        if(hPDG==89001001)
    5116                       {
     5277        {
    51175278          if(hM<mK0+mProt || G4UniformRand()>.5)
    51185279          {
     
    51315292        G4double sum=fM+sM;
    51325293        if(fabs(hM-sum)<=eps)
    5133                       {
     5294        {
    51345295          f4M=h4Mom*(fM/sum);
    51355296          s4M=h4Mom*(sM/sum);
    5136                       }
     5297        }
    51375298        else if(hM<sum || !G4QHadron(h4Mom).DecayIn2(f4M,s4M))
    5138                {
     5299        {
    51395300          G4cout<<"---WARNING---G4QE::FSI: Still trying (2),NDM="<<hM<<"->"<<fM<<"("<<fQPDG
    51405301                <<")+"<<sM<<"("<<sPDG<<")="<<sum<<G4endl;
     
    51665327            delete quasH;
    51675328            fOK=false;
    5168                         }
     5329          }
    51695330          else
    51705331          {
    51715332            G4cerr<<"***G4QEnv::FSI: No KN recovery Env="<<theEnvironment<<G4endl;
    5172                    throw G4QException("G4QEnv::FSI:KN DecayIn2 did not succeed");
     5333            throw G4QException("G4QEnv::FSI:KN DecayIn2 did not succeed");
    51735334          }
    5174                }
     5335        }
    51755336        if(fOK)
    51765337        {
     
    51835344        hQPDG= G4QPDGCode(hPDG);
    51845345        hGSM = hQPDG.GetMass();                  // Change GroundStateMass of theFirstFragm
    5185              }
     5346      }
    51865347      nHadr=theQHadrons.size();
    51875348      G4int           hS = curHadr->GetStrangeness();
     
    51995360      G4cout<<"G4QE::FSI:h="<<hPDG<<",S="<<hS<<",B="<<hB<<",#"<<hadron<<"<"<<nHadr<<G4endl;
    52005361#endif
    5201              //if(hadron&&!hF&&hB>0&&!hS&&(nHadr>3||hB<2)) // ThermoBackFus (VIMP for gamA TotCS)
    5202              //if(hadron&&!hF&&hB>0&&!hS&&(nHadr>2||hB<4)) // ThermoBackFus (VIMP for gamA TotCS)
    5203              if(hadron&&!hF&&hB>0&&!hS) // ThermoBackFusion cond. (VIMP for gamA TotCS)
    5204              //if(hadron&&!hF&&hB>0&&hB<4&&!hS) // ThermoBackFusion cond. (VIMP for gamA TotCS)
    5205              //if(hadron&&!hF&&hB>0&&!hS&&nHadr>2)//ThermoBackFusion MAX condition (VIMP for gamA)
    5206              //if(2>3)                         // Close the ThermoBackFusion (VIMP for gamA TotCS)
     5362      //if(hadron&&!hF&&hB>0&&!hS&&(nHadr>3||hB<2)) // ThermoBackFus (VIMP for gamA TotCS)
     5363      //if(hadron&&!hF&&hB>0&&!hS&&(nHadr>2||hB<4)) // ThermoBackFus (VIMP for gamA TotCS)
     5364      if(hadron&&!hF&&hB>0&&!hS) // ThermoBackFusion cond. (VIMP for gamA TotCS)
     5365      //if(hadron&&!hF&&hB>0&&hB<4&&!hS) // ThermoBackFusion cond. (VIMP for gamA TotCS)
     5366      //if(hadron&&!hF&&hB>0&&!hS&&nHadr>2)//ThermoBackFusion MAX condition (VIMP for gamA)
     5367      //if(2>3)                         // Close the ThermoBackFusion (VIMP for gamA TotCS)
    52075368      {
    52085369#ifdef pdebug
     
    52125373        G4QContent hQC = curHadr->GetQC();
    52135374        if(hadron&&!hF&&hB>0) for(unsigned pt=0; pt<hadron; pt++)
    5214                {
     5375        {
    52155376          G4QHadron* backH = theQHadrons[pt];   // Get pointer to one of thePreviousHadrons
    52165377          G4int   bF = backH->GetNFragments();
     
    52385399#ifdef pdebug
    52395400          //if(nHadr==3)
    5240                         G4cout<<"G4QE::FSI:"<<pt<<",B="<<bB<<",S="<<bS<<",p="<<pCM2<<"<"<<p2cut<<",hB="
     5401          G4cout<<"G4QE::FSI:"<<pt<<",B="<<bB<<",S="<<bS<<",p="<<pCM2<<"<"<<p2cut<<",hB="
    52415402                <<hB<<",bM+hM="<<bM+hM<<">tM="<<tM<<",tQC="<<sQC<<G4endl;
    52425403#endif
    52435404          //if(!bF&&(bB==1||hB==1)&&bM+hM>tM+.001&&pCM2<p2cut)      // Only baryons == pcut
    5244                         //if(!bF&&!bS&&(bB==1&&hB>0||hB==1&&bB>0)&&bM+hM>tM+.00001
     5405          //if(!bF&&!bS&&(bB==1&&hB>0||hB==1&&bB>0)&&bM+hM>tM+.00001
    52455406          //   && (pCM2<p2cut&&nHadr>3||pCM2<p2cut2&&nHadr==3))
    5246                         //if(!bF&&(bB==1||hB==1)&&bM+hM>tM+.001&&(pCM2<p2cut&&nHadr>3 ||
    5247                         //   pCM2<p2cut2&&nHadr==3&&bPDG>90000000))
     5407          //if(!bF&&(bB==1||hB==1)&&bM+hM>tM+.001&&(pCM2<p2cut&&nHadr>3 ||
     5408          //   pCM2<p2cut2&&nHadr==3&&bPDG>90000000))
    52485409          //if(!bF&&bB<4&&bM+hM>tM+.001&&pCM2<p2cut)
    52495410          if(!bF&&!bS&&bB>0&&bM+hM>tM+.001&&pCM2<p2cut)
    52505411          //if(!bF&&bB<4&&bM+hM>tM+.001&&(pCM2<p2cut || bB+hB==4&&pCM2<p2cut2))
    5251                         //if(!bF&&(bB==1||hB==1)&&(nHadr>3||bPDG>90000000)&&bM+hM>tM+.001&&pCM2<p2cut)
    5252                         //if(!bF&&(bB==1&&!bC||hB==1&&!hC)&&bM+hM>tM+.001&&pCM2<p2cut)// Only n == pcut
    5253                         //if(!bF&&(bB==1||hB==1)&&bM+hM>tM+.001&&sM-bM-hM<cut)  // Only baryons == ecut
    5254                         //if(!bF&&bB&&bB<fL&&bM+hM>tM+.001&&sM-bM-hM<cut)    // Light fragments == ecut
    5255                  {
     5412          //if(!bF&&(bB==1||hB==1)&&(nHadr>3||bPDG>90000000)&&bM+hM>tM+.001&&pCM2<p2cut)
     5413          //if(!bF&&(bB==1&&!bC||hB==1&&!hC)&&bM+hM>tM+.001&&pCM2<p2cut)// Only n == pcut
     5414          //if(!bF&&(bB==1||hB==1)&&bM+hM>tM+.001&&sM-bM-hM<cut)  // Only baryons == ecut
     5415          //if(!bF&&bB&&bB<fL&&bM+hM>tM+.001&&sM-bM-hM<cut)    // Light fragments == ecut
     5416          {
    52565417#ifdef fdebug
    52575418            G4int bPDG = backH->GetPDGCode();
    5258                                  if(sPDG==89999003||sPDG==90002999||sPDG==89999002||sPDG==90001999)
     5419            if(sPDG==89999003||sPDG==90002999||sPDG==89999002||sPDG==90001999)
    52595420              G4cout<<"G4QE::FSI:**nD-/pD++**,h="<<hPDG<<",hB="<<hB<<",b="<<bPDG<<",bB="
    52605421                    <<bB<<G4endl;
    52615422            //if(nHadr==3)
    5262                    G4cout<<"G4QE::FSI:*FUSION*#"<<hadron<<"["<<hPDG<<"]"<<hM<<"+#"<<pt<<"["<<bPDG
     5423            G4cout<<"G4QE::FSI:*FUSION*#"<<hadron<<"["<<hPDG<<"]"<<hM<<"+#"<<pt<<"["<<bPDG
    52635424                  <<"]"<<bM<<"="<<bM+hM<<", sM="<<sM<<">["<<sPDG<<"]"<<tM<<",p2="<<pCM2
    52645425                  <<"<"<<p2cut<<G4endl;
     
    52745435            G4LorentzVector t4Mom(0.,0.,0.,0.);
    52755436            if(sPDG==89999002)                               // A=1
    5276                           {
     5437            {
    52775438              fQPDG=nQPDG;
    52785439              rQPDG=pimQPDG;
    52795440              f4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    52805441              g4Mom=G4LorentzVector(0.,0.,0.,mPi);
    5281                           }
     5442            }
    52825443            else if(sPDG==90001999)
    5283                           {
     5444            {
    52845445              fQPDG=pQPDG;
    52855446              rQPDG=pipQPDG;
    52865447              f4Mom=G4LorentzVector(0.,0.,0.,mProt);
    52875448              g4Mom=G4LorentzVector(0.,0.,0.,mPi);
    5288                           }
     5449            }
    52895450            else if(sPDG==90000002)                        // A=2
    5290                           {
     5451            {
    52915452              fQPDG=nQPDG;
    52925453              rQPDG=nQPDG;
    52935454              f4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    52945455              g4Mom=f4Mom;
    5295                           }
     5456            }
    52965457            else if(sPDG==90002000)
    5297                           {
     5458            {
    52985459              fQPDG=pQPDG;
    52995460              rQPDG=pQPDG;
    53005461              f4Mom=G4LorentzVector(0.,0.,0.,mProt);
    53015462              g4Mom=f4Mom;
    5302                           }
     5463            }
    53035464            else if(sPDG==92000000)
    5304                           {
     5465            {
    53055466              fQPDG=lQPDG;
    53065467              rQPDG=lQPDG;
     
    53085469              g4Mom=f4Mom;
    53095470              if(sM>mSigZ+mSigZ)             // Sigma0+Sigma0 is possible
    5310                                    {                                  // @@ Only two particles PS is used
     5471              {                                  // @@ Only two particles PS is used
    53115472                G4double sma=mLamb+mLamb;        // Lambda+Lambda sum
    53125473                G4double pr1=0.;                 // Prototype to avoid sqrt(-)
     
    53345495              }
    53355496              else if(sM>mSigZ+mLamb)            // Lambda+Sigma0 is possible
    5336                                    {                                  // @@ Only two particles PS is used
     5497              {                                  // @@ Only two particles PS is used
    53375498                G4double sma=mLamb+mLamb;        // Lambda+Lambda sum
    53385499                G4double pr1=0.;                 // Prototype to avoid sqrt(-)
     
    53485509                }                                //
    53495510              }                                  //
    5350                           }
     5511            }
    53515512            else if(sPDG==89999003)                       // A=2
    5352                           {
     5513            {
    53535514              hQPDG=nQPDG;
    53545515              rQPDG=nQPDG;
     
    53585519              f4Mom=G4LorentzVector(0.,0.,0.,mPi);
    53595520              three=true;
    5360                           }
     5521            }
    53615522            else if(sPDG==90002999)
    5362                           {
     5523            {
    53635524              hQPDG=pQPDG;
    53645525              rQPDG=pQPDG;
     
    53685529              f4Mom=G4LorentzVector(0.,0.,0.,mPi);
    53695530              three=true;
    5370                           }
     5531            }
    53715532            else if(sPDG==90000003)                        // A=3
    5372                           {
     5533            {
    53735534              hQPDG=nQPDG;
    53745535              rQPDG=nQPDG;
     
    53785539              f4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    53795540              three=true;
    5380                           }
     5541            }
    53815542            else if(sPDG==90003000)
    5382                           {
     5543            {
    53835544              hQPDG=pQPDG;
    53845545              rQPDG=pQPDG;
     
    53885549              f4Mom=G4LorentzVector(0.,0.,0.,mProt);
    53895550              three=true;
    5390                           }
     5551            }
    53915552            else if(sPDG==90001003)                     // A=4
    5392                           {
     5553            {
    53935554              rQPDG=nQPDG;
    53945555              fQPDG=tQPDG;
    53955556              g4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    53965557              f4Mom=G4LorentzVector(0.,0.,0.,mTrit);
    5397                           }
     5558            }
    53985559            else if(sPDG==90003001)
    5399                           {
     5560            {
    54005561              rQPDG=pQPDG;
    54015562              fQPDG=he3QPDG;
    54025563              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    54035564              f4Mom=G4LorentzVector(0.,0.,0.,mHe3);
    5404                           }
     5565            }
    54055566            else if(sPDG==90002003)                     // A=5
    5406                           {
     5567            {
    54075568              rQPDG=nQPDG;
    54085569              fQPDG=aQPDG;
    54095570              g4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    54105571              f4Mom=G4LorentzVector(0.,0.,0.,mAlph);
    5411                           }
     5572            }
    54125573            else if(sPDG==90003002)
    5413                           {
     5574            {
    54145575              rQPDG=pQPDG;
    54155576              fQPDG=aQPDG;
    54165577              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    54175578              f4Mom=G4LorentzVector(0.,0.,0.,mAlph);
    5418                           }
     5579            }
    54195580            else if(sPDG==90004002)                          // A=6
    5420                           {
     5581            {
    54215582              hQPDG=pQPDG;
    54225583              rQPDG=pQPDG;
     
    54265587              f4Mom=G4LorentzVector(0.,0.,0.,mAlph);
    54275588              three=true;
    5428                           }
     5589            }
    54295590            else if(sPDG==90002005)                        // A=7
    5430                           {
     5591            {
    54315592              rQPDG=nQPDG;
    54325593              fQPDG=a6QPDG;
    54335594              g4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    54345595              f4Mom=G4LorentzVector(0.,0.,0.,mHe6);
    5435                           }
     5596            }
    54365597            else if(sPDG==90005002)
    5437                           {
     5598            {
    54385599              rQPDG=pQPDG;
    54395600              fQPDG=be6QPDG;
    54405601              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    54415602              f4Mom=G4LorentzVector(0.,0.,0.,mBe6);
    5442                           }
     5603            }
    54435604            else if(sPDG==90004004)                        // A=8
    5444                           {
     5605            {
    54455606              fQPDG=aQPDG;
    54465607              rQPDG=aQPDG;
    54475608              f4Mom=G4LorentzVector(0.,0.,0.,mAlph);
    54485609              g4Mom=f4Mom;
    5449                           }
     5610            }
    54505611            //else if(sPDG==90006002)
    5451                           //{
     5612            //{
    54525613            //  hQPDG=pQPDG;
    54535614            //  rQPDG=pQPDG;
     
    54575618            //  f4Mom=G4LorentzVector(0.,0.,0.,mBe6);
    54585619            //  three=true;
    5459                           //}
     5620            //}
    54605621            //else if(sPDG==90002006)
    5461                           //{
     5622            //{
    54625623            //  hQPDG=nQPDG;
    54635624            //  rQPDG=nQPDG;
     
    54675628            //  f4Mom=G4LorentzVector(0.,0.,0.,mHe6);
    54685629            //  three=true;
    5469                           //}
     5630            //}
    54705631            else if(sPDG==90002007)                      // A=9
    5471                           {
     5632            {
    54725633              rQPDG=nQPDG;
    54735634              fQPDG=a8QPDG;
    54745635              g4Mom=G4LorentzVector(0.,0.,0.,mNeut);
    54755636              f4Mom=G4LorentzVector(0.,0.,0.,mHe8);
    5476                           }
     5637            }
    54775638            else if(sPDG==90005004)                      // A=9
    5478                           {
     5639            {
    54795640              rQPDG=pQPDG;
    54805641              fQPDG=aQPDG;
     
    54845645              t4Mom=G4LorentzVector(0.,0.,0.,mAlph);
    54855646              three=true;
    5486                           }
     5647            }
    54875648            else if(sPDG==90007002)                      // A=9
    5488                           {
     5649            {
    54895650              rQPDG=pQPDG;
    54905651              fQPDG=c8QPDG;
    54915652              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    54925653              f4Mom=G4LorentzVector(0.,0.,0.,mC8);
    5493                           }
     5654            }
    54945655            else if(sPDG==90008004)                      // A=12
    5495                           {
     5656            {
    54965657              hQPDG=pQPDG;
    54975658              rQPDG=pQPDG;
     
    55015662              f4Mom=G4LorentzVector(0.,0.,0.,mC10);
    55025663              three=true;
    5503                           }
     5664            }
    55045665            else if(sPDG==90009006)                     // A=15
    5505                           {
     5666            {
    55065667              rQPDG=pQPDG;
    55075668              fQPDG=o14QPDG;
    55085669              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    55095670              f4Mom=G4LorentzVector(0.,0.,0.,mO14);
    5510                           }
     5671            }
    55115672            else if(sPDG==90009007)                     // A=16
    5512                           {
     5673            {
    55135674              rQPDG=pQPDG;
    55145675              fQPDG=o15QPDG;
    55155676              g4Mom=G4LorentzVector(0.,0.,0.,mProt);
    55165677              f4Mom=G4LorentzVector(0.,0.,0.,mO15);
    5517                           }
     5678            }
    55185679            else if(sPDG==90010006)                     // A=16
    5519                           {
     5680            {
    55205681              hQPDG=pQPDG;
    55215682              rQPDG=pQPDG;
     
    55255686              f4Mom=G4LorentzVector(0.,0.,0.,mO14);
    55265687              three=true;
    5527                           }
     5688            }
    55285689#ifdef pdebug
    55295690            G4cout<<"G4QE::FSI: "<<three<<",r="<<rQPDG<<",f="<<fQPDG<<",t="<<hQPDG<<G4endl;
     
    55385699              }
    55395700              else
    5540                                    {
     5701              {
    55415702#ifdef pdebug
    55425703                G4cout<<"G4QE::FSI:*FUSION IS DONE*,fPDG="<<sPDG<<",PDG1="<<hPDG<<",PDG2="
     
    55525713#endif
    55535714              }
    5554                           }
     5715            }
    55555716            else
    55565717            {
     
    55625723              }
    55635724              else
    5564                                    {
     5725              {
    55655726#ifdef pdebug
    55665727                G4cout<<"G4QE::FSI:DONE,n="<<nHadr<<",PDG="<<sPDG<<",1="<<hPDG<<",2="<<bPDG
     
    55825743#endif
    55835744              }
    5584                           }
     5745            }
    55855746            tot4Mom+=b4m;                       // Instead of the fused hadron
    55865747            tot4Mom-=g4Mom;                     // subtract from the total the new hadron
     
    55935754            hB=hQC.GetBaryonNumber();
    55945755            hGSM = hQPDG.GetMass();
    5595                           h4m=f4Mom;
     5756            h4m=f4Mom;
    55965757            hM=h4m.m();
    55975758            // End of Instead ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     
    55995760            G4cout<<"G4QE::FSI:cH4M="<<curHadr->Get4Momentum()<<G4endl;
    56005761#endif
    5601                         } // End of the fusion check
    5602                } // End of the LOOP over previous hadrons
    5603              } // End of the FUSION check
     5762          } // End of the fusion check
     5763        } // End of the LOOP over previous hadrons
     5764      } // End of the FUSION check
    56045765#ifdef chdebug
    56055766      // *** (2) Charge Control Sum Calculation for the Charge Conservation Check ***
     
    56285789      tot4Mom-=cH4Mom;                          // Reduce theTotal 4mom by theCurrent 4mom
    56295790      if(hadron+1==nHadr)                       // The Last Hadron in the set
    5630              {
     5791      {
    56315792        G4double re =tot4Mom.e();
    56325793        G4double rpx=tot4Mom.px();
     
    56385799        G4cout<<"G4QE::FSI: Is Energy&Mom conserved? t4M="<<tot4Mom<<",d2="<<dem<<G4endl;
    56395800#endif
    5640                       //if(2>3)                                 //@@En/Mom conservation check is closed
     5801        //if(2>3)                                 //@@En/Mom conservation check is closed
    56415802        if(dem>0.0001)                          // Energy or momentum is not conserved
    5642                {
     5803        {
    56435804#ifdef pdebug
    56445805          if(dem>.1)
     
    56475808            G4LorentzVector cor4M(0.,0.,0.,mNeut);  // Prototype for the neutron
    56485809            if(dmo<0.0001 && re>900.)               // MomentumIsConserved - recoverMissing
    5649                                  {
     5810            {
    56505811              if(fabs(re-mNeut)<.01)
    5651                                    {
     5812              {
    56525813                G4cout<<"...G4QE::FSI:E/M conservation is corrected by neutron"<<G4endl;
    56535814                //cor4M=G4LorentzVector(0.,0.,0.,mNeut); // Made as a prototype
     
    56555816                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56565817              }
    5657                                    else if(fabs(re-mProt)<.01)
    5658                                    {
     5818              else if(fabs(re-mProt)<.01)
     5819              {
    56595820                G4cout<<"...G4QE::FSI:E/M conservation is corrected by proton"<<G4endl;
    56605821                cor4M=G4LorentzVector(0.,0.,0.,mProt);
     
    56625823                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56635824              }
    5664                                    else if(fabs(re-mDeut)<.01)
    5665                                    {
     5825              else if(fabs(re-mDeut)<.01)
     5826              {
    56665827                G4cout<<"...G4QE::FSI:E/M conservation is corrected by deuteron"<<G4endl;
    56675828                cor4M=G4LorentzVector(0.,0.,0.,mDeut);
     
    56695830                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56705831              }
    5671                                    else if(fabs(re-mTrit)<.01)
    5672                                    {
     5832              else if(fabs(re-mTrit)<.01)
     5833              {
    56735834                G4cout<<"...G4QE::FSI:E/M conservation is corrected by tritium"<<G4endl;
    56745835                cor4M=G4LorentzVector(0.,0.,0.,mTrit);
     
    56765837                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56775838              }
    5678                                    else if(fabs(re-mHe3)<.01)
    5679                                    {
     5839              else if(fabs(re-mHe3)<.01)
     5840              {
    56805841                G4cout<<"...G4QE::FSI:E/M conservation is corrected by He3"<<G4endl;
    56815842                cor4M=G4LorentzVector(0.,0.,0.,mHe3);
     
    56835844                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56845845              }
    5685                                    else if(fabs(re-mAlph)<.01)
    5686                                    {
     5846              else if(fabs(re-mAlph)<.01)
     5847              {
    56875848                G4cout<<"...G4QE::FSI:E/M conservation is corrected by alpha"<<G4endl;
    56885849                cor4M=G4LorentzVector(0.,0.,0.,mAlph);
     
    56905851                theQHadrons.push_back(theH);  // (delete equivalent for the proton)
    56915852              }
    5692                                    else if(fabs(re-mNeut-mNeut)<.01)
    5693                                    {
     5853              else if(fabs(re-mNeut-mNeut)<.01)
     5854              {
    56945855                cor4M=G4LorentzVector(0.,0.,0.,mNeut+mNeut);
    56955856                G4cout<<"...G4QE::FSI:E/M conservation is corrected by 2 neutrons"<<G4endl;
     
    56995860                theQHadrons.push_back(theH2); // (delete equivalent for the proton)
    57005861              }
    5701                                    else if(fabs(re-mProt-mProt)<.01)
    5702                                    {
     5862              else if(fabs(re-mProt-mProt)<.01)
     5863              {
    57035864                G4cout<<"...G4QE::FSI:E/M conservation is corrected by 2 protons"<<G4endl;
    57045865                cor4M=G4LorentzVector(0.,0.,0.,mProt+mProt);
     
    57085869                theQHadrons.push_back(theH2); // (delete equivalent for the proton)
    57095870              }
    5710                                    else throw G4QException("***G4QEnv::FSInteract: Increase theCorrectionEps");
    5711                                  }
     5871              else throw G4QException("***G4QEnv::FSInteract: Increase theCorrectionEps");
     5872            }
    57125873            else
    57135874            {
     
    57355896          G4double totRM=tot4Mom.m();
    57365897          if(cHM+pHM<=totRM)                  // *** Make the final correction ***
    5737                         {
     5898          {
    57385899            if(!G4QHadron(tot4Mom).DecayIn2(pH4Mom,cH4Mom))
    57395900            {
     
    58015962    G4cout<<"G4QE::FSI:===Before Gamma Compression===, nH="<<nHadr<<",frag="<<frag<<G4endl;
    58025963#endif
    5803            if(nHadr>2 && frag) for(G4int h=nHadr-1; h>=0; h--)//Collect gammas & kill DecayedHadrs
     5964    if(nHadr>2 && frag) for(G4int h=nHadr-1; h>=0; h--)//Collect gammas & kill DecayedHadrs
    58045965    {
    58055966      G4QHadron* curHadr = theQHadrons[h];    // Get a pointer to the current Hadron
     
    58095970        G4cout<<"---Warning---G4QEnv::FSI:nD-/pD++(1)="<<hPDG<<G4endl;
    58105971#ifdef pdebug
    5811              G4cout<<"G4QE::FSI: h#"<<h<<", hPDG="<<hPDG<<", hNFrag="<<hF<<G4endl;
    5812 #endif
    5813              if(hF||hPDG==22)                        // It should be compressed
    5814              {
     5972      G4cout<<"G4QE::FSI: h#"<<h<<", hPDG="<<hPDG<<", hNFrag="<<hF<<G4endl;
     5973#endif
     5974      if(hF||hPDG==22)                        // It should be compressed
     5975      {
    58155976        G4QHadron* theLast = theQHadrons[theQHadrons.size()-1];//Get Ptr to the Last Hadron
    58165977        if(hPDG==22)
     
    58205981        }
    58215982        if(h<static_cast<G4int>(theQHadrons.size())-1) // Need swap with the Last
    5822                {
     5983        {
    58235984          curHadr->SetNFragments(0);
    58245985          curHadr->Set4Momentum(theLast->Get4Momentum());
     
    58275988          else curHadr->SetQC(theLast->GetQC());// CurHadrPDG instead of LastHadrPDG
    58285989#ifdef pdebug
    5829                  G4cout<<"G4QE::FSI: Exchange with the last is done"<<G4endl;
    5830 #endif
    5831                }
     5990          G4cout<<"G4QE::FSI: Exchange with the last is done"<<G4endl;
     5991#endif
     5992        }
    58325993        theQHadrons.pop_back();               // theLastQHadron is excluded from QHadrons
    58335994        delete theLast;//!!When kill,DON'T forget to delete theLastQHadron as an instance!!
    58345995        nHadr--;
    58355996#ifdef pdebug
    5836                G4cout<<"G4QE::FSI: The last is compessed"<<G4endl;
     5997        G4cout<<"G4QE::FSI: The last is compessed"<<G4endl;
    58375998#endif
    58385999      }
     
    58496010        ccContSum+=theQHadrons[ic4]->GetCharge();
    58506011        cbContSum+=theQHadrons[ic4]->GetBaryonNumber();
    5851            }
     6012    }
    58526013    if(ccContSum-chContSum || cbContSum-bnContSum)
    58536014    {
     
    58726033#endif
    58736034      if(lB<hB)                               // Must be swapped
    5874              {
     6035      {
    58756036        G4QPDGCode   hQPDG = curHadr->GetQPDG();
    58766037        G4LorentzVector h4m= curHadr->Get4Momentum();
     
    58816042        theLast->Set4Momentum(h4m);
    58826043        theLast->SetQPDG(hQPDG);
    5883              }
     6044      }
    58846045    }
    58856046    nHadr=theQHadrons.size();
     
    59226083        //G4double mGamEva=2700.;             // @@Threshold for the evaporation
    59236084        G4double mGamEva=1700.;               // @@Threshold for the evaporation
    5924                if(exResidN.SplitBaryon())
    5925                //if(2>3)                             //CloseTheFirstPriorityResN+gamSumEvaporation
    5926                {
     6085        if(exResidN.SplitBaryon())
     6086        //if(2>3)                             //CloseTheFirstPriorityResN+gamSumEvaporation
     6087        {
    59276088          theNew->Set4Momentum(exRes4M);      // Icrease 4Mom of theLast by "sum" to Evapor
    59286089#ifdef ffdebug
     
    59326093        }
    59336094        else if(theNew->GetPDGCode()==90002002&&exRes4M.m()>mHe3+mNeut&&G4UniformRand()>.5)
    5934                {
     6095        {
    59356096          theNew->Set4Momentum(exRes4M);      // Icrease 4Mom of theLast by "sum" to Evapor
    59366097          G4LorentzVector n4M(0.,0.,0.,mNeut);
     
    59506111          theQHadrons.push_back(theHe3);      // (delete equivalent for the proton)
    59516112        }
    5952                else if(nHadr)                        // Get LastHadrBefResNuc, absorb gam & decay
    5953                //else if(2>3)                        // Close the pair absorbtion of gamma
    5954                {
     6113        else if(nHadr)                        // Get LastHadrBefResNuc, absorb gam & decay
     6114        //else if(2>3)                        // Close the pair absorbtion of gamma
     6115        {
    59556116          if(nHadr>1)for(unsigned sh=0; sh<theQHadrons.size()-1; sh++)//Ord:MinE is TheLast
    59566117          {
     
    59706131#endif
    59716132            if(hM>mGamEva&&lT>hT)             // Must be swapped as the current is smaller
    5972                    {
     6133            {
    59736134              G4QPDGCode   hQPDG = curHadr->GetQPDG();
    59746135              curHadr->Set4Momentum(l4M);
     
    59786139              thePrev->Set4Momentum(h4M);
    59796140              thePrev->SetQPDG(hQPDG);
    5980                    }
     6141            }
    59816142          }
    59826143          nHadr=theQHadrons.size();
     
    59966157            G4double dhM=dh4M.m();            // M of LH+PH+sum(gammas) for theDecay
    59976158            if(theHad->GetPDGCode()==90001001&&dhM>n4M.m()+mProt+mNeut&&G4UniformRand()>.5)
    5998                           //if(2>3)                           // Close Possibility toSplitDeuteron
     6159            //if(2>3)                           // Close Possibility toSplitDeuteron
    59996160            {
    60006161              G4double nuM=n4M.m();
     
    60396200              EvaporateResidual(theNew);      // Try to evaporate theResNuc (del.eq.)
    60406201            }
    6041                  }
     6202          }
    60426203          else
    6043                  {
     6204          {
    60446205            theNew->Set4Momentum(exRes4M);    // Icrease 4MomOfTheLast by "sum" for Evapor
    60456206#ifdef ffdebug
     
    60496210          }
    60506211        }
    6051                else                            // Absorb gammas to theResidNucleus and evaporateIt
    6052                {
     6212        else                            // Absorb gammas to theResidNucleus and evaporateIt
     6213        {
    60536214          theNew->Set4Momentum(exRes4M);// Icrease 4Mom of the Last by the "sum" for Evap
    60546215          EvaporateResidual(theNew);    // Try to evaporate the Nucl.(@@DecDib)(delete eq.)
     
    60586219          G4cout<<"G4QE::FSI:AfterEvaporation: nNew="<<nHN<<G4endl;
    60596220          if(nHN>nHadr)for(unsigned idp=nHadr; idp<nHN; idp++)
    6060                         G4cout<<"G4QE::FSI: h#"<<idp<<", PDG="<<theQHadrons[idp]->GetPDGCode()<<G4endl;
     6221          G4cout<<"G4QE::FSI: h#"<<idp<<", PDG="<<theQHadrons[idp]->GetPDGCode()<<G4endl;
    60616222#endif
    60626223        }
     
    61086269        maxB=ipo;
    61096270      }                                           // the current biggest nuclear fragment
    6110            }
     6271    }
    61116272  }
    61126273#ifdef pdebug
     
    61576318#endif
    61586319      if(hPDG==22)                                // Photon is foun on the "gp" position
    6159              {
     6320      {
    61606321        gamSum=gamSum+theCurr->Get4Momentum();    // Accumulate the 4Momenta of the photon
    61616322        unsigned nLast=nHadr-1;                   // position of theLastHadron (gp<nHadr-1)
    61626323        G4QHadron* theLast = theQHadrons[nLast];  // Pointer to the Last Hadron
    61636324        while(nLast>gp && theLast->GetPDGCode()==22) // "TheLast is a photon too" LOOP
    6164                                                                 {
     6325        {
    61656326          gamSum=gamSum+theLast->Get4Momentum();  // Accumulate 4-momentum of theLastPhoton
    61666327          theQHadrons.pop_back();                 // Pnt to theLastHadr.is excluded from HV
     
    61836344#endif
    61846345        }
    6185              }
     6346      }
    61866347    }
    61876348    // @@ Now it is necessary to try to emit alpha or evaporate the residual nucleus
    61886349    G4QHadron* theLast = theQHadrons[nHadr-1];   // Pointer to the Last Hadron
    61896350    if(theLast->GetPDGCode()==22)
    6190            {
     6351    {
    61916352      gamSum=gamSum+theLast->Get4Momentum();     // Accumulate 4-momentum of the LastPhoton
    61926353      theQHadrons.pop_back();                    // Pnt to theLastHadr.is excluded from HV
     
    61976358#endif
    61986359      theLast = theQHadrons[nHadr-1];
    6199            }
     6360    }
    62006361    G4int nEx=nHadr-2;                           // position to be exchanged with theLast
    62016362    while(theLast->GetBaryonNumber()<1 && nEx>=0)// theLastHadron must be a nucleus (A>0)
    6202                                 {
     6363    {
    62036364      G4QHadron* theEx=theQHadrons[nEx];         // A hadron to be exchanged with theLast
    62046365      G4LorentzVector ex4Mom=theEx->Get4Momentum();
     
    62216382    G4double tRM=tR4M.m();                       // TotMass of theResidualNucleus to decay
    62226383    if(theLB>4)
    6223            {
    6224              G4QContent lrQC=curHadr->GetQC()-G4QContent(6,6,0,0,0,0);
     6384    {
     6385      G4QContent lrQC=curHadr->GetQC()-G4QContent(6,6,0,0,0,0);
    62256386      G4QNucleus lrN(lrQC);
    62266387      G4double lrM=lrN.GetMZNS();
    62276388      if(tRM>lrM+mAlph)
    6228              {
     6389      {
    62296390        G4LorentzVector lr4M(0.,0.,0.,lrM);
    62306391        G4LorentzVector al4M(0.,0.,0.,mAlph);
     
    62366397          G4cout<<"G4QE::FSI: After Evap (1) nH="<<theQHadrons.size()<<G4endl;
    62376398#endif
    6238                }
     6399        }
    62396400        else
    62406401        {
    6241                         delete curHadr;
     6402          delete curHadr;
    62426403          G4int APDG=lrN.GetPDG();
    62436404#ifdef pdebug
     
    62576418        G4cout<<"G4QE::FSI: After Evap (2) nH="<<theQHadrons.size()<<G4endl;
    62586419#endif
    6259              }
     6420      }
    62606421    }
    62616422    else
     
    62666427      G4cout<<"G4QE::FSI: After Evap (5) nH="<<theQHadrons.size()<<G4endl;
    62676428#endif
    6268            }
     6429    }
    62696430  }
    62706431  //Now just fill the output theFravment vector (User is responsible to ClearAndDestroy it)
     
    63426503      G4double sum=mNucl+mPion+mSi;
    63436504      if(hPDG==90998003&&reM<sum)                      // Default -- values
    6344              {
     6505      {
    63456506        PDGsi=2112;
    63466507        mSi=mNeut;
     
    63506511      }
    63516512      if(hPDG==91002998)                      // Change -- default values to +++ values
    6352              {
     6513      {
    63536514        mNucl=mProt;
    63546515        PDGnu=2212;
     
    63586519        sum=mNucl+mPion+mSi;
    63596520        if(reM<sum)
    6360                {
     6521        {
    63616522          PDGsi=2212;
    63626523          mSi=mProt;
     
    63686529      G4LorentzVector k4M(0.,0.,0.,mSi);
    63696530      if(fabs(reM-sum)<eps)
    6370              {
     6531      {
    63716532        //G4cout<<"G4QE::FSI:*TMP* PiDelta split PDG="<<hPDG<<G4endl;//To find out why?
    63726533        n4M=r4M*(mNucl/sum);
     
    63876548            G4QPDGCode lQP=theLast->GetQPDG();         // The QPDG of the last
    63886549            if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); //CurHadr instead of PrevHadr
    6389             else curHadr->SetQC(theLast->GetQC());       // CurHadrPDG instead of LastHadrPDG
     6550            else curHadr->SetQC(theLast->GetQC());     // CurHadrPDG instead of LastHadrPDG
    63906551            curHadr->Set4Momentum(theLast->Get4Momentum()); // ... 4Momentum substitution
    63916552          }
     
    64076568              G4int hpPDG=cpHadr->GetPDGCode();
    64086569              G4LorentzVector hpLV=cpHadr->Get4Momentum();
    6409                       G4cout<<"G4QE::FSI:h#"<<hp<<": hPDG="<<hpPDG<<", h4M="<<hpLV<<G4endl;
     6570        G4cout<<"G4QE::FSI:h#"<<hp<<": hPDG="<<hpPDG<<", h4M="<<hpLV<<G4endl;
    64106571            }
    64116572#endif
     
    64156576          delete quasH;
    64166577          fOK=false;
    6417                       }
     6578        }
    64186579        else
    64196580        {
     
    64346595        curHadr->SetQPDG(G4QPDGCode(PDGnu));// At least one nucleun always exists
    64356596        if(dub)
    6436                       {
     6597        {
    64376598          p4M/=2.;
    64386599          G4QHadron* Pid = new G4QHadron(PDGpi,p4M); // Create a Hadron for the pion
     
    64496610    }
    64506611    else if(hPDG==89998003||hPDG==90002998)   // Isonucleus (pi- + DEL- or pi+ + DEL++)
    6451            {                                         // @@ can be converted here to B>1
     6612    {                                         // @@ can be converted here to B>1
    64526613      //G4cout<<"G4QE::FSI:*TMP* PiDelta decay PDG="<<hPDG<<G4endl;//To find out why?
    64536614      G4double mNucl=mNeut;
     
    64556616      G4int PDGpi=-211;
    64566617      if(hPDG==90002998)                      // Change DEL- default values to DEL++ values
    6457              {
     6618      {
    64586619        mNucl=mProt;
    64596620        PDGnu=2212;
     
    64686629      G4double sum=mNucl+mPi+mPi;
    64696630      if(fabs(reM-sum)<eps)
    6470              {
     6631      {
    64716632        //G4cout<<"G4QE::FSI:*TMP* PiDelta split PDG="<<hPDG<<G4endl;//To find out why?
    64726633        n4M=r4M*(mNucl/sum);
     
    64876648            G4QPDGCode lQP=theLast->GetQPDG();         // The QPDG of the last
    64886649            if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); //CurHadr instead of PrevHadr
    6489             else curHadr->SetQC(theLast->GetQC());       // CurHadrPDG instead of LastHadrPDG
     6650            else curHadr->SetQC(theLast->GetQC());     // CurHadrPDG instead of LastHadrPDG
    64906651            curHadr->Set4Momentum(theLast->Get4Momentum()); // ... 4Momentum substitution
    64916652          }
     
    65066667          delete quasH;
    65076668          fOK=false;
    6508                       }
     6669        }
    65096670        else
    65106671        {
     
    65346695    }
    65356696    else if(hBN>0 && !hST && (hCG<0||hCG>hBN)) // Isonucleus (n*N+k*DEL- or n*P+k*DEL++)
    6536            {
     6697    {
    65376698      G4double mNucl=mNeut;
    65386699      G4int PDGnu=2112;
     
    65406701      G4int nPi=-hCG;                         // Prototype of the minimum number of pions
    65416702      if(hCG>0)                               // Change DEL- default values to DEL++ values
    6542              {
     6703      {
    65436704        mNucl=mProt;
    65446705        PDGnu=2212;
     
    65546715      G4double sum=nucM+pioM;
    65556716      if(fabs(reM-sum)<eps)
    6556              {
     6717      {
    65576718        n4M=r4M*(nucM/sum);
    65586719        k4M=r4M*(pioM/sum);
     
    65756736            G4QPDGCode lQP=theLast->GetQPDG();         // The QPDG of the last
    65766737            if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); //CurHadr instead of PrevHadr
    6577             else curHadr->SetQC(theLast->GetQC());       // CurHadrPDG instead of LastHadrPDG
     6738            else curHadr->SetQC(theLast->GetQC());     // CurHadrPDG instead of LastHadrPDG
    65786739            curHadr->Set4Momentum(theLast->Get4Momentum()); // ... 4Momentum substitution
    65796740          }
     
    65966757              G4int hpPDG=cpHadr->GetPDGCode();
    65976758              G4LorentzVector hpLV=cpHadr->Get4Momentum();
    6598                             G4cout<<"G4QE::FSI:h#"<<hp<<": hPDG="<<hpPDG<<", h4M="<<hpLV<<G4endl;
     6759              G4cout<<"G4QE::FSI:h#"<<hp<<": hPDG="<<hpPDG<<", h4M="<<hpLV<<G4endl;
    65996760            }
    66006761#endif
     
    66046765          delete quasH;                          // TemporaryQuasmon is used for recovery
    66056766          fOK=false;
    6606                       }
     6767        }
    66076768        else
    66086769        {
     
    66196780        G4cout<<"G4QE::FSI:IsoN==>"<<r4M<<"->N="<<PDGnu<<n4M<<"+Pi="<<PDGpi<<k4M<<G4endl;
    66206781#endif
    6621                       if(hBN>1) n4M/=hBN;                    // Calculate the 4mom per one nucleon
     6782        if(hBN>1) n4M/=hBN;                    // Calculate the 4mom per one nucleon
    66226783        curHadr->Set4Momentum(n4M);
    66236784        curHadr->SetQPDG(G4QPDGCode(PDGnu));   // At least one nucleun always exists
     
    66666827      }
    66676828    else if(hST<0 && hBN>0) // AntistrangeNucleus (@@ see above, already done)
    6668            {
     6829    {
    66696830      G4LorentzVector r4M=curHadr->Get4Momentum(); // Real 4-mom of theAntiStrangeNucleus
    66706831      G4double reM=r4M.m();              // Real mass of the antiStrange nucleus
     
    66866847      G4double sum=mR+mKaon;
    66876848      if(sum>reM)                        // for GEANT4 (Can not decay in kaon and residual)
    6688              {
     6849      {
    66896850        if(kPDG==321)                    // *** Very seldom *** "K+->pi+ conversion"
    6690                       {
     6851        {
    66916852          kPDG=211;
    66926853          mKaon=mPi;
    6693                       }
     6854        }
    66946855        else                             // *** Very seldom *** "K0(S=-1)->pi- conversion"
    6695                       {
     6856        {
    66966857          kPDG=111;
    66976858          mKaon=mPi0;
    6698                       }
     6859        }
    66996860        sum=mR+mKaon;
    67006861      }
     
    67026863      G4LorentzVector k4M(0.,0.,0.,mKaon);
    67036864      if(fabs(reM-sum)<eps)
    6704              {
     6865      {
    67056866        n4M=r4M*(mR/sum);
    67066867        k4M=r4M*(mKaon/sum);
     
    67196880            G4QPDGCode lQP=theLast->GetQPDG();         // The QPDG of the last
    67206881            if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); //CurHadr instead of PrevHadr
    6721             else curHadr->SetQC(theLast->GetQC());       // CurHadrPDG instead of LastHadrPDG
     6882            else curHadr->SetQC(theLast->GetQC());     // CurHadrPDG instead of LastHadrPDG
    67226883            curHadr->Set4Momentum(theLast->Get4Momentum()); // ... 4Momentum substitution
    67236884          }
     
    67386899          delete quasH;
    67396900          fOK=false;
    6740                       }
     6901        }
    67416902        else
    67426903        {
     
    67576918    }
    67586919    else if(hPDG>90500000&&hPDG!=91000000&&hPDG!=91000999&&hPDG!=90999001) // Only for G4
    6759         // @@ Xi & Omega- can be added here ^^^, if show up below
    6760            {
     6920 // @@ Xi & Omega- can be added here ^^^, if show up below
     6921    {
    67616922#ifdef pdebug
    67626923      G4cout<<"***G4QEnvironment::FSI:*G4* Hypernucleus PDG="<<hPDG<<" must decay"<<G4endl;
     
    67686929      G4int nSP=0;                             // A#0f unavoidable Sigma+
    67696930      if(nC<0)                                 // Negative hypernucleus
    6770              {
     6931      {
    67716932        if(-nC<=nL)
    6772                       {
     6933        {
    67736934          nSM=-nC;                             // Can be compensated by Sigma-
    67746935          nL+=nC;                              // Reduce the residual strangeness
    67756936        }
    67766937        else
    6777                       {
     6938        {
    67786939          nSM=nL;                              // The maximum number of Sigma-
    67796940          nL=0;                                // Kill the residual strangeness
     
    67816942      }
    67826943      else if(nC>nB-nL)                        // Extra positive hypernucleus
    6783              {
     6944      {
    67846945        if(nC<=nB)
    6785                       {
     6946        {
    67866947          G4int dH=nB-nC;
    67876948          nSP=nL-dH;                           // Can be compensated by Sigma+
     
    67896950        }
    67906951        else
    6791                       {
     6952        {
    67926953          nSP=nL;                              // The maximum number of Sigma+
    67936954          nL=0;                                // Kill the residual strangeness
     
    68036964#endif
    68046965      if(nSP||nSM)
    6805              {
     6966      {
    68066967        if(nL)
    68076968        {
     
    68136974        }
    68146975        if(nSP)
    6815                       {
     6976        {
    68166977          nL=nSP;
    68176978          sPDG=3222;
     
    68196980        }
    68206981        else
    6821                       {
     6982        {
    68226983          nL=nSM;
    68236984          sPDG=3112;
     
    68316992      G4double rlM=G4QNucleus(rlPDG).GetMZNS();// Mass of the new residualNonstrangeNucleus
    68326993      if(!nSP&&!nSM&&nL==1&&reM>rlM+mSigZ&&G4UniformRand()>.5) // Sigma0 @@ AddToHadroniz.?
    6833              {
     6994      {
    68346995        sPDG=3212;
    68356996        MLa=mSigZ;
     
    68407001      // @@ Take into account that there can be Iso-Hypernucleus (Add PI+,R & Pi-,R decays)
    68417002      if(rlPDG==90000000)                      // Multy Hyperon (HyperNuc of only hyperons)
    6842              {
     7003      {
    68437004        if(nL>1) r4M=r4M/nL;                   // split the 4-mom for the MultyLambda
    68447005        for(G4int il=0; il<nL; il++)           // loop over Lambdas
     
    68487009        }
    68497010      }
    6850              else if(reM>rlM+MLa-eps)                  // Lambda(or Sigma) can be split
    6851              {
     7011      else if(reM>rlM+MLa-eps)                  // Lambda(or Sigma) can be split
     7012      {
    68527013        G4LorentzVector n4M(0.,0.,0.,rlM);
    68537014        G4LorentzVector h4M(0.,0.,0.,MLa);
    68547015        G4double sum=rlM+MLa;
    68557016        if(fabs(reM-sum)<eps)
    6856                {
     7017        {
    68577018          n4M=r4M*(rlM/sum);
    68587019          h4M=r4M*(MLa/sum);
     
    68697030        curHadr->SetQPDG(G4QPDGCode(rlPDG));   // converted hypernucleus
    68707031        if(rlPDG==90000002)                    // Additional action with curHadr change
    6871                {
     7032        {
    68727033          G4LorentzVector newLV=n4M/2.;
    68737034          curHadr->Set4Momentum(newLV);
     
    68777038        }
    68787039        else if(rlPDG==90002000)               // Additional action with curHadr change
    6879                {
     7040        {
    68807041          G4LorentzVector newLV=n4M/2.;
    68817042          curHadr->Set4Momentum(newLV);
     
    68957056        }
    68967057      }
    6897              else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)    // Lambda->N only if Sigmas are absent
    6898              {
     7058      else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)    // Lambda->N only if Sigmas are absent
     7059      {
    68997060        G4int nPi=static_cast<G4int>((reM-rnM)/mPi0);
    69007061        if (nPi>nL) nPi=nL;
     
    69047065        G4double sum=rnM+npiM;
    69057066        if(fabs(reM-sum)<eps)
    6906                {
     7067        {
    69077068          n4M=r4M*(rnM/sum);
    69087069          h4M=r4M*(npiM/sum);
     
    69267087        }
    69277088        if(rnPDG==90000002)                    // Additional action with curHadr change
    6928                {
     7089        {
    69297090          G4LorentzVector newLV=n4M/2.;
    69307091          curHadr->Set4Momentum(newLV);
     
    69357096        }
    69367097        else if(rnPDG==90002000)               // Additional action with curHadr change
    6937                {
     7098        {
    69387099          G4LorentzVector newLV=n4M/2.;
    69397100          curHadr->Set4Momentum(newLV);
     
    69457106        // @@ Add multybaryon decays if necessary
    69467107      }
    6947       else // If this Excepton shows up (lowProbable appearance) => include gamma decay
    6948              {
     7108      else if(reM>rnM-eps)    // Decay in nonstange and gamma
     7109      {
     7110        G4LorentzVector n4M(0.,0.,0.,rnM);
     7111        G4LorentzVector h4M(0.,0.,0.,0.);
     7112        G4double sum=rnM;
     7113        if(fabs(reM-sum)<eps) n4M=r4M;
     7114        else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M))
     7115        {
     7116          G4cerr<<"***G4QE::FSI:Hypern, M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl;
     7117          throw G4QException("***G4QEnvironment::FSInter: Hypernuclear gamma decay error");
     7118        }
     7119        curHadr->Set4Momentum(n4M);
     7120        curHadr->SetQPDG(G4QPDGCode(rnPDG));   // converted hypernucleus
     7121#ifdef fdebug
     7122        G4cout<<"*G4QE::FSI:HypNg "<<r4M<<"->A="<<rnPDG<<n4M<<",gamma="<<h4M<<G4endl;
     7123#endif
     7124        G4QHadron* theGamma = new G4QHadron(22,h4M);// Make a New Hadr for the gamma
     7125        theQHadrons.push_back(theGamma);      // (del.eq.- user is responsible for del)
     7126        if(rnPDG==90000002)                   // Additional action with curHadr change
     7127        {
     7128          G4LorentzVector newLV=n4M/2.;
     7129          curHadr->Set4Momentum(newLV);
     7130          curHadr->SetQPDG(G4QPDGCode(90000001));
     7131          G4QHadron* secHadr = new G4QHadron(curHadr);
     7132          theQHadrons.push_back(secHadr);     // (del.eq.- user is responsible for del)
     7133          //theFragments->push_back(secHadr);   // (del.eq.- user is responsible for del)
     7134        }
     7135        else if(rnPDG==90002000)              // Additional action with curHadr change
     7136        {
     7137          G4LorentzVector newLV=n4M/2.;
     7138          curHadr->Set4Momentum(newLV);
     7139          curHadr->SetQPDG(G4QPDGCode(90001000));
     7140          G4QHadron* secHadr = new G4QHadron(curHadr);
     7141          theQHadrons.push_back(secHadr);    // (del.eq.- user is responsible for del)
     7142          //theFragments->push_back(secHadr);    // (del.eq.- user is responsible for del)
     7143        }
     7144        // @@ Add multybaryon decays if necessary
     7145      }
     7146      else // If this Error shows up (lowProbable appearance) => now it is left as is
     7147      {
    69497148        G4double d=rlM+MLa-reM;
    6950                 G4cerr<<"G4QE::FSI:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl;
     7149        G4cerr<<"G4QE::FSI:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl;
    69517150        d=rnM+mPi0-reM;
    6952                 G4cerr<<"***G4QE::FSI: HypN="<<hPDG<<", M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl;
    6953         throw G4QException("G4QEnvironment::FSInteract: Hypernuclear conversion");
     7151        G4cerr<<"***G4QE::FSI: HypN="<<hPDG<<", M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl;
     7152        //throw G4QException("G4QEnvironment::FSInteract: Hypernuclear conversion");
    69547153      }
    69557154    }
    69567155    //unsigned nHd=theQHadrons.size()-1;
    69577156    //if(hd==nHd && !fOK)
    6958         //{
     7157    //{
    69597158    //  G4cout<<"---Warning---G4QE::FSI: The Last #"<<hd<<" hadron must be filled"<<G4endl;
    6960         //  fOK=true;
     7159    //  fOK=true;
    69617160    //  curHadr = new G4QHadron(theQHadrons[hd]);
    69627161    //}
     
    69977196        curHadr->SetQPDG(G4QPDGCode(bPDG)); // Substitute Multibaryon by a baryon
    69987197        for (G4int ib=1; ib<brn; ib++)
    6999                       {
     7198        {
    70007199          G4QHadron* bH = new G4QHadron(bPDG, sp4m);
    70017200         theFragments->push_back(bH);     //(del eq. - user is responsible for deleting)
     
    71637362  {
    71647363    if(!theLC)                  // Neutron like: n+gam, n+Pi0, p+Pi- are possible
    7165                                 {
     7364    {
    71667365      if(qM<mNPi0)              // Only n+gamma decay is possible
    7167                                                 {
     7366      {
    71687367        if(fabs(qM-mNeut)<eps)
    7169                                                                 {
     7368        {
    71707369#ifdef pdebug
    71717370          G4cout<<"G4QEnv::DecayBaryon: Fill Neutron AsIs"<<G4endl;
     
    71807379      }
    71817380      else if(qM>mPPi)          // Both n+pi0 (p=2/3) & p+Pi- (p=1/3) are possible
    7182                                                 {
     7381      {
    71837382        if(G4UniformRand()>.333333333) // Clebsh value for the Isobar decay
    71847383        {
     
    71927391        }
    71937392      }
    7194                                                 else                      // Only n+Pi0 decay is possible
     7393      else                      // Only n+Pi0 decay is possible
    71957394      {
    71967395        fQPDG=nQPDG;            // Baryon is neutron
     
    71997398    }
    72007399    else if(theLC==1)           // Proton like: p+gam, p+Pi0, n+Pi+ are possible
    7201                                 {
     7400    {
    72027401      if(qM<mPPi0)              // Only p+gamma decay is possible
    7203                                                 {
     7402      {
    72047403        if(fabs(qM-mProt)<eps)
    7205                                                                 {
     7404        {
    72067405#ifdef pdebug
    72077406          G4cout<<"G4QEnv::DecayBaryon: Fill Proton AsIs"<<G4endl;
     
    72147413      }
    72157414      else if(qM>mNPi)          // Both p+pi0 (p=2/3) & n+Pi+ (p=1/3) are possible
    7216                                                 {
     7415      {
    72177416        if(G4UniformRand()<.333333333) // Clebsh value for the Isobar decay
    72187417        {
     
    72277426    }
    72287427    else if(theLC==2)           // Delta++ like: only p+PiP is possible
    7229                                 {
     7428    {
    72307429      if(qM>mPPi)               // Only p+gamma decay is possible
    7231                                                 {
     7430      {
    72327431        sQPDG=pipQPDG;          // Meson is Pi+ (baryon is proton)
    72337432        sMass=mPi;
    72347433      }
    72357434      else                      // @@ Can be aReason to search for anError in Fragmentation
    7236                                                 {
     7435      {
    72377436#ifdef pdebug
    72387437        G4cout<<"-Warning-G4QE::DecBary:*AsIs* DEL++ M="<<qM<<"<"<<mPPi<<G4endl;
     
    72437442    }
    72447443    else if(theLC==-1)          // Delta- like: only n+PiM is possible
    7245                                 {
     7444    {
    72467445      if(qM+eps>mNPi)           // Only p+gamma decay is possible
    7247                                                 {
     7446      {
    72487447        fQPDG=nQPDG;            // Baryon is neutron
    72497448        fMass=mNeut;
     
    72527451      }
    72537452      else                      // @@ Can be aReason to search for anError in Fragmentation
    7254                                                 {
     7453      {
    72557454#ifdef pdebug
    72567455        G4cout<<"-Warning-G4QE::DecBary:*AsIs* DEL++ M="<<qM<<"<"<<mNPi<<G4endl;
     
    72727471  {
    72737472    if(!theLC)                  // -->> Lambda/Sz: L+g,L+Pi0,Sz+Pi0,Sm+Pip,Sp+Pim,p+Km,n+Kz
    7274                                 {
     7473    {
    72757474      if(qM<mLPi0)              // Only Lambda+gamma decay is possible
    7276                                                 {
     7475      {
    72777476        if(fabs(qM-mLamb)<eps)
    7278                                                                 {
     7477        {
    72797478#ifdef pdebug
    72807479          G4cout<<"G4QEnv::DecayBaryon: Fill Lambda AsIs"<<G4endl;
     
    72897488      }
    72907489      else if(qM<mSzPi0)        // Only Lambda+Pi0 is possible
    7291                                                 {
     7490      {
    72927491        fQPDG=lQPDG;            // Baryon is Lambda
    72937492        fMass=mLamb;
    72947493      }
    72957494      else if(qM<mSpPi)         // Both Lambda+Pi0 & Sigma0+Pi0 are possible
    7296                                                 {
     7495      {
    72977496        if(G4UniformRand()>.6)  // @@ Relative probability (take into account Phase Space)
    72987497        {
     
    73077506      }
    73087507      else if(qM<mSmPi)         // Lambda+Pi0, Sigma0+Pi0, & SigmaP+PiM are possible
    7309                                                 {
     7508      {
    73107509        G4double ra=G4UniformRand();
    73117510        if(ra<.4)               // @@ Rel. probab. (take into account Phase Space)
     
    73287527      }
    73297528      else if(qM<mPK)           // Lambda+Pi0, Sig0+Pi0, SigP+PiM, SigM+PiP are possible
    7330                                                 {
     7529      {
    73317530        G4double ra=G4UniformRand();
    73327531        if(ra<.35)              // @@ Rel. probab. (take into account Phase Space)
     
    73567555      }
    73577556      else if(qM<mNKZ)          // Lambda+Pi0, Sig0+Pi0, SigP+PiM, SigM+PiP are possible
    7358                                                 {
     7557      {
    73597558        G4double ra=G4UniformRand();
    73607559        if(ra<.3)               // @@ Rel. probab. (take into account Phase Space)
     
    73907589        }
    73917590      }
    7392                                                 else                      // Only n+Pi0 decay is possible
     7591      else                      // Only n+Pi0 decay is possible
    73937592      {
    73947593        G4double ra=G4UniformRand();
     
    74347633    }
    74357634    else if(theLC==1)           // SigmaP: SigP+gam,SigP+Pi0,Sp+PiP,L+Pi0,p+K0 are possible
    7436                                 {
     7635    {
    74377636      if(qM<mLPi)               // Only SigmaPlus+gamma decay is possible
    7438                                                 {
     7637      {
    74397638        if(fabs(qM-mSigP)<eps)
    7440                                                                 {
     7639        {
    74417640#ifdef pdebug
    74427641          G4cout<<"G4QEnv::DecayBaryon: Fill SigmaPlus AsIs"<<G4endl;
     
    74517650      }
    74527651      else if(qM<mSpPi0)        // Only Lambda+PiP is possible
    7453                                                 {
     7652      {
    74547653        fQPDG=lQPDG;            // Baryon is Lambda
    74557654        fMass=mLamb;
     
    74587657      }
    74597658      else if(qM<mSzPi)         // Both Lambda+PiP & Sigma0+Pi0 are possible
    7460                                                 {
     7659      {
    74617660        if(G4UniformRand()<.6)  // @@ Relative probability (take into account Phase Space)
    74627661        {
     
    74737672      }
    74747673      else if(qM<mPKZ)          // Lambda+PiP, SigmaP+Pi0, & Sigma0+PiP are possible
    7475                                                 {
     7674      {
    74767675        G4double ra=G4UniformRand();
    74777676        if(ra<.4)               // @@ Rel. probab. (take into account Phase Space)
     
    74967695      }
    74977696      else                      // Lambda+PiP, SigmaP+Pi0, Sigma0+PiP, p+K0 are possible
    7498                                                 {
     7697      {
    74997698        G4double ra=G4UniformRand();
    75007699        if(ra<.35)              // @@ Rel. probab. (take into account Phase Space)
     
    75277726    }
    75287727    else if(theLC==-1)          // SigmaM: SigM+gam,SigM+Pi0,S0+PiM,L+Pi-,n+KM are possible
    7529                                 {
     7728    {
    75307729      if(qM<mLPi)               // Only SigmaMinus + gamma decay is possible
    7531                                                 {
     7730      {
    75327731        if(fabs(qM-mSigM)<eps)
    7533                                                                 {
     7732        {
    75347733#ifdef pdebug
    75357734          G4cout<<"G4QEnv::DecayBaryon: Fill SigmaMinus AsIs"<<G4endl;
     
    75447743      }
    75457744      else if(qM<mSzPi)         // Only Lambda+PiM is possible
    7546                                                 {
     7745      {
    75477746        fQPDG=lQPDG;            // Baryon is Lambda
    75487747        fMass=mLamb;
     
    75517750      }
    75527751      else if(qM<mSzPi)         // Both Lambda+PiM & Sigma0+PiM are possible
    7553                                                 {
     7752      {
    75547753        if(G4UniformRand()<.6)  // @@ Relative probability (take into account Phase Space)
    75557754        {
     
    75687767      }
    75697768      else if(qM<mPKZ)          // Lambda+PiM, Sigma0+PiM, & SigmaM+Pi0 are possible
    7570                                                 {
     7769      {
    75717770        G4double ra=G4UniformRand();
    75727771        if(ra<.4)               // @@ Rel. probab. (take into account Phase Space)
     
    75917790      }
    75927791      else                      // Lambda+PiM, Sig0+PiM, SigM+Pi0, n+KM are possible
    7593                                                 {
     7792      {
    75947793        G4double ra=G4UniformRand();
    75957794        if(ra<.35)              // @@ Rel. probab. (take into account Phase Space)
     
    76347833  {
    76357834#ifdef pdebug
    7636     G4cout<<"---Warning---G4QE::DecBary:*AsIso* UnknBaryon(AntiS) QC="<<qH->GetQC()<<G4endl;
     7835    G4cout<<"---Warning---G4QE::DecBary:*AsIso*UnknBaryon(AntiS),QC="<<qH->GetQC()<<G4endl;
    76377836#endif
    76387837    theQHadrons.push_back(qH);                 // Fill AsIs (delete equivalent)
     
    76437842  G4double sum=fMass+sMass;
    76447843  if(fabs(qM-sum)<eps)
    7645         {
     7844  {
    76467845    f4Mom=q4M*(fMass/sum);
    76477846    s4Mom=q4M*(sMass/sum);
     
    76567855    {
    76577856      G4Quasmon* quasH = new G4Quasmon(qH->GetQC(),qH->Get4Momentum());
    7658              if(!CheckGroundState(quasH,true)) theQHadrons.push_back(qH); // Cor or fill asItIs
     7857      if(!CheckGroundState(quasH,true)) theQHadrons.push_back(qH); // Cor or fill asItIs
    76597858      else delete qH; 
    76607859      delete quasH;
     
    76797878  theQHadrons.push_back(H2);                  // Fill "H2" (delete equivalent)
    76807879} // End of DecayBaryon
     7880
     7881//Decay of the Antistrange Nucleus in nucleus & K+/antiK0 (at present only S=-1)
     7882void G4QEnvironment::DecayAntistrange(G4QHadron* qH)
     7883{//  ===============================================
     7884  static const G4QPDGCode kpQPDG(321);          // QPDG for Antistrange positive kaon
     7885  static const G4QPDGCode kzQPDG(311);          // QPDG for Antistrange neutral anti-kaon
     7886  static const G4double mK =G4QPDGCode(321).GetMass(); // Mass of antistrange positive Kaon
     7887  static const G4double mK0=G4QPDGCode(311).GetMass(); // Mass of antistrange neutral aK0
     7888  static const G4double eps=0.003;
     7889  //static const G4QNucleus vacuum(90000000);
     7890  G4int theLS= qH->GetStrangeness();           // Strangness of the Nucleus
     7891  if(theLS>=0)
     7892  {
     7893    G4cerr<<"***G4QEnvironment::DecayAntistrange: S="<<theLS<<", but must be <0"<<G4endl;
     7894    //#ifdef ppdebug
     7895    throw G4QException("G4QEnv::DecayAntistrange: Not Antistrange nucleus");
     7896    //#endif
     7897    //theQHadrons.push_back(qH);                 // Fill AsIs (delete equivalent)
     7898    return;
     7899  }
     7900  else if(theLS<-1)
     7901  {
     7902    G4cout<<"*Warning*G4QEnvironment::DecayAntistrange: S="<<theLS<<",AsIsImprove"<<G4endl;
     7903    theQHadrons.push_back(qH);                 // Fill AsIs (delete equivalent)
     7904    return;
     7905  }
     7906  G4int theLB= qH->GetBaryonNumber();          // Baryon number of the Nucleus
     7907  G4int theLC= qH->GetCharge();                // Chsrge of the Nucleus
     7908  G4int qPDG = qH->GetPDGCode();               // PDG Code of the decaying Nucleus
     7909  G4int K0PDG= qPDG+999999;                    // Residual nonStrange nucleus for antiK0
     7910  G4QPDGCode K0QPDG(K0PDG);                    // QPDG of the nuclear residual for antiK0
     7911  G4double rK0M=K0QPDG.GetMass();              // Mass of the nuclear residual for antiK0
     7912  G4int KpPDG= qPDG+999000;                    // Residual nonStrange nucleus for K+
     7913  G4QPDGCode KpQPDG(KpPDG);                    // QPDG of the nuclear residual for K+
     7914  G4double rKpM=KpQPDG.GetMass();              // Mass of the nuclear residual for K+
     7915  G4LorentzVector q4M = qH->Get4Momentum();    // Get 4-momentum of the Nucleus
     7916  G4double         qM = q4M.m();               // Mass of the Nucleus
     7917#ifdef pdebug
     7918  G4cout<<"G4QE::DecayAntistrang:S="<<theLS<<",C="<<theLC<<",B="<<theLB<<",M="<<qM<<G4endl;
     7919#endif
     7920  // Select a chanel of the decay
     7921  G4QPDGCode     fQPDG = kzQPDG;               // Prototype for Kaon (anti-K0)
     7922  G4double       fMass= mK0;
     7923  G4QPDGCode     sQPDG = K0QPDG;               // Prototype for residual nucleus to Kaon
     7924  G4double       sMass= rK0M;
     7925  if(mK0+rK0M>qM)                              // Can not be K0
     7926  {
     7927    if(mK+rKpM>qM)                             // Can not be K+ too
     7928    {
     7929      G4cout<<"*Warning*G4QEnvironment::DecayAntistrange: Too low mass, keep AsIs"<<G4endl;
     7930      theQHadrons.push_back(qH);               // Fill AsIs (delete equivalent)
     7931      return;
     7932    }
     7933    else                                       // Switch to K+
     7934    {
     7935      fQPDG = kpQPDG;                          // Positive Kaon
     7936      fMass= mK;
     7937      sQPDG = KpQPDG;                          // Residual nucleus to K+
     7938      sMass= rKpM;
     7939    }
     7940  }
     7941  else if(mK+rKpM<qM && theLC>theLB-theLC)     // Switch to K+ if Z>N
     7942  {
     7943    fQPDG = kpQPDG;                            // Positive Kaon
     7944    fMass= mK;
     7945    sQPDG = KpQPDG;                            // Residual nucleus to K+
     7946    sMass= rKpM;
     7947  }
     7948  G4LorentzVector f4Mom(0.,0.,0.,fMass);
     7949  G4LorentzVector s4Mom(0.,0.,0.,sMass);
     7950  G4double sum=fMass+sMass;
     7951  if(fabs(qM-sum)<eps)
     7952  {
     7953    f4Mom=q4M*(fMass/sum);
     7954    s4Mom=q4M*(sMass/sum);
     7955  }
     7956  else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
     7957  {
     7958#ifdef pdebug
     7959    G4cout<<"--Warning--G4QE::DecAntistrange: fPDG="<<fQPDG<<"(M="<<fMass<<")+sPDG="<<sQPDG
     7960          <<"(M="<<sMass<<") > TotM="<<q4M.m()<<G4endl;
     7961#endif
     7962    G4cerr<<"***G4QEnv::DecayAntistrange: M="<<qM<<", sum="<<sum<<G4endl;
     7963    throw G4QException("G4QEnv::DecayAntistrange: Nucleus DecayIn2 error");
     7964  }
     7965#ifdef pdebug
     7966  G4cout<<"G4QEnv::DecayAntistrange: *Done* f4M="<<f4Mom<<",fPDG="<<fQPDG<<", s4M="<<s4Mom
     7967        <<",sPDG="<<sQPDG<<G4endl;
     7968#endif
     7969  delete qH;
     7970  //
     7971  G4QHadron* H1 = new G4QHadron(fQPDG,f4Mom); // Create a Hadron for the 1-st baryon
     7972  theQHadrons.push_back(H1);                  // Fill "H1" (delete equivalent)
     7973  G4QHadron* H2 = new G4QHadron(sQPDG,s4Mom); // Create a Hadron for the 2-nd baryon
     7974  theQHadrons.push_back(H2);                  // Fill "H2" (delete equivalent)
     7975} // End of DecayAntistrange
    76817976
    76827977// Check that it's possible to decay the TotalResidualNucleus in Quasmon+Environ & correct
     
    77148009
    77158010  if ( resB > 1 &&
    7716        ( (!resS && ((resC == resB && reTM > resC*mProt) || (!resC && reTM > resB*mNeut) ) ) ||
    7717           (resS == resB && reTM > resS*mLamb) ) ) // Immediate Split(@@Decay) MultiBaryon
     8011       ( ( !resS &&
     8012           ( (resC == resB && reTM > resC*mProt) || (!resC && reTM > resB*mNeut) )
     8013         ) ||
     8014         (resS == resB && reTM > resS*mLamb)
     8015       )
     8016     ) // Immediate Split(@@Decay) MultiBaryon
    77188017  {
    77198018#ifdef chdebug
     
    77288027      reTLV=G4LorentzVector(0.,0.,0.,resQMa);   // GSM of the Quasmon
    77298028      if(G4QHadron(toLV).DecayIn2(reTLV,enva4M))
    7730              {
     8029      {
    77318030#ifdef pdebug
    77328031        G4cout<<"G4QE::CGS: fill EnvPDG="<<envPDG<<",4M="<<enva4M<<" and continue"<<G4endl;
     
    77568055    resEMa=theEnvironment.GetMZNS();            // GSMass of the Residual Environment
    77578056#ifdef cdebug
    7758            G4cout<<"G4QE::CGS:EnvironmentExists,gsM="<<resEMa<<",4M="<<enva4M<<enva4M.m()<<G4endl;
     8057    G4cout<<"G4QE::CGS:EnvironmentExists,gsM="<<resEMa<<",4M="<<enva4M<<enva4M.m()<<G4endl;
    77598058#endif
    77608059    reTQC+=theEnvironment.GetQCZNS();           // Quark content of the Residual Nucleus
     
    77688067    G4int    baryn=valQ.GetBaryonNumber();      // Baryon Number of the Residual vacQuasmon
    77698068    if(baryn>1)                                 // => "Can split baryon?"
    7770            {
     8069    {
    77718070      if(valQ.GetN())                           // ===> "Can split neutron?"
    7772              {
     8071      {
    77738072        G4QContent resQC=valQ-neutQC;           // QC of Residual for the Neutron
    77748073        G4int    resPDG=resQC.GetSPDGCode();    // PDG of Residual for the Neutron
     
    77768075        G4double resMas=G4QPDGCode(resPDG).GetMass(); // GS Mass of the Residual
    77778076        if(resMas+mNeut<resQM) bsCond=true;
    7778              }
     8077      }
    77798078      else if(valQ.GetP())                      // ===> "Can split proton?"
    7780              {
     8079      {
    77818080        G4QContent resQC=valQ-protQC;           // QC of Residual for the Proton
    77828081        G4int    resPDG=resQC.GetSPDGCode();    // PDG of Residual for the Proton
     
    77848083        G4double resMas=G4QPDGCode(resPDG).GetMass(); // GS Mass of the Residual
    77858084        if(resMas+mProt<resQM) bsCond=true;
    7786              }
     8085      }
    77878086      else if(valQ.GetL())                      // ===> "Can split Lambda?"
    7788              {
     8087      {
    77898088        G4QContent resQC=valQ-lambQC;           // QC of Residual for the Lambda
    77908089        G4int    resPDG=resQC.GetSPDGCode();    // PDG of Residual for the Lambda
     
    77928091        G4double resMas=G4QPDGCode(resPDG).GetMass(); // GS Mass of the Residual
    77938092        if(resMas+mLamb<resQM) bsCond=true;
    7794              }
    7795            }
     8093      }
     8094    }
    77968095  }
    77978096  G4double resTMa=reTLV.m();                    // CM Mass of the ResidualNucleus (Q+Env)
     
    78058104        <<" then the correction must be done for PDG="<<reTPDG<<G4endl;
    78068105#endif
    7807   if ( (resTMa < resSMa || (!resEMa && !bsCond) ) && nOfOUT > 0 && corFlag) // *** CORRECTION ***
     8106  if ( (resTMa < resSMa || (!resEMa && !bsCond) ) && nOfOUT > 0 && corFlag)//**CORRECTION**
    78088107  {
    78098108    G4QHadron*  theLast = theQHadrons[nOfOUT-1];
     
    78118110    G4int crPDG=theLast->GetPDGCode();
    78128111#ifdef cdebug
    7813            G4cout<<"G4QE::CGS: **Correction** lNF="<<cNf<<",lPDG="<<crPDG<<",Q4M="<<reTLV<<G4endl;
     8112    G4cout<<"G4QE::CGS: **Correction** lNF="<<cNf<<",lPDG="<<crPDG<<",Q4M="<<reTLV<<G4endl;
    78148113#endif
    78158114    G4LorentzVector hadr4M = theLast->Get4Momentum();
     
    78178116    G4LorentzVector tmpTLV=reTLV+hadr4M;        // Tot (ResidNucl+LastHadron) 4-Mom
    78188117#ifdef cdebug
    7819            G4cout<<"G4QE::CGS:YES, s4M/M="<<tmpTLV<<tmpTLV.m()<<">rSM+hM="<<resSMa+hadrMa<<G4endl;
     8118    G4cout<<"G4QE::CGS:YES, s4M/M="<<tmpTLV<<tmpTLV.m()<<">rSM+hM="<<resSMa+hadrMa<<G4endl;
    78208119#endif
    78218120    G4double tmpTM=tmpTLV.m();
     
    78488147          // Kill environment as it is already included in the decay
    78498148          theEnvironment=G4QNucleus(G4QContent(0,0,0,0,0,0), G4LorentzVector(0.,0.,0.,0.));
    7850                       }
     8149        }
    78518150        else
    78528151        {
     
    78568155          return false;
    78578156        }
    7858              }
     8157      }
    78598158      else                                      // => "Environ is vacuum" case (DecayIn2)
    78608159      {
     
    78738172#endif
    78748173          EvaporateResidual(quasH);     // Try to evaporate residual (del.eq.)
    7875                       }
     8174        }
    78768175        else
    78778176        {
     
    78828181          return false;
    78838182        }
    7884              }
     8183      }
    78858184    }
    78868185    else                                        // *** Try Last+Previous CORRECTION ***
    78878186    {
    78888187#ifdef cdebug
    7889              G4cout<<"G4QEnv::CheckGS: the Last did not help, nH="<<nOfOUT<<G4endl;
     8188      G4cout<<"G4QEnv::CheckGS: the Last did not help, nH="<<nOfOUT<<G4endl;
    78908189#endif
    78918190      if(nOfOUT>1)                              // Cor with Last&Previous can be tryed
    7892              {
     8191      {
    78938192        G4QHadron*  thePrev = theQHadrons[nOfOUT-2]; // Get pointer to Prev before Last
    78948193        if(thePrev->GetNFragments()||thePrev->GetNFragments()) return false;// Dec H/g
     
    79008199        G4double   tQMa=G4QPDGCode(totPDG).GetMass(); // GS Mass of the Residual Nucleus
    79018200#ifdef cdebug
    7902                G4cout<<"G4QE::CGS:T3="<<tmpTLV<<tmpTLV.m()<<">t+h+p="<<tQMa+hadrMa+prevMa<<G4endl;
     8201        G4cout<<"G4QE::CGS:T3="<<tmpTLV<<tmpTLV.m()<<">t+h+p="<<tQMa+hadrMa+prevMa<<G4endl;
    79038202#endif
    79048203        if(tmpTLV.m()>tQMa+hadrMa+prevMa)
     
    79188217            nucH->Set4Momentum(nuc4M);
    79198218#ifdef cdebug
    7920                    G4cout<<"G4QE::CGS:*SUCCESS**>CHECK, D4M="<<tmpTLV-hadr4M-prev4M-nuc4M<<G4endl;
     8219            G4cout<<"G4QE::CGS:*SUCCESS**>CHECK, D4M="<<tmpTLV-hadr4M-prev4M-nuc4M<<G4endl;
    79218220#endif
    79228221#ifdef pdebug
     
    79248223#endif
    79258224            EvaporateResidual(nucH);     // Try to evaporate residual (del.eq.)
    7926                  }
    7927                       }
     8225          }
     8226        }
    79288227        else                                  // ===> Try to use any hadron from the output
    79298228        {
    79308229#ifdef cdebug
    7931                         G4cout<<"G4QE::CGS:Prev&Last didn't help,nH="<<nOfOUT<<">2, MQ="<<resQMa<<G4endl;
    7932 #endif
    7933                                                                                 G4int nphot=-1;                     // #of photons
     8230          G4cout<<"G4QE::CGS:Prev&Last didn't help,nH="<<nOfOUT<<">2, MQ="<<resQMa<<G4endl;
     8231#endif
     8232          G4int nphot=-1;                     // #of photons
    79348233          G4int npip=-1;                      // #of Pi+
    79358234          G4int npiz=-1;                      // #of Pi0
     
    79378236          G4double emaz=0.;                   // The maximum energy for pi0 (to sel high E)
    79388237          for(G4int id=nOfOUT-1; id>=0; id--) // Search for photons and pi+, and pi-
    7939                              {
     8238          {
    79408239            G4QHadron* curHadr = theQHadrons[id];
    79418240            G4int hPDG=curHadr->GetPDGCode();
     
    79448243            else if(hPDG==111)
    79458244            {
    7946                                           G4double piE=curHadr->Get4Momentum().e();
     8245              G4double piE=curHadr->Get4Momentum().e();
    79478246#ifdef chdebug
    79488247              G4cout<<"G4QE::CheckGroundState:"<<id<<",Epi0="<<piE<<">"<<emaz<<G4endl;
     
    79578256          }
    79588257          if(nphot>=0)                 // Photon is found, try to use it to resolve PANIC
    7959                                {
     8258          {
    79608259            G4QHadron* curHadr = theQHadrons[nphot];      // Pointer to the photon
    79618260            G4LorentzVector ch4M=curHadr->Get4Momentum(); // 4-Mom of the Photon
     
    79638262            G4double ttM=tt4M.m();          // Mass of the Phot+ResidQm compaund system
    79648263            if(resQMa<ttM)                  // PANIC can be resolved with this Photon
    7965                                  {
     8264            {
    79668265              G4LorentzVector quas4M = G4LorentzVector(0.,0.,0.,resSMa);//GSMass of Quasm
    79678266              G4QHadron* rqH = new G4QHadron(reTQC,quas4M); // Prototype of outputResidQ
     
    79878286                                                          G4LorentzVector(0.,0.,0.,0.));
    79888287                return true;
    7989                             }
     8288              }
    79908289            } // End of the KINEMATIC CHECK FOR THE PHOTON if
    79918290          } // End of nphot IF
     
    79978296          if (envPDG == 90000000 && !resS && resB > 1 &&
    79988297              ((npip >= 0 && resC == -2) || (npim >= 0 && resC-resB == 2)) )
    7999           {
     8298   {
    80008299            G4int npi=npip;               // (Delta-)+(Delta-)+k*n+(pi+)->(k+2)*n+(pi-)
    80018300            G4int piPD=-211;
     
    80238322#endif
    80248323            if(suM<ttM)                    // PANIC can be resolved with this Pion
    8025                                  {
     8324            {
    80268325              G4LorentzVector fn4M = G4LorentzVector(0.,0.,0.,suB);//First nucleon(s)
    80278326              G4LorentzVector sn4M = G4LorentzVector(0.,0.,0.,nuM);//Second nucleon
     
    80578356#endif
    80588357                return true;
    8059                             }
     8358              }
    80608359            } // End of the KINEMATIC CHECK FOR THE PI+/PI- if
    80618360          } // End of npip/pin Isonucleus IF
    80628361          if(envPDG==90000000&&!resS&&resB>1&&npiz>=0&&(resC<-1||resC-resB>1))
    8063                                {
     8362          {
    80648363#ifdef chdebug
    80658364            G4cout<<"***G4QE::CGS:Pi0, rPDG="<<resQPDG<<",rC="<<resC<<",rB="<<resB<<G4endl;
     
    80898388#endif
    80908389            if(sum<ttM)                     // PANIC can be resolved with this Pi0
    8091                                  {
     8390            {
    80928391              G4LorentzVector fn4M = G4LorentzVector(0.,0.,0.,suB); // Nucleon(s)
    80938392              G4LorentzVector pi4M = G4LorentzVector(0.,0.,0.,suM); // Pion(s)
     
    81158414                }
    81168415#ifdef chdebug
    8117                                                    G4cout<<"G4QE::CGS: nucl="<<nuPD<<fn4M<<resB<<", pion="<<pi4M<<npi<<G4endl;
     8416                G4cout<<"G4QE::CGS: nucl="<<nuPD<<fn4M<<resB<<", pion="<<pi4M<<npi<<G4endl;
    81188417#endif
    81198418
    81208419                return true;
    8121                             }
     8420              }
    81228421#ifdef chdebug
    81238422              else G4cout<<"***G4QEnv::CheckGS:DecayIn3:*Pi0* tM="<<ttM<<","<<sum<<G4endl;
    81248423#endif
    81258424            } // End of the KINEMATIC CHECK FOR THE PI0 if
    8126                                                                                 } // End of npiz Isonucleus IF
     8425          } // End of npiz Isonucleus IF
    81278426#ifdef cdebug
    8128                         G4cout<<"G4QE::CGS: Photons can't help nP="<<nphot<<". TryChangeCharge."<<G4endl;
     8427          G4cout<<"G4QE::CGS: Photons can't help nP="<<nphot<<". TryChangeCharge."<<G4endl;
    81298428#endif
    81308429          // > Photons did not help, try to find an appropriate partner to join and decay
     
    81398438          if((!nnPDG||nnPDG==10)&&nnQC.GetBaryonNumber()>0) nnPDG=nnQC.GetZNSPDGCode();
    81408439#ifdef cdebug
    8141                         G4cout<<"G4QE::CGS: nnPDR="<<nnPDG<<". TryChangeCharge nOUT="<<nOfOUT<<",Iso="
     8440          G4cout<<"G4QE::CGS: nnPDR="<<nnPDG<<". TryChangeCharge nOUT="<<nOfOUT<<",Iso="
    81428441                <<isoN<<",Nor="<<norN<<",C="<<reTCH<<",B="<<reTBN<<G4endl;
    81438442#endif
    81448443          if(isoN)                           // Calculations for the Isonuclear Residual
    8145                                {
     8444          {
    81468445            if(reTCH<0)                      // "at least one Delta-" isostate (chngPort)
    81478446            {
     
    81508449              nnPDG=nnQC.GetSPDGCode();      // Change PDGCode of theResidNormalNucleus
    81518450              if(nnPDG==10&&nnQC.GetBaryonNumber()>0) nnPDG=nnQC.GetZNSPDGCode();
    8152                                  }
     8451            }
    81538452            G4QPDGCode nnQPDG(nnPDG);        // Now can even have Q-code !
    81548453            if(nnPDG<80000000) nnM=nnQPDG.GetMass(); // Mass for the Fundamental Hadron
     
    81618460            if(force) chx2g=false;
    81628461            for(G4int hd=nOfOUT-1; hd>=0; hd--)// Try to use any hadron to resolve PANIC
    8163                                {
     8462            {
    81648463              G4QHadron* curHadr = theQHadrons[hd];
    81658464              G4int chNF=curHadr->GetNFragments();
     
    81698468              G4LorentzVector ch4M=curHadr->Get4Momentum(); // 4Mom of the Current Hadron
    81708469#ifdef cdebug
    8171                                    G4cout<<"G4QE::CGS:#"<<hd<<",ch="<<chCH<<",b="<<chBN<<",4M="<<ch4M<<G4endl;
     8470              G4cout<<"G4QE::CGS:#"<<hd<<",ch="<<chCH<<",b="<<chBN<<",4M="<<ch4M<<G4endl;
    81728471#endif
    81738472              if(!chNF)
     
    81778476                G4double ttM=tt4M.m();          // TotalMass of CurHadr+Residual compaund
    81788477                if(isoN)                        // "1 Delta Isonucleus" case
    8179                               {
     8478                {
    81808479                  if(nnM+mPi+chM<ttM)           // PANIC can be resolved with thisCurHadron
    8181                                        {
     8480                  {
    81828481#ifdef cdebug
    81838482                      G4cout<<"G4QE::CGS:CurH+ResQ+Pion t="<<tt4M<<ttM<<",cM="<<chM<<",rM="
     
    82098508                                                        ,G4LorentzVector(0.,0.,0.,0.));
    82108509                      return true;
    8211                                   }
     8510                    }
    82128511#ifdef cdebug
    8213                                                                                                                                                                 else G4cout<<"***G4QE::CGS:DecIn3 CurH+ResQ+Pion dM="<<ttM-chM<<G4endl;
     8512                    else G4cout<<"***G4QE::CGS:DecIn3 CurH+ResQ+Pion dM="<<ttM-chM<<G4endl;
    82148513#endif
    82158514                  }
    8216                   if ( (reTCH < 0 && chCH > 0) || (reTCH > reTBN && chCH < chBN) ) // Isoexchange can help
    8217                   {
     8515                  if ( (reTCH < 0 && chCH > 0) || (reTCH > reTBN && chCH < chBN) ) //IsoEx?
     8516                  {
    82188517                    G4QContent chQC=curHadr->GetQC(); // QuarkCont of the CurrentHadron
    82198518                    if(reTCH<0)chQC+=pimQC;           // Add the negativPion QC to CurHadr
     
    82478546                        {
    82488547                          if(chCH+reTCH-chQC.GetCharge()-nnQC.GetCharge())
    8249                                                                       G4cout<<"**G4QE::CGS:ChEx CH+2G i="<<reTCH<<"+h="<<chCH<<", f="
     8548                            G4cout<<"**G4QE::CGS:ChEx CH+2G i="<<reTCH<<"+h="<<chCH<<", f="
    82508549                                  <<nnQC.GetCharge()<<"+o="<<chQC.GetCharge()<<G4endl;
    82518550                          curHadr->Set4Momentum(ch4M);// Change 4M of the Current Hadron
     
    82688567                          G4QNucleus(G4QContent(0,0,0,0,0,0),G4LorentzVector(0.,0.,0.,0.));
    82698568                          return true;
    8270                                       }
     8569                        }
    82718570                      } // End of "the Normal decay without 2 gammas"
    82728571                      else                        // Normal decay (without "Pi0"->2 gammas)
     
    82828581                        {
    82838582                          if(chCH+reTCH-chQC.GetCharge()-nnQC.GetCharge())
    8284                                                                       G4cout<<"**G4QE::CGS:ChEx CH+RQ i="<<reTCH<<"+h="<<chCH<<", f="
     8583                            G4cout<<"**G4QE::CGS:ChEx CH+RQ i="<<reTCH<<"+h="<<chCH<<", f="
    82858584                                  <<nnQC.GetCharge()<<"+o="<<chQC.GetCharge()<<G4endl;
    82868585                          curHadr->Set4Momentum(ch4M);// Change 4M of the Current Hadron
     
    82978596                          G4QNucleus(G4QContent(0,0,0,0,0,0),G4LorentzVector(0.,0.,0.,0.));
    82988597                          return true;
    8299                                       }
     8598                        }
    83008599                      } // End of "the Normal decay without 2 gammas"
    83018600                    }
    83028601                    else
    8303                                                                                                                                                   {
     8602                    {
    83048603#ifdef cdebug
    83058604                      G4cout<<"**G4QE::CGS:rM+hB="<<nnM+chM<<">"<<ttM<<",B="<<chBN<<G4endl;
     
    83148613                        G4int tcC=tcQC.GetCharge();                 // Total Charge
    83158614                        G4int tcBN=tcQC.GetBaryonNumber();          // Total Baryon Number
    8316                         if ( tcBN == 2 || (!tcS && !tcC) || tcS == tcBN || tcC == tcBN ) //dec DiBar or MulBar
     8615                        //Try to decay in DiBaryon or MultyBaryon
     8616                        if ( tcBN == 2 || (!tcS && !tcC) || tcS == tcBN || tcC == tcBN )
    83178617                        {
    83188618                          if(tcBN==2) theEnvironment.DecayDibaryon(tcH,&theQHadrons); // DB
     
    83278627                        }
    83288628                        else if(tcM<ttM)// @@ Can't evaporate here, can only radiate gamma
    8329                                                                                                                                                                                   {
     8629                        {
    83308630                          G4LorentzVector tc4M=G4LorentzVector(0.,0.,0.,tcM);//4M of TotCom
    83318631                          G4LorentzVector gc4M=G4LorentzVector(0.,0.,0.,0.); //4M of gamma
     
    83518651#endif
    83528652                            EvaporateResidual(tcH); // Try to evaporate(d.e.)
    8353                                         }
     8653                          }
    83548654                        }
    8355                                                                                                                                                                                   else // @@ Fill the TotalCompound instead of the CurrentHadron @@
    8356                                                                                                                                                                                   {
     8655                        else // @@ Fill the TotalCompound instead of the CurrentHadron @@
     8656                        {
    83578657#ifdef cdebug
    83588658                          G4cout<<"G4QE::CGS:**CEF,M="<<tcM<<">"<<ttM<<",B="<<chBN<<G4endl;
     
    83688668                } // End of the IF: KINEMATIC CHECK FOR THE CURRENT HADRON(Isonuclear Case)
    83698669                else if(norN)
    8370                               {
     8670                {
    83718671                  if(resSMa+chM<ttM)          // PANIC can be resolved with this CurHadron
    8372                                        {
     8672                  {
    83738673                    G4LorentzVector quas4M = G4LorentzVector(0.,0.,0.,resSMa);// GSMass ofQ
    83748674                    G4QHadron* rqH = new G4QHadron(reTQC,quas4M);// Prototype OutputResidQ
     
    83958695                                                            ,G4LorentzVector(0.,0.,0.,0.));
    83968696                      return true;
    8397                                   }
     8697                    }
    83988698                  } // End of the KINEMATIC CHECK FOR THE CURRENT HADRON if (NormNuclCase)
    83998699                } // End of IsoNucleus/NormalNucleus choice
    84008700              } // End of the NumberOfFragments=0 (NOT DECAYED PARTICLE) if
    8401                                  } // End of the LOOP over hadrons and all attempts to resolve PANIC
     8701            } // End of the LOOP over hadrons and all attempts to resolve PANIC
    84028702#ifdef cdebug
    84038703            G4cout<<"G4QEnv::CheckGS:***Any hadron from the OUTPUT did not help"<<G4endl;
     
    84108710            if(npiz>-1) hind=npiz;
    84118711            else
    8412                                                                                                 {
     8712            {
    84138713              if(resC+resC>resB && npim>-1) hind=npim;
    84148714              else                          hind=npip;
    84158715            }
    84168716            if(hind>-1)
    8417                                                                                                 {
     8717            {
    84188718              G4QHadron* curHadr = theQHadrons[hind];
    84198719              G4int chNF=curHadr->GetNFragments();
     
    84468746                  if(!G4QHadron(tt4M).DecayIn3(quas4M,fgam4M,sgam4M))G4cout<<"*3*"<<G4endl;
    84478747                  else
    8448                                                                                                                                                 {
     8748                  {
    84498749                    curHadr->Set4Momentum(fgam4M); // Change 4M of the Pion to Gamma
    84508750                    curHadr->SetQPDG(gamQPDG);      // Change QPDG of the Pion to Gamma
     
    84628762          return false;
    84638763        } // End of the KINEMATIC LIMIT FOR THE L&P CORRECTION if/else (try any hadron)
    8464              } // End of the POSSIBILITY OF PREV+LAST (OR MORE) CORRECTION if
     8764      } // End of the POSSIBILITY OF PREV+LAST (OR MORE) CORRECTION if
    84658765      else return false;
    84668766    } // End of the CORRECTION WITH THE LAST if/else
     
    84848784      {
    84858785#ifdef pdebug
    8486                G4cout<<"G4QEnv::Copy&DeleteHV:#"<<ih<<", hPDG="<<inH->GetPDGCode()<<G4endl;
     8786        G4cout<<"G4QEnv::Copy&DeleteHV:#"<<ih<<", hPDG="<<inH->GetPDGCode()<<G4endl;
    84878787#endif
    84888788        G4QHadron* curH = new G4QHadron(inH);      // will be deleted with allQHadronVector
     
    85178817    resSMa+=resEMa;                               // Minimal Split Mass of Residual Nucleus
    85188818    G4double resTMa=reTLV.m();                    // CM Mass of theResidNucleus (Quasm+Env)
    8519         //#ifdef pdebug
     8819 //#ifdef pdebug
    85208820    G4cout<<"G4QEnv::DecayInEnvQ: totM="<<reTLV<<resTMa<<" > rQM+rEM="<<resSMa<<G4endl;
    8521         //#endif
     8821 //#endif
    85228822    if(resTMa>resSMa)
    85238823    {
     
    85388838        envaH->Set4Momentum(enva4M);
    85398839        EvaporateResidual(envaH);                // Try to evaporate residual (del. equiv.)
    8540              }
     8840      }
    85418841    }
    85428842    else return false;
     
    85548854  tot4Mom  +=Q->Get4Momentum();
    85558855#ifdef debug
    8556                 G4cout<<"G4QEnv::AddQuasmon:t4M="<<tot4Mom<<",tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
     8856  G4cout<<"G4QEnv::AddQuasmon:t4M="<<tot4Mom<<",tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;
    85578857#endif
    85588858}
     
    85748874      if(quad>0.875)    return G4ThreeVector(-x/r,-y/r,-z/r);
    85758875      else              return G4ThreeVector(-x/r,-y/r, z/r);
    8576            }
     8876    }
    85778877    else
    85788878    {
    85798879      if(quad>0.625)    return G4ThreeVector(-x/r, y/r,-z/r);
    85808880      else              return G4ThreeVector(-x/r, y/r, z/r);
    8581            }
     8881    }
    85828882  }
    85838883  else
     
    85878887      if(quad>0.375)    return G4ThreeVector( x/r,-y/r,-z/r);
    85888888      else              return G4ThreeVector( x/r,-y/r, z/r);
    8589            }
     8889    }
    85908890    else if(quad>0.125) return G4ThreeVector( x/r, y/r,-z/r);
    85918891  }
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QException.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QException.cc,v 1.9 2006/06/29 20:06:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QException.cc,v 1.10 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QException ----------------
    3131//           by Mikhail Kossov, November 2003.
    3232//      class for an Exception used by the CHIPS Model
    33 // ------------------------------------------------------------
     33// -------------------------------------------------------------
     34// Short description: Just an internal CHIPS Exception Messenger
     35// -------------------------------------------------------------
    3436
    3537#include "G4QException.hh"
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QFragmentation.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QFragmentation.cc,v 1.3 2007/05/02 14:59:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QFragmentation.cc,v 1.5 2009/04/29 07:53:18 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    3939//     G4ExcitedStringDecay
    4040// -----------------------------------------------------------------------------
    41 //
     41// Short description: CHIPS string fragmentation class
     42// -----------------------------------------------------------------------------
    4243
    4344//#define debug
     
    6061G4double G4QFragmentation::widthOfPtSquare=-0.72*GeV*GeV; // pt -width2 forStringExcitation
    6162G4double G4QFragmentation::minExtraMass=250.*MeV;// minimum excitation mass
    62 G4double G4QFragmentation::minmass=250.*MeV;        // mean pion transverse mass for Xmin
     63G4double G4QFragmentation::minmass=250.*MeV;     // mean pion transverse mass for Xmin
    6364
    6465G4QFragmentation::G4QFragmentation() : theNucleus(0)
    6566{
    6667  // Construct Shortlived particles (needed after the 2006 Particles revolution)
    67         G4ShortLivedConstructor ShortLived;
    68         ShortLived.ConstructParticle();
     68  G4ShortLivedConstructor ShortLived;
     69  ShortLived.ConstructParticle();
    6970}
    7071
     
    8889  while(!strings)
    8990  {
    90         if (attempts++ > maxAttempts )
    91         {
    92                                         G4cerr<<"***G4QFragmentation::Scatter: "<<attempts<<" to create a string ( > max="
     91    if (attempts++ > maxAttempts )
     92    {
     93      G4cerr<<"***G4QFragmentation::Scatter: "<<attempts<<" to create a string ( > max="
    9394            <<maxAttempts<<") --> try to increase maxAttempts"<<G4endl;
    9495      G4Exception("G4QFragmentation::Scatter:","72",FatalException,"StringCreation");
    95         }
    96            InitModel(aNucleus,thePrimary);
    97         strings = GetStrings();
     96    }
     97    InitModel(aNucleus,thePrimary);
     98    strings = GetStrings();
    9899  }
    99100 
     
    119120void G4QFragmentation::InitModel(const G4QNucleus& aNucleus,const G4QHadron& aProjectile)
    120121{
    121   static const G4double         mProt = G4Proton::Proton()->GetPDGMass(); // Mass of proton
     122  static const G4double  mProt = G4Proton::Proton()->GetPDGMass(); // Mass of proton
    122123  Init(aNucleus.GetN(),aNucleus.GetZ());
    123124  theCurrentVelocity.setX(0);   
     
    133134  //e_per_projectile += proj4M.vect()*proj4M.vect();
    134135  //e_per_projectile /=nCons*nCons;
    135         //e_per_projectile = std::sqrt(e_per_projectile);
    136         //e_per_projectile += G4Proton::Proton()->GetPDGMass();//@@Add mass of TargetProtonAtRest
     136  //e_per_projectile = std::sqrt(e_per_projectile);
     137  //e_per_projectile += G4Proton::Proton()->GetPDGMass();//@@Add mass of TargetProtonAtRest
    137138  G4double vz = pz_per_projectile/e_per_projectile;
    138139#ifdef debug
    139                 G4cout<<"G4QFragmentation::Init: Projectile4M="<<proj4M<<", vz="<<vz<<G4endl;
     140  G4cout<<"G4QFragmentation::Init: Projectile4M="<<proj4M<<", vz="<<vz<<G4endl;
    140141#endif
    141142  theCurrentVelocity.setZ(vz);
     
    278279        G4QHadron* aTarget = new G4QHadron(*pNucleon);
    279280        //G4QFragmentation_NPart ++;                       // ? M.K.
    280                theTargets.push_back(aTarget);
    281               pNucleon=aTarget;
     281        theTargets.push_back(aTarget);
     282        pNucleon=aTarget;
    282283        if((theProbability.GetDiffractiveProbability(s,Distance2)/Probability >
    283284            G4UniformRand() && (ModelMode==SOFT)) || ModelMode==DIFFRACTIVE)
    284                {
    285                  // diffractive interaction occurs
    286                  if(IsSingleDiffractive()) ExciteSingDiffParticipants(aProjectile, aTarget);
    287                  else                          ExciteDiffParticipants(aProjectile, aTarget);
     285        {
     286          // diffractive interaction occurs
     287          if(IsSingleDiffractive()) ExciteSingDiffParticipants(aProjectile, aTarget);
     288          else                          ExciteDiffParticipants(aProjectile, aTarget);
    288289          G4QInteraction* aInteraction = new G4QInteraction(aProjectile);
    289290          aInteraction->SetTarget(aTarget);
    290291          theInteractions.push_back(aInteraction);
    291                  aInteraction->SetNumberOfDiffractiveCollisions(1);
     292          aInteraction->SetNumberOfDiffractiveCollisions(1);
    292293          totalCuts += 1;
    293                }
    294                else
    295                {
    296                  // nondiffractive soft interaction occurs
    297                  // sample nCut+1 (cut Pomerons) pairs of strings can be produced
     294        }
     295        else
     296        {
     297          // nondiffractive soft interaction occurs
     298          // sample nCut+1 (cut Pomerons) pairs of strings can be produced
    298299          G4int nCut;
    299300          G4double* running = new G4double[nCutMax];
     
    301302          for(nCut = 0; nCut < nCutMax; nCut++)
    302303          {
    303                    running[nCut] = theProbability.GetCutPomeronProbability(s, Distance2, nCut+1);
     304            running[nCut] = theProbability.GetCutPomeronProbability(s, Distance2, nCut+1);
    304305            if(nCut!=0) running[nCut] += running[nCut-1];
    305306          }
    306                  G4double random = running[nCutMax-1]*G4UniformRand();
     307          G4double random = running[nCutMax-1]*G4UniformRand();
    307308          for(nCut = 0; nCut < nCutMax; nCut++) {if(running[nCut] > random) break;}
    308309          delete [] running;
     
    416417    else
    417418    {
    418              //generatedHadrons = new G4QHadronVector;
    419              //generatedHadrons->push_back((*theStrings)[astring]->GetAsQHadron()); //@@ NotImplem
     419      //generatedHadrons = new G4QHadronVector;
     420      //generatedHadrons->push_back((*theStrings)[astring]->GetAsQHadron()); //@@ NotImplem
    420421    }   
    421            if (!generatedHadrons)
    422            {
    423                     G4cerr<<"G4QFragmentation::FragmentStrings: No Hadrons produced" << G4endl;
    424                     continue;
    425            }
     422    if (!generatedHadrons)
     423    {
     424      G4cerr<<"G4QFragmentation::FragmentStrings: No Hadrons produced" << G4endl;
     425      continue;
     426    }
    426427    G4LorentzVector KTsum1(0.,0.,0.,0.);
    427428    for(unsigned aTrack=0; aTrack<generatedHadrons->size(); aTrack++)
    428            {
    429                     theResult->push_back((*generatedHadrons)[aTrack]);
    430                     KTsum1+= (*generatedHadrons)[aTrack]->Get4Momentum();
    431            }
    432        
    433            if(std::abs((KTsum1.e()-(*theStrings)[astring]->Get4Momentum().e())/KTsum1.e())
     429    {
     430      theResult->push_back((*generatedHadrons)[aTrack]);
     431      KTsum1+= (*generatedHadrons)[aTrack]->Get4Momentum();
     432    }
     433 
     434    if(std::abs((KTsum1.e()-(*theStrings)[astring]->Get4Momentum().e())/KTsum1.e())
    434435       > perMillion) NeedEnergyCorrector=true;
    435436    //      clean up
    436            delete generatedHadrons;
     437    delete generatedHadrons;
    437438  }
    438439#ifdef debug
     
    472473      G4cerr<<"***G4QFragmentation::EnergyAndMomentumCorrector: SumMass="<<SumMass<<G4endl;
    473474      G4Exception("G4QFragmentation::EnergyAndMomentumCor:","72",FatalException,"NANMass");
    474            }
     475    }
    475476  }
    476477  // Cannot correct a single particle
     
    508509      break;
    509510    }
    510 #ifdef debug 
     511#ifdef debug
    511512    G4cout<<"G4QFragmentation::EnergyAndMomentumCorrector: Scale-1="<<Scale-1<<", TotM="
    512513          <<TotalCollisionMass<<", Sum="<<Sum<<G4endl;
    513 #endif     
    514   }   
     514#endif
     515  }
     516#ifdef debug
    515517  if(!success)
    516518  {
    517519    G4cout<<"***G4QFragmentation::EnergyAndMomentumCorrector: Scale #1 at end of loop M="
    518520          <<TotalCollisionMass<<", S"<<Sum<<", Sc="<<Scale
    519           <<" Increase number of attempts or increase ERRLIMIT"<<G4endl;
    520     G4Exception("G4QFragmentation::SelectInteractions:","72",FatalException,"NotCorrect");
    521   }
     521          <<" Increase number of attempts or increase the ErrLimit parameter"<<G4endl;
     522    //G4Exception("G4QFragmentation::EnergyAndMomCor:","72",FatalException,"NoCorrection");
     523  }
     524#endif
    522525  // Compute c.m.s. interaction velocity and KTV back boost
    523526  Beta = TotalCollisionMom.boostVector();
     
    531534                                                G4QHadron* target) const
    532535{
    533         G4LorentzVector Pprojectile=projectile->Get4Momentum();
    534         G4double Mprojectile=projectile->GetMass() + minExtraMass;
    535         G4double Mprojectile2=Mprojectile*Mprojectile;
     536  G4LorentzVector Pprojectile=projectile->Get4Momentum();
     537  G4double Mprojectile=projectile->GetMass() + minExtraMass;
     538  G4double Mprojectile2=Mprojectile*Mprojectile;
    536539  G4LorentzVector Ptarget=target->Get4Momentum();
    537540  G4double Mtarget=target->GetMass() + minExtraMass;
    538541  G4double Mtarget2=Mtarget*Mtarget;
    539542#ifdef debug
    540         G4cout<<"G4QFragm::ExciteDiffPartici:Ep="<<Pprojectile.e()<<",Et="<<Ptarget.e()<<G4endl;
     543  G4cout<<"G4QFragm::ExciteDiffPartici:Ep="<<Pprojectile.e()<<",Et="<<Ptarget.e()<<G4endl;
    541544#endif
    542545  // Transform momenta to cms and then rotate parallel to z axis;
    543         G4LorentzVector Psum=Pprojectile+Ptarget;
    544         G4LorentzRotation toCms(-Psum.boostVector()); // Boost Rotation to CMS
    545         G4LorentzVector Ptmp=toCms*Pprojectile;
    546         if(Ptmp.pz()<=0.) // "String" moving backwards in CMS, abort collision !! ? M.K.
    547         {
    548 #ifdef debug
    549            G4cout<<"G4QFragmentation::ExciteDiffParticipants: *1* abort Collision!! *1*"<<G4endl;
    550 #endif
    551                   return false;
    552          }                         
    553         toCms.rotateZ(-Ptmp.phi());
    554         toCms.rotateY(-Ptmp.theta());
     546  G4LorentzVector Psum=Pprojectile+Ptarget;
     547  G4LorentzRotation toCms(-Psum.boostVector()); // Boost Rotation to CMS
     548  G4LorentzVector Ptmp=toCms*Pprojectile;
     549  if(Ptmp.pz()<=0.) // "String" moving backwards in CMS, abort collision !! ? M.K.
     550  {
     551#ifdef debug
     552    G4cout<<"G4QFragmentation::ExciteDiffParticipants: *1* abort Collision!! *1*"<<G4endl;
     553#endif
     554    return false;
     555  }         
     556  toCms.rotateZ(-Ptmp.phi());
     557  toCms.rotateY(-Ptmp.theta());
    555558#ifdef debug
    556559  G4cout<<"G4QFragment::ExciteDiffParticipantts: Be4Boost Pproj="<<Pprojectile<<", Ptarg="
    557560        <<Ptarget<<G4endl;
    558561#endif
    559         G4LorentzRotation toLab(toCms.inverse()); // Boost Rotation to LabSys (LS)
    560         Pprojectile.transform(toCms);
    561         Ptarget.transform(toCms);
    562 #ifdef debug
    563         G4cout<< "G4QFragment::ExciteDiffParticipantts: AfterBoost Pproj="<<Pprojectile<<"Ptarg="
     562  G4LorentzRotation toLab(toCms.inverse()); // Boost Rotation to LabSys (LS)
     563  Pprojectile.transform(toCms);
     564  Ptarget.transform(toCms);
     565#ifdef debug
     566  G4cout<< "G4QFragment::ExciteDiffParticipantts: AfterBoost Pproj="<<Pprojectile<<"Ptarg="
    564567        <<Ptarget<<", cms4M="<<Pprojectile+Ptarget<<G4endl;
    565         G4cout<<"G4QFragment::ExciteDiffParticipantts: ProjX+="<<Pprojectile.plus()<<", ProjX-="
     568  G4cout<<"G4QFragment::ExciteDiffParticipantts: ProjX+="<<Pprojectile.plus()<<", ProjX-="
    566569        <<Pprojectile.minus()<<", TargX+="<< Ptarget.plus()<<", TargX-="<<Ptarget.minus()
    567570        <<G4endl;
    568571#endif
    569         G4LorentzVector Qmomentum(0.,0.,0.,0.);
    570         G4int whilecount=0;
    571         do
    572   {
    573     //  Generate pt             
    574            G4double maxPtSquare=sqr(Ptarget.pz());
    575            if(whilecount++>=500 && whilecount%100==0) // @@ M.K. Hardwired limits
    576 #ifdef debug
    577                 G4cout<<"G4QFragmentation::ExciteDiffParticipantts: can loop, loopCount="<<whilecount
     572  G4LorentzVector Qmomentum(0.,0.,0.,0.);
     573  G4int whilecount=0;
     574  do
     575  {
     576    //  Generate pt 
     577    G4double maxPtSquare=sqr(Ptarget.pz());
     578    if(whilecount++>=500 && whilecount%100==0) // @@ M.K. Hardwired limits
     579#ifdef debug
     580    G4cout<<"G4QFragmentation::ExciteDiffParticipantts: can loop, loopCount="<<whilecount
    578581          <<", maxPtSquare="<<maxPtSquare<<G4endl;
    579582#endif
     
    583586      G4cout<<"G4QFragmentation::ExciteDiffParticipants: *2* abort Loop!! *2*"<<G4endl;
    584587#endif
    585                    return false;          //  Ignore this interaction
    586     }
    587            Qmomentum=G4LorentzVector(GaussianPt(widthOfPtSquare,maxPtSquare),0);
     588      return false;    //  Ignore this interaction
     589    }
     590    Qmomentum=G4LorentzVector(GaussianPt(widthOfPtSquare,maxPtSquare),0);
    588591#ifdef debug
    589592    G4cout<<"G4QFragment::ExciteDiffParticipants: generated Pt="<<Qmomentum<<", ProjPt="
     
    591594#endif
    592595    //  Momentum transfer
    593            G4double Xmin = minmass/(Pprojectile.e() + Ptarget.e());
    594            G4double Xmax=1.;
    595            G4double Xplus =ChooseX(Xmin,Xmax);
    596            G4double Xminus=ChooseX(Xmin,Xmax);
    597 #ifdef debug
    598            G4cout<<"G4QFragment::ExciteDiffParticip: X-plus="<<Xplus<<",X-minus="<<Xminus<<G4endl;
    599 #endif
    600            G4double pt2=G4ThreeVector(Qmomentum.vect()).mag2();
    601            G4double Qplus =-pt2/Xminus/Ptarget.minus();
    602            G4double Qminus= pt2/Xplus /Pprojectile.plus();
    603            Qmomentum.setPz((Qplus-Qminus)/2);
    604            Qmomentum.setE( (Qplus+Qminus)/2);
    605 #ifdef debug
    606            G4cout<<"G4QFragment::ExciteDiffParticip: Qplus="<<Qplus<<", Qminus="<<Qminus<<", pt2="
     596    G4double Xmin = minmass/(Pprojectile.e() + Ptarget.e());
     597    G4double Xmax=1.;
     598    G4double Xplus =ChooseX(Xmin,Xmax);
     599    G4double Xminus=ChooseX(Xmin,Xmax);
     600#ifdef debug
     601    G4cout<<"G4QFragment::ExciteDiffParticip: X-plus="<<Xplus<<",X-minus="<<Xminus<<G4endl;
     602#endif
     603    G4double pt2=G4ThreeVector(Qmomentum.vect()).mag2();
     604    G4double Qplus =-pt2/Xminus/Ptarget.minus();
     605    G4double Qminus= pt2/Xplus /Pprojectile.plus();
     606    Qmomentum.setPz((Qplus-Qminus)/2);
     607    Qmomentum.setE( (Qplus+Qminus)/2);
     608#ifdef debug
     609    G4cout<<"G4QFragment::ExciteDiffParticip: Qplus="<<Qplus<<", Qminus="<<Qminus<<", pt2="
    607610          <<pt2<<", Qmomentum="<<Qmomentum<<", ProjM="<<(Pprojectile+Qmomentum).mag()
    608611          <<", TargM="<<(Ptarget-Qmomentum).mag()<<G4endl;
    609612#endif
    610         } while((Pprojectile+Qmomentum).mag2()<=Mprojectile2 ||
     613  } while((Pprojectile+Qmomentum).mag2()<=Mprojectile2 ||
    611614          (Ptarget-Qmomentum).mag2()<=Mtarget2);
    612         Pprojectile += Qmomentum;
    613         Ptarget     -= Qmomentum;
    614 #ifdef debug
    615         G4cout<<"G4QFragment::ExciteDiffParticipan: Proj(Q)="<<Pprojectile<<", Targ(Q)="<<Ptarget
    616                <<", Proj(back)="<<toLab*Pprojectile<<", Targ(bac)="<< toLab*Ptarget << G4endl;
     615  Pprojectile += Qmomentum;
     616  Ptarget     -= Qmomentum;
     617#ifdef debug
     618  G4cout<<"G4QFragment::ExciteDiffParticipan: Proj(Q)="<<Pprojectile<<", Targ(Q)="<<Ptarget
     619        <<", Proj(back)="<<toLab*Pprojectile<<", Targ(bac)="<< toLab*Ptarget << G4endl;
    617620#endif
    618621  // Transform back and update SplitableHadron Participant.
    619         Pprojectile.transform(toLab);
    620         Ptarget.transform(toLab);
    621 #ifdef debug
    622         G4cout<< "G4QFragmentation::ExciteDiffParticipants: TargetMass="<<Ptarget.mag()<<G4endl;
    623 #endif
    624          target->Set4Momentum(Ptarget);         
    625 #ifdef debug
    626         G4cout<<"G4QFragment::ExciteDiffParticipants:ProjectileMass="<<Pprojectile.mag()<<G4endl;
    627 #endif
    628         projectile->Set4Momentum(Pprojectile);
    629         return true;
     622  Pprojectile.transform(toLab);
     623  Ptarget.transform(toLab);
     624#ifdef debug
     625  G4cout<< "G4QFragmentation::ExciteDiffParticipants: TargetMass="<<Ptarget.mag()<<G4endl;
     626#endif
     627  target->Set4Momentum(Ptarget); 
     628#ifdef debug
     629  G4cout<<"G4QFragment::ExciteDiffParticipants:ProjectileMass="<<Pprojectile.mag()<<G4endl;
     630#endif
     631  projectile->Set4Momentum(Pprojectile);
     632  return true;
    630633} // End of ExciteDiffParticipants
    631634
     
    635638                                                    G4QHadron* target) const
    636639{
    637         G4LorentzVector Pprojectile=projectile->Get4Momentum();
    638         G4double Mprojectile=projectile->GetMass() + minExtraMass;
    639         G4double Mprojectile2=Mprojectile*Mprojectile;
     640  G4LorentzVector Pprojectile=projectile->Get4Momentum();
     641  G4double Mprojectile=projectile->GetMass() + minExtraMass;
     642  G4double Mprojectile2=Mprojectile*Mprojectile;
    640643  G4LorentzVector Ptarget=target->Get4Momentum();
    641644  G4double Mtarget=target->GetMass() + minExtraMass;
    642645  G4double Mtarget2=Mtarget*Mtarget;
    643646#ifdef debug
    644         G4cout<<"G4QFragm::ExSingDiffPartici:Ep="<<Pprojectile.e()<<",Et="<<Ptarget.e()<<G4endl;
    645 #endif
    646         G4bool KeepProjectile= G4UniformRand() > 0.5;
     647  G4cout<<"G4QFragm::ExSingDiffPartici:Ep="<<Pprojectile.e()<<",Et="<<Ptarget.e()<<G4endl;
     648#endif
     649  G4bool KeepProjectile= G4UniformRand() > 0.5;
    647650  // Reset minMass of the non diffractive particle to its value, (minus for rounding...)
    648         if(KeepProjectile )
    649         {
     651  if(KeepProjectile )
     652  {
    650653#ifdef debug
    651654    G4cout<<"--1/2--G4QFragmentation::ExSingDiffParticipants: Projectile is fixed"<<G4endl;
    652655#endif
    653            Mprojectile2 = projectile->GetMass2()*(1.-perCent); // Isn't it too big reduction? M.K.
    654         }
     656    Mprojectile2 = projectile->GetMass2()*(1.-perCent); // Isn't it too big reduction? M.K.
     657  }
    655658  else
    656659  {
     
    658661    G4cout<<"---1/2---G4QFragmentation::ExSingDiffParticipants: Target is fixed"<<G4endl;
    659662#endif
    660            Mtarget2 = target->GetMass2()*(1.-perCent); // @@ Isn't it too big reduction? M.K.
    661         }
     663    Mtarget2 = target->GetMass2()*(1.-perCent); // @@ Isn't it too big reduction? M.K.
     664  }
    662665  // @@ From this point it repeats the Diffractional excitation (? Use flag ?)
    663666  // Transform momenta to cms and then rotate parallel to z axis;
    664         G4LorentzVector Psum=Pprojectile+Ptarget;
    665         G4LorentzRotation toCms(-Psum.boostVector()); // Boost Rotation to CMS
    666         G4LorentzVector Ptmp=toCms*Pprojectile;
    667         if(Ptmp.pz()<=0.) // "String" moving backwards in CMS, abort collision !! ? M.K.
    668         {
    669 #ifdef debug
    670            G4cout<<"G4QFragment::ExciteSingDiffParticipants: *1* abort Collision!! *1*"<<G4endl;
    671 #endif
    672                   return false;
    673          }                         
    674         toCms.rotateZ(-Ptmp.phi());
    675         toCms.rotateY(-Ptmp.theta());
     667  G4LorentzVector Psum=Pprojectile+Ptarget;
     668  G4LorentzRotation toCms(-Psum.boostVector()); // Boost Rotation to CMS
     669  G4LorentzVector Ptmp=toCms*Pprojectile;
     670  if(Ptmp.pz()<=0.) // "String" moving backwards in CMS, abort collision !! ? M.K.
     671  {
     672#ifdef debug
     673    G4cout<<"G4QFragment::ExciteSingDiffParticipants: *1* abort Collision!! *1*"<<G4endl;
     674#endif
     675    return false;
     676  }         
     677  toCms.rotateZ(-Ptmp.phi());
     678  toCms.rotateY(-Ptmp.theta());
    676679#ifdef debug
    677680  G4cout<<"G4QFragm::ExciteSingDiffParticipantts: Be4Boost Pproj="<<Pprojectile<<",Ptarg="
    678681        <<Ptarget<<G4endl;
    679682#endif
    680         G4LorentzRotation toLab(toCms.inverse()); // Boost Rotation to LabSys (LS)
    681         Pprojectile.transform(toCms);
    682         Ptarget.transform(toCms);
    683 #ifdef debug
    684         G4cout<< "G4QFragment::ExciteDiffParticipantts: AfterBoost Pproj="<<Pprojectile<<"Ptarg="
     683  G4LorentzRotation toLab(toCms.inverse()); // Boost Rotation to LabSys (LS)
     684  Pprojectile.transform(toCms);
     685  Ptarget.transform(toCms);
     686#ifdef debug
     687  G4cout<< "G4QFragment::ExciteDiffParticipantts: AfterBoost Pproj="<<Pprojectile<<"Ptarg="
    685688        <<Ptarget<<", cms4M="<<Pprojectile+Ptarget<<G4endl;
    686689
    687         G4cout<<"G4QFragment::ExciteDiffParticipantts: ProjX+="<<Pprojectile.plus()<<", ProjX-="
     690  G4cout<<"G4QFragment::ExciteDiffParticipantts: ProjX+="<<Pprojectile.plus()<<", ProjX-="
    688691        <<Pprojectile.minus()<<", TargX+="<< Ptarget.plus()<<", TargX-="<<Ptarget.minus()
    689692        <<G4endl;
    690693#endif
    691         G4LorentzVector Qmomentum(0.,0.,0.,0.);
    692         G4int whilecount=0;
    693         do
    694   {
    695     //  Generate pt             
    696            G4double maxPtSquare=sqr(Ptarget.pz());
    697            if(whilecount++>=500 && whilecount%100==0) // @@ M.K. Hardwired limits
    698 #ifdef debug
    699                 G4cout<<"G4QFragment::ExciteSingDiffParticipantts: can loop, loopCount="<<whilecount
     694  G4LorentzVector Qmomentum(0.,0.,0.,0.);
     695  G4int whilecount=0;
     696  do
     697  {
     698    //  Generate pt 
     699    G4double maxPtSquare=sqr(Ptarget.pz());
     700    if(whilecount++>=500 && whilecount%100==0) // @@ M.K. Hardwired limits
     701#ifdef debug
     702    G4cout<<"G4QFragment::ExciteSingDiffParticipantts: can loop, loopCount="<<whilecount
    700703          <<", maxPtSquare="<<maxPtSquare<<G4endl;
    701704#endif
     
    705708      G4cout<<"G4QFragmentation::ExciteSingDiffParticipants: *2* abort Loop!! *2*"<<G4endl;
    706709#endif
    707                    return false;          //  Ignore this interaction
    708     }
    709            Qmomentum=G4LorentzVector(GaussianPt(widthOfPtSquare,maxPtSquare),0);
     710      return false;    //  Ignore this interaction
     711    }
     712    Qmomentum=G4LorentzVector(GaussianPt(widthOfPtSquare,maxPtSquare),0);
    710713#ifdef debug
    711714    G4cout<<"G4QFragm::ExciteSingDiffParticipants: generated Pt="<<Qmomentum<<", ProjPt="
     
    713716#endif
    714717    //  Momentum transfer
    715            G4double Xmin = minmass/(Pprojectile.e() + Ptarget.e());
    716            G4double Xmax=1.;
    717            G4double Xplus =ChooseX(Xmin,Xmax);
    718            G4double Xminus=ChooseX(Xmin,Xmax);
    719 #ifdef debug
    720            G4cout<<"G4QFragm::ExciteSingDiffPartici:X-plus="<<Xplus<<",X-minus="<<Xminus<<G4endl;
    721 #endif
    722            G4double pt2=G4ThreeVector(Qmomentum.vect()).mag2();
    723            G4double Qplus =-pt2/Xminus/Ptarget.minus();
    724            G4double Qminus= pt2/Xplus /Pprojectile.plus();
    725            if (KeepProjectile)
    726              Qminus=(projectile->GetMass2()+pt2)/(Pprojectile.plus()+Qplus) - Pprojectile.minus();
    727            else Qplus=Ptarget.plus() - (target->GetMass2()+pt2)/(Ptarget.minus()-Qminus);               
    728            Qmomentum.setPz((Qplus-Qminus)/2);
    729            Qmomentum.setE( (Qplus+Qminus)/2);
    730 #ifdef debug
    731            G4cout<<"G4QFragm::ExciteDiffParticip: Qplus="<<Qplus<<", Qminus="<<Qminus<<", pt2="
     718    G4double Xmin = minmass/(Pprojectile.e() + Ptarget.e());
     719    G4double Xmax=1.;
     720    G4double Xplus =ChooseX(Xmin,Xmax);
     721    G4double Xminus=ChooseX(Xmin,Xmax);
     722#ifdef debug
     723    G4cout<<"G4QFragm::ExciteSingDiffPartici:X-plus="<<Xplus<<",X-minus="<<Xminus<<G4endl;
     724#endif
     725    G4double pt2=G4ThreeVector(Qmomentum.vect()).mag2();
     726    G4double Qplus =-pt2/Xminus/Ptarget.minus();
     727    G4double Qminus= pt2/Xplus /Pprojectile.plus();
     728    if (KeepProjectile)
     729      Qminus=(projectile->GetMass2()+pt2)/(Pprojectile.plus()+Qplus) - Pprojectile.minus();
     730    else Qplus=Ptarget.plus() - (target->GetMass2()+pt2)/(Ptarget.minus()-Qminus); 
     731    Qmomentum.setPz((Qplus-Qminus)/2);
     732    Qmomentum.setE( (Qplus+Qminus)/2);
     733#ifdef debug
     734    G4cout<<"G4QFragm::ExciteDiffParticip: Qplus="<<Qplus<<", Qminus="<<Qminus<<", pt2="
    732735          <<pt2<<", Qmomentum="<<Qmomentum<<", ProjM="<<(Pprojectile+Qmomentum).mag()
    733736          <<", TargM="<<(Ptarget-Qmomentum).mag()<<G4endl;
    734737#endif
    735738    // while is different from the Double Diffractive Excitation (@@ !)
    736                   //} while((Pprojectile+Qmomentum).mag2()<= Mprojectile2 ||
     739    //} while((Pprojectile+Qmomentum).mag2()<= Mprojectile2 ||
    737740    //        (Ptarget-Qmomentum).mag2()<=Mtarget2);
    738         } while((Ptarget-Qmomentum).mag2()<=Mtarget2 ||
     741  } while((Ptarget-Qmomentum).mag2()<=Mtarget2 ||
    739742          (Pprojectile+Qmomentum).mag2()<=Mprojectile2 ||
    740743          (Ptarget-Qmomentum).e() < 0. || (Pprojectile+Qmomentum).e() < 0.);
    741         Pprojectile += Qmomentum;
    742         Ptarget     -= Qmomentum;
    743 #ifdef debug
    744         G4cout<<"G4QFragmentation::ExciteSingDiffParticipan: Proj(Q)="<<Pprojectile<<"(E="
     744  Pprojectile += Qmomentum;
     745  Ptarget     -= Qmomentum;
     746#ifdef debug
     747  G4cout<<"G4QFragmentation::ExciteSingDiffParticipan: Proj(Q)="<<Pprojectile<<"(E="
    745748        <<Pprojectile.e()<<"), Targ(Q)="<<Ptarget<<"(E="<<Ptarget.e()
    746                <<"), Proj(back)="<<toLab*Pprojectile<<", Targ(bac)="<< toLab*Ptarget << G4endl;
     749        <<"), Proj(back)="<<toLab*Pprojectile<<", Targ(bac)="<< toLab*Ptarget << G4endl;
    747750#endif
    748751  // Transform back and update SplitableHadron Participant.
    749         Pprojectile.transform(toLab);
    750         Ptarget.transform(toLab);
    751 #ifdef debug
    752         G4cout<< "G4QFragm::ExciteSingDiffParticipants: TargetMass="<<Ptarget.mag()<<G4endl;
    753 #endif
    754          target->Set4Momentum(Ptarget);         
    755 #ifdef debug
    756         G4cout<<"G4QFragm::ExciteDiffParticipants:ProjectileMass="<<Pprojectile.mag()<<G4endl;
    757 #endif
    758         projectile->Set4Momentum(Pprojectile);
    759         return true;
     752  Pprojectile.transform(toLab);
     753  Ptarget.transform(toLab);
     754#ifdef debug
     755  G4cout<< "G4QFragm::ExciteSingDiffParticipants: TargetMass="<<Ptarget.mag()<<G4endl;
     756#endif
     757  target->Set4Momentum(Ptarget); 
     758#ifdef debug
     759  G4cout<<"G4QFragm::ExciteDiffParticipants:ProjectileMass="<<Pprojectile.mag()<<G4endl;
     760#endif
     761  projectile->Set4Momentum(Pprojectile);
     762  return true;
    760763} // End of ExciteSingleDiffParticipants
    761764
     
    767770  QGSMThershold      = QGSMth;         // QGSM threshold
    768771  theNucleonRadius   = radNuc;         // effective radius of the nucleon inside Nucleus
    769          widthOfPtSquare    = -2*SigPt*SigPt;   // width^2 of pt for string excitation
    770          minExtraMass       = extraM;           // minimum excitation mass
    771          minmass            = minM;               // mean pion transverse mass; used for Xmin
     772  widthOfPtSquare    = -2*SigPt*SigPt; // width^2 of pt for string excitation
     773  minExtraMass       = extraM;         // minimum excitation mass
     774  minmass            = minM;           // mean pion transverse mass; used for Xmin
    772775}
    773776
     
    776779// choose an x between Xmin and Xmax with P(x) ~ 1/x
    777780//  to be improved...
    778         G4double range=Xmax-Xmin;
    779         if( Xmin<= 0. || range <=0.)
    780         {
    781                   G4cerr<<"***G4QFragmentation::ChooseX: Xmin="<<Xmin<<", Xmax="<<Xmax<< G4endl;
     781  G4double range=Xmax-Xmin;
     782  if( Xmin<= 0. || range <=0.)
     783  {
     784    G4cerr<<"***G4QFragmentation::ChooseX: Xmin="<<Xmin<<", Xmax="<<Xmax<< G4endl;
    782785    G4Exception("G4QFragmentation::ChooseX:","72",FatalException,"BadXRange");
    783         }
    784         G4double x;
    785         do {x=Xmin+G4UniformRand()*range;} while ( Xmin/x < G4UniformRand() );
     786  }
     787  G4double x;
     788  do {x=Xmin+G4UniformRand()*range;} while ( Xmin/x < G4UniformRand() );
    786789#ifdef debug
    787790  G4cout<<"G4QFragmentation::ChooseX: DiffractiveX="<<x<<G4endl;
    788791#endif
    789         return x;
     792  return x;
    790793} // End of ChooseX
    791794
     
    793796G4ThreeVector G4QFragmentation::GaussianPt(G4double widthSq, G4double maxPtSquare) const
    794797{
    795         G4double pt2; do{pt2=widthSq*std::log(G4UniformRand());} while (pt2>maxPtSquare);
    796                 pt2=std::sqrt(pt2);
    797         G4double phi=G4UniformRand()*twopi;
    798         return G4ThreeVector(pt2*std::cos(phi),pt2*std::sin(phi),0.);   
     798  G4double pt2; do{pt2=widthSq*std::log(G4UniformRand());} while (pt2>maxPtSquare);
     799  pt2=std::sqrt(pt2);
     800  G4double phi=G4UniformRand()*twopi;
     801  return G4ThreeVector(pt2*std::cos(phi),pt2*std::sin(phi),0.);   
    799802} // End of GaussianPt
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QHadron.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QHadron.cc,v 1.53 2008/03/20 20:11:38 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QHadron.cc,v 1.54 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QHadron ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Quasmon initiated Hadrons generated by CHIPS Model
    33 // ------------------------------------------------------------------
     33// -------------------------------------------------------------------
     34// Short description: In CHIPS all particles are G4QHadrons, while they
     35// can be leptons, gammas or nuclei. The G4QPDGCode makes the difference.
     36// In addition the 4-momentum is a basic value, so the mass can be
     37// different from the GS mass (e.g. for the virtual gamma).
     38// -------------------------------------------------------------------
    3439//
    3540//#define debug
     
    9297    G4int cPDG=theQPDG.GetPDGCode();
    9398    if(cPDG>80000000) DefineQC(cPDG);
    94            else G4cerr<<"***G4QHadr:(QP) PDG="<<cPDG<<" use other constructor"<<G4endl;
     99    else G4cerr<<"***G4QHadr:(QP) PDG="<<cPDG<<" use other constructor"<<G4endl;
    95100  }
    96101}
     
    99104G4QHadron::G4QHadron(G4QContent QC, G4LorentzVector p): theQPDG(0),theMomentum(p),valQ(QC),
    100105  nFragm(0),thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true),
    101                 Color(),AntiColor(),bindE(0.),formTime(0.)
     106  Color(),AntiColor(),bindE(0.),formTime(0.)
    102107{
    103108  G4int curPDG=valQ.GetSPDGCode();
     
    156161  Direction           = right.Direction;
    157162  bindE               = right.bindE;
    158                 formTime            = right.formTime;
     163  formTime            = right.formTime;
    159164}
    160165
     
    170175  Direction           = right->Direction;
    171176  bindE               = right->bindE;
    172                 formTime            = right->formTime;
     177  formTime            = right->formTime;
    173178}
    174179
     
    184189  Direction           = right->Direction;
    185190  bindE               = right->bindE;
    186                 formTime            = right->formTime;
     191  formTime            = right->formTime;
    187192}
    188193
     
    306311    G4double emodif=std::fabs(dE-vP);
    307312    //if(emodif<accuracy)
    308                                 //{
     313    //{
    309314      G4cerr<<"G4QHadron::RelDecIn2: *Boost* E-p shift is corrected to "<<emodif<<G4endl;
    310315      theMomentum.setE(vP+emodif+.01*accuracy);
    311                                 //}
     316    //}
    312317  }
    313318  G4ThreeVector ltb = theMomentum.boostVector();// Boost vector for backward Lorentz Trans.
     
    429434    cosp=-cosp;
    430435    neg=true;
    431                 }
     436  }
    432437  if(dE<vP)
    433438  {
     
    436441    G4double emodif=std::fabs(dE-vP);
    437442    //if(emodif<accuracy)
    438                                 //{
     443    //{
    439444      G4cerr<<"G4QHadron::CopDecIn2: *Boost* E-p shift is corrected to "<<emodif<<G4endl;
    440445      theMomentum.setE(vP+emodif+.01*accuracy);
    441                                 //}
     446    //}
    442447  }
    443448  G4ThreeVector ltb = theMomentum.boostVector();// Boost vector for backward Lorentz Trans.
     
    594599  if(theMomentum.e()<theMomentum.rho())
    595600  {
    596            G4cerr<<"*G4QH::DecIn2:*Boost* 4M="<<theMomentum<<",e-p="
     601    G4cerr<<"*G4QH::DecIn2:*Boost* 4M="<<theMomentum<<",e-p="
    597602          <<theMomentum.e()-theMomentum.rho()<<G4endl;
    598            //throw G4QException("G4QHadron::DecayIn2: Decay of particle with zero mass")
     603    //throw G4QException("G4QHadron::DecayIn2: Decay of particle with zero mass")
    599604    theMomentum.setE(1.0000001*theMomentum.rho());
    600605  }
     
    607612    G4double emodif=std::fabs(dE-vP);
    608613    if(emodif<accuracy)
    609                                 {
     614    {
    610615      G4cerr<<"G4QHadron::DecayIn2: *Boost* E-p shift is corrected to "<<emodif<<G4endl;
    611616      theMomentum.setE(vP+emodif+.01*accuracy);
     
    822827    G4double dif=(e1*e1-four12*fM2)*(e2*e2-four12*tM2);
    823828    if(dif<0.)
    824            {
     829    {
    825830#ifdef debug
    826831      if(dif<-.01) G4cerr<<"*G4QHadron::DecayIn3:iM="<<iM<<",tM="<<tM<<",sM="<<sM<<",fM="
     
    841846  {
    842847    G4cerr<<"***G4QHadron::DecayIn3: Exception1"<<G4endl;
    843            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     848    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    844849    return false;
    845850  }
     
    850855  {
    851856    G4cerr<<"***G4QHadron::DecayIn3: Error in DecayIn2 -> Exception2"<<G4endl;
    852            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     857    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    853858    return false;
    854859  }
     
    907912    G4double dif=(e1*e1-four12*fM2)*(e2*e2-four12*tM2);
    908913    if(dif<0.)
    909            {
     914    {
    910915#ifdef debug
    911916      if(dif<-.01) G4cerr<<"G4QHadron::RelDecayIn3:iM="<<iM<<",tM="<<tM<<",sM="<<sM<<",fM="
     
    926931  {
    927932    G4cerr<<"***G4QHadron::RelDecayIn3: Exception1"<<G4endl;
    928            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     933    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    929934    return false;
    930935  }
     
    935940  {
    936941    G4cerr<<"***G4QHadron::RelDecayIn3: Error in DecayIn2 -> Exception2"<<G4endl;
    937            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     942    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    938943    return false;
    939944  }
     
    991996    G4double dif=(e1*e1-four12*fM2)*(e2*e2-four12*tM2);
    992997    if(dif<0.)
    993            {
     998    {
    994999#ifdef debug
    9951000      if(dif<-.01) G4cerr<<"G4QHadron::CopDecayIn3:iM="<<iM<<",tM="<<tM<<",sM="<<sM<<",fM="
     
    10101015  {
    10111016    G4cerr<<"***G4QHadron::CopDecayIn3: Exception1"<<G4endl;
    1012            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     1017    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    10131018    return false;
    10141019  }
     
    10191024  {
    10201025    G4cerr<<"***G4QHadron::CopDecayIn3: Error in DecayIn2 -> Exception2"<<G4endl;
    1021            //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
     1026    //throw G4QException("G4QHadron::DecayIn3(): DecayIn2 did not succeed");
    10221027    return false;
    10231028  }
     
    10451050  {
    10461051#ifdef debug
    1047            if(meanM>maxM) G4cerr<<"***G4QHadron::RandM:Stable m="<<meanM<<">maxM="<<maxM<<G4endl;
     1052    if(meanM>maxM) G4cerr<<"***G4QHadron::RandM:Stable m="<<meanM<<">maxM="<<maxM<<G4endl;
    10481053#endif
    10491054    return meanM;
     
    10521057  else if(width<0.)
    10531058  {
    1054            G4cerr<<"***G4QHadron::RandM: width="<<width<<"<0,PDGC="<<theQPDG.GetPDGCode()<<G4endl;
    1055            throw G4QException("G4QHadron::RandomizeMass: with the width of the Hadron < 0.");
     1059    G4cerr<<"***G4QHadron::RandM: width="<<width<<"<0,PDGC="<<theQPDG.GetPDGCode()<<G4endl;
     1060    throw G4QException("G4QHadron::RandomizeMass: with the width of the Hadron < 0.");
    10561061  }
    10571062  G4double minM = pPart->MinMassOfFragm();
     
    10591064  {
    10601065#ifdef debug
    1061            G4cout<<"***G4QHadron::RandomizeMass:for PDG="<<theQPDG.GetPDGCode()<<" minM="<<minM
     1066    G4cout<<"***G4QHadron::RandomizeMass:for PDG="<<theQPDG.GetPDGCode()<<" minM="<<minM
    10621067          <<" > maxM="<<maxM<<G4endl;
    10631068#endif
     
    11071112    //G4cout<<"DSU 2: Right4M="<<RightMom<<", Left4M= "<<LeftMom<<G4endl;
    11081113
    1109     G4double Local1 = HadronMom.minus() + (RightMom.perp2() - LeftMom.perp2())/HadronMom.plus();
    1110     G4double Local2 = std::sqrt(std::max(0., sqr(Local1) - 4.*RightMom.perp2()*HadronMom.minus()/HadronMom.plus()));
     1114    G4double Local1 = HadronMom.minus() +
     1115                      (RightMom.perp2() - LeftMom.perp2()) / HadronMom.plus();
     1116    G4double Local2 = std::sqrt(std::max(0., Local1*Local1 -
     1117                                4*RightMom.perp2()*HadronMom.minus() / HadronMom.plus()));
    11111118    //G4cout<<"DSU 3: L1="<< Local1 <<", L2="<<Local2<<G4endl;
    11121119
     
    11401147    // here the condition,to ensure viability of splitting, also in cases
    11411148    // where difractive excitation occured together with soft scattering.
    1142     //   G4double LightConeMomentum = (Direction)? Get4Momentum().plus() : Get4Momentum().minus();
    1143     //   G4double Xmin = theMinPz/LightConeMomentum;
     1149    //G4double LightConeMomentum=(Direction)? Get4Momentum().plus():Get4Momentum().minus();
     1150    //G4double Xmin = theMinPz/LightConeMomentum;
    11441151    G4double Xmin = theMinPz/( Get4Momentum().e() - GetMass() );
    11451152    while(Xmin>=1-(2*nSeaPair+1)*Xmin) Xmin*=0.95;
     
    11551162      G4QParton* aParton = BuildSeaQuark(false, aPDGCode);
    11561163
    1157       //                G4cout << "G4QGSMSplitableHadron::SoftSplitUp()" << G4endl;
    1158 
    1159       //                G4cout << "Parton 1: "
    1160       //                       << " PDGcode: "  << aPDGCode
    1161       //                       << " - Name: "   << aParton->GetDefinition()->GetParticleName()
    1162       //                       << " - Type: "   << aParton->GetDefinition()->GetParticleType()
    1163       //                       << " - Spin-3: " << aParton->GetSpinZ()
    1164       //                       << " - Colour: " << aParton->GetColour() << G4endl;
     1164      //  G4cout << "G4QGSMSplitableHadron::SoftSplitUp()" << G4endl;
     1165
     1166      //  G4cout << "Parton 1: "
     1167      //         << " PDGcode: "  << aPDGCode
     1168      //         << " - Name: "   << aParton->GetDefinition()->GetParticleName()
     1169      //         << " - Type: "   << aParton->GetDefinition()->GetParticleType()
     1170      //         << " - Spin-3: " << aParton->GetSpinZ()
     1171      //         << " - Colour: " << aParton->GetColour() << G4endl;
    11651172
    11661173      // save colour a spin-3 for anti-quark
     
    11771184      aParton->SetColour(-firstPartonColour);
    11781185
    1179       //                G4cout << "Parton 2: "
    1180       //                       << " PDGcode: "  << -aPDGCode
    1181       //                       << " - Name: "   << aParton->GetDefinition()->GetParticleName()
    1182       //                       << " - Type: "   << aParton->GetDefinition()->GetParticleType()
    1183       //                       << " - Spin-3: " << aParton->GetSpinZ()
    1184       //                       << " - Colour: " << aParton->GetColour() << G4endl;
    1185       //                G4cerr << "------------" << G4endl;
     1186      //  G4cout << "Parton 2: "
     1187      //         << " PDGcode: "  << -aPDGCode
     1188      //         << " - Name: "   << aParton->GetDefinition()->GetParticleName()
     1189      //         << " - Type: "   << aParton->GetDefinition()->GetParticleType()
     1190      //         << " - Spin-3: " << aParton->GetSpinZ()
     1191      //         << " - Colour: " << aParton->GetColour() << G4endl;
     1192      //  G4cerr << "------------" << G4endl;
    11861193
    11871194      SumPx += aParton->Get4Momentum().px();
     
    12391246      ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta);
    12401247      HPWtest = ColorX;
    1241       while (ColorX < Xmin || ColorX > 1.|| 1. -  ColorX <= Xmin) {
    1242         ;  // Possible dead loop?  Don't know why this loop is here - DHW
    1243       }
    1244       Color.back()->SetX(SumX = ColorX);// this is the valenz quark.
     1248      //while (ColorX < Xmin || ColorX > 1. || 1. -  ColorX <= Xmin)
     1249      //{
     1250      //}
     1251      Color.back()->SetX(SumX = ColorX); // this is the valenz quark.
    12451252
    12461253      std::list<G4QParton*>::iterator icolor = Color.begin();
     
    12631270    AntiColor.back()->SetX(1.0 - SumX); // the di-quark takes the rest, then go to momentum
    12641271    // and here is the bug ;-) @@@@@@@@@@@@@
    1265     if(getenv("debug_QGSMSplitableHadron") )G4cout << "particle energy at split = "<<Get4Momentum().t()<<G4endl;
     1272    if(getenv("debug_QGSMSplitableHadron"))
     1273                         G4cout<<"particle energy at split = "<<Get4Momentum().t()<<G4endl;
    12661274    G4double lightCone = ((!Direction) ? Get4Momentum().minus() : Get4Momentum().plus());
    12671275    // lightCone -= 0.5*Get4Momentum().m();
     
    13201328  if(anXmin > xMax)
    13211329  {
    1322                                 G4cerr<<"***G4QHadron::SampleX: anXmin="<<anXmin<<" > xMax="<<xMax<<", nSea="<<nSea
     1330    G4cerr<<"***G4QHadron::SampleX: anXmin="<<anXmin<<" > xMax="<<xMax<<", nSea="<<nSea
    13231331          <<", totSea="<<totalSea<<G4endl;
    13241332    G4Exception("G4QHadron::SampleX:","72",FatalException,"TooBigXValue");
     
    13491357  Parton1->SetPosition(GetPosition());
    13501358
    1351 //      G4cerr << "G4QGSMSplitableHadron::GetValenceQuarkFlavors()" << G4endl;
    1352 //      G4cerr << "Parton 1: "
    1353 //             << " PDGcode: "  << aEnd
    1354 //             << " - Name: "   << Parton1->GetDefinition()->GetParticleName()
    1355 //             << " - Type: "   << Parton1->GetDefinition()->GetParticleType()
    1356 //             << " - Spin-3: " << Parton1->GetSpinZ()
    1357 //             << " - Colour: " << Parton1->GetColour() << G4endl;
     1359// G4cerr << "G4QGSMSplitableHadron::GetValenceQuarkFlavors()" << G4endl;
     1360// G4cerr << "Parton 1: "
     1361//        << " PDGcode: "  << aEnd
     1362//        << " - Name: "   << Parton1->GetDefinition()->GetParticleName()
     1363//        << " - Type: "   << Parton1->GetDefinition()->GetParticleType()
     1364//        << " - Spin-3: " << Parton1->GetSpinZ()
     1365//        << " - Colour: " << Parton1->GetColour() << G4endl;
    13581366
    13591367  Parton2 = new G4QParton(bEnd);
    13601368  Parton2->SetPosition(GetPosition());
    13611369
    1362 //      G4cerr << "Parton 2: "
    1363 //             << " PDGcode: "  << bEnd
    1364 //             << " - Name: "   << Parton2->GetDefinition()->GetParticleName()
    1365 //             << " - Type: "   << Parton2->GetDefinition()->GetParticleType()
    1366 //             << " - Spin-3: " << Parton2->GetSpinZ()
    1367 //             << " - Colour: " << Parton2->GetColour() << G4endl;
    1368 //      G4cerr << "... now checking for color and spin conservation - yielding: " << G4endl;
     1370// G4cerr << "Parton 2: "
     1371//        << " PDGcode: "  << bEnd
     1372//        << " - Name: "   << Parton2->GetDefinition()->GetParticleName()
     1373//        << " - Type: "   << Parton2->GetDefinition()->GetParticleType()
     1374//        << " - Spin-3: " << Parton2->GetSpinZ()
     1375//        << " - Colour: " << Parton2->GetColour() << G4endl;
     1376// G4cerr << "... now checking for color and spin conservation - yielding: " << G4endl;
    13691377
    13701378  // colour of parton 1 choosen at random by G4QParton(aEnd)
     
    13731381  Parton2->SetColour(-(Parton1->GetColour()));
    13741382
    1375         // isospin-3 of both partons is handled by G4Parton(PDGCode)
    1376 
    1377         // spin-3 of parton 1 and 2 choosen at random by G4QParton(aEnd)
    1378         // spin-3 of parton 2 may be constrained by spin of original particle:
     1383 // isospin-3 of both partons is handled by G4Parton(PDGCode)
     1384
     1385 // spin-3 of parton 1 and 2 choosen at random by G4QParton(aEnd)
     1386 // spin-3 of parton 2 may be constrained by spin of original particle:
    13791387
    13801388  if ( std::abs(Parton1->GetSpinZ() + Parton2->GetSpinZ()) > GetSpin())
    1381   {
    1382                 Parton2->SetSpinZ(-(Parton2->GetSpinZ()));   
    1383   }
    1384 
    1385 //      G4cerr << "Parton 2: "
    1386 //             << " PDGcode: "  << bEnd
    1387 //             << " - Name: "   << Parton2->GetDefinition()->GetParticleName()
    1388 //             << " - Type: "   << Parton2->GetDefinition()->GetParticleType()
    1389 //             << " - Spin-3: " << Parton2->GetSpinZ()
    1390 //             << " - Colour: " << Parton2->GetColour() << G4endl;
    1391 //      G4cerr << "------------" << G4endl;
     1389                                                 Parton2->SetSpinZ(-(Parton2->GetSpinZ()));
     1390
     1391// G4cerr << "Parton 2: "
     1392//        << " PDGcode: "  << bEnd
     1393//        << " - Name: "   << Parton2->GetDefinition()->GetParticleName()
     1394//        << " - Type: "   << Parton2->GetDefinition()->GetParticleType()
     1395//        << " - Spin-3: " << Parton2->GetSpinZ()
     1396//        << " - Colour: " << Parton2->GetColour() << G4endl;
     1397// G4cerr << "------------" << G4endl;
    13921398
    13931399} // End of GetValenceQuarkFlavors
     
    14291435  static const G4double r12=1./12.;
    14301436  //
    1431                 std::pair<G4int,G4int> qdq[5];
     1437  std::pair<G4int,G4int> qdq[5];
    14321438  G4double               prb[5];
    14331439  G4int                  nc=0;
     
    14471453    qdq[2]=make_pair(1103, 2); prb[2]=r3;    // dd_1, u
    14481454  }
    1449                 else if(aPDGcode%10<3)                     // ==> Spin 1/2 Hyperons
    1450                 {
     1455  else if(aPDGcode%10<3)                     // ==> Spin 1/2 Hyperons
     1456  {
    14511457    if(aPDGcode==3122)
    14521458    {
     
    15851591{
    15861592  G4double R=0.;
    1587   while ((R = -widthSquare*std::log(G4UniformRand())) > maxPtSquare) {
    1588     ;
    1589   }
     1593  while ((R = -widthSquare*std::log(G4UniformRand())) > maxPtSquare){}
    15901594  R = std::sqrt(R);
    15911595  G4double phi = twopi*G4UniformRand();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QHadronBuilder.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QHadronBuilder.cc,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QHadronBuilder.cc,v 1.4 2009/04/29 07:53:18 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    3636//      G4HadronBuilder
    3737// -----------------------------------------------------------------------------
     38// Short description: A CHIPS class for the builder of the G4QHadron, which is a
     39// resulting object for the string fragmentation. the G4QHadron has specific
     40// parameters, which are not included in the G4QParticle from the CHIPS World,
     41// but necessary for the string fragmentation. When the G4QHadron is created
     42// (builded), it is converted to the CHIPS particle.
     43// -----------------------------------------------------------------------------
     44
    3845
    3946//#define debug
     
    4552G4QHadronBuilder::G4QHadronBuilder()
    4653{
    47          mesonSpinMix = 0.5;                        // probability to create vector meson
    48         baryonSpinMix= 0.5;                     // probability to create 3/2 baryon
     54  mesonSpinMix = 0.5;                     // probability to create vector meson
     55  baryonSpinMix= 0.5;                     // probability to create 3/2 baryon
    4956  scalarMesonMixings.resize(6);
    5057  scalarMesonMixings[0] = 0.5;
     
    6572G4QHadron* G4QHadronBuilder::Build(G4QParton* black, G4QParton* white)
    6673{
    67         if(black->GetParticleSubType()=="di_quark" || white->GetParticleSubType()=="di_quark")
     74  if(black->GetParticleSubType()=="di_quark" || white->GetParticleSubType()=="di_quark")
    6875  {
    6976    // Baryon consists of quark and at least one di-quark
    70            Spin spin = (G4UniformRand() < baryonSpinMix) ? SpinHalf : SpinThreeHalf;
    71            return Baryon(black,white,spin);
    72         }
     77    Spin spin = (G4UniformRand() < baryonSpinMix) ? SpinHalf : SpinThreeHalf;
     78    return Baryon(black,white,spin);
     79  }
    7380  else
    74   {     
     81  { 
    7582    // Meson consists of quark and abnti-quark
    76            Spin spin = (G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
    77            return Meson(black,white,spin);
    78         }
     83    Spin spin = (G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
     84    return Meson(black,white,spin);
     85  }
    7986}
    8087
    8188G4QHadron* G4QHadronBuilder::BuildLowSpin(G4QParton* black, G4QParton* white)
    8289{
    83         if(black->GetParticleSubType() == "quark" && white->GetParticleSubType() == "quark")
    84                       return Meson(black,white, SpinZero);
    85   //    returns a SpinThreeHalf Baryon if all quarks are the same
    86          else           return Baryon(black,white, SpinHalf);
     90  if(black->GetParticleSubType() == "quark" && white->GetParticleSubType() == "quark")
     91        return Meson(black,white, SpinZero);
     92  // returns a SpinThreeHalf Baryon if all quarks are the same
     93  else  return Baryon(black,white, SpinHalf);
    8794}
    8895
    8996G4QHadron* G4QHadronBuilder::BuildHighSpin(G4QParton* black, G4QParton* white)
    9097{
    91         if(black->GetParticleSubType() == "quark" && white->GetParticleSubType() == "quark")
    92                      return Meson(black,white, SpinOne);
    93         else return Baryon(black,white,SpinThreeHalf);
     98  if(black->GetParticleSubType() == "quark" && white->GetParticleSubType() == "quark")
     99       return Meson(black,white, SpinOne);
     100  else return Baryon(black,white,SpinThreeHalf);
    94101}
    95102
     
    98105#ifdef debug
    99106  //  Verify Input Charge
    100   G4double charge =  black->GetPDGCharge() + white->GetPDGCharge();     
     107  G4double charge =  black->GetPDGCharge() + white->GetPDGCharge(); 
    101108  if (std::abs(charge)>2 || std::abs(3*(charge-G4int(charge*1.001))) > perCent)
    102            G4cerr<<"-Warning-G4QHadronBuilder::Meson: invalid TotalCharge="<<charge<<", PDG_q1="
     109    G4cerr<<"-Warning-G4QHadronBuilder::Meson: invalid TotalCharge="<<charge<<", PDG_q1="
    103110          <<black->GetPDGEncoding()<< ", PDG_q2="<<white->GetPDGEncoding()<<G4endl;
    104 #endif 
    105        
    106         G4int id1= black->GetPDGCode();
    107         G4int id2= white->GetPDGCode();
    108         if (std::abs(id1) < std::abs(id2))     // exchange black and white
    109         {
    110            G4int xchg = id1;
    111            id1 = id2; 
    112            id2 = xchg;
    113         }
    114         if(std::abs(id1)>3)
    115         {
    116                                 G4cerr<<"***G4QHadronBuilder::Meson: q1="<<id1<<", q2="<<id2
     111#endif 
     112 
     113  G4int id1= black->GetPDGCode();
     114  G4int id2= white->GetPDGCode();
     115  if (std::abs(id1) < std::abs(id2))     // exchange black and white
     116  {
     117    G4int xchg = id1;
     118    id1 = id2; 
     119    id2 = xchg;
     120  }
     121  if(std::abs(id1)>3)
     122  {
     123    G4cerr<<"***G4QHadronBuilder::Meson: q1="<<id1<<", q2="<<id2
    117124          <<" while CHIPS is only SU(3)"<<G4endl;
    118125    G4Exception("G4QHadronBuilder::Meson:","72",FatalException,"HeavyQuarkFound");
    119   }     
     126  } 
    120127  G4int PDGEncoding=0;
    121         if(!(id1+id2))                      // annihilation case (neutral)
     128  if(!(id1+id2))                      // annihilation case (neutral)
    122129  {     
    123            G4double rmix = G4UniformRand();
    124            G4int    imix = 2*std::abs(id1) - 1;
    125            if(theSpin == SpinZero)
    126               PDGEncoding = 110*(1 + G4int(rmix + scalarMesonMixings[imix - 1])
    127                                    + G4int(rmix + scalarMesonMixings[imix]    ) ) +  theSpin;
    128                   else
    129               PDGEncoding = 110*(1 + G4int(rmix + vectorMesonMixings[imix - 1])
    130                                                     + G4int(rmix + vectorMesonMixings[imix]    ) ) +  theSpin;
    131         }
     130    G4double rmix = G4UniformRand();
     131    G4int    imix = 2*std::abs(id1) - 1;
     132    if(theSpin == SpinZero)
     133       PDGEncoding = 110*(1 + G4int(rmix + scalarMesonMixings[imix - 1])
     134                            + G4int(rmix + scalarMesonMixings[imix]    ) ) +  theSpin;
     135    else
     136       PDGEncoding = 110*(1 + G4int(rmix + vectorMesonMixings[imix - 1])
     137                            + G4int(rmix + vectorMesonMixings[imix]    ) ) +  theSpin;
     138  }
    132139  else
    133140  {
    134            PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) +  theSpin; 
    135            G4bool IsUp = (std::abs(id1)&1) == 0;        // quark 1 is up type quark (u or c?)
    136            G4bool IsAnti = id1 < 0;                        // quark 1 is an antiquark?
    137            if( (IsUp && IsAnti) || (!IsUp && !IsAnti) )  PDGEncoding = - PDGEncoding;
    138          }
    139          G4QHadron* Meson= new G4QHadron(PDGEncoding);
    140 #ifdef debug
    141          if(std::abs(black->GetPDGCharge() + white->GetPDGCharge() - Meson->GetCharge()) > .001)
    142            G4cout<<"-Warning-G4QHadronBuilder::Meson:wrongCharge, q1="<<black->GetPDGCharge()<<"("
     141    PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) +  theSpin; 
     142    G4bool IsUp = (std::abs(id1)&1) == 0; // quark 1 is up type quark (u or c?)
     143    G4bool IsAnti = id1 < 0;              // quark 1 is an antiquark?
     144    if( (IsUp && IsAnti) || (!IsUp && !IsAnti) )  PDGEncoding = - PDGEncoding;
     145    // Correction for the true neutral mesons
     146    if( PDGEncoding == -111 || PDGEncoding == -113 || PDGEncoding == -223 ||
     147        PDGEncoding == -221 || PDGEncoding == -331 || PDGEncoding == -333 )
     148                                                               PDGEncoding = - PDGEncoding;
     149  }
     150  G4QHadron* Meson= new G4QHadron(PDGEncoding);
     151#ifdef debug
     152  if(std::abs(black->GetPDGCharge() + white->GetPDGCharge() - Meson->GetCharge()) > .001)
     153    G4cout<<"-Warning-G4QHadronBuilder::Meson:wrongCharge, q1="<<black->GetPDGCharge()<<"("
    143154          <<black->->GetParticleName()<<"), q2="<<white->GetPDGCharge()<<"("
    144155          <<white->->GetParticleName()<<"), qM="<<Meson->GetCharge()<<"/"<<PDGEncoding
    145156          <<G4endl;
    146157#endif
    147         return Meson;
     158  return Meson;
    148159}
    149160
     
    152163#ifdef debug
    153164  //  Verify Input Charge
    154   G4double charge =  black->GetPDGCharge() + white->GetPDGCharge();     
     165  G4double charge =  black->GetPDGCharge() + white->GetPDGCharge(); 
    155166  if(std::abs(charge) > 2 || std::abs(3*(charge - G4int(charge*1.001))) > perCent )
    156            G4cerr<<"-Warning-G4QHadronBuilder::Baryon: invalid TotalCharge="<<charge<<", PDG_q1="
     167    G4cerr<<"-Warning-G4QHadronBuilder::Baryon: invalid TotalCharge="<<charge<<", PDG_q1="
    157168          <<black->GetPDGEncoding()<< ", PDG_q2="<<white->GetPDGEncoding()<<G4endl;
    158 #endif 
    159         G4int id1= black->GetPDGCode();
    160         G4int id2= white->GetPDGCode();
    161         if(std::abs(id1) < std::abs(id2))
    162         {
    163            G4int xchg = id1;
    164            id1 = id2; 
    165            id2 = xchg;
    166         }
    167         if(std::abs(id1)<1000 || std::abs(id2)> 3)
    168         {
    169                                 G4cerr<<"***G4QHadronBuilder::Baryon: q1="<<id1<<", q2="<<id2
     169#endif 
     170  G4int id1= black->GetPDGCode();
     171  G4int id2= white->GetPDGCode();
     172  if(std::abs(id1) < std::abs(id2))
     173  {
     174    G4int xchg = id1;
     175    id1 = id2; 
     176    id2 = xchg;
     177  }
     178  if(std::abs(id1)<1000 || std::abs(id2)> 3)
     179  {
     180    G4cerr<<"***G4QHadronBuilder::Baryon: q1="<<id1<<", q2="<<id2
    170181          <<" can't create a Baryon"<<G4endl;
    171182    G4Exception("G4QHadronBuilder::Baryon:","72",FatalException,"WrongQdQSequence");
    172183  }
    173         G4int ifl1= std::abs(id1)/1000;
    174         G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
    175         G4int diquarkSpin = std::abs(id1)%10;
    176         G4int ifl3 = id2;
    177         if (id1 < 0) {ifl1 = - ifl1; ifl2 = - ifl2;}
    178         //... Construct baryon, distinguish Lambda and Sigma baryons.
    179         G4int kfla = std::abs(ifl1);
    180         G4int kflb = std::abs(ifl2);
    181         G4int kflc = std::abs(ifl3);
    182         G4int kfld = std::max(kfla,kflb);
    183                kfld = std::max(kfld,kflc);
    184         G4int kflf = std::min(kfla,kflb);
    185                kflf = std::min(kflf,kflc);
    186         G4int kfle = kfla + kflb + kflc - kfld - kflf;
    187         //... baryon with content uuu or ddd or sss has always spin = 3/2
    188         if(kfla==kflb && kflb==kflc) theSpin=SpinThreeHalf;   
    189 
    190         G4int kfll = 0;
    191         if(theSpin == SpinHalf && kfld > kfle && kfle > kflf)
     184  G4int ifl1= std::abs(id1)/1000;
     185  G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
     186  G4int diquarkSpin = std::abs(id1)%10;
     187  G4int ifl3 = id2;
     188  if (id1 < 0) {ifl1 = - ifl1; ifl2 = - ifl2;}
     189  //... Construct baryon, distinguish Lambda and Sigma baryons.
     190  G4int kfla = std::abs(ifl1);
     191  G4int kflb = std::abs(ifl2);
     192  G4int kflc = std::abs(ifl3);
     193  G4int kfld = std::max(kfla,kflb);
     194        kfld = std::max(kfld,kflc);
     195  G4int kflf = std::min(kfla,kflb);
     196        kflf = std::min(kflf,kflc);
     197  G4int kfle = kfla + kflb + kflc - kfld - kflf;
     198  //... baryon with content uuu or ddd or sss has always spin = 3/2
     199  if(kfla==kflb && kflb==kflc) theSpin=SpinThreeHalf;   
     200
     201  G4int kfll = 0;
     202  if(theSpin == SpinHalf && kfld > kfle && kfle > kflf)
    192203  {
    193204    // Spin J=1/2 and all three quarks different
     
    195206    //   -  lambda: s(ud)0 s : 3122; ie. reverse the two lighter quarks
    196207    //   -  sigma0: s(ud)1 s : 3212
    197            if(diquarkSpin == 1 )
     208    if(diquarkSpin == 1 )
    198209    {
    199               if ( kfla == kfld) kfll = 1; // heaviest quark in diquark
    200               else kfll = G4int(0.25 + G4UniformRand());
    201            }   
    202            if(diquarkSpin==3 && kfla!=kfld) kfll = G4int(0.75+G4UniformRand());
    203         }
    204         G4int PDGEncoding=0;
    205         if (kfll == 1) PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
    206         else           PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
    207         if (id1 < 0) PDGEncoding = -PDGEncoding;
    208         G4QHadron* Baryon= new G4QHadron(PDGEncoding);
    209 #ifdef debug
    210         if(std::abs(black->GetPDGCharge() + white->GetPDGCharge()- Baryon->GetCharge()) > .001)
    211            G4cout<<"-Warning-G4QHadronBuilder::Baryon:wrongCharge,dq="<<black->GetPDGCharge()<<"("
     210       if ( kfla == kfld) kfll = 1; // heaviest quark in diquark
     211       else kfll = G4int(0.25 + G4UniformRand());
     212    }   
     213    if(diquarkSpin==3 && kfla!=kfld) kfll = G4int(0.75+G4UniformRand());
     214  }
     215  G4int PDGEncoding=0;
     216  if (kfll == 1) PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
     217  else           PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
     218  if (id1 < 0) PDGEncoding = -PDGEncoding;
     219  G4QHadron* Baryon= new G4QHadron(PDGEncoding);
     220#ifdef debug
     221  if(std::abs(black->GetPDGCharge() + white->GetPDGCharge()- Baryon->GetCharge()) > .001)
     222    G4cout<<"-Warning-G4QHadronBuilder::Baryon:wrongCharge,dq="<<black->GetPDGCharge()<<"("
    212223          <<black->->GetParticleName()<<"), q="<<white->GetPDGCharge()<<"("
    213224          <<white->->GetParticleName()<<"), qB="<<Baryon->GetCharge()<<"/"<<PDGEncoding
    214225          <<G4endl;
    215226#endif
    216         return Baryon;
    217 }
     227  return Baryon;
     228}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QInteraction.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QInteraction.cc,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QInteraction.cc,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------------
     
    3333//      ---------------- G4QInteraction----------------
    3434//            Created by Mikhail Kossov Oct, 2006
    35 //   class for a storing colliding particles in PartonString Models
     35//   class for colliding particles (hadrons) in Parton String Models
    3636//   For comparison mirror member functions are taken from G4 class:
    3737//   G4InteractionContent
    38 // -------------------------------------------------------------------
     38// ---------------------------------------------------------------------
     39//  Short description: Classify the interaction in soft/hard/diffractive
     40//  parts for firther treatment by the QGS algorithm.
     41// ---------------------------------------------------------------------
    3942
    4043#include "G4QInteraction.hh"
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QIsotope.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QIsotope.cc,v 1.10 2007/11/28 14:14:36 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QIsotope.cc,v 1.11 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QIsotope class ----------------
     
    3939//       1         2         3         4         5         6         7         8         9
    4040//34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
     41// ------------------------------------------------------------------------------
     42// Short description: containes the natural abundance DB for isotops and permits
     43// new artificial materials with unnatural abundance (e.g. enreached Deuterium).
     44// Uses isotope cross-sections for calculation of the mean cross-sections for the
     45// Element (fixed Z).
     46// ------------------------------------------------------------------------------
     47
    4148
    4249//#define debug
     
    636643      s->push_back(sP);
    637644#ifdef cdebug
    638              G4cout<<"G4QIsotope::Constructor:Element# "<<i<<", Pair # "<<j<<" is filled"<<G4endl;
     645      G4cout<<"G4QIsotope::Constructor:Element# "<<i<<", Pair # "<<j<<" is filled"<<G4endl;
    639646#endif
    640647    }
     
    650657      c->push_back(cP);
    651658#ifdef cdebug
    652              G4cout<<"G4QIsotope::Constructor:CrosSecPair i="<<i<<", j="<<j<<" is filled"<<G4endl;
     659      G4cout<<"G4QIsotope::Constructor:CrosSecPair i="<<i<<", j="<<j<<" is filled"<<G4endl;
    653660#endif
    654661    }
     
    877884        }
    878885        else return 3;
    879              }
     886      }
    880887      else return 2;
    881            }
     888    }
    882889    else return 1;
    883890  }
     
    894901  {
    895902 //   n              Be                   F              Al       P
    896              1, -1, -1, -1,  5, -1, -1, -1, -1, 10, -1, 12, -1, 14, -1, 16, -1, -1, -1, -1,
     903      1, -1, -1, -1,  5, -1, -1, -1, -1, 10, -1, 12, -1, 14, -1, 16, -1, -1, -1, -1,
    897904 //      Sc              Mn      Co                      As                       Y
    898             -1, 24, -1, -1, -1, 30, -1, 32, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, 50,
    899         //      Nb      Tc      Rh                               I      Cs              Pr
     905     -1, 24, -1, -1, -1, 30, -1, 32, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, 50,
     906 //      Nb      Tc      Rh                               I      Cs              Pr
    900907     -1, 52, -1, 55, -1, 58, -1, -1, -1, -1, -1, -1, -1, 74, -1, 78, -1, -1, -1, 82,
    901         //      Pm              Tb      Ho      Tm                                      Au
     908 //      Pm              Tb      Ho      Tm                                      Au
    902909     -1,-85, -1, -1, -1, 94, -1, 98, -1,100, -1, -1, -1, -1, -1, -1, -1, -1, -1,118,
    903         //                      Po   At   Rn   Fr   Ra   Ac
    904             -1,  -1,  -1, 126,-125,-136,-136,-138,-138,-142,
    905         //  Th   Pa    U   Np   Pu   Am   Cm   Bk   Cf   Es
     910 //                      Po   At   Rn   Fr   Ra   Ac
     911     -1,  -1,  -1, 126,-125,-136,-136,-138,-138,-142,
     912 //  Th   Pa    U   Np   Pu   Am   Cm   Bk   Cf   Es
    906913    142,-140,  -1,-144,-150,-148,-151,-150,-153,-153
    907         //  Fm   Md   No   Lr   Rf   Db   Sg   Bh   Hs   Mt
    908           -157,-157,-157,-157,-157,-157,-157,-155,-157,-157
     914 //  Fm   Md   No   Lr   Rf   Db   Sg   Bh   Hs   Mt
     915   -157,-157,-157,-157,-157,-157,-157,-155,-157,-157
    909916  };
    910917#ifdef debug
     
    915922  {
    916923    G4double rnd=G4UniformRand();
    917            if          (i<44)        // ====== H - Mo
    918            {
     924    if          (i<44)        // ====== H - Mo
     925    {
    919926      if        (i<23)        // ------ H - Ti
    920              {
     927      {
    921928        if      (i<12)        // ______ H - Ne
    922                {
     929        {
    923930          if     (i<6)        // ...... H - B
    924                  {
     931          {
    925932            if   (i<3)
    926                    {
     933            {
    927934              if(i==1)        // H
    928                      {
     935              {
    929936                if(rnd>.00015)       N=0;
    930937                else                 N=1;
    931                      }
     938              }
    932939              else            // He (2)
    933                      {
     940              {
    934941                if(rnd>1.37e-6)      N=2;
    935942                else                 N=1;
    936                      }
    937                    }
     943              }
     944            }
    938945            else
    939                    {
     946            {
    940947              if(i==3)        // Li
    941                      {
     948              {
    942949                if(rnd>.075)         N=4;
    943950                else                 N=3;
    944                      }
     951              }
    945952              else            // B (5)
    946                      {
     953              {
    947954                if(rnd>.199)         N=6;
    948955                else                 N=5;
    949                      }
     956              }
    950957            }
    951958          }
     
    953960          {
    954961            if   (i<8)
    955                    {
     962            {
    956963              if(i==6)        // C
    957                      {
     964              {
    958965                if(rnd>.011)         N=6;
    959966                else                 N=7;
    960                      }
     967              }
    961968              else            // N (7)
    962                      {
     969              {
    963970                if(rnd>.0037)        N=7;
    964971                else                 N=8;
    965                      }
    966                    }
     972              }
     973            }
    967974            else
    968                    {
     975            {
    969976              if(i==8)        // O
    970                      {
     977              {
    971978                if     (rnd<.9976)   N=8;
    972979                else if(rnd<.9996)   N=10;
    973980                else                 N=9;
    974                      }
     981              }
    975982              else            // Ne (10)
    976                      {
     983              {
    977984                if     (rnd<.9948)   N=10;
    978985                else if(rnd<.9975)   N=11;
    979986                else                 N=12;
    980                      }
     987              }
    981988            }
    982989          }
     
    985992        {
    986993          if     (i<18)       // ...... Mg - Cl
    987                  {
     994          {
    988995            if   (i<16)
    989                    {
     996            {
    990997              if(i==12)       // Mg
    991                      {
     998              {
    992999                if     (rnd<.7899)   N=12;
    9931000                else if(rnd<.8899)   N=13;
    9941001                else                 N=14;
    995                      }
     1002              }
    9961003              else            // Si (14)
    997                      {
     1004              {
    9981005                if    (rnd<.9223)    N=14;
    9991006                else if(rnd<.969)    N=15;
    10001007                else                 N=16;
    1001                      }
    1002                    }
     1008              }
     1009            }
    10031010            else
    1004                    {
     1011            {
    10051012              if(i==16)       // S
    1006                      {
     1013              {
    10071014                if     (rnd<.9502)   N=16;
    10081015                else if(rnd<.9923)   N=18;
    10091016                else if(rnd<.9998)   N=17;
    10101017                else                 N=20;
    1011                      }
     1018              }
    10121019              else            // Cl (17)
    1013                      {
     1020              {
    10141021                if     (rnd>.7577)   N=18;
    10151022                else                 N=20;
    1016                      }
     1023              }
    10171024            }
    10181025          }
     
    10201027          {
    10211028            if   (i<20)
    1022                    {
     1029            {
    10231030              if(i==18)       // Ar
    1024                      {
     1031              {
    10251032                if     (rnd<.996)    N=22;
    10261033                else if(rnd<.99937)  N=18;
    10271034                else                 N=20;
    1028                      }
     1035              }
    10291036              else            // K (19)
    1030                      {
     1037              {
    10311038                if     (rnd<.932581) N=20;
    10321039                else if(rnd<.999883) N=22;
    10331040                else                 N=21;
    1034                      }
    1035                    }
     1041              }
     1042            }
    10361043            else
    1037                    {
     1044            {
    10381045              if(i==20)       // Ca
    1039                      {
     1046              {
    10401047                if     (rnd<.96941)  N=20;
    10411048                else if(rnd<.99027)  N=24;
     
    10441051                else if(rnd<.99996)  N=23;
    10451052                else                 N=26;
    1046                      }
     1053              }
    10471054              else            // Ti (22)
    1048                      {
     1055              {
    10491056                if     (rnd<.738)    N=26;
    10501057                else if(rnd<.818)    N=24;
     
    10521059                else if(rnd<.946)    N=27;
    10531060                else                 N=28;
    1054                      }
     1061              }
    10551062            }
    10561063          }
    1057                       }
    1058              }
    1059              else                    // ------ V - Mo
    1060              {
     1064        }
     1065      }
     1066      else                    // ------ V - Mo
     1067      {
    10611068        if     (i<32)         // ______ V - Ga
    1062                {
     1069        {
    10631070          if     (i<28)       // ...... H - Fe
    1064                  {
     1071          {
    10651072            if   (i<26)
    1066                    {
     1073            {
    10671074              if(i==23)       // V
    1068                      {
     1075              {
    10691076                if     (rnd<.9975)   N=28;
    10701077                else                 N=27;
    1071                      }
     1078              }
    10721079              else            // Cr (24)
    1073                      {
     1080              {
    10741081                if     (rnd<.8379)   N=28;
    10751082                else if(rnd<.9329)   N=29;
    10761083                else if(rnd<.97635)  N=26;
    10771084                else                 N=30;
    1078                      }
    1079                    }
     1085              }
     1086            }
    10801087            else              // Fe (26)
    1081                    {
     1088            {
    10821089                if     (rnd<.9172)   N=30;
    10831090                else if(rnd<.9762)   N=28;
     
    10891096          {
    10901097            if   (i<30)
    1091                    {
     1098            {
    10921099              if(i==28)       // Ni
    1093                      {
     1100              {
    10941101                if     (rnd<.68077)  N=30;
    10951102                else if(rnd<.943)    N=32;
     
    10971104                else if(rnd<.99074)  N=33;
    10981105                else                 N=36;
    1099                      }
     1106              }
    11001107              else            // Cu (29)
    1101                      {
     1108              {
    11021109                if     (rnd<.6917)   N=34;
    11031110                else                 N=36;
    1104                      }
    1105                    }
     1111              }
     1112            }
    11061113            else
    1107                    {
     1114            {
    11081115              if(i==30)       // Zn
    1109                      {
     1116              {
    11101117                if     (rnd<.486)    N=34;
    11111118                else if(rnd<.765)    N=36;
     
    11131120                else if(rnd<.994)    N=37;
    11141121                else                 N=40;
    1115                      }
     1122              }
    11161123              else            // Ga (31)
    1117                      {
     1124              {
    11181125                if     (rnd<.60108)  N=38;
    11191126                else                 N=40;
    1120                      }
     1127              }
    11211128            }
    11221129          }
     
    11251132        {
    11261133          if     (i<37)       // ...... H - B
    1127                  {
     1134          {
    11281135            if   (i<35)
    1129                    {
     1136            {
    11301137              if(i==32)       // Ge
    1131                      {
     1138              {
    11321139                if     (rnd<.3594)  N=42;
    11331140                else if(rnd<.6360)  N=40;
     
    11351142                else if(rnd<.9256)  N=41;
    11361143                else                N=44;
    1137                      }
     1144              }
    11381145              else            // Se (34)
    1139                      {
     1146              {
    11401147                if     (rnd>.4961)  N=46;
    11411148                else if(rnd<.7378)  N=44;
     
    11441151                else if(rnd<.9911)  N=43;
    11451152                else                N=40;
    1146                      }
    1147                    }
     1153              }
     1154            }
    11481155            else
    1149                    {
     1156            {
    11501157              if(i==35)       // Br
    1151                      {
     1158              {
    11521159                if     (rnd<.5069)  N=44;
    11531160                else                N=46;
    1154                      }
     1161              }
    11551162              else            // Kr (36)
    1156                      {
     1163              {
    11571164                if     (rnd<.57)    N=48;
    11581165                else if(rnd<.743)   N=50;
     
    11611168                else if(rnd<.9965)  N=44;
    11621169                else                N=42;
    1163                      }
     1170              }
    11641171            }
    11651172          }
     
    11671174          {
    11681175            if     (i<40)
    1169                    {
     1176            {
    11701177              if(i==37)       // Rb
    1171                      {
     1178              {
    11721179                if     (rnd<.7217)  N=48;
    11731180                else                N=50;
    1174                      }
     1181              }
    11751182              else            // SR (38)
    1176                      {
     1183              {
    11771184                if     (rnd<.8258)  N=50;
    11781185                else if(rnd<.9244)  N=48;
    11791186                else if(rnd<.9944)  N=49;
    11801187                else                N=46;
    1181                      }
    1182                    }
     1188              }
     1189            }
    11831190            else
    1184                    {
     1191            {
    11851192              if(i==40)       // Zr
    1186                      {
     1193              {
    11871194                if     (rnd<.5145)  N=50;
    11881195                else if(rnd<.6883)  N=54;
     
    11901197                else if(rnd<.972)   N=51;
    11911198                else                N=56;
    1192                      }
     1199              }
    11931200              else            // Mo (42)
    1194                      {
     1201              {
    11951202                if     (rnd<.2413)  N=56;
    11961203                else if(rnd<.4081)  N=54;
     
    12001207                else if(rnd<.9075)  N=55;
    12011208                else                N=52;
    1202                      }
     1209              }
    12031210            }
    12041211          }
    12051212        }
    1206              }
     1213      }
    12071214    }
    1208            else                      // ====== Ru - U
    1209            {
     1215    else                      // ====== Ru - U
     1216    {
    12101217      if         (i<66)       // ------ Ru - Gd
    1211              {
     1218      {
    12121219        if       (i<54)       // ______ Ru - Te
    1213                {
     1220        {
    12141221          if     (i<49)       // ...... Ru - Cd
    1215                  {
     1222          {
    12161223            if   (i<47)
    1217                    {
     1224            {
    12181225              if(i==44)       // Ru
    1219                      {
     1226              {
    12201227                if     (rnd<.316)   N=58;
    12211228                else if(rnd<.502)   N=60;
     
    12251232                else if(rnd<.9814)  N=52;
    12261233                else                N=54;
    1227                      }
     1234              }
    12281235              else            // Pd (46)
    1229                      {
     1236              {
    12301237                if     (rnd<.2733)  N=60;
    12311238                else if(rnd<.5379)  N=62;
     
    12341241                else if(rnd<.9898)  N=58;
    12351242                else                N=56;
    1236                      }
    1237                    }
     1243              }
     1244            }
    12381245            else
    1239                    {
     1246            {
    12401247              if(i==47)       // Ag
    1241                      {
     1248              {
    12421249                if(rnd<.51839)      N=60;
    12431250                else                N=62;
    1244                      }
     1251              }
    12451252              else            // Cd (48)
    1246                      {
     1253              {
    12471254                if     (rnd<.2873)  N=66;
    12481255                else if(rnd<.5286)  N=64;
     
    12531260                else if(rnd<.9911)  N=58;
    12541261                else                N=60;
    1255                      }
     1262              }
    12561263            }
    12571264          }
     
    12591266          {
    12601267            if   (i<51)
    1261                    {
     1268            {
    12621269              if(i==49)       // In
    1263                      {
     1270              {
    12641271                if     (rnd<.9577)  N=66;
    12651272                else                N=64;
    1266                      }
     1273              }
    12671274              else            // Sn (50)
    1268                      {
     1275              {
    12691276                if     (rnd<.3259)  N=70;
    12701277                else if(rnd<.5681)  N=68;
     
    12781285                //else if(rnd<.9964)  N=64;
    12791286                //else                N=65;
    1280                      }
    1281                    }
     1287              }
     1288            }
    12821289            else
    1283                    {
     1290            {
    12841291              if(i==51)       // Sb
    1285                      {
     1292              {
    12861293                if     (rnd<.5736)  N=70;
    12871294                else                N=72;
    1288                      }
     1295              }
    12891296              else            // Te (52)
    1290                      {
     1297              {
    12911298                if     (rnd<.3387)  N=78;
    12921299                else if(rnd<.6557)  N=76;
     
    12971304                else if(rnd<.99905) N=71;
    12981305                else                N=68;
    1299                      }
     1306              }
    13001307            }
    13011308          }
     
    13041311        {
    13051312          if     (i<60)     // ...... Xe - B
    1306                  {
     1313          {
    13071314            if   (i<57)
    1308                    {
     1315            {
    13091316              if(i==54)       // Xe
    1310                      {
     1317              {
    13111318                if     (rnd<.269)   N=78;
    13121319                else if(rnd<.533)   N=75;
     
    13181325                else if(rnd<.9991)  N=70;
    13191326                else                N=72;
    1320                      }
     1327              }
    13211328              else            // Ba (56)
    1322                      {
     1329              {
    13231330                if     (rnd<.717)   N=82;
    13241331                else if(rnd<.8293)  N=81;
     
    13281335                else if(rnd<.99899) N=74;
    13291336                else                N=76;
    1330                      }
    1331                    }
     1337              }
     1338            }
    13321339            else
    1333                    {
     1340            {
    13341341              if(i==57)       // La
    1335                      {
     1342              {
    13361343                if     (rnd<.999098)N=82;
    13371344                else                N=81;
    1338                      }
     1345              }
    13391346              else            // Ce (58)
    1340                      {
     1347              {
    13411348                if     (rnd<.8843)  N=82;
    13421349                else if(rnd<.9956)  N=84;
    13431350                else if(rnd<.9981)  N=80;
    13441351                else                N=78;
    1345                      }
     1352              }
    13461353            }
    13471354          }
     
    13491356          {
    13501357            if   (i<63)
    1351                    {
     1358            {
    13521359              if(i==60)       // Nd
    1353                      {
     1360              {
    13541361                if     (rnd<.2713)  N=82;
    13551362                else if(rnd<.5093)  N=84;
     
    13591366                else if(rnd<.9436)  N=88;
    13601367                else                N=90;
    1361                      }
     1368              }
    13621369              else            // Sm (62)
    1363                      {
     1370              {
    13641371                if     (rnd<.267)   N=90;
    13651372                else if(rnd<.494)   N=92;
     
    13691376                else if(rnd<.969)   N=88;
    13701377                else                N=82;
    1371                      }
    1372                    }
     1378              }
     1379            }
    13731380            else
    1374                    {
     1381            {
    13751382              if(i==63)       // Eu
    1376                      {
     1383              {
    13771384                if     (rnd<.522)   N=90;
    13781385                else                N=89;
    1379                      }
     1386              }
    13801387              else            // Gd (64)
    1381                      {
     1388              {
    13821389                if     (rnd<.2484)  N=94;
    13831390                else if(rnd<.4670)  N=96;
     
    13871394                else if(rnd<.9980)  N=90;
    13881395                else                N=88;
    1389                      }
     1396              }
    13901397            }
    13911398          }
    13921399        }
    1393              }
    1394              else                    // ------ Dy - U
    1395              {
     1400      }
     1401      else                    // ------ Dy - U
     1402      {
    13961403        if       (i<76)       // ______ Dy - Re
    1397                {
     1404        {
    13981405          if     (i<72)       // ...... Dy - Lu
    1399                  {
     1406          {
    14001407            if   (i<70)
    1401                    {
     1408            {
    14021409              if(i==66)       // Dy
    1403                      {
     1410              {
    14041411                if     (rnd<.282)   N=98;
    14051412                else if(rnd<.537)   N=96;
     
    14091416                else if(rnd<.9994)  N=92;
    14101417                else                N=90;
    1411                      }
     1418              }
    14121419              else            // Er (68)
    1413                      {
     1420              {
    14141421                if     (rnd<.3360)  N= 98;
    14151422                else if(rnd<.6040)  N=100;
     
    14181425                else if(rnd<.9986)  N= 96;
    14191426                else                N= 94;
    1420                      }
    1421                    }
     1427              }
     1428            }
    14221429            else
    1423                    {
     1430            {
    14241431              if(i==70)       // Yb
    1425                      {
     1432              {
    14261433                if     (rnd<.3180)  N=104;
    14271434                else if(rnd<.5370)  N=102;
     
    14311438                else if(rnd<.9987)  N=100;
    14321439                else                N= 98;
    1433                      }
     1440              }
    14341441              else            // Lu (71)
    1435                      {
     1442              {
    14361443                if     (rnd<.9741)  N=104;
    14371444                else                N=105;
    1438                      }
     1445              }
    14391446            }
    14401447          }
     
    14421449          {
    14431450            if   (i<74)
    1444                    {
     1451            {
    14451452              if(i==72)       // Hf
    1446                      {
     1453              {
    14471454                if     (rnd<.35100) N=108;
    14481455                else if(rnd<.62397) N=106;
     
    14511458                else if(rnd<.99838) N=104;
    14521459                else                N=102;
    1453                      }
     1460              }
    14541461              else            // Ta (73)
    1455                      {
     1462              {
    14561463                if(rnd<.99988) N=108;
    14571464                else           N=107;
    1458                      }
    1459                    }
     1465              }
     1466            }
    14601467            else
    1461                    {
     1468            {
    14621469              if(i==74)       // W
    1463                      {
     1470              {
    14641471                if     (rnd<.307)   N=110;
    14651472                else if(rnd<.593)   N=112;
     
    14671474                else if(rnd<.9988)  N=109;
    14681475                else                N=106;
    1469                      }
     1476              }
    14701477              else            // Re (75)
    1471                      {
     1478              {
    14721479                if     (rnd<.626)   N=112;
    14731480                else                N=110;
    1474                      }
     1481              }
    14751482            }
    14761483          }
     
    14791486        {
    14801487          if     (i<81)       // ...... Os - Hg
    1481                  {
     1488          {
    14821489            if     (i<78)
    1483                    {
     1490            {
    14841491              if(i==76)       // Os
    1485                      {
     1492              {
    14861493                if     (rnd<.410)   N=116;
    14871494                else if(rnd<.674)   N=114;
     
    14911498                else if(rnd<.9998)  N=110;
    14921499                else                N=108;
    1493                      }
     1500              }
    14941501              else            // Ir (77)
    1495                      {
     1502              {
    14961503                if     (rnd<.627)   N=116;
    14971504                else                N=114;
    1498                      }
    1499                    }
     1505              }
     1506            }
    15001507            else
    1501                    {
     1508            {
    15021509              if(i==78)       // Pt
    1503                      {
     1510              {
    15041511                if     (rnd<.338)   N=117;
    15051512                else if(rnd<.667)   N=116;
     
    15081515                else if(rnd<.9999)  N=114;
    15091516                else                N=112;
    1510                      }
     1517              }
    15111518              else            // Hg (80)
    1512                      {
     1519              {
    15131520                if     (rnd<.2986)  N=122;
    15141521                else if(rnd<.5296)  N=120;
     
    15181525                else if(rnd<.9985)  N=124;
    15191526                else                N=116;
    1520                      }
     1527              }
    15211528            }
    15221529          }
     
    15241531          {
    15251532            if        (i<92)
    1526                    {
     1533            {
    15271534              if     (i==81)  // Tl
    1528                      {
     1535              {
    15291536                if     (rnd<.70476) N=124;
    15301537                else                N=122;
    1531                      }
     1538              }
    15321539              else            // Pb (82)
    1533                      {
     1540              {
    15341541                if     (rnd<.524)   N=126;
    15351542                else if(rnd<.765)   N=124;
    15361543                else if(rnd<.986)   N=125;
    15371544                else                N=122;
    1538                                    }
    1539                    }
     1545              }
     1546            }
    15401547            else              // U (92)
    1541                    {
     1548            {
    15421549                if     (rnd<.992745)N=146;
    15431550                else if(rnd<.999945)N=143;
    15441551                else                N=142;
    1545                    }
     1552            }
    15461553          }
    15471554        }
    1548              }
     1555      }
    15491556    }
    15501557  }
     
    15971604    if(j==I-1.)
    15981605    {
    1599              if(fabs(sumAbu-1.)>.00001)
     1606      if(fabs(sumAbu-1.)>.00001)
    16001607      {
    16011608        G4cerr<<"--Worning--G4QIsotope::InitEl:maxSum="<<sumAbu<<" is fixed to 1."<<G4endl;
     
    16041611      }
    16051612      else if(sumAbu-abu>1.)
    1606              {
     1613      {
    16071614        G4cerr<<"--Worning--G4QIsotope::InitEl:(-2)WrongAbund,Z="<<Z<<",i="<<index<<G4endl;
    16081615        for(G4int k=0; k<I-1; k++)
     
    16321639  }
    16331640  pair<G4int,vector<pair<G4int,G4double>*>*>* newAP=
    1634                                            new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,A);
     1641                                    new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,A);
    16351642  newElems.push_back(newAP);
    16361643  pair<G4int,vector<pair<G4int,G4double>*>*>* newSA=
    1637                                            new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,S);
     1644                                    new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,S);
    16381645  newSumAb.push_back(newSA);
    16391646  pair<G4int,vector<pair<G4int,G4double>*>*>* newCP=
    1640                                            new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,C);
     1647                                    new pair<G4int,vector<pair<G4int,G4double>*>*>(ZInd,C);
    16411648  newIsoCS.push_back(newCP);
    16421649#ifdef debug
     
    18691876  {
    18701877#ifdef ppdebug
    1871                                 G4cout<<"G4QIsotope::GetMeanCrossSection: Nat Abundance, Z="<<Z<<G4endl;
     1878    G4cout<<"G4QIsotope::GetMeanCrossSection: Nat Abundance, Z="<<Z<<G4endl;
    18721879#endif
    18731880    ab=natElements[Z];
     
    18771884  {
    18781885#ifdef ppdebug
    1879                                 G4cout<<"G4QIsotope::GetMeanCrossSection: Art Abund, Z="<<Z<<",ind="<<index<<G4endl;
     1886    G4cout<<"G4QIsotope::GetMeanCrossSection: Art Abund, Z="<<Z<<",ind="<<index<<G4endl;
    18801887#endif
    18811888    // For the positive index tries to find the newUserDefinedElement
     
    19131920    G4double sum=0.;
    19141921    for(G4int j=0; j<nis; j++)
    1915            {
     1922    {
    19161923      G4double cur=(*ab)[j]->second;
    19171924      //G4double abunda=cur-last;
    19181925      //last=cur;
    19191926#ifdef ppdebug
    1920                                                 G4cout<<"G4QIsot::GetMeanCS:j="<<j<<",ab="<<cur<<",CS="<<(*cs)[j]->second<<G4endl;
     1927      G4cout<<"G4QIsot::GetMeanCS:j="<<j<<",ab="<<cur<<",CS="<<(*cs)[j]->second<<G4endl;
    19211928#endif
    19221929      //sum+=abunda * (*cs)[j]->second;
     
    19831990    vector<G4double> scs(nis);
    19841991    for(G4int j=0; j<nis; j++)
    1985            {
     1992    {
    19861993      G4double cur=(*ab)[j]->second;
    19871994      G4double abunda=cur-last;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QNucleus.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNucleus.cc,v 1.95 2008/03/31 20:30:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNucleus.cc,v 1.96 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QNucleus ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Nuclei/Nuclear Environment used by CHIPS Model
    33 // ------------------------------------------------------------------
     33// ---------------------------------------------------------------------
     34// Short description: a class describing properties of nuclei, which
     35// are necessary for the CHIPS Model.
     36// ---------------------------------------------------------------------
     37
    3438
    3539//#define debug
     
    5660
    5761G4QNucleus::G4QNucleus(): G4QHadron(),Z(0),N(0),S(0),dZ(0),dN(0),dS(0),maxClust(0),
    58                           currentNucleon(-1),rho0(0),radius(0)
    59   //  probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()
     62     currentNucleon(-1),rho0(0),radius(0)
     63   //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()
    6064{
    6165  //Tb = new std::vector<G4double>;
     
    115119G4QNucleus::G4QNucleus(G4LorentzVector p, G4int nucPDG): G4QHadron(nucPDG,p),maxClust(0),
    116120  currentNucleon(-1),rho0(0),radius(0)
    117   //  probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()
     121  //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()
    118122{
    119123  //Tb = new std::vector<G4double>;
     
    324328  clustProb=c;
    325329  mediRatio=d;
    326                 nucleonDistance=e;
     330  nucleonDistance=e;
    327331}
    328332
     
    353357  probVect[0]=mediRatio;                        // init Vacuum/Medium probability
    354358  for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
     359  //std::uninitialized_fill( probVect+1, probVect+256, 0.0 ); // Worse in performance!
    355360  if(nucPDG<80000000) nucPDG=HadrToNucPDG(nucPDG); // Convert HadrPDGCode to NucPDGCode
    356361  G4int s=0;
     
    375380    SetNFragments(0);
    376381#ifdef debug
    377            G4cout<<"G4QNucleus::InitByPDG:->QPDG="<<nPDG<<": 4M="<<p<<G4endl;
     382    G4cout<<"G4QNucleus::InitByPDG:->QPDG="<<nPDG<<": 4M="<<p<<G4endl;
    378383#endif
    379384  }
     
    426431  if (din && dA<2 && a>2)
    427432  {
    428            dA=2;
     433    dA=2;
    429434    sA=a-2;
    430435  }
     
    480485    sum =prb;
    481486#ifdef pdebug
    482           G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[1]=s="<<sum<<",dA="<<dA<<",uA="<<uA<<G4endl;
     487   G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[1]=s="<<sum<<",dA="<<dA<<",uA="<<uA<<G4endl;
    483488#endif
    484489    //probVect[1]= prb/comb;                   // a#of quasi-free nucleons (correct)
     
    494499    sum+=prb+prb;
    495500#ifdef pdebug
    496         G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[2]="<<prb<<",s="<<sum<<",pA="<<pA<<G4endl;
     501    G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[2]="<<prb<<",s="<<sum<<",pA="<<pA<<G4endl;
    497502#endif
    498503    //probVect[2]= prb/comb;                   // a#of quasi-free "dibaryons" (correct)
     
    504509    maxi=3;
    505510#ifdef debug
    506         G4cout<<"G4QNucleus::UpdateClusters:p1="<<probVect[1]<<", p2="<<probVect[2]<<",sA="<<sA
     511    G4cout<<"G4QNucleus::UpdateClusters:p1="<<probVect[1]<<", p2="<<probVect[2]<<",sA="<<sA
    507512          <<",uA="<<uA<<",pA="<<pA<<",wrd="<<wrd<<",sud="<<sud<<G4endl;
    508513#endif
     
    518523        sum+=rd*i;
    519524#ifdef pdebug
    520             G4cout<<"G4QNucleus::UpdateCl:sud="<<sud<<", v["<<i<<"]="<<rd<<", s="<<sum<<G4endl;
     525     G4cout<<"G4QNucleus::UpdateCl:sud="<<sud<<", v["<<i<<"]="<<rd<<", s="<<sum<<G4endl;
    521526#endif
    522527        //comb*=(itA-i)/i;
     
    529534#endif
    530535      }
    531            }
     536    }
    532537    dS = S;                                  // @@ Lambdas are always in the dense region
    533538    dZ = static_cast<int>(static_cast<double>((dA-dS)*Z)/(Z+N) + 0.5);
     
    555560  //          <<G4endl;
    556561  //#endif
    557   //    G4int m=RandomizeBinom(prob,jmax);     // A#of clusters of this type
     562  // G4int m=RandomizeBinom(prob,jmax);     // A#of clusters of this type
    558563  //    if(m)
    559564  //    {
     
    595600    {
    596601      //if(abs(newPDG)<NUCPDG)
    597           //{
     602      //{
    598603      //  G4cerr<<"***G4QNucleus::Reduce:iPDG="<<curPDG<<"=newPDG="<<newPDG<<"+cPDG="<<cPDG
    599604      //        <<G4endl;
    600605      //  throw G4QException("*E*:::G4QNucleus::Reduce: Abnormal Nuclear Reduction");
    601           //}
     606      //}
    602607      InitByPDG(newPDG);                         // Reinit the Nucleus
    603         }
     608 }
    604609  }
    605610  else if(cPDG!=NUCPDG) G4cerr<<"***G4QN::Reduce:Subtract not nuclear PDGC="<<cPDG<<G4endl;
     
    946951        {
    947952          G4cerr<<"***G4QNucl::EvapBary: tM="<<totMass<<"-> 2N="<<nucPDG<<"(M="
    948                         <<nucM<<") + pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
     953          <<nucM<<") + pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
    949954          //throw G4QException("G4QNucl::EvapBary:ISO-dibaryon DecayIn3 did not succeed");
    950955          return false;
     
    11311136      pp2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
    11321137      if(pp2m>=0.000001)
    1133              {
     1138      {
    11341139        pFlag=true;
    11351140        pBnd=mProt-GSMass+GSResNp;             // Binding energy for proton
    11361141        G4double eMax=sqrt(mP2+pp2m);
    11371142#ifdef pdebug
    1138                G4cout<<"G4QNuc::EvapBaryon:pm="<<eMax+sqrt(pp2m+GSResNp*GSResNp)<<" = M="<<totMass
     1143        G4cout<<"G4QNuc::EvapBaryon:pm="<<eMax+sqrt(pp2m+GSResNp*GSResNp)<<" = M="<<totMass
    11391144              <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl;
    11401145#endif
    11411146        pExcess=eMax-mProt+pBnd;               // Max Kin Energy from bottom
    1142              }
     1147      }
    11431148      else pExcess=pBnd;
    11441149      if(Z>1)
    1145              {
     1150      {
    11461151        ppQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-2)+N);
    11471152        GSResPP=ppQPDG.GetMass();
    11481153#ifdef pdebug
    11491154        G4double sm=GSResPP+mProt+mProt+SPPBarr;
    1150                G4cout<<"G4QNucl::EvapBaryon: ppM="<<GSResPP<<",T="<<sm-GSMass<<",E="<<totMass-sm
     1155        G4cout<<"G4QNucl::EvapBaryon: ppM="<<GSResPP<<",T="<<sm-GSMass<<",E="<<totMass-sm
    11511156              <<",C="<<PBarr<<G4endl;
    11521157#endif
     
    11621167#ifdef pdebug
    11631168            G4double s=GSResPA+mAlph+mProt+SAPBarr;
    1164                    G4cout<<"G4QN::EB:paM="<<GSResPA<<",T="<<s-GSMass<<",E="<<totMass-s<<G4endl;
     1169            G4cout<<"G4QN::EB:paM="<<GSResPA<<",T="<<s-GSMass<<",E="<<totMass-s<<G4endl;
    11651170#endif
    11661171            if(GSResPA+mProt+SAPBarr+mAlph<totMass) paFlag=true;
    1167                         }
     1172          }
    11681173        }
    11691174        if(N>0&&a>3)
     
    11711176          GSReNPP=G4QPDGCode().GetNuclMass(Z-2,N-1,S);
    11721177          if(GSReNPP+mProt+mProt+SPPBarr+mNeut<totMass) nppF=true;
    1173                       }
     1178        }
    11741179        if(S>0&&a>3)
    11751180        {
    11761181          GSRePPL=G4QPDGCode().GetNuclMass(Z-2,N,S-1);
    11771182          if(GSRePPL+mProt+mProt+SPPBarr+mLamb<totMass) pplF=true;
    1178                       }
     1183        }
    11791184        if(N>1&&a>4)
    11801185        {
     
    11851190              GSReLLA=G4QPDGCode().GetNuclMass(Z-2,N-2,S-2);
    11861191              if(GSReLLA+mAlph+ABarr+mLamb+mLamb<totMass) llaF=true;
    1187                           }
     1192            }
    11881193            if(N>2&&S>0)
    11891194            {
    11901195              GSReNLA=G4QPDGCode().GetNuclMass(Z-2,N-3,S-1);
    11911196              if(GSReNLA+mAlph+ABarr+mNeut+mLamb<totMass) nlaF=true;
    1192                           }
     1197            }
    11931198            if(Z>2&&S>0)
    11941199            {
    11951200              GSRePLA=G4QPDGCode().GetNuclMass(Z-3,N-2,S-1);
    11961201              if(GSRePLA+mAlph+SAPBarr+mProt+mLamb<totMass) plaF=true;
    1197                           }
     1202            }
    11981203            if(N>3)
    11991204            {
    12001205              GSReNNA=G4QPDGCode().GetNuclMass(Z-2,N-4,S);
    12011206              if(GSReNNA+mAlph+ABarr+mNeut+mNeut<totMass) nnaF=true;
    1202                           }
     1207            }
    12031208            if(Z>2&&N>2)
    12041209            {
    12051210              GSReNPA=G4QPDGCode().GetNuclMass(Z-3,N-3,S);
    12061211              if(GSReNPA+mAlph+SAPBarr+mProt+mNeut<totMass) npaF=true;
    1207                           }
     1212            }
    12081213            if(N>3)
    12091214            {
    12101215              GSRePPA=G4QPDGCode().GetNuclMass(Z-4,N-2,S);
    12111216              if(GSRePPA+mAlph+SPPABarr+mProt+mProt<totMass) ppaF=true;
    1212                           }
     1217            }
    12131218            if(a>9)
    12141219            {
     
    12331238                if(GSReAAA+mAlph+mAlph+mAlph+SAAABarr<totMass) aaaF=true;
    12341239              }
    1235                                  }
    1236                         }
     1240            }
     1241          }
    12371242          if(N>3&&Z>3&&a>8)
    12381243          {
     
    12411246#ifdef pdebug
    12421247            G4double s=GSResAA+mAlph+mAlph+SAABarr;
    1243                    G4cout<<"G4QNucl::EvapBaryon: a="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s
     1248            G4cout<<"G4QNucl::EvapBaryon: a="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s
    12441249                  <<",A="<<SAABarr<<G4endl;
    12451250#endif
    12461251            if(GSResAA+mAlph+mAlph+SAABarr<totMass) aaFlag=true;
    1247                         }
     1252          }
    12481253          if(N>2&&a>5)
    12491254          {
     
    12521257#ifdef pdebug
    12531258            G4double s=GSResNA+mAlph+mNeut;
    1254                    G4cout<<"G4QNucl::EvapBary: M="<<GSResNA<<",T="<<s-GSMass<<",E="<<totMass-s
     1259            G4cout<<"G4QNucl::EvapBary: M="<<GSResNA<<",T="<<s-GSMass<<",E="<<totMass-s
    12551260                  <<",C="<<ABarr<<G4endl;
    12561261#endif
    12571262            if(GSResNA+mNeut+mAlph+ABarr<totMass) naFlag=true;
    1258                         }
     1263          }
    12591264          if(S>0&&a>5)
    12601265          {
     
    12621267            GSResLA=laQPDG.GetMass();
    12631268            if(GSResLA+mLamb+mAlph+ABarr<totMass) laFlag=true;
    1264                         }
     1269          }
    12651270          AQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-2)+N-2);
    12661271          GSResNa=AQPDG.GetMass();
     
    12691274          ap2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
    12701275          if(ap2m>=0.000001)
    1271                  {
     1276          {
    12721277            aFlag=true;
    12731278            aBnd=mAlph-GSMass+GSResNa;           // Binding energy for ALPHA
    12741279            G4double eMax=sqrt(mA2+ap2m);
    12751280#ifdef pdebug
    1276                    G4cout<<"G4QNuc::EvapBar:m="<<eMax+sqrt(ap2m+GSResNa*GSResNa)<<" = M="<<totMass
     1281            G4cout<<"G4QNuc::EvapBar:m="<<eMax+sqrt(ap2m+GSResNa*GSResNa)<<" = M="<<totMass
    12771282                  <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl;
    12781283#endif
    12791284            aExcess=eMax-mAlph+aBnd;             // Max Kin Energy from bottom
    1280                  }
     1285          }
    12811286          else aExcess=pBnd;
    1282                       }
    1283              }
     1287        }
     1288      }
    12841289      if(N>0)
    1285              {
     1290      {
    12861291        if(Z>0)
    12871292        {
     
    12901295#ifdef pdebug
    12911296          G4double s=GSResNP+mNeut+mProt;
    1292                  G4cout<<"G4QNucl::EvapBaryon: npM="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s
     1297          G4cout<<"G4QNucl::EvapBaryon: npM="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s
    12931298                <<",C="<<PBarr<<G4endl;
    12941299#endif
    12951300          if(GSResNP+mNeut+mProt+PBarr<totMass) npFlag=true;
    1296                       }
     1301        }
    12971302        if(N>1)
    12981303        {
    12991304          GSReNNP=G4QPDGCode().GetNuclMass(Z-1,N-2,S);
    13001305          if(GSReNNP+mProt+PBarr+mNeut+mNeut<totMass) nnpF=true;
    1301                       }
     1306        }
    13021307        if(S>0)
    13031308        {
    13041309          GSReNPL=G4QPDGCode().GetNuclMass(Z-1,N-1,S-1);
    13051310          if(GSReNPL+mProt+PBarr+mNeut+mLamb<totMass) nplF=true;
    1306                       }
    1307              }
     1311        }
     1312      }
    13081313      if(S>0)
    1309              {
     1314      {
    13101315        if(Z>0)
    13111316        {
     
    13131318          GSResPL=plQPDG.GetMass();
    13141319          if(GSResPL+mProt+PBarr+mLamb<totMass) plFlag=true;
    1315                       }
     1320        }
    13161321        if(S>1)
    13171322        {
    13181323          GSRePLL=G4QPDGCode().GetNuclMass(Z-1,N,S-2);
    13191324          if(GSRePLL+mProt+PBarr+mLamb+mLamb<totMass) pllF=true;
    1320                       }
    1321              }
    1322            }
     1325        }
     1326      }
     1327    }
    13231328    G4double GSResNn= GSMass;         // Prototype of Residual Nuclear Mass for neutron
    13241329    G4double nExcess= 0.;             // Prototype of excess energy for neutron
     
    13301335      GSResNn=NQPDG.GetMass();
    13311336#ifdef pdebug
    1332              G4cout<<"G4QNucleus::EvapBaryon: M(A-N)="<<GSResNn<<",Z="<<Z
     1337      G4cout<<"G4QNucleus::EvapBaryon: M(A-N)="<<GSResNn<<",Z="<<Z
    13331338            <<",N="<<N<<",S="<<S<<G4endl;
    13341339#endif
     
    13461351#endif
    13471352        nExcess=eMax-mNeut+nBnd;
    1348              }
     1353      }
    13491354      else nExcess=nBnd;
    13501355      if(N>1)
    1351              {
     1356      {
    13521357        nnQPDG=G4QPDGCode(90000000+1000*(1000*S+Z)+N-2);
    13531358        GSResNN=nnQPDG.GetMass();
     
    13571362          GSReNNN=G4QPDGCode().GetNuclMass(Z,N-3,S);
    13581363          if(GSReNNN+mNeut*3<totMass) nnnF=true;
    1359                       }
     1364        }
    13601365        if(S>0)
    13611366        {
    13621367          GSReNNL=G4QPDGCode().GetNuclMass(Z,N-2,S-1);
    13631368          if(GSReNNL+mNeut+mNeut+mLamb<totMass) nnlF=true;
    1364                       }
    1365              }
     1369        }
     1370      }
    13661371      if(S>0)
    1367              {
     1372      {
    13681373        nlQPDG=G4QPDGCode(90000000+1000*(1000*(S-1)+Z)+N-1);
    13691374        GSResNL=nlQPDG.GetMass();
     
    13731378          GSReNLL=G4QPDGCode().GetNuclMass(Z,N-1,S-2);
    13741379          if(GSReNLL+mNeut+mLamb+mLamb<totMass) nllF=true;
    1375                       }
    1376              }
    1377            }
     1380        }
     1381      }
     1382    }
    13781383    G4double GSResNl= GSMass;         // Prototype of Residual Nuclear Mass for Lambda
    13791384    G4double lExcess= 0.;             // Prototype of excess energy for Lambda
     
    13971402#endif
    13981403        lExcess=eMax-mLamb+lBnd;
    1399              }
     1404      }
    14001405      else lExcess=lBnd;
    14011406      if(S>1)
    1402              {
     1407      {
    14031408        llQPDG=G4QPDGCode(90000000+1000*(1000*(S-2)+Z)+N);
    14041409        GSResLL=llQPDG.GetMass();
     
    14081413          GSReLLL=G4QPDGCode().GetNuclMass(Z,N,S-3);
    14091414          if(GSReLLL+mLamb*3<totMass) lllF=true;
    1410                       }
    1411              }
    1412            }
     1415        }
     1416      }
     1417    }
    14131418    G4bool nSecF = nnFlag||npFlag||nlFlag||naFlag; // Pos of second radiation after neutron
    14141419    G4bool pSecF = npFlag||ppFlag||plFlag||paFlag; // Pos of second radiation after proton
     
    14221427    //G4bool thdB  = nTrF||pTrF||lTrF||aTrF||naaF||paaF||laaF||aaaF;// Pos to radiate three
    14231428#ifdef pdebug
    1424            G4cout<<"G4QNucl::EvapBary:n="<<nSecF<<",p="<<pSecF<<",l="<<lSecF<<",a="<<aSecF<<",nn="
     1429    G4cout<<"G4QNucl::EvapBary:n="<<nSecF<<",p="<<pSecF<<",l="<<lSecF<<",a="<<aSecF<<",nn="
    14251430          <<nnFlag<<", np="<<npFlag<<",pp="<<ppFlag<<",pa="<<paFlag<<",na="<<naFlag<<",aa="
    14261431          <<aaFlag<<G4endl;
     
    14281433    G4QPDGCode bQPDG;
    14291434    G4QPDGCode rQPDG;
    1430            if(secB)                            // Decay in two baryons is possible
    1431            //if(thdB)                            //@@CHECK@@ Decay in three baryons is possible
     1435    if(secB)                            // Decay in two baryons is possible
     1436    //if(thdB)                            //@@CHECK@@ Decay in three baryons is possible
    14321437    {
    14331438      if(!nSecF) nFlag=false;
     
    14361441      if(!aSecF) aFlag=false;
    14371442#ifdef pdebug
    1438              G4cout<<"G4QNuc::EB:nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl;
     1443      G4cout<<"G4QNuc::EB:nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl;
    14391444#endif
    14401445      G4double maxE=0.;                          // Prototype for maximum energy
     
    14751480        G4double ma=uWell*a+maxE;        // Total Kinetic Energy of baryons (@@alphas?)
    14761481        if(mi<0.)
    1477                {
     1482        {
    14781483          uW-=mi;
    14791484          mm-=mi;
    14801485          mi=0.;
    1481                }
     1486        }
    14821487        G4bool good=true;
    14831488        if(ma<mm)
     
    14871492        }
    14881493#ifdef pdebug
    1489                G4cout<<"G4QNuc::EvapBary:iE="<<minE<<",aE="<<maxE<<",mi="<<mi<<",mm="<<mm<<",ma="
     1494        G4cout<<"G4QNuc::EvapBary:iE="<<minE<<",aE="<<maxE<<",mi="<<mi<<",mm="<<mm<<",ma="
    14901495              <<ma<<G4endl;
    14911496#endif
     
    15001505        if(xMi>xMa)
    15011506        {
    1502                  G4cerr<<"***G4QNucleus::EvapBaryon: M="<<mm/ma<<",xi="<<xMi<<",xa="<<xMa<<G4endl;
     1507          G4cerr<<"***G4QNucleus::EvapBaryon: M="<<mm/ma<<",xi="<<xMi<<",xa="<<xMa<<G4endl;
    15031508          return false;
    15041509        }
     
    15061511        xMa=sqrt(xMa);                          // @@ ?
    15071512#ifdef pdebug
    1508                G4cout<<"G4QNuc:EvapBaryon:mi="<<mi<<",ma="<<ma<<", xi="<<xMi<<",xa="<<xMa<<G4endl;
     1513        G4cout<<"G4QNuc:EvapBaryon:mi="<<mi<<",ma="<<ma<<", xi="<<xMi<<",xa="<<xMa<<G4endl;
    15091514#endif
    15101515        G4double powr=1.5*a1;                   // Power for low & up limits
     
    15281533          G4double x = sqrt(x2);
    15291534          if(x<xMi||x>xMa)
    1530                         {
     1535          {
    15311536#ifdef pdebug
    15321537            G4cerr<<"**G4QNucl::EvapB:R="<<R<<",xi="<<xMi<<" < "<<x<<" < xa="<<xMa<<G4endl;
     
    15351540            else      x=xMa;
    15361541            x2 = x*x;
    1537                         }
     1542          }
    15381543          G4double rn=G4UniformRand();
    15391544          //if(rn<x/xMa||!good)
     
    15441549            G4double zCBPP=0.;                         // Probabylity for a proton
    15451550#ifdef pdebug
    1546                                  G4cout<<"G4QNuc::EvapB:t="<<tk<<",pM="<<pMin<<",pB="<<pBnd<<",n="<<nMin<<",a="
     1551            G4cout<<"G4QNuc::EvapB:t="<<tk<<",pM="<<pMin<<",pB="<<pBnd<<",n="<<nMin<<",a="
    15471552                  <<aMin<<G4endl;
    15481553#endif
     
    15521557              //if(barf) kin-=PBarr; //@@ This is a mistake
    15531558#ifdef pdebug
    1554                                    G4cout<<"G4QN::EB:Proton="<<kin<<",CB="<<PBarr<<",B="<<pBnd<<",M="<<pMin
     1559              G4cout<<"G4QN::EB:Proton="<<kin<<",CB="<<PBarr<<",B="<<pBnd<<",M="<<pMin
    15551560                    <<",p="<<CoulBarPenProb(PBarr,kin,1,1)<<G4endl;
    15561561#endif
    15571562              zCBPP=Z*CoulBarPenProb(PBarr,kin,1,1)*sqrt(kin);
    1558                                  }
     1563            }
    15591564            psum+=zCBPP;
    15601565            G4double nCBPP=0.;                       // Probability for a neutron (=> p+n)
     
    15631568              G4double kin=tk-nBnd;
    15641569#ifdef pdebug
    1565                                    G4cout<<"G4QN::EB:Neutron="<<kin<<",p="<<CoulBarPenProb(0.,kin,0,1)<<G4endl;
     1570              G4cout<<"G4QN::EB:Neutron="<<kin<<",p="<<CoulBarPenProb(0.,kin,0,1)<<G4endl;
    15661571#endif
    15671572              nCBPP=N*CoulBarPenProb(0.,kin,0,1)*sqrt(kin);
     
    15741579              G4double kin=tk-lBnd;
    15751580#ifdef pdebug
    1576                                    G4cout<<"G4QN::EB:Lambda="<<kin<<",p="<<CoulBarPenProb(0,kin,0,1)<<G4endl;
     1581              G4cout<<"G4QN::EB:Lambda="<<kin<<",p="<<CoulBarPenProb(0,kin,0,1)<<G4endl;
    15771582#endif
    15781583              lCBPP=S*CoulBarPenProb(0.,kin,0,1)*sqrt(kin);
    1579                                  }
     1584            }
    15801585            psum+=lCBPP;
    15811586            lCBPP+=nCBPP;
    1582                                  if(evalph&&aFlag&&tk>aMin)
     1587            if(evalph&&aFlag&&tk>aMin)
    15831588            {
    15841589              G4double kin=tk-aBnd;
    15851590              //if(barf) kin-=ABarr; //@@ This is a mistake
    15861591#ifdef pdebug
    1587                                    G4cout<<"G4QN::EB:Alpha="<<kin<<",CB="<<ABarr<<",p="
     1592              G4cout<<"G4QN::EB:Alpha="<<kin<<",CB="<<ABarr<<",p="
    15881593                    <<CoulBarPenProb(ABarr,kin,2,4)<<G4endl;
    15891594#endif
    15901595              psum+=CoulBarPenProb(ABarr,kin,2,4)*sqrt(kin)*evalph*Z*(Z-1)*N*(N-1)
    15911596                                                 *6/a1/(a-2)/(a-3);
    1592                                  }
     1597            }
    15931598            G4double r = psum*G4UniformRand();
    15941599#ifdef pdebug
    1595                                  G4cout<<"G4QNuc::EvapB:"<<r<<",p="<<zCBPP<<",pn="<<nCBPP<<",pnl="<<lCBPP<<",t="
     1600            G4cout<<"G4QNuc::EvapB:"<<r<<",p="<<zCBPP<<",pn="<<nCBPP<<",pnl="<<lCBPP<<",t="
    15961601                  <<psum<<G4endl;
    15971602#endif
    15981603            cond = false;
    15991604            if     (r&&r>lCBPP)
    1600                           {
    1601 #ifdef pdebug
    1602                                    G4cout<<"G4QNuc::EvaB:ALPHA is selected for evap, r="<<r<<">"<<lCBPP<<G4endl;
     1605            {
     1606#ifdef pdebug
     1607              G4cout<<"G4QNuc::EvaB:ALPHA is selected for evap, r="<<r<<">"<<lCBPP<<G4endl;
    16031608#endif
    16041609              PDG=aPDG;
    1605                           }
     1610            }
    16061611            else if(r&&r>nCBPP&&r<=lCBPP)
    16071612            {
    16081613#ifdef pdebug
    1609                                    G4cout<<"G4QNuc::EvaB:LAMBDA is selected for evap,r="<<r<<"<"<<lCBPP<<G4endl;
     1614              G4cout<<"G4QNuc::EvaB:LAMBDA is selected for evap,r="<<r<<"<"<<lCBPP<<G4endl;
    16101615#endif
    16111616              PDG=lPDG;
    1612                                  }
     1617            }
    16131618            else if(r&&r>zCBPP&&r<=nCBPP)
    16141619            {
    16151620#ifdef pdebug
    1616                                    G4cout<<"G4QNuc::EvaBar: N is selected for evapor,r="<<r<<"<"<<nCBPP<<G4endl;
     1621              G4cout<<"G4QNuc::EvaBar: N is selected for evapor,r="<<r<<"<"<<nCBPP<<G4endl;
    16171622#endif
    16181623              PDG=nPDG;
    1619                                  }
     1624            }
    16201625            else if(r&&r<=zCBPP)
    16211626            {
    16221627#ifdef pdebug
    1623                                    G4cout<<"G4QNuc::EvaBar: P is selected for evapor,r="<<r<<"<"<<zCBPP<<G4endl;
     1628              G4cout<<"G4QNuc::EvaBar: P is selected for evapor,r="<<r<<"<"<<zCBPP<<G4endl;
    16241629#endif
    16251630              PDG=pPDG;
    1626                                  }
     1631            }
    16271632            else cond=true;
    1628                         }
     1633          }
    16291634#ifdef pdebug
    16301635          G4cout<<"G4QNuc::EvapBar:c="<<cond<<",x="<<x<<",cnt="<<cntr<<",R="<<R<<",ma="<<ma
     
    16321637#endif
    16331638          cntr++;
    1634                }
     1639        }
    16351640        if(cntr<cntm)                       // => Succeeded to find the evaporation channel
    1636                {
     1641        {
    16371642          G4double p2=0.;
    16381643          if     (PDG==aPDG)
     
    16441649              p2=ap2m;
    16451650              tk=sqrt(p2+mA2);
    1646                           }
     1651            }
    16471652            eMass=mAlph;
    16481653            bQPDG=aQPDG;
    16491654            rQPDG=AQPDG;
    1650                  }
     1655          }
    16511656          else if(PDG==pPDG)
    16521657          {
     
    16571662              p2=pp2m;
    16581663              tk=sqrt(p2+mP2);
    1659                           }
     1664            }
    16601665            eMass=mProt;
    16611666            bQPDG=pQPDG;
    16621667            rQPDG=PQPDG;
    1663                  }
     1668          }
    16641669          else if(PDG==nPDG)
    16651670          {
     
    16731678              p2=np2m;
    16741679              tk=sqrt(p2+mN2);
    1675                           }
     1680            }
    16761681            eMass=mNeut;
    16771682            bQPDG=nQPDG;
    16781683            rQPDG=NQPDG;
    1679                  }
     1684          }
    16801685          else if(PDG==lPDG)
    16811686          {
     
    16861691              p2=lp2m;
    16871692              tk=sqrt(p2+mL2);
    1688                           }
     1693            }
    16891694            eMass=mLamb;
    16901695            bQPDG=lQPDG;
    16911696            rQPDG=LQPDG;
    1692                  }
     1697          }
    16931698          else G4cerr<<"***G4QNucleus::EvaporateBaryon: PDG="<<PDG<<G4endl;
    16941699          G4double rEn=totMass-tk;
     
    17211726          if(barf) aaCond = !aaFlag || (aaFlag && GSResAA+mAlph+SAABarr > rMass);
    17221727#ifdef pdebug
    1723                         G4cout<<"G4QNucl::EvaB:"<<PDG<<", E="<<tk<<", rM="<<rMass<<", ";
     1728          G4cout<<"G4QNucl::EvaB:"<<PDG<<", E="<<tk<<", rM="<<rMass<<", ";
    17241729          if(PDG==pPDG)      G4cout<<"PN="<<GSResNP+mNeut<<"("<<pnCond<<"),PP="
    17251730                                   <<GSResPP+mProt+PPBarr<<"("<<ppCond<<"),PL="
     
    17431748          //if(3>2)three=false;                        // @@@@@@@@@@@@@@@@@@
    17441749          //else if(PDG==pPDG&&(pnCond&&ppCond&&plCond&&paCond)) // @@@@@@@@@@@@@@@@@@@
    1745                         if(PDG==pPDG&&(pnCond&&ppCond&&plCond&&paCond))//p+RN decay, p+b+RN dec is closed
    1746                         {
    1747 #ifdef pdebug
    1748                                  G4cout<<"G4QN::EB:*p*: n="<<pnCond<<",p="<<ppCond<<",l="<<plCond<<",a="<<paCond
     1750          if(PDG==pPDG&&(pnCond&&ppCond&&plCond&&paCond))//p+RN decay, p+b+RN dec is closed
     1751          {
     1752#ifdef pdebug
     1753            G4cout<<"G4QN::EB:*p*: n="<<pnCond<<",p="<<ppCond<<",l="<<plCond<<",a="<<paCond
    17491754                  <<G4endl;
    17501755#endif
     
    17531758            G4double nLim=0.;
    17541759            if(N&&GSResNP!=GSMass&&fMass+PBarr+mNeut+GSResNP<totMass)
    1755                                  {
    1756                                    if(barf) nLim+=(N+N)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
     1760            {
     1761              if(barf) nLim+=(N+N)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
    17571762              else     nLim+=(N+N)*pow(totMass-mNeut-mProt-GSResNP,2);
    1758                                  }
     1763            }
    17591764            G4double zLim=nLim;
    17601765            if(Z>1&&GSResPP!=GSMass&&fMass+mProt+SPPBarr+GSResPP<totMass)
    1761                                  {
    1762                                    if(barf) zLim+=(Z-1)*pow(totMass-mProt-mProt-SPPBarr-GSResPP,2);
     1766            {
     1767              if(barf) zLim+=(Z-1)*pow(totMass-mProt-mProt-SPPBarr-GSResPP,2);
    17631768              else     zLim+=(Z-1)*pow(totMass-mProt-mProt-GSResPP,2);
    1764                                  }
     1769            }
    17651770            G4double sLim=zLim;
    17661771            if(S&&GSResPL!=GSMass&&fMass+PBarr+mLamb+GSResPL<totMass)
    1767                                  {
    1768                                    if(barf) sLim+=(S+S)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
     1772            {
     1773              if(barf) sLim+=(S+S)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
    17691774              else     sLim+=(S+S)*pow(totMass-mProt-mLamb-GSResPL,2);
    1770                                  }
     1775            }
    17711776            G4double aLim=sLim;
    17721777            if(evalph&&Z>2&&N>1&&a>4&&GSResPL!=GSMass&&fMass+SAPBarr+mAlph+GSResPA<totMass)
    1773                                  {
    1774                                    if(barf) aLim+=pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2)*evalph*
     1778            {
     1779              if(barf) aLim+=pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2)*evalph*
    17751780                             (Z-1)*(Z-2)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
    17761781              else     aLim+=pow(totMass-mProt-mAlph-GSResPA,2)*evalph*(Z-1)*(Z-2)*N*(N-1)
    17771782                             *12/(a-2)/(a-3)/(a-4);
    1778                                  }
     1783            }
    17791784            G4double r = aLim*G4UniformRand();
    17801785#ifdef pdebug
    1781                                  G4cout<<"G4QNuc::EvaB:p, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="
     1786            G4cout<<"G4QNuc::EvaB:p, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="
    17821787                  <<aLim<<G4endl;
    17831788#endif
     
    17851790            if(!aLim) three=false;
    17861791            else if(r>sLim)
    1787                           {
     1792            {
    17881793              eMass = mAlph;
    17891794              dbQPDG= PAQPDG;
     
    17911796              rQPDG = paQPDG;
    17921797#ifdef pdebug
    1793                                    G4cout<<"G4QNucleus::EvaporateBary: P+A"<<G4endl;
    1794 #endif
    1795                           }
     1798              G4cout<<"G4QNucleus::EvaporateBary: P+A"<<G4endl;
     1799#endif
     1800            }
    17961801            else if(zLim<sLim&&r>zLim&&r<=sLim)
    1797                           {
     1802            {
    17981803              eMass = mLamb;
    17991804              dbQPDG= PLQPDG;
     
    18011806              rQPDG = plQPDG;
    18021807#ifdef pdebug
    1803                                    G4cout<<"G4QNucleus::EvaporateBary: P+L"<<G4endl;
    1804 #endif
    1805                           }
     1808              G4cout<<"G4QNucleus::EvaporateBary: P+L"<<G4endl;
     1809#endif
     1810            }
    18061811            else if(nLim<zLim&&r>nLim&&r<=zLim)
    1807                    {
     1812            {
    18081813              eMass = mProt;
    18091814              dbQPDG= PPQPDG;
     
    18111816              rQPDG = ppQPDG;
    18121817#ifdef pdebug
    1813                                    G4cout<<"G4QNucleus::EvaporateBary: P+P"<<G4endl;
    1814 #endif
    1815                           }
     1818              G4cout<<"G4QNucleus::EvaporateBary: P+P"<<G4endl;
     1819#endif
     1820            }
    18161821            else if(r<=nLim)
    1817                    {
     1822            {
    18181823              eMass = mNeut;
    18191824              dbQPDG= NPQPDG;
     
    18211826              rQPDG = npQPDG;
    18221827#ifdef pdebug
    1823                                    G4cout<<"G4QNucleus::EvaporateBary: P+N"<<G4endl;
    1824 #endif
    1825                 }
     1828              G4cout<<"G4QNucleus::EvaporateBary: P+N"<<G4endl;
     1829#endif
     1830            }
    18261831            else three=false;
    1827                         }
     1832          }
    18281833          else if(PDG==nPDG&&(nnCond&&npCond&&nlCond&&naCond)) // n+b+RN decay can't happen
    1829                         { //@@ Take into account Coulomb Barier Penetration Probability
    1830 #ifdef pdebug
    1831                                  G4cout<<"G4QN::EB:*n*: n="<<nnCond<<",p="<<npCond<<",l="<<nlCond<<",a="<<naCond
     1834          { //@@ Take into account Coulomb Barier Penetration Probability
     1835#ifdef pdebug
     1836            G4cout<<"G4QN::EB:*n*: n="<<nnCond<<",p="<<npCond<<",l="<<nlCond<<",a="<<naCond
    18321837                  <<G4endl;
    18331838#endif
     
    18391844            G4double zLim=nLim;
    18401845            if(Z&&GSResNP!=GSMass&&fMass+mProt+PBarr+GSResNP<totMass)
    1841                                  {
    1842                                    if(barf) zLim+=(Z+Z)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
     1846            {
     1847              if(barf) zLim+=(Z+Z)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
    18431848              else     zLim+=(Z+Z)*pow(totMass-mNeut-mProt-GSResNP,2);
    1844                                  }
     1849            }
    18451850            G4double sLim=zLim;
    18461851            if(S&&GSResNL!=GSMass&&fMass+mLamb+GSResNL<totMass)
     
    18481853            G4double aLim=sLim;
    18491854            if(evalph&&Z>1&&N>2&&a>4&&GSResNA!=GSMass&&fMass+mAlph+ABarr+GSResNA<totMass)
    1850                                  {
    1851                                    if(barf) aLim+=pow(totMass-mNeut-mAlph-ABarr-GSResNA,2)*
     1855            {
     1856              if(barf) aLim+=pow(totMass-mNeut-mAlph-ABarr-GSResNA,2)*
    18521857                             evalph*Z*(Z-1)*(N-1)*(N-2)*12/(a-2)/(a-3)/(a-4);
    18531858              else     aLim+=pow(totMass-mNeut-mAlph-GSResNA,2)*
    18541859                             evalph*Z*(Z-1)*(N-1)*(N-2)*12/(a-2)/(a-3)/(a-4);
    1855                                  }
     1860            }
    18561861            G4double r = aLim*G4UniformRand();
    18571862#ifdef pdebug
    1858                                  G4cout<<"G4QN::EB:n, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
     1863            G4cout<<"G4QN::EB:n, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
    18591864                  <<G4endl;
    18601865#endif
     
    18621867            if(!aLim) three=false;
    18631868            else if(r>sLim)
    1864                           {
     1869            {
    18651870              eMass = mAlph;
    18661871              dbQPDG= NAQPDG;
     
    18681873              rQPDG = naQPDG;
    18691874#ifdef pdebug
    1870                                    G4cout<<"G4QNucleus::EvaporateBary: N+A"<<G4endl;
    1871 #endif
    1872                           }
     1875              G4cout<<"G4QNucleus::EvaporateBary: N+A"<<G4endl;
     1876#endif
     1877            }
    18731878            else if(zLim<sLim&&r>zLim&&r<=sLim)
    1874                           {
     1879            {
    18751880              eMass = mLamb;
    18761881              dbQPDG= NLQPDG;
     
    18781883              rQPDG = nlQPDG;
    18791884#ifdef pdebug
    1880                                    G4cout<<"G4QNucleus::EvaporateBary: N+L"<<G4endl;
    1881 #endif
    1882                           }
     1885              G4cout<<"G4QNucleus::EvaporateBary: N+L"<<G4endl;
     1886#endif
     1887            }
    18831888            else if(nLim<zLim&&r>nLim&&r<=zLim)
    1884                    {
     1889            {
    18851890              eMass = mProt;
    18861891              dbQPDG= NPQPDG;
     
    18881893              rQPDG = npQPDG;
    18891894#ifdef pdebug
    1890                                    G4cout<<"G4QNucleus::EvaporateBary: N+P"<<G4endl;
    1891 #endif
    1892                           }
     1895              G4cout<<"G4QNucleus::EvaporateBary: N+P"<<G4endl;
     1896#endif
     1897            }
    18931898            else if(r<=nLim)
    1894                    {
     1899            {
    18951900              eMass = mNeut;
    18961901              dbQPDG= NNQPDG;
     
    18981903              rQPDG = nnQPDG;
    18991904#ifdef pdebug
    1900                                    G4cout<<"G4QNucleus::EvaporateBary: N+N"<<G4endl;
    1901 #endif
    1902                 }     
     1905              G4cout<<"G4QNucleus::EvaporateBary: N+N"<<G4endl;
     1906#endif
     1907            }     
    19031908            else three=false;
    1904                         }
     1909          }
    19051910          else if(PDG==lPDG&&(lnCond&&lpCond&&llCond&&laCond)) // l+b+RN decay can't happen
    1906                         { //@@ Take into account Coulomb Barier Penetration Probability
     1911          { //@@ Take into account Coulomb Barier Penetration Probability
    19071912#ifdef ppdebug
    1908                                  G4cout<<"G4QN::EB:*l*: n="<<lnCond<<",p="<<lpCond<<",l="<<llCond<<",a="<<laCond
     1913            G4cout<<"G4QN::EB:*l*: n="<<lnCond<<",p="<<lpCond<<",l="<<llCond<<",a="<<laCond
    19091914                  <<G4endl;
    19101915#endif
     
    19161921            G4double zLim=nLim;
    19171922            if(Z&&GSResPL!=GSMass&&fMass+mProt+PBarr+GSResPL<totMass)
    1918                                  {
    1919                                    if(barf) zLim+=(Z+Z)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
     1923            {
     1924              if(barf) zLim+=(Z+Z)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
    19201925              else zLim+=(Z+Z)*pow(totMass-mProt-mLamb-GSResPL,2);
    1921                                  }
     1926            }
    19221927            G4double sLim=zLim;
    19231928            if(S>1&&GSResLL!=GSMass&&fMass+mLamb+GSResLL<totMass)
     
    19251930            G4double aLim=sLim;
    19261931            if(evalph&&Z>1&&N>1&&a>4&&GSResLA!=GSMass&&fMass+mAlph+ABarr+GSResLA<totMass)
    1927                                  {
    1928                                    if(barf) aLim+=pow(totMass-mLamb-mAlph-ABarr-GSResLA,2)*
     1932            {
     1933              if(barf) aLim+=pow(totMass-mLamb-mAlph-ABarr-GSResLA,2)*
    19291934                             evalph*Z*(Z-1)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
    19301935              else     aLim+=pow(totMass-mLamb-mAlph-GSResLA,2)*
    19311936                             evalph*Z*(Z-1)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
    1932                                  }
     1937            }
    19331938            G4double r = aLim*G4UniformRand();
    19341939#ifdef pdebug
    1935                                  G4cout<<"G4QN::EB:l, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
     1940            G4cout<<"G4QN::EB:l, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
    19361941                  <<G4endl;
    19371942#endif
     
    19391944            if(!aLim) three=false;
    19401945            else if(r>sLim)
    1941                           {
     1946            {
    19421947              eMass = mAlph;
    19431948              dbQPDG= LAQPDG;
     
    19451950              rQPDG = laQPDG;
    19461951#ifdef pdebug
    1947                                    G4cout<<"G4QNucleus::EvaporateBary: L+A"<<G4endl;
    1948 #endif
    1949                           }
     1952              G4cout<<"G4QNucleus::EvaporateBary: L+A"<<G4endl;
     1953#endif
     1954            }
    19501955            else if(zLim<sLim&&r>zLim&&r<=sLim)
    1951                           {
     1956            {
    19521957              eMass = mLamb;
    19531958              dbQPDG= LLQPDG;
     
    19551960              rQPDG = llQPDG;
    19561961#ifdef pdebug
    1957                                    G4cout<<"G4QNucleus::EvaporateBary: L+L"<<G4endl;
    1958 #endif
    1959                           }
     1962              G4cout<<"G4QNucleus::EvaporateBary: L+L"<<G4endl;
     1963#endif
     1964            }
    19601965            else if(nLim<zLim&&r>nLim&&r<=zLim)
    1961                    {
     1966            {
    19621967              eMass = mProt;
    19631968              dbQPDG= PLQPDG;
     
    19651970              rQPDG = plQPDG;
    19661971#ifdef pdebug
    1967                                    G4cout<<"G4QNucleus::EvaporateBary: L+P"<<G4endl;
    1968 #endif
    1969                           }
     1972              G4cout<<"G4QNucleus::EvaporateBary: L+P"<<G4endl;
     1973#endif
     1974            }
    19701975            else if(r<=nLim)
    1971                    {
     1976            {
    19721977              eMass = mNeut;
    19731978              dbQPDG= NLQPDG;
     
    19751980              rQPDG = nlQPDG;
    19761981#ifdef pdebug
    1977                                    G4cout<<"G4QNucleus::EvaporateBary: L+N"<<G4endl;
    1978 #endif
    1979                 }
     1982              G4cout<<"G4QNucleus::EvaporateBary: L+N"<<G4endl;
     1983#endif
     1984            }
    19801985            else three=false;
    1981                         }
     1986          }
    19821987          else if(PDG==aPDG&&(anCond&&apCond&&alCond&&aaCond)) // a+b+RN decay can't happen
    1983                         { //@@ Take into account Coulomb Barier Penetration Probability
    1984 #ifdef pdebug
    1985                                  G4cout<<"G4QN::EB:*a*: n="<<anCond<<",p="<<apCond<<",l="<<alCond<<",a="<<aaCond
     1988          { //@@ Take into account Coulomb Barier Penetration Probability
     1989#ifdef pdebug
     1990            G4cout<<"G4QN::EB:*a*: n="<<anCond<<",p="<<apCond<<",l="<<alCond<<",a="<<aaCond
    19861991                  <<G4endl;
    19871992#endif
     
    19901995            G4double nLim=0.;
    19911996            if(N>2&&GSResNA!=GSMass&&fMass+mNeut+ABarr+GSResNA<totMass)
    1992                                  {
    1993                                    if(barf) nLim+=(N-2)*pow(totMass-mNeut-mAlph-ABarr-GSResNA,2);
     1997            {
     1998              if(barf) nLim+=(N-2)*pow(totMass-mNeut-mAlph-ABarr-GSResNA,2);
    19941999              else     nLim+=(N-2)*pow(totMass-mNeut-mAlph-GSResNA,2);
    1995                                  }
     2000            }
    19962001            G4double zLim=nLim;
    19972002            if(Z>2&&GSResPA!=GSMass&&fMass+mProt+SAPBarr+GSResPA<totMass)
    1998                                  {
    1999                                    if(barf) zLim+=(Z-2)*pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2);
     2003            {
     2004              if(barf) zLim+=(Z-2)*pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2);
    20002005              else     zLim+=(Z-2)*pow(totMass-mProt-mAlph-GSResPA,2);
    2001                                  }
     2006            }
    20022007            G4double sLim=zLim;
    20032008            if(S&&GSResLA!=GSMass&&fMass+mLamb+ABarr+GSResLA<totMass)
    2004                                  {
    2005                                    if(barf) sLim+=S*pow(totMass-mLamb-mAlph-ABarr-GSResLA,2);
     2009            {
     2010              if(barf) sLim+=S*pow(totMass-mLamb-mAlph-ABarr-GSResLA,2);
    20062011              else     sLim+=S*pow(totMass-mLamb-mAlph-GSResLA,2);
    2007                                  }
     2012            }
    20082013            G4double aLim=sLim;
    20092014            if(evalph&&Z>3&&N>3&&a>7&&GSResAA!=GSMass&&fMass+mAlph+SAABarr+GSResAA<totMass)
    2010                                  {
    2011                                    if(barf) aLim+=pow(totMass-mAlph-mAlph-SAABarr-GSResAA,2)*
     2015            {
     2016              if(barf) aLim+=pow(totMass-mAlph-mAlph-SAABarr-GSResAA,2)*
    20122017                             evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*12/(a-5)/(a-6)/(a-7);
    20132018              else     aLim+=pow(totMass-mAlph-mAlph-GSResAA,2)*
    20142019                             evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*12/(a-5)/(a-6)/(a-7);
    2015                                  }
     2020            }
    20162021            G4double r = aLim*G4UniformRand();
    20172022#ifdef pdebug
    2018                                  G4cout<<"G4QN::EB:a, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
     2023            G4cout<<"G4QN::EB:a, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
    20192024                  <<G4endl;
    20202025#endif
     
    20222027            if(!aLim) three=false;
    20232028            else if(r>sLim)
    2024                           {
     2029            {
    20252030              eMass = mAlph;
    20262031              dbQPDG= AAQPDG;
     
    20282033              rQPDG = aaQPDG;
    20292034#ifdef pdebug
    2030                                    G4cout<<"G4QNucleus::EvaporateBary: A+A"<<G4endl;
    2031 #endif
    2032                           }
     2035              G4cout<<"G4QNucleus::EvaporateBary: A+A"<<G4endl;
     2036#endif
     2037            }
    20332038            else if(zLim<sLim&&r>zLim&&r<=sLim)
    2034                           {
     2039            {
    20352040              eMass = mLamb;
    20362041              dbQPDG= LAQPDG;
     
    20382043              rQPDG = laQPDG;
    20392044#ifdef pdebug
    2040                                    G4cout<<"G4QNucleus::EvaporateBary: A+L"<<G4endl;
    2041 #endif
    2042                           }
     2045              G4cout<<"G4QNucleus::EvaporateBary: A+L"<<G4endl;
     2046#endif
     2047            }
    20432048            else if(nLim<zLim&&r>nLim&&r<=zLim)
    2044                    {
     2049            {
    20452050              eMass = mProt;
    20462051              dbQPDG= PAQPDG;
     
    20482053              rQPDG = paQPDG;
    20492054#ifdef pdebug
    2050                                    G4cout<<"G4QNucleus::EvaporateBary: A+P"<<G4endl;
    2051 #endif
    2052                           }
     2055              G4cout<<"G4QNucleus::EvaporateBary: A+P"<<G4endl;
     2056#endif
     2057            }
    20532058            else if(r<=nLim)
    2054                    {
     2059            {
    20552060              eMass = mNeut;
    20562061              dbQPDG= NAQPDG;
     
    20582063              rQPDG = naQPDG;
    20592064#ifdef pdebug
    2060                                    G4cout<<"G4QNucleus::EvaporateBary: A+N"<<G4endl;
    2061 #endif
    2062                 }
     2065              G4cout<<"G4QNucleus::EvaporateBary: A+N"<<G4endl;
     2066#endif
     2067            }
    20632068            else three=false;
    2064                         }
     2069          }
    20652070          else three=false;
    20662071          if(rMass<1600.)
    2067                         {
     2072          {
    20682073            if     (rQPDG==pQPDG)rMass=mProt;
    20692074            else if(rQPDG==nQPDG)rMass=mNeut;
    20702075            else if(rQPDG==lQPDG)rMass=mLamb;
    2071                         }
     2076          }
    20722077#ifdef pdebug
    20732078          G4cout<<"G4QNucleus::EvaporateBary:evaBar="<<eMass<<bQPDG<<",resN="<<rMass<<rQPDG
    20742079                <<",secB="<<fMass<<",three="<<three<<G4endl;
    20752080#endif
    2076                }
    2077              }
     2081        }
     2082      }
    20782083      else // ==============> Just decay in a baryon and a residual (to avoid gamma-decay)
    2079              { //@@ Take into account Coulomb Barier Penetration Probability (?? - Emergency)
     2084      { //@@ Take into account Coulomb Barier Penetration Probability (?? - Emergency)
    20802085        G4double nLim=0.;
    20812086        if(nFlag&&mNeut+GSResNn<totMass)
     
    20832088          G4double ken=totMass-mNeut-GSResNn;
    20842089          nLim+=N*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
    2085                       }
     2090        }
    20862091        G4double zLim=nLim;
    20872092        if(pFlag&&mProt+PBarr+GSResNp<totMass)
     
    20902095          if(barf) ken-=PBarr;
    20912096          zLim+=Z*CoulBarPenProb(PBarr,ken,1,1)*sqrt(ken);
    2092                       }
     2097        }
    20932098        G4double sLim=zLim;
    20942099        if(lFlag&&mLamb+GSResNl<totMass)
     
    20962101          G4double ken=totMass-mLamb-GSResNl;
    20972102          sLim+=S*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
    2098                       }
     2103        }
    20992104        G4double aLim=sLim;
    21002105        if(evalph&&aFlag&&mAlph+GSResNa<totMass)
     
    21042109          aLim+=CoulBarPenProb(ABarr,ken,2,4)*sqrt(ken)*evalph*Z*(Z-1)*N*(N-1)
    21052110                *6/a1/(a-2)/(a-3);
    2106                       }
     2111        }
    21072112        G4double r = aLim*G4UniformRand();
    21082113#ifdef pdebug
     
    21112116#endif
    21122117        if     (aFlag&&r>sLim)
    2113                       {
     2118        {
    21142119          bQPDG=aQPDG;
    21152120          eMass=mAlph;
    21162121          rQPDG=AQPDG;
    21172122          rMass=GSResNa;
    2118                       }
     2123        }
    21192124        else if(lFlag&&r>=zLim&&r<=sLim&&zLim<sLim)
    2120                       {
     2125        {
    21212126          bQPDG=lQPDG;
    21222127          eMass=mLamb;
    21232128          rQPDG=LQPDG;
    21242129          rMass=GSResNl;
    2125                       }
     2130        }
    21262131        else if(nFlag&&r>=nLim&&r<=zLim&&nLim<zLim)
    2127                {
     2132        {
    21282133          bQPDG=pQPDG;
    21292134          eMass=mProt;
    21302135          rQPDG=PQPDG;
    21312136          rMass=GSResNp;
    2132                       }
     2137        }
    21332138        else if(pFlag&&r<nLim)
    2134                {
     2139        {
    21352140          bQPDG=nQPDG;
    21362141          eMass=mNeut;
    21372142          rQPDG=NQPDG;
    21382143          rMass=GSResNn;
    2139             }
     2144        }
    21402145        else
    2141                {
     2146        {
    21422147#ifdef pdebug
    21432148          G4cout<<"G4QNucleus::EvaporateBaryon: Photon #2-B#, dM="<<totMass-GSMass<<G4endl;
     
    21472152          eMass=0.;
    21482153          rMass=GSMass;
    2149                }
     2154        }
    21502155#ifdef pdebug
    21512156        G4cout<<"G4QNucl::EvaporateBaryon: b="<<eMass<<bQPDG<<",r="<<rMass<<rQPDG<<G4endl;
     
    21532158      }
    21542159      if(three)           // Decay in two baryons + Residual Nucleus
    2155              {
     2160      {
    21562161#ifdef pdebug
    21572162          G4cout<<"G4QNucl::EvaporateBaryon:Decay in 3 particles"<<G4endl;
     
    21602165        h2mom=G4LorentzVector(0.,0.,0.,rMass);
    21612166        h3mom=G4LorentzVector(0.,0.,0.,fMass);
    2162                if(!DecayIn3(h1mom,h2mom,h3mom))
     2167        if(!DecayIn3(h1mom,h2mom,h3mom))
    21632168        {
    21642169#ifdef ppdebug
    21652170          G4cout<<"*G4QNucl::EvaporateBaryon:Decay M="<<totMass<<",b="<<eMass<<bQPDG
    2166                         <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
     2171          <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
    21672172#endif
    21682173          return false;
    2169                }
     2174        }
    21702175        h1mom+=h3mom;
    21712176        bQPDG=dbQPDG;
    2172              }
     2177      }
    21732178      else
    2174              {
     2179      {
    21752180        if(eMass+rMass<totMass&&cntr<cntm)
    21762181        {
     
    21802185#endif
    21812186          if(rMass<1600.)
    2182                         {
     2187          {
    21832188            if     (rQPDG==pQPDG)rMass=mProt;
    21842189            else if(rQPDG==nQPDG)rMass=mNeut;
    21852190            else if(rQPDG==lQPDG)rMass=mLamb;
    2186                         }
     2191          }
    21872192          h1mom=G4LorentzVector(0.,0.,0.,eMass);
    21882193          h2mom=G4LorentzVector(0.,0.,0.,rMass);
    21892194        }
    21902195        else if(totMass>mNeut+GSResNn)               // Neutron if 2-Decay failed
    2191                {
    2192 #ifdef pdebug
    2193                         G4cout<<"G4QNucl::EvaporateBaryon: Neutron , dM="<<totMass-GSResNn-mNeut<<G4endl;
     2196        {
     2197#ifdef pdebug
     2198          G4cout<<"G4QNucl::EvaporateBaryon: Neutron , dM="<<totMass-GSResNn-mNeut<<G4endl;
    21942199#endif
    21952200          bQPDG=nQPDG;
     
    21972202          h1mom=G4LorentzVector(0.,0.,0.,mNeut);
    21982203          h2mom=G4LorentzVector(0.,0.,0.,GSResNn);     
    2199                }
     2204        }
    22002205        else if(totMass>mProt+PBarr+GSResNp)               // Proton if 2-Decay failed
    2201                {
    2202 #ifdef pdebug
    2203                         G4cout<<"G4QNucl::EvaporateBaryon: Proton , dM="<<totMass-GSResNp-mProt<<G4endl;
     2206        {
     2207#ifdef pdebug
     2208          G4cout<<"G4QNucl::EvaporateBaryon: Proton , dM="<<totMass-GSResNp-mProt<<G4endl;
    22042209#endif
    22052210          bQPDG=pQPDG;
     
    22072212          h1mom=G4LorentzVector(0.,0.,0.,mProt);
    22082213          h2mom=G4LorentzVector(0.,0.,0.,GSResNp);     
    2209                }
     2214        }
    22102215        else if(totMass>mAlph+ABarr+GSResNa)               // Alpha if 2-Decay failed
    2211                {
    2212 #ifdef pdebug
    2213                         G4cout<<"G4QNucl::EvaporateBaryon: Alpha , dM="<<totMass-GSResNa-mAlph<<G4endl;
     2216        {
     2217#ifdef pdebug
     2218          G4cout<<"G4QNucl::EvaporateBaryon: Alpha , dM="<<totMass-GSResNa-mAlph<<G4endl;
    22142219#endif
    22152220          bQPDG=aQPDG;
     
    22172222          h1mom=G4LorentzVector(0.,0.,0.,mAlph);
    22182223          h2mom=G4LorentzVector(0.,0.,0.,GSResNa);     
    2219                }
     2224        }
    22202225        else if(totMass>GSMass)               // Photon if 2-Decay failed
    2221                {
    2222 #ifdef pdebug
    2223                         G4cout<<"G4QNucl::EvaporateBaryon:Photon ### 2 ###, dM="<<totMass-GSMass<<G4endl;
     2226        {
     2227#ifdef pdebug
     2228          G4cout<<"G4QNucl::EvaporateBaryon:Photon ### 2 ###, dM="<<totMass-GSMass<<G4endl;
    22242229#endif
    22252230          bQPDG=gQPDG;
     
    22272232          h1mom=G4LorentzVector(0.,0.,0.,0.);
    22282233          h2mom=G4LorentzVector(0.,0.,0.,GSMass);     
    2229                }
     2234        }
    22302235        else
    22312236        {
    2232                  G4cerr<<"***G4QNucl::EvaporateBaryon: Cann't evaporate even gamma (1)"<<G4endl;
     2237          G4cerr<<"***G4QNucl::EvaporateBaryon: Cann't evaporate even gamma (1)"<<G4endl;
    22332238          return false;
    22342239        }
    22352240      }
    2236            }
     2241    }
    22372242    else // ==> Decay in 3 Baryons + Residual is impossible at this point
    2238            {
    2239              if(secB)                        // Decay in 2Baryons(2a,a+bary)+ResidN is possible
    2240              //if(2>3)
    2241              {
     2243    {
     2244      if(secB)                        // Decay in 2Baryons(2a,a+bary)+ResidN is possible
     2245      //if(2>3)
     2246      {
    22422247#ifdef pdebug
    22432248        G4cout<<"G4QNucleus::EvaporateBaryon: Decay in 2 baryons"<<G4endl;
     
    22462251        //@@ Coulomb Barrier penetration can be added
    22472252        G4double alp=0.;
    2248                       if(aSecF)alp=evalph*Z*(Z-1)*N*(N-1)*10/(a-2)/(a-3)/(a-4);
     2253        if(aSecF)alp=evalph*Z*(Z-1)*N*(N-1)*10/(a-2)/(a-3)/(a-4);
    22492254        G4double  nnLim=0.;
    22502255        if(nnFlag&&totMass>mNeut+mNeut+GSResNN)
     
    22522257        G4double  nzLim=nnLim;
    22532258        if(npFlag&&totMass>mNeut+mProt+PBarr+GSResNP)
    2254                       {
     2259        {
    22552260          if(barf) nzLim+=2*N*Z*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
    22562261          else     nzLim+=2*N*Z*pow(totMass-mNeut-mProt-GSResNP,2);
    2257                       }
     2262        }
    22582263        G4double  zzLim=nzLim;
    22592264        if(ppFlag&&totMass>mProt+mProt+SPPBarr+GSResPP)
    2260                       {
     2265        {
    22612266          if(barf) zzLim+=Z*(Z-1)*pow(totMass-mProt-mProt-SPPBarr-GSResPP,2);
    22622267          else     zzLim+=Z*(Z-1)*pow(totMass-mProt-mProt-GSResPP,2);
    2263                       }
     2268        }
    22642269        G4double  nlLim=zzLim;
    22652270        if(nlFlag&&totMass>mNeut+mLamb+GSResNL)
     
    22672272        G4double  zlLim=nlLim;
    22682273        if(plFlag&&totMass>mProt+PBarr+mLamb+GSResPL)
    2269                       {
     2274        {
    22702275          if(barf) zlLim+=2*Z*S*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
    22712276          else     zlLim+=2*Z*S*pow(totMass-mProt-mLamb-GSResPL,2);
    2272                       }
     2277        }
    22732278        G4double  llLim=zlLim;
    22742279        if(llFlag&&totMass>mLamb+mLamb+GSResLL)
     
    22762281        G4double  naLim=llLim;
    22772282        if(naFlag&&totMass>mNeut+mAlph+ABarr+GSResNA)
    2278                       {
     2283        {
    22792284          if(barf) naLim+=(N-3)*alp*pow(totMass-mNeut-mAlph-ABarr-GSResNA,2);
    22802285          else     naLim+=(N-3)*alp*pow(totMass-mNeut-mAlph-GSResNA,2);
    2281                       }
     2286        }
    22822287        G4double  zaLim=naLim;
    22832288        if(paFlag&&totMass>mProt+SAPBarr+mAlph+GSResPA)
    2284                       {
     2289        {
    22852290          if(barf) zaLim+=(Z-3)*alp*pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2);
    22862291          else     zaLim+=(Z-3)*alp*pow(totMass-mProt-mAlph-GSResPA,2);
    2287                       }
     2292        }
    22882293        G4double  laLim=zaLim;
    22892294        if(laFlag&&totMass>mLamb+mAlph+ABarr+GSResLA)
    2290                       {
     2295        {
    22912296          if(barf) laLim+=S*alp*pow(totMass-mLamb-mAlph-ABarr-GSResLA,2);
    22922297          else     laLim+=S*alp*pow(totMass-mLamb-mAlph-GSResLA,2);
    2293                       }
     2298        }
    22942299        G4double  aaLim=laLim;
    22952300        if(evalph&&aaFlag&&totMass>mAlph+mAlph+SAABarr+GSResAA)
    2296                       {
     2301        {
    22972302          if(barf) aaLim+=alp*pow(totMass-mAlph-mAlph-SAABarr-GSResAA,2)*
    22982303                          evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*7/(a-5)/(a-6)/(a-7);
    22992304          else     aaLim+=alp*pow(totMass-mAlph-mAlph-GSResAA,2)*
    23002305                          evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*7/(a-5)/(a-6)/(a-7);
    2301                       }
     2306        }
    23022307        G4double r = aaLim*G4UniformRand();
    23032308        if     (aaLim&&laLim<r)
    2304                {
     2309        {
    23052310          dbQPDG= AAQPDG;
    23062311          eMass=mAlph;
     
    23092314          rMass=GSResAA;
    23102315#ifdef pdebug
    2311                         G4cout<<"G4QNuc::EvapBaryon: A+A, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2312 #endif
    2313                }
     2316          G4cout<<"G4QNuc::EvapBaryon: A+A, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2317#endif
     2318        }
    23142319        else if(aaLim&&zaLim<r&&r<laLim)
    2315                {
     2320        {
    23162321          dbQPDG= LAQPDG;
    23172322          eMass=mAlph;
     
    23202325          rMass=GSResLA;
    23212326#ifdef pdebug
    2322                         G4cout<<"G4QNuc::EvapBaryon: A+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2323 #endif
    2324                }
     2327          G4cout<<"G4QNuc::EvapBaryon: A+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2328#endif
     2329        }
    23252330        else if(aaLim&&naLim<r&&r<zaLim)
    2326                {
     2331        {
    23272332          dbQPDG= PAQPDG;
    23282333          eMass=mAlph;
     
    23312336          rMass=GSResPA;
    23322337#ifdef pdebug
    2333                         G4cout<<"G4QNuc::EvapBaryon: A+P, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2334 #endif
    2335                }
     2338          G4cout<<"G4QNuc::EvapBaryon: A+P, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2339#endif
     2340        }
    23362341        else if(aaLim&&llLim<r&&r<naLim)
    2337                {
     2342        {
    23382343          dbQPDG= NAQPDG;
    23392344          eMass=mAlph;
     
    23422347          rMass=GSResNA;
    23432348#ifdef pdebug
    2344                         G4cout<<"G4QNuc::EvapBaryon: A+N, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2345 #endif
    2346                }
     2349          G4cout<<"G4QNuc::EvapBaryon: A+N, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2350#endif
     2351        }
    23472352        else if(aaLim&&zlLim<r&&r<llLim)
    2348                {
     2353        {
    23492354          dbQPDG= LLQPDG;
    23502355          eMass=mLamb;
     
    23532358          rMass=GSResLL;
    23542359#ifdef pdebug
    2355                         G4cout<<"G4QNuc::EvapBaryon: L+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2356 #endif
    2357                }
     2360          G4cout<<"G4QNuc::EvapBaryon: L+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2361#endif
     2362        }
    23582363        else if(aaLim&&nlLim<r&&r<zlLim)
    2359                {
     2364        {
    23602365          dbQPDG= PLQPDG;
    23612366          eMass=mLamb;
     
    23642369          rMass=GSResPL;
    23652370#ifdef pdebug
    2366                         G4cout<<"G4QNuc::EvapBaryon: L+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2367 #endif
    2368                }
     2371          G4cout<<"G4QNuc::EvapBaryon: L+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2372#endif
     2373        }
    23692374        else if(aaLim&&zzLim<r&&r<nlLim)
    2370                {
     2375        {
    23712376          dbQPDG= NLQPDG;
    23722377          eMass=mLamb;
     
    23752380          rMass=GSResNL;
    23762381#ifdef pdebug
    2377                         G4cout<<"G4QNuc::EvapBaryon: L+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2378 #endif
    2379 
    2380                }
     2382          G4cout<<"G4QNuc::EvapBaryon: L+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2383#endif
     2384
     2385        }
    23812386        else if(aaLim&&nzLim<r&&r<zzLim)
    2382                {
     2387        {
    23832388          dbQPDG= PPQPDG;
    23842389          eMass=mProt;
     
    23872392          rMass=GSResPP;
    23882393#ifdef pdebug
    2389                         G4cout<<"G4QNuc::EvapBaryon: p+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2390 #endif
    2391                }
     2394          G4cout<<"G4QNuc::EvapBaryon: p+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2395#endif
     2396        }
    23922397        else if(aaLim&&nnLim<r&&r<nzLim)
    2393                {
     2398        {
    23942399          dbQPDG= NPQPDG;
    23952400          eMass=mNeut;
     
    23982403          rMass=GSResNP;
    23992404#ifdef pdebug
    2400                         G4cout<<"G4QNuc::EvapBaryon: n+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2401 #endif
    2402                }
     2405          G4cout<<"G4QNuc::EvapBaryon: n+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2406#endif
     2407        }
    24032408        else if(aaLim&&r<nnLim)
    2404                {
     2409        {
    24052410          dbQPDG= NNQPDG;
    24062411          eMass=mNeut;
     
    24092414          rMass=GSResNN;
    24102415#ifdef pdebug
    2411                         G4cout<<"G4QNuc::EvapBaryon: n+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
    2412 #endif
    2413             }
     2416          G4cout<<"G4QNuc::EvapBaryon: n+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
     2417#endif
     2418        }
    24142419        //Two particle decay only possible (not frequent event!)
    24152420        else if(nFlag)
    2416                       {
     2421        {
    24172422#ifdef pdebug
    24182423          G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in neutron ###"<<G4endl;
     
    24232428          eMass=mNeut;
    24242429          rMass=GSResNn;
    2425                       }
     2430        }
    24262431        else if(pFlag)
    2427                       {
     2432        {
    24282433#ifdef pdebug
    24292434          G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in proton ###"<<G4endl;
     
    24342439          eMass=mProt;
    24352440          rMass=GSResNp;
    2436                       }
     2441        }
    24372442        else if(aFlag)
    2438                       {
     2443        {
    24392444#ifdef pdebug
    24402445          G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in alpha ###"<<G4endl;
     
    24452450          eMass=mAlph;
    24462451          rMass=GSResNa;
    2447                       }
     2452        }
    24482453        else if(lFlag)
    2449                       {
     2454        {
    24502455#ifdef pdebug
    24512456          G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in Lambda ###"<<G4endl;
     
    24562461          eMass=mLamb;
    24572462          rMass=GSResNl;
    2458                       }
     2463        }
    24592464        else
    2460                       {
     2465        {
    24612466#ifdef pdebug
    24622467          G4cout<<"G4QNuc::EvaporBaryon: Photon ### 3-Big ###,dM="<<totMass-GSMass<<G4endl;
     
    24672472          eMass=0.;
    24682473          rMass=GSMass;
    2469                       }
     2474        }
    24702475        if(tpd)
    24712476        {
     
    24732478          h2mom=G4LorentzVector(0.,0.,0.,rMass);
    24742479          h3mom=G4LorentzVector(0.,0.,0.,fMass);
    2475                  if(!DecayIn3(h1mom,h2mom,h3mom))
     2480          if(!DecayIn3(h1mom,h2mom,h3mom))
    24762481          {
    24772482#ifdef pdebug
    24782483            G4cout<<"*G4QNucl::EvaporateBaryon:Decay M="<<totMass<<",b="<<eMass<<bQPDG
    2479                           <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
     2484            <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
    24802485#endif
    24812486            return false;
    2482                  }
     2487          }
    24832488          h1mom+=h3mom;
    24842489          bQPDG=dbQPDG;
     
    24862491          G4double sma=h1mom.m();
    24872492          G4double dma=sma-eMass-fMass;
    2488                         G4cout<<"G4QNuc::EvapBar:s="<<sma<<",e="<<eMass<<",f="<<fMass<<",d="<<dma<<",rM="
     2493          G4cout<<"G4QNuc::EvapBar:s="<<sma<<",e="<<eMass<<",f="<<fMass<<",d="<<dma<<",rM="
    24892494                <<rMass<<G4endl;
    24902495#endif
    2491                       }
     2496        }
    24922497        else
    2493                       {
     2498        {
    24942499          if(rMass<1600.)
    2495                         {
     2500          {
    24962501            if     (rQPDG==pQPDG)rMass=mProt;
    24972502            else if(rQPDG==nQPDG)rMass=mNeut;
    24982503            else if(rQPDG==lQPDG)rMass=mLamb;
    2499                         }
     2504          }
    25002505          h1mom=G4LorentzVector(0.,0.,0.,eMass);
    25012506          h2mom=G4LorentzVector(0.,0.,0.,rMass);     
    2502                  if(!DecayIn2(h1mom,h2mom))
     2507          if(!DecayIn2(h1mom,h2mom))
    25032508          {
    25042509#ifdef pdebug
     
    25072512#endif
    25082513            return false;
    2509                  }
     2514          }
    25102515          h1->SetQPDG(bQPDG);
    25112516          h2->SetQPDG(rQPDG);
     
    25142519#ifdef pdebug
    25152520          G4cout<<"G4QNuc::EvapBaryon: Emergency decay is done for b="<<bQPDG<<h1->GetQC()
    2516                        <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
     2521                <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
    25172522#endif
    25182523          return true;
    2519                       }
    2520              }
     2524        }
     2525      }
    25212526      else                                     // Only decay in Baryon+Residual is possible
    25222527      {
     
    25302535          G4double ken=totMass-mNeut-GSResNn;
    25312536          nLim+=N*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
    2532                       }
     2537        }
    25332538        G4double zLim=nLim;
    25342539        if(pFlag&&mProt+PBarr+GSResNp<totMass)
     
    25372542          if(barf) ken-=PBarr;
    25382543          zLim+=Z*CoulBarPenProb(PBarr,ken,1,1)*sqrt(ken);
    2539                       }
     2544        }
    25402545        G4double sLim=zLim;
    25412546        if(lFlag&&mLamb+GSResNl<totMass)
     
    25432548          G4double ken=totMass-mLamb-GSResNl;
    25442549          sLim+=S*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
    2545                       }
     2550        }
    25462551        G4double aLim=sLim;
    2547                       if(aFlag&&mAlph+GSResNa+ABarr<totMass)
     2552        if(aFlag&&mAlph+GSResNa+ABarr<totMass)
    25482553        {
    25492554          G4double ken=totMass-mAlph-GSResNa;
     
    25552560                <<CoulBarPenProb(ABarr,ken,2,4)<<G4endl;
    25562561#endif
    2557                       }
     2562        }
    25582563        G4double r = aLim*G4UniformRand();
    25592564#ifdef pdebug
     
    25622567#endif
    25632568        if     (aFlag&&r>sLim)
    2564                {
     2569        {
    25652570          bQPDG=aQPDG;
    25662571          eMass=mAlph;
     
    25702575          G4cout<<"G4QNucleus::EvaporateBaryon: Decay in A + rA="<<GSResNa+mAlph<<G4endl;
    25712576#endif
    2572                }
     2577        }
    25732578        else if(lFlag&&r>zLim&&r<sLim)
    2574                {
     2579        {
    25752580          bQPDG=lQPDG;
    25762581          eMass=mLamb;
     
    25802585          G4cout<<"G4QNucleus::EvaporateBaryon: Decay in L + rA="<<GSResNl+mLamb<<G4endl;
    25812586#endif
    2582                }
     2587        }
    25832588        else if(pFlag&&r>nLim&&r<zLim)
    2584                {
     2589        {
    25852590          bQPDG=pQPDG;
    25862591          eMass=mProt;
     
    25902595          G4cout<<"G4QNucleus::EvaporateBaryon: Decay in P + rA="<<GSResNp+mProt<<G4endl;
    25912596#endif
    2592                }
     2597        }
    25932598        else if(nFlag&&r<nLim)
    2594                {
     2599        {
    25952600          bQPDG=nQPDG;
    25962601          eMass=mNeut;
     
    26002605          G4cout<<"G4QNucleus::EvaporateBaryon: Decay in N + rA="<<GSResNn+mNeut<<G4endl;
    26012606#endif
    2602             }
     2607        }
    26032608        else if(mProt+GSResNp<totMass)
    2604                {
     2609        {
    26052610#ifdef pdebug
    26062611          G4cout<<"G4QNucl::EvapBar: Emergency Proton, dM="<<totMass-GSResNp-mProt<<G4endl;
     
    26102615          eMass=mProt;
    26112616          rMass=GSResNp;
    2612                }
     2617        }
    26132618        else if(mAlph+GSResNa<totMass)
    2614                {
     2619        {
    26152620#ifdef pdebug
    26162621          G4cout<<"G4QNucl::EvapBar: Emergency Alpha, dM="<<totMass-GSResNa-mAlph<<G4endl;
     
    26202625          eMass=mAlph;
    26212626          rMass=GSResNa;
    2622                }
     2627        }
    26232628        else
    2624                {
     2629        {
    26252630#ifdef pdebug
    26262631          G4cout<<"G4QNuc::EvapBaryon: Photon ### 4-Big ###, dM="<<totMass-GSMass<<G4endl;
     
    26302635          eMass=0.;
    26312636          rMass=GSMass;
    2632                }
     2637        }
    26332638        if(rMass<1600.)
    2634                       {
     2639        {
    26352640          if     (rQPDG==pQPDG)rMass=mProt;
    26362641          else if(rQPDG==nQPDG)rMass=mNeut;
    26372642          else if(rQPDG==lQPDG)rMass=mLamb;
    2638                }
     2643        }
    26392644        h1mom=G4LorentzVector(0.,0.,0.,eMass);
    26402645        h2mom=G4LorentzVector(0.,0.,0.,rMass);     
    26412646      }
    2642            }
    2643            if(!DecayIn2(h1mom,h2mom))
     2647    }
     2648    if(!DecayIn2(h1mom,h2mom))
    26442649    {
    26452650#ifdef pdebug
    26462651      G4cout<<"*G4QNucleus::EvaporateBaryon: Decay M="<<totMass<<",b="<<bQPDG<<h1->GetQC()
    2647                     <<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl;
     2652      <<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl;
    26482653#endif
    26492654      return false;
    2650            }
    2651 #ifdef pdebug
    2652            G4cout<<"G4QN::EvaB: **RESULT** b="<<bQPDG<<h1mom<<", r="<<rQPDG<<h2mom<<G4endl;
     2655    }
     2656#ifdef pdebug
     2657    G4cout<<"G4QN::EvaB: **RESULT** b="<<bQPDG<<h1mom<<", r="<<rQPDG<<h2mom<<G4endl;
    26532658#endif
    26542659    h1->SetQPDG(bQPDG);
     
    26582663#ifdef pdebug
    26592664    G4cout<<"G4QNucleus::EvaporateBaryon: Evaporation is done for b="<<bQPDG<<h1->GetQC()
    2660               <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
    2661 #endif
    2662            return true;
     2665       <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
     2666#endif
     2667    return true;
    26632668  }
    26642669  else if(a==1)
     
    27072712  {
    27082713    j--;
    2709            i++;
    2710            v*=j*f/i;
     2714    i++;
     2715    v*=j*f/i;
    27112716    s+=v;
    27122717  }
     
    27242729  static G4int mesonPDG[nOfMesons]  =  {221,111,211,-211,311,321,-311,-321,331,    //  0- 8
    27252730  // Vector resonances   (1):           omega,Rh0,Rh+,Rho-,K0*,K+*,AK0*,AK-*,Phi
    2726                                                                                                                                                                                                                                                                                                                                 223,113,213,-213,313,323,-313,-323,333,    //  9-18
     2731                                        223,113,213,-213,313,323,-313,-323,333,    //  9-18
    27272732  // Tensor D-resonances (2):           f2 ,a20,a2+, a2-,K20,K2+,AK20,AK2-,f2'
    2728                                                                                                                                                                                                                                                                                                                                 225,115,215,-215,315,325,-315,-325,335,    // 19-27
     2733                                        225,115,215,-215,315,325,-315,-325,335,    // 19-27
    27292734  // Tensor F-resonances (3):           om3,ro3,r3+,rh3-,K30,K3+,AK30,AK3-,Phi3
    27302735                                        227,117,217,-217,317,327,-317,-327,337,    // 28-35
    27312736  // Tensor G-resonances (4):           f4 ,a40,a4+, a4-,K40,K4+,AK40,AK4-,f4'
    2732                                                                                                 229,119,219,-219,319,329,-319,-329,339};   // 36-44
     2737                                        229,119,219,-219,319,329,-319,-329,339};   // 36-44
    27332738  // Baryon octet      (1/2):          n  , an  , p  , ap  ,lamb,alamb, sig-,asig-
    27342739  static G4int baryonPDG[nOfBaryons]={2112,-2112,2212,-2212,3122,-3122,3112,-3112, // 45-52
    2735                 // Hyperon octet     (1/2):         sig0,asig0,sig+,asig+,ksi-,aksi-,ksi0,aksi0
    2736                                                                                                                                                                                                                                                                                                                 3212,-3212,3222,-3222,3312,-3312,3322,-3322, // 53-60
     2740  // Hyperon octet     (1/2):         sig0,asig0,sig+,asig+,ksi-,aksi-,ksi0,aksi0
     2741                                      3212,-3212,3222,-3222,3312,-3312,3322,-3322, // 53-60
    27372742  // Baryon decuplet   (3/2):   del-,adel-,del0,adel0,del+,adel+,dl++,adl++,sis-,asis-
    2738                                                                                                                                                                                                                                                                 1114,-1114,2114,-2114,2214,-2214,2224,-2224,3114,-3114,//70
    2739                 //                            sis0,asis0,sis+,asis+,kss-,akss-,kss0,akss0,omeg,aomeg
    2740                                                                                                                                                                                                                                                                 3214,-3214,3224,-3224,3314,-3314,3324,-3324,3334,-3334,//80
     2743                                1114,-1114,2114,-2114,2214,-2214,2224,-2224,3114,-3114,//70
     2744  //                            sis0,asis0,sis+,asis+,kss-,akss-,kss0,akss0,omeg,aomeg
     2745                                3214,-3214,3224,-3224,3314,-3314,3324,-3324,3334,-3334,//80
    27412746  // Baryon octet      (5/2):         n5/2,an5/2,p5/2,ap5/2,l5/2,al5/2,si5-,asi5-
    2742                                                                                                                                                                                                                                                                                                                 2116,-2116,2216,-2216,3126,-3126,3116,-3116, // 81-88
    2743                 //                                  si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50
     2747                                      2116,-2116,2216,-2216,3126,-3126,3116,-3116, // 81-88
     2748  //                                  si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50
    27442749                                      3216,-3216,3226,-3226,3316,-3316,3326,-3326, // 89-96
    27452750  // Baryon decuplet   (7/2):  dl5-,adl5-,dl50,adl50,dl5+,adl5+,d5++,ad5++,si5-,asi5-
    2746                                                                                                                                                                                                                                                 1118,-1118,2118,-2118,2218,-2218,2228,-2228,3118,-3118, //106
    2747                 //                          si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50,ome5,aome5
    2748                                                                                                                                                                                                                                                 3218,-3218,3228,-3228,3318,-3318,3328,-3328,3338,-3338};//116
     2751                              1118,-1118,2118,-2118,2218,-2218,2228,-2228,3118,-3118, //106
     2752  //                          si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50,ome5,aome5
     2753                              3218,-3218,3228,-3228,3318,-3318,3328,-3328,3338,-3338};//116
    27492754  G4int i=0;
    27502755#ifdef debug
     
    28372842    //static G4int mesonPDG[45]  =  {221,111,211,-211,311,321,-311,-321,331,       //  0- 8
    28382843    // Vector resonances   (1):    omega,Rh0,Rh+,Rho-,K0*,K+*,AK0*,AK-*,Phi
    2839                   //                                                                                                                                                                                                                                    223,113,213,-213,313,323,-313,-323,333,        //  9-18
     2844    //                              223,113,213,-213,313,323,-313,-323,333,        //  9-18
    28402845    // Tensor D-resonances (2):     f2 ,a20,a2+, a2-,K20,K2+,AK20,AK2-,f2'
    2841                   //                                                                                                                                                                                                                                    225,115,215,-215,315,325,-315,-325,335,        // 19-27
     2846    //                              225,115,215,-215,315,325,-315,-325,335,        // 19-27
    28422847    // Tensor F-resonances (3):     om3,ro3,r3+,rh3-,K30,K3+,AK30,AK3-,Phi3
    28432848    //                              227,117,217,-217,317,327,-317,-327,337,        // 28-35
    28442849    // Tensor G-resonances (4):     f4 ,a40,a4+, a4-,K40,K4+,AK40,AK4-,f4'
    2845                   //                                                                    229,119,219,-219,319,329,-319,-329,339};       // 36-44
     2850    //                              229,119,219,-219,319,329,-319,-329,339};       // 36-44
    28462851    // Baryon octet       (1/2):    n  , an  , p  , ap  ,lamb,alamb, sig-,asig-
    28472852    //static G4int baryonPDG[72]={2112,-2112,2212,-2212,3122,-3122,3112,-3112,     // 45-52
    2848                   // Hyperon octet     (1/2): sig0,asig0,sig+,asig+,ksi-,aksi-,ksi0,aksi0
    2849                   //                                                                                                                                                                                                                            3212,-3212,3222,-3222,3312,-3312,3322,-3322,     // 53-60
     2853    // Hyperon octet     (1/2): sig0,asig0,sig+,asig+,ksi-,aksi-,ksi0,aksi0
     2854    //                            3212,-3212,3222,-3222,3312,-3312,3322,-3322,     // 53-60
    28502855    // Baryon decuplet   (3/2): del-,adel-,del0,adel0,del+,adel+,dl++,adl++,sis-,asis-
    2851                   //                                                                                                                                                                                                            1114,-1114,2114,-2114,2214,-2214,2224,-2224,3114,-3114,//70
    2852                   //                          sis0,asis0,sis+,asis+,kss-,akss-,kss0,akss0,omeg,aomeg
    2853                   //                                                                                                                                                                                                            3214,-3214,3224,-3224,3314,-3314,3324,-3324,3334,-3334,//80
     2856    //                          1114,-1114,2114,-2114,2214,-2214,2224,-2224,3114,-3114,//70
     2857    //                          sis0,asis0,sis+,asis+,kss-,akss-,kss0,akss0,omeg,aomeg
     2858    //                          3214,-3214,3224,-3224,3314,-3314,3324,-3324,3334,-3334,//80
    28542859    // Baryon octet      (5/2): n5/2,an5/2,p5/2,ap5/2,l5/2,al5/2,si5-,asi5-
    2855                   //                                                                                                                                                                                                            2116,-2116,2216,-2216,3126,-3126,3116,-3116,       // 81-88
    2856                   //                          si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50
     2860    //                          2116,-2116,2216,-2216,3126,-3126,3116,-3116,       // 81-88
     2861    //                          si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50
    28572862    //                          3216,-3216,3226,-3226,3316,-3316,3326,-3326,       // 89-96
    28582863    // Baryon decuplet  (7/2): dl5-,adl5-,dl50,adl50,dl5+,adl5+,d5++,ad5++,si5-,asi5-
    2859                                 //                                                                                                                                                                                              1118,-1118,2118,-2118,2218,-2218,2228,-2228,3118,-3118, //106
    2860                   //                        si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50,ome5,aome5
    2861                                 //                                                                                                                                                                                3218,-3218,3228,-3228,3318,-3318,3328,-3328,3338,-3338};//116
     2864    //                        1118,-1118,2118,-2118,2218,-2218,2228,-2228,3118,-3118, //106
     2865    //                        si50,asi50,si5+,asi5+,ks5-,aks5-,ks50,aks50,ome5,aome5
     2866    //                        3218,-3218,3228,-3228,3318,-3318,3328,-3328,3338,-3338};//116
    28622867    // One should take into account, that #of mesons & baryons can be cut in G4Quas::HadrQE
    2863                                 //G4int nP= theWorld->GetQPEntries(); // A#of initialized particles in CHIPS World
    2864                                 ////@@ Make special parametyer to cut high resonances for nuclear fragmentation !!
    2865                                 //G4int          nMesons  = 45;
    2866                                 //if     (nP<34) nMesons  =  9;
    2867                                 //else if(nP<51) nMesons  = 18;
    2868                                 //else if(nP<65) nMesons  = 27;
    2869                                 //else if(nP<82) nMesons  = 36;
    2870                                 //G4int          nBaryons = 72;
    2871                                 //if     (nP<45) nBaryons = 16;
    2872                                 //else if(nP<59) nBaryons = 36;
    2873                                 //else if(nP<76) nBaryons = 52;
     2868    //G4int nP= theWorld->GetQPEntries(); // A#of initialized particles in CHIPS World
     2869    ////@@ Make special parametyer to cut high resonances for nuclear fragmentation !!
     2870    //G4int          nMesons  = 45;
     2871    //if     (nP<34) nMesons  =  9;
     2872    //else if(nP<51) nMesons  = 18;
     2873    //else if(nP<65) nMesons  = 27;
     2874    //else if(nP<82) nMesons  = 36;
     2875    //G4int          nBaryons = 72;
     2876    //if     (nP<45) nBaryons = 16;
     2877    //else if(nP<59) nBaryons = 36;
     2878    //else if(nP<76) nBaryons = 52;
    28742879    // **********************************************************************************
    28752880    //G4int cS    = curCand->GetStrangeness();
    2876            //if(piF&&gaF&&cPDG!=90000001&&cPDG!=90001000) // Both flags, in case of pi-first-int
    2877            //if(piF&&gaF&&cBN!=1&&cBN!=3) // Both flags, which is in case of pi-first-int
    2878            if(piF&&gaF&&cBN!=1)// @@ Should be both, which is in case of pi-first-interaction @@ ?
    2879            //if(piF&&gaF&&cBN!=1&&cBN!=4) // Should be both, in case of pi-first-interaction
     2881    //if(piF&&gaF&&cPDG!=90000001&&cPDG!=90001000) // Both flags, in case of pi-first-int
     2882    //if(piF&&gaF&&cBN!=1&&cBN!=3) // Both flags, which is in case of pi-first-int
     2883    if(piF&&gaF&&cBN!=1)// @@ Should be both, which is in case of pi-first-interaction @@ ?
     2884    //if(piF&&gaF&&cBN!=1&&cBN!=4) // Should be both, in case of pi-first-interaction
    28802885    {
    28812886      curCand->SetPreProbability(0.); 
    28822887      curCand->SetDenseProbability(0.);
    2883              curCand->SetPossibility(false);   
     2888      curCand->SetPossibility(false);   
    28842889#ifdef cldebug
    28852890      if(cPDG==90001001) G4cout<<"G4QNuc::PrepCand: piF/gaF fragments are blocked"<<G4endl;
     
    28872892    }
    28882893    // @@ in case of the Ksi or Omega- capture it can disturb the simulation
    2889            else if(cPDG<80000000&&(abs(cPDG)%10>4||cST>2))// @@ PreClosed HighSpin/Strange hadrons
     2894    else if(cPDG<80000000&&(abs(cPDG)%10>4||cST>2))// @@ PreClosed HighSpin/Strange hadrons
    28902895    {
    28912896      curCand->SetPreProbability(0.); 
    28922897      curCand->SetDenseProbability(0.);
    2893              curCand->SetPossibility(false);   
     2898      curCand->SetPossibility(false);   
    28942899    }
    28952900    else
    2896            {
     2901    {
    28972902      G4double tnM=GetQPDG().GetMass();          // Total mass of this nucleus
    28982903      if(cPDG>80000000&&cPDG!=90000000)          // ===> Cluster case
    2899              {
     2904      {
    29002905        G4int sc = cST;                          // "S" of the cluster
    29012906        G4int zc = curCand->GetCharge();         // "Z" of the cluster
     
    29062911        pos      = probVect[ac];                 // Cluster Probability NormalizationFactor
    29072912        if(ac<=maxClust&&pos>0.&&(pLV==zeroLV||intLV.m()>.00001+cM))
    2908                {
     2913        {
    29092914
    29102915#ifdef cldebug
     
    29132918          G4int dac=ac+ac;
    29142919          if(ac && (piF || gaF))                 // zc>=0
    2915                                                                                 {
     2920          {
    29162921            if     (piF&&!gaF&&zc+ac) pos*=(zc+ac)/ac;  // piF interaction (#of u-quarks)
    29172922            else if(gaF&&!piF&&zc+dac) pos*=(zc+dac)/ac; // gaF interaction (sum of Q_q^2)
     
    29212926          else if(ac==2&&pos>0.)dense=probVect[255]/pos;
    29222927#ifdef cldebug
    2923                  G4cout<<"G4QNucleus::PrepC: cPDG="<<cPDG<<",norm="<<pos<<",zc="<<zc<<",nc="<<nc
     2928          G4cout<<"G4QNucleus::PrepC: cPDG="<<cPDG<<",norm="<<pos<<",zc="<<zc<<",nc="<<nc
    29242929                <<",sc="<<sc<<",ac="<<ac<<",ze1="<<ze1<<",ne1="<<ne1<<",se1="<<se1<<G4endl;
    29252930          G4double mp=pos;
    29262931#endif
    29272932          if     (ac==1 && ae)                   // ae=0 protection (since here no /pos)
    2928                  {
     2933          {
    29292934            if     (zc) pos*=ze/ae;
    29302935            else if(nc) pos*=ne/ae;
     
    29362941#ifdef cldebug
    29372942            if(pos)
    2938                                  G4cout<<"G4QN::PrC:mp="<<mp<<",pos="<<pos<<",ae="<<ae
     2943            G4cout<<"G4QN::PrC:mp="<<mp<<",pos="<<pos<<",ae="<<ae
    29392944                  <<",Z="<<zc<<",N="<<nc<<",mac="<<mac<<G4endl;
    29402945            sZ+=pos*zc;
     
    29432948          }
    29442949          else if(ac==2)
    2945                  {
     2950          {
    29462951            if(ze<zc||ne<nc||se<sc) pos=0.;
    29472952            else if(aea)                         // Protection against aea=0.
    2948                           {
     2953            {
    29492954              if     (zc==2) pos*=ze*(ze-1)/aea;
    29502955              else if(nc==2) pos*=ne*(ne-1)/aea;
     
    29602965              //else if(sc==1&&nc==1) pos*=se*ne;
    29612966              else G4cout<<"***G4QNucl::PrepCand: z="<<zc<<", n="<<nc<<", s="<<sc<<G4endl;
    2962                             // Normalization for only not strange matter
    2963                           }
     2967              // Normalization for only not strange matter
     2968            }
    29642969            acm=2;
    29652970#ifdef cldebug
    29662971            if(pos)
    2967                           G4cout<<"G4QN::PrC:mp="<<mp<<",p="<<pos<<",A=2,(Z="<<zc<<",N="<<nc<<"),m="
     2972            G4cout<<"G4QN::PrC:mp="<<mp<<",p="<<pos<<",A=2,(Z="<<zc<<",N="<<nc<<"),m="
    29682973                  <<mac<<G4endl;
    29692974            sZ+=pos*zc;
     
    29722977          }
    29732978          else                                     // ac>2
    2974                  {
     2979          {
    29752980            if(acm<ac)                             // first time that big cluster
    2976                           {
     2981            {
    29772982              if(ac<ae1 && ac>0) comb*=(ae1-ac)/ac;
    29782983              acm=ac;
     
    29802985              cca=0;
    29812986              if(ac%2) mac=7;                      // @@Change it if cluster set is changed
    2982                             else     mac=8;                      // @@ It is not yet automatic
     2987              else     mac=8;                      // @@ It is not yet automatic
    29832988#ifdef cldebug
    29842989              G4cout<<"G4QNuc::PrepCl:c="<<comb<<",ac="<<ac<<"("<<index<<"),m="<<mac<<",a="
     
    29892994            if(ze1<=zc||ne1<=nc||se1<=sc) prod=0.;
    29902995            else
    2991                           {
     2996            {
    29922997              if(zc>0) for(int iz=1; iz<=zc; iz++) prod*=(ze1-iz)/iz;
    29932998              if(nc>0) for(int in=1; in<=nc; in++) prod*=(ne1-in)/in;
    29942999              if(sc>0) for(int is=1; is<=sc; is++) prod*=(se1-is)/is;
    2995                           }
     3000            }
    29963001            s+=prod;
    29973002            pos*=prod;
    29983003            pos/=comb;
    29993004#ifdef cldebug
    3000                           if(pos) G4cout<<"G4QN::PreC:c="<<cPDG<<",p="<<pos<<",i="<<index<<",m="<<mac
     3005            if(pos) G4cout<<"G4QN::PreC:c="<<cPDG<<",p="<<pos<<",i="<<index<<",m="<<mac
    30013006                          <<",pr="<<prod<<",c="<<cca<<G4endl;
    30023007            sZ+=pos*zc;
     
    30043009#endif
    30053010            cca++;
    3006                  }
     3011          }
    30073012          curCand->SetPreProbability(pos);
    30083013          curCand->SetDenseProbability(pos*dense);
    30093014#ifdef cldebug
    3010                  G4cout<<"G4QN::PrepC: ClusterPDG="<<cPDG<<",preProb="<<pos<<",d="<<dense<<G4endl;
    3011 #endif
    3012         }
    3013                else                                       // => "Cluster is too big" case
     3015          G4cout<<"G4QN::PrepC: ClusterPDG="<<cPDG<<",preProb="<<pos<<",d="<<dense<<G4endl;
     3016#endif
     3017        }
     3018        else                                       // => "Cluster is too big" case
    30143019        {
    30153020          curCand->SetPreProbability(0.);     
    30163021          curCand->SetDenseProbability(0.);
    3017                  curCand->SetPossibility(false);          // This candidate is not possible
    3018         }
    3019              }
    3020              else
     3022          curCand->SetPossibility(false);          // This candidate is not possible
     3023        }
     3024      }
     3025      else
    30213026      {
    30223027        curCand->SetPreProbability(pos);           // ===> Hadronic case in Vacuum     
    30233028        curCand->SetDenseProbability(0.);          // ===> Hadronic case in Vacuum
    30243029      }
    3025              curCand->SetPossibility(true);           // All candidates are possible at this point
     3030      curCand->SetPossibility(true);           // All candidates are possible at this point
    30263031    }
    30273032  } // End of the LOOP over Candidates
     
    30593064  // @@ --- Temporary "Lambda/Delta barrier for mesons"
    30603065  //if(!cA) cb+=40.;
    3061                 // --- End of Temporary ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     3066  // --- End of Temporary ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    30623067  return cb;
    30633068} // End of "CoulombBarier"
     
    31483153  G4double GSM=GetGSMass();
    31493154#ifdef debug
    3150                 G4cout<<"G4QNucl::CBPenProb:GSM="<<GSM<<",Z="<<Z<<",N="<<N<<",C="<<C<<",B="<<B<<G4endl;
     3155  G4cout<<"G4QNucl::CBPenProb:GSM="<<GSM<<",Z="<<Z<<",N="<<N<<",C="<<C<<",B="<<B<<G4endl;
    31513156#endif
    31523157  if(2>3);
    31533158  // @@ Temporary "Mass Barrier for mesons" @@ __________________
    31543159  //else if(!B) wD=40.;
    3155                 // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     3160  // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    31563161  ////else if(nA<7&&B>0)  wD=0.;    // Only Coulomb Barrier can reflect !!!
    31573162  ////else if((nA<12||nA>16)&&B>0) wD=0.;// Only CoulombB can reflect !!! O16 E-dep of gamA
     
    31743179    wD=80.; // 40 MeV per each nucleon
    31753180    //wD=wD/2;
    3176                         // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     3181    // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    31773182  }
    31783183  ////else if(B>2)  wD=0.;
     
    31903195  if(wD<0.) wD=0.;
    31913196#ifdef debug
    3192                 G4cout<<"G4QNucl::CBPenProb: wD="<<wD<<",E="<<E<<",CB="<<CB<<G4endl;
     3197  G4cout<<"G4QNucl::CBPenProb: wD="<<wD<<",E="<<E<<",CB="<<CB<<G4endl;
    31933198#endif
    31943199  // @@ Temporary "Virial factor" @@ __________________
    31953200  wD=wD+wD;
    3196                 // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     3201  // @@ End of Temporary^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    31973202  G4double sR=0.;
    31983203  G4double CBD=CB+wD;
    31993204  G4double ED=E+wD;
    32003205  if(CBD<0.) return 1.;
    3201   if(ED<0.)  return 0.;
    3202   //if(nA<27) sR=sqrt(wD/(E+wD));
    3203   //else      sR=sqrt((CB+wD)/(E+wD));
    3204   sR=sqrt((CB+wD)/(E+wD));
    3205   //sR=sqrt(wD/(E+wD));
     3206  if(ED<=0.)  return 0.;
     3207  //if(nA<27) sR=sqrt(wD/ED);
     3208  //else      sR=sqrt(CBD/ED);
     3209  sR=sqrt(CBD/ED);
     3210  //sR=sqrt(wD/ED);
    32063211#ifdef pdebug
    32073212  G4cout<<"G4QN::CBPP:s="<<sR<<",E="<<E<<",w="<<wD<<",CB="<<CB<<",B="<<B<<",C="<<C<<G4endl;
     
    32323237void G4QNucleus::ChooseNucleons()
    32333238{
    3234         G4int protons =0;
    3235         G4int nucleons=0;
     3239  G4int protons =0;
     3240  G4int nucleons=0;
    32363241  G4int myA=GetA();
    3237         while (nucleons < myA)
    3238         {
    3239            if(protons<Z && G4UniformRand() < G4double(Z-protons)/G4double(myA-nucleons) )
    3240            {
    3241              protons++;
     3242  while (nucleons < myA)
     3243  {
     3244    if(protons<Z && G4UniformRand() < G4double(Z-protons)/G4double(myA-nucleons) )
     3245    {
     3246      protons++;
    32423247      nucleons++;
    32433248      G4QHadron* proton = new G4QHadron(2212);
    3244              theNucleons.push_back(proton);
    3245            }
    3246            else if ( (nucleons-protons) < (myA-Z) )
    3247            {
     3249      theNucleons.push_back(proton);
     3250    }
     3251    else if ( (nucleons-protons) < (myA-Z) )
     3252    {
    32483253      nucleons++;
    32493254      G4QHadron* neutron = new G4QHadron(2112);
    3250              theNucleons.push_back(neutron);
    3251            }
    3252            else G4cout<<"G4QNucleus::ChooseNucleons not efficient"<<G4endl;
    3253         }
    3254         return;
     3255      theNucleons.push_back(neutron);
     3256    }
     3257    else G4cout<<"G4QNucleus::ChooseNucleons not efficient"<<G4endl;
     3258  }
     3259  return;
    32553260} // End of ChooseNucleons
    32563261
     
    32603265  static const G4double mProt= G4QPDGCode(2212).GetMass();
    32613266  static const G4double mProt2= mProt*mProt;
    3262         G4int i=0;                                  // general index
     3267  G4int i=0;                                  // general index
    32633268  G4int myA=GetA();                           // cashed value of A
    3264          G4ThreeVector  aPos;                         // Prototype of nucleon position
    3265          G4ThreeVector  delta;                        // Prototype of distance between nucleons
     3269  G4ThreeVector aPos;                         // Prototype of nucleon position
     3270  G4ThreeVector delta;                        // Prototype of distance between nucleons
    32663271  G4ThreeVector* places = new G4ThreeVector[myA]; // Vector of 3D positions
    32673272  G4double*      placeM = new G4double[myA];  // Vector of radii
    3268          G4bool         freeplace;                          // flag of free space available
    3269         G4double nucDist2 = nucleonDistance*nucleonDistance; // @@ can be a common static
    3270         G4double maxR=GetRadius(0.01);              // there are no nucleons at this density
    3271         while(i<myA)                                // LOOP over all nucleons
    3272         {
    3273            aPos = maxR*RandomUnitSphere();           // Get random position of nucleon iside maxR
    3274            G4double density=GetRelativeDensity(aPos);
    3275            if(G4UniformRand()<density)               // Try this position with frequency ~Density
    3276            {
    3277              freeplace = true;                       // Imply that there is a free space
    3278              for(G4int j=0; j<i && freeplace; j++)   // Check that there is no overlap with others
    3279              {
    3280                delta = places[j] - aPos;             // Distance to nucleon j
     3273  G4bool  freeplace;                          // flag of free space available
     3274  G4double nucDist2 = nucleonDistance*nucleonDistance; // @@ can be a common static
     3275  G4double maxR=GetRadius(0.01);              // there are no nucleons at this density
     3276  while(i<myA)                                // LOOP over all nucleons
     3277  {
     3278    aPos = maxR*RandomUnitSphere();           // Get random position of nucleon iside maxR
     3279    G4double density=GetRelativeDensity(aPos);
     3280    if(G4UniformRand()<density)               // Try this position with frequency ~Density
     3281    {
     3282      freeplace = true;                       // Imply that there is a free space
     3283      for(G4int j=0; j<i && freeplace; j++)   // Check that there is no overlap with others
     3284      {
     3285        delta = places[j] - aPos;             // Distance to nucleon j
    32813286        freeplace= delta.mag2()>nucDist2;     // If false break the LOOP (M.K.)
    32823287        if(!freeplace) break;                 // M.K. acceleration
    3283              }
    3284                     //  protons must at least have binding energy of CoulombBarrier (@@ ? M.K.), so
    3285                     //  assuming Fermi Energy corresponds to Potential, we must place protons such
    3286                     //  that the Fermi Energy > CoulombBarrier (?)
    3287              if(freeplace && theNucleons[i]->GetPDGCode() == 2212) // Free Space Protons
    3288              {
    3289                     G4double pFermi=GetFermiMomentum(GetDensity(aPos));
    3290                G4double eFermi= sqrt(pFermi*pFermi+mProt2)-mProt; // Kinetic energy
    3291                if (eFermi <= CoulombBarrier()) freeplace=false;
    3292              }
    3293              if(freeplace)
    3294              {
    3295                       places[i]=aPos;
    3296                       ++i;
    3297              }
    3298            }
    3299         }
    3300         ReduceSum(places,placeM);                    // Reduce center of mass shift (equalWeight)
     3288      }
     3289      //  protons must at least have binding energy of CoulombBarrier (@@ ? M.K.), so
     3290      //  assuming Fermi Energy corresponds to Potential, we must place protons such
     3291      //  that the Fermi Energy > CoulombBarrier (?)
     3292      if(freeplace && theNucleons[i]->GetPDGCode() == 2212) // Free Space Protons
     3293      {
     3294        G4double pFermi=GetFermiMomentum(GetDensity(aPos));
     3295        G4double eFermi= sqrt(pFermi*pFermi+mProt2)-mProt; // Kinetic energy
     3296        if (eFermi <= CoulombBarrier()) freeplace=false;
     3297      }
     3298      if(freeplace)
     3299      {
     3300        places[i]=aPos;
     3301        ++i;
     3302      }
     3303    }
     3304  }
     3305  ReduceSum(places,placeM);                    // Reduce center of mass shift (equalWeight)
    33013306  for(i=0; i<myA; i++) theNucleons[i]->SetPosition(places[i]);
    33023307  delete [] places;
     
    33183323  G4double At2= At*At;
    33193324  if(iA<17)                                         // Gaussian density distribution
    3320                 {
     3325  {
    33213326    radius = r0sq*At2;                              // Mean Squared Radius (fm^2)
    33223327    rho0   = pow(pi*radius, -1.5);                  // Central Density
    33233328  }
    33243329  else                                              // Wood-Saxon density distribution
    3325                 {
     3330  {
    33263331    G4double r0=1.16*(1.-1.16/At2)*fermi;           // Base for A-dependent radius
    33273332    G4double rd=deld/r0;                            // Relative thickness of the surface
     
    33843389  G4ThreeVector* momentum = new G4ThreeVector[myA];
    33853390  G4double*      fermiM   = new G4double[myA];
    3386         for(i=0; i<myA; i++) // momenta for all, including the last, in case we swap nucleons
    3387         {
    3388            density=GetDensity(theNucleons[i]->GetPosition());// density around nucleon i
    3389            G4double ferm = GetFermiMomentum(density);        // module of momentun for nucleon i
    3390            fermiM[i] = ferm;                                 // module of momentun for nucleon i
    3391            G4ThreeVector mom=ferm*RandomUnitSphere();        // 3-vector for nucleon mpomentum
    3392            if(theNucleons[i]->GetPDGCode() == 2212)           // the nucleon is proton
    3393            {
    3394              G4double eMax = sqrt(ferm*ferm+mProt2)-CoulombBarrier();
    3395              if(eMax>mProt)
    3396              {
    3397                G4double pmax2= eMax*eMax - mProt2;
    3398                       fermiM[i] = sqrt(pmax2);                      // modify proton momentum
    3399                       while(mom.mag2() > pmax2) mom=Get3DFermiMomentum(density, fermiM[i]);
    3400              }
     3391  for(i=0; i<myA; i++) // momenta for all, including the last, in case we swap nucleons
     3392  {
     3393    density=GetDensity(theNucleons[i]->GetPosition());// density around nucleon i
     3394    G4double ferm = GetFermiMomentum(density);        // module of momentun for nucleon i
     3395    fermiM[i] = ferm;                                 // module of momentun for nucleon i
     3396    G4ThreeVector mom=ferm*RandomUnitSphere();        // 3-vector for nucleon mpomentum
     3397    if(theNucleons[i]->GetPDGCode() == 2212)           // the nucleon is proton
     3398    {
     3399      G4double eMax = sqrt(ferm*ferm+mProt2)-CoulombBarrier();
     3400      if(eMax>mProt)
     3401      {
     3402        G4double pmax2= eMax*eMax - mProt2;
     3403        fermiM[i] = sqrt(pmax2);                      // modify proton momentum
     3404        while(mom.mag2() > pmax2) mom=Get3DFermiMomentum(density, fermiM[i]);
     3405      }
    34013406      else
    3402              {
    3403                G4cerr<<"G4QNucleus: difficulty finding proton momentum -> mom=0"<<G4endl;
    3404                       mom=0;
    3405              }
    3406            }
    3407            momentum[i]= mom;
    3408         }
    3409         ReduceSum(momentum,fermiM);                    // Reduse momentum nonconservation
     3407      {
     3408        G4cerr<<"G4QNucleus: difficulty finding proton momentum -> mom=0"<<G4endl;
     3409        mom=0;
     3410      }
     3411    }
     3412    momentum[i]= mom;
     3413  }
     3414  ReduceSum(momentum,fermiM);                    // Reduse momentum nonconservation
    34103415  for(i=0; i< myA ; i++ )
    34113416  {
    3412                                 G4double mN=mNeut;
     3417    G4double mN=mNeut;
    34133418    if(theNucleons[i]->GetPDGCode() == 2212) mN=mProt;
    34143419    G4double energy = mN - BindingEnergy()/myA;
     
    34303435  }
    34313436  G4int i=0;                                          // To avoid declaration in j-LOOP
    3432         G4ThreeVector sum(0.,0.,0.);                        // The sum which must be reduced
     3437  G4ThreeVector sum(0.,0.,0.);                        // The sum which must be reduced
    34333438  G4double minV=DBL_MAX;                              // Min value of Fermi Momentum
    34343439  G4double maxV=0.;                                   // Max value of Fermi Momentum
    34353440  G4int    maxI=-1;                                   // Index of maximum Fermi Momentum
    3436         for(i=0; i<myA; i++)
     3441  for(i=0; i<myA; i++)
    34373442  {
    34383443    sum+=momentum[i];                                 // Make sum of 3D Momenta
     
    34533458  }
    34543459  G4double* fm2   = new G4double[myA];                // collect temporary squared FermiMom
    3455         for(i=0; i<myA; i++) fm2[i]=pFermiM[i]*pFermiM[i];  // calculate squared Fermi Momenta
     3460  for(i=0; i<myA; i++) fm2[i]=pFermiM[i]*pFermiM[i];  // calculate squared Fermi Momenta
    34563461  G4int myA1=myA-1;                                   // to avoid calculation in the j-LOOP
    34573462  for(G4int j=0; j<myA; j++)                          // Not more than myA attempts
     
    34593464    G4double minP=DBL_MAX;                            // Minimal progection value
    34603465    G4int    minI=-1;                                 // Minimal projection index
    3461            for(i=0; i<myA; i++)                              // Sirch for minimum projection
     3466    for(i=0; i<myA; i++)                              // Sirch for minimum projection
    34623467    {
    34633468      G4double proj=fabs(sum.dot(momentum[i])/fm2[i]);// abs value of |sum|*cos(theta)
    34643469      if(proj<minP)
    3465                                   {
     3470      {
    34663471        minP=proj;
    34673472        minI=i;
     
    34843489    }
    34853490  }
    3486         return true;
     3491  return true;
    34873492} // End of ReduceSum
    34883493
     
    34983503  G4cout<<"G4QNucleus::Init3D: A="<<myA<<", Z="<<Z<<G4endl;
    34993504#endif
    3500                 InitDensity();
     3505  InitDensity();
    35013506  ChooseNucleons(); 
    35023507  ChoosePositions();
     
    35043509  G4double Ebind= BindingEnergy()/myA;
    35053510  for (G4int i=0; i<myA; i++) theNucleons[i]->SetBindingEnergy(Ebind); // @@ ? M.K.
    3506         currentNucleon=0;                                   // Automatically starts the LOOP
     3511  currentNucleon=0;                                   // Automatically starts the LOOP
    35073512  return; 
    35083513} // End of Init3D
     
    35113516G4double G4QNucleus::GetOuterRadius()
    35123517{
    3513         G4double maxradius2=0;
     3518  G4double maxradius2=0;
    35143519  G4int myA=theNucleons.size();
    3515         if(myA) for(G4int i=0; i<myA; i++)
    3516         {
    3517                         G4double nucr2=theNucleons[i]->GetPosition().mag2();
    3518            if(nucr2 > maxradius2) maxradius2=nucr2;
    3519         }
    3520         return sqrt(maxradius2)+nucleonDistance;
     3520  if(myA) for(G4int i=0; i<myA; i++)
     3521  {
     3522    G4double nucr2=theNucleons[i]->GetPosition().mag2();
     3523    if(nucr2 > maxradius2) maxradius2=nucr2;
     3524  }
     3525  return sqrt(maxradius2)+nucleonDistance;
    35213526} // End of GetOuterRadius
    35223527
     
    35253530{
    35263531  G4int myA=theNucleons.size();
    3527         if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);
     3532  if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);
    35283533} // End of DoLorentzBoost(G4LorentzVector)
    35293534
     
    35323537{
    35333538  G4int myA=theNucleons.size();
    3534         if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);
     3539  if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);
    35353540} // End of DoLorentzBoost(G4ThreeVector)
    35363541
     
    35393544{
    35403545  G4double bet2=theBeta.mag2();
    3541         G4double factor=(1.-sqrt(1.-bet2))/bet2;         // 1./(beta2*gamma2)
     3546  G4double factor=(1.-sqrt(1.-bet2))/bet2;         // 1./(beta2*gamma2)
    35423547  G4int myA=theNucleons.size();
    3543         if(myA) for (G4int i=0; i< myA; i++)
    3544         {
    3545            G4ThreeVector pos=theNucleons[i]->GetPosition();
    3546            pos -= factor*(theBeta*pos)*theBeta; 
    3547            theNucleons[i]->SetPosition(pos);
    3548         }   
     3548  if(myA) for (G4int i=0; i< myA; i++)
     3549  {
     3550    G4ThreeVector pos=theNucleons[i]->GetPosition();
     3551    pos -= factor*(theBeta*pos)*theBeta; 
     3552    theNucleons[i]->SetPosition(pos);
     3553  }   
    35493554} // End of DoLorentzContraction(G4ThreeVector)
    35503555
     
    35533558{
    35543559  G4int myA=theNucleons.size();
    3555         if(myA) for(G4int i=0; i<myA; i++)
     3560  if(myA) for(G4int i=0; i<myA; i++)
    35563561    theNucleons[i]->SetPosition(theNucleons[i]->GetPosition() + theShift);
    35573562} // End of DoTranslation
     
    35623567  G4int myA=theNucleons.size();
    35633568  if(myA) currentNucleon=0;
    3564                 else G4cout<<"-Warning-G4QNucleus::StartLoop: LOOP starts for uninited nucleons"<<G4endl;
    3565         return myA;
     3569  else G4cout<<"-Warning-G4QNucleus::StartLoop: LOOP starts for uninited nucleons"<<G4endl;
     3570  return myA;
    35663571} // End of StartLoop
    35673572
     
    35803585  G4double mT= C*B/(1+B);                   // Max (b=0) b-thickness
    35813586  G4double T = mT;                          // Current b-thickness
    3582                 mT/=1000.;                                // Min b-thickness (@@ make 1000 a parameter)
     3587  mT/=1000.;                                // Min b-thickness (@@ make 1000 a parameter)
    35833588  G4double b = 0.;
    35843589  while(T>mT)
     
    38033808    G4double gsM=mNeut;
    38043809    if(thePDG==90001000)      gsM=mProt;
    3805            else if(thePDG==91000000) gsM=mLamb;
     3810    else if(thePDG==91000000) gsM=mLamb;
    38063811    if(fabs(totMass-gsM)<.001)
    38073812    {
    38083813#ifdef pdebug
    3809              G4cout<<"G4QNu::EvaporateNucl:GSM="<<gsM<<", H="<<thePDG<<qH->Get4Momentum()<<G4endl;
     3814      G4cout<<"G4QNu::EvaporateNucl:GSM="<<gsM<<", H="<<thePDG<<qH->Get4Momentum()<<G4endl;
    38103815#endif
    38113816      evaHV->push_back(qH); // (delete equivalent)
     
    38163821    }
    38173822    else if(totMass<gsM)
    3818            {
     3823    {
    38193824#ifdef qdebug
    38203825      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (2) qH="<<G4endl;
     
    38323837      G4double d=totMass-gsM;
    38333838#ifdef pdebug
    3834              G4cout<<"G4QN::EvaporNucl: PDG="<<thePDG<<",M="<<totMass<<">"<<gsM<<",d="<<d<<G4endl;
     3839      G4cout<<"G4QN::EvaporNucl: PDG="<<thePDG<<",M="<<totMass<<">"<<gsM<<",d="<<d<<G4endl;
    38353840#endif
    38363841      G4int decPDG=22;
    38373842      G4double decM=0.;
    38383843      if(d>142.)                           // @@ to avoid more precise calculations
    3839                                                 {
     3844      {
    38403845        if(thePDG==90001000)               // D+ -> n + pi+
    3841                                                                 {
     3846        {
    38423847          gsM=mNeut;
    38433848          thePDG=90000001;
     
    38463851        }
    38473852        else if(thePDG==90000001)          // D+ -> n + pi+
    3848                                                                 {
     3853        {
    38493854          gsM=mProt;
    38503855          thePDG=90001000;
     
    38533858        }
    38543859        else
    3855                                                                 {
     3860        {
    38563861          decPDG=111;
    38573862          decM=mPi0;
     
    38743879      }
    38753880#ifdef pdebug
    3876              G4cout<<"G4QNucl::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+g="<<g4Mom<<",n="
     3881      G4cout<<"G4QNucl::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+g="<<g4Mom<<",n="
    38773882            <<evaHV->size()<<G4endl;
    38783883#endif
     
    39123917    {
    39133918#ifdef pdebug
    3914              G4cout<<"G4QN::EvaporateNuc:(D)GSM="<<gsM<<",H="<<thePDG<<qH->Get4Momentum()<<G4endl;
     3919      G4cout<<"G4QN::EvaporateNuc:(D)GSM="<<gsM<<",H="<<thePDG<<qH->Get4Momentum()<<G4endl;
    39153920#endif
    39163921      G4LorentzVector h4Mom=q4M*(gsM/totMass);           // At rest in CM
     
    39313936    }
    39323937    else if(totMass<gsM+mPi)
    3933            {
     3938    {
    39343939#ifdef qdebug
    39353940      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (6) qH="<<G4endl;
     
    39613966      }
    39623967#ifdef pdebug
    3963              G4cout<<"G4QNuc::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+pi="<<g4Mom<<", nH="
     3968      G4cout<<"G4QNuc::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+pi="<<g4Mom<<", nH="
    39643969            <<evaHV->size()<<G4endl;
    39653970#endif
     
    40124017    G4int   piPDG = -211;
    40134018    if(thePDG==90002999)
    4014            {
     4019    {
    40154020      nucPDG = 2212;
    40164021      nucM   = mProt;
    40174022      piPDG  = 211;
    4018            }
     4023    }
    40194024    if(totMass>mPi+nucM+nucM)
    4020            {
     4025    {
    40214026      G4LorentzVector n14M(0.,0.,0.,nucM);
    40224027      G4LorentzVector n24M(0.,0.,0.,nucM);
     
    40344039        G4cerr<<"***G4QNucleus::EvaporateNucleus: tM="<<totMass<<"-> 2N="<<nucPDG<<"(M="
    40354040              <<nucM<<") + pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
    4036                       throw G4QException("G4QNucleus::EvaporateNucleus: ISO-Dibaryon DecayIn3 error");
     4041        throw G4QException("G4QNucleus::EvaporateNucleus: ISO-Dibaryon DecayIn3 error");
    40374042      }
    40384043#ifdef qdebug
     
    40594064#endif
    40604065      evaHV->push_back(piH);                // (delete equivalent)
    4061            }
    4062            else
    4063            {
     4066    }
     4067    else
     4068    {
    40644069#ifdef qdebug
    40654070      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (11) qH="<<G4endl;
     
    40734078            <<" < M_2N+Pi, d="<<totMass-2*nucM-mPi<<G4endl;
    40744079      throw G4QException("G4QNucleus::EvaporateNucleus:ISO-DiBaryon is under MassShell");
    4075            }
     4080    }
    40764081  }
    40774082  else if((thePDG==90000002||thePDG==90001001||thePDG==90002000)&&totMass>2020.) //=> IsoDB
     
    40884093    {
    40894094      if(G4UniformRand()>.5)
    4090                                                 {
     4095      {
    40914096        n1PDG=2112;
    40924097        n1M=mNeut;
     
    40944099      }
    40954100      else
    4096                                                 {
     4101      {
    40974102        n2PDG=2212;
    40984103        n2M=mProt;
     
    41014106    }
    41024107    if(totMass>mPi+n1M+n2M)
    4103            {
     4108    {
    41044109      G4LorentzVector n14M(0.,0.,0.,n1M);
    41054110      G4LorentzVector n24M(0.,0.,0.,n2M);
    41064111      G4LorentzVector pi4M(0.,0.,0.,mPi);
    41074112      if(!G4QHadron(q4M).DecayIn3(n14M,n24M,pi4M))
    4108              {
     4113      {
    41094114        G4cerr<<"***G4QNucl::EvapNucleus:IsoDN, tM="<<totMass<<"-> N1="<<n1PDG<<"(M="<<n1M
    41104115              <<") + N2="<<n2PDG<<"(M="<<n2M<<") + pi="<<piPDG<<" (Mpi="<<mPi<<")"<<G4endl;
    4111                       throw G4QException("G4QNucl::EvaporateNucleus:ISO-dibaryon excit. DecayIn3 error");
    4112              }
     4116        throw G4QException("G4QNucl::EvaporateNucleus:ISO-dibaryon excit. DecayIn3 error");
     4117      }
    41134118#ifdef qdebug
    41144119      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (12) qH="<<G4endl;
     
    41344139#endif
    41354140      evaHV->push_back(piH);                // (delete equivalent)
    4136            }
    4137            else
    4138            {
     4141    }
     4142    else
     4143    {
    41394144#ifdef qdebug
    41404145      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (13) qH="<<G4endl;
     
    41484153            <<" < M1+M2+Pi, d="<<totMass-n1M-n2M-mPi<<G4endl;
    41494154      throw G4QException("G4QNucleus::EvaporateNucleus:IsoDiBarState is under MassShell");
    4150            }
     4155    }
    41514156  }
    41524157  else if(fabs(totMass-totGSM)<.001)  // Fill as it is or decay Be8, He5, Li5 (@@ add more)
     
    42214226    G4LorentzVector k24M(0.,0.,0.,mK2);
    42224227    if(!G4QHadron(q4M).DecayIn3(n4M,k14M,k24M))
    4223            {
     4228    {
    42244229#ifdef qdebug
    42254230      if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (14) qH="<<G4endl;
     
    42324237      G4cout<<"***G4QNucleus::EvaNuc:tM="<<totMass<<"-> N="<<nucPDG<<"(M="<<nucM<<") + k1="
    42334238            <<k1PDG<<"(M="<<mK1<<") + k2="<<k2PDG<<"(M="<<mK2<<")"<<G4endl;
    4234              throw G4QException("G4QNucleus::EvaporateNucleus: Nucleus+2antiK DecayIn3 error");
    4235            }
     4239      throw G4QException("G4QNucleus::EvaporateNucleus: Nucleus+2antiK DecayIn3 error");
     4240    }
    42364241#ifdef qdebug
    42374242    if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (15) qH="<<G4endl;
     
    42604265  // **>>> From here the EVA code starts (baryons/hyperons can be excited) <<<**
    42614266  else if ( (thePDG > 80000000 && thePDG != 90000000) ||
    4262             thePDG == 2112 || thePDG == 2212 || thePDG == 3122)
     4267     thePDG == 2112 || thePDG == 2212 || thePDG == 3122)
    42634268  { // @@ Improve for Sigma+, Sigma-, Ksi0 & Ksi- content in the Total Np/Nn Nuclei
    42644269    if(thePDG<80000000)                        // Switch from QHadronCode to QNuclearCode
     
    42674272      else if(thePDG==2212) thePDG=90001000;   // p
    42684273      else if(thePDG==3122) thePDG=91000000;   // lambda
    4269            }
     4274    }
    42704275    G4QNucleus qNuc(q4M,thePDG);               // Make a Nucleus for theTotalResidNucleus
    42714276    G4double GSMass =qNuc.GetGSMass();         // GSMass of the Total Residual Nucleus
     
    42774282#ifdef pdebug
    42784283    if(bZ==2&&bN==5)G4cout<<"G4QNucleus::EvaNucl: (2,5) GSM="<<GSMass<<" > "
    4279                                                                     <<G4QPDGCode(2112).GetNuclMass(2,4,0)+mNeut<<G4endl;
     4284                          <<G4QPDGCode(2112).GetNuclMass(2,4,0)+mNeut<<G4endl;
    42804285    if(bZ==1&&bN==3)G4cout<<"G4QNucl::EvaNucl: (1,3) GSM="<<GSMass<<" > "
    4281                                                                     <<G4QPDGCode(2112).GetNuclMass(1,2,0)+mNeut<<G4endl;
     4286                          <<G4QPDGCode(2112).GetNuclMass(1,2,0)+mNeut<<G4endl;
    42824287    G4double dM=totMass-GSMass;
    4283            G4cout<<"G4QNucl::EvaNuc:"<<qNuc<<",PDG="<<thePDG<<",M="<<totMass<<",dM="<<dM<<G4endl;
     4288    G4cout<<"G4QNucl::EvaNuc:"<<qNuc<<",PDG="<<thePDG<<",M="<<totMass<<",dM="<<dM<<G4endl;
    42844289    ////////if(dM>7.) throw G4QException("G4QNucleus::EvaporateNucleus: Big Excitation");
    42854290#endif
     
    42874292    G4bool  dbsCond=qNuc.Split2Baryons();      // (Two Baryons)SeparCond for TotResidNucl
    42884293#ifdef pdebug
    4289            G4cout<<"G4QNucleus::EvaporateNuc: bs="<<bsCond<<", dbs="<<dbsCond<<", A="<<bA<<G4endl;
     4294    G4cout<<"G4QNucleus::EvaporateNuc: bs="<<bsCond<<", dbs="<<dbsCond<<", A="<<bA<<G4endl;
    42904295#endif
    42914296    if(fabs(totMass-GSMass)<.003&&!bsCond&&!dbsCond) // GS or can't split 1(2)B FillAsItIs
     
    43004305      return;
    43014306    }
    4302     else if ( ( bA == 1 || (!bsCond && !dbsCond) ) && totMass > GSMass+.003 )  //==>Fuse&DecayTech(noGamDec)
    4303            //else if(2>3)                                // Close "Fuse&Decay Technology" ***@@@***
    4304     {
    4305 #ifdef pdebug
    4306              G4cout<<"G4QN::EvaN:SplitBar, s="<<bsCond<<",M="<<totMass<<" > GSM="<<GSMass<<G4endl;
     4307    else if ( ( bA == 1 || (!bsCond && !dbsCond) ) && totMass > GSMass+.003 )//=>Fuse&Decay
     4308    //else if(2>3)                                // Close "Fuse&Decay Technology"***@@@***
     4309    {
     4310#ifdef pdebug
     4311      G4cout<<"G4QN::EvaN:SplitBar, s="<<bsCond<<",M="<<totMass<<" > GSM="<<GSMass<<G4endl;
    43074312#endif
    43084313      G4int nOfOUT = evaHV->size();            // Total#of QHadrons in Vector at this point
    43094314      G4bool bnfound=true;                     // Cure "back fusion fragment not found"
    43104315      while(nOfOUT)                            // Try BackFusionDecays till something is in
    4311              {
     4316      {
    43124317        G4QHadron*     theLast = (*evaHV)[nOfOUT-1];
    43134318        G4int          lastBN = theLast->GetBaryonNumber();
     
    43154320        //////////////////G4int          gam    = theLast->GetPDGCode();
    43164321#ifdef pdebug
    4317                       G4cout<<"G4QN::EvaNuc:*BackFus*,BN="<<lastBN<<",nF="<<nFrag<<",n="<<nOfOUT<<G4endl;
    4318 #endif
    4319                       while(nFrag)                       // => "Delete Last Decayed Hadron" case
    4320                       {
     4322        G4cout<<"G4QN::EvaNuc:*BackFus*,BN="<<lastBN<<",nF="<<nFrag<<",n="<<nOfOUT<<G4endl;
     4323#endif
     4324        while(nFrag)                       // => "Delete Last Decayed Hadron" case
     4325        {
    43214326          G4QHadron* thePrev = (*evaHV)[nOfOUT-2];
    43224327          nFrag  = thePrev->GetNFragments();
     
    43244329#ifdef pdebug
    43254330          G4int     prevPDG = thePrev->GetPDGCode();
    4326                         G4cout<<"G4QNucl::EvaNucl: DelTheLast, nFr="<<nFrag<<", pPDG="<<prevPDG<<G4endl;
     4331          G4cout<<"G4QNucl::EvaNucl: DelTheLast, nFr="<<nFrag<<", pPDG="<<prevPDG<<G4endl;
    43274332#endif
    43284333          evaHV->pop_back();               // the prev QHadron is excluded from OUTPUT
     
    43304335          theLast = thePrev;               // Update theLastPntr(Prev instead of Last)
    43314336          lastBN=prevBN;
    4332                         nOfOUT--;                        // Reduce the stack for the Last decayed hadron
    4333                       }
     4337          nOfOUT--;                        // Reduce the stack for the Last decayed hadron
     4338        }
    43344339        if(nOfOUT)
    4335                       {
     4340        {
    43364341          if(lastBN<1&&nOfOUT>1)           // Try Once To Skip Mesons/Gammas & Antibaryons
    4337                         {
     4342          {
    43384343            G4QHadron* thePrev = (*evaHV)[nOfOUT-2];//***Exchange between Last & Prev***
    43394344            evaHV->pop_back();             // the last QHadron is excluded from OUTPUT
     
    43424347            evaHV->push_back(thePrev);     // the Prev becomes the Last (2nd part of exch)
    43434348            theLast = thePrev;             // Update theLastPointer (Prev instead of Last)
    4344                         }
     4349          }
    43454350          G4LorentzVector last4M = theLast->Get4Momentum(); // Selected the last 4-Mom
    43464351          G4QContent  lastQC = theLast->GetQC();
     
    43544359          G4double dM=totMass-GSMass-lastM;
    43554360#ifdef pdebug
    4356                         G4cout<<"G4QN::EvaNuc: tM="<<totMass<<"-LM="<<lastM<<lastQC<<"-GSM="<<GSMass<<"="
     4361          G4cout<<"G4QN::EvaNuc: tM="<<totMass<<"-LM="<<lastM<<lastQC<<"-GSM="<<GSMass<<"="
    43574362                <<dM<<G4endl;
    43584363#endif
    43594364          if(dM>-0.001)                    // Decay in the qH and the last is impossible
    4360                         {
     4365          {
    43614366            G4QHadron* evH = new G4QHadron(totPDG,q4M); // Create QHadron for CompResidNuc
    43624367            if(dM<=0.)
     
    43774382              if(totBN==2)DecayDibaryon(evH,evaHV); // Fill dibaryon (with decay products)
    43784383              else evaHV->push_back(evH);// Fill TRN to HVect asIs (delete equivalent)
    4379                           }
     4384            }
    43804385            else                        // Decay TotalResidualNucleus in GSM+Last
    4381                           {
     4386            {
    43824387              G4LorentzVector r4Mom(0.,0.,0.,GSMass);
    43834388              if(!G4QHadron(q4M).DecayIn2(last4M,r4Mom)) // Decay failed
     
    44004405                G4cout<<"***G4QN::EvaN:DecayIn L"<<lastQC<<"+RN"<<totQC<<" failed"<<G4endl;
    44014406#endif
    4402                      }
     4407              }
    44034408              else                        // Decay in GSM+theLast succeeded
    44044409              {
     
    44224427                else evaHV->push_back(nucH);// Fill the Residual Nucleus (del.eq.)
    44234428              }
    4424                           }
     4429            }
    44254430            bnfound=false;
    44264431            break;
    4427                         }
     4432          }
    44284433          thePDG=totPDG;                   // Make ResidualNucleus outOf theTotResidualNucl
    4429                         GSMass=G4QPDGCode(thePDG).GetMass();// Update the Total Residual Nucleus mass
     4434          GSMass=G4QPDGCode(thePDG).GetMass();// Update the Total Residual Nucleus mass
    44304435          evaHV->pop_back();               // the last QHadron is excluded from OUTPUT
    44314436          delete theLast;//!!When kill,DON'T forget to delete theLastQHadron asAnInstance!!
    44324437          nOfOUT--;                        // Update the value of OUTPUT entries
    4433                       }
    4434              }
     4438        }
     4439      }
    44354440      if(bnfound)
    44364441      {
     
    44514456        }
    44524457#ifdef pdebug
    4453                G4cout<<"G4QNuc::EvaNuc: "<<q4M<<"->totResN="<<thePDG<<h4Mom<<"+g="<<g4Mom<<G4endl;
     4458        G4cout<<"G4QNuc::EvaNuc: "<<q4M<<"->totResN="<<thePDG<<h4Mom<<"+g="<<g4Mom<<G4endl;
    44544459#endif
    44554460        G4QHadron* curH = new G4QHadron(thePDG,h4Mom);
     
    44734478#endif
    44744479      }
    4475            }
     4480    }
    44764481    else if(bA==2)
    44774482    {
     
    44914496    {
    44924497#ifdef pdebug
    4493              G4cout<<"G4QN::EvN:2B="<<dbsCond<<",B="<<bsCond<<",M="<<totMass<<"<"<<GSMass<<G4endl;
     4498      G4cout<<"G4QN::EvN:2B="<<dbsCond<<",B="<<bsCond<<",M="<<totMass<<"<"<<GSMass<<G4endl;
    44944499#endif
    44954500      G4double gResM  =1000000.;           // Prototype of mass of residual for a gamma
    44964501      G4int    gResPDG=0;                  // Prototype of residualPDGCode for a gamma
    44974502      if(bN==4&&bZ==2&&!bS)                // It's He6 nucleus
    4498              {
     4503      {
    44994504        gResPDG= thePDG;                   // PDG of the Residual Nucleus
    45004505        gResM  = mHel6;                    // min mass of the Residual Nucleus
    4501              }
     4506      }
    45024507      G4double nResM  =1000000.;           // Prototype of mass of residual for a neutron
    45034508      G4int    nResPDG=0;                  // Prototype of ResidualPDGCode for a neutron
    45044509      if(bsCond==2112&&bN>0&&bA>1)         // There's aNeutr in theNucl, which can be split
    4505              {
     4510      {
    45064511        G4QContent resQC=totQC-neutQC;
    45074512        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45114516        else if(nResPDG==91000000) nResM=mLamb;
    45124517        else nResM=resN.GetMZNS();         // min mass of the Residual Nucleus
    4513              }
     4518      }
    45144519      G4double pResM  =1000000.;           // Prototype of mass of residual for a proton
    45154520      G4int    pResPDG=0;                  // Prototype of PDGCode of residual for a proton
    45164521      if(bsCond==2212&&bZ>0&&bA>1)         // There's aProton in Nucl, which can be split
    4517              {
     4522      {
    45184523        G4QContent resQC=totQC-protQC;
    45194524        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45234528        else if(pResPDG==91000000) pResM=mLamb;
    45244529        else pResM  =resN.GetMZNS();       // min mass of the Residual Nucleus
    4525              }
     4530      }
    45264531      G4double lResM  =1000000.;           // Prototype of mass of residual for a Lambda
    45274532      G4int    lResPDG=0;                  // Prototype of PDGCode of residual for a Lambda
    45284533      if(bsCond==3122&&bS>0&&bA>1)         // There's aLambd in theNucl, which can be split
    4529              {
     4534      {
    45304535        G4QContent resQC=totQC-lambQC;
    45314536        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45354540        else if(lResPDG==91000000) lResM=mLamb;
    45364541        else lResM  =resN.GetMZNS();       // min mass of the Residual Nucleus
    4537              }
     4542      }
    45384543      G4double dResM  =1000000.;           // Prototype of mass of residual for a Alpha
    45394544      G4int    dResPDG=0;                  // Prototype of PDGCode of residual for a Alpha
    45404545      if(bsCond==90001001&&bN>0&&bZ>0&&bA>2)// There's aDeuter in Nucl, which canBeRadiated
    4541              {
     4546      {
    45424547        G4QContent resQC=totQC-deutQC;
    45434548        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45474552        else if(dResPDG==91000000) dResM=mLamb;
    45484553        else dResM  =resN.GetMZNS();       // minMass of the Residual Nucleus
    4549              }
     4554      }
    45504555      G4double aResM  =1000000.;           // Prototype of mass of residual for a Alpha
    45514556      G4int    aResPDG=0;                  // Prototype of PDGCode of residual for a Alpha
    45524557      if(bsCond==90002002&&bN>1&&bZ>1&&bA>4)// There's Alpha in theNucl, which can be split
    4553              {
     4558      {
    45544559        G4QContent resQC=totQC-alphQC;
    45554560        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45594564        else if(aResPDG==91000000) aResM=mLamb;
    45604565        else aResM  =resN.GetMZNS();       // minMass of the Residual Nucleus
    4561              }
     4566      }
    45624567      G4double nnResM  =1000000.;          // Prototype of mass of residual for a dineutron
    45634568      G4int    nnResPDG=0;                 // Prototype of ResidualPDGCode for a dineutron
    45644569      if(dbsCond&&bN>1&&bA>2)              // It's nucleus and there is a dineutron
    4565              {
     4570      {
    45664571        G4QContent resQC=totQC-neutQC-neutQC;
    45674572        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45714576        else if(nnResPDG==91000000) nnResM=mLamb;
    45724577        else nnResM  =resN.GetMZNS();      // min mass of the Residual Nucleus
    4573              }
     4578      }
    45744579      G4double ppResM  =1000000.;          // Prototype of mass of residual for a diproton
    45754580      G4int    ppResPDG=0;                 // Prototype of ResidualPDGCode for a diproton
    45764581      if(dbsCond&&bZ>1&&bA>2)              // It's nucleus and there is a diproton
    4577              {
     4582      {
    45784583        G4QContent resQC=totQC-protQC-protQC;
    45794584        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45834588        else if(ppResPDG==91000000) ppResM=mLamb;
    45844589        else ppResM  =resN.GetMZNS();      // min mass of the Residual Nucleus
    4585              }
     4590      }
    45864591      G4double npResM  =1000000.;          // Prototype of ResidualMass for proton+neutron
    45874592      G4int    npResPDG=0;                 // Prototype of ResidualPDGCode for a prot+neut
    45884593      if(dbsCond&&bN>0&&bZ>0&&bA>2)        // It's nucleus and there is aProton & aNeutron
    4589              {
     4594      {
    45904595        G4QContent resQC=totQC-neutQC-protQC;
    45914596        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    45954600        else if(npResPDG==91000000) npResM=mLamb;
    45964601        else npResM  =resN.GetMZNS();      // min mass of the Residual Nucleus
    4597              }
     4602      }
    45984603      G4double lnResM  =1000000.;          // Prototype of residualMass for lambda+neutron
    45994604      G4int    lnResPDG=0;                 // Prototype of ResidualPDGCode for aLambda+Neut
    46004605      if(dbsCond&&bN>0&&bS>0&&bA>2)        // It's nucleus and there is aLambda & aNeutron
    4601              {
     4606      {
    46024607        G4QContent resQC=totQC-lambQC-protQC;
    46034608        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    46074612        else if(lnResPDG==91000000) lnResM=mLamb;
    46084613        else lnResM  =resN.GetMZNS();      // min mass of the Residual Nucleus
    4609              }
     4614      }
    46104615      G4double lpResM  =1000000.;          // Prototype of residualMass for a proton+lambda
    46114616      G4int    lpResPDG=0;                 // Prototype of ResidualPDGCode for theProt+lamb
    46124617      if(dbsCond&&bS>0&&bZ>0&&bA>2)        // It's nucleus and there is aProton and aLambda
    4613              {
     4618      {
    46144619        G4QContent resQC=totQC-neutQC-protQC;
    46154620        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    46194624        else if(lpResPDG==91000000) lpResM=mLamb;
    46204625        else lpResM  =resN.GetMZNS();      // minMass of the Residual Nucleus
    4621              }
     4626      }
    46224627      G4double llResM  =1000000.;          // Prototype of mass of residual for a di-lambda
    46234628      G4int    llResPDG=0;                 // Prototype of ResidPDGCode for the di-lambda
    46244629      if(dbsCond&&bS>1&&bA>2)              // It's nucleus and there is a di-lambda
    4625              {
     4630      {
    46264631        G4QContent resQC=totQC-neutQC-protQC;
    46274632        G4QNucleus resN(resQC);            // Pseudo nucleus for the Residual Nucleus
     
    46314636        else if(llResPDG==91000000) llResM=mLamb;
    46324637        else llResM  =resN.GetMZNS();      // min mass of the Residual Nucleus
    4633              }
     4638      }
    46344639#ifdef pdebug
    46354640      G4cout<<"G4QNucleus::EvaNucl: rP="<<pResPDG<<",rN="<<nResPDG<<",rL="<<lResPDG<<",N="
     
    46424647          (thePDG == 90002004 && totMass > mHel6+.003) ||
    46434648
    4644           (bA > 4 && bsCond && bN > 1 && bZ > 1 && totMass > aResM+mAlph) ||
     4649          (bA > 4 && bsCond && bN > 1 && bZ > 1 && totMass > aResM+mAlph) ||
    46454650
    46464651          (bA > 1 && bsCond && ( (bN > 0 && totMass > nResM+mNeut) ||
    46474652                                 (bZ > 0 && totMass > pResM+mProt) ||
    4648                                  (bS > 0 && totMass > lResM+mLamb) ) )      ||
     4653                                 (bS > 0 && totMass > lResM+mLamb) ) )    ||
    46494654          (bA > 2 &&
    4650             ( ( bN > 0 && bZ > 0 &&
    4651                 ((bsCond && totMass > dResM+mDeut) || (dbsCond && totMass > dResM+mDeut) ) ) ||
    4652 
    4653               ( dbsCond && ( (bN > 1 && totMass > nnResM+mNeut+mNeut) ||
    4654                              (bZ > 1 && totMass > ppResM+mProt+mProt) ||
    4655                              (bS > 1 && totMass > llResM+mLamb+mLamb) ||
    4656                              (bN && bS && totMass > lnResM+mLamb+mNeut) ||
    4657                              (bZ && bS && totMass > lpResM+mLamb+mProt) ) ) ) ) )
     4655           (( bN > 0 && bZ > 0 &&
     4656              ( (bsCond && totMass > dResM+mDeut) || (dbsCond && totMass > dResM+mDeut) )
     4657            ) || ( dbsCond && ( (bN > 1   && totMass > nnResM+mNeut+mNeut) ||
     4658                                (bZ > 1   && totMass > ppResM+mProt+mProt) ||
     4659                                (bS > 1   && totMass > llResM+mLamb+mLamb) ||
     4660                                (bN && bS && totMass > lnResM+mLamb+mNeut) ||
     4661                                (bZ && bS && totMass > lpResM+mLamb+mProt)
     4662                              )
     4663                 )
     4664           )
     4665          )
     4666         )
    46584667      {
    46594668        G4int barPDG = 90002002;           // Just for the default case of Be8->alpha+alpha
     
    46644673        G4double thdM= mNeut;              // This default value is used in the IF
    46654674        G4double tMC=totMass+.0002;
    4666                       if(gResPDG&&tMC>mHel6+.003)        // Can make radiative decay of He6 (priority 0)
    4667                       {
     4675        if(gResPDG&&tMC>mHel6+.003)        // Can make radiative decay of He6 (priority 0)
     4676        {
    46684677          barPDG=90002004;
    46694678          resPDG=22;
    46704679          barM  =mHel6;
    46714680          resM  =0.;
    4672                       }
    4673                       else if(nResPDG&&tMC>nResM+mNeut)  // Can radiate a neutron (priority 1)
    4674                       {
     4681        }
     4682        else if(nResPDG&&tMC>nResM+mNeut)  // Can radiate a neutron (priority 1)
     4683        {
    46754684          barPDG=90000001;
    46764685          resPDG=nResPDG;
    46774686          barM  =mNeut;
    46784687          resM  =nResM;
    4679                       }
    4680                       else if(pResPDG&&totMass+.001>pResM+mProt)   // Can radiate a proton (priority 2)
    4681                       {
     4688        }
     4689        else if(pResPDG&&totMass+.001>pResM+mProt)   // Can radiate a proton (priority 2)
     4690        {
    46824691          barPDG=90001000;
    46834692          resPDG=pResPDG;
    46844693          barM  =mProt;
    46854694          resM  =pResM;
    4686                       }
    4687                       else if(lResPDG&&tMC>lResM+mLamb)  // Can radiate a Lambda (priority 3) @@ Sigma0
    4688                       {
     4695        }
     4696        else if(lResPDG&&tMC>lResM+mLamb)  // Can radiate a Lambda (priority 3) @@ Sigma0
     4697        {
    46894698          barPDG=91000000;
    46904699          resPDG=lResPDG;
    46914700          barM  =mLamb;
    46924701          resM  =lResM;
    4693                       }
     4702        }
    46944703        else if(thePDG!=90004004&&bN>1&&bZ>1&&bA>4&&tMC>aResM+mAlph)// Decay in alpha (p4)
    4695                       {
     4704        {
    46964705          barPDG=90002002;
    46974706          resPDG=aResPDG;
    46984707          barM  =mAlph;
    46994708          resM  =aResM;
    4700                       }
    4701                       else if(dResPDG&&tMC>dResM+mDeut)  // Can radiate a Deuteron (priority 5)
    4702                       {
     4709        }
     4710        else if(dResPDG&&tMC>dResM+mDeut)  // Can radiate a Deuteron (priority 5)
     4711        {
    47034712          barPDG=90001001;
    47044713          resPDG=dResPDG;
    47054714          barM  =mDeut;
    47064715          resM  =dResM;
    4707                       }
    4708                       else if(ppResPDG&&tMC>ppResM+mProt+mProt)// Can radiate a DiProton (priority 6)
    4709                       {
     4716        }
     4717        else if(ppResPDG&&tMC>ppResM+mProt+mProt)// Can radiate a DiProton (priority 6)
     4718        {
    47104719          barPDG=90001000;
    47114720          resPDG=ppResPDG;
     
    47144723          resM  =ppResM;
    47154724          thdM  =mProt;
    4716                       }
    4717                       else if(nnResPDG&&tMC>nnResM+mNeut+mNeut)// Can radiate a DiNeutron (priority 7)
    4718                       {
     4725        }
     4726        else if(nnResPDG&&tMC>nnResM+mNeut+mNeut)// Can radiate a DiNeutron (priority 7)
     4727        {
    47194728          barPDG=90000001;
    47204729          resPDG=nnResPDG;
     
    47224731          barM  =mNeut;
    47234732          resM  =nnResM;
    4724                       }
    4725                       else if(npResPDG&&tMC>npResM+mProt+mNeut)// Can radiate a neutron+proton (prior 8)
    4726                       {
     4733        }
     4734        else if(npResPDG&&tMC>npResM+mProt+mNeut)// Can radiate a neutron+proton (prior 8)
     4735        {
    47274736          barPDG=90001000;
    47284737          resPDG=npResPDG;
     
    47304739          barM  =mProt;
    47314740          resM  =npResM;
    4732                       }
    4733                       else if(lnResPDG&&tMC>lnResM+mLamb+mNeut)// Can radiate a Lambda+neutron (prior 9)
    4734                       {
     4741        }
     4742        else if(lnResPDG&&tMC>lnResM+mLamb+mNeut)// Can radiate a Lambda+neutron (prior 9)
     4743        {
    47354744          barPDG=91000000; // @@ Sigma0
    47364745          resPDG=lnResPDG;
     
    47384747          barM  =mLamb;
    47394748          resM  =lnResM;
    4740                       }
    4741                       else if(lpResPDG&&tMC>lpResM+mLamb+mProt)// Can radiate a Lambda+proton (prior 10)
    4742                       {
     4749        }
     4750        else if(lpResPDG&&tMC>lpResM+mLamb+mProt)// Can radiate a Lambda+proton (prior 10)
     4751        {
    47434752          barPDG=91000000; // @@ Sigma0
    47444753          resPDG=lpResPDG;
     
    47474756          resM  =lpResM;
    47484757          thdM  =mProt;
    4749                       }
    4750                       else if(llResPDG&&tMC>llResM+mLamb+mLamb)// Can radiate a DiLambda (priority 11)
    4751                       {
     4758        }
     4759        else if(llResPDG&&tMC>llResM+mLamb+mLamb)// Can radiate a DiLambda (priority 11)
     4760        {
    47524761          barPDG=91000000; // @@ Sigma0
    47534762          resPDG=llResPDG;
     
    47564765          resM  =llResM;
    47574766          thdM  =mLamb;
    4758                       }
     4767        }
    47594768        else if(thePDG!=90004004&&tMC>GSMass)// If it's not Be8 decay in gamma & GSM
    4760                       {
     4769        {
    47614770          barPDG=thePDG;
    47624771          resPDG=22;
    47634772          barM  =GSMass;
    47644773          resM  =0.;
    4765                       }
     4774        }
    47664775        else if(thePDG!=90004004)
    4767                       {
     4776        {
    47684777          G4cerr<<"***G4QNuc::EvaN:PDG="<<thePDG<<",M="<<totMass<<"< GSM="<<GSMass<<G4endl;
    47694778          throw G4QException("G4QNucleus::EvaporateNucleus: M<GSM & can't decayInPNL");
    4770                       }
     4779        }
    47714780        G4LorentzVector a4Mom(0.,0.,0.,barM);
    47724781        G4LorentzVector b4Mom(0.,0.,0.,resM);
     
    47854794            G4cout<<"---Warning---G4QN::EvN:DecIn2Error b="<<barPDG<<",r="<<resPDG<<G4endl;
    47864795            return;
    4787                  }
     4796          }
    47884797          else
    47894798          {
     
    48254834            G4cout<<"---Warning---G4QN::EvN:DecIn2Error,b="<<barPDG<<",r="<<resPDG<<G4endl;
    48264835            return;
    4827                  }
     4836          }
    48284837          else
    48294838          {
     
    48554864          }
    48564865        }
    4857              }
     4866      }
    48584867      else if (fabs(totMass-GSMass)<.003) // @@ Looks like a duplication of the prev. check
    48594868      {
     
    48684877      }
    48694878      else                             // "System is below mass shell and can't decay" case
    4870              {
     4879      {
    48714880#ifdef pdebug
    48724881        G4cout<<"***G4QNucl::EvaNuc: tM="<<totMass<<"("<<thePDG<<") < GSM="<<GSMass<<", d="
     
    48814890    }
    48824891    else                                        // ===> Evaporation of excited system
    4883            {
     4892    {
    48844893#ifdef pdebug
    48854894      G4cout<<"G4QN::EvaNuc:***EVA***tPDG="<<thePDG<<",M="<<totMass<<">GSM="<<GSMass<<",d="
     
    49064915        evcn++;
    49074916        if(!qNuc.EvaporateBaryon(bHadron,rHadron)) // Evaporation did not succeed
    4908                {
     4917        {
    49094918#ifdef pdebug
    49104919          G4cout<<"***G4QNuc::EvaNuc:***EVA Failed***PDG="<<thePDG<<",M="<<totMass<<G4endl;
     
    49204929#endif
    49214930          return;
    4922                }
     4931        }
    49234932        evC=false;
    49244933        b4M=bHadron->Get4Momentum();
     
    49394948#endif
    49404949        //if(b4M.e()-b4M.m()<bCB&&evcn<evcm) evC=true;
    4941              }  // End of while
     4950      }  // End of while
    49424951#ifdef pdebug
    49434952      G4cout<<"G4QNucl::EvaNuc:*** EVA IS DONE *** F="<<bPDG<<b4M<<",bB="<<bB<<", ResNuc="
     
    49594968      else if(bPDG==90004004) DecayAlphaAlpha(bHadron,evaHV);// Alph+Alph Decay (del.eq.)
    49604969      else
    4961              {
     4970      {
    49624971        delete bHadron;
    49634972        G4cerr<<"***G4QNuc::EvaNuc:bB="<<bB<<">2 - unexpected evaporated fragment"<<G4endl;
    49644973        throw G4QException("G4QNucleus::EvaporateNucleus: Wrong evaporation act");
    4965              }
     4974      }
    49664975      if(rB>2) EvaporateNucleus(rHadron,evaHV);    // Continue evaporation (@@ Self-call)
    49674976      else if(rB==2)                   // => "Dibaryon" case needs decay @@ DecayDibaryon
    4968              {
     4977      {
    49694978        G4double rGSM = rHadron->GetQPDG().GetMass(); // Ground State mass of the dibaryon
    49704979#ifdef pdebug
    4971                       G4cout<<"G4QNuc::EvaNuc:ResidDibM="<<rM<<",GSM="<<rGSM<<",M-GSM="<<rM-rGSM<<G4endl;
     4980        G4cout<<"G4QNuc::EvaNuc:ResidDibM="<<rM<<",GSM="<<rGSM<<",M-GSM="<<rM-rGSM<<G4endl;
    49724981#endif
    49734982        if(rM<=rGSM-0.01)
    4974                       {
     4983        {
    49754984          delete rHadron;
    49764985          G4cerr<<"***G4QNucleus::EvaporNucl: <residual> M="<<rM<<" < GSM="<<rGSM<<G4endl;
    49774986          throw G4QException("G4QNucleus::EvaporateNucleus: Evaporation below MassShell");
    4978                       }
     4987        }
    49794988        else if(fabs(rM-rGSM)<0.01&&rPDG==90001001) evaHV->push_back(rHadron); // (DE)
    49804989        else DecayDibaryon(rHadron,evaHV);   // => "Dibaryon Decay" case (del.equivalent)
    4981              }
     4990      }
    49824991      else if(rB==5) DecayAlphaBar(rHadron,evaHV);// "Alpha+Baryon Decay" case (del.equiv.)
    49834992      else if(rPDG==90004002) DecayAlphaDiN(rHadron,evaHV);//alph+2p (alph+2n is stable)
    49844993      else if(rPDG==90004004) DecayAlphaAlpha(rHadron,evaHV);//Alpha+Alpha Decay (delEq)
    4985       else evaHV->push_back(rHadron);         // Fill ResidNucl=Baryon to OutputHadronVector
    4986            } // End of Evaporation of excited system
     4994      else evaHV->push_back(rHadron);        // Fill ResidNucl=Baryon to OutputHadronVector
     4995    } // End of Evaporation of excited system
    49874996#ifdef pdebug
    49884997    G4cout<<"G4QNucleus::EvaporateNucleus: === End of the evaporation attempt"<<G4endl;
     
    49975006    {
    49985007      if(thePDG==10)                            // "Chipolino decay" case
    4999              {
     5008      {
    50005009        G4QContent totQC = qH->GetQC();         // Quark content of the hadron
    50015010        G4QChipolino resChip(totQC);            // define the Residual as a Chipolino
     
    50175026          G4LorentzVector qe4M(0.,0.,0.,m2);
    50185027          if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
    5019                         {
     5028          {
    50205029            G4cerr<<"***G4QNuc::EvaNuc:tM="<<totMass<<"-> h1M="<<m1<<" + h2M="<<m2<<G4endl;
    5021                           throw G4QException("G4QNucleus::EvaporateNucleus: Chipol->h1+h2 DecIn2 error");
    5022                  }
     5030            throw G4QException("G4QNucleus::EvaporateNucleus: Chipol->h1+h2 DecIn2 error");
     5031          }
    50235032          G4QHadron* H2 = new G4QHadron(h2.GetPDGCode(),qe4M);
    50245033#ifdef pdebug
     
    50315040#endif
    50325041          evaHV->push_back(H1);            // (delete equivalent)
    5033                       }
     5042        }
    50345043        else
    5035                {
     5044        {
    50365045#ifdef qdebug
    50375046          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (25) qH="<<G4endl;
     
    50445053          G4cerr<<"**G4QN::EN:M="<<totMass<<"<"<<m1<<"+"<<m2<<",d="<<m1+m2-totMass<<G4endl;
    50455054          throw G4QException("G4QNucleus::EvaporateNucleus: Chipolino is under MassShell");
    5046                }
    5047              }
     5055        }
     5056      }
    50485057      else                                      // "Hadron" case
    5049              {
     5058      {
    50505059        G4double totM=G4QPDGCode(thePDG).GetMass();
    50515060        if(fabs(totMass-totM)<0.001||abs(thePDG)-10*(abs(thePDG)/10)>2)
    5052                                                                 {
     5061        {
    50535062#ifdef pdebug
    50545063          G4cout<<"**G4QNuc::EvaNuc:EmerFill(2) "<<qH->GetQC()<<qH->Get4Momentum()<<G4endl;
     
    50605069        }
    50615070        else if ((thePDG==221||thePDG==331)&&totMass>mPi+mPi) // "Decay in pipi" case
    5062                {
     5071        {
    50635072#ifdef qdebug
    50645073          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (26) qH="<<G4endl;
     
    50725081          G4LorentzVector qe4M(0.,0.,0.,mPi);
    50735082          if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
    5074                         {
     5083          {
    50755084            G4cerr<<"***G4QNucleus::EvaporateNucleus:tM="<<totMass<<"-> pi+ + pi-"<<G4endl;
    5076                           throw G4QException("G4QNucleus::EvaporateNucleus: H->Pi+Pi DecayIn2 error");
    5077                  }
     5085            throw G4QException("G4QNucleus::EvaporateNucleus: H->Pi+Pi DecayIn2 error");
     5086          }
    50785087          G4QHadron* H1 = new G4QHadron(211,fq4M);
    50795088#ifdef pdebug
     
    50865095#endif
    50875096          evaHV->push_back(H2);            // (delete equivalent)
    5088                }
     5097        }
    50895098        else if ((thePDG==221||thePDG==331)&&totMass>mPi0+mPi0) // "Decay in 2pi0" case
    5090                {
     5099        {
    50915100#ifdef qdebug
    50925101          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (27) qH="<<G4endl;
     
    51005109          G4LorentzVector qe4M(0.,0.,0.,mPi0);
    51015110          if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
    5102                         {
     5111          {
    51035112            G4cerr<<"***G4QNucleus::EvaporateNucleus:tM="<<totMass<<"-> pi0 + pi0"<<G4endl;
    5104                           throw G4QException("G4QNucleus::EvaporateNucleus: H->Pi+Pi DecayIn2 error");
    5105                  }
     5113            throw G4QException("G4QNucleus::EvaporateNucleus: H->Pi+Pi DecayIn2 error");
     5114          }
    51065115          G4QHadron* H1 = new G4QHadron(111,fq4M);
    51075116#ifdef pdebug
     
    51145123#endif
    51155124          evaHV->push_back(H2);            // (delete equivalent)
    5116                }
     5125        }
    51175126        else if (totMass>totM)                  // "Radiative Hadron decay" case
    5118                {
     5127        {
    51195128#ifdef qdebug
    51205129          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (28) qH="<<G4endl;
     
    51285137          G4LorentzVector qe4M(0.,0.,0.,totM);
    51295138          if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
    5130                         {
     5139          {
    51315140            G4cerr<<"***G4QNuc::EvaporateNuc:tM="<<totMass<<"->h1M="<<totM<<"+gam"<<G4endl;
    5132                           throw G4QException("G4QNucleus::EvaporateNucleus: H*->H+gamma DecIn2 error");
    5133                  }
     5141            throw G4QException("G4QNucleus::EvaporateNucleus: H*->H+gamma DecIn2 error");
     5142          }
    51345143          G4QHadron* H2 = new G4QHadron(thePDG,qe4M);
    51355144#ifdef pdebug
     
    51425151#endif
    51435152          evaHV->push_back(H1);            // (delete equivalent)
    5144                }
     5153        }
    51455154        else if (thePDG==111||thePDG==221||thePDG==331) // "Gamma+Gamma decay" case
    5146                {
     5155        {
    51475156#ifdef qdebug
    51485157          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (29) qH="<<G4endl;
     
    51565165          G4LorentzVector qe4M(0.,0.,0.,0.);
    51575166          if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
    5158                         {
     5167          {
    51595168            G4cerr<<"***G4QNucl::EvaporateNucleus:tM="<<totMass<<"->gamma + gamma"<<G4endl;
    5160                           throw G4QException("G4QNucleus::EvaporateNucleus: pi/eta->g+g DecIn2 error");
    5161                  }
     5169            throw G4QException("G4QNucleus::EvaporateNucleus: pi/eta->g+g DecIn2 error");
     5170          }
    51625171          G4QHadron* H2 = new G4QHadron(22,qe4M);
    51635172#ifdef pdebug
     
    51705179#endif
    51715180          evaHV->push_back(H1);            // (delete equivalent)
    5172                }
     5181        }
    51735182        else
    5174                {
     5183        {
    51755184#ifdef qdebug
    51765185          if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (30) qH="<<G4endl;
     
    51845193                <<" < GSM="<<totM<<", 2Pi="<<mPi+mPi<<", 2Pi0="<<mPi0+mPi0<<G4endl;
    51855194          throw G4QException("G4QNucleus::EvaporateNucleus: Hadron is under MassShell");
    5186                }
    5187              }
    5188            }
     5195        }
     5196      }
     5197    }
    51895198    else
    51905199    {
     
    52615270      {
    52625271        if(fabs(qM-mSigM)<eps)
    5263                       {
     5272        {
    52645273          evaHV->push_back(qH);                  // Fill Sigma- as it is
    52655274          return;
     
    53395348    }
    53405349    else                                          //(2) n*N+m*(Pi-)   (qS=0)
    5341            {
     5350    {
    53425351      sPDG = -211;
    53435352      qPN  = -qC;
     
    53895398      qBN  = qC;
    53905399      fMass= mProt;
    5391            }
     5400    }
    53925401    else if(qS  && qC<qBN-qS)                     //(3)n*L+m*P+k*N ***Should not be here***
    53935402    {
     
    54045413      {
    54055414        if(fabs(qM-mSigP)<eps)                    // Fill Sigma+ as it is
    5406                       {
     5415        {
    54075416          evaHV->push_back(qH);
    54085417          return;
     
    56595668  {
    56605669    if(fabs(qM-mDeut)<eps)
    5661            {
     5670    {
    56625671      evaHV->push_back(qH);               // Fill as it is (delete equivalent)
    56635672      return;
    5664            }
     5673    }
    56655674    else if(mProt+mNeut<rM)
    56665675    {
     
    57755784    G4double sum=fMass+sMass;
    57765785    if(fabs(qM-sum)<eps)
    5777            {
     5786    {
    57785787      f4Mom=q4M*(fMass/sum);
    57795788      s4Mom=q4M*(sMass/sum);
     
    58105819    G4double sum=fMass+sMass;
    58115820    if(fabs(qM-sum)<eps)
    5812            {
     5821    {
    58135822      f4Mom=q4M*(fMass/sum);
    58145823      s4Mom=q4M*(sMass/sum);
     
    58365845    // Now the second pair mus be decayed
    58375846    if(fabs(qM-sum)<eps)
    5838            {
     5847    {
    58395848      f4Mom=q4M*(fMass/sum);
    58405849      s4Mom=q4M*(sMass/sum);
     
    58685877    G4double sum=fMass+sMass+tMass;
    58695878    if(fabs(qM-sum)<eps)
    5870            {
     5879    {
    58715880      f4Mom=q4M*(fMass/sum);
    58725881      s4Mom=q4M*(sMass/sum);
     
    60506059  {
    60516060    if(!n1)                               // No K0's only K+'s
    6052            {
     6061    {
    60536062      if(n2==1 && mK+nucM>qM+.0001)  // Mass limit: switch to K0
    6054              {
     6063      {
    60556064        k1M=mK0;
    60566065        n1=1;
     
    60636072        k1PDG=321;                        // Only K+'s (default K0's)
    60646073        n1=n2;                            // only n1 is used
    6065              }
    6066            }
     6074      }
     6075    }
    60676076    else                                  // No K+'s only K0's
    60686077    {
    60696078      if(n1==1 && mK0+nucM>qM+.0001) // Mass limit: switch to K+
    6070              {
     6079      {
    60716080        k1M=mK;
    60726081        k1PDG=321;                        // K+ instead of K0
     
    61196128    }
    61206129    if(fabs(qM-sum)<eps)
    6121            {
     6130    {
    61226131      f4Mom=q4M*(n1M/sum);
    61236132      s4Mom=q4M*(nucM/sum);
     
    61456154      G4QHadron* H1 = new G4QHadron(k1PDG,f4Mom); // Create a Hadron for the Kaon
    61466155      evaHV->push_back(H1);                       // Fill "H1" (delete equivalent)
    6147            }
     6156    }
    61486157    G4QHadron* H2 = new G4QHadron(qPDG,s4Mom);    // Create a Hadron for the Nucleus
    61496158    //evaHV->push_back(H2);                       // Fill "H2" (delete equivalent)
     
    61626171    G4double sum=nucM+n1M+n2M;
    61636172    if(fabs(qM-sum)<eps)
    6164            {
     6173    {
    61656174      f4Mom=q4M*(n1M/sum);
    61666175      s4Mom=q4M*(n2M/sum);
     
    61886197      G4QHadron* H1 = new G4QHadron(k1PDG,f4Mom); // Create a Hadron for the K0
    61896198      evaHV->push_back(H1);                       // Fill "H1" (delete equivalent)
    6190            }
     6199    }
    61916200    s4Mom/=n2;
    61926201    for(G4int i2=0; i2<n2; i2++)
     
    61946203      G4QHadron* H2 = new G4QHadron(k2PDG,s4Mom); // Create a Hadron for the K+
    61956204      evaHV->push_back(H2);                       // Fill "H2" (delete equivalent)
    6196            }
     6205    }
    61976206    G4QHadron* H3 = new G4QHadron(qPDG,t4Mom);    // Create a Hadron for the nucleus
    61986207    //evaHV->push_back(H3);                       // Fill "H3" (delete equivalent)
     
    62696278    G4double sum=fMass+fMass;
    62706279    if(fabs(qM-sum)<eps)
    6271            {
     6280    {
    62726281      f4Mom=q4M/2.;
    62736282      s4Mom=f4Mom;
     
    63016310    G4double sum=fMass+fMass+fMass;
    63026311    if(fabs(qM-sum)<eps)
    6303            {
     6312    {
    63046313      f4Mom=q4M/3.;
    63056314      s4Mom=f4Mom;
     
    63486357      G4QHadron* H1 = new G4QHadron(fPDG,f4Mom); // Create a Hadron for the baryon
    63496358      evaHV->push_back(H1);                 // Fill "H1" (delete equivalent)
    6350            }
     6359    }
    63516360  }
    63526361#ifdef qdebug
     
    63816390  {
    63826391    if(fabs(qM-mHel6)<eps)
    6383            {
     6392    {
    63846393      evaHV->push_back(qH);                 // Fill as it is (delete equivalent)
    63856394      return;
    6386            }
     6395    }
    63876396    else if(mNeut+mNeut+mAlph<qM)
    63886397    {
    63896398      fPDG = 2112;
    63906399      fMass= mNeut;
    6391            }
     6400    }
    63926401    else
    63936402    {
     
    64996508    G4double sum=tfM+tsM;
    65006509    if(fabs(qM-sum)<eps)
    6501            {
     6510    {
    65026511      f4Mom=q4M*(tfM/sum);
    65036512      s4Mom=q4M*(tsM/sum);
     
    65506559    G4double sum=fMass+sMass+sMass;
    65516560    if(fabs(qM-sum)<eps)
    6552            {
     6561    {
    65536562      f4Mom=q4M*(fMass/sum);
    65546563      s4Mom=q4M*(sMass/sum);
     
    66106619    G4double sum=fMass+fMass+sMass;
    66116620    if(fabs(qM-sum)<eps)
    6612            {
     6621    {
    66136622      f4Mom=q4M*((fMass+fMass)/sum);
    66146623      s4Mom=q4M*(sMass/sum);
     
    66826691    G4double sum=fMass+sMass;
    66836692    if(fabs(qM-sum)<eps)
    6684            {
     6693    {
    66856694      f4Mom=q4M*(fMass/sum);
    66866695      s4Mom=q4M*(sMass/sum);
     
    67536762    G4double sum=fMass+sMass;
    67546763    if(fabs(qM-sum)<eps)
    6755            {
     6764    {
    67566765      f4Mom=q4M*(fMass/sum);
    67576766      s4Mom=q4M*(sMass/sum);
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPDGCode.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPDGCode.cc,v 1.56 2008/03/20 20:11:38 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPDGCode.cc,v 1.57 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QPDGCode ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class for Hadron definitions in CHIPS Model
     33// -------------------------------------------------------------------
     34// Short description: The PDG Code is made on the basis of the Quark
     35// Content (G4QuarkContent) of the hadronic state (including nuclear
     36// fragments). The PDG code of the ground state (e.g. pi, N, etc.) is
     37// calculated. It includes a complicated algortithm of the G.S. mass
     38// calculation for nuclear fragments (now it is synchronised with the
     39// G4 nuclear massess).
    3340// -------------------------------------------------------------------
    3441
     
    222229  static G4int qC[modi] = { 11,   12,   13,   14,   15,   16,   22,   23,   24,   25, // 10
    223230                            37,  110,  220,  330,  111,  211,  221,  311,  321,  331, // 20
    224                                                                     2112, 2212, 3122, 3112, 3212, 3222, 3312, 3322,  113,  213, // 30
    225                                                                      223,  313,  323,  333, 1114, 2114, 2214, 2224, 3124, 3114, // 40
     231                          2112, 2212, 3122, 3112, 3212, 3222, 3312, 3322,  113,  213, // 30
     232                           223,  313,  323,  333, 1114, 2114, 2214, 2224, 3124, 3114, // 40
    226233                          3214, 3224, 3314, 3324, 3334,  115,  215,  225,  315,  325, // 50
    227234                           335, 2116, 2216, 3126, 3116, 3216, 3226, 3316, 3326,  117, // 60
     
    235242                           91001999 , 90001002 , 90002001 , 91000002 , 91001001 ,     //110
    236243                           91002000 , 92000001 , 92001000 , 90999003 , 90001003 ,
    237                                                    90002002 , 90003001 , 91001002 , 91002001 , 92000002 ,     //120
     244         90002002 , 90003001 , 91001002 , 91002001 , 92000002 ,     //120
    238245                           92001001 , 92002000};
    239246  static G4int aC[15] = {1,1000,999001,1000000,1000999,1999000,1999999,        // sum 1
     
    269276    ,  1691.,   1667.,    1776.,    1776.,   1854.,   1950.,  1950.,  1950.,  1950.,  2100.
    270277    ,  2030.,   2030.,    2030.,    2127.,   2127.,   2252.,  2020.,  2020.,  2044.,  2045.
    271            , 2045., 2297., 2170.272, 2171.565, 2464., 2464., 3108.544, 3111.13,3402.272,3403.565};
     278    , 2045., 2297., 2170.272, 2171.565, 2464., 2464., 3108.544, 3111.13,3402.272,3403.565};
    272279  if(iniFlag) // Initialization of the Geant4 hadronic masses
    273                 {
    274                                 m[ 0]=      G4Electron::Electron()->GetPDGMass();
    275                                 m[ 1]=    G4NeutrinoE::NeutrinoE()->GetPDGMass();
    276                                 m[ 2]=    G4MuonMinus::MuonMinus()->GetPDGMass();
    277                                 m[ 3]=  G4NeutrinoMu::NeutrinoMu()->GetPDGMass();
    278                                 m[ 4]=      G4TauMinus::TauMinus()->GetPDGMass();
    279                                 m[ 5]=G4NeutrinoTau::NeutrinoTau()->GetPDGMass();
    280                                 m[14]=      G4PionZero::PionZero()->GetPDGMass();
    281                                 m[15]=    G4PionMinus::PionMinus()->GetPDGMass();
    282                                 m[16]=                G4Eta::Eta()->GetPDGMass();
    283                                 m[17]=      G4KaonZero::KaonZero()->GetPDGMass();
    284                                 m[18]=    G4KaonMinus::KaonMinus()->GetPDGMass();
    285                                 m[19]=      G4EtaPrime::EtaPrime()->GetPDGMass();
    286                                 m[20]=        G4Neutron::Neutron()->GetPDGMass();
    287                                 m[21]=          G4Proton::Proton()->GetPDGMass();
    288                                 m[22]=          G4Lambda::Lambda()->GetPDGMass();
    289                                 m[23]=  G4SigmaMinus::SigmaMinus()->GetPDGMass();
    290                                 m[24]=    G4SigmaZero::SigmaZero()->GetPDGMass();
    291                                 m[25]=    G4SigmaPlus::SigmaPlus()->GetPDGMass();
    292                                 m[26]=        G4XiMinus::XiMinus()->GetPDGMass();
    293                                 m[27]=          G4XiZero::XiZero()->GetPDGMass();
    294                                 m[44]=  G4OmegaMinus::OmegaMinus()->GetPDGMass();
     280  {
     281    m[ 0]=      G4Electron::Electron()->GetPDGMass();
     282    m[ 1]=    G4NeutrinoE::NeutrinoE()->GetPDGMass();
     283    m[ 2]=    G4MuonMinus::MuonMinus()->GetPDGMass();
     284    m[ 3]=  G4NeutrinoMu::NeutrinoMu()->GetPDGMass();
     285    m[ 4]=      G4TauMinus::TauMinus()->GetPDGMass();
     286    m[ 5]=G4NeutrinoTau::NeutrinoTau()->GetPDGMass();
     287    m[14]=      G4PionZero::PionZero()->GetPDGMass();
     288    m[15]=    G4PionMinus::PionMinus()->GetPDGMass();
     289    m[16]=                G4Eta::Eta()->GetPDGMass();
     290    m[17]=      G4KaonZero::KaonZero()->GetPDGMass();
     291    m[18]=    G4KaonMinus::KaonMinus()->GetPDGMass();
     292    m[19]=      G4EtaPrime::EtaPrime()->GetPDGMass();
     293    m[20]=        G4Neutron::Neutron()->GetPDGMass();
     294    m[21]=          G4Proton::Proton()->GetPDGMass();
     295    m[22]=          G4Lambda::Lambda()->GetPDGMass();
     296    m[23]=  G4SigmaMinus::SigmaMinus()->GetPDGMass();
     297    m[24]=    G4SigmaZero::SigmaZero()->GetPDGMass();
     298    m[25]=    G4SigmaPlus::SigmaPlus()->GetPDGMass();
     299    m[26]=        G4XiMinus::XiMinus()->GetPDGMass();
     300    m[27]=          G4XiZero::XiZero()->GetPDGMass();
     301    m[44]=  G4OmegaMinus::OmegaMinus()->GetPDGMass();
    295302    iniFlag=false;
    296303  }
    297304  if(nQ<0 || nQ>=nQHM)
    298                 {
     305  {
    299306    G4cout<<"***G4QPDGCode::QHaM: negative Q-code or Q="<<nQ<<" >= nQmax = "<<nQHM<<G4endl;
    300307    return 0.;
     
    327334#endif
    328335    if(b<0)                                        // ---> Baryons & Fragments
    329            {
    330              b=-b;
     336    {
     337      b=-b;
    331338      n=-n;
    332339      z=-z;
     
    335342    }
    336343    else if(!b)                                    // --> Mesons
    337            {
     344    {
    338345      //G4bool anti=false;                           // For the PDG conversion
    339346      if(z<0)                                      // --> Mesons conversion
    340              {
     347      {
    341348        n=-n;
    342349        z=-z;
     
    345352      }
    346353      if(!z)
    347              {
     354      {
    348355        if(s>0)
    349                {
     356        {
    350357          n=-n;
    351358          s=-s;
     
    357364      }
    358365      else                                         // --> z>0
    359              {
     366      {
    360367        if(z==1)
    361368        {
     
    368375    } // End of meson case
    369376    if(b>0)                                        // --> Baryon case
    370            {
     377    {
    371378      if(b==1)
    372              {
     379      {
    373380        if(!s)                                     // --> Baryons
    374                       {
     381        {
    375382          if(z==-1)    return 34;                  // Delta-
    376383          else if(!z)  return 91;                  // neutron
     
    381388        }
    382389        else if(s==1)                              // --> Hyperons
    383                       {
     390        {
    384391          if(z==-1)    return 93;                  // Sigma-
    385392          else if(!z)  return 92;                  // Lambda (@@ 24->Sigma0)
     
    389396        }
    390397        else if(s==2)                              // --> Xi Hyperons
    391                       {
     398        {
    392399          if(z==-1)    return 95;                  // Xi-
    393400          else if(!z)  return 96;                  // Xi0
     
    396403        }
    397404        else if(s==3)                              // --> Xi Hyperons
    398                       {
     405        {
    399406          if(z==-1)    return 97;                  // Omega-
    400407          else if(!z||z==-2)  return -1;           // Omega+pi Chipolino
     
    403410      }
    404411      else
    405              {
     412      {
    406413        if(b==2)
    407414        {
     
    457464    G4int p=PDGC/10;                // Quark Content
    458465    if(r%2)                         // (2s+1 is odd) Mesons are all the same
    459            {
     466    {
    460467      if     (p==11) return Q+=1;
    461468      else if(p==21) return Q+=2;
     
    471478        return -2;
    472479      }
    473            }
     480    }
    474481    else                    // (2s+1 is even) Baryons
    475            {
     482    {
    476483      G4int s=r/2;
    477484      if(s%2)               // ((2s+1)/2 is odd) N Family
    478              {
     485      {
    479486        if     (p==211) return Q+=1;
    480487        else if(p==221) return Q+=2;
     
    492499          return -2;
    493500        }
    494              }
    495              else                  // ((2s+1)/2 is odd) Delta Family
    496              {
     501      }
     502      else                  // ((2s+1)/2 is odd) Delta Family
     503      {
    497504        if     (p==111) return Q+= 1;
    498505        else if(p==211) return Q+= 2;
     
    513520          return -2;
    514521        }
    515              }
    516            }
     522      }
     523    }
    517524  }
    518525  else                        // Nuclear Fragments
     
    527534#endif
    528535      return -2;
    529            }
     536    }
    530537    else
    531            {
     538    {
    532539      G4int b=t/3;            // baryon number
    533540      if(b==1)                // baryons
     
    604611      }
    605612      else
    606              {
     613      {
    607614        if     (s==0&&u==-1&&d== 1) return Q+=1;
    608615        else if(s==0&&u== 0&&d== 0) return Q+=2;
     
    620627          return -2;
    621628        }
    622              }
    623            }
     629      }
     630    }
    624631  }
    625632#ifdef pdebug
     
    634641  G4int ab=theQCode;
    635642#ifdef debug
    636                 G4cout<<"G4QPDGCode::GetMass: Mass for Q="<<ab<<",PDG="<<thePDGCode<<",N="<<nQHM<<G4endl;
     643  G4cout<<"G4QPDGCode::GetMass: Mass for Q="<<ab<<",PDG="<<thePDGCode<<",N="<<nQHM<<G4endl;
    637644#endif
    638645  if ( (ab < 0 && thePDGCode < 80000000) || !thePDGCode) {
     
    664671  G4double m=GetNuclMass(z,n,s);
    665672#ifdef debug
    666                 G4cout<<"G4QPDG::GetM:PDG="<<thePDGCode<<"=>Z="<<z<<",N="<<n<<",S="<<s<<",M="<<m<<G4endl;
     673  G4cout<<"G4QPDG::GetM:PDG="<<thePDGCode<<"=>Z="<<z<<",N="<<n<<",S="<<s<<",M="<<m<<G4endl;
    667674#endif
    668675  return m;
     
    684691    , 160., 168., 159., 159.,  87., 300., 300.,  300., 300., 200.
    685692    , 180., 180., 180.,  99.,  99.,  55., 387.,  387., 208., 198.
    686            , 198., 149., 120., 120., 170., 170., 120.,  120., 170., 170.};
     693    , 198., 149., 120., 120., 170., 170., 120.,  120., 170., 170.};
    687694  G4int ab=abs(theQCode);
    688695  if(ab<nW) return width[ab];
     
    730737  static const G4int iNF[nEl]={0,0,0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, // 14
    731738                         1  ,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, // 29
    732                                                                                                                                                                                                         16 , 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 44
    733                                                                                                                                                                                                         31 , 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, // 59
     739                         16 , 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 44
     740                         31 , 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, // 59
    734741                         56 , 56, 57, 57, 58, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, // 74
    735742                         71 , 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, // 89
     
    738745  static G4int iNmin[nEl]={0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, // 14
    739746                         1  ,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, // 29
    740                                                                                                                                                                                                         16 , 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 44
    741                                                                                                                                                                                                         31 , 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, // 59
     747                         16 , 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 44
     748                         31 , 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, // 59
    742749                         56 , 56, 57, 57, 58, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, // 74
    743750                         71 , 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, // 89
     
    746753  static G4int iNran[nEl]={19,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, // 14
    747754                         34 , 35, 36, 37, 38, 39, 40, 48, 48, 48, 48, 50, 50, 50, 52, // 29
    748                                                                                                                                                                                                         53 , 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, // 44
    749                                                                                                                                                                                                         68 , 69, 70, 70, 70, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, // 59
     755                         53 , 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, // 44
     756                         68 , 69, 70, 70, 70, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, // 59
    750757                         73 , 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 76, // 74
    751758                         76 , 76, 76, 76, 76, 75, 74, 73, 72, 71, 70, 70, 69, 69, 69, // 89
     
    754761  static const G4int iNL[nEl]={19,20,21,22,23,24, 25, 26, 27, 28, 29, 30, 31, 32, 33, // 14
    755762                         34 , 35, 36, 37, 38, 39, 40, 48, 48, 48, 48, 50, 50, 50, 52, // 29
    756                                                                                                                                                                                                         53 , 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, // 44
    757                                                                                                                                                                                                         68 , 69, 70, 70, 70, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, // 59
     763                         53 , 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, // 44
     764                         68 , 69, 70, 70, 70, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, // 59
    758765                         73 , 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 76, // 74
    759766                         76 , 76, 76, 76, 76, 75, 74, 73, 72, 71, 70, 70, 69, 69, 69, // 89
    760767                         68 , 68, 68, 67, 63, 59, 55, 51, 47, 43, 39, 35, 31, 27, 23};//104
    761768   // ********* S=-4 vectors *************
    762                 static G4bool iNin6[nEl]={false,false,false,false,false,false,false,
    763     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    764     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    765     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    766     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    767     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    768     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    769                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     769  static G4bool iNin6[nEl]={false,false,false,false,false,false,false,
     770    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     771    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     772    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     773    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     774    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     775    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     776    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    770777  static G4double VZ6[nEl][iNR];
    771778  //********* S=-3 vectors *************
    772                 static G4bool iNin7[nEl]={false,false,false,false,false,false,false,
    773     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    774     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    775     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    776     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    777     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    778     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    779                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     779  static G4bool iNin7[nEl]={false,false,false,false,false,false,false,
     780    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     781    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     782    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     783    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     784    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     785    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     786    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    780787  static G4double VZ7[nEl][iNR];
    781788  // ********* S=-2 vectors *************
    782                 static G4bool iNin8[nEl]={false,false,false,false,false,false,false,
    783     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    784     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    785     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    786     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    787     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    788     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    789                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     789  static G4bool iNin8[nEl]={false,false,false,false,false,false,false,
     790    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     791    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     792    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     793    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     794    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     795    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     796    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    790797  static G4double VZ8[nEl][iNR];
    791798  // ********* S=-1 vectors *************
    792                 static G4bool iNin9[nEl]={false,false,false,false,false,false,false,
    793     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    794     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    795     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    796     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    797     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    798     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    799                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     799  static G4bool iNin9[nEl]={false,false,false,false,false,false,false,
     800    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     801    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     802    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     803    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     804    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     805    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     806    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    800807  static G4double VZ9[nEl][iNR];
    801808  // ********* S=0 vectors *************
    802                 static G4bool iNin0[nEl]={false,false,false,false,false,false,false,
    803     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    804     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    805     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    806     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    807     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    808     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    809                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     809  static G4bool iNin0[nEl]={false,false,false,false,false,false,false,
     810    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     811    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     812    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     813    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     814    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     815    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     816    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    810817 static G4double VZ0[nEl][iNR];
    811818  // ********* S=1 vectors *************
    812                 static G4bool iNin1[nEl]={false,false,false,false,false,false,false,
    813     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    814     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    815     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    816     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    817     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    818     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    819                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     819  static G4bool iNin1[nEl]={false,false,false,false,false,false,false,
     820    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     821    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     822    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     823    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     824    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     825    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     826    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    820827  static G4double VZ1[nEl][iNR];
    821828  // ********* S=2 vectors *************
    822                 static G4bool iNin2[nEl]={false,false,false,false,false,false,false,
    823     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    824     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    825     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    826     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    827     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    828     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    829                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     829  static G4bool iNin2[nEl]={false,false,false,false,false,false,false,
     830    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     831    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     832    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     833    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     834    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     835    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     836    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    830837  static G4double VZ2[nEl][iNR];
    831838  // ********* S=3 vectors *************
    832                 static G4bool iNin3[nEl]={false,false,false,false,false,false,false,
    833     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    834     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    835     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    836     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    837     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    838     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    839                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     839  static G4bool iNin3[nEl]={false,false,false,false,false,false,false,
     840    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     841    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     842    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     843    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     844    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     845    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     846    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    840847  static G4double VZ3[nEl][iNR];
    841848  // ********* S=2 vectors *************
    842                 static G4bool iNin4[nEl]={false,false,false,false,false,false,false,
    843     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    844     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    845     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    846     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    847     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    848     false,false,false,false,false,false,false,false,false,false,false,false,false,false,
    849                                 false,false,false,false,false,false,false,false,false,false,false,false,false,false};
     849  static G4bool iNin4[nEl]={false,false,false,false,false,false,false,
     850    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     851    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     852    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     853    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     854    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     855    false,false,false,false,false,false,false,false,false,false,false,false,false,false,
     856    false,false,false,false,false,false,false,false,false,false,false,false,false,false};
    850857  static G4double VZ4[nEl][iNR];
    851858  //
     
    863870  G4int zns=nz+s;
    864871  if(nz+s<0)
    865                 {
     872  {
    866873    z=-z;
    867874    n=-n;
     
    871878  }
    872879  if(z<0)
    873                 {
     880  {
    874881    if(z==-1)
    875                         {
     882    {
    876883      if(!s)
    877                                                 {
     884      {
    878885        if(n==1)      return mPiC;              // pi-
    879886        else          return mPiC+(n-1)*mNeut;  // Delta- + (N-1)*n
    880887      }
    881888      else if(s==1)                             // Strange negative hadron
    882                                                 {
     889      {
    883890        if(!n)        return mKM;               // K-
    884891        else if(n==1) return mSiM;              // Sigma-
     
    888895      }
    889896      else if(s==2)                             // --> Double-strange negative hadrons
    890                                                 {
     897      {
    891898        if(!n)        return mKsM;              // Ksi-
    892899        else if(n==1) return mKsiM+mNeut;       // Ksi- + n
     
    986993  }
    987994  else if(n<0)
    988                 {
     995  {
    989996    if(n==-1)
    990                         {
     997    {
    991998      if(!s)
    992                                                 {
     999      {
    9931000        if(z==1)      return mPiC;              // pi+
    9941001        else          return mPiC+(z-1)*mProt;  // Delta++ + (Z-1)*p
    995                                         }
     1002      }
    9961003      else if(s==1)                             // --> Strange neutral hadrons
    997                                                 {
     1004      {
    9981005        if(!z)        return mKZ;               // K0
    9991006        else if(z==1) return mSiP;              // Sigma+
     
    10031010      }
    10041011      else if(s==2)                             // --> Double-strange negative hadrons
    1005                                                 {
     1012      {
    10061013        if(!z)        return mKsZ;              // Ksi0
    10071014        else if(z==1) return mKsiZ+mProt;       // Ksi- + p
     
    10951102  //return CalculateNuclMass(z,n,s); // @@ This is just to compare the calculation time @@
    10961103  if(!s)                   // **************> S=0 nucleus
    1097                 {
     1104  {
    10981105    if(nz==256) return 256000.;
    10991106    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    11001107    if(!iNin0[z])          // ====> This element is already initialized
    1101                                 {
     1108    {
    11021109#ifdef idebug
    11031110      G4cout<<"**>G4QPDGCode::GetMass:Z="<<z<<", S=0 is initialized. F="<<iNin0[z]<<G4endl;
     
    11101117    G4int dNn=n-Nmin;
    11111118    if(dNn<0)              // --> The minimum N must be reduced
    1112                                 {
     1119    {
    11131120#ifdef qdebug
    11141121      if(n<iNmin[z])
     
    11221129    else if(dNn<iNL[z]) return VZ0[z][dNn]; // Found in DAM
    11231130    else                   // --> The maximum N must be increased
    1124                                 {
     1131    {
    11251132#ifdef qdebug
    11261133      if(dNn>iNmax)
     
    11391146  }
    11401147  else if(s==1)            // ******************> S=1 nucleus
    1141                 {
     1148  {
    11421149
    11431150    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    11441151    if(!iNin1[z])          // ====> This element is already initialized
    1145                                 {
     1152    {
    11461153#ifdef idebug
    11471154      G4cout<<"**>G4QPDGCode::GetMass:Z="<<z<<", S=1 is initialized. F="<<iNin1[z]<<G4endl;
     
    11541161    G4int dNn=n-Nmin;
    11551162    if(dNn<0)              // --> The minimum N must be reduced
    1156                                 {
     1163    {
    11571164#ifdef qdebug
    11581165      if(n<iNmin[z])
     
    11661173    else if(dNn<iNL[z]) return VZ1[z][dNn]; // Found in DAM
    11671174    else                   // --> The maximum N must be increased
    1168                                 {
     1175    {
    11691176#ifdef qdebug
    11701177      if(dNn>iNmax)
     
    11831190  }
    11841191  else if(s==-1)           // ******************> S=-1 nucleus
    1185                 {
     1192  {
    11861193    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    11871194    if(!iNin9[z])          // ====> This element is already initialized
    1188                                 {
     1195    {
    11891196#ifdef idebug
    11901197      G4cout<<"*>G4QPDGCode::GetMass:Z="<<z<<", S=-1 is initialized. F="<<iNin9[z]<<G4endl;
     
    11971204    G4int dNn=n-Nmin;
    11981205    if(dNn<0)              // --> The minimum N must be reduced
    1199                                 {
     1206    {
    12001207#ifdef qdebug
    12011208      if(n<iNmin[z])
     
    12091216    else if(dNn<iNL[z]) return VZ9[z][dNn]; // Found in DAM
    12101217    else                   // --> The maximum N must be increased
    1211                                 {
     1218    {
    12121219#ifdef qdebug
    12131220      if(dNn>iNmax)
     
    12261233  }
    12271234  else if(s==2)            // ******************> S=2 nucleus
    1228                 {
     1235  {
    12291236    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    12301237    if(!iNin2[z])          // ====> This element is already initialized
    1231                                 {
     1238    {
    12321239#ifdef idebug
    12331240      G4cout<<"**>G4QPDGCode::GetMass:Z="<<z<<", S=2 is initialized. F="<<iNin2[z]<<G4endl;
     
    12401247    G4int dNn=n-Nmin;
    12411248    if(dNn<0)              // --> The minimum N must be reduced
    1242                                 {
     1249    {
    12431250#ifdef qdebug
    12441251      if(n<iNmin[z])
     
    12521259    else if(dNn<iNL[z]) return VZ2[z][dNn]; // Found in DAM
    12531260    else                   // --> The maximum N must be increased
    1254                                 {
     1261    {
    12551262#ifdef qdebug
    12561263      if(dNn>iNmax)
     
    12691276  }
    12701277  else if(s==-2)           // ******************> S=-2 nucleus
    1271                 {
     1278  {
    12721279    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    12731280    if(!iNin8[z])          // ====> This element is already initialized
    1274                                 {
     1281    {
    12751282#ifdef idebug
    12761283      G4cout<<"*>G4QPDGCode::GetMass:Z="<<z<<", S=-2 is initialized. F="<<iNin8[z]<<G4endl;
     
    12831290    G4int dNn=n-Nmin;
    12841291    if(dNn<0)              // --> The minimum N must be reduced
    1285                                 {
     1292    {
    12861293#ifdef qdebug
    12871294      if(n<iNmin[z])
     
    12951302    else if(dNn<iNL[z]) return VZ8[z][dNn]; // Found in DAM
    12961303    else                   // --> The maximum N must be increased
    1297                                 {
     1304    {
    12981305#ifdef qdebug
    12991306      if(dNn>iNmax)
     
    13121319  }
    13131320  else if(s==-3)           // ******************> S=-3 nucleus
    1314                 {
     1321  {
    13151322    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    13161323    if(!iNin7[z])          // ====> This element is already initialized
    1317                                 {
     1324    {
    13181325#ifdef idebug
    13191326      G4cout<<"*>G4QPDGCode::GetMass:Z="<<z<<", S=-3 is initialized. F="<<iNin7[z]<<G4endl;
     
    13261333    G4int dNn=n-Nmin;
    13271334    if(dNn<0)              // --> The minimum N must be reduced
    1328                                 {
     1335    {
    13291336#ifdef qdebug
    13301337      if(n<iNmin[z])
     
    13381345    else if(dNn<iNL[z]) return VZ7[z][dNn]; // Found in DAM
    13391346    else                   // --> The maximum N must be increased
    1340                                 {
     1347    {
    13411348#ifdef qdebug
    13421349      if(dNn>iNmax)
     
    13551362  }
    13561363  else if(s==3)            // ******************> S=3 nucleus
    1357                 {
     1364  {
    13581365    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    13591366    if(!iNin3[z])          // ====> This element is already initialized
    1360                                 {
     1367    {
    13611368#ifdef idebug
    13621369      G4cout<<"**>G4QPDGCode::GetMass:Z="<<z<<", S=3 is initialized. F="<<iNin3[z]<<G4endl;
     
    13691376    G4int dNn=n-Nmin;
    13701377    if(dNn<0)              // --> The minimum N must be reduced
    1371                                 {
     1378    {
    13721379#ifdef qdebug
    13731380      if(n<iNmin[z])
     
    13811388    else if(dNn<iNL[z]) return VZ3[z][dNn]; // Found in DAM
    13821389    else                   // --> The maximum N must be increased
    1383                                 {
     1390    {
    13841391#ifdef qdebug
    13851392      if(dNn>iNmax)
     
    13981405  }
    13991406  else if(s==-4)           // ******************> S=-4 nucleus
    1400                 {
     1407  {
    14011408    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    14021409    if(!iNin6[z])          // ====> This element is already initialized
    1403                                 {
     1410    {
    14041411#ifdef idebug
    14051412      G4cout<<"*>G4QPDGCode::GetMass:Z="<<z<<", S=-4 is initialized. F="<<iNin6[z]<<G4endl;
     
    14121419    G4int dNn=n-Nmin;
    14131420    if(dNn<0)              // --> The minimum N must be reduced
    1414                                 {
     1421    {
    14151422#ifdef qdebug
    14161423      if(n<iNmin[z])
     
    14241431    else if(dNn<iNL[z]) return VZ6[z][dNn]; // Found in DAM
    14251432    else                   // --> The maximum N must be increased
    1426                                 {
     1433    {
    14271434#ifdef qdebug
    14281435      if(dNn>iNmax)
     
    14411448  }
    14421449  else if(s==4)           // ******************> S=4 nucleus
    1443                 {
     1450  {
    14441451    G4int Nmin=iNF[z];     // Minimun N(Z) for the Dynamic Associative Memory (DAM)
    14451452    if(!iNin4[z])          // ====> This element is already initialized
    1446                                 {
     1453    {
    14471454#ifdef idebug
    14481455      G4cout<<"*>G4QPDGCode::GetMass:Z="<<z<<", S=4 is initialized. F="<<iNin4[z]<<G4endl;
     
    14551462    G4int dNn=n-Nmin;
    14561463    if(dNn<0)              // --> The minimum N must be reduced
    1457                                 {
     1464    {
    14581465#ifdef qdebug
    14591466      if(n<iNmin[z])
     
    14671474    else if(dNn<iNL[z]) return VZ4[z][dNn]; // Found in DAM
    14681475    else                   // --> The maximum N must be increased
    1469                                 {
     1476    {
    14701477#ifdef qdebug
    14711478      if(dNn>iNmax)
     
    14841491  }
    14851492  else
    1486                 {
     1493  {
    14871494#ifdef qdebug
    14881495    if(s<Smin || s>Smax)
    1489                                 {
     1496    {
    14901497      if(s<Smin) Smin=s;
    14911498      if(s>Smax) Smax=s;
     
    15871594  //static G4double c[9][9]={// z=1     =2     =3     =4     =5     =6     =7     =8     =9
    15881595  //                 {13.136,14.931,25.320,38.000,45.000,55.000,65.000,75.000,85.000},//n=1
    1589                 //                 {14.950, 2.425,11.680,18.374,27.870,35.094,48.000,60.000,72.000},  //n=2
    1590                 //                 {25.930,11.390,14.086,15.770,22.921,28.914,39.700,49.000,60.000},  //n=3
    1591                 //                 {36.830,17.594,14.908, 4.942,12.416,15.699,24.960,32.048,45.000},  //n=4
    1592                 //                 {41.860,26.110,20.946,11.348,12.051,10.650,17.338,23.111,33.610},  //n=5
    1593                 //                 {45.000,31.598,24.954,12.607, 8.668, 0.000, 5.345, 8.006,16.780},  //n=6
    1594                 //                 {50.000,40.820,33.050,20.174,13.369, 3.125, 2.863, 2.855,10.680},  //n=7
    1595                 //                 {55.000,48.810,40.796,25.076,16.562, 3.020, 0.101,-4.737,1.9520},  //n=8
    1596                 //                 {60.000,55.000,50.100,33.660,23.664, 9.873, 5.683,-0.809,0.8730}}; //n=9
     1596  //     {14.950, 2.425,11.680,18.374,27.870,35.094,48.000,60.000,72.000},  //n=2
     1597  //     {25.930,11.390,14.086,15.770,22.921,28.914,39.700,49.000,60.000},  //n=3
     1598  //     {36.830,17.594,14.908, 4.942,12.416,15.699,24.960,32.048,45.000},  //n=4
     1599  //     {41.860,26.110,20.946,11.348,12.051,10.650,17.338,23.111,33.610},  //n=5
     1600  //     {45.000,31.598,24.954,12.607, 8.668, 0.000, 5.345, 8.006,16.780},  //n=6
     1601  //     {50.000,40.820,33.050,20.174,13.369, 3.125, 2.863, 2.855,10.680},  //n=7
     1602  //     {55.000,48.810,40.796,25.076,16.562, 3.020, 0.101,-4.737,1.9520},  //n=8
     1603  //     {60.000,55.000,50.100,33.660,23.664, 9.873, 5.683,-0.809,0.8730}}; //n=9
    15971604  if(z>107)
    1598                 {
     1605  {
    15991606#ifdef debug
    16001607    G4cout<<"***G4QPDGCode::CalcNuclMass: Z="<<z<<">107, N="<<n<<", S="<<s<<G4endl;
     
    16411648      return mK;  // Simple decision
    16421649    else if(S>0)                                  // General decision
    1643            {
     1650    {
    16441651      if     (-Z>S) return S*mK-(S+Z)*mPi+eps;
    16451652      else if(Z>=0) return S*mK0+Z*mPi+eps;
     
    16471654    }
    16481655    else if(S<0)                                  // General decision
    1649            {
     1656    {
    16501657      if     (Z>-S) return -S*mK+(S+Z)*mPi+eps;
    16511658      else if(Z<=0) return -S*mK0-Z*mPi+eps;
     
    16661673    else if(!S&&N<0) return mP-mPi*N+eps;         // Positive Isonuclei
    16671674    else if(S==1)                                 // --> General decision
    1668            {
     1675    {
    16691676      if     (N>1)   return mSm+(N-1)*mPi+eps;    // (Sigma-)+(n*PI-)
    16701677      else if(Z>1)   return mSp+(Z-1)*mPi+eps;    // (Sigma+)+(n*PI+)
    16711678    }
    16721679    else if(S==2)                                 // --> General decision
    1673            {
     1680    {
    16741681      if     (N>0)   return mXm+N*mPi+eps;        // (Xi-)+(n*PI-)
    16751682      else if(Z>0)   return mXz+Z*mPi+eps;        // (Xi0)+(n*PI+)
    16761683    }
    16771684    else if(S==3)                                 // --> General decision
    1678            {
     1685    {
    16791686      if     (N>-1)  return mOm+(N+1)*mPi+eps;    // (Omega-)+(n*PI-)
    16801687      else if(Z>-1)  return mOm+(Z+1)*mPi+eps;    // (Omega-)+(n*PI+)
    16811688    }
    16821689    else if(S>3)                                  // --> General Omega- decision
    1683            {
     1690    {
    16841691      if   (-Z>S-2)  return mOm+(S-3)*mK +(2-Z-S)*mPi+eps;
    16851692      else if(Z>-1)  return mOm+(S-3)*mK0+(Z+1)+mPi+eps;
     
    17051712    else if(!S&&N<0) return dmP-mPi*N+eps;        // Positive Isonuclei
    17061713    else if(S==1)                                 // --> General decision
    1707            {
     1714    {
    17081715      if     (N>2)   return dSP+(N-2)*mPi+eps;    // (nSigma-)+(n*PI-)
    17091716      else if(Z>2)   return dSN+(Z-1)*mPi+eps;    // (pSigma+)+(n*PI+)
    17101717    }
    17111718    else if(S==2)                                 // --> General decision
    1712            {
     1719    {
    17131720      if     (N>1)   return dXN+(N-1)*mPi+eps;    // (nXi-)+(n*PI-)
    17141721      else if(Z>1)   return dXP+(Z-1)*mPi+eps;    // (pXi0)+(n*PI+)
    17151722    }
    17161723    else if(S==3)                                 // --> General decision
    1717            {
     1724    {
    17181725      if     (N>0)   return dON+N*mPi+eps;        // (nOmega-)+(n*PI-)
    17191726      else if(Z>0)   return dOP+Z*mPi+eps;        // (pOmega-)+(n*PI+)
    17201727    }
    17211728    else if(S>3)                                  // --> General Omega- decision
    1722            {
     1729    {
    17231730      if   (-Z>S-2)  return dON+(S-3)*mK +(2-Z-S)*mPi+eps;
    17241731      else if(Z>0)   return dOP+(S-3)*mK0+Z+mPi+eps;
     
    17271734    //else if(S>0)                                // @@ Implement General Decision
    17281735    //{
    1729            //  //#ifdef debug
    1730            //  G4cout<<"***G4QPDGCode::GetNuclMass:B=2, Z="<<Z<<",N="<<N<<",S="<<S<<G4endl;
    1731            //  //#endif
     1736    //  //#ifdef debug
     1737    //  G4cout<<"***G4QPDGCode::GetNuclMass:B=2, Z="<<Z<<",N="<<N<<",S="<<S<<G4endl;
     1738    //  //#endif
    17321739    //  return bigM;                              // Exotic dibaryons (?)
    17331740    //}
     
    17601767  {
    17611768    if(Zm>=-S)                        // Enough charge for K+'s
    1762            {
     1769    {
    17631770      km=-S*mK;                       // Anti-Lambdas are compensated by protons
    1764              Zm+=S;
     1771      Zm+=S;
    17651772    }
    17661773    else if(Zm>0)
    1767            {
     1774    {
    17681775      km=Zm*mK-(S+Zm)*mK0;            // Anti-Lambdas are partially compensated by neutrons
    17691776      Zm=0;
     
    17791786    G4int bH=-S-sH;                   // BigHalhS   || as in G4QE::DecayAntiStrange
    17801787    if(Z>0 && Z>N)
    1781            {
     1788    {
    17821789      if(Z>=bH)                       // => "Enough protons in nucleus" case
    1783              {
     1790      {
    17841791        if(N>=sH)
    17851792        {
     
    18231830          }
    18241831        }
    1825              }
     1832      }
    18261833      else // Must not be here
    1827              {
     1834      {
    18281835#ifdef debug
    18291836        G4cout<<"***G4QPDGC::CalcNuclMass:Antimatter? Z="<<Z<<",N="<<N<<",S="<<S<<G4endl;
    18301837#endif
    18311838        return 0.;                          // @@ Antiparticles aren't implemented @@
    1832              }
    1833            }
     1839      }
     1840    }
    18341841    else if(N>=bH)
    1835            {
     1842    {
    18361843      if(Z>=sH)
    18371844      {
     
    18751882        }
    18761883      }
    1877            }
     1884    }
    18781885    else // Must not be here
    1879            {
     1886    {
    18801887      return 0.;                            // @@ Antiparticles aren't implemented @@
    18811888#ifdef debug
    18821889        G4cout<<"***G4QPDGC::CalcNuclMass:Antimatter? N="<<N<<",Z="<<Z<<",S="<<S<<G4endl;
    18831890#endif
    1884            }
     1891    }
    18851892    S=0;
    18861893  }
     
    19231930    //else if(A==256 && Z==128) m=256000.;
    19241931    //else
    1925                                 //              m=k+G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z)->GetPDGMass();
    1926                 //m+=-sh[Z]-sh[N]+b1*D*D*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*D)))+Z*Z*(b5*pow(fA,b9)+b6/fA);
     1932    //  m=k+G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z)->GetPDGMass();
     1933  //m+=-sh[Z]-sh[N]+b1*D*D*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*D)))+Z*Z*(b5*pow(fA,b9)+b6/fA);
    19271934  }
    19281935  //@@//G4double maxM= k+Z*mP+N*mN+S*mL+eps;      // @@ eps -- Wings of the Mass parabola
     
    19501957    {   // @@ Can be generalized to anti-nuclei
    19511958#ifdef debug
    1952       G4cerr<<"**G4QPDGCode::CalcNucM:A="<<Am<<"<1 || Z="<<Zm<<"<0 || N="<<Nm<<"<0"<<G4endl;
     1959      G4cerr<<"*G4QPDGCode::CalcNucM:A="<<Am<<"<1 || Z="<<Zm<<"<0 || N="<<Nm<<"<0"<<G4endl;
    19531960#endif
    19541961    }
     
    19651972      //  mm=km+G4NucleiProperties::GetNuclearMass(Am,Zm);
    19661973      //else
    1967                                                 //  mm=km+G4ParticleTable::GetParticleTable()->FindIon(Zm,Am,0,Zm)->GetPDGMass();
    1968                                                 //  //mm+=-sh[Zm]-sh[Nm]+b1*Dm*Dm*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*Dm)))
     1974      //  mm=km+G4ParticleTable::GetParticleTable()->FindIon(Zm,Am,0,Zm)->GetPDGMass();
     1975      //  //mm+=-sh[Zm]-sh[Nm]+b1*Dm*Dm*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*Dm)))
    19691976      //  //    +Zm*Zm*(b5*pow(fA,b9)+b6/Am);
    19701977    }
     
    20202027    if     (ab==22) G4cout<<"-W-G4QPDGC::GetQuarkCont: For the Photon? - Return 0"<<G4endl;
    20212028    else if(ab==10) G4cout<<"-W-G4QPDGC::GetQuarkCont: For Chipolino? - Return 0"<<G4endl;
    2022            else G4cout<<"-W-G4QPDGCode::GetQuarkCont: For PDG="<<thePDGCode<<" Return 0"<<G4endl;
     2029    else G4cout<<"-W-G4QPDGCode::GetQuarkCont: For PDG="<<thePDGCode<<" Return 0"<<G4endl;
    20232030#endif
    20242031    return G4QContent(0,0,0,0,0,0); // Photon, bosons, leptons
     
    20312038    G4int t=0;         // (3)prototype of highest quark (B)
    20322039#ifdef sdebug
    2033            G4cout<<"G4QPDGCode::GetQuarkContent: a="<<ab<<", c="<<c<<", f="<<f<<", v="<<v<<G4endl;
     2040    G4cout<<"G4QPDGCode::GetQuarkContent: a="<<ab<<", c="<<c<<", f="<<f<<", v="<<v<<G4endl;
    20342041#endif
    20352042    if(v>10)           // Baryons
    2036            {
     2043    {
    20372044      t=v/10;          // (3) highest quark
    20382045      v%=10;           // (2) high quark
    20392046      if     (f==1)
    2040              {
     2047      {
    20412048        if(a) ad++;
    20422049        else   d++;
    2043              }
     2050      }
    20442051      else if(f==2)
    2045              {
     2052      {
    20462053        if(a) au++;
    20472054        else   u++;
    2048              }
     2055      }
    20492056      else if(f==3)
    2050              {
     2057      {
    20512058        if(a) as++;
    20522059        else   s++;
    2053              }
    2054       else G4cerr<<"***G4QPDGCode::GetQContent:1 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
     2060      }
     2061      else G4cerr<<"*G4QPDGC::GetQCont:1 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
    20552062      if     (v==1)
    2056              {
     2063      {
    20572064        if(a) ad++;
    20582065        else   d++;
    2059              }
     2066      }
    20602067      else if(v==2)
    2061              {
     2068      {
    20622069        if(a) au++;
    20632070        else   u++;
    2064              }
     2071      }
    20652072      else if(v==3)
    2066              {
     2073      {
    20672074        if(a) as++;
    20682075        else   s++;
    2069              }
    2070       else G4cerr<<"***G4QPDGCode::GetQContent:2 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
     2076      }
     2077      else G4cerr<<"*G4QPDGC::GetQCont:2 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
    20712078      if     (t==1)
    2072              {
     2079      {
    20732080        if(a) ad++;
    20742081        else   d++;
    2075              }
     2082      }
    20762083      else if(t==2)
    2077              {
     2084      {
    20782085        if(a) au++;
    20792086        else   u++;
    2080              }
     2087      }
    20812088      else if(t==3)
    2082              {
     2089      {
    20832090        if(a) as++;
    20842091        else   s++;
    2085              }
    2086       else G4cerr<<"***G4QPDGCode::GetQCont:3 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
     2092      }
     2093      else G4cerr<<"*G4QPDGC::GetQCont:3 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
    20872094      return G4QContent(d,u,s,ad,au,as);
    2088            }
     2095    }
    20892096    else        // Mesons
    2090            {
     2097    {
    20912098      if(f==v)
    2092              {
     2099      {
    20932100        if     (f==1) return G4QContent(1,0,0,1,0,0);
    20942101        else if(f==2) return G4QContent(0,1,0,0,1,0);
    20952102        else if(f==3) return G4QContent(0,0,1,0,0,1);
    2096         else G4cerr<<"***G4QPDGCode::GetQCont:4 PDG="<<thePDGCode<<",i="<<f<<","<<v<<","<<t<<G4endl;
    2097              }
     2103        else G4cerr<<"*G4QPDGC::GetQC:4 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
     2104      }
    20982105      else
    2099              {
     2106      {
    21002107        if     (f==1 && v==2)
    21012108        {
     
    21132120          else return G4QContent(0,1,0,0,0,1);
    21142121        }
    2115         else G4cerr<<"***G4QPDGCode::GetQCont:5 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
    2116              }
    2117            }
     2122        else G4cerr<<"*G4QPDGC::GetQC:5 PDG="<<thePDGCode<<","<<f<<","<<v<<","<<t<<G4endl;
     2123      }
     2124    }
    21182125  }
    21192126  else                   
     
    22142221  if(theQCode<fragmStart) return 7;
    22152222  G4int sub=theQCode-fragmStart;
    2216   if ( (sub > 1 && sub < 8) || sub == 15) return 7; //@@Why they are in clusters?-Residuals(?)
     2223  if ( (sub > 1 && sub < 8) || sub == 15) return 7;//Why they are in clusters?-Residuals(?)
    22172224  G4int rel=sub;                         // case of nuclear baryons and isonuclei
    22182225  if     (sub>31)rel =(sub-32)%15;       // case of heavy fragments (BaryNum>3)
     
    22782285  {
    22792286    G4int shiftQ=GetRelCrossIndex(i, o);
    2280     G4int sQCode=theQCode;                        // QCode of the parent cluster
    2281     if     (shiftQ==7) return 0;                  // A parent cluster doesn't exist
    2282     else if(!shiftQ) sQCode+=shiftQ;              // Shift QCode of son to QCode of his parent
    2283     G4QPDGCode parent;                            // Create a temporary (fake) parent cluster
    2284     parent.InitByQCode(sQCode);                   // Initialize it by Q-Code
    2285     G4QContent parentQC=parent.GetQuarkContent(); // Quark Content of the parent cluster
     2287    G4int sQCode=theQCode;                     // QCode of the parent cluster
     2288    if     (shiftQ==7) return 0;               // A parent cluster doesn't exist
     2289    else if(!shiftQ) sQCode+=shiftQ;           // Shift QCode of son to QCode of his parent
     2290    G4QPDGCode parent;                         // Create a temporary (fake) parent cluster
     2291    parent.InitByQCode(sQCode);                // Initialize it by Q-Code
     2292    G4QContent parentQC=parent.GetQuarkContent();// Quark Content of the parent cluster
    22862293    if     (!o)   return parentQC.GetD();
    22872294    else if(o==1) return parentQC.GetU();
     
    23242331    {
    23252332      if(cz>500000) cz-=1000000;                   // AntiProtons
    2326                                   z=cz/1000;                                   // Number of protons
     2333      z=cz/1000;                                   // Number of protons
    23272334      r-=cz;                                       // Subtract them from the residual
    23282335      if(r==90000000) return;
     
    23322339    {
    23332340      if(cs>5000000) cs-=10000000;                 // AntiLambda
    2334                                   s=cs/1000000;                                // Number of Lambdas
     2341      s=cs/1000000;                                // Number of Lambdas
    23352342    }
    23362343  }
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPDGToG4Particle.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QPDGToG4Particle.cc,v 1.5 2006/06/29 20:07:09 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QPDGToG4Particle.cc,v 1.6 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// ---------------- G4QG4ToG4Particle singletone class ------------------
     
    3535// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3636// ****************************************************************************************
     37// Short description: This is a helper class, which converts the PDG-defined
     38// G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones.
     39// -----------------------------------------------------------------------------
     40
    3741
    3842//#define pdebug
     
    6165  if(!PDG) return 0;
    6266  else if(PDG>0)     // Positive PDG Code
    63                 {
     67  {
    6468    if(PDG<100)
    6569    {
     
    7377        }
    7478        else
    75                                                                 {
     79        {
    7680          if(PDG<15)
    7781          {
     
    8993    } // End of the Lepton definition
    9094    else if(PDG<1000)
    91                                 {
     95    {
    9296      if(PDG<420)
    9397      {
     
    111115      }
    112116      else
    113                                                 {
     117      {
    114118        if(PDG<500)
    115119        {
     
    129133    } // Emd of the Meson definition
    130134    else
    131                                 {
     135    {
    132136      if(PDG<3333)
    133137      {
     
    137141          {
    138142            if(PDG==2112) return G4Neutron::Neutron();
    139                                                       else if(PDG==2212) return G4Proton::Proton();
     143            else if(PDG==2212) return G4Proton::Proton();
    140144            else return 0; // @@ Warning can be added
    141145          }
     
    199203  }
    200204  else               // Negative PDG Code
    201                 {
    202                   G4int aPDG=-PDG;
     205  {
     206    G4int aPDG=-PDG;
    203207#ifdef pdebug
    204208    G4cout<<"G4QPDGToG4Particle:Antiparticle PDG="<<PDG<<G4endl;
     
    214218        }
    215219        else
    216                                                                 {
     220        {
    217221          if(aPDG<15)
    218222          {
     
    230234    } // End of the Anti-Lepton definition
    231235    else if(aPDG<1000)
    232                                 {
     236    {
    233237#ifdef pdebug
    234238      G4cout<<"G4QPDGToG4Particle:AntiMesons aPDG="<<aPDG<<G4endl;
     
    282286    } // Emd of the Anti-Meson definition
    283287    else
    284                                 {
     288    {
    285289      if(aPDG<3333)
    286290      {
     
    290294          {
    291295            if(aPDG==2112) return G4AntiNeutron::AntiNeutron();
    292                                                       else if(aPDG==2212) return G4AntiProton::AntiProton();
     296            else if(aPDG==2212) return G4AntiProton::AntiProton();
    293297            else return 0; // @@ Warning can be added
    294298          }
     
    357361// ==========================================
    358362{
    359                 //======== LEPTONS =========
     363  //======== LEPTONS =========
    360364  G4Gamma::GammaDefinition();
    361365  G4MuonPlus::MuonPlusDefinition();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParentCluster.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParentCluster.cc,v 1.25 2006/11/27 10:44:55 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParentCluster.cc,v 1.26 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QParentCluster ----------------
    3131//             by Mikhail Kossov, Sept 1999.
    3232//      class fora Parent nuclear cluster in the CHIPS Model
    33 // ----------------------------------------------------------
    34 
     33// -------------------------------------------------------------------
     34// Short description: The parent cluster is the cluster, which can be
     35// used for the nuclear fragment production. Different clusters csn be
     36// used as the parent cluser for the particular G4QCandidate (nuclear
     37// fragment), e.g. t and He3 for the t-fragment production. So the
     38// G4QParentClusterVector is needed.
     39// -------------------------------------------------------------------
    3540//#define debug
    3641//#define pdebug
     
    3843#include "G4QParentClusterVector.hh"
    3944
    40 G4QParentCluster::G4QParentCluster(G4int PDGCode): thePDGCode(PDGCode), theProbability(0.){}
     45G4QParentCluster::G4QParentCluster(G4int PDGCode): thePDGCode(PDGCode),theProbability(0.){}
    4146
    4247G4QParentCluster::G4QParentCluster(G4int PDGCode, G4double prob):
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParticle.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParticle.cc,v 1.33 2006/11/27 10:44:55 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParticle.cc,v 1.34 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QParticle ----------------
     
    3434//       1         2         3         4         5         6         7         8         9
    3535//34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
    36  
     36// -----------------------------------------------------------------------
     37// Short description: The G4QParticle is a part of the CHIPS World. It is
     38// characterized by the quark content, spin, mass, width and a vector of
     39// the decay channels (G4QDecayCannelVector).
     40// -----------------------------------------------------------------------
    3741//#define debug
    3842//#define pdebug
     
    143147      else   lhs << ",";
    144148      lhs << PCV[j]->GetPDGCode() ;
    145            }
     149    }
    146150  }
    147151  return lhs;
     
    170174    //if(limit<=  6 && nQ>=  6)DecayDB[  6] = 0;    // gamma  (22)
    171175    if(limit<=  7 && nQ>=  7)                       // Z0     (23)
    172            {
     176    {
    173177      DecayDB[  7].push_back(new G4QDecayChan(.036,  11, -11));
    174178      DecayDB[  7].push_back(new G4QDecayChan(.073,  13, -13));
     
    184188      DecayDB[  7].push_back(new G4QDecayChan(.990,2112,-2212, 211));
    185189      DecayDB[  7].push_back(new G4QDecayChan(1.00,2112,-3122, 111));
    186            }
     190    }
    187191    if(limit<=  8 && nQ>=  8)                       // W-     (24) @@ Update HadronicDecays
    188            {
     192    {
    189193      DecayDB[  8].push_back(new G4QDecayChan(.107,  11, -12));
    190194      DecayDB[  8].push_back(new G4QDecayChan(.214,  13, -14));
     
    197201      DecayDB[  8].push_back(new G4QDecayChan(.921,3122,-2212, 111));
    198202      DecayDB[  8].push_back(new G4QDecayChan(1.00,2112,-3122,-211));
    199            }
     203    }
    200204    //if(limit<=  9 && nQ>=  9)DecayDB[  9] = 0;    // H0     (25)
    201205    //if(limit<= 10 && nQ>= 10)DecayDB[ 10] = 0;    // H-     (37)
    202206    if(limit<= 11 && nQ>= 11)    // Low sigma=pi,pi S-wave : f_0 (800)
    203            {
     207    {
    204208      DecayDB[ 11].push_back(new G4QDecayChan(.333,211,-211));
    205209      DecayDB[ 11].push_back(new G4QDecayChan(1.00,111, 111));
    206            }
     210    }
    207211    if(limit<= 12 && nQ>= 12)    // Midle Regeon-Pomeron   : f_0 (980)
    208            {
     212    {
    209213      DecayDB[ 12].push_back(new G4QDecayChan(.333,211,-211));
    210214      DecayDB[ 12].push_back(new G4QDecayChan(1.00,111, 111));
    211            }
     215    }
    212216    if(limit<= 13 && nQ>= 13)    // High Regeon-Pomeron    : f_0 (1500)
    213            {
     217    {
    214218      DecayDB[ 13].push_back(new G4QDecayChan(.019,221, 331));
    215219      DecayDB[ 13].push_back(new G4QDecayChan(.070,221, 221));
     
    218222      DecayDB[ 13].push_back(new G4QDecayChan(.578,211,-211)); //@@ include 4pi decays
    219223      DecayDB[ 13].push_back(new G4QDecayChan(1.00,111, 111));
    220            }
     224    }
    221225    //if(limit<= 14 && nQ>= 14)DecayDB[ 14].push_back(new G4QDecayChan(1.00,22,22));//Pi0
    222226    //if(limit<= 15 && nQ>= 15)DecayDB[ 15] = 0;    // Pi +
    223227    if(limit<= 16 && nQ>= 16)    // eta
    224            {
     228    {
    225229      DecayDB[ 16].push_back(new G4QDecayChan(.226,211,-211,111));
    226230      DecayDB[ 16].push_back(new G4QDecayChan(.551,111, 111,111));
     
    228232      DecayDB[ 16].push_back(new G4QDecayChan(.606, 11, -11, 22)); //@@ .002 (pi+)(pi-)2gam
    229233      DecayDB[ 16].push_back(new G4QDecayChan(1.00, 22,  22));
    230            }
     234    }
    231235    //if(limit<= 17 && nQ>= 17)    // K 0 (K_short - probab 1/2) @@@@@@@@@@@@
    232            //{
     236    //{
    233237    //  DecayDB[ 17].push_back(new G4QDecayChan(.6861,211,-211));
    234238    //  DecayDB[ 17].push_back(new G4QDecayChan(1.00, 111, 111));
    235            //}
     239    //}
    236240    //if(limit<= 18 && nQ>= 18)DecayDB[  8] = 0;    // K +
    237241    if(limit<= 19 && nQ>= 19)    // eta'
    238            {
     242    {
    239243      DecayDB[ 19].push_back(new G4QDecayChan(.443,211,-211,221));
    240244      DecayDB[ 19].push_back(new G4QDecayChan(.652,111, 111,221));
     
    243247      DecayDB[ 19].push_back(new G4QDecayChan(.979, 22, 113));
    244248      DecayDB[ 19].push_back(new G4QDecayChan(1.00, 22,  22));
    245            }
     249    }
    246250    //if(limit<= 20 && nQ>= 20)DecayDB[ 20] = 0;    // n
    247251    //if(limit<= 21 && nQ>= 21)DecayDB[ 21] = 0;    // p
    248252    //if(limit<= 22 && nQ>= 22)    // Lambda ===>>> all week decays are closed at this time
    249            //{
     253    //{
    250254    //  DecayDB[ 22].push_back(new G4QDecayChan(.640,2212,-211));
    251255    //  DecayDB[ 22].push_back(new G4QDecayChan(1.00,2112, 111));
    252            //}
     256    //}
    253257    //if(limit<= 23 &&nQ>=23)DecayDB[23].push_back(new G4QDecayChan(1.,2112,-211));//Sigma-
    254258    if(limit<= 24 &&nQ>=24)DecayDB[24].push_back(new G4QDecayChan(1.,3122,22));//Sigma0(EM)
    255259    //if(limit<= 25 && nQ>= 25)    // Sigma +
    256            //{
     260    //{
    257261    //  DecayDB[ 25].push_back(new G4QDecayChan(.484,2112, 211));
    258262    //  DecayDB[ 25].push_back(new G4QDecayChan(1.00,2212, 111));
    259            //}
     263    //}
    260264    //if(limit<= 26 && nQ>=26)DecayDB[26].push_back(new G4QDecayChan(1.,3122,-211));// Ksi-
    261265    //if(limit<= 27 && nQ>=27)DecayDB[27].push_back(new G4QDecayChan(1.,3122, 111));// Ksi0
     
    263267    if(limit<= 29 && nQ>= 29)DecayDB[ 29].push_back(new G4QDecayChan(1., 211, 111));// rho+
    264268    if(limit<= 30 && nQ>= 30)    // omega
    265            {
     269    {
    266270      DecayDB[ 30].push_back(new G4QDecayChan(.891, 211,-211,111));
    267271      DecayDB[ 30].push_back(new G4QDecayChan(.908, 211,-211));
     
    270274      DecayDB[ 30].push_back(new G4QDecayChan(.998,  13, -13, 111));
    271275      DecayDB[ 30].push_back(new G4QDecayChan(1.00,  22, 221));
    272            }
     276    }
    273277    if(limit<= 31 && nQ>= 31)    // K* 0
    274            {
     278    {
    275279      DecayDB[ 31].push_back(new G4QDecayChan(.667,-211, 321));
    276280      DecayDB[ 31].push_back(new G4QDecayChan(1.00, 111, 311));
    277            }
     281    }
    278282    if(limit<= 32 && nQ>= 32)    // K* +
    279            {
     283    {
    280284      DecayDB[ 32].push_back(new G4QDecayChan(.667, 211, 311));
    281285      DecayDB[ 32].push_back(new G4QDecayChan(1.00, 111, 321));
    282            }
     286    }
    283287    if(limit<= 33 && nQ>= 33)    // phi
    284            {
     288    {
    285289      DecayDB[ 33].push_back(new G4QDecayChan(.491, 311,-311));
    286290      DecayDB[ 33].push_back(new G4QDecayChan(.831, 321,-321));
     
    290294      DecayDB[ 33].push_back(new G4QDecayChan(.948,-211, 213));
    291295      DecayDB[ 33].push_back(new G4QDecayChan(1.00, 111, 113));
    292            }
     296    }
    293297    if(limit<= 34 && nQ>= 34)DecayDB[34].push_back(new G4QDecayChan(1.,2112,-211));//Delta-
    294298    if(limit<= 35 && nQ>= 35)    // Delta 0
    295            {
     299    {
    296300      DecayDB[ 35].push_back(new G4QDecayChan(.333,2212,-211));
    297301      DecayDB[ 35].push_back(new G4QDecayChan(1.00,2112, 111));
    298            }
     302    }
    299303    if(limit<= 36 && nQ>= 36)    // Delta +
    300            {
     304    {
    301305      DecayDB[ 36].push_back(new G4QDecayChan(.333,2112, 211));
    302306      DecayDB[ 36].push_back(new G4QDecayChan(1.00,2212, 111));
    303            }
     307    }
    304308    if(limit<= 37 && nQ>= 37)DecayDB[37].push_back(new G4QDecayChan(1.,2212,211));//Delta++
    305309    if(limit<= 38 && nQ>= 38)    // Lambda* (1520)
    306            {
     310    {
    307311      DecayDB[ 38].push_back(new G4QDecayChan(.225,3112,-311));
    308312      DecayDB[ 38].push_back(new G4QDecayChan(.450,3222,-321));
     
    317321      DecayDB[ 38].push_back(new G4QDecayChan(.982,3112, 211));
    318322      DecayDB[ 38].push_back(new G4QDecayChan(1.00,3122,  22));
    319            }
     323    }
    320324    if(limit<= 39 && nQ>= 39)    // Sigma* -
    321            {
     325    {
    322326      DecayDB[ 39].push_back(new G4QDecayChan(.060,3112, 111));
    323327      DecayDB[ 39].push_back(new G4QDecayChan(.120,3212,-211));
    324328      DecayDB[ 39].push_back(new G4QDecayChan(1.00,3122,-211));
    325            }
     329    }
    326330    if(limit<= 40 && nQ>= 40)    // Sigma* 0
    327            {
     331    {
    328332      DecayDB[ 40].push_back(new G4QDecayChan(.040,3112, 211));
    329333      DecayDB[ 40].push_back(new G4QDecayChan(.080,3222,-211));
    330334      DecayDB[ 40].push_back(new G4QDecayChan(.120,3212, 111));
    331335      DecayDB[ 40].push_back(new G4QDecayChan(1.00,3122, 111));
    332            }
     336    }
    333337    if(limit<= 41 && nQ>= 41)    // Sigma* +
    334            {
     338    {
    335339      DecayDB[ 41].push_back(new G4QDecayChan(.060,3212, 211));
    336340      DecayDB[ 41].push_back(new G4QDecayChan(.120,3222, 111));
    337341      DecayDB[ 41].push_back(new G4QDecayChan(1.00,3122, 211));
    338            }
     342    }
    339343    if(limit<= 42 && nQ>= 42)    // Ksi* -
    340            {
     344    {
    341345      DecayDB[ 42].push_back(new G4QDecayChan(.667,3322,-211));
    342346      DecayDB[ 42].push_back(new G4QDecayChan(1.00,3312, 111));
    343            }
     347    }
    344348    if(limit<= 43 && nQ>= 43)    // Ksi* 0
    345            {
     349    {
    346350      DecayDB[ 43].push_back(new G4QDecayChan(.667,3312, 211));
    347351      DecayDB[ 43].push_back(new G4QDecayChan(1.00,3322, 111));
    348            }
     352    }
    349353    //if(limit<= 44 && nQ>= 44)    // OMEGA - (Weak)
    350            //{
     354    //{
    351355    //  DecayDB[ 44].push_back(new G4QDecayChan(.678,3122, 321));
    352356    //  DecayDB[ 44].push_back(new G4QDecayChan(.914,3322,-211));
    353357    //  DecayDB[ 44].push_back(new G4QDecayChan(1.00,3312, 111));
    354            //}
     358    //}
    355359    if(limit<= 45 && nQ>= 45)    // a_2 0
    356            {
     360    {
    357361      DecayDB[ 45].push_back(new G4QDecayChan(.070, 211,-211,223));
    358362      DecayDB[ 45].push_back(new G4QDecayChan(.106, 111, 111,223));
     
    363367      DecayDB[ 45].push_back(new G4QDecayChan(.767, 211,-213));
    364368      DecayDB[ 45].push_back(new G4QDecayChan(1.00, 111, 113));
    365            }
     369    }
    366370    if(limit<= 46 && nQ>= 46)    // a_2 +
    367            {
     371    {
    368372      DecayDB[ 46].push_back(new G4QDecayChan(.106,111,211,223));
    369373      DecayDB[ 46].push_back(new G4QDecayChan(.156, 321,-311));
     
    371375      DecayDB[ 46].push_back(new G4QDecayChan(.651, 211, 113));
    372376      DecayDB[ 46].push_back(new G4QDecayChan(1.00, 111, 213));
    373            }
     377    }
    374378    if(limit<= 47 && nQ>= 47)    // f_2 0
    375            {
     379    {
    376380      DecayDB[ 47].push_back(new G4QDecayChan(.005, 221, 221));
    377381      DecayDB[ 47].push_back(new G4QDecayChan(.028, 311,-311));
     
    382386      DecayDB[ 47].push_back(new G4QDecayChan(.717, 211,-211));
    383387      DecayDB[ 47].push_back(new G4QDecayChan(1.00, 111, 111));
    384            }
     388    }
    385389    if(limit<= 48 && nQ>= 48)    // K_2 0
    386            {
     390    {
    387391      DecayDB[ 48].push_back(new G4QDecayChan(.028, 311, 223));
    388392      DecayDB[ 48].push_back(new G4QDecayChan(.074, 211,-211,313));
     
    395399      DecayDB[ 48].push_back(new G4QDecayChan(.750,-211, 321));
    396400      DecayDB[ 48].push_back(new G4QDecayChan(1.00, 111, 311));
    397            }
     401    }
    398402    if(limit<= 49 && nQ>= 49)    // K_2 +
    399            {
     403    {
    400404      DecayDB[ 49].push_back(new G4QDecayChan(.028, 321, 223));
    401405      DecayDB[ 49].push_back(new G4QDecayChan(.074,211,-211,323));
     
    408412      DecayDB[ 49].push_back(new G4QDecayChan(.750, 211, 311));
    409413      DecayDB[ 49].push_back(new G4QDecayChan(1.00, 111, 321));
    410            }
     414    }
    411415    if(limit<= 50 && nQ>= 50)    // f_2' 0
    412            {
     416    {
    413417      DecayDB[ 50].push_back(new G4QDecayChan(.103, 221, 221));
    414418      DecayDB[ 50].push_back(new G4QDecayChan(.547, 311,-311));
     
    416420      DecayDB[ 50].push_back(new G4QDecayChan(.997, 211,-211));
    417421      DecayDB[ 50].push_back(new G4QDecayChan(1.00, 111, 111));
    418            }
     422    }
    419423    if(limit<= 51 && nQ>= 51)    // N_5/2 0
    420            {
     424    {
    421425      DecayDB[ 51].push_back(new G4QDecayChan(.040, 211, 1114));
    422426      DecayDB[ 51].push_back(new G4QDecayChan(.080, 111, 2114));
     
    427431      DecayDB[ 51].push_back(new G4QDecayChan(.780, 2212,-211));
    428432      DecayDB[ 51].push_back(new G4QDecayChan(1.00, 2112, 111));
    429            }
     433    }
    430434    if(limit<= 52 && nQ>= 52)    // N_5/2 +
    431            {
     435    {
    432436      DecayDB[ 52].push_back(new G4QDecayChan(.040,-211, 2224));
    433437      DecayDB[ 52].push_back(new G4QDecayChan(.080, 211, 2114));
     
    438442      DecayDB[ 52].push_back(new G4QDecayChan(.780, 2112, 211));
    439443      DecayDB[ 52].push_back(new G4QDecayChan(1.00, 2212, 111));
    440            }
     444    }
    441445    if(limit<= 53 && nQ>= 53)    // LAMBDA_5/2
    442            {
     446    {
    443447      DecayDB[ 53].push_back(new G4QDecayChan(.350, 2112,-311));
    444448      DecayDB[ 53].push_back(new G4QDecayChan(.700, 2212,-321));
     
    449453      DecayDB[ 53].push_back(new G4QDecayChan(.940, 3222,-211));
    450454      DecayDB[ 53].push_back(new G4QDecayChan(1.00, 3212, 111));
    451            }
     455    }
    452456    if(limit<= 54 && nQ>= 54)    // SIGMA_5/2 -
    453            {
     457    {
    454458      DecayDB[ 54].push_back(new G4QDecayChan(.600, 2112,-321));
    455459      DecayDB[ 54].push_back(new G4QDecayChan(.660,-211, 3214));
     
    458462      DecayDB[ 54].push_back(new G4QDecayChan(.900, 3112, 111));
    459463      DecayDB[ 54].push_back(new G4QDecayChan(1.00, 3122,-211));
    460            }
     464    }
    461465    if(limit<= 55 && nQ>= 55)    // SIGMA_5/2 0
    462            {
     466    {
    463467      DecayDB[ 55].push_back(new G4QDecayChan(.300, 2112,-311));
    464468      DecayDB[ 55].push_back(new G4QDecayChan(.600, 2212,-321));
     
    470474      DecayDB[ 55].push_back(new G4QDecayChan(.900, 3212, 111));
    471475      DecayDB[ 55].push_back(new G4QDecayChan(1.00, 3122, 111));
    472            }
     476    }
    473477    if(limit<= 56 && nQ>= 56)    // SIGMA_5/2 +
    474            {
     478    {
    475479      DecayDB[ 56].push_back(new G4QDecayChan(.600, 2212,-311));
    476480      DecayDB[ 56].push_back(new G4QDecayChan(.660, 211, 3214));
     
    479483      DecayDB[ 56].push_back(new G4QDecayChan(.900, 3222, 111));
    480484      DecayDB[ 56].push_back(new G4QDecayChan(1.00, 3122, 211));
    481            }
     485    }
    482486    if(limit<= 57 && nQ>= 57)    // KSI_5/2 -
    483            {
     487    {
    484488      DecayDB[ 57].push_back(new G4QDecayChan(.400, 3112,-311));
    485489      DecayDB[ 57].push_back(new G4QDecayChan(.800, 3212,-321));
    486490      DecayDB[ 57].push_back(new G4QDecayChan(1.00, 3122,-321));
    487            }
     491    }
    488492    if(limit<= 58 && nQ>= 58)    // KSI_5/2 0
    489            {
     493    {
    490494      DecayDB[ 58].push_back(new G4QDecayChan(.400, 3212,-311));
    491495      DecayDB[ 58].push_back(new G4QDecayChan(.800, 3222,-321));
    492496      DecayDB[ 58].push_back(new G4QDecayChan(1.00, 3122,-311));
    493            }
     497    }
    494498    if(limit<= 59 && nQ>= 59)    // rho_3 0
    495            {
     499    {
    496500      DecayDB[ 59].push_back(new G4QDecayChan(.019,311,-313));
    497501      DecayDB[ 59].push_back(new G4QDecayChan(.038,321,-323));
     
    503507      DecayDB[ 59].push_back(new G4QDecayChan(.764,111, 111,113));
    504508      DecayDB[ 59].push_back(new G4QDecayChan(1.00,211,-211));
    505            }
     509    }
    506510    if(limit<= 60 && nQ>= 60)    // rho_3 +
    507            {
     511    {
    508512      DecayDB[ 60].push_back(new G4QDecayChan(.019, 321,-313));
    509513      DecayDB[ 60].push_back(new G4QDecayChan(.038,-311, 323));
     
    514518      DecayDB[ 60].push_back(new G4QDecayChan(.764,211,111,113));
    515519      DecayDB[ 60].push_back(new G4QDecayChan(1.00, 211, 111));
    516            }
     520    }
    517521    if(limit<= 61 && nQ>= 61)    // omega_3
    518            {
     522    {
    519523      DecayDB[ 61].push_back(new G4QDecayChan(.020,211,-211,223));
    520524      DecayDB[ 61].push_back(new G4QDecayChan(.040,111, 111,223));
     
    522526      DecayDB[ 61].push_back(new G4QDecayChan(.080,-211, 213));
    523527      DecayDB[ 61].push_back(new G4QDecayChan(1.00, 111, 113));
    524            }
     528    }
    525529    if(limit<= 62 && nQ>= 62)    // K_3 0
    526            {
     530    {
    527531      DecayDB[ 62].push_back(new G4QDecayChan(.030, 111, 315));
    528532      DecayDB[ 62].push_back(new G4QDecayChan(.060,-211, 325));
     
    534538      DecayDB[ 62].push_back(new G4QDecayChan(.940,-211, 321));
    535539      DecayDB[ 62].push_back(new G4QDecayChan(1.00, 111, 311));
    536            }
     540    }
    537541    if(limit<= 63 && nQ>= 63)    // K_3 +
    538            {
     542    {
    539543      DecayDB[ 63].push_back(new G4QDecayChan(.030, 211, 315));
    540544      DecayDB[ 63].push_back(new G4QDecayChan(.060, 111, 325));
     
    546550      DecayDB[ 63].push_back(new G4QDecayChan(.940, 211, 311));
    547551      DecayDB[ 63].push_back(new G4QDecayChan(1.00, 111, 321));
    548            }
     552    }
    549553    if(limit<= 64 && nQ>= 64)    // phi_3
    550            {
     554    {
    551555      DecayDB[ 64].push_back(new G4QDecayChan(.250, 321,-321));
    552556      DecayDB[ 64].push_back(new G4QDecayChan(.500, 311,-311));
     
    555559      DecayDB[ 64].push_back(new G4QDecayChan(.875, 311,-313));
    556560      DecayDB[ 64].push_back(new G4QDecayChan(1.00,-311, 313));
    557            }
     561    }
    558562    if(limit<= 65 && nQ>= 65)    // DELTA_7/2 -
    559            {
     563    {
    560564      DecayDB[ 65].push_back(new G4QDecayChan(.200, 2112,-213 ));
    561565      DecayDB[ 65].push_back(new G4QDecayChan(.320,-211 , 2114));
    562566      DecayDB[ 65].push_back(new G4QDecayChan(.500, 111 , 1114));
    563567      DecayDB[ 65].push_back(new G4QDecayChan(1.00, 2112,-211 ));
    564            }
     568    }
    565569    if(limit<= 66 && nQ>= 66)    // DELTA_7/2 0
    566            {
     570    {
    567571      DecayDB[ 66].push_back(new G4QDecayChan(.133, 2112, 113 ));
    568572      DecayDB[ 66].push_back(new G4QDecayChan(.200, 2212,-213 ));
     
    572576      DecayDB[ 66].push_back(new G4QDecayChan(.666, 2212,-211 ));
    573577      DecayDB[ 66].push_back(new G4QDecayChan(1.00, 2112, 111 ));
    574            }
     578    }
    575579    if(limit<= 67 && nQ>= 67)    // DELTA_7/2 +
    576            {
     580    {
    577581      DecayDB[ 67].push_back(new G4QDecayChan(.133, 2112, 213 ));
    578582      DecayDB[ 67].push_back(new G4QDecayChan(.200, 2212, 113 ));
     
    582586      DecayDB[ 67].push_back(new G4QDecayChan(.666, 2112, 211 ));
    583587      DecayDB[ 67].push_back(new G4QDecayChan(1.00, 2212, 111 ));
    584            }
     588    }
    585589    if(limit<= 68 && nQ>= 68)    // DELTA_7/2 ++
    586            {
     590    {
    587591      DecayDB[ 68].push_back(new G4QDecayChan(.200, 2212, 213 ));
    588592      DecayDB[ 68].push_back(new G4QDecayChan(.320, 211 , 2214));
    589593      DecayDB[ 68].push_back(new G4QDecayChan(.500, 111 , 2224));
    590594      DecayDB[ 68].push_back(new G4QDecayChan(1.00, 2212, 211 ));
    591            }
     595    }
    592596    if(limit<= 69 && nQ>= 69)     // LAMBDA_7/2
    593            {
     597    {
    594598      DecayDB[ 69].push_back(new G4QDecayChan(.160, 3122, 223 ));
    595599      DecayDB[ 69].push_back(new G4QDecayChan(.260, 2112,-313 ));
     
    603607      DecayDB[ 69].push_back(new G4QDecayChan(.800, 3222,-211 ));
    604608      DecayDB[ 69].push_back(new G4QDecayChan(1.00, 3212, 111 ));
    605            }
     609    }
    606610    if(limit<= 70 && nQ>= 70)    // SIGMA_7/2 -
    607            {
     611    {
    608612      DecayDB[ 70].push_back(new G4QDecayChan(.030, 2112,-323 ));
    609613      DecayDB[ 70].push_back(new G4QDecayChan(.165,-311 , 1114));
     
    617621      DecayDB[ 70].push_back(new G4QDecayChan(.780,-321 , 2112));
    618622      DecayDB[ 70].push_back(new G4QDecayChan(1.00,-211 , 3122));
    619            }
     623    }
    620624    if(limit<= 71 && nQ>= 71)    // SIGMA_7/2 0
    621            {
     625    {
    622626      DecayDB[ 71].push_back(new G4QDecayChan(.015, 2112,-313 ));
    623627      DecayDB[ 71].push_back(new G4QDecayChan(.030, 2212,-321 ));
     
    634638      DecayDB[ 71].push_back(new G4QDecayChan(.780,-321 , 2212));
    635639      DecayDB[ 71].push_back(new G4QDecayChan(1.00, 111 , 3122));
    636            }
     640    }
    637641    if(limit<= 72 && nQ>= 72)    // SIGMA_7/2 +
    638            {
     642    {
    639643      DecayDB[ 72].push_back(new G4QDecayChan(.030, 2212,-313 ));
    640644      DecayDB[ 72].push_back(new G4QDecayChan(.165,-321 , 2224));
     
    648652      DecayDB[ 72].push_back(new G4QDecayChan(.780,-311 , 2212));
    649653      DecayDB[ 72].push_back(new G4QDecayChan(1.00, 211 , 3122));
    650            }
     654    }
    651655    if(limit<= 73 && nQ>= 73)    // KSI_7/2 -
    652            {
     656    {
    653657      DecayDB[ 73].push_back(new G4QDecayChan(.400, 3112,-311));
    654658      DecayDB[ 73].push_back(new G4QDecayChan(.800, 3212,-321));
    655659      DecayDB[ 73].push_back(new G4QDecayChan(1.00, 3122,-321));
    656            }
     660    }
    657661    if(limit<= 74 && nQ>= 74)    // KSI_7/2 0
    658            {
     662    {
    659663      DecayDB[ 74].push_back(new G4QDecayChan(.400, 3212,-311));
    660664      DecayDB[ 74].push_back(new G4QDecayChan(.800, 3222,-321));
    661665      DecayDB[ 74].push_back(new G4QDecayChan(1.00, 3122,-311));
    662            }
     666    }
    663667    if(limit<= 75 && nQ>= 75)    // OMEGA_7/2 -
    664            {
     668    {
    665669      DecayDB[ 75].push_back(new G4QDecayChan(.250,-311 , 3314));
    666670      DecayDB[ 75].push_back(new G4QDecayChan(.500,-321 , 3324));
    667671      DecayDB[ 75].push_back(new G4QDecayChan(.750, 3312,-313 ));
    668672      DecayDB[ 75].push_back(new G4QDecayChan(1.00, 3322,-323 ));
    669            }
     673    }
    670674    if(limit<= 76 && nQ>= 76)    // a_4 0
    671            {
     675    {
    672676      DecayDB[ 76].push_back(new G4QDecayChan(.200, 311,-311));
    673677      DecayDB[ 76].push_back(new G4QDecayChan(.400, 321,-321));
    674678      DecayDB[ 76].push_back(new G4QDecayChan(.600, 111, 221));
    675679      DecayDB[ 76].push_back(new G4QDecayChan(1.00, 111, 211,-211));
    676            }
     680    }
    677681    if(limit<= 77 && nQ>= 77)    // a_4 +
    678            {
     682    {
    679683      DecayDB[ 77].push_back(new G4QDecayChan(.400, 321,-311));
    680684      DecayDB[ 77].push_back(new G4QDecayChan(.600, 211, 221));
    681685      DecayDB[ 77].push_back(new G4QDecayChan(.800, 211, 211,-211));
    682686      DecayDB[ 77].push_back(new G4QDecayChan(1.00, 211, 111, 111));
    683            }
     687    }
    684688    if(limit<= 78 && nQ>= 78)    // f_4 0
    685            {
     689    {
    686690      DecayDB[ 78].push_back(new G4QDecayChan(.020, 333, 333));
    687691      DecayDB[ 78].push_back(new G4QDecayChan(.340, 223, 223));
     
    693697      DecayDB[ 78].push_back(new G4QDecayChan(.940, 211,-211));
    694698      DecayDB[ 78].push_back(new G4QDecayChan(1.00, 111, 111));
    695            }
     699    }
    696700    if(limit<= 79 && nQ>= 79)    // K_4 0
    697            {
     701    {
    698702      DecayDB[ 79].push_back(new G4QDecayChan(.060, 333, 313));
    699703      DecayDB[ 79].push_back(new G4QDecayChan(.260, 223, 313));
     
    707711      DecayDB[ 79].push_back(new G4QDecayChan(.900, 311, 111));
    708712      DecayDB[ 79].push_back(new G4QDecayChan(1.00, 321,-211));
    709            }
     713    }
    710714    if(limit<= 80 && nQ>= 80)    // K_4 +
    711            {
     715    {
    712716      DecayDB[ 80].push_back(new G4QDecayChan(.060, 333, 323));
    713717      DecayDB[ 80].push_back(new G4QDecayChan(.260, 223, 323));
     
    721725      DecayDB[ 80].push_back(new G4QDecayChan(.900, 311, 211));
    722726      DecayDB[ 80].push_back(new G4QDecayChan(1.00, 321, 111));
    723            }
     727    }
    724728    if(limit<=81&&nQ>=81)DecayDB[81].push_back(new G4QDecayChan(1., 333,333));//phi_4(2300)
    725729    if(limit<=82&&nQ>=82)DecayDB[82].push_back(new G4QDecayChan(1.,2212, 2224));//pDelta++
     
    762766    // ------- Nuclear fragments
    763767    //if(limit<=114 && nQ>=114)
    764            //{
     768    //{
    765769    //  if(limit<114) limit=101;
    766770    //  for (int i=limit; i<nQ; i++) DecayDB[i] = 0;
    767771    //}
    768            //Update the limit
     772    //Update the limit
    769773    limit=nQ+1;
    770774#ifdef debug
    771            G4cout<<"G4QParticle::InitDecayVector: limit is set to "<<limit<<G4endl;
     775    G4cout<<"G4QParticle::InitDecayVector: limit is set to "<<limit<<G4endl;
    772776#endif
    773777  }
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParton.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QParton.cc,v 1.3 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QParton.cc,v 1.4 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
     
    3636//   For comparison mirror member functions are taken from G4 class:
    3737//   G4Parton
    38 // ------------------------------------------------------------
    39 
     38// ------------------------------------------------------------------------
     39// Short description: The Quark-Gluon String consists of the partons, which
     40// are quarks and some times gluons.
     41// ------------------------------------------------------------------------
    4042#include "G4QParton.hh"
    4143
    4244G4QParton::G4QParton(G4int PDGcode)
    4345{
    44         PDGencoding=PDGcode;
    45         theX = 0;
    46         theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
    47   G4int aPDG=std::abs(PDGcode);
    48         //___________quarks__ 2 possible codes for gluons _ Condition for di-quarks
    49          if(!aPDG || (aPDG>3 && PDGcode!=9 && PDGcode!=21 && (aPDG>3303||aPDG<1103||aPDG%100>3))
    50      || theDefinition==0)
    51         {
    52                         G4cerr<<"***G4QParton::Constructor: wrong quark/diquark PDG="<<PDGcode<<G4endl;
    53     G4Exception("G4QParton::Constructor:","72",FatalException,"WrongPartonPDG");
    54         }
    55         //
    56         // colour by random in (1,2,3)=(R,G,B) for quarks and
    57         //                  in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
    58   G4int RGB=(G4int)(3*G4UniformRand())+1;
    59         G4String name=theDefinition->GetParticleType();
    60         if(name == "quarks")
    61         {
    62                 if(PDGcode>0) theColour = RGB;
     46  PDGencoding=PDGcode;
     47  theX = 0;
     48  theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
     49       G4int aPDG=std::abs(PDGcode);
     50  //___________quarks__ 2 possible codes for gluons _ Condition for di-quarks
     51  if(!aPDG || (aPDG>3 && PDGcode!=9 && PDGcode!=21 &&
     52          (aPDG>3303||aPDG<1103||aPDG%100>3)) || theDefinition==0)
     53  {
     54    G4cerr<<"***G4QParton::Constructor: wrong quark/diquark PDG="<<PDGcode<<G4endl;
     55         G4Exception("G4QParton::Constructor:","72",FatalException,"WrongPartonPDG");
     56  }
     57  //
     58  // colour by random in (1,2,3)=(R,G,B) for quarks and
     59  //                  in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
     60       G4int RGB=(G4int)(3*G4UniformRand())+1;
     61  G4String name=theDefinition->GetParticleType();
     62  if(name == "quarks")
     63  {
     64    if(PDGcode>0) theColour = RGB;
    6365    else          theColour =-RGB;
    6466  }
    65         // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
    66         //                  in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
    67         else if(name == "diquarks")
     67  // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
     68  //                  in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
     69  else if(name == "diquarks")
    6870  {
    69                 if(PDGcode>0) theColour =-RGB;
     71    if(PDGcode>0) theColour =-RGB;
    7072    else          theColour = RGB;
    71         }
    72          // colour by random in (-11,-12,-13,-21,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons
    73         else if(name == "gluons") theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1);
    74         else
     73  }
     74  // ColourByRandom (-11,-12,-13,-21,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons
     75  else if(name == "gluons") theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1);
     76  else
    7577  {
    76                         G4cerr<<"***G4QParton::Constructor: not quark/diquark/gluon = "
     78    G4cerr<<"***G4QParton::Constructor: not quark/diquark/gluon = "
    7779          <<theDefinition->GetParticleType()<<G4endl;
    7880    G4Exception("G4QParton::Constructor:","72",FatalException,"WrongParton");
    79         }
    80         // isospin-z from PDG-encoded isospin-z for
    81         // quarks, anti-quarks, di-quarks, and anti-di-quarks:
    82          if (name == "quarks" || name == "diquarks")theIsoSpinZ = theDefinition->GetPDGIsospin3();
    83   // isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero):
    84         else
     81  }
     82  // isospin-z from PDG-encoded isospin-z for
     83  // quarks, anti-quarks, di-quarks, and anti-di-quarks:
     84  if(name == "quarks" || name == "diquarks") theIsoSpinZ = theDefinition->GetPDGIsospin3();
     85       // isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero):
     86  else
    8587  {
    86                   G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin();
    87                   if (thisPDGiIsospin == 0) theIsoSpinZ = 0;
    88     //@@ ? M.K.
    89                   else  theIsoSpinZ = ((G4int)((thisPDGiIsospin+1)*G4UniformRand()))-thisPDGiIsospin*0.5;
    90         }
    91         //
    92         // spin-z choosen at random from PDG-encoded spin:
    93         //
    94         G4int thisPDGiSpin=theDefinition->GetPDGiSpin();
    95          if(thisPDGiSpin == 0)  theSpinZ = 0;
    96          else   theSpinZ = (G4int)((thisPDGiSpin+1)*G4UniformRand())-thisPDGiSpin*0.5;;
     88    G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin();
     89    if (thisPDGiIsospin == 0) theIsoSpinZ = 0;
     90         //@@ ? M.K.
     91    else theIsoSpinZ=((G4int)((thisPDGiIsospin+1)*G4UniformRand())) - thisPDGiIsospin*0.5;
     92  }
     93  //
     94  // spin-z choosen at random from PDG-encoded spin:
     95  //
     96  G4int thisPDGiSpin=theDefinition->GetPDGiSpin();
     97  if(thisPDGiSpin == 0) theSpinZ = 0;
     98  else theSpinZ = (G4int)((thisPDGiSpin+1)*G4UniformRand())-thisPDGiSpin*0.5;;
    9799}
    98100
     
    132134    theColour = right.theColour;
    133135    theIsoSpinZ = right.theIsoSpinZ;
    134     theSpinZ = right.theSpinZ; 
     136    theSpinZ = right.theSpinZ; 
    135137  }
    136138  return *this;
     
    139141G4QParton::~G4QParton()
    140142{
    141 //  cout << "G4QParton::~G4QParton(): this = "<<this <<endl;
    142 //  cout << "break here"<<this <<endl;
     143  //G4cout << "G4QParton::~G4QParton(): this = "<<this <<G4endl;
     144  //G4cout << "break here"<<this <<G4endl;
    143145}
    144146
    145147void G4QParton::DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection)
    146148{
    147         G4double Mass = GetMass();
    148         G4LorentzVector a4Momentum = Get4Momentum();
    149         aLightConeMomentum*=theX;
    150         G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
    151         a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum)*(aDirection? 1: -1));
    152         a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
    153         Set4Momentum(a4Momentum);
     149  G4double Mass = GetMass();
     150  G4LorentzVector a4Momentum = Get4Momentum();
     151  aLightConeMomentum*=theX;
     152  G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
     153  a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum) *
     154                                                                      (aDirection? 1: -1));
     155  a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
     156  Set4Momentum(a4Momentum);
    154157
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPartonPair.cc

    r1007 r1055  
    2626#include "G4QPartonPair.hh"
    2727//
    28 // $Id: G4QPartonPair.cc,v 1.1 2006/10/30 10:40:36 mkossov Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
     28// $Id: G4QPartonPair.cc,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3030//
    3131// ------------------------------------------------------------
     
    3434//      ---------------- G4QParton ----------------
    3535//             by Mikhail Kossov, Oct 2006.
    36 // class for PartonPair (hadron) used by Parton String Models
    37 // ------------------------------------------------------------
     36// class for PartonPair (hadron) used by QGS Models
     37// --------------------------------------------------------------
     38// Short description: Each Quasmon String has a pair of partons
     39// (quark/diquark-partons) on its ends. During the hadronization
     40// procedure the rapidity gap between partons shrinks, but the
     41// parton pair still exists, while it is converted to the final
     42// meson (quaek-antiquark) or baryon (quark-diquark).
     43// --------------------------------------------------------------
    3844
    3945G4QPartonPair::G4QPartonPair(G4QParton* P1, G4QParton* P2, G4int Type, G4int aDirection)
    40                 : Parton1(P1), Parton2(P2), CollisionType(Type), Direction(aDirection) {}
     46  : Parton1(P1), Parton2(P2), CollisionType(Type), Direction(aDirection) {}
    4147
    4248G4QPartonPair::~G4QPartonPair() {}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPomeron.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QPomeron.cc,v 1.2 2006/12/12 11:02:22 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QPomeron.cc,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
     
    3636//   For comparison mirror member functions are taken from G4 class:
    3737//   G4PomeronCrossSection
    38 // -----------------------------------------------------------------
     38// ------------------------------------------------------------------
     39// Short description: Pomeron is one of the possible vacuum pole (the
     40// second is Oderon, but they are identical in the present model), by
     41// which particle exchang in the ellastic scattering process. Strings,
     42// which appear as a cut of the Pomeron (optic theorem connects the
     43// amplitude of scattering at zero angle with the total inelastic
     44// cross-section), describe most of the processes at high energies.
     45// ------------------------------------------------------------------
    3946
    4047#include "G4QPomeron.hh"
     
    4249G4QPomeron::G4QPomeron(G4int PDG)
    4350{
    44          pomeron_Alpha=         1.0808;
    45          pomeron_Alphaprime =   0.25/GeV/GeV;     
     51  pomeron_Alpha=  1.0808;
     52  pomeron_Alphaprime = 0.25/GeV/GeV;     
    4653  pomeron_Gamma_Hard = 0.0002/GeV/GeV;
    4754  pomeron_Alpha_Hard = 1.47;
     
    5461                                                InitForNucleon();
    5562  else
    56                 {
     63  {
    5764    G4cout<<"-Warning-G4QPomeron is initialised for PDGCode="<<PDG<<" as a pion"<<G4endl;
    5865    InitForPion();
     
    6370                                              const G4int nPom)
    6471{
    65         G4double f=1; if(nPom>1) for(G4int i=2; i<= nPom; i++) f*=i; // Calculate factorial
     72  G4double f=1; if(nPom>1) for(G4int i=2; i<= nPom; i++) f*=i; // Calculate factorial
    6673  G4double e=Eikonal(s,imp2); e+=e;                            // Doubled Eikonal
    67         return std::exp(-e)*std::pow(e,nPom)/pomeron_C/f;
     74  return std::exp(-e)*std::pow(e,nPom)/pomeron_C/f;
    6875}
    6976
    7077void G4QPomeron::InitForNucleon()
    7178{
    72   // pomeron_S=         3.0*GeV*GeV; 
    73          pomeron_S=             2.7*GeV*GeV;
    74   //    pomeron_Gamma=          2.16/GeV/GeV;      // ? M.K.
    75   //    pomeron_Gamma=          3.96/GeV/GeV;      // ? M.K.
    76          pomeron_Gamma   =      (2.6+3.96)/GeV/GeV; // ? M.K.
    77          pomeron_C       =      1.4;
    78          pomeron_Rsquare =      3.56/GeV/GeV;
    79          /////pomeron_Alpha=            0.9808;          // This is very strange M.K. (was in GHAD QGSM)
     79  // pomeron_S=  3.0*GeV*GeV; 
     80  pomeron_S=  2.7*GeV*GeV;
     81  // pomeron_Gamma=  2.16/GeV/GeV;      // ? M.K.
     82  // pomeron_Gamma=  3.96/GeV/GeV;      // ? M.K.
     83  pomeron_Gamma   = (2.6+3.96)/GeV/GeV; // ? M.K.
     84  pomeron_C       = 1.4;
     85  pomeron_Rsquare = 3.56/GeV/GeV;
     86  /////pomeron_Alpha=  0.9808;          // This is very strange M.K. (was in GHAD QGSM)
    8087  // If pomeron_Gamma_Hard!=0 to fit total pp XS use pomeron_Gamma_Soft=2.35/GeV/GeV ? M.K.
    8188}
     
    8390void G4QPomeron::InitForPion()
    8491{
    85          pomeron_S       =      1.5*GeV*GeV;
    86   //pomeron_Gamma =     1.46/GeV/GeV;  // ? M.K.
    87          pomeron_Gamma   =      2.17/GeV/GeV;  // ? M.K.
    88          pomeron_C       =      1.6;
    89          pomeron_Rsquare =      2.36/GeV/GeV;
     92  pomeron_S       = 1.5*GeV*GeV;
     93  //pomeron_Gamma = 1.46/GeV/GeV;  // ? M.K.
     94  pomeron_Gamma   = 2.17/GeV/GeV;  // ? M.K.
     95  pomeron_C       = 1.6;
     96  pomeron_Rsquare = 2.36/GeV/GeV;
    9097}
    9198
    9299void G4QPomeron::InitForKaon()
    93100{
    94          pomeron_S       =      2.3*GeV*GeV;
    95   //pomeron_Gamma =     1.31/GeV/GeV;  // ? M.K.
    96         pomeron_Gamma   = 1.92/GeV/GeV;  // ? M.K.
    97          pomeron_C       =      1.8;
    98          pomeron_Rsquare =      1.96/GeV/GeV;
     101  pomeron_S       = 2.3*GeV*GeV;
     102  //pomeron_Gamma = 1.31/GeV/GeV;  // ? M.K.
     103  pomeron_Gamma   = 1.92/GeV/GeV;  // ? M.K.
     104  pomeron_C       = 1.8;
     105  pomeron_Rsquare = 1.96/GeV/GeV;
    99106}
    100107
    101108void G4QPomeron::InitForGamma()
    102109{
    103          pomeron_S       =      1.7*GeV*GeV;
    104   //pomeron_Gamma =             1.42/GeV/GeV; // ? M.K.
    105          pomeron_Gamma   =      2.07/GeV/GeV;  // ? M.K.
    106          pomeron_C       =      1.7;
    107          pomeron_Rsquare =      2.16/GeV/GeV;
     110  pomeron_S       = 1.7*GeV*GeV;
     111  //pomeron_Gamma =  1.42/GeV/GeV; // ? M.K.
     112  pomeron_Gamma   = 2.07/GeV/GeV;  // ? M.K.
     113  pomeron_C       = 1.7;
     114  pomeron_Rsquare = 2.16/GeV/GeV;
    108115}
    109116
     
    111118{
    112119
    113         G4double sum=1.;
    114         G4double current=1.;
    115         for(G4int j=2; j<21; j++)
    116         {
    117                 current *= -z*(j-1)/j/j;
    118                 sum+=current;
    119         }
    120         return sum;
     120 G4double sum=1.;
     121 G4double current=1.;
     122 for(G4int j=2; j<21; j++)
     123 {
     124  current *= -z*(j-1)/j/j;
     125  sum+=current;
     126 }
     127 return sum;
    121128}
    122129
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QSplitter.cc

    r1007 r1055  
    2828//
    2929//
    30 // $Id: G4QSplitter.cc,v 1.6 2006/11/27 10:44:55 mkossov Exp $
    31 // GEANT4 tag $Name: geant4-09-02 $
     30// $Id: G4QSplitter.cc,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     31// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3232//
    3333//      ---------------- G4QSplitter ----------------
    3434//             by Mikhail Kossov, August 2005.
    3535//  class for Hadron-Hadron String Interaction used by the CHIPS Model
    36 // -------------------------------------------------------------------
    37  
     36// ----------------------------------------------------==---------------
     37// Short description: the hadron befor the interaction must be splitted
     38// in partons: quark-antiquark (mesons) or quark-diquark (baryon) parts
     39// (some time in more than two parts, e.g. baryon in three quarks or a
     40// few quark-antiquark pairs can be added for the splitting). Then each
     41// projectile parton can create a parton pair (G4QPartonPair) with the
     42// target parton. This pair with the big rapidity difference on the ends
     43// creates a planar Quark-Gluon String (a pole). A pair of the projectile
     44// partons with a pair of the target partons can create a cylindrical
     45// string (doubled string in the algorithm - a cut). 
     46// -------------------------------------------------===------------------
     47
    3848//#define chdebug
    3949//#define debug
     
    6373  theWorld= G4QCHIPSWorld::Get();             // Get a pointer to the CHIPS World
    6474#ifdef debug
    65   G4cout<<"-->G4QString::Constr:pPDG="<<projHadron.GetPDGCode()<<",tPDG="<<targPDG<<G4endl;
     75  G4cout<<">G4QSplitter::Constr:pPDG="<<projHadron.GetPDGCode()<<",tPDG="<<targPDG<<G4endl;
    6676#endif
    6777  // Target initialization
     
    7686  // Projectile initialization
    7787  theProj4Mom = projHadron.Get4Momentum();
    78                 G4ThreeVector projBoost = theProj4Mom.boostVector(); // Projectile BoostVector to LS
     88  G4ThreeVector projBoost = theProj4Mom.boostVector(); // Projectile BoostVector to LS
    7989  G4ThreeVector projRBoost= -projBoost;       // Projevtile Boost vector to projectile CMS
    8090  G4QPDGCode projQPDG(projHadron.GetPDGCode());
     
    8999  G4double tM2 = tM*tM;
    90100  G4double dM2 = fabs(pM2-projM2);
    91   if(dM2>1.) G4cout<<"-Warn-G4QS::Constr:dM2="<<dM2<<",M2="<<projM2<<",LVM2="<<pM2<<G4endl;
     101  if(dM2>1.)G4cout<<"-Warn-G4QSplit::Con:dM2="<<dM2<<",M2="<<projM2<<",LVM2="<<pM2<<G4endl;
    92102  G4double pM=sqrt(pM2);                     // @@ do we need pM ? @@ (in print)
    93103
    94104  // === Print out of the input information at Creation time & tot 4-mom Calculation ======
    95105#ifdef pdebug
    96   G4cout<<"G4QS::Cons:PQC="<<theProjQC<<",TQC="<<theTargQC<<",P4Mom="<<theProj4Mom<<
    97                                 theProj4Mom.m2()<<theProj4Mom.m()<<G4endl;
    98   G4cout<<"G4QSpl::Constr: tC="<<totCharge<<",tB="<<totBaryNum<<",tot4M="<<tot4Mom<<G4endl;
     106  G4cout<<"G4QSplitter::Cons:PQC="<<theProjQC<<",TQC="<<theTargQC<<",P4Mom="<<theProj4Mom<<
     107    theProj4Mom.m2()<<theProj4Mom.m()<<G4endl;
     108  G4cout<<"G4QSplit::Cons: tC="<<totCharge<<",tB="<<totBaryNum<<",tot4M="<<tot4Mom<<G4endl;
    99109#endif
    100110  //G4int nP=theWorld->GetQPEntries();       // A#of init'ed particles in CHIPS World (@@?)
    101111  //G4int nCl=nP-90;                          // A#of init'ed clusters in CHIPS World (@@?)
    102                 //#ifdef pdebug
     112  //#ifdef pdebug
    103113  //G4cout<<"G4QS:Const:Before QEX:n="<<nP<<G4endl;
    104                 //#endif
     114  //#endif
    105115  // @@@@@@ ===> Here the Quark Exchange Quasmon Creation must be added <=== @@@@@@
    106116  // @@ --- old ---
     
    129139  G4double interc=1.;                        // @@ A parameter ?!
    130140#ifdef pdebug
    131   G4cout<<"G4QSpl::Constr: nP="<<nQProj<<", nT="<<nQTarg<<", intercept="<<interc<<G4endl;
     141  G4cout<<"G4QSplit::Constr: nP="<<nQProj<<", nT="<<nQTarg<<", intercept="<<interc<<G4endl;
    132142#endif
    133143  // @@ Now projectile can be only meson or baryon @@ -- @@ Improve for clusters @@ --
     
    136146  G4bool FreeFraF=false;                     // Prototype of the free exchange Flag
    137147  //if(G4UniformRand()<0.) FreeFraF=true;      // @@@@@@@@ Confirm the free exchange
    138   if(nQProj<2) G4cout<<"***G4QSpl::Constr: nQProj="<<nQProj<<"<2 ***FatalError***"<<G4endl;
    139                 else if(nQProj>2)                          // ---> Baryon case (clusters are not implem.)
    140                 {
     148  if(nQProj<2) G4cout<<"***G4QSplitter::C: nQProj="<<nQProj<<"<2 ***FatalError***"<<G4endl;
     149  else if(nQProj>2)                          // ---> Baryon case (clusters are not implem.)
     150  {
    141151    //if(nQProj>3)G4cout<<"-Wor-G4QS::Const:nQProj="<<nQProj<<">3 is not implem'd"<<G4endl;
    142152    G4double xP=0.;
     
    146156      xP=RandomizeMomFractionString(nQProj);
    147157      theWeight*=pow(xP,interc);
    148       G4cout<<"************G4QS::C: string xP="<<xP<<G4endl;
     158      G4cout<<"************G4QSplitter::C: string xP="<<xP<<G4endl;
    149159    }
    150160    rPMass = sqrt(pM2*(1.-xP));              // Residual Projectile mass
    151161#ifdef pdebug
    152     G4cout<<"G4QS::C: nQProj="<<nQProj<<", xProj="<<xP<<", rPMass="<<rPMass<<G4endl;
     162    G4cout<<"G4QSplitter::C: nQProj="<<nQProj<<", xProj="<<xP<<", rPMass="<<rPMass<<G4endl;
    153163#endif
    154164  }
     
    161171  else G4cout<<"*Warning*G4QSplitter::Constr:ProjDecIn2 rpM="<<rPMass<<", pM="<<pM<<G4endl;
    162172#ifdef pdebug
    163   G4cout<<"G4QSpl::Con:"<<projFl<<" split PROJ in R4M="<<pr4Mom<<" & Q4M="<<pq4Mom<<G4endl;
     173  G4cout<<"G4QSplit::C:"<<projFl<<" split PROJ in R4M="<<pr4Mom<<" & Q4M="<<pq4Mom<<G4endl;
    164174#endif
    165175  G4LorentzVector tq4Mom(0.,0.,0.,0.);       // Prototype of LV of quark of the target 
     
    172182    xT=RandomizeMomFractionString(nQTarg);
    173183    theWeight*=pow(xT,interc);
    174     G4cout<<"************G4QS::C: string xT="<<xT<<G4endl;
     184    G4cout<<"************G4QSplitter::Constr: string xT="<<xT<<G4endl;
    175185  }
    176186  G4double rTMass = sqrt(tM2*(1.-xT));       // Residual Target mass
     
    180190  G4LorentzVector tr4Mom(0.,0.,0.,rTMass);   // Prototype of LV of the residual projectile
    181191  if(targHadron.DecayIn2(tq4Mom,tr4Mom)) targFl=true; // Targ decay is OK
    182   else G4cout<<"**Worning**G4QStr::Constr:TargDecIn2 rtM="<<rTMass<<", tM="<<tM<<G4endl;
    183 #ifdef pdebug
    184   G4cout<<"G4QStr::Con:"<<targFl<<" split TARG in R4M="<<tr4Mom<<" & Q4M="<<tq4Mom<<G4endl;
     192  else G4cout<<"**Warning**G4QSplit::Constr:TargDecIn2 rtM="<<rTMass<<", tM="<<tM<<G4endl;
     193#ifdef pdebug
     194  G4cout<<"G4QSplit::C:"<<targFl<<" split TARG in R4M="<<tr4Mom<<" & Q4M="<<tq4Mom<<G4endl;
    185195#endif
    186196  G4bool elasFl=false;                       // ByDefault avoid the elastic scattering
     
    201211    // @@ Just to try ---- End
    202212#ifdef pdebug
    203     G4cout<<"G4QS::Cons: npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
     213    G4cout<<"G4QSplit::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
    204214#endif
    205215    if(npM<pM+mPi0) // The projectile is under min mass (@@ In Future put other cut @@)
    206216    {
    207217      G4double valk=tq4Mom.e();         // Momentum of the target quark
    208                                                 //#ifdef pdebug
     218      //#ifdef pdebug
    209219      G4double dvalk=valk-tq4Mom.rho();
    210       if(fabs(dvalk)>.00001) G4cout<<"***kp***G4QS::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
    211                                                 //#endif
     220      if(fabs(dvalk)>.00001) G4cout<<"**kp**G4QSplit::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
     221      //#endif
    212222      G4double dmas=pM2-pr4Mom.m2();    // Difference of squared masses
    213223      G4double vale=pr4Mom.e();
     
    219229      {
    220230#ifdef pdebug
    221         G4cout<<"***p***>>>G4QS::C: cost="<<cost<<G4endl;
     231        G4cout<<"***p***>>>G4QSplitter::Constr: cost="<<cost<<G4endl;
    222232#endif
    223233        // Get max value of |cos(theta)| and change tq value to get the pM on mass shell
     
    231241        }
    232242        else                               // --->>> cost<0.
    233                                                                 {
     243        {
    234244          G4double hvalk=dmas/(vale+valp); // Momentum's too small (must be increased, LIM)
    235245          if(hvalk>tM)                     // Momentum can not be increased to this value
    236246          {
    237247#ifdef pdebug
    238             G4cout<<"**p-Cor**>G4QS::C: hvalk="<<hvalk<<" > tM="<<tM<<", dm="<<dmas<<", e="
    239                   <<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
     248            G4cout<<"**p-Cor**>G4QSplitter::Constr: hvalk="<<hvalk<<" > tM="<<tM<<", dm="
     249                  <<dmas<<", e="<<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
    240250#endif
    241251            // Put the scatteredProjectile on the massShell, and rescatter the target quark
     
    248258          }
    249259          else
    250                                                                                 {
     260          {
    251261#ifdef pdebug
    252262            G4cout<<"***---***>G4QS::C: hvalk="<<hvalk<<" < tM="<<tM<<G4endl;
     
    284294      }
    285295#ifdef pdebug
    286       G4cout<<"G4QStr::C: Proj under GS, newP4M="<<newProj4M<<", pq4M="<<pq4Mom<<G4endl;
     296      G4cout<<"G4QSplit::C: Proj under GS, newP4M="<<newProj4M<<", pq4M="<<pq4Mom<<G4endl;
    287297#endif
    288298      pcorFl=true;                           // Projectile is on the GS mass shell
     
    296306    //ntM=sqrt(nTM2);
    297307#ifdef pdebug
    298     G4cout<<"G4QStr::C: ntM="<<ntM<<" <? tM="<<tM<<"+mPi0="<<mPi0<<" = "<<tM+mPi0<<G4endl;
     308    G4cout<<"G4QSplit::C:ntM="<<ntM<<" <? tM="<<tM<<"+mPi0="<<mPi0<<" = "<<tM+mPi0<<G4endl;
    299309#endif
    300310    if(ntM<tM+mPi0 && !pcorFl) // The target is under min mass (@@ InFut put another cut@@)
     
    304314      pqc4M.boost(projRBoost);             // projectileQuark => projCM system <step2>
    305315      G4double valk=pqc4M.e();             // Momentum of the target quark in projCM
    306                                                 //#ifdef pdebug
     316      //#ifdef pdebug
    307317      G4double dvalk=valk-pqc4M.rho();
    308318      if(fabs(dvalk)>.00001) G4cout<<"***kt***G4QS::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
    309                                                 //#endif
     319      //#endif
    310320      G4double dmas=tM2-tr4Mom.m2();       // Difference of squared masses (targ - targRes)
    311321      G4LorentzVector trc4M=tr4Mom;        // targetResidual => projCM system <step1>
     
    314324      G4ThreeVector tr=trc4M.v();          // 3-mom of the targetResidual in projCM
    315325      G4double valp=tr.mag();              // momentum of the targetResidual in projCM
    316       if(fabs(dmas-tM2+trc4M.m2())>.1) G4cout<<"**t**G4QS::C: trM2="<<tr4Mom.m2()<<"="
     326      if(fabs(dmas-tM2+trc4M.m2())>.1) G4cout<<"**t**G4QSplit::C: trM2="<<tr4Mom.m2()<<"="
    317327                                            <<trc4M.m2()<<","<<vale*vale-valp*valp<<G4endl;
    318328      G4ThreeVector utr=tr/valp;           // Unit vector in the tr direction in projCM
     
    321331      {
    322332#ifdef pdebug
    323         G4cout<<"***t***>>>G4QS::C: cost="<<cost<<G4endl;
     333        G4cout<<"***t***>>>G4QSplitter::Constr: cost="<<cost<<G4endl;
    324334#endif
    325335        // Get max value of |cos(theta)| and change pq value to get the tM on mass shell
     
    337347        }
    338348        else                                   // --->>> cost<-1 => cost=-1
    339                                                                 {
     349        {
    340350          G4double hvalk=dmas/(vale+valp); // Momentum's too small (must be increased, LIM)
    341351          if(hvalk>pM)                     // Momentum can not be increased to this value
     
    354364          }
    355365          else
    356                                                                                 {
    357 #ifdef pdebug
    358             G4cout<<"***---***>G4QS::C: hvalk="<<hvalk<<" < pM="<<pM<<G4endl;
     366          {
     367#ifdef pdebug
     368            G4cout<<"***---***>G4QSplitter::Constr: hvalk="<<hvalk<<" < pM="<<pM<<G4endl;
    359369#endif
    360370            valk=hvalk/2;                        // Momentum is too small (mustBeIncreased)
     
    377387            G4double smo=nTc4M.rho();
    378388            G4cout<<"G4QS::C:qM2="<<pqc4M.m2()<<",rM2="<<trc4M.m2()<<",E="<<sen<<"="<<
    379                                                                                                                 vale+valk<<",P="<<smo<<"="<<valp-valk<<",M="<<sqrt(sen*sen-smo*smo)<<G4endl;
     389              vale+valk<<",P="<<smo<<"="<<valp-valk<<",M="<<sqrt(sen*sen-smo*smo)<<G4endl;
    380390#endif
    381391            G4LorentzVector prc4M(pM-valk,-pqf); // Fill new 4-mom for projectResid in CM
     
    386396        }
    387397        if(fabs(newTarg4M.m()-tM)>.0001)
    388           G4cout<<"******************************G4QS::C:"<<newTarg4M.m()<<"="<<pM<<G4endl;
     398          G4cout<<"***************G4QSplitter::Constr: M="<<newTarg4M.m()<<"#"<<pM<<G4endl;
    389399      }
    390400      else // -1<cos(theta)<1 - only rotate the projQ
     
    392402        // Turn the projectile quark-parton to the target residual in CMS of the Projectile
    393403#ifdef pdebug
    394         G4cout<<"---t--->>>G4QS::C: cost="<<cost<<G4endl;
     404        G4cout<<"---t--->>>G4QSplitter::Constr: cost="<<cost<<G4endl;
    395405#endif
    396406        G4LorentzVector prc4M=pr4Mom;          // projectileQuark => projCM system <step1>
     
    421431      }
    422432#ifdef pdebug
    423       G4cout<<"G4QStr::C: Targ under GS, newT4M="<<newTarg4M<<", tq4M="<<tq4Mom<<G4endl;
     433      G4cout<<"G4QSplit::C: Targ under GS, newT4M="<<newTarg4M<<", tq4M="<<tq4Mom<<G4endl;
    424434#endif
    425435      tcorFl=true;                  // Target is on the GS mass shell
     
    428438      npM=sqrt(nPM2);
    429439#ifdef pdebug
    430       G4cout<<"G4QStr::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
     440      G4cout<<"G4QSpl::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
    431441#endif
    432442      if(npM<pM+mPi0) elasFl=true;    // Force elastic scattering (@@InFut putAnotherCut@@)
     
    437447      // **** Put the hadrons on the mass shell conserving the CMS scattering angle ****
    438448      G4LorentzVector theTot4M=theProj4Mom+theTarg4Mom;// 4-momentum of CMS of "targ+proj"
    439                     G4ThreeVector cmsBoost = theTot4M.boostVector(); // CMS Boost Vector "CMS to LS"
     449      G4ThreeVector cmsBoost = theTot4M.boostVector(); // CMS Boost Vector "CMS to LS"
    440450      G4ThreeVector cmsRBoost= -cmsBoost;              // CMS Boost Vector "LS to CMS"
    441451      G4LorentzVector cmsProj4M=theProj4Mom; // LS projectile => CMS <step1>
     
    447457      if(fabs(cmsTarg4M.rho()-pcm) > 0.0001)
    448458        G4cout<<"-Worning-G4QSplitter::Constr: P="<<cmsTarg4M.rho()<<"#"<<pcm<<G4endl;
    449                                                 //#endif
     459      //#endif
    450460      G4LorentzVector cmsNewPr4M=newProj4M;  // LS finalProj => CMS <step1>
    451461      cmsNewPr4M.boost(cmsRBoost);           // LS finalProj => CMS <step2>
     
    456466      G4ThreeVector tuV=cmsNewTg4M.v()/cmsNewTg4M.rho(); // Direction of the projectile
    457467      if(1.+puV.dot(tuV) > 0.001)
    458         G4cout<<"-Worning-G4QSplitter::Constr: ct="<<puV.dot(tuV)<<G4endl;
    459                                                 //#endif
     468        G4cout<<"-Warning-G4QSplitter::Constr: ct="<<puV.dot(tuV)<<G4endl;
     469      //#endif
    460470      cmsProj4M.setV(puV*pcm);
    461471      newProj4M=cmsProj4M;
     
    494504        theQHadrons.push_back(targH);        // Fill the Target Hadron (delete equivalent)
    495505      }
    496                                                 else                                   // Both are excited (two Quasmons only)
     506      else                                   // Both are excited (two Quasmons only)
    497507      {
    498508        G4Quasmon* projQ = new G4Quasmon(projHadron.GetQC(),newProj4M);
     
    503513    }
    504514  }
    505   else G4cout<<"-Wor-G4QSplitter::Constr:T="<<targFl<<" or P="<<projFl<<" err"<<G4endl;
     515  else G4cout<<"-Warning-G4QSplitter::Constr:T="<<targFl<<" or P="<<projFl<<" err"<<G4endl;
    506516#ifdef pdebug
    507517  G4cout<<"G4QSplitter::Constructor: *** End of Constructor ***, elF="<<elasFl<<G4endl;
     
    523533    finBaryoN+=theQuasmons[iq]->GetBaryonNumber();
    524534  }
    525   G4cout<<"G4QStr::C:nH="<<nHad<<",nQ="<<nQuas<<",C="<<finCharge<<",B="<<finBaryoN<<G4endl;
     535  G4cout<<"G4QSpl::C:nH="<<nHad<<",nQ="<<nQuas<<",C="<<finCharge<<",B="<<finBaryoN<<G4endl;
    526536  if(finCharge!=totCharge || finBaryoN!=totBaryNum)
    527537  {
    528     G4cerr<<"***G4QStr::C:tC="<<totCharge<<",C="<<finCharge<<",tB="<<totBaryNum
     538    G4cerr<<"***G4QSptitter::C:tC="<<totCharge<<",C="<<finCharge<<",tB="<<totBaryNum
    529539          <<",B="<<finBaryoN<<G4endl;
    530540    if(nHad) for(G4int h=0; h<nHad; h++)
    531541    {
    532542      G4QHadron* cH = theQHadrons[h];
    533       G4cerr<<"::G4QS::C:h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
     543      G4cerr<<"G4QSplit::C: h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
    534544    }
    535545    if(nQuas) for(G4int q=0; q<nQuas; q++)
    536546    {
    537547      G4Quasmon* cQ = theQuasmons[q];
    538       G4cerr<<"::G4QS::C:q#"<<q<<",C="<<cQ->GetCharge()<<",QuarkCon="<<cQ->GetQC()<<G4endl;
     548      G4cerr<<"G4QSplit::C: q#"<<q<<",C="<<cQ->GetCharge()<<",QCont="<<cQ->GetQC()<<G4endl;
    539549    }
    540550  }
     
    550560    G4Quasmon* curQ    = new G4Quasmon(right.theQuasmons[iq]);
    551561#ifdef fdebug
    552     G4cout<<"G4QS::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     562    G4cout<<"G4QSplit::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    553563#endif
    554564    theQuasmons.push_back(curQ);             // (delete equivalent)
     
    563573 
    564574  theWorld        =  right.theWorld;
    565                 tot4Mom         =        right.tot4Mom;
    566                 totCharge       =        right.totCharge;
    567                 totBaryNum      =        right.totBaryNum;
     575  tot4Mom         = right.tot4Mom;
     576  totCharge       = right.totCharge;
     577  totBaryNum      = right.totBaryNum;
    568578}
    569579
     
    581591      G4Quasmon* curQ    = new G4Quasmon(right.theQuasmons[iq]);
    582592#ifdef fdebug
    583       G4cout<<"G4QS::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     593      G4cout<<"G4QSpl::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    584594#endif
    585595      theQuasmons.push_back(curQ);             // (delete equivalent)
     
    594604 
    595605    theWorld        =  right.theWorld;
    596                   tot4Mom         =      right.tot4Mom;
    597                   totCharge       =      right.totCharge;
    598                   totBaryNum      =      right.totBaryNum;
     606    tot4Mom         = right.tot4Mom;
     607    totCharge       = right.totCharge;
     608    totBaryNum      = right.totBaryNum;
    599609  }
    600610  return *this;
     
    609619    G4Quasmon* curQ    = new G4Quasmon(right->theQuasmons[iq]);
    610620#ifdef fdebug
    611     G4cout<<"G4QS::CopyByPoint:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     621    G4cout<<"G4QSpl::CopyByPoint:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    612622#endif
    613623    theQuasmons.push_back(curQ);             // (delete equivalent)
     
    622632 
    623633  theWorld        =  right->theWorld;
    624                 tot4Mom         =        right->tot4Mom;
    625                 totCharge       =        right->totCharge;
    626                 totBaryNum      =        right->totBaryNum;
     634  tot4Mom         = right->tot4Mom;
     635  totCharge       = right->totCharge;
     636  totBaryNum      = right->totBaryNum;
    627637}
    628638
     
    657667G4QHadronVector* G4QSplitter::Fragment()
    658668{//              ========================== -- @@ Must be changed @@ --
    659                 // Make the final check before filling the output -- @@ Must be changed @@ --
     669  // Make the final check before filling the output -- @@ Must be changed @@ --
    660670#ifdef chdebug
    661671  G4int fCharge=0;
     
    774784  // @@ TMP --- Begin ---
    775785  if(2>1)
    776                 {
     786  {
    777787    if(nPart<2)
    778788    {
     
    785795    if(r==0.) return 0.;
    786796    if(r==1.) return 1.;
    787                   if     (nPart==3) x=r;          // GS baryon
    788                   else if(nPart==4) x=1.-sqrt(r); // GS quaternion
     797    if     (nPart==3) x=r;          // GS baryon
     798    else if(nPart==4) x=1.-sqrt(r); // GS quaternion
    789799    else x=1.-pow(r,1./(nPart-2.)); // nPart>4
    790800    return x;
     
    802812  if(r==0.) return 0.;
    803813  if(r==1.) return 1.;
    804                 if(nPart==3) x=sqrt(r);      // GS baryon
    805                 else if(nPart==4)            // GS quaternion
    806                 {
     814  if(nPart==3) x=sqrt(r);      // GS baryon
     815  else if(nPart==4)            // GS quaternion
     816  {
    807817    if    (r==0.5) x=0.5;
    808818    else if(r<0.5) x=sqrt(r+r)*(.5+.1579*(r-.5));
     
    810820  }
    811821  else
    812                 {
     822  {
    813823    G4int n1=nPart-2;
    814824    G4double r1=n1;
     
    819829    if  (r==rr)  x=p2;
    820830    else
    821                                 {
     831    {
    822832      if(r<rr)
    823833      {
    824                                                                 G4double pr=0.;
    825                                                                 G4double pra=0.;
     834        G4double pr=0.;
     835        G4double pra=0.;
    826836        if(nPart>8)
    827                                                                 {
     837        {
    828838          if(nPart>10)
    829                                                                   {
     839          {
    830840            if(nPart>11)                      // >11
    831841            {
     
    833843              pra=.915/pow((nPart+6.7),1.75);
    834844            }
    835                                                                                                 else                              // 11
     845            else                              // 11
    836846            {
    837847              pr=.09945;
     
    840850          }
    841851          else
    842                                                                   {
     852          {
    843853            if(nPart>9)                       // 10
    844854            {
     
    846856              pra=.00741;
    847857            }
    848                                                                                                 else                              // 9
     858            else                              // 9
    849859            {
    850860              pr=.11425;
     
    854864        }
    855865        else
    856                                                                 {
     866        {
    857867          if(nPart>6)
    858                                                                   {
     868          {
    859869            if(nPart>7)                       // 8
    860870            {
     
    862872              pra=.00926;
    863873            }
    864                                                                                                 else                              // 7
     874            else                              // 7
    865875            {
    866876              pr=.13405;
     
    869879          }
    870880          else
    871                                                                   {
     881          {
    872882            if(nPart>5)                       // 6
    873883            {
     
    875885              pra=.01112;
    876886            }
    877                                                                                                 else                              // 5
     887            else                              // 5
    878888            {
    879889              pr=.15765;
     
    886896      else
    887897      {
    888                                                                 G4double sr=0.;
     898        G4double sr=0.;
    889899        if(nPart>8)
    890                                                                 {
     900        {
    891901          if(nPart>10)
    892                                                                   {
     902          {
    893903            if(nPart>11) sr=.86/(nPart+1.05); // >11
    894                                                                                                 else         sr=.0774;            // 11
     904            else         sr=.0774;            // 11
    895905          }
    896906          else
    897                                                                   {
     907          {
    898908            if(nPart>9) sr=.0849;             // 10
    899                                                                                                 else        sr=.0938;             // 9
     909            else        sr=.0938;             // 9
    900910          }
    901911        }
    902912        else
    903                                                                 {
     913        {
    904914          if(nPart>6)
    905                                                                   {
     915          {
    906916            if(nPart>7) sr=.1047;             // 8
    907                                                                                                 else        sr=.1179;             // 7
     917            else        sr=.1179;             // 7
    908918          }
    909919          else
    910                                                                   {
     920          {
    911921            if(nPart>5) sr=.1339;             // 6
    912                                                                                                 else        sr=.15135;            // 5
     922            else        sr=.15135;            // 5
    913923          }
    914924        }
     
    933943  if(r==0.) return 0.;
    934944  if(r==1.) return 1.;
    935                 if     (nPart==3) x=r;          // GS baryon
    936                 else if(nPart==4) x=1.-sqrt(r); // GS quaternion
     945  if     (nPart==3) x=r;          // GS baryon
     946  else if(nPart==4) x=1.-sqrt(r); // GS quaternion
    937947  else x=1.-pow(r,1./(nPart-2.)); // nPart>4
    938948  return x;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QString.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QString.cc,v 1.4 2007/07/06 07:38:36 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QString.cc,v 1.5 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
     
    3737//   G4FragmentingString
    3838//   G4ExcitedStringDecay
    39 // ------------------------------------------------------------
     39// ---------------------------------------------------------------------
     40// Short description: If partons from the G4QPartonPair are close in
     41// rapidity, they create Quasmons, but if they are far in the rapidity
     42// space, they can not interact directly. Say the bottom parton (quark)
     43// has rapidity 0, and the top parton (antiquark) has rapidity 8, then
     44// the top quark splits in two by radiating gluon, and each part has
     45// rapidity 4, then the gluon splits in quark-antiquark pair (rapidity
     46// 2 each), and then the quark gadiates anothe gluon and reachs rapidity
     47// 1. Now it can interact with the bottom antiquark, creating a Quasmon
     48// or a hadron. The intermediate partons is the string ladder.
     49// ---------------------------------------------------------------------
    4050
    4151//#define debug
     
    6575
    6676G4QString::G4QString(G4QParton* QCol,G4QParton* Gluon,G4QParton* QAntiCol,G4int Direction):
    67         theDirection(Direction),thePosition(QCol->GetPosition()),hadronizer(new G4QHadronBuilder)
     77  theDirection(Direction),thePosition(QCol->GetPosition()),hadronizer(new G4QHadronBuilder)
    6878{
    6979  thePartons.push_back(QCol);
     
    8090G4LorentzVector G4QString::Get4Momentum() const
    8191{
    82         G4LorentzVector momentum(0.,0.,0.,0.);
    83         for(unsigned i=0; i<thePartons.size(); i++) momentum += thePartons[i]->Get4Momentum();
    84         return momentum;
     92  G4LorentzVector momentum(0.,0.,0.,0.);
     93  for(unsigned i=0; i<thePartons.size(); i++) momentum += thePartons[i]->Get4Momentum();
     94  return momentum;
    8595}
    8696
    8797void G4QString::LorentzRotate(const G4LorentzRotation & rotation)
    8898{
    89         for(unsigned i=0; i<thePartons.size(); i++)
    90             thePartons[i]->Set4Momentum(rotation*thePartons[i]->Get4Momentum());
     99  for(unsigned i=0; i<thePartons.size(); i++)
     100     thePartons[i]->Set4Momentum(rotation*thePartons[i]->Get4Momentum());
    91101}
    92102
     
    94104{
    95105  G4QPartonVector::iterator insert_index;   // Begin by default (? M.K.)
    96        
    97         if(addafter != NULL)
    98         {
    99            insert_index=std::find(thePartons.begin(), thePartons.end(), addafter);
    100            if (insert_index == thePartons.end())                // No object addafter in thePartons
    101            {
    102                                         G4cerr<<"***G4QString::InsertParton: Address Parton is not found"<<G4endl;
     106 
     107  if(addafter != NULL)
     108  {
     109    insert_index=std::find(thePartons.begin(), thePartons.end(), addafter);
     110    if (insert_index == thePartons.end())  // No object addafter in thePartons
     111    {
     112      G4cerr<<"***G4QString::InsertParton: Address Parton is not found"<<G4endl;
    103113      G4Exception("G4QString::InsertParton:","72",FatalException,"NoAddressParton");
    104            }
    105         }
    106         thePartons.insert(insert_index+1, aParton);
     114    }
     115  }
     116  thePartons.insert(insert_index+1, aParton);
    107117}
    108118
    109119G4LorentzRotation G4QString::TransformToCenterOfMass()
    110120{
    111         G4LorentzRotation toCms(-1*Get4Momentum().boostVector());
    112         for(unsigned i=0; i<thePartons.size(); i++)
    113                              thePartons[i]->Set4Momentum(toCms*thePartons[i]->Get4Momentum());
    114         return toCms;
     121  G4LorentzRotation toCms(-1*Get4Momentum().boostVector());
     122  for(unsigned i=0; i<thePartons.size(); i++)
     123                      thePartons[i]->Set4Momentum(toCms*thePartons[i]->Get4Momentum());
     124  return toCms;
    115125}
    116126
    117127G4LorentzRotation G4QString::TransformToAlignedCms()
    118128{
    119         G4LorentzVector momentum=Get4Momentum();
    120         G4LorentzRotation toAlignedCms(-1*momentum.boostVector());
    121         momentum= toAlignedCms* thePartons[0]->Get4Momentum();
    122         toAlignedCms.rotateZ(-1*momentum.phi());
    123         toAlignedCms.rotateY(-1*momentum.theta());
    124         for(unsigned index=0; index<thePartons.size(); index++)
    125         {
    126            momentum=toAlignedCms * thePartons[index]->Get4Momentum();
    127            thePartons[index]->Set4Momentum(momentum);
    128         }
    129         return toAlignedCms;
     129  G4LorentzVector momentum=Get4Momentum();
     130  G4LorentzRotation toAlignedCms(-1*momentum.boostVector());
     131  momentum= toAlignedCms* thePartons[0]->Get4Momentum();
     132  toAlignedCms.rotateZ(-1*momentum.phi());
     133  toAlignedCms.rotateY(-1*momentum.theta());
     134  for(unsigned index=0; index<thePartons.size(); index++)
     135  {
     136    momentum=toAlignedCms * thePartons[index]->Get4Momentum();
     137    thePartons[index]->Set4Momentum(momentum);
     138  }
     139  return toAlignedCms;
    130140}
    131141
     
    169179  SmoothParam     = smPar;          // QGS model parameter
    170180  StrangeSuppress = SSup;           // Strangeness suppression parameter
    171          widthOfPtSquare = -2*SigPt*SigPt;      // width^2 of pt for string excitation
     181  widthOfPtSquare = -2*SigPt*SigPt; // width^2 of pt for string excitation
    172182  StringLoopInterrupt = SLmax;      // String fragmentation LOOP limit
    173183  ClusterLoopInterrupt= CLmax;      // Cluster fragmentation LOOP limit
     
    177187G4ThreeVector G4QString::GaussianPt(G4double widthSquare, G4double maxPtSquare) const
    178188{
    179         G4double pt2; do{pt2=widthSquare*std::log(G4UniformRand());} while (pt2>maxPtSquare);
    180                 pt2=std::sqrt(pt2);
    181         G4double phi=G4UniformRand()*twopi;
    182         return G4ThreeVector(pt2*std::cos(phi),pt2*std::sin(phi),0.);   
     189  G4double pt2; do{pt2=widthSquare*std::log(G4UniformRand());} while (pt2>maxPtSquare);
     190  pt2=std::sqrt(pt2);
     191  G4double phi=G4UniformRand()*twopi;
     192  return G4ThreeVector(pt2*std::cos(phi),pt2*std::sin(phi),0.);   
    183193} // End of GaussianPt
    184194
     
    186196void G4QString::DiffString(G4QHadron* hadron, G4bool isProjectile)
    187197{
    188         hadron->SplitUp();
    189         G4QParton* start = hadron->GetNextParton();
    190         if( start==NULL)
    191         {
     198  hadron->SplitUp();
     199  G4QParton* start = hadron->GetNextParton();
     200  if( start==NULL)
     201  {
    192202    G4cerr<<"***G4QString::DiffString: No start parton found, nothing is done"<<G4endl;
    193            return;
    194         }
    195         G4QParton* end = hadron->GetNextParton();
    196         if( end==NULL)
    197         {
     203    return;
     204  }
     205  G4QParton* end = hadron->GetNextParton();
     206  if( end==NULL)
     207  {
    198208    G4cerr<<"***G4QString::DiffString: No end parton found, nothing is done"<<G4endl;
    199            return;
    200         }
    201          if(isProjectile)       ExciteString(end, start, 1); //  1 = Projectile
    202          else                   ExciteString(start, end,-1); // -1 = Target
    203         SetPosition(hadron->GetPosition());
     209    return;
     210  }
     211  if(isProjectile) ExciteString(end, start, 1); //  1 = Projectile
     212  else             ExciteString(start, end,-1); // -1 = Target
     213  SetPosition(hadron->GetPosition());
    204214  // momenta of string ends
    205         G4double ptSquared= hadron->Get4Momentum().perp2();
     215  G4double ptSquared= hadron->Get4Momentum().perp2();
    206216  G4double hmins=hadron->Get4Momentum().minus();
    207217  G4double hplus=hadron->Get4Momentum().plus();
    208         G4double transMassSquared=hplus*hmins;
    209         G4double maxMomentum = std::sqrt(transMassSquared) - std::sqrt(ptSquared);
    210         G4double maxAvailMomentumSquared = maxMomentum * maxMomentum;
    211         G4ThreeVector pt=GaussianPt(widthOfPtSquare,maxAvailMomentumSquared);
    212         G4LorentzVector Pstart(G4LorentzVector(pt,0.));
    213         G4LorentzVector Pend(hadron->Get4Momentum().px(), hadron->Get4Momentum().py(), 0.);
    214         Pend-=Pstart;
    215         G4double tm1=hmins+(Pend.perp2()-Pstart.perp2())/hplus;
    216         G4double tm2=std::sqrt( std::max(0., tm1*tm1-4*Pend.perp2()*hmins/hplus ) );
    217         G4int Sign= isProjectile ? TARGET : PROJECTILE;
    218         G4double endMinus  = 0.5 * (tm1 + Sign*tm2);
    219         G4double startMinus= hmins - endMinus;
    220         G4double startPlus = Pstart.perp2() / startMinus;
    221         G4double endPlus   = hplus - startPlus;
    222         Pstart.setPz(0.5*(startPlus - startMinus));
    223         Pstart.setE (0.5*(startPlus + startMinus));
    224         Pend.setPz  (0.5*(endPlus - endMinus));
    225         Pend.setE   (0.5*(endPlus + endMinus));
    226         start->Set4Momentum(Pstart);
    227         end->Set4Momentum(Pend);
     218  G4double transMassSquared=hplus*hmins;
     219  G4double maxMomentum = std::sqrt(transMassSquared) - std::sqrt(ptSquared);
     220  G4double maxAvailMomentumSquared = maxMomentum * maxMomentum;
     221  G4ThreeVector pt=GaussianPt(widthOfPtSquare,maxAvailMomentumSquared);
     222  G4LorentzVector Pstart(G4LorentzVector(pt,0.));
     223  G4LorentzVector Pend(hadron->Get4Momentum().px(), hadron->Get4Momentum().py(), 0.);
     224  Pend-=Pstart;
     225  G4double tm1=hmins+(Pend.perp2()-Pstart.perp2())/hplus;
     226  G4double tm2=std::sqrt( std::max(0., tm1*tm1-4*Pend.perp2()*hmins/hplus ) );
     227  G4int Sign= isProjectile ? TARGET : PROJECTILE;
     228  G4double endMinus  = 0.5 * (tm1 + Sign*tm2);
     229  G4double startMinus= hmins - endMinus;
     230  G4double startPlus = Pstart.perp2() / startMinus;
     231  G4double endPlus   = hplus - startPlus;
     232  Pstart.setPz(0.5*(startPlus - startMinus));
     233  Pstart.setE (0.5*(startPlus + startMinus));
     234  Pend.setPz  (0.5*(endPlus - endMinus));
     235  Pend.setE   (0.5*(endPlus + endMinus));
     236  start->Set4Momentum(Pstart);
     237  end->Set4Momentum(Pend);
    228238#ifdef debug
    229                 G4cout<<"G4QString::DiffString: StartQ="<<start->GetPDGCode()<<start->Get4Momentum()<<"("
     239  G4cout<<"G4QString::DiffString: StartQ="<<start->GetPDGCode()<<start->Get4Momentum()<<"("
    230240        <<start->Get4Momentum().mag()<<"), EndQ="<<end->GetPDGCode()<<end ->Get4Momentum()
    231241        <<"("<<end->Get4Momentum().mag()<<"), sumOfEnds="<<Pstart+Pend<<", H4M(original)="
     
    237247void G4QString::ExciteString(G4QParton* Color, G4QParton* AntiColor, G4int Direction)
    238248{
    239                 theDirection = Direction;
     249  theDirection = Direction;
    240250  thePosition  = Color->GetPosition();
    241251  thePartons.push_back(Color);
     
    258268       z = zmin + G4UniformRand()*(zmax-zmin);
    259269       // yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
    260               yf = (1-z)/z * std::exp(-alund*Mt2/z);
     270       yf = (1-z)/z * std::exp(-alund*Mt2/z);
    261271    } while (G4UniformRand()*maxYf>yf);
    262272    return z;
     
    266276// QGSM Longitudinal fragmentation
    267277G4double G4QString::GetQGSMLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding,
    268                                                                                                                                                                                                                                                                                                                 G4QHadron* , G4double, G4double) // @@ M.K.
     278                                      G4QHadron* , G4double, G4double) // @@ M.K.
    269279{
    270280  static const G4double arho=0.5;
     
    287297     G4Exception("G4QString::GetQGSMLightConeZ:","72",FatalException,"WrongQuark");
    288298    }
    289     do  
     299    do  
    290300    {
    291301      z  = zmin + G4UniformRand()*(zmax - zmin);
     
    314324{
    315325  // Can no longer modify Parameters for Fragmentation.
    316         // PastInitPhase=true;                                     // Now static
    317        
    318   //    check if string has enough mass to fragment...
    319         G4QHadronVector* LeftVector=LightFragmentationTest();
    320         if(LeftVector) return LeftVector;
    321        
    322         LeftVector = new G4QHadronVector;
    323         G4QHadronVector* RightVector = new G4QHadronVector;
     326  // PastInitPhase=true;                                     // Now static
     327 
     328  //  check if string has enough mass to fragment...
     329  G4QHadronVector* LeftVector=LightFragmentationTest();
     330  if(LeftVector) return LeftVector;
     331 
     332  LeftVector = new G4QHadronVector;
     333  G4QHadronVector* RightVector = new G4QHadronVector;
    324334
    325335  // this should work but it's only a semi deep copy.
    326   // %GF        G4ExcitedString theStringInCMS(theString);
     336  // %GF G4ExcitedString theStringInCMS(theString);
    327337  G4QString* theStringInCMS=CPExcited();                      // must be deleted
    328         G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
    329         G4bool success=false;
    330         G4bool inner_sucess=true;
    331         G4int attempt=0;
    332         while (!success && attempt++<StringLoopInterrupt)              //@@ It's Loop with break
    333         {
    334                   G4QString* currentString = new G4QString(*theStringInCMS);
    335                   if(LeftVector->size())
     338  G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
     339  G4bool success=false;
     340  G4bool inner_sucess=true;
     341  G4int attempt=0;
     342  while (!success && attempt++<StringLoopInterrupt)              //@@ It's Loop with break
     343  {
     344    G4QString* currentString = new G4QString(*theStringInCMS);
     345    if(LeftVector->size())
    336346    {
    337347      std::for_each(LeftVector->begin(), LeftVector->end(), DeleteQHadron());
    338                     LeftVector->clear();
     348      LeftVector->clear();
    339349    }
    340                   if(RightVector->size())
    341                   {
     350    if(RightVector->size())
     351    {
    342352      std::for_each(RightVector->begin(), RightVector->end(), DeleteQHadron());
    343                     RightVector->clear();
    344                   }
    345                   inner_sucess=true;  // set false on failure..
    346                   while (!StopFragmentation())
    347                   {  // Split current string into hadron + new string
    348                         G4QString* newString=0;  // used as output from SplitUp...
    349                            G4QHadron* Hadron=Splitup(QL);
    350                            if(Hadron && IsFragmentable())
    351                            {
    352                              if(currentString->GetDecayDirection()>0) LeftVector->push_back(Hadron);
    353         else RightVector->push_back(Hadron);
    354                              delete currentString;
    355                              currentString=newString;
    356                            }
     353      RightVector->clear();
     354    }
     355    inner_sucess=true;  // set false on failure..
     356    while (!StopFragmentation())
     357    {  // Split current string into hadron + new string
     358      G4QString* newString=0;  // used as output from SplitUp...
     359      G4QHadron* Hadron=Splitup(QL);
     360      if(Hadron && IsFragmentable())
     361      {
     362        if(currentString->GetDecayDirection()>0) LeftVector->push_back(Hadron);
     363        else RightVector->push_back(Hadron);
     364        delete currentString;
     365        currentString=newString;
     366      }
    357367      else
    358368      {
    359                              // abandon ... start from the beginning
    360                              if (newString) delete newString;
    361                              if (Hadron)    delete Hadron;
    362                              inner_sucess=false;
    363                              break;
    364                            }
    365                   }
    366                 // Split current string into 2 final Hadrons
    367                   if( inner_sucess && SplitLast(currentString, LeftVector, RightVector) )       success=true;
    368                   delete currentString;
    369         }
    370         delete theStringInCMS;
    371         if (!success)
    372         {
    373                   if(RightVector->size())
    374                   {
     369        // abandon ... start from the beginning
     370        if (newString) delete newString;
     371        if (Hadron)    delete Hadron;
     372        inner_sucess=false;
     373        break;
     374      }
     375    }
     376  // Split current string into 2 final Hadrons
     377    if( inner_sucess && SplitLast(currentString, LeftVector, RightVector) )  success=true;
     378    delete currentString;
     379  }
     380  delete theStringInCMS;
     381  if (!success)
     382  {
     383    if(RightVector->size())
     384    {
    375385      std::for_each(RightVector->begin(), RightVector->end(), DeleteQHadron());
    376                     RightVector->clear();
    377                   }
    378                   delete RightVector;
    379                   if(LeftVector->size())
     386      RightVector->clear();
     387    }
     388    delete RightVector;
     389    if(LeftVector->size())
    380390    {
    381391      std::for_each(LeftVector->begin(), LeftVector->end(), DeleteQHadron());
    382                     LeftVector->clear();
     392      LeftVector->clear();
    383393    }
    384                   return LeftVector;
    385          }             
    386         // Join Left and Right Vectors into LeftVector in correct order.
    387         while(!RightVector->empty())
    388         {
    389             LeftVector->push_back(RightVector->back());
    390             RightVector->erase(RightVector->end()-1);
    391         }
    392         delete RightVector;
    393         CalculateHadronTimePosition(Get4Momentum().mag(), LeftVector);
    394         G4LorentzRotation toObserverFrame(toCms.inverse());
    395         for(unsigned C1 = 0; C1 < LeftVector->size(); C1++)
    396         {
    397            G4QHadron* Hadron = (*LeftVector)[C1];
    398            G4LorentzVector Momentum = Hadron->Get4Momentum();
    399            Momentum = toObserverFrame*Momentum;
    400            Hadron->Set4Momentum(Momentum);
    401            G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
    402            Momentum = toObserverFrame*Coordinate;
    403            Hadron->SetFormationTime(Momentum.e());
    404            Hadron->SetPosition(GetPosition()+Momentum.vect());
    405         }
    406         return LeftVector;
     394    return LeftVector;
     395  } 
     396  // Join Left and Right Vectors into LeftVector in correct order.
     397  while(!RightVector->empty())
     398  {
     399     LeftVector->push_back(RightVector->back());
     400     RightVector->erase(RightVector->end()-1);
     401  }
     402  delete RightVector;
     403  CalculateHadronTimePosition(Get4Momentum().mag(), LeftVector);
     404  G4LorentzRotation toObserverFrame(toCms.inverse());
     405  for(unsigned C1 = 0; C1 < LeftVector->size(); C1++)
     406  {
     407    G4QHadron* Hadron = (*LeftVector)[C1];
     408    G4LorentzVector Momentum = Hadron->Get4Momentum();
     409    Momentum = toObserverFrame*Momentum;
     410    Hadron->Set4Momentum(Momentum);
     411    G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
     412    Momentum = toObserverFrame*Coordinate;
     413    Hadron->SetFormationTime(Momentum.e());
     414    Hadron->SetPosition(GetPosition()+Momentum.vect());
     415  }
     416  return LeftVector;
    407417} // End of FragmentLundString
    408418
     
    410420G4QString* G4QString::CPExcited()
    411421{
    412         G4QParton* LeftParton = new G4QParton(GetLeftParton());
    413         G4QParton* RightParton= new G4QParton(GetRightParton());
    414         return new G4QString(LeftParton,RightParton,GetDirection());
     422 G4QParton* LeftParton = new G4QParton(GetLeftParton());
     423 G4QParton* RightParton= new G4QParton(GetRightParton());
     424 return new G4QString(LeftParton,RightParton,GetDirection());
    415425} // End of CPExcited
    416426
     
    419429{
    420430  // Check string decay threshold
    421                
    422         G4QHadronVector* result=0;  // return 0 when string exceeds the mass cut
    423        
    424         G4QHadronPair hadrons((G4QHadron*)0, (G4QHadron*)0); // pair of hadrons
    425         if(sqr(FragmentationMass(0,&hadrons)+MassCut)<Mass2()) return 0; //Par MassCut
    426        
    427         result = new G4QHadronVector;
     431 
     432  G4QHadronVector* result=0;  // return 0 when string exceeds the mass cut
     433 
     434  G4QHadronPair hadrons((G4QHadron*)0, (G4QHadron*)0); // pair of hadrons
     435  if(sqr(FragmentationMass(0,&hadrons)+MassCut)<Mass2()) return 0; //Par MassCut
     436 
     437  result = new G4QHadronVector;
    428438       
    429         if(hadrons.second==0)                   // Second hadron exists
    430         {
    431            // Substitute string by a light hadron, Note that Energy is not conserved here! @@
    432            G4ThreeVector Mom3 = Get4Momentum().vect();
    433            G4LorentzVector Mom(Mom3, std::sqrt(Mom3.mag2() + hadrons.first->GetMass2()) );
     439  if(hadrons.second==0)                   // Second hadron exists
     440  {
     441    // Substitute string by a light hadron, Note that Energy is not conserved here! @@
     442    G4ThreeVector Mom3 = Get4Momentum().vect();
     443    G4LorentzVector Mom(Mom3, std::sqrt(Mom3.mag2() + hadrons.first->GetMass2()) );
    434444    result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), Mom));
    435         }
     445  }
    436446  else
    437         {
    438            //... string was qq--qqbar type: Build two stable hadrons,
    439            G4LorentzVector  Mom1, Mom2;
    440            Sample4Momentum(&Mom1, hadrons.first->GetMass(), &Mom2, hadrons.second->GetMass(),
    441                                                                                   Get4Momentum().mag());
    442            result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), Mom1));
    443            result->push_back(new G4QHadron(hadrons.second,0, GetPosition(), Mom2));
     447  {
     448    //... string was qq--qqbar type: Build two stable hadrons,
     449    G4LorentzVector  Mom1, Mom2;
     450    Sample4Momentum(&Mom1, hadrons.first->GetMass(), &Mom2, hadrons.second->GetMass(),
     451                                                             Get4Momentum().mag());
     452    result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), Mom1));
     453    result->push_back(new G4QHadron(hadrons.second,0, GetPosition(), Mom2));
    444454    G4ThreeVector Velocity = Get4Momentum().boostVector();
    445455    G4int L=result->size(); if(L) for(G4int i=0; i<L; i++) (*result)[i]->Boost(Velocity);
    446         }
    447         return result;
     456  }
     457  return result;
    448458} // End of LightFragmentationTest
    449459
    450460// Calculate Fragmentation Mass (if pdefs # 0, returns two hadrons)
    451 G4double G4QString::FragmentationMass(G4QHcreate build, G4QHadronPair* pdefs)
     461G4double G4QString::FragmentationMass(G4QHcreate build, G4QHadronPair* pdefs)
    452462{
    453463  G4double mass;
    454464  // Example how to use an interface to different member functions
    455         if(build==0) build=&G4QHadronBuilder::BuildLowSpin; // @@ Build S Hadrons?
     465  if(build==0) build=&G4QHadronBuilder::BuildLowSpin; // @@ Build S Hadrons?
    456466  G4QHadron* Hadron1 = 0;                            // @@ Not initialized
    457467  G4QHadron* Hadron2 = 0;
     
    465475  {
    466476    // string is qq--qqbar: Build two stable hadrons, with extra uubar or ddbar quark pair
    467            G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
    468            if (GetLeftParton()->GetPDGCode() < 0) iflc = -iflc;
    469            //... theSpin = 4; spin 3/2 baryons will be built
    470            Hadron1 = (hadronizer->*build)(GetLeftParton(),CreateParton(iflc));
    471            Hadron2 = (hadronizer->*build)(GetRightParton(),CreateParton(-iflc));
     477    G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
     478    if (GetLeftParton()->GetPDGCode() < 0) iflc = -iflc;
     479    //... theSpin = 4; spin 3/2 baryons will be built
     480    Hadron1 = (hadronizer->*build)(GetLeftParton(),CreateParton(iflc));
     481    Hadron2 = (hadronizer->*build)(GetRightParton(),CreateParton(-iflc));
    472482    mass    = Hadron1->GetMass() + Hadron2->GetMass();
    473483  }
    474         if(pdefs) // need to return hadrons as well....
    475         {
    476            pdefs->first  = Hadron1;
    477            pdefs->second = Hadron2;
    478         }
     484  if(pdefs) // need to return hadrons as well....
     485  {
     486    pdefs->first  = Hadron1;
     487    pdefs->second = Hadron2;
     488  }
    479489  return mass;
    480490} // End of FragmentationMass
     
    527537G4int G4QString::GetDecayDirection() const
    528538{
    529         if      (decaying == Left ) return +1;
    530         else if (decaying == Right) return -1;
    531         else
    532         {
    533                                 G4cerr<<"***G4QString::GetDecayDirection: wrong DecayDirection="<<decaying<<G4endl;
     539  if      (decaying == Left ) return +1;
     540  else if (decaying == Right) return -1;
     541  else
     542  {
     543    G4cerr<<"***G4QString::GetDecayDirection: wrong DecayDirection="<<decaying<<G4endl;
    534544    G4Exception("G4QString::GetDecayDirection:","72",FatalException,"WrongDecayDirection");
    535         }
    536         return 0;
     545  }
     546  return 0;
    537547}
    538548
    539549G4ThreeVector G4QString::StablePt()
    540550{
    541         if (decaying == Left ) return Ptright;
    542         else if (decaying == Right ) return Ptleft;
    543         else
    544         {
    545                                 G4cerr<<"***G4QString::StablePt: wrong DecayDirection="<<decaying<<G4endl;
     551  if (decaying == Left ) return Ptright;
     552  else if (decaying == Right ) return Ptleft;
     553  else
     554  {
     555    G4cerr<<"***G4QString::StablePt: wrong DecayDirection="<<decaying<<G4endl;
    546556    G4Exception("G4QString::StablePt:","72",FatalException,"WrongDecayDirection");
    547         }
    548         return G4ThreeVector();
     557  }
     558  return G4ThreeVector();
    549559}
    550560
    551561G4ThreeVector G4QString::DecayPt()
    552562{
    553         if      (decaying == Left  ) return Ptleft;
    554         else if (decaying == Right ) return Ptright;
    555         else
    556         {
    557                                 G4cerr<<"***G4QString::DecayPt: wrong DecayDirection="<<decaying<<G4endl;
     563  if      (decaying == Left  ) return Ptleft;
     564  else if (decaying == Right ) return Ptright;
     565  else
     566  {
     567    G4cerr<<"***G4QString::DecayPt: wrong DecayDirection="<<decaying<<G4endl;
    558568    G4Exception("G4QString::DecayPt:","72",FatalException,"WrongDecayDirection");
    559         }
    560         return G4ThreeVector();
     569  }
     570  return G4ThreeVector();
    561571}
    562572
    563573G4double G4QString::LightConeDecay()
    564574{
    565         if      (decaying == Left  ) return Pplus;
    566         else if (decaying == Right ) return Pminus;
    567         else
    568         {
    569                                 G4cerr<<"***G4QString::LightConeDecay: wrong DecayDirection="<<decaying<<G4endl;
     575  if      (decaying == Left  ) return Pplus;
     576  else if (decaying == Right ) return Pminus;
     577  else
     578  {
     579    G4cerr<<"***G4QString::LightConeDecay: wrong DecayDirection="<<decaying<<G4endl;
    570580    G4Exception("G4QString::LightConeDecay:","72",FatalException,"WrongDecayDirection");
    571         }
    572         return 0;
     581  }
     582  return 0;
    573583}
    574584
     
    576586{
    577587  G4LorentzVector momentum(Ptleft+Ptright,0.5*(Pplus+Pminus));
    578         momentum.setPz(0.5*(Pplus-Pminus));
    579         return momentum;
     588  momentum.setPz(0.5*(Pplus-Pminus));
     589  return momentum;
    580590}
    581591
     
    594604  if(HadronMomentum)
    595605  {   
    596            G4ThreeVector   Pos(0.,0.,0.);
    597            Hadron->Set4Momentum(*HadronMomentum);
    598            UpdateString(newStringEnd, HadronMomentum);
    599            delete HadronMomentum;
     606    G4ThreeVector   Pos(0.,0.,0.);
     607    Hadron->Set4Momentum(*HadronMomentum);
     608    UpdateString(newStringEnd, HadronMomentum);
     609    delete HadronMomentum;
    600610  }     
    601611  return Hadron;
     
    604614void G4QString::UpdateString(G4QParton* decay, const G4LorentzVector* mom)
    605615{
    606         decaying=None;
    607         if(decaying == Left)
    608         {
     616  decaying=None;
     617  if(decaying == Left)
     618  {
    609619    G4QParton* theFirst = thePartons[0];
    610                                 delete theFirst;
    611                   theFirst = decay;
    612                   Ptleft  -= mom->vect();
    613                   Ptleft.setZ(0.);
    614         }
     620    delete theFirst;
     621    theFirst = decay;
     622    Ptleft  -= mom->vect();
     623    Ptleft.setZ(0.);
     624  }
    615625  else if (decaying == Right)
    616         {
     626  {
    617627    G4QParton* theLast = thePartons[thePartons.size()-1];
    618628    delete theLast;
    619                   theLast  = decay;
    620                   Ptright -= mom->vect();
    621                   Ptright.setZ(0.);
    622         }
     629    theLast  = decay;
     630    Ptright -= mom->vect();
     631    Ptright.setZ(0.);
     632  }
    623633  else
    624         {
    625                                 G4cerr<<"***G4QString::UpdateString: wrong oldDecay="<<decaying<<G4endl;
     634  {
     635    G4cerr<<"***G4QString::UpdateString: wrong oldDecay="<<decaying<<G4endl;
    626636    G4Exception("G4QString::UpdateString","72",FatalException,"WrongDecayDirection");
    627         }
    628         Pplus  -= mom->e() + mom->pz();
    629         Pminus -= mom->e() - mom->pz();
     637  }
     638  Pplus  -= mom->e() + mom->pz();
     639  Pminus -= mom->e() - mom->pz();
    630640} // End of UpdateString
    631641
     
    641651  G4double DecayQuarkMass2  = sqr(GetDecayParton()->GetMass()); // Mass of quark? M.K.
    642652  G4double HadronMass2T = HadronMass*HadronMass + HadronPt.mag2();
    643   if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*Mass2() )  return 0;                // restart!
     653  if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*Mass2() )  return 0;  // restart!
    644654  //... then compute allowed z region  z_min <= z <= z_max
    645655  G4double zMin = HadronMass2T/Mass2();
    646656  G4double zMax = 1. - DecayQuarkMass2/Mass2();
    647   if (zMin >= zMax) return 0;           // have to start all over! 
     657  if (zMin >= zMax) return 0;  // have to start all over! 
    648658  G4double z=0;
    649659  if(QL) z = GetQGSMLightConeZ(zMin, zMax, GetDecayParton()->GetPDGCode(), pHadron,
     
    704714  {
    705715    if(cClusterInterrupt++ >= ClusterLoopInterrupt) return false;
    706            G4QParton* quark = 0;
    707            string->SetLeftPartonStable(); // to query quark contents..
    708            if(string->DecayIsQuark() && string->StableIsQuark()) // There're quarks on clusterEnds
    709                     LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
    710            else
    711     {
    712              //... there is a Diquark on cluster ends
    713                     G4int IsParticle;
    714                     if(string->StableIsQuark())IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?-1:1;
    715                     else                       IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?1:-1;
     716    G4QParton* quark = 0;
     717    string->SetLeftPartonStable(); // to query quark contents..
     718    if(string->DecayIsQuark() && string->StableIsQuark()) // There're quarks on clusterEnds
     719      LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
     720    else
     721    {
     722      //... there is a Diquark on cluster ends
     723      G4int IsParticle;
     724      if(string->StableIsQuark())IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?-1:1;
     725      else                       IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?1:-1;
    716726      G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false);  // no diquarks wanted
    717727      quark = QuarkPair.GetParton2();
    718728      LeftHadron=hadronizer->Build(QuarkPair.GetParton1(), string->GetLeftParton());
    719            }
     729    }
    720730    RightHadron = hadronizer->Build(string->GetRightParton(), quark);
    721731    //... repeat procedure, if mass of cluster is too low to produce hadrons
    722732    //... ClusterMassCut = 0.15*GeV model parameter
    723            if ( quark->GetParticleSubType()== "quark" ) ClusterMassCut = 0.;
    724            else                                         ClusterMassCut = ClusterMass;
     733    if ( quark->GetParticleSubType()== "quark" ) ClusterMassCut = 0.;
     734    else                                         ClusterMassCut = ClusterMass;
    725735  } while(ResidualMass <= LeftHadron->GetMass() + RightHadron->GetMass() + ClusterMassCut);
    726736  //... compute hadron momenta and energies   
     
    737747} // End of SplitLast
    738748
    739 G4QHadron*      G4QString::QuarkSplitup(G4QParton*      decay, G4QParton *&created)
    740 {
    741   G4int IsParticle=(decay->GetPDGCode()>0) ? -1 : +1; // if we have a quark, we need antiquark (or diquark)
     749G4QHadron* G4QString::QuarkSplitup(G4QParton* decay, G4QParton *&created)
     750{
     751  G4int IsParticle=(decay->GetPDGCode()>0) ? -1 : +1; // a quark needs antiquark or diquark
    742752  G4QPartonPair QuarkPair = CreatePartonPair(IsParticle);
    743753  created = QuarkPair.GetParton2();
     
    761771    }
    762772    G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
    763            // if we have a quark, we need antiquark)
     773    // if we have a quark, we need antiquark)
    764774    G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false);  // no diquarks wanted
    765775    //... Build new Diquark
     
    777787    //... Diquark does not break
    778788    G4int IsParticle=(decay->GetPDGCode()>0) ? +1 : -1;
    779         // if we have a diquark, we need quark)
     789     // if we have a diquark, we need quark)
    780790    G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false);  // no diquarks wanted
    781791    created = QuarkPair.GetParton2();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4Quasmon.cc

    r1007 r1055  
    2828//
    2929//
    30 // $Id: G4Quasmon.cc,v 1.107 2008/03/31 20:30:35 dennis Exp $
    31 // GEANT4 tag $Name: geant4-09-02 $
     30// $Id: G4Quasmon.cc,v 1.111 2009/05/27 08:53:15 mkossov Exp $
     31// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3232//
    3333//      ---------------- G4Quasmon ----------------
    3434//             by Mikhail Kossov, July 1999.
    3535//  class for an excited hadronic state used by the CHIPS Model
    36 // ------------------------------------------------------------
     36// ---------------------------------------------------------------------------
     37// Short description: The Quasmon is the main object of the CHIPS model, where
     38// hadronic states are defined by the quark content and the 4-momentum (mass).
     39// In this sense a Quasmon is a generalised hadron - hadrons are the low
     40// mass discrete states of quasmons. Here the hadron can be not only an
     41// elementary particle, consisting of   2 or 3 quarks, but a nucleonic
     42// cluster, consisting of 6, 9, ... , 3n, ... quarks. In the CHIPS model
     43// the nucleus is considered as a group of the nucleons and the nucleonic
     44// clusters. In hadronic reactions a Quasmon is constructed in vacuum as
     45// a result of the collision (G4QCollision process). In this case only
     46// the G4Quasmon class can be used for the reaction. In nuclear reactions
     47// one or a few Quasmons can be created as a result of the colision of
     48// the projectile hadrons with the nucleons and the nucleonic clusters
     49// of the nuclear target. In this case the Quasmons are created and
     50// fragmented in the nuclear environment (G4QNucleus) and the G4QEnvironment
     51// class must be used for the reaction. For nuclear-nuclear reactions
     52// two G4QEnvironments are used with the common (which can fragment in both
     53// nuclear environments - mostly at low energies), individual (which can
     54// fragment in only one of two G4QEnvironments) and vacuum (which can
     55// fragment in vacuum being too far by rapidity from both nuclei) Quasmons.
     56// --------------------------------------------------------------------------
     57//
    3758//#define debug
    3859//#define pdebug
     
    287308  {
    288309#ifdef debug
    289            G4cout<<"G4Q::HQ: PionAtRest, addP="<<addPhoton<<", momP="<<momPhoton<<G4endl;
     310    G4cout<<"G4Q::HQ: PionAtRest, addP="<<addPhoton<<", momP="<<momPhoton<<G4endl;
    290311#endif
    291312    addPhoton=0.;
     
    330351#endif
    331352    if(addPhoton)
    332            {
    333              G4cerr<<"***G4Quas::HQ:Q4M="<<q4Mom<<",status="<<status<<", phE="<<addPhoton<<G4endl;
     353    {
     354      G4cerr<<"***G4Quas::HQ:Q4M="<<q4Mom<<",status="<<status<<", phE="<<addPhoton<<G4endl;
    334355      throw G4QException("G4Quasmon::HadronizeQuasmon: OverheadPhoton for theZeroQuasmon");
    335            }
     356    }
    336357    KillQuasmon();                         // This Quasmon is done
    337358    qEnv=theEnvironment;                   // Update QEnvironment
     
    386407    if(nHd) for(int ih=0; ih<nHd; ih++) ccSum+=theQHadrons[ih]->GetCharge();
    387408    if(ccSum!=cSum)
    388            {
     409    {
    389410      G4cerr<<"*G4Q::HQ:C"<<cSum<<",c="<<ccSum<<",E="<<theEnvironment<<",Q="<<valQ<<G4endl;
    390411      G4cerr<<":G4Q::HQ:oldE="<<oldEnv<<"oldQ="<<oldCQC<<",oN="<<oldNH<<",N="<<nHd<<G4endl;
     
    405426    G4double tmpPq=q4Mom.rho();            // Momentum of Quasmon
    406427    if(fabs(qM2)<.0001 || tmpEq<=tmpPq)
    407            {
     428    {
    408429      qM2=0.;
    409430      if(!valQ.GetCharge() && !valQ.GetBaryonNumber() && !valQ.GetStrangeness())
    410431      {
    411432        if(fabs(qM2)<.001)
    412                {
     433        {
    413434          q4Mom.setE(tmpPq);
    414435#ifdef debug
     
    420441          qEnv=theEnvironment;             // Update QEnvironment
    421442          return theQHadrons;              // The last decay of the quasmon...
    422                }
     443        }
    423444        else if(tmpPq<.001)                // @@ Unprobable...
    424                {
     445        {
    425446#ifdef debug
    426447          G4cout<<"G4Q::HQ:Quasmon is nothing, Q4M="<<q4Mom<<",E="<<theEnvironment<<G4endl;
     
    429450          qEnv=theEnvironment;             // Update QEnvironment
    430451          return theQHadrons;              // The last act of the quasmon...
    431                }
     452        }
    432453      }
    433454      else q4Mom.setE(tmpPq*1.00001);      // @@ Can break E/p conservation
     
    438459    //////////G4double b2=qltb.mag2();                       // beta^2 of Quasmon
    439460#ifdef debug
    440            G4cout<<"G4Q::HQ: Quasm="<<q4Mom<<",qM="<<quasM<<",qQC="<<valQ<<G4endl;
     461    G4cout<<"G4Q::HQ: Quasm="<<q4Mom<<",qM="<<quasM<<",qQC="<<valQ<<G4endl;
    441462#endif
    442463    CalculateNumberOfQPartons(quasM);      // Fills PrivateParameter nOfQ (a#OfQPartonsInQ)
     
    449470    //G4int maxActEnv=4;   // n-Dod + p-Dod  // maxEnv.(in d) to compensate the Q recoilMom
    450471    G4int maxActEnv=256; // n-Dod + p-Dod  // maxEnv.(in d) to compensate the Q recoilMom
    451     G4int dmaxActEnv=maxActEnv+maxActEnv;  // 2maxEnv.(in d) to compensate the Q recoilMom
     472    G4int dmaxActEnv=maxActEnv+maxActEnv;  // 2*maxEnv.(in d) to compensate the Q recoilMom
    452473    //G4double fAE=static_cast<double>(maxActEnv);
    453            if(envA>dmaxActEnv)
    454                                 //if(2>3)                              // Corresponds to envA>256
    455            {
    456              //G4int oEn=static_cast<int>(fAE/sqrt(static_cast<double>(envA)));
     474    if(envA>dmaxActEnv)
     475    //if(2>3)                              // Corresponds to envA>256
     476    {
     477      //G4int oEn=static_cast<int>(fAE/sqrt(static_cast<double>(envA)));
    457478      G4int zEn=maxActEnv;                 // Charge of the LimitActiveNuclearEnvironment
    458479      G4int nEn=zEn;                       // Charge of the LimitActiveNuclearEnvironment
     
    461482      bEn4M=G4LorentzVector(0.,0.,0.,mbEn);// 4-momentum of the LimitActiveNuclearEnviron
    462483      bEnQC=G4QContent(bEn+nEn,bEn+zEn,0,0,0,0); // QuarkContent of the LimitActiveNuclEnv
    463            }
     484    }
    464485    else                                   // @@ Can be made STATIC CONSTANTS
    465            {
     486    {
    466487      bEn   = 256;                         // BaryoN of the LimitActiveNuclearEnvironment
    467488      mbEn  = G4QPDGCode(2112).GetNuclMass(128,128,0); // Mass of the LimActNucEnvironment
     
    472493    G4QContent envQC=theEnvironment.GetQCZNS(); // QuarkContent of theCurrentNuclearEnviron
    473494#ifdef debug
    474            G4cout<<"G4Q::HQ: ePDG="<<envPDG<<",eM="<<envM<<",eQC="<<envQC<<G4endl;
     495    G4cout<<"G4Q::HQ: ePDG="<<envPDG<<",eM="<<envM<<",eQC="<<envQC<<G4endl;
    475496#endif
    476497    G4QContent totQC=valQ+envQC;           // Total Quark Content
     
    483504    G4double totM  =totN.GetMZNS();        // Minimum Mass of the Total System
    484505#ifdef debug
    485            G4cout<<"G4Q::HQ: tN="<<totN<<",tGSM="<<totM<<",tQC="<<totQC<<G4endl;
     506    G4cout<<"G4Q::HQ: tN="<<totN<<",tGSM="<<totM<<",tQC="<<totQC<<G4endl;
    486507#endif
    487508    /////////////////////G4double protCB=theEnvironment.CoulombBarrier(1.,1.);
     
    489510    G4double resNM =10000000.;             // Prototype of residual mass after n separated
    490511    if(totNeut>0)
    491            {
     512    {
    492513      G4QContent resNQC=totQC-G4QContent(2,1,0,0,0,0);
    493514      G4QNucleus resNN(resNQC);
    494515      resNM  = resNN.GetMZNS();
    495516      resNPDG= resNN.GetPDG();
    496            }
     517    }
    497518    G4LorentzVector env4M =G4LorentzVector(0.,0.,0.,envM);
    498519    G4LorentzVector tot4M =q4Mom+env4M;
     
    500521    G4int    totPDG=totN.GetPDG();         // Total PDG Code for the Current compound
    501522#ifdef debug
    502            G4cout<<"G4Q::HQ: totPDG="<<totPDG<<",totM="<<totMass<<",rPDG="<<resNPDG<<G4endl;
     523    G4cout<<"G4Q::HQ: totPDG="<<totPDG<<",totM="<<totMass<<",rPDG="<<resNPDG<<G4endl;
    503524#endif
    504525    G4double totEn=tot4M.e();
    505                                 G4double totMo=tot4M.rho();
    506            if(totEn<totMo)
     526    G4double totMo=tot4M.rho();
     527    if(totEn<totMo)
    507528    {
    508529      G4cerr<<"---Warning---G4Q::HQ: *Boost* tot4M="<<tot4M<<", E-p="<<totEn-totMo<<G4endl;
     
    510531      G4double emodif=fabs(totEn-totMo);
    511532      //if(emodif<accuracy)
    512                                                 //{
     533      //{
    513534        G4cerr<<"G4Q::HQ: *Boost* E-p shift  is corrected to "<<emodif<<G4endl;
    514535        tot4M.setE(totMo+emodif+.01*accuracy);
    515                                                 //}
     536      //}
    516537    }
    517538    G4ThreeVector totBoost = tot4M.boostVector(); // BoostVector for TotalSystem (backward)
     
    524545    G4int    iniS   =valQ.GetL();
    525546#ifdef debug
    526            G4cout<<"G4Q::HQ: iniPDG="<<iniPDG<<", Z="<<iniP<<", N="<<iniN<<", S="<<iniS<<G4endl;
     547    G4cout<<"G4Q::HQ: iniPDG="<<iniPDG<<", Z="<<iniP<<", N="<<iniN<<", S="<<iniS<<G4endl;
    527548#endif
    528549    G4QNucleus iniRN(iniP,iniN-1,iniS);
     
    531552    G4double iniQM =G4QPDGCode(iniPDG).GetMass();  // Minimum mass of Quasmon
    532553#ifdef debug
    533            G4cout<<"G4Q::HQ: iniRN="<<iniRN<<", iniRM="<<iniRM<<", iniQM="<<iniQM<<G4endl;
     554    G4cout<<"G4Q::HQ: iniRN="<<iniRN<<", iniRM="<<iniRM<<", iniQM="<<iniQM<<G4endl;
    534555#endif
    535556    /////////////////G4double iniQM2= iniQM*iniQM;
     
    558579    //theEnvironment.PrepareCandidates(theQCandidates,false,false);//Calc.PrePreprob's of C
    559580    //G4bool fF=piF||gaF;
    560            // piF,piF or gaF,gaF is correct. Made to avoid theSpecificInteractionTimeClusterChoice
     581    // piF,piF or gaF,gaF is correct. Made to avoid theSpecificInteractionTimeClusterChoice
    561582    theEnvironment.PrepareCandidates(theQCandidates,piF,piF);// Calc.PrePreprob of Candid's
    562583    ModifyInMatterCandidates();            // Calculate InMediaMasses of Cand. & Possibil.
     
    596617      kCountMax=pCountMax;
    597618    }
    598            G4bool gintFlag=false;                // Flag of gamma interaction with one quark
    599            while(kCount<kCountMax&&kCond)
    600            {
     619    G4bool gintFlag=false;                // Flag of gamma interaction with one quark
     620    while(kCount<kCountMax&&kCond)
     621    {
    601622      kCond=true;
    602623      G4double miM2=0.;
    603624      if(envPDG==NUCPDG)
    604              {
     625      {
    605626        if(excE>mPi0) miM2=mPi02;
    606627        else          miM2=mP2;
    607              }
     628      }
    608629      else                                // "Env. exists" case - find k_min & k_max
    609              {
     630      {
    610631        minK=100000.;
    611632        // @@ ??? May be for the light nuclei ???
    612633        //if(piF&&quasM>iniQM) maxK=mNeut/2.+(quasM-iniQM)*iniQM/(iniQM+mNeut);
    613634        //else if(quasM>iniQM)
    614                       //{
     635        //{
    615636        //  G4double limK=envM/2.+(quasM-iniQM)*iniQM/(iniQM+envM);
    616637        //  if(limK<maxK) maxK=limK;
    617                       //}
     638        //}
    618639        //@@*acceleration*: check only for P,N,d,& alpfa, can be done for all clusters(?)
    619640        //if(iniN>0&&iniBN>1)               // "Neutron-hadron" estimate
     
    634655        //    G4double dkts=kts+kts;
    635656        //    G4double fu=dkts*(dkts*quasM-sm2)+quasM*m2N;
    636                //    G4cout<<"G4Q::HQ:M="<<quasM<<",R="<<bnRQ<<",f("<<kts<<")="<<fu<<"<0"<<G4endl;
     657        //    G4cout<<"G4Q::HQ:M="<<quasM<<",R="<<bnRQ<<",f("<<kts<<")="<<fu<<"<0"<<G4endl;
    637658#endif
    638659        //    if(quasM>=mNeut+bnRQ)
     
    653674        if(totN>0&&totBN>1)               // "Neutron-cluster" estimate
    654675        {
    655                         G4QNucleus tmpNN(totZ,totN-1,0);
     676          G4QNucleus tmpNN(totZ,totN-1,0);
    656677          G4double delN=tmpNN.GetMZNS()+mNeut-totM;
    657678          if(envN>0&&envA>1)
    658679          {
    659                                  G4QNucleus envNN(envZ,envN-1,0);
     680            G4QNucleus envNN(envZ,envN-1,0);
    660681            G4double delEN=envNN.GetMZNS()+mNeut-envM;
    661682            if(delEN>delN) delN=delEN;
    662                         }
     683          }
    663684          delN*=qurF;
    664685          if(delN<minK) minK=delN;
     
    667688        {
    668689          G4double proCB=theEnvironment.CoulombBarrier(1,1);
    669                         G4QNucleus tmpPN(totZ-1,totN,0);
     690          G4QNucleus tmpPN(totZ-1,totN,0);
    670691          G4double delP=tmpPN.GetMZNS()+mProt-totM+proCB;
    671692          if(envZ>0&&envA>1)
    672693          {
    673                                  G4QNucleus envPN(envZ-1,envN,0);
     694            G4QNucleus envPN(envZ-1,envN,0);
    674695            G4double delEP=envPN.GetMZNS()+mProt-envM+proCB;
    675696            if(delEP>delP) delP=delEP;
    676                         }
     697          }
    677698          delP*=qurF;
    678699          if(delP<minK) minK=delP;
     
    681702        {
    682703          G4double proCB=theEnvironment.CoulombBarrier(1,2);
    683                         G4QNucleus tmpDN(totZ-1,totN-1,0);
     704          G4QNucleus tmpDN(totZ-1,totN-1,0);
    684705          G4double delD=tmpDN.GetMZNS()+mDeut-totM+proCB;
    685706          if(envN>0&&envZ>0&&envA>2)
    686707          {
    687                           G4QNucleus envDN(envZ-1,envN-1,0);
     708            G4QNucleus envDN(envZ-1,envN-1,0);
    688709            G4double delED=envDN.GetMZNS()+mDeut-envM+proCB;
    689710            if(delED>delD) delD=delED;
    690                         }
     711          }
    691712          delD*=qurF;
    692713          if(delD<minK) minK=delD;
     
    695716        {
    696717          G4double proCB=theEnvironment.CoulombBarrier(1,3);
    697                         G4QNucleus tmpTN(totZ-1,totN-2,0);
     718          G4QNucleus tmpTN(totZ-1,totN-2,0);
    698719          G4double delT=tmpTN.GetMZNS()+mTrit-totM+proCB;
    699720          if(envN>1&&envZ>0&&envA>3)
    700721          {
    701                           G4QNucleus envTN(envZ-1,envN-2,0);
     722            G4QNucleus envTN(envZ-1,envN-2,0);
    702723            G4double delET=envTN.GetMZNS()+mTrit-envM+proCB;
    703724            if(delET>delT) delT=delET;
    704                         }
     725          }
    705726          delT*=qurF;
    706727          if(delT<minK) minK=delT;
     
    709730        {
    710731          G4double proCB=theEnvironment.CoulombBarrier(2,3);
    711                         G4QNucleus tmpRN(totZ-2,totN-1,0);
     732          G4QNucleus tmpRN(totZ-2,totN-1,0);
    712733          G4double delR=tmpRN.GetMZNS()+mHel3-totM+proCB;
    713734          if(envN>0&&envZ>1&&envA>3)
    714735          {
    715                           G4QNucleus envRN(envZ-2,envN-1,0);
     736            G4QNucleus envRN(envZ-2,envN-1,0);
    716737            G4double delER=envRN.GetMZNS()+mHel3-envM+proCB;
    717738            if(delER>delR) delR=delER;
    718                         }
     739          }
    719740          delR*=qurF;
    720741          if(delR<minK) minK=delR;
     
    723744        {
    724745          G4double proCB=theEnvironment.CoulombBarrier(2,4);
    725                         G4QNucleus tmpAN(totZ-2,totN-2,0);
     746          G4QNucleus tmpAN(totZ-2,totN-2,0);
    726747          G4double delA=tmpAN.GetMZNS()+mAlph-totM+proCB;
    727748          if(envN>1&&envZ>1&&envA>4)
    728749          {
    729                           G4QNucleus envAN(envZ-2,envN-2,0);
     750            G4QNucleus envAN(envZ-2,envN-2,0);
    730751            G4double delEA=envAN.GetMZNS()+mAlph-envM+proCB;
    731752            if(delEA>delA) delA=delEA;
    732                         }
     753          }
    733754          delA*=qurF;
    734755          if(delA*qurF<minK) minK=delA*qurF;
     
    738759        //{
    739760        //  G4double proCB=theEnvironment.CoulombBarrier(3,6);
    740                       //  G4QNucleus tmpLN(totZ-3,totN-3,0);
     761        //  G4QNucleus tmpLN(totZ-3,totN-3,0);
    741762        //  G4double delL=tmpLN.GetMZNS()+mLit6-totM+proCB;
    742763        //  if(envN>2&&envZ>2&&envA>6)
    743764        //  {
    744                       //    G4QNucleus envLN(envZ-3,envN-3,0);
     765        //    G4QNucleus envLN(envZ-3,envN-3,0);
    745766        //    G4double delEL=envLN.GetMZNS()+mLit6-envM+proCB;
    746767        //    if(delEL>delL) delL=delEL;
    747                       //  }
     768        //  }
    748769        //  delL*=qurF;
    749770        //  if(delL<minK) minK=delL;
    750771        //}
    751772        if(minK<0.||minK+minK>quasM) minK=0.;
    752              }
     773      }
    753774      //if(addPhoton>0.&&quasM<1500.&&G4UniformRand()<f2all)
    754              //if(addPhoton>0.&&iniBN<2)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    755              //if(addPhoton>0.&&(G4UniformRand()<.7||iniBN<2))//PhotoAbsorbDiagramContrib
    756              //if(addPhoton>0.&&(G4UniformRand()<.5||iniBN<2))//PhotonAbsorbDiagramContrib
     775      //if(addPhoton>0.&&iniBN<2)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     776      //if(addPhoton>0.&&(G4UniformRand()<.7||iniBN<2))//PhotoAbsorbDiagramContrib
     777      //if(addPhoton>0.&&(G4UniformRand()<.5||iniBN<2))//PhotonAbsorbDiagramContrib
    757778      //if(addPhoton>0.&&(G4UniformRand()<.27||iniBN<2))// PhotonAbsorbDiagramContrib
    758              //if(addPhoton>0.&&iniBN<2)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    759              //if(addPhoton>0.&&iniBN>1)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    760              //if(addPhoton>0.&&G4UniformRand()<0.5)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    761              //if(addPhoton>0.&&G4UniformRand()<0.75)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    762              ///if(addPhoton>0.&&G4UniformRand()<0.8)// PhotonAbsorbDiagramContrib(@@HiddenPar)
    763              //if(addPhoton>0.&&iniBN>1)//PhotonAbsorbDiagramContrib(Photon's captured by N quark)
    764              if(addPhoton>0.)// PhotonAbsorbDiagramContrib(Photon is always captured by quarks)
    765              //if(2>3)                              // Photon capture by quark is closed
     779      //if(addPhoton>0.&&iniBN<2)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     780      //if(addPhoton>0.&&iniBN>1)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     781      //if(addPhoton>0.&&G4UniformRand()<0.5)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     782      //if(addPhoton>0.&&G4UniformRand()<0.75)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     783      ///if(addPhoton>0.&&G4UniformRand()<0.8)// PhotonAbsorbDiagramContrib(@@HiddenPar)
     784      //if(addPhoton>0.&&iniBN>1)//PhotonAbsorbDiagramContrib(Photon's captured by N quark)
     785      if(addPhoton>0.)// PhotonAbsorbDiagramContrib(Photon is always captured by quarks)
     786      //if(2>3)                              // Photon capture by quark is closed
    766787      {
    767788        //nOfQ=valQ.GetQ()-valQ.GetAQ();     // Recover nOfQ for the not excited cluster
    768789        // @@ 1/(p_g,p_q) interaction probability (? (p_g,p_q)=0 always)
    769                gintFlag=true;
     790        gintFlag=true;
    770791        q4Mom-= phot4M;                    // recover Quasmon-Cluster without the Photon
    771792        qM2   = q4Mom.m2();                // Update the Current squared mass of Quasmon
     
    779800        //G4int cMax=27;//For m_gam=0:*[k/(k+p) factor 1/s{m<<k,s=m^2*(1+p/k)}]*[p/k(ct=0)]
    780801        //G4int pCount=0;//For m_gam=0 the suppression factor can be p*p/(p+k)/(p+k) @@ (?)
    781                       //while (frat && pCount<cMax)
     802        //while (frat && pCount<cMax)
    782803        //{
    783                       // ____ Keep this when closing while______________________________
    784                       G4double rn=G4UniformRand(); // k is changed by addPhoton
     804        // ____ Keep this when closing while______________________________
     805        G4double rn=G4UniformRand(); // k is changed by addPhoton
    785806        kMom=(1.-(1.-xmi)*pow(rn,1./kpow))*quasM/2; // 1/k from delta-funct integration
    786807        // ----------
     
    788809        G4double dkM=kMom+kMom;
    789810        // p2+k2+2pkcost=(k+e)2
    790                //cost=(addPhoton*addPhoton-momPhoton*momPhoton+addPhoton*dkM)/momPhoton/dkM;
     811        //cost=(addPhoton*addPhoton-momPhoton*momPhoton+addPhoton*dkM)/momPhoton/dkM;
    791812        G4double cor=200./dkM/addPhoton;
    792813        G4double bas=std::log(2+cor);
    793                cost=1.-std::exp(bas-(bas-std::log(cor))*G4UniformRand());
    794                //cost=1.-2*G4UniformRand();
    795                       // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    796                       //  frat=G4UniformRand()>kMom/(addPhoton+kMom);
    797                       //  //frat=G4UniformRand()>kMom*kMom/(addPhoton+kMom)/(addPhoton+kMom);
     814        cost=1.-std::exp(bas-(bas-std::log(cor))*G4UniformRand());
     815        //cost=1.-2*G4UniformRand();
     816        // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     817        //  frat=G4UniformRand()>kMom/(addPhoton+kMom);
     818        //  //frat=G4UniformRand()>kMom*kMom/(addPhoton+kMom)/(addPhoton+kMom);
    798819        //  //frat=G4UniformRand()>addPhoton/(addPhoton+kMom);
    799820        //  //frat=G4UniformRand()>addPhoton*addPhoton/(addPhoton+kMom)/(addPhoton+kMom);
    800821        //  pCount++;
    801                       //}
     822        //}
    802823        if(cost>1.) cost=1.;
    803824        if(cost<-1.) cost=-1.;
    804825#ifdef debug
    805                G4cout<<"G4Q::HQ:**PHOTON out of Q**k="<<kMom<<",ct="<<cost<<",QM="<<quasM<<G4endl;
     826        G4cout<<"G4Q::HQ:**PHOTON out of Q**k="<<kMom<<",ct="<<cost<<",QM="<<quasM<<G4endl;
    806827#endif
    807828        // @@ (?) Pseudo Fermi-mom correction (use lib function for the 3d randomization -*
     
    834855        //cost-=dc;                                  // for virtPhotons smear in both dir.|
    835856        // --- Quark mass correction ends here (?) ---------------------------------------*
    836              }
     857      }
    837858      else
    838              {
    839                       gaF=false;                         // GammaFirstAct flag is only for the gamma-q
    840                gintFlag=false;
     859      {
     860        gaF=false;                         // GammaFirstAct flag is only for the gamma-q
     861        gintFlag=false;
    841862        // ==== Probabiliti proportional to k (without 1/k factor of hadronization)
    842863        if(!miM2) miM2=(minK+minK)*quasM; // Make minimum mass for randomization
     
    846867        //G4double kpow=static_cast<double>(nOfQ-2);
    847868        //G4double kst=0.;
    848                       //if(maxK+maxK<quasM+.1) kst=pow((1.-(maxK+maxK)/quasM),kpow);
     869        //if(maxK+maxK<quasM+.1) kst=pow((1.-(maxK+maxK)/quasM),kpow);
    849870        //if(maxK>minK)
    850871        //{
     
    856877        G4double rnc=G4UniformRand();
    857878        cost = 1.-rnc-rnc;
    858              }
     879      }
    859880      G4double cQM2=qM2-(kMom+kMom)*quasM;
    860881      if(cQM2<0.)
    861              {
     882      {
    862883        //if(cQM2<-.0001)G4cerr<<"--Warning--G4Q::HQ:(PhBack) cQM2="<<cQM2<<" < 0"<<G4endl;
    863884        cQM2=0.;
    864              }
     885      }
    865886      G4double cQM=sqrt(cQM2);             // Mass of the coloured residual Quasmom
    866887      k4Mom=zeroLV;
    867888      cr4Mom=G4LorentzVector(0.,0.,0.,cQM);
    868889      G4LorentzVector dir4M=q4Mom-G4LorentzVector(0.,0.,0.,q4Mom.e()*.01);
    869              if(!G4QHadron(q4Mom).RelDecayIn2(k4Mom,cr4Mom,dir4M,cost,cost)) //Q->ColResQ+k_part
     890      if(!G4QHadron(q4Mom).RelDecayIn2(k4Mom,cr4Mom,dir4M,cost,cost)) //Q->ColResQ+k_part
    870891      {
    871892#ifdef debug
     
    884905          }
    885906          gintFlag=false;
    886                       }
     907        }
    887908      }
    888909      else                                  // ***> The decay succeeded
     
    896917          kMom=k4Mom.e();                   // Update the k_parton momentum
    897918          gintFlag=false;
    898                       }
    899 #ifdef debug
    900                G4cout<<"G4Q::HQ:(PhBack) k="<<kMom<<",k4M="<<k4Mom<<",ct="<<cost<<",gF="<<gintFlag
     919        }
     920#ifdef debug
     921        G4cout<<"G4Q::HQ:(PhBack) k="<<kMom<<",k4M="<<k4Mom<<",ct="<<cost<<",gF="<<gintFlag
    901922              <<G4endl;
    902923#endif
     
    907928        G4int totCand = theQCandidates.size(); // Total number of candidates
    908929#ifdef sdebug
    909                G4cout<<"G4Q::HQ: ***>>>K-ITERATION #"<<kCount<<", k="<<kMom<<k4Mom<<G4endl;
     930        G4cout<<"G4Q::HQ: ***>>>K-ITERATION #"<<kCount<<", k="<<kMom<<k4Mom<<G4endl;
    910931#endif
    911932        for (G4int index=0; index<totCand; index++)
     
    917938            G4bool poss= curCand->GetPossibility();
    918939#ifdef debug
    919                           if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
    920                      G4cout<<"G4Q::HQ:pos="<<poss<<",cPDG="<<cPDG<<",iQC="<<iniQChg<<G4endl;
    921 #endif
    922                           if(poss)
     940            if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
     941              G4cout<<"G4Q::HQ:pos="<<poss<<",cPDG="<<cPDG<<",iQC="<<iniQChg<<G4endl;
     942#endif
     943            if(poss)
    923944            {
    924945              G4double   cMs=curCand->GetEBMass(); // EnvBound mass of the ParentCluster(?)
     
    931952              //////////////////G4double pmk  = rMo*cMs/kLS;
    932953#ifdef debug
    933                             if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
    934                                      G4cout<<"G4Q::HQ:cfM="<<cfM<<",cMs="<<cMs<<",ind="<<index<<G4endl;
     954              if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
     955                G4cout<<"G4Q::HQ:cfM="<<cfM<<",cMs="<<cMs<<",ind="<<index<<G4endl;
    935956#endif
    936957              G4double k = kMom;
     
    946967              //if (dR<0.) dR=0.;
    947968              G4double dR=0.;               // @@ Temporary no q-acceleration cut is used
    948                        if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
    949                       G4cout<<"G4Q::HQ:i="<<index<<",cPDG="<<cPDG<<",k="<<kMom<<","<<kLS<<">kMin="
     969              if(cPDG==90000001 || cPDG==90001000 || cPDG==90000002 || cPDG==90001001)
     970               G4cout<<"G4Q::HQ:i="<<index<<",cPDG="<<cPDG<<",k="<<kMom<<","<<kLS<<">kMin="
    950971                     <<kMin<<",bM="<<bnM<<",rEP="<<rEP<<",dR="<<dR<<",kCo="<<kCond<<G4endl;
    951972#endif
    952973              if(kLS>kMin)
    953                                    {
     974              {
    954975                kCond=false;
    955976                break;
    956977              }
    957                           }
    958                         }
    959                }
    960              }
     978            }
     979          }
     980        }
     981      }
    961982      kCount++;
    962            }
     983    }
    963984    // End of search for "k": *** Here we forget about the initial photon forever ***???***
    964985#ifdef debug
    965986    if(addPhoton)
    966              G4cout<<"G4Q::HQ:***PHOTON OK***k="<<k4Mom<<",Q="<<q4Mom<<",PhE="<<addPhoton<<G4endl;
     987      G4cout<<"G4Q::HQ:***PHOTON OK***k="<<k4Mom<<",Q="<<q4Mom<<",PhE="<<addPhoton<<G4endl;
    967988#endif
    968989    //if(gintFlag)kLS-=addPhoton;           // @@ correct for the virtual (?) -*
     
    9901011    {
    9911012#ifdef debug
    992              if(status==4)throw G4QException("G4Q::HQ:*TMP EXCEPTION - NoChanalsOfFragmentation");
     1013      if(status==4)throw G4QException("G4Q::HQ:*TMP EXCEPTION - NoChanalsOfFragmentation");
    9931014#endif
    9941015#ifdef debug
     
    10071028      // @@ practically never is here
    10081029      if(!first&&excE>qCB&&envM+iniQM<totMass&&nQuasms==1&&qenv&&G4UniformRand()<pCB)
    1009              //if(2>3)                               // Decay in GSQuasmon+GSEnviron **Is closed**
    1010              {
     1030      //if(2>3)                               // Decay in GSQuasmon+GSEnviron **Is closed**
     1031      {
    10111032        G4QHadron* resNuc = new G4QHadron(valQ,q4Mom);// Createa Hadron for Quasmon
    10121033        resNuc->CorMDecayIn2(iniQM,env4M);  // Recalculate the fr4Mom for ResidualGSMass
     
    10231044          FillHadronVector(envH);           // Fill Moving Environment (delete equivalent)
    10241045          qEnv = vacuum;
    1025                       }
     1046        }
    10261047#ifdef debug
    10271048        G4double eM=env4M.m();
     
    10311052        ClearQuasmon();                     // This Quasmon is done
    10321053        return theQHadrons;                 // The last decay of the quasmon...
    1033              }
     1054      }
    10341055      else                                  // May be evaporation is possible
    1035              {
     1056      {
    10361057#ifdef debug
    10371058        G4cout<<"G4Q::HQ:Q2E:E="<<theEnvironment<<",valQ="<<valQ<<",tot4M="<<tot4M<<G4endl;
     
    10401061        if(CheckGroundState(true)) ClearQuasmon(); // This Quasmon is done
    10411062        //if(CheckGroundState(true)) KillQuasmon(); // This Quasmon is done
    1042                       //else if(envPDG==NUCPDG && quasM>iniQM && iniBN>1) // Convert Quasmon to MovingEnv
    1043                       //{
     1063        //else if(envPDG==NUCPDG && quasM>iniQM && iniBN>1) // Convert Quasmon to MovingEnv
     1064        //{
    10441065#ifdef debug
    10451066        //  G4cerr<<"***G4Q::HQ:Q2E="<<theEnvironment<<",QC="<<valQ<<",4M="<<tot4M<<G4endl;
     
    10471068        //  theEnvironment=G4QNucleus(valQ,tot4M);
    10481069        //  KillQuasmon();
    1049                       //}
    1050                       else if(envPDG==NUCPDG && quasM>iniQM) // Emergency decay in Gamma & GSQuasmon
    1051                       {
     1070        //}
     1071        else if(envPDG==NUCPDG && quasM>iniQM) // Emergency decay in Gamma & GSQuasmon
     1072        {
    10521073#ifdef debug
    10531074          G4cout<<"***G4Q::HQ: Emergency Decay in Gamma/Pi0 + Residual GSQuasmon"<<G4endl;
     
    10571078          G4double gamM=0.;
    10581079          if(quasM>mPi0+iniQM)
    1059                         {
     1080          {
    10601081            gamPDG=111;
    10611082            gamM=mPi0;
    1062                         }
     1083          }
    10631084          G4LorentzVector r4Mom(0.,0.,0.,gamM);  // mass of the photon/Pi0
    10641085          G4LorentzVector s4Mom(0.,0.,0.,iniQM); // mass of the GSQuasmon
    10651086          G4double sum=gamM+iniQM;
    10661087          if(sum>0. && fabs(quasM-sum)<eps)
    1067                         {
     1088          {
    10681089             r4Mom=q4Mom*(gamM/sum);
    10691090             s4Mom=q4Mom*(iniQM/sum);
     
    10721093          {
    10731094            G4cerr<<"***G4Q::HQ:Q="<<q4Mom<<quasM<<"->g/pi0(M="<<gamM<<")+GSQ="<<iniPDG
    1074                                               <<"(M="<<iniQM<<")="<<sum<<", d="<<sum-quasM<<G4endl;
    1075                throw G4QException("G4Quasmon::HadronizeQ:(E=0)G/Pi0+GSQ decay error");
    1076           }
    1077 #ifdef debug
    1078                  G4cout<<"G4Q::HQ:=== 0 ===>HadrVec, Q="<<q4Mom<<quasM<<"->g/pi0("<<gamPDG<<")="
     1095                  <<"(M="<<iniQM<<")="<<sum<<", d="<<sum-quasM<<G4endl;
     1096            throw G4QException("G4Quasmon::HadronizeQ:(E=0)G/Pi0+GSQ decay error");
     1097          }
     1098#ifdef debug
     1099          G4cout<<"G4Q::HQ:=== 0 ===>HadrVec, Q="<<q4Mom<<quasM<<"->g/pi0("<<gamPDG<<")="
    10791100                <<r4Mom<<gamM<<"+GSQ="<<iniPDG<<r4Mom<<iniQM<<G4endl;
    10801101#endif
     
    10841105          FillHadronVector(curHadr1);       // Fill "new curHadr1" (delete equivalent)
    10851106          ClearQuasmon();                   // This Quasmon is done
    1086                       }
    1087 #ifdef pdebug
    1088                G4cout<<"***G4Q::HQ:dE="<<excE<<">minK="<<minK<<",Env="<<theEnvironment<<",k="<<kLS
     1107        }
     1108#ifdef pdebug
     1109        G4cout<<"***G4Q::HQ:dE="<<excE<<">minK="<<minK<<",Env="<<theEnvironment<<",k="<<kLS
    10891110              <<",Q="<<valQ<<quasM<<", nQ="<<nQuasms<<G4endl;
    10901111#endif
    10911112        qEnv=theEnvironment;
    10921113        return theQHadrons;
    1093              }
     1114      }
    10941115    }
    10951116    G4bool nucflag=false;                   // NuclearBinding Flag (can't reduce Environ)
     
    11451166        G4cerr<<"***G4Q::HQ: Cand#"<<i<<" >= Tot#"<<nCandid<<G4endl;
    11461167        throw G4QException("G4Quasmon::HadronizeQuasmon: Too big number of the candidate");
    1147              }
     1168      }
    11481169      curQ = valQ;                            // Temporary copy of valQ to estimate MinM2
    1149                                                 if (!fprob)  // At present is closed    // Prepare final decay (nothing was selected)
    1150              {
     1170      if (!fprob)  // At present is closed    // Prepare final decay (nothing was selected)
     1171      {
    11511172        memQ=curQ;                            // Remembe QC for the case of 2H decay
    11521173        sPDG=curQ.GetSPDGCode();              // PDG of current Quasmon as S-hadron
     
    11611182        }
    11621183        else if(!sPDG)
    1163                {
     1184        {
    11641185          G4cerr<<"**G4Q::HQ:sPDG=0,E="<<theEnvironment<<",B="<<totBN<<",S="<<totS<<G4endl;
    11651186          throw G4QException("G4Quasmon::HadronizeQuasmon:DecayPartSelection,Evaporation");
    1166                }
     1187        }
    11671188        else if(sPDG==10)                     // ---> "Chipolino" case
    1168                {
     1189        {
    11691190          fchipo=true;
    11701191          G4QChipolino chipQ(valQ);
     
    11761197          rMass= QPDG2.GetMass();
    11771198          if(sMass+rMass>quasM)               //@@ Evaporate but try 3Pt decay with Environ
    1178                         {
    1179                           if(totBN>1&&totMass>totM&&totS>=0)
    1180                           {
     1199          {
     1200            if(totBN>1&&totMass>totM&&totS>=0)
     1201            {
    11811202#ifdef ppdebug
    11821203              G4cout<<"G4Q::HQ:NEED-EVAP-2:Q="<<q4Mom<<valQ<<",E="<<theEnvironment<<G4endl;
     
    11851206              qEnv=theEnvironment;
    11861207              return theQHadrons;
    1187                           }
     1208            }
    11881209            else
    1189                           {
     1210            {
    11901211              G4cerr<<"***G4Q::HQ:QM="<<quasM<<"<S="<<sMass<<"+R="<<rMass<<"="<<sMass+rMass
    11911212                    <<",tB="<<totBN<<",tS="<<totS<<",tM="<<totMass<<">minM="<<totM<<G4endl;
    11921213              throw G4QException("G4Quasmon::HadronizeQuasmon:VirtChipo Can'tEvapNucleus");
    1193                           }
    1194                         }
     1214            }
     1215          }
    11951216        }
    11961217        else if(nQuasms>1)
     
    12081229          rPDG=envPDG;
    12091230          if (rPDG>MINPDG&&rPDG!=NUCPDG)
    1210                  {
     1231          {
    12111232            rMass=theEnvironment.GetMZNS();
    12121233            q4Mom+=G4LorentzVector(0.,0.,0.,rMass);
     
    12151236            KillEnvironment();
    12161237            fred=true;                        // Flag of environment reduction
    1217                  }
     1238          }
    12181239          else if(rPDG!=NUCPDG&&totBN>1&&totMass>totM&&totS>=0)  // ===> "Evaporation" case
    1219                  {
     1240          {
    12201241#ifdef ppdebug
    12211242            G4QContent nTotQC=totQC-neutQC;
     
    12331254            qEnv=theEnvironment;
    12341255            return theQHadrons;
    1235                  }
     1256          }
    12361257          else if(rPDG==NUCPDG)
    12371258          {
     
    12431264              rMass=mPi0;                     // Safety decay in pi0
    12441265              rPDG=111;
    1245                           }
     1266            }
    12461267            else
    12471268            {
    12481269              rMass=0.;                       // Safety decay in gamma
    12491270              rPDG=22;
    1250                           }
     1271            }
    12511272          }
    12521273        }
     
    12551276        G4cout<<"G4Q::HQ:hsflagTRUE,s="<<sPDG<<","<<sMass<<",r="<<rPDG<<","<<rMass<<G4endl;
    12561277#endif
    1257              }
     1278      }
    12581279      else                                    // ---> "Something was selected" case
    1259              {
     1280      {
    12601281        G4QCandidate* curCand = theQCandidates[i];// Pointer toSelectedCandidate:hadr/fragm
    12611282        sPDG  = curCand->GetPDGCode();        // PDG of the selected candidate
     
    12661287        //@@ For clusters use another randomization & a loop over possible parent clusters
    12671288        if(sPDG>MINPDG&&sPDG!=NUCPDG)         // ===> "Fragment" case
    1268                {
     1289        {
    12691290          G4int ip=0;
    12701291          G4int nParCandid = curCand->GetPClustEntries();
     
    12781299            G4cerr<<G4endl;
    12791300            throw G4QException("G4Quasmon::HadronizeQuasmon:NoParentClust forTheFragment");
    1280                  }
     1301          }
    12811302          else                                // ---> "Parent cluster was found" case
    1282                  {
     1303          {
    12831304            G4double totPP = sppm * G4UniformRand();
    12841305            while(curCand->TakeParClust(ip)->GetProbability() < totPP) ip++;
     
    12861307            G4cout<<"G4Q::HQ:p#ip="<<ip<<",f#i="<<i<<",tP="<<totPP<<",sP="<<sppm<<G4endl;
    12871308#endif
    1288                  }
     1309          }
    12891310          G4QParentCluster* parCluster=curCand->TakeParClust(ip);
    12901311          pPDG  = parCluster->GetPDGCode();
    1291                  G4QPDGCode pQPDG(pPDG);
     1312          G4QPDGCode pQPDG(pPDG);
    12921313          pQC   = pQPDG.GetQuarkContent();
    12931314          pBaryn= pQC.GetBaryonNumber();
    1294                  pMass = parCluster->GetEBMass();    // Environment Bounded Mass
    1295                  pNMass = parCluster->GetNBMass();   // NuclBoundedMass @@Env.Reduce dosn't work
    1296                  transQC = parCluster->GetTransQC();
    1297                  delta = parCluster->GetEBind();     // Environmental Binding
    1298                  deltaN = parCluster->GetNBind();    // Nuclear Binding
    1299                  loli  = parCluster->GetLow();
    1300                  hili  = parCluster->GetHigh();
     1315          pMass = parCluster->GetEBMass();    // Environment Bounded Mass
     1316          pNMass = parCluster->GetNBMass();   // NuclBoundedMass @@Env.Reduce dosn't work
     1317          transQC = parCluster->GetTransQC();
     1318          delta = parCluster->GetEBind();     // Environmental Binding
     1319          deltaN = parCluster->GetNBind();    // Nuclear Binding
     1320          loli  = parCluster->GetLow();
     1321          hili  = parCluster->GetHigh();
    13011322          //G4double dhil=.0001*(hili-loli);    // Safety factor
    13021323          //loli += dhil;
    13031324          //hili -= dhil;
    1304                  npqp2 = parCluster->GetNQPart2();
     1325          npqp2 = parCluster->GetNQPart2();
    13051326          // @@ One can get otherUsefulParameters of the parent cluster for hadronization
    1306                  G4QPDGCode sQPDG(curCand->GetPDGCode());
     1327          G4QPDGCode sQPDG(curCand->GetPDGCode());
    13071328          sQC   = sQPDG.GetQuarkContent();
    13081329          //if(sPDG==90001001 && G4UniformRand()>0.75) sMass=np; //@@ n-p pair
     
    13151336                <<") = curQ="<<curQ<<",InvBinding="<<delta<<",pM="<<pMass<<pQC<<G4endl;
    13161337#endif
    1317                }
     1338        }
    13181339        else                                  // ===> "Hadron" case
    13191340        {
     
    13271348                <<",C="<<theQCandidates[i]->GetPDGCode()<<",Q="<<curQ<<",M2="<<sM2<<G4endl;
    13281349#endif
    1329                }
     1350        }
    13301351        G4QContent resNQC=totQC-sQC;          // Quark Content of the totNucleus-Fragment
    13311352        G4QNucleus resTN(resNQC);   
     
    13451366        {
    13461367          // *** LIM ***
    1347                         G4QContent RNQC=curQ+envQC;
     1368          G4QContent RNQC=curQ+envQC;
    13481369          if(sPDG>MINPDG&&sPDG!=NUCPDG) RNQC-=pQC; // ==> "Nuclear Fragment Radiation" case
    13491370          if(envA-pBaryn>bEn) RNQC=curQ+bEnQC; // Leave the minimum environment
     
    13511372          if(RNPDG==10) minSqN=G4QChipolino(RNQC).GetMass2();// MinSqM of DiHadron of Chipo
    13521373          else if(!RNPDG) // It never should happen as curQ is real and env/bEn QC is > 0
    1353                  {
    1354                                                                                 //#ifdef debug
     1374          {
     1375            //#ifdef debug
    13551376            G4cout<<"**G4Q::HQ:*KinematicTotal*, PDG="<<RNPDG<<curQ<<", QC="<<RNQC<<G4endl;
    1356                                                                                   //#endif
     1377            //#endif
    13571378            minSqN=1000000.;
    1358                  }
     1379          }
    13591380          else
    1360                         {
     1381          {
    13611382            G4double minN=G4QPDGCode(RNPDG).GetMass();
    13621383            minSqN=minN*minN;                 // SquaredGSMass of ResidQuasmon+ResidEnviron
     
    13651386#endif
    13661387          }
    1367                }
     1388        }
    13681389        else
    1369                                                   {
     1390        {
    13701391#ifdef debug
    13711392          G4cout<<"*G4Q::HQ:EnvironmentA="<<envA<<" < SecondaryFragmentA="<<pBaryn<<G4endl;
     
    14001421            G4double qpeM=G4QNucleus(envZ+rqZ,envN+rqN,envS+rqS).GetGSMass();
    14011422#ifdef debug
    1402                                                                                   G4cout<<"G4Q::HadQ:Z="<<rqZ<<",N="<<rqN<<",S="<<rqS<<",eZ="<<envZ<<",eN="<<envN
     1423            G4cout<<"G4Q::HadQ:Z="<<rqZ<<",N="<<rqN<<",S="<<rqS<<",eZ="<<envZ<<",eN="<<envN
    14031424                  <<",eS="<<envS<<",ePDG="<<envPDG<<",eM="<<envM<<",tM="<<qpeM<<G4endl;
    14041425#endif
    14051426            minT=qpeM-envM;
    14061427          }
    1407           minSqT=minT*minT;      // Squared minimum mass of residual quasmon
     1428          minSqT=minT*minT;               // Squared minimum mass of residual quasmon
    14081429#ifdef debug
    14091430          G4cout<<"G4Q::HQ:rPDG="<<rqPDG<<curQ<<",minT="<<minT<<",minSqT="<<minSqT
    14101431                <<",hsfl="<<hsflag<<G4endl;
    14111432#endif
    1412           G4double newT=0.;    // Prototype of minimal TotBoundQuasmon mass
     1433          G4double newT=0.;               // Prototype of minimal TotBoundQuasmon mass
    14131434          // (Hadron with environment
    1414           // (see above?) || QEX) && (Q==nucFrag || Q==n,p,Lambda)
     1435          // (see above?) || QEX) && (Q==nucFrag || Q==n,p,Lambda)
    14151436
    14161437          if ( ( (sPDG < MINPDG && envPDG > MINPDG && envPDG != NUCPDG) ||
    1417                  (sPDG > MINPDG && sPDG != NUCPDG && envPDG > pPDG) )
    1418            &&
    1419                ( (rqPDG > MINPDG && rqPDG != NUCPDG) ||
    1420                   rqPDG==2112 ||
    1421                   rqPDG==2212 ||
    1422                   rqPDG==3122) )
    1423           {
    1424             if(sPDG<MINPDG) {     // The radiatedBaryon is aVaquum(QF) particle
     1438                 (sPDG > MINPDG && sPDG != NUCPDG && envPDG > pPDG)
     1439               ) && ( (rqPDG > MINPDG && rqPDG != NUCPDG) ||
     1440                      rqPDG==2112 || rqPDG==2212 || rqPDG==3122
     1441                    )
     1442             )
     1443          {
     1444            if(sPDG<MINPDG)               // The radiatedBaryon is aVaquum(QF) particle
     1445            {
    14251446              // *** LIM ***
    1426               G4QContent rtQC=curQ;    // Total Residual Quasmon Quark Content
    1427               if (envA > bEn) {        // Nucl Env > than A_max
    1428                 reM=mbEn;
     1447              G4QContent rtQC=curQ;       // Total Residual Quasmon Quark Content
     1448              if (envA > bEn)             // Nucl Env > than A_max
     1449              {
     1450                reM=mbEn;
    14291451                rtQC+=bEnQC;
    1430               } else {
    1431                 reM=envM;              // MinMassOfResidEnviron = MassOfEnviron
     1452              }
     1453              else
     1454              {
     1455                reM=envM;                 // MinMassOfResidEnviron = MassOfEnviron
    14321456                rtQC+=envQC;              // Nucl Env is below A_max=bEn
    1433               }
     1457              }
    14341458              G4QNucleus rtN(rtQC);       // Create a pseudo-nucleus for E+Q
    14351459              rtM=rtN.GetMZNS();          // MinMass of TotalResidualNucleus (+hadron)
    14361460              newT=rtM-reM;               // The effective mass
    14371461#ifdef debug
    1438                             G4cout<<"G4Q::HQ:***VacuumFragmentation** M="<<newT<<",rM="<<rtM<<rtQC
     1462              G4cout<<"G4Q::HQ:***VacuumFragmentation** M="<<newT<<",rM="<<rtM<<rtQC
    14391463                    <<",eM="<<envM<<",mM="<<minT<<G4endl;
    14401464#endif
    1441             } else {          // The RadiatedHadron is aQuarkExchange frag.
    1442        
    1443               G4QContent reQC=envQC-pQC;      // Total Residual Quark Content
     1465            }
     1466            else                          // The RadiatedHadron is aQuarkExchange frag.
     1467            {
     1468 
     1469              G4QContent reQC=envQC-pQC;  // Total Residual Quark Content
    14441470              if(envA-pBaryn>bEn) reQC=bEnQC; // Nucl Env - fragment > than A_max
    1445               G4QNucleus reN(reQC);   // Create a pseudoNucleus for ResidualNucleus
    1446               reM=reN.GetMZNS();   // Min Mass of the residual EnvironmentNucleus
     1471              G4QNucleus reN(reQC);       // Create a pseudoNucleus for ResidualNucleus
     1472              reM=reN.GetMZNS();          // Min Mass of the residual EnvironmentNucleus
    14471473              // *** LIM ***
    1448               G4QContent rtQC=curQ;      // Total Quasmon Quark Content
    1449 #ifdef debug
    1450               G4cout<<"G4Q::HQ:reQC="<<reQC<<",rtQC="<<rtQC<<",eA="<<envA<<",pB="<<pBaryn
    1451                   <<",bE="<<bEn<<bEnQC<<G4endl;
    1452 #endif
    1453               rtQC+=reQC;         // Quasmon + (effective) nuclear environment
    1454               G4QNucleus rtN(rtQC);    // Create a pseudo-nucleus for residual ENE
    1455               rtM=rtN.GetMZNS();       // MinMass of TotalResidualNucleus (fragment)
     1474              G4QContent rtQC=curQ;       // Total Quasmon Quark Content
     1475#ifdef debug
     1476              G4cout<<"G4Q::HQ:reQC="<<reQC<<",rtQC="<<rtQC<<",eA="<<envA<<",pB="<<pBaryn
     1477                    <<",bE="<<bEn<<bEnQC<<G4endl;
     1478#endif
     1479              rtQC+=reQC;                 // Quasmon + (effective) nuclear environment
     1480              G4QNucleus rtN(rtQC);       // Create a pseudo-nucleus for residual ENE
     1481              rtM=rtN.GetMZNS();          // MinMass of TotalResidualNucleus (fragment)
    14561482              // *** LIM ***
    1457               if (envA-pBaryn > bEn) {
    1458                 newT=rtM-mbEn;
    1459               } else {
    1460                 newT=rtM-reM;
    1461               } 
    1462 #ifdef debug
    1463               G4cout<<"G4Q::HQ:NuclFrM="<<newT<<",r="<<rtM<<rtQC<<",e="<<envM<<envQC<<",p="
     1483              if (envA-pBaryn > bEn) newT=rtM-mbEn;
     1484              else                   newT=rtM-reM;
     1485#ifdef debug
     1486              G4cout<<"G4Q::HQ:NuclFrM="<<newT<<",r="<<rtM<<rtQC<<",e="<<envM<<envQC<<",p="
    14641487                    <<pMass<<pQC<<",re="<<reM<<reQC<<",exEn="<<totMass-rtM-sMass<<G4endl;
    14651488#endif
    1466             }
     1489            }
    14671490            if(minT<newT) newT=minT;
    1468           }
    1469           minSqB=newT*newT;     // MinSquaredMass of BoundedResidualQuasmon
    1470         }
    1471 #ifdef debug
    1472         G4cout<<"G4Q::HQ:rq="<<rqPDG<<",miT="<<minSqT<<",miB="<<minSqB<<",M="<<rtM<<G4endl;
     1491          }
     1492          minSqB=newT*newT;               // MinSquaredMass of BoundedResidualQuasmon
     1493        }
     1494#ifdef debug
     1495 G4cout<<"G4Q::HQ:rq="<<rqPDG<<",miT="<<minSqT<<",miB="<<minSqB<<",M="<<rtM<<G4endl;
    14731496#endif
    14741497        if(!minSqT)
     
    14791502        G4double m2 = BIG2; //@@ justBigNumber// Prototype/Squared Mass of Residual Quasmon
    14801503        G4double kp=0.;                       // 3-Mpm/Mass for the residual Quasmon
    1481         if (sPDG > MINPDG && sPDG != NUCPDG) {       // ==> NuclearFragmentCandidate hadronization
     1504        if (sPDG > MINPDG && sPDG != NUCPDG) {// ==> NuclearFragmentCandidate hadronization
    14821505#ifdef debug
    1483           G4cout<<"G4Q::HQ: BoundM="<<pMass<<",FreeM="<<sMass<<",QM="<<quasM<<G4endl;
     1506          G4cout<<"G4Q::HQ: BoundM="<<pMass<<",FreeM="<<sMass<<",QM="<<quasM<<G4endl;
    14841507#endif
    14851508          // = = = =  P u r e   k i n e m a t i c a l   c a l c u l a t i o n s:  = = = = =
     
    14881511          G4LorentzVector tot4Mom=q4Mom+cl4Mom;  // @@ Just for checking
    14891512#ifdef debug
    1490           G4cout<<"G4Q::HQ:Q("<<quasM<<")->k("<<k4Mom<<")+CRQ("<<cr4Mom.m()<<")"<<G4endl;
     1513          G4cout<<"G4Q::HQ:Q("<<quasM<<")->k("<<k4Mom<<")+CRQ("<<cr4Mom.m()<<")"<<G4endl;
    14911514#endif
    14921515          G4LorentzVector cc4Mom=k4Mom+cl4Mom;// 4-mom of ColoredFragment (before kappa)
    14931516          G4double ccM2=cc4Mom.m2();          // SquaredMass of the ColoredFragment
    14941517          G4double frM2=sMass*sMass;          // MinSuaredMass of the OutgoingFragment
    1495           if (ccM2 <= frM2) {                 // Decaying ColoredFragmM < FragmM
    1496 #ifdef debug
    1497             G4cout<<"***G4Q::HQ:FailedToFind FragmM:"<<ccM2<<"<"<<frM2<<",M="<<pMass<<"+k="
     1518          if (ccM2 <= frM2)                   // Decaying ColoredFragmM < FragmM
     1519          {
     1520#ifdef debug
     1521            G4cout<<"***G4Q::HQ:FailedToFind FragmM:"<<ccM2<<"<"<<frM2<<",M="<<pMass<<"+k="
    14981522                  <<k4Mom<<"="<<sqrt(ccM2)<<cc4Mom<<" < fM="<<sMass<<",miK="<<minK<<G4endl;
    14991523#endif
    1500             dMass=pMass-pNMass;               // Remember the difference
     1524            dMass=pMass-pNMass;               // Remember the difference
    15011525            pMass=pNMass;
    15021526            delta=deltaN;
     
    15051529            cc4Mom=k4Mom+cl4Mom;              // 4-mom of ColoredFragment (before kappa)
    15061530            ccM2=cc4Mom.m2();
    1507             if (ccM2 <= frM2) {
    1508 #ifdef debug
    1509               G4cout<<"G4Q::HQ:hsflagTRUE*NuclBINDING,ccM2="<<ccM2<<"<frM2="<<frM2<<G4endl;
     1531            if (ccM2 <= frM2)
     1532            {
     1533#ifdef debug
     1534              G4cout<<"G4Q::HQ:hsflagTRUE*NuclBINDING,ccM2="<<ccM2<<"<frM2="<<frM2<<G4endl;
    15101535#endif
    15111536              hsflag=true;                    // Flag of decay in Q+S
    1512             } else {
    1513 #ifdef debug
    1514               G4cout<<"G4Q::HQ:***NUCLEAR BINDING***ccM2="<<ccM2<<" > frM2="<<frM2<<G4endl;
     1537            }
     1538            else
     1539            {
     1540#ifdef debug
     1541              G4cout<<"G4Q::HQ:***NUCLEAR BINDING***ccM2="<<ccM2<<" > frM2="<<frM2<<G4endl;
    15151542#endif
    15161543              nucflag=true;                   // Nuclear binding was used
    1517             }
    1518           } else {
     1544            }
     1545          }
     1546          else
     1547          {
    15191548#ifdef debug
    15201549            G4double crMass2 = cr4Mom.m2();   // SquredMass of ColouredResidualQuasmon
    1521                    G4cout<<"G4Q::HQ:cM2="<<crMass2<<"="<<rEP*(rEP-rMo-rMo)<<",h="<<hili<<",l="
     1550            G4cout<<"G4Q::HQ:cM2="<<crMass2<<"="<<rEP*(rEP-rMo-rMo)<<",h="<<hili<<",l="
    15221551                  <<loli<<G4endl;
    15231552#endif
     
    15321561            G4double dM=0.;
    15331562            if(sPDG==90001001) dM=2.25;       // Binding energy of the deuteron ???
    1534                    G4cout<<"G4Q::HQ:Is xE="<<excE<<" > sM="<<sMass<<"-pM="<<pMass<<"-dM="<<dM
     1563            G4cout<<"G4Q::HQ:Is xE="<<excE<<" > sM="<<sMass<<"-pM="<<pMass<<"-dM="<<dM
    15351564                  <<" = "<<sMass-pMass-dM<<G4endl;
    15361565#endif
    15371566#ifdef debug
    1538                    G4cout<<"G4Q::HQ: must totM="<<totMass<<" > rTM="<<resTNM<<"+sM="<<sMass<<" = "
     1567            G4cout<<"G4Q::HQ: must totM="<<totMass<<" > rTM="<<resTNM<<"+sM="<<sMass<<" = "
    15391568                  <<sMass+resTNM<<G4endl;
    15401569#endif
    1541             if(resTNM && totMass<resTNM+sMass) { // Probably it never takes place
     1570            if(resTNM && totMass<resTNM+sMass)// Probably it never takes place
     1571            {
    15421572#ifdef ppdebug
    15431573              G4cout<<"***G4Quasmon::HadronizeQuasmon:***PANIC#1***TotalDE="<<excE<<"< bE="
     
    15481578              qEnv=theEnvironment;            // Update the QEnvironment ???
    15491579              return theQHadrons;
    1550             }
    1551 
    1552             G4double   ex=kLS-delta;          // EnvironmentExcess of parton energy in LS
     1580            }
     1581            G4double   ex=kLS-delta;          // EnvironmentExcess of parton energy in LS
    15531582            G4double   dex=ex+ex;
    15541583            G4QContent tmpEQ=envQC-pQC;       // Quark content for Residual Environment
     
    15571586            G4double   tmpNM=tmpN.GetMZNS();  // Mass of Residual Environment
    15581587#ifdef debug
    1559             G4cout<<"G4Q::HQ:eQC="<<envQC<<",pQC="<<pQC<<",rEnvM="<<tmpNM<<",hsfl="<<hsflag
     1588            G4cout<<"G4Q::HQ:eQC="<<envQC<<",pQC="<<pQC<<",rEnvM="<<tmpNM<<",hsfl="<<hsflag
    15601589                  <<G4endl;
    15611590#endif
     
    16131642              G4double ctkk=1.-(dex/(1.-z)-pMass)/kLS;// cos(theta_k,kappa) in LS
    16141643#ifdef ppdebug
    1615                      if(qCount) G4cout<<"G4Q::HQ:qC="<<qCount<<",ct="<<ctkk<<",M="<<pMass<<",z="
     1644              if(qCount) G4cout<<"G4Q::HQ:qC="<<qCount<<",ct="<<ctkk<<",M="<<pMass<<",z="
    16161645                               <<z<<",zl="<<pow(loli,pw)<<",zh="<<pow(hili,pw)<<",dE="
    16171646                               <<totMass-totM<<",bE="<<sMass-pMass<<G4endl;
     
    16381667                if(ctc>1.) ctc=1.;
    16391668                else if(ctc<-1.) ctc=-1.;
    1640                                    }
     1669              }
    16411670              kp4Mom=zeroLV;                           // 4-mom update for RecoilQuark (q)
    16421671              fr4Mom=G4LorentzVector(0.,0.,0.,sMass);  // 4-mom update for the fragment
     
    16501679              //G4ThreeVector kp3v=kp4Mom.vect();
    16511680              //G4double ctr=cc3v.dot(kp3v)/cc3v.mag()/kp3v.mag();
    1652                      //G4cout<<"G4Q::HQ:cost="<<ctc<<"="<<ctr<<", d="<<ctc-ctr<<G4endl;
     1681              //G4cout<<"G4Q::HQ:cost="<<ctc<<"="<<ctr<<", d="<<ctc-ctr<<G4endl;
    16531682#ifdef debug
    16541683              G4double ccM=sqrt(ccM2);
    16551684              G4double kappa=ex/(1.+kLS*(1.-ctkk)/pMass);// Energy of the RecoilQuark in LS
    1656                      G4cout<<"G4Q::HQ:>ColDec>>>CF("<<ccM<<")->F("<<sMass<<")+q"<<kp4Mom<<"="
     1685              G4cout<<"G4Q::HQ:>ColDec>>>CF("<<ccM<<")->F("<<sMass<<")+q"<<kp4Mom<<"="
    16571686                    <<kappa<<",hsfl="<<hsflag<<G4endl;
    16581687#endif
     
    16671696              // ***VBQ***
    16681697              //G4double rQM2=rQ4Mom.m2();             // TMP (Before the "kt" is defined)
    1669                                    //if(rQM2>=minSqB && fr4Mom.e()>=sCBE)   // minSqB = SqGSMass of BoundResidQ
     1698              //if(rQM2>=minSqB && fr4Mom.e()>=sCBE)   // minSqB = SqGSMass of BoundResidQ
    16701699              // ***VFQ***
    16711700              //G4double rQM2=rQ4Mom.m2();             // TMP (Before the "kt" is defined)
    1672                                    //if(rQM2>=minSqT && fr4Mom.e()>=sCBE)   // minSqB = SqGSMass of BoundResidQ
     1701              //if(rQM2>=minSqT && fr4Mom.e()>=sCBE)   // minSqB = SqGSMass of BoundResidQ
    16731702              // ***VQU***
    16741703              fQ4Mom=rQ4Mom+G4LorentzVector(0.,0.,0.,tmpBE); // Free Quasmon 4-mom
    16751704              G4double fQM2=fQ4Mom.m2();             // TMP (Before the "kt" is defined)
    1676                                    if(fQM2>=minSqT && reTNM2>=tmpTM2 && fr4Mom.e()>=sCBE) // minSqT = SqGSMass
     1705              if(fQM2>=minSqT && reTNM2>=tmpTM2 && fr4Mom.e()>=sCBE) // minSqT = SqGSMass
    16771706              {
    1678                                                                                                                   qCond=false;  // Ok, the appropriate q is found
     1707                qCond=false;  // Ok, the appropriate q is found
    16791708                //ffdc=false;
    16801709#ifdef debug
    16811710                // ***VTN***
    1682                                      //G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<reTNM2<<">"<<tmpTM2
     1711                //G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<reTNM2<<">"<<tmpTM2
    16831712                //      <<" & E="<<fr4Mom.e()<<" > CB+M="<<sCBE<<G4endl;
    16841713                // ***VBQ***
    1685                                      //G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<rQM2<<">"<<minSqB<<G4endl;
     1714                //G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<rQM2<<">"<<minSqB<<G4endl;
    16861715                // ***VQU***+***VFQ***
    1687                                      G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<fQM2<<">"<<minSqT<<G4endl;
    1688 #endif
    1689                                    }
    1690                                    else
     1716                G4cout<<"G4Q::HQ:Attemp#"<<qCount<<".Yes.M2="<<fQM2<<">"<<minSqT<<G4endl;
     1717#endif
     1718              }
     1719              else
    16911720              {
    16921721#ifdef debug
    16931722                // ***VTN***
    1694                                      //G4cout<<"G4Q::HQ:Attempt#"<<qCount<<",NO.M2="<<reTNM2<<"<"<<tmpTM2
     1723                //G4cout<<"G4Q::HQ:Attempt#"<<qCount<<",NO.M2="<<reTNM2<<"<"<<tmpTM2
    16951724                //      <<" or E="<<fr4Mom.e()<<" < CB+M="<<sCBE<<G4endl;
    16961725                // ***VBQ***
     
    17071736                // ***VTN***
    17081737                //if(reTNM2<tmpTM2 && reTNM2>MEMrQM2 && fr4Mom.e()>=sCBE)
    1709                                      {
     1738                {
    17101739                  // ***VQU***
    17111740                  MEMrQM2=fQM2;
     
    17231752                else if(fr4Mom.e()<sCBE&&fr4Mom.e()>MEMsCBE&&reTNM2>=tmpTM2&&fQM2>MEMrQM2)
    17241753                // ***VBQ***VFQ***
    1725                 //else if(fr4Mom.e()<sCBE&&fr4Mom.e()>MEMsCBE&&reTNM2>=tmpTM2&&rQM2>MEMrQM2)
     1754                //else if(fr4Mom.e()<sCBE&&fr4Mom.e()>MEMsCBE&&reTNM2>tmpTM2&&rQM2>MEMrQM2)
    17261755                // ***VTN***
    17271756                //else if(fr4Mom.e()<sCBE && fr4Mom.e()>MEMsCBE && reTNM2>=tmpTM2)
    1728                                      {
     1757                {
    17291758                  MEMsCBE=fr4Mom.e(); // Remember the best choice
    17301759                  MEMkp4M=kp4Mom;
     
    17341763                }
    17351764                else if(!qCount)                 //@@ Should not be here
    1736                                      {
     1765                {
    17371766                  // ***VQU***
    17381767                  MEMrQM2=fQM2;
     
    17491778                }
    17501779                else
    1751                                      {
     1780                {
    17521781                  // ***VQU***
    17531782                  fQM2=MEMrQM2;
     
    17611790                  rQ4Mom=MEMrQ4M;
    17621791                  reTNM2=MEMreM2;
    1763                                      }
    1764                                    }
     1792                }
     1793              }
    17651794              qCount++;
    1766                           } // End of the WHILE of the q-choice for the fixed parent
     1795            } // End of the WHILE of the q-choice for the fixed parent
    17671796            // If q-choice is exhosted, then get the best, not the last
    17681797            quexf=true;                      // Quark Exchange is successfully done
    17691798#ifdef debug
    1770                    G4cout<<"G4Q::HadQ:RQ("<<rQ4Mom.m()<<")=C("<<cr4Mom.m()<<")+q"<<kp4Mom<<G4endl;
     1799            G4cout<<"G4Q::HadQ:RQ("<<rQ4Mom.m()<<")=C("<<cr4Mom.m()<<")+q"<<kp4Mom<<G4endl;
    17711800#endif
    17721801            kt=rQ4Mom.m2();
     
    17861815            tot4Mom-=rQ4Mom+fr4Mom;
    17871816#ifdef debug
    1788                    G4cout<<"G4Q::HQ:t4M="<<tot4Mom<<",hsfl="<<hsflag<<".Is kt="<<kt<<">"<<minSqB
     1817            G4cout<<"G4Q::HQ:t4M="<<tot4Mom<<",hsfl="<<hsflag<<".Is kt="<<kt<<">"<<minSqB
    17891818                  <<" or kn="<<kn<<">"<<minSqN<<"? m2="<<m2<<", sPDG="<<sPDG<<G4endl;
    17901819#endif
    17911820            // Final check to accept or reject the quark-exchange
    17921821            // ***VFQ***
    1793                           //if(kn<minSqN && kt<minSqT)
     1822            //if(kn<minSqN && kt<minSqT)
    17941823            // ***VQU***
    1795                           if(kn<minSqN && ku<minSqT)
     1824            if(kn<minSqN && ku<minSqT)
    17961825            // ***VBQ***
    1797                           //if(kn<minSqN && kt<minSqB)
     1826            //if(kn<minSqN && kt<minSqB)
    17981827            //if(kt<minSqT&&ffdc)
    1799                           //if(kt<minSqT)
     1828            //if(kt<minSqT)
    18001829            // ***VTN*** (former default)
    1801                           //if(sPDG<MINPDG&&kt<minSqB||sPDG>MINPDG&&kn<minSqN)
    1802                                                                                   //if(sPDG<MINPDG&&kt<minSqB||sPDG>MINPDG&&kt<minSqB)
    1803                           //if(kn<minSqN)
     1830            //if(sPDG<MINPDG&&kt<minSqB||sPDG>MINPDG&&kn<minSqN)
     1831            //if(sPDG<MINPDG&&kt<minSqB||sPDG>MINPDG&&kt<minSqB)
     1832            //if(kn<minSqN)
    18041833            // ***VTN***
    1805                           //if(kt<minSqT&&sPDG!=90000001||kn<minSqN&&sPDG==90000001)//Nucleus for Neutron
    1806                           //if(kt<minSqT&&sMass>1200.||kn<minSqN&&sMass<1200.) //NuclEnreach for Nucleons
     1834            //if(kt<minSqT&&sPDG!=90000001||kn<minSqN&&sPDG==90000001)//Nucleus for Neutron
     1835            //if(kt<minSqT&&sMass>1200.||kn<minSqN&&sMass<1200.) //NuclEnreach for Nucleons
    18071836            // @@@@ Priveleged Nuteron !! ??? @@@@@
    1808                           //if(kn<minSqN&&sPDG==90000001||kt<minSqB&&sPDG!=90000001)//BindEnOnlyForNuter.
     1837            //if(kn<minSqN&&sPDG==90000001||kt<minSqB&&sPDG!=90000001)//BindEnOnlyForNuter.
    18091838            {
    18101839              hsflag=true; // The quark exchange is REJECTED
    18111840#ifdef debug
    1812                      G4cout<<"G4Q::HQ:**hsflag=1** No, sPDG="<<sPDG<<", kt="<<kt<<"<"<<minSqB
     1841              G4cout<<"G4Q::HQ:**hsflag=1** No, sPDG="<<sPDG<<", kt="<<kt<<"<"<<minSqB
    18131842                    <<" or kn="<<kn<<"<"<<minSqN<<G4endl;
    18141843#endif
    1815                           }
    1816 #ifdef debug
    1817                    else G4cout<<"G4Q::HQ:YES,t="<<kt<<">"<<minSqB<<",n="<<kn<<">"<<minSqN<<G4endl;
    1818 #endif
    1819                         }
    1820                }
     1844            }
     1845#ifdef debug
     1846            else G4cout<<"G4Q::HQ:YES,t="<<kt<<">"<<minSqB<<",n="<<kn<<">"<<minSqN<<G4endl;
     1847#endif
     1848          }
     1849        }
    18211850        else                                 // ==> "HadronicCandidate hadronization" case
    18221851        {
     
    18391868            else            TCRN+=env4M;
    18401869            kn=TCRN.m2();                  // tot4M - fr4Mom
    1841                         }
     1870          }
    18421871          else kn=kt;
    18431872        }
     
    18571886        // ***VBQ***
    18581887        if(kt>minSqB+.01 && tM>rtM && !hsflag)
    1859                                                   //if((kt>minSqB+.01&&sPDG<MINPDG || sPDG>MINPDG&&kt>minSqB+.01&&tM>rtM) && !hsflag)
     1888        //if((kt>minSqB+.01&&sPDG<MINPDG || sPDG>MINPDG&&kt>minSqB+.01&&tM>rtM) && !hsflag)
    18601889        // ***VTN***
    18611890        //if((kt>minSqB+.01&&sPDG<MINPDG || sPDG>MINPDG&&kn>minSqN+.01&&tM>rtM) && !hsflag)
    18621891        //if(tM>rtM&&!hsflag)                               // Mass(RNucleus)>M_min
    18631892        //if(tM>rtM&&kp<kpMax&&!hsflag)                     // Mass(RNucleus)>M_min
    1864                //if(2>3)                                      // *** Close k-correction ***
    1865                {
     1893        //if(2>3)                                      // *** Close k-correction ***
     1894        {
    18661895          // ***VTN*** (?)
    1867                         //if(sPDG<MINPDG)                      // Hadronic candidate: finish calculations
     1896          //if(sPDG<MINPDG)                      // Hadronic candidate: finish calculations
    18681897          // ***VBQ***VFQ***VQU***
    1869                         //if(2>3)                             // Close crrection for hadrons @@?p-pbar?@@
    1870                  //{
     1898          //if(2>3)                             // Close crrection for hadrons @@?p-pbar?@@
     1899          //{
    18711900          //  G4double np = nOfQ - 3;             // Power for an residual quasmon mass
    18721901          //  G4double cM = pow(minSqB/kt,np);    // Cut for PossibleQuasmon residual mass
     
    18781907#endif
    18791908          //  m2 = kt*rn;                         // SquaredMass of ResidualQuasmon (hadr)
    1880                  //}
     1909          //}
    18811910          //else
    18821911          //{
     
    18871916          //}
    18881917        }
    1889                else
     1918        else
    18901919        {
    18911920          hsflag=true;                          // Decay in ThisHadron/Fragment+(SHadron)
    18921921#ifdef pdebug
    1893                         G4cout<<"G4Q::HQ:NO,hsfl=1,kt="<<kt<<"<"<<minSqB<<" or M="<<tM<<"<"<<rtM<<G4endl;
    1894 #endif
    1895                }
    1896 #ifdef debug
    1897                G4cout<<"G4Q::HQ:*****>>>rM="<<rMass<<",sqM2="<<sqrt(m2)<<",hsfl="<<hsflag<<G4endl;
     1922          G4cout<<"G4Q::HQ:NO,hsfl=1,kt="<<kt<<"<"<<minSqB<<" or M="<<tM<<"<"<<rtM<<G4endl;
     1923#endif
     1924        }
     1925#ifdef debug
     1926        G4cout<<"G4Q::HQ:*****>>>rM="<<rMass<<",sqM2="<<sqrt(m2)<<",hsfl="<<hsflag<<G4endl;
    18981927#endif
    18991928        rMass=sqrt(m2);                         // if(hsflag)(TwoPartDecay) it's fake 0.
     
    19071936        G4int aPDG  = abs(rPDG);
    19081937        G4int rb    = abs(curQ.GetBaryonNumber()); // BaryNum of residual hadronic state
    1909         G4double rcMass=-BIG; //@@ just BIG number // Prototype of minimal mass for residual
     1938        G4double rcMass=-BIG; //@@ just BIG number // Prototype of minimalMass for residual
    19101939        if (!rPDG)
    19111940        {
     
    19241953        if(sPDG<MINPDG&&envPDG==NUCPDG)rFl=G4UniformRand()<bs*bs*bs/m3;//ProbFun:minM^3/m^3
    19251954#ifdef debug
    1926                G4cout<<"G4Q::HQ: sPDG="<<sPDG<<", hsflag="<<hsflag<<", rPDG="<<rPDG<<curQ<<",rM="
     1955        G4cout<<"G4Q::HQ: sPDG="<<sPDG<<", hsflag="<<hsflag<<", rPDG="<<rPDG<<curQ<<",rM="
    19271956              <<rMass<<",rb="<<rb<<",F="<<rFl<<",v="<<m2<<","<<bs<<",r="<<bs*bs/m2<<G4endl;
    19281957#endif
    19291958        if(!hsflag&&rFl&&rPDG&& rPDG!=10 && rb<2 && aPDG!=1114 && aPDG!=2224 && aPDG!=3334)
    1930                { // ------------------------------->>>>>>>>>>>>>>> Hadron-Parton Duality decay
     1959        { // ------------------------------->>>>>>>>>>>>>>> Hadron-Parton Duality decay
    19311960          G4int regPDG = 0;                            // PDG prototype for G-meson
    19321961          G4int refPDG = 0;                            // PDG prototype for F-meson
     
    19341963          G4int repPDG = 0;                            // PDG prototype for P-meson
    19351964          if(rPDG && rPDG!=10)                         // Can the residual be a Hadron ?
    1936                  {
     1965          {
    19371966            if     (rPDG== 3122) rPDG= 3212;           // LAMBDA* converted to SIGMA*
    19381967            else if(rPDG==-3122) rPDG=-3212;
     
    19471976            //if((rPDG==221||rPDG==331)&&sPDG==111) rPDG=111; // eta/eta'=>Pi0
    19481977#ifdef debug
    1949                    G4cout<<"G4Q::HQ:QuasM="<<quasM<<valQ<<")->H("<<sPDG<<")+R("<<rPDG<<")"<<",rp="
     1978            G4cout<<"G4Q::HQ:QuasM="<<quasM<<valQ<<")->H("<<sPDG<<")+R("<<rPDG<<")"<<",rp="
    19501979                  <<repPDG<<",rd="<<redPDG<<",rf="<<refPDG<<",rg="<<regPDG<<G4endl;
    19511980#endif
     
    19691998            if(((rM>0 && rMass<pB && rMass>sB) || (dM>0 && rMass>pB && rMass<dB) ||
    19701999               (fM>0 && rMass>dB && rMass<fB)) && theEnvironment.GetPDG()==NUCPDG)
    1971                           {// Final H+R decay of QUASMON in vacuum (should not exist if Environ exists)
     2000            {// Final H+R decay of QUASMON in vacuum (should not exist if Environ exists)
    19722001              if     (rMass>pB && rMass<dB && dM>0)    // D-resonance case
    1973                             {
     2002              {
    19742003                repPDG=redPDG;
    19752004                rM=dM;
    1976                             }
     2005              }
    19772006              else if(rMass>dB && rMass<fB && dM>0)    // F-resonance case
    1978                             {
     2007              {
    19792008                repPDG=refPDG;
    19802009                rM=fM;
    1981                             }                                        // If not changed - P-resonance
     2010              }                                        // If not changed - P-resonance
    19822011#ifdef debug
    19832012              G4cout<<"G4Q::HQ:s="<<sPDG<<",Q=>rM="<<rMass<<"(minQ="<<rPDG<<curQ<<")+sB="
     
    19852014#endif
    19862015              if(quasM<rM+sMass &&(sPDG==221||sPDG==331))// Change eta-Cand to pi-Cand
    1987                      {
     2016              {
    19882017                sPDG=111;
    19892018                sMass=mPi0;
    1990                    }
     2019              }
    19912020              G4LorentzVector r4Mom(0.,0.,0.,rM);    // P/D/F-resonance with a random Mass
    19922021              G4LorentzVector s4Mom(0.,0.,0.,sMass); // Mass's random since ProbabilityTime
    19932022              G4double sum=rM+sMass;
    19942023              if(fabs(quasM-sum)<eps)
    1995                             {
     2024              {
    19962025                r4Mom=q4Mom*(rM/sum);
    19972026                s4Mom=q4Mom*(sMass/sum);
     
    20012030                G4cerr<<"**G4Quasmon::HadronizeQuasmon:rPD="<<repPDG<<"(rM="<<rMass
    20022031                      <<")+sPD="<<sPDG<<"(sM="<<sMass<<"), Env="<<theEnvironment<<G4endl;
    2003                    throw G4QException("G4Quasmon::HadronizeQuasmon: H+Res Decay failed");
     2032                throw G4QException("G4Quasmon::HadronizeQuasmon: H+Res Decay failed");
    20042033              }
    20052034#ifdef debug
    2006                      G4cout<<"G4Q::HQ:=== 1 ===> HadronVec, Q="<<q4Mom<<" -> s4M="<<s4Mom<<"("
     2035              G4cout<<"G4Q::HQ:=== 1 ===> HadronVec, Q="<<q4Mom<<" -> s4M="<<s4Mom<<"("
    20072036                    <<sPDG<<"), r4M="<<r4Mom<<"("<<repPDG<<")"<<G4endl;
    20082037#endif
     
    20202049              qEnv=theEnvironment;                   // Update the QEnvironment
    20212050              return theQHadrons;                    // The last decay of the quasmon...
    2022                    }
    2023                  }
     2051            }
     2052          }
    20242053        }
    20252054        curQ = memQ;                                   // Recover original curQ=valQ-candQ
     
    20282057      }
    20292058      // ***VFQ***
    2030                     //if(kn>minSqN && kt>minSqT)
     2059      //if(kn>minSqN && kt>minSqT)
    20312060      // ***VQU***
    2032 
    20332061      if (kn > minSqN && ku > minSqT)
    20342062      // ***VBQ***
    2035                     //if(kn>minSqN && kt>minSqB)
     2063      //if(kn>minSqN && kt>minSqB)
    20362064      // ***VTN***
    2037                            //if(kt>minSqB&&sPDG<MINPDG || sPDG>MINPDG&&kn>minSqN)
    2038       {
    2039         pCond=false;       // Ok, the appropriate parent cluster is found
     2065      //if(kt>minSqB&&sPDG<MINPDG || sPDG>MINPDG&&kn>minSqN)
     2066      {
     2067        pCond=false;       // Ok, the appropriate parent cluster is found
    20402068#ifdef debug
    20412069        // ***VTN***VBQ***
    2042                              //G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",kt="<<kt<<">"
     2070        //G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",kt="<<kt<<">"
    20432071        //      <<minSqB<<" || kn="<<kn<<">"<<minSqN<<G4endl;
    20442072        // ***VQU***
    2045                              G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",ku="<<ku<<">"
     2073        G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",ku="<<ku<<">"
    20462074              <<minSqT<<" || kn="<<kn<<">"<<minSqN<<G4endl;
    20472075        // ***VFQ***
    2048                              //G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",kt="<<kt<<">"
     2076        //G4cout<<"G4Q::HQ:P-Attempt#"<<pCount<<" *Yes* sPDG="<<sPDG<<",kt="<<kt<<">"
    20492077        //      <<minSqT<<" || kn="<<kn<<">"<<minSqN<<G4endl;
    20502078#endif
    2051       } else {
     2079      }
     2080      else
     2081      {
    20522082#ifdef debug
    20532083        // ***VBQ***VTN***
     
    20622092#endif
    20632093        // ***VTN*** (former default)
    2064                            //if(kt>=minSqB || sPDG>MINPDG&&kn>minSqN)
     2094        //if(kt>=minSqB || sPDG>MINPDG&&kn>minSqN)
    20652095        // ***VBQ***
    2066                            //if(kn<minSqN && kt>=minSqB)
     2096        //if(kn<minSqN && kt>=minSqB)
    20672097        // ***VFQ***
    2068                            //if(kn<minSqN && kt>=minSqT)
     2098        //if(kn<minSqN && kt>=minSqT)
    20692099        // ***VQU***
    2070 
    2071         if (kn < minSqN && ku < minSqT) {
    2072 
     2100        if (kn < minSqN && ku < minSqT)
     2101        {
    20732102          // ***VTN*** (former default)
    2074           //if(kt<minSqB&&sPDG<MINPDG && kt>PMEMktM2 || kn<minSqN&&sPDG>MINPDG&& kn>PMEMknM2)
     2103          //if(kt<minSqB&&sPDG<MINPDG && kt>PMEMktM2 ||
     2104          //   kn<minSqN&&sPDG>MINPDG && kn>PMEMknM2)
    20752105          // ***VBQ***
    20762106          //if(kt<minSqB && kt>PMEMktM2)
     
    20782108          //if(kt<minSqT && kt>PMEMktM2)
    20792109          // ***VQU***
    2080 
    2081           if(ku<minSqT && ku>PMEMktM2) {
     2110          if(ku < minSqT && ku > PMEMktM2)
     2111          {
    20822112            // ***VQU***
    20832113            PMEMktM2=ku;
     
    21062136            PMEMnucf=nucflag;
    21072137#ifdef pdebug
    2108             G4cout<<"G4Q::HQ:RememberBest rPDG="<<rPDG<<",sPDG="<<sPDG<<",kt="<<kt<<G4endl;
    2109 #endif
    2110           } else if(!pCount) {                    // @@ Should not be here
    2111 
     2138            G4cout<<"G4Q::HQ:RemTheBest rPDG="<<rPDG<<",sPDG="<<sPDG<<",kt="<<kt<<G4endl;
     2139#endif
     2140          }
     2141          else if(!pCount)
     2142          {                    // @@ Should not be here
    21122143            // ***VQU***
    21132144            PMEMktM2=ku;
     
    21362167            PMEMnucf=nucflag;
    21372168#ifdef pdebug
    2138             G4cout<<"G4Q::HQ:RememberFirst rPDG="<<rPDG<<",sPDG="<<sPDG<<",kt="<<kt<<G4endl;
    2139 #endif
    2140           } else {
     2169            G4cout<<"G4Q::HQ:RemTheFirst rPDG="<<rPDG<<",sPDG="<<sPDG<<",kt="<<kt<<G4endl;
     2170#endif
     2171          }
     2172          else
     2173          {
    21412174            fr4Mom=PMEMfr4M; // OK -> Recover the best found values
    21422175            rQ4Mom=PMEMrQ4M; // OK
     
    21642197            hsflag=PMEMhsfl; // OK
    21652198            nucflag=PMEMnucf;// OK
    2166           }
    2167         }
     2199          }
     2200        }
    21682201      }
    21692202      pCount++;
    2170                   } // End of the WHILE of the parent choice
     2203    } // End of the WHILE of the parent choice
    21712204#ifdef pdebug
    21722205    G4cout<<"G4Q::HQ:>rPDG="<<rPDG<<curQ<<",sPDG="<<sPDG<<",kt="<<kt<<",F="<<fprob
     
    21932226
    21942227    if ( ( ( (sPDG < MINPDG && envPDG > MINPDG && envPDG != NUCPDG) ||
    2195              (sPDG > MINPDG && sPDG!=NUCPDG && envPDG > pPDG) ) && iniBN > 0) ||
    2196              iniBN > 1 ||
    2197              rPDG == 10 ) aMass=0.;  // No Pi0 cond.(eg in NucE)
     2228             (sPDG > MINPDG && sPDG!=NUCPDG && envPDG > pPDG)
     2229           ) && iniBN > 0
     2230         ) ||  iniBN > 1 ||  rPDG == 10
     2231       ) aMass=0.;         // No Pi0 cond.(eg in NucE)
    21982232
    21992233#ifdef pdebug
     
    22052239    if ( hsflag ||
    22062240         (sPDG < MINPDG && rMass < reMass+aMass) ||
    2207          (sPDG > MINPDG && envPDG > pPDG && reTNM2 < tmpTM2) ||
    2208          fdul ) {
    2209       // >>>>>> Decay Q->S+H or Q/C->H1+H2 or suck in or evaporate or slow down or decay etc.
     2241         (sPDG > MINPDG && envPDG > pPDG && reTNM2 < tmpTM2) ||
     2242         fdul )
     2243    {
     2244      // >>>> Decay Q->S+H or Q/C->H1+H2 or suck in or evaporate or slow down or decay etc.
    22102245      // ========> Decide what to do, if fragmentation in this Candidate is impossible ===
    22112246#ifdef debug
     
    22162251      if(hsflag) rMass=rQPDG.GetMass();          // Get Nuclear Cluster mass
    22172252      if(sPDG>MINPDG&&sPDG!=NUCPDG)              // "Quark exchange hadronization" case
    2218              {
     2253      {
    22192254        G4QContent tmpEQ=envQC-pQC;              // Quark content for Residual Environment
    22202255        G4QNucleus tmpN(tmpEQ);                  // Pseudo nucleus for Residual Environment
     
    22252260        G4LorentzVector ResEnv4Mom(0.,0.,0.,tmpNM);// 4-Mom for the Residual Environment
    22262261        if(rQ4Mom==zeroLV)
    2227                       {
     2262        {
    22282263#ifdef ppdebug
    22292264          G4cout<<"G4Q::HQ:NEEDS-EVAP-5,Q="<<q4Mom<<valQ<<",QEnv="<<theEnvironment<<G4endl;
     
    22322267          qEnv=theEnvironment;
    22332268          return theQHadrons;
    2234                       }
     2269        }
    22352270        G4LorentzVector retN4Mom=rQ4Mom+ResEnv4Mom;// 4-Mom for the Total Residual Nucleus
    22362271        G4double retNM2=retN4Mom.m2();    // SqMass of the Total Residual Nucleus @@ double
     
    22652300        //      <<"+rCB="<<rCB<<"+sCB="<<sCB<<"="<<tmpNM+rMass+sMass+rCB+sCB<<G4endl;
    22662301#endif
    2267                       //if(nQuasms==1&&tmpNM+rMass+rCB+sMass+sCB<totMass)// Decay in resEnv+resQ+Fragment
    2268                                                                 if(2>3)                              //*** Attempt GoOutDropExcNucl is closed ***
    2269                       {
     2302        //if(nQuasms==1&&tmpNM+rMass+rCB+sMass+sCB<totMass)// Decay in resEnv+resQ+Fragment
     2303        if(2>3)                              //*** Attempt GoOutDropExcNucl is closed ***
     2304        {
    22702305          G4LorentzVector fr4M = G4LorentzVector(0.,0.,0.,sMass);//GSM of Fragment
    22712306          G4LorentzVector re4M = G4LorentzVector(0.,0.,0.,tmpNM);//GSM of ResidualEnviron
     
    22782313          G4double sum=tmpNM+sMass+rMass;
    22792314          if(fabs(totMass-sum)<eps)
    2280                         {
     2315          {
    22812316            re4M=tot4M*(tmpNM/sum);
    22822317            rq4M=tot4M*(rMass/sum);
     
    22962331            FillHadronVector(envH);              // Fill MovingEnvironment (del.equiv)
    22972332            qEnv = vacuum;                       // Distruct Environment
    2298                                }
     2333          }
    22992334          else
    23002335          {
     
    23082343          ClearQuasmon();                        // This Quasmon is done
    23092344          return theQHadrons;                    // The last decay of the quasmon...
    2310                       }
     2345        }
    23112346        //else if(nQuasms==1&&tmpTM+sMass<totMass) //Lose p,go out,leave GSResNuc
    2312                       //else if(nQuasms==1&&tmpTM+sMass+sCB<totMass) //Lose p,goOut,leaveGSResNuc
     2347        //else if(nQuasms==1&&tmpTM+sMass+sCB<totMass) //Lose p,goOut,leaveGSResNuc
    23132348        else if(2>3) // ********** Decay in Fragm + GSResidNucleus is Closed ************
    2314                       {
     2349        {
    23152350          G4LorentzVector dif1=tot4M-retN4Mom-fr4Mom;
    23162351          qEnv = G4QNucleus(tmpTQ,retN4Mom);         // Createa Nucleus for TotalResidNucl
     
    23342369          ClearQuasmon();                             // This Quasmon is done
    23352370          return theQHadrons;                        // The last decay of the quasmon...
    2336                       }
     2371        }
    23372372        else if(totBN>1&&totMass>totM&&totS>=0&&envPDG>MINPDG&&envPDG!=NUCPDG)//Evaporate
    2338                                                                 //else if(2>3) // ********** Forced Evaporation is Closed ************
    2339                       {
     2373        //else if(2>3) // ********** Forced Evaporation is Closed ************
     2374        {
    23402375#ifdef ppdebug
    23412376          //@@ May be recalculate hadronization ??
     
    23532388          qEnv=theEnvironment;
    23542389          return theQHadrons;
    2355                       }
     2390        }
    23562391        else if(totBN==1&&nQuasms==1) // Decay of the baryonic Total Nucleus state
    2357                       {
     2392        {
    23582393#ifdef debug
    23592394          G4cout<<"G4Q::HQ:tB=1,nQ=1,Z="<<totZ<<",S="<<totS<<totQC<<",M="<<totMass<<G4endl;
     
    23662401          {
    23672402            if(totS==1)               // Decay of the strange hyperstate
    2368                                  {
     2403            {
    23692404              if(!totZ&&totMass>mLamb+mPi0)
    2370                                    {
     2405              {
    23712406                nucM  = mLamb;
    23722407                nucPDG= 3122;
    23732408                piM   = mPi0;
    23742409                piPDG = 111;
    2375                                    }
     2410              }
    23762411              else if(abs(totZ)==1&&totMass>mLamb+mPi)
    2377                                    {
     2412              {
    23782413                nucM  = mLamb;
    23792414                nucPDG= 3122;
     
    23812416                if(totZ>0) piPDG = 211;
    23822417                else       piPDG =-211;
    2383                                    }
     2418              }
    23842419              else
    2385                                    {
     2420              {
    23862421                G4cerr<<"***G4Q::HQ:Z="<<totZ<<",S="<<totS<<totQC<<",tM="<<totMass<<G4endl;
    2387                    throw G4QException("G4Quasmon::HadronizeQuasm: Pi + Lambda decay error");
     2422                throw G4QException("G4Quasmon::HadronizeQuasm: Pi + Lambda decay error");
    23882423              }
    2389                                  }
    2390                                  else                      // Decay of the anti-strange hyperstate
    2391                                  {
     2424            }
     2425            else                      // Decay of the anti-strange hyperstate
     2426            {
    23922427              if(!totZ&&totMass>mNeut+mK0)
    2393                                    {
     2428              {
    23942429                nucM  = mNeut;
    23952430                nucPDG= 2112;
    23962431                piM   = mK0;
    23972432                piPDG = 311;
    2398                                    }
     2433              }
    23992434              else if(totZ==2&&totMass>mProt+mK)
    2400                                    {
     2435              {
    24012436                piM   = mK;
    24022437                piPDG = 321;
    2403                                    }
     2438              }
    24042439              else if(totZ==1&&totMass>mProt+mK0&&G4UniformRand()>0.5)
    2405                                    {
     2440              {
    24062441                piM   = mK0;
    24072442                piPDG = 311;
    2408                                    }
     2443              }
    24092444              else if(totZ==1&&totMass>=mNeut+mK)
    2410                                    {
     2445              {
    24112446                nucM  = mNeut;
    24122447                nucPDG= 2112;
    24132448                piM   = mK;
    24142449                piPDG = 321;
    2415                                    }
     2450              }
    24162451              else
    2417                                    {
     2452              {
    24182453                G4cerr<<"***G4Q::HQ:Z="<<totZ<<",S="<<totS<<totQC<<",tM="<<totMass<<G4endl;
    2419                    throw G4QException("G4Quasmon::HadronizeQuasm: K + Nucleon decay error");
     2454                throw G4QException("G4Quasmon::HadronizeQuasm: K + Nucleon decay error");
    24202455              }
    2421                                  }
    2422                         }
     2456            }
     2457          }
    24232458          else if(totMass>PiNM&&!totS) // Decay in nucleon & pion
    24242459          {
    24252460            if(!totZ&&totMass>mProt+mPi&&G4UniformRand()<0.5)
    2426                           {
     2461            {
    24272462              piM   = mPi;
    24282463              piPDG = -211;
    24292464            }
    24302465            else if(!totZ&&totMass>mNeut+mPi0)
    2431                           {
     2466            {
    24322467              nucM  = mNeut;
    24332468              nucPDG= 2112;
     
    24362471            }
    24372472            else if(totZ==1&&totMass>mNeut+mPi&&G4UniformRand()<0.5)
    2438                           {
     2473            {
    24392474              nucM  = mNeut;
    24402475              nucPDG= 2112;
     
    24432478            }
    24442479            else if(totZ==1&&totMass>mProt+mPi0)
    2445                           {
     2480            {
    24462481              piM   = mPi0;
    24472482              piPDG = 111;
    24482483            }
    24492484            else if(totZ==-1)
    2450                           {
     2485            {
    24512486              nucM  = mNeut;
    24522487              nucPDG= 2112;
     
    24552490            }
    24562491            else if(totZ==2)
    2457                           {
     2492            {
    24582493              piM   = mPi;
    24592494              piPDG = 211;
    24602495            }
    24612496            else
    2462                                  {
     2497            {
    24632498              G4cerr<<"*G4Q::HQ:Z="<<totZ<<",B="<<totBN<<",E="<<envQC<<",Q="<<valQ<<G4endl;
    2464                  throw G4QException("G4Quasmon::HadronizeQuasm: Pi + Nucleon decay error");
    2465             }
    2466                         }
     2499              throw G4QException("G4Quasmon::HadronizeQuasm: Pi + Nucleon decay error");
     2500            }
     2501          }
    24672502          else if(!totS)
    2468                         {
     2503          {
    24692504            if(!totZ)
    2470                                  {
     2505            {
    24712506              nucM=mNeut;
    24722507              nucPDG=2112;
    24732508            }
    24742509            else if(totZ<0||totZ>1)
    2475                                  {
     2510            {
    24762511              G4cerr<<"*G4Q::HQ:Z="<<totZ<<",B="<<totBN<<",E="<<envQC<<",Q="<<valQ<<G4endl;
    2477                  throw G4QException("G4Quasmon::HadronizeQuasm:Photon+Nucleon decay error");
     2512              throw G4QException("G4Quasmon::HadronizeQuasm:Photon+Nucleon decay error");
    24782513            }
    24792514          }
     
    24822517          G4double sum=piM+nucM;
    24832518          if(fabs(totMass-sum)<eps)
    2484                         {
     2519          {
    24852520            pi4M=tot4M*(piM/sum);
    24862521            nuc4M=tot4M*(nucM/sum);
     
    24902525            G4cerr<<"***G4Q::HQ:T="<<tot4M<<totMass<<"->gam/pi/K("<<piM<<")+N="<<nucPDG
    24912526                  <<"("<<nucM<<")="<<sum<<G4endl;
    2492                throw G4QException("G4Quasmon::HadronizeQuasm:Gam/Pi/K+N decay error");
    2493           }
    2494 #ifdef debug
    2495                  G4cout<<"G4Q::HQ:T="<<tot4M<<totMass<<"->GPK="<<piPDG<<pi4M<<"+B="<<nucPDG<<nuc4M
     2527            throw G4QException("G4Quasmon::HadronizeQuasm:Gam/Pi/K+N decay error");
     2528          }
     2529#ifdef debug
     2530          G4cout<<"G4Q::HQ:T="<<tot4M<<totMass<<"->GPK="<<piPDG<<pi4M<<"+B="<<nucPDG<<nuc4M
    24962531                <<G4endl;
    24972532#endif
     
    25082543                   <<", envPDG="<<envPDG<<G4endl;
    25092544#endif
    2510              }
     2545      }
    25112546      G4double dm=quasM-sMass;
    25122547#ifdef debug
     
    25152550#endif
    25162551      if(abs(dm)<.000001)
    2517              {
     2552      {
    25182553        if(sPDG==iniPDG)
    2519                {
     2554        {
    25202555          G4QHadron* quasH = new G4QHadron(iniPDG,q4Mom);//Create Hadron for Quasmon-Hadron
    25212556          FillHadronVector(quasH);                   // Fill "new quasH" (del. equivalent)
     
    25232558          qEnv=theEnvironment;                       // Keep initial environment
    25242559          return theQHadrons;                        // The last decay of the total nucleus
    2525                }
     2560        }
    25262561        else G4cerr<<"---Warning---G4Q::HQ:Q=H,q="<<iniPDG<<",s="<<sPDG<<",d="<<dm<<G4endl;
    2527              }
     2562      }
    25282563      G4double rWi=0.;
    25292564      if(rPDG!=10) rWi=G4QPDGCode(rPDG).GetWidth();
    25302565      if(rPDG!=10&&rMass>dm&&!rWi)   // Try to use the h-resonance width or reduce its spin
    2531              {
     2566      {
    25322567        G4double sWi=G4QPDGCode(sPDG).GetWidth();
    25332568        G4double sMM=G4QPDGCode(sPDG).GetMass();
    25342569        if(sWi)                                      // Hadron is a resonance
    2535                       {
     2570        {
    25362571          G4double mmm=theWorld->GetQParticle(G4QPDGCode(sPDG))->MinMassOfFragm();
    25372572          G4double ddm=quasM-rMass;                  // Minimum mass of the sHadron
     
    25542589                  <<sWi<<G4endl;
    25552590#endif
    2556                         }
     2591          }
    25572592          //else if(G4int ds1=abs(sPDG)%10>2)        // @@ Make it C-style ?: operator ?
    2558                         //{
     2593          //{
    25592594          //  G4int oPDG=sPDG;
    25602595          //  if   (sPDG>0&&sPDG%2==0)   sPDG-=ds1-2;
     
    25642599          //  sMass=G4QPDGCode(sPDG).GetMass();
    25652600          //  G4cout<<"**G4Q::HQ:sPDG="<<oPDG<<" changed to "<<sPDG<<",sM="<<sMass<<G4endl;
    2566                         //}
    2567                       }
     2601          //}
     2602        }
    25682603      }
    25692604      // First decay suppression for the final decay in 2 particles
     
    25792614        //if(dm>958. && rnd>.5) rPDG=331;
    25802615        if(dm>958.) rPDG=331;
    2581                       else rPDG=221;
     2616        else rPDG=221;
    25822617      }
    25832618      if(rPDG==221 && dm>958. && rnd>.5 ) rPDG=331;
     
    25932628             rMass > 782. && dm > 782. && rnd < .5) rPDG = 223; //0->omega
    25942629
    2595       if ( rPDG == 331 && rMass > 1020. && dm > 1020. && rnd < .5) rPDG=333;    // eta' -> phi0
     2630      if ( rPDG == 331 && rMass > 1020. && dm > 1020. && rnd < .5) rPDG=333;// eta' -> phi0
    25962631
    25972632      if(rPDG== 211 && dm>544. && rnd>.5) rPDG= 213; // M-1.5*W conv. of pi+ to rho+
     
    26072642#endif
    26082643        if(reMass==0.)
    2609                {
     2644        {
    26102645          if(sPDG==221 || sPDG==331)                 // Change eta-Candidate to pi/gamma
    2611                  {
     2646          {
    26122647            if     (sPDG==221) dm+=mEta-mPi0;
    26132648            else if(sPDG==331) dm+=mEtaP-mPi0;
    26142649            if(dm<0)
    2615                                  {
     2650            {
    26162651              dm+=mPi0;
    26172652              sPDG=22;
    26182653              sMass=0.;
    2619                                  }
     2654            }
    26202655            else
    26212656            {
    26222657              sPDG=111;
    26232658              sMass=mPi0;
    2624                                  }
     2659            }
    26252660            if(dm<mPi0-.00001&&rPDG==111)
    2626                                  {
     2661            {
    26272662              rPDG=22;
    26282663              reMass=0.;
    2629                                  }
     2664            }
    26302665            else reMass=GetRandomMass(rPDG,dm);//Rerandomize mass of ResidQuasmon-Resonance
    26312666            if(reMass==0.)G4cerr<<"-W-G4Q::HQ:2,M="<<quasM<<",r="<<rPDG<<",d="<<dm<<G4endl;
    2632                         }
     2667          }
    26332668          else if(rPDG==111)                      // Make a photon out of the Resid Quasmon
    2634                         {
     2669          {
    26352670            rPDG=22;
    26362671            reMass=0.;
    2637                         }
     2672          }
    26382673          else
    2639                         {
     2674          {
    26402675            if(CheckGroundState()) ClearQuasmon();// This Quasmon is done
    26412676            //if(CheckGroundState(true)) KillQuasmon();// This Quasmon is done
     
    26462681            qEnv=theEnvironment;
    26472682            return theQHadrons;
    2648                  }
    2649         }
    2650              }
     2683          }
     2684        }
     2685      }
    26512686      else if(rPDG==NUCPDG)
    2652              {
     2687      {
    26532688        if(dm>mPi0)
    26542689        {
    2655                          rPDG=111;
     2690           rPDG=111;
    26562691           reMass=mPi0;
    26572692        }
    26582693        else
    26592694        {
    2660                        rPDG=22;
     2695           rPDG=22;
    26612696           reMass=0.;
    26622697        }
    2663            }
     2698      }
    26642699      G4double freeRQM=rQPDG.GetMass();
    26652700      G4int    RQB = rQPDG.GetBaryNum();
     
    26712706      G4double sCB=theEnvironment.CoulombBarrier(sChg,sBaryn);
    26722707#ifdef debug
    2673              G4cout<<"G4Q::HQ:h="<<sCB<<",C="<<sChg<<",B="<<sBaryn<<",E="<<theEnvironment<<G4endl;
     2708      G4cout<<"G4Q::HQ:h="<<sCB<<",C="<<sChg<<",B="<<sBaryn<<",E="<<theEnvironment<<G4endl;
    26742709#endif
    26752710      G4int rChg=rQPDG.GetCharge();
     
    26812716#endif
    26822717      if ( totBN > 1 && totS >= 0 && envPDG > MINPDG && envPDG != NUCPDG &&
    2683           (reMass+sMass > quasM || sCB+rCB+reMass+sMass+envM > totMass || (!RQB && quasM < diPiM) ) )
    2684              //if(2>3)                                      // This Evaporation channel is closed
     2718           (reMass+sMass > quasM || sCB+rCB+reMass+sMass+envM > totMass ||
     2719             (!RQB && quasM < diPiM)
     2720           )
     2721         )
     2722      //if(2>3)                                      // This Evaporation channel is closed
    26852723      {
    26862724#ifdef ppdebug
     
    26922730        qEnv=theEnvironment;
    26932731        return theQHadrons;
    2694              }
     2732      }
    26952733      if(rPDG==NUCPDG)                               
    26962734      {
     
    26992737      }
    27002738      if(rPDG==2212&&sPDG==311&&reMass+sMass>quasM)
    2701              {
     2739      {
    27022740        if(mNeut+mK<=quasM+.001)
    2703                       {
     2741        {
    27042742          reMass=mNeut;
    27052743          rPDG  =2112;
     
    27092747          rCB=theEnvironment.CoulombBarrier(rChg,rBaryn);
    27102748#ifdef debug
    2711                  G4cout<<"G4Q::HQ:NCB="<<rCB<<",NC="<<rChg<<",sB="<<sBaryn<<",r="<<rQPDG<<G4endl;
     2749          G4cout<<"G4Q::HQ:NCB="<<rCB<<",NC="<<rChg<<",sB="<<sBaryn<<",r="<<rQPDG<<G4endl;
    27122750#endif
    27132751          freeRQM=mNeut;
     
    27222760          sCB=theEnvironment.CoulombBarrier(sChg,sBaryn);
    27232761#ifdef debug
    2724                  G4cout<<"G4Q::HQ:KCB="<<sCB<<",KC="<<sChg<<",frB="<<sBaryn<<",E="<<theEnvironment
     2762          G4cout<<"G4Q::HQ:KCB="<<sCB<<",KC="<<sChg<<",frB="<<sBaryn<<",E="<<theEnvironment
    27252763                <<G4endl;
    27262764#endif
     
    27512789        q4Mom+=G4LorentzVector(0.,0.,0.,pMass);
    27522790      }
    2753              G4double tmM=q4Mom.m()+.001;;
     2791      G4double tmM=q4Mom.m()+.001;;
    27542792      G4double sum=reMass+sMass;
    27552793      if(fabs(tmM-sum)<eps)
     
    27732811          G4double nreM=nNuc.GetGSMass();          // Mass of the new isotope
    27742812          if(tmM>mK+nreM)
    2775                         {
     2813          {
    27762814            sMass=mK;
    27772815            sPDG=321;
     
    27952833          }
    27962834          else
    2797                         {
     2835          {
    27982836            G4cerr<<"***G4Q::HQ:(O) KCor M="<<tmM<<"=>rPDG="<<rPDG<<"(rM="<<reMass
    27992837                  <<")+sPDG="<<sPDG<<"(sM="<<sMass<<")="<<sum<<G4endl;
     
    28072845          G4double nreM=nNuc.GetGSMass();          // Mass of the new isotope
    28082846          if(tmM>mK0+nreM)
    2809                         {
     2847          {
    28102848            sMass=mK0;
    28112849            sPDG=311;
     
    28292867          }
    28302868          else
    2831                         {
     2869          {
    28322870            G4cerr<<"***G4Q::HQ:(O) K0Cor M="<<tmM<<"=>rPDG="<<rPDG<<"(rM="<<reMass
    28332871                  <<")+sPDG="<<sPDG<<"(sM="<<sMass<<")="<<sum<<G4endl;
     
    28412879          G4double nreM=nNuc.GetGSMass();          // Mass of the new isotope
    28422880          if(tmM>mPi0+nreM)
    2843                         {
     2881          {
    28442882            sMass=mPi0;
    28452883            sPDG=111;
     
    28632901          }
    28642902          else if(tmM>nreM)
    2865                         {
     2903          {
    28662904            sMass=0.;
    28672905            sPDG=22;
     
    28852923          }
    28862924          else
    2887                         {
     2925          {
    28882926            G4cerr<<"***G4Q::HQ:(O) Pi+/Pi0Cor M="<<tmM<<"=>rPDG="<<rPDG<<"(rM="<<reMass
    28892927                  <<")+sPDG="<<sPDG<<"(sM="<<sMass<<")="<<sum<<G4endl;
     
    28972935          G4double nreM=nNuc.GetGSMass();          // Mass of the new isotope
    28982936          if(tmM>mPi0+nreM)
    2899                         {
     2937          {
    29002938            sMass=mPi0;
    29012939            sPDG=111;
     
    29192957          }
    29202958          else if(tmM>nreM)
    2921                         {
     2959          {
    29222960            sMass=0.;
    29232961            sPDG=22;
     
    29422980        }
    29432981        else if((sPDG==221 || sPDG==331) && tmM>mPi0+reMass)
    2944                       {
     2982        {
    29452983          sMass=mPi0;
    29462984          sPDG=111;
     
    29602998        }
    29612999        else if((sPDG==111 || sPDG==221 || sPDG==331) && tmM>reMass)
    2962                       {
     3000        {
    29633001          sMass=0.;
    29643002          sPDG=22;
     
    30553093          }
    30563094          else
    3057                         {
     3095          {
    30583096            G4cerr<<"***G4Q::HQ: LamToN M="<<tmM<<totQC<<"=>rM="<<nucM.GetPDG()<<","
    30593097                  <<nucZ.GetPDG()<<"("<<nreM<<","<<nreZ<<")+PiM/PiZ="<<mPi+nreM<<","
     
    30633101        }
    30643102        else if(tmM>iniQM)
    3065                       {
     3103        {
    30663104          G4QContent tmpSQC=G4QPDGCode(sPDG).GetQuarkContent();//QuarkContent of the hadron
    30673105          sMass=0.;
     
    30863124        }
    30873125        else if(totMass>resTNM+sMass) // Just decay in sPDG and total residual nucleus
    3088            {
     3126        {
    30893127          G4LorentzVector re4M = G4LorentzVector(0.,0.,0.,resTNM); //GSM of ResidTotEnvir
    30903128          G4LorentzVector rs4M = G4LorentzVector(0.,0.,0.,sMass);  //GSM of a Hadron
     
    30953133          G4double sum=resTNM+sMass;
    30963134          if(fabs(totMass-sum)<eps)
    3097                         {
     3135          {
    30983136            re4M=tot4M*(resTNM/sum);
    30993137            rs4M=tot4M*(sMass/sum);
     
    31143152              resTN.Set4Momentum(re4M);
    31153153              qEnv=resTN;                          // Create Nucleus for MovingResEnv
    3116                                                                                                 }
     3154            }
    31173155            else
    31183156            {
     
    31203158              FillHadronVector(envH);              // Fill MovingEnvironment (del.equiv)
    31213159              qEnv = vacuum;
    3122                                  }
     3160            }
    31233161            ClearQuasmon();                         // This Quasmon is done
    31243162            return theQHadrons;                    // The last decay of the quasmon...
    3125                         }
     3163          }
    31263164        }
    31273165        else if(totMass>totM)         // Just decay in minimal total nucleus and gamma
    3128            {
     3166        {
    31293167          G4LorentzVector re4M = G4LorentzVector(0.,0.,0.,totM); // GSM of ResidTotEnvir
    31303168          G4LorentzVector rs4M = G4LorentzVector(0.,0.,0.,0.);   // GSM of a Photon
     
    31463184              totN.Set4Momentum(re4M);
    31473185              qEnv=totN;// Create Nucleus for MovingResEnv
    3148                                                                                                 }
     3186            }
    31493187            else
    31503188            {
     
    31523190              FillHadronVector(envH);              // Fill MovingEnvironment (del.equiv)
    31533191              qEnv = vacuum;
    3154                                  }
     3192            }
    31553193            ClearQuasmon();                         // This Quasmon is done
    31563194            return theQHadrons;                    // The last decay of the quasmon...
    3157                         }
     3195          }
    31583196        }
    31593197        else
     
    31613199          G4cerr<<"***G4Q::HQ:M="<<tmM<<"=>rPDG="<<rPDG<<"(rM="<<reMass<<")+sPDG="
    31623200                <<sPDG<<"(sM="<<sMass<<")="<<sum<<",QM="<<iniQM<<G4endl;
    3163                                                                                 if(fabs(tmM-sum)<1.) // Just to avoid exception (Must be treated !)
    3164                                                                                 //if(2>3)            // ------> Catch the under mass shell event
     3201          if(fabs(tmM-sum)<1.) // Just to avoid exception (Must be treated !)
     3202          //if(2>3)            // ------> Catch the under mass shell event
    31653203          {
    31663204            r4Mom=q4Mom*(reMass/sum);
    31673205            s4Mom=q4Mom*(sMass/sum);
    31683206          }
    3169                                                                                 else throw G4QException("***G4Quasmon::HadronizeQuasmon:QHadr+SHadr DecayIn2");
     3207          else throw G4QException("***G4Quasmon::HadronizeQuasmon:QHadr+SHadr DecayIn2");
    31703208        }
    31713209      }
    31723210      G4double sKE=s4Mom.e()-sMass;
    31733211#ifdef rdebug
    3174              G4cout<<"G4Q::HQ:=2.3=>QHVect s4M="<<s4Mom<<",sPDG="<<sPDG<<", r4M/M="<<r4Mom<<reMass
     3212      G4cout<<"G4Q::HQ:=2.3=>QHVect s4M="<<s4Mom<<",sPDG="<<sPDG<<", r4M/M="<<r4Mom<<reMass
    31753213            <<",fR="<<freeRQM<<",fW="<<fRQW<<",PDG="<<rPDG<<",r="<<rCB<<",s="<<sCB<<G4endl;
    31763214#endif
     
    31783216      //if(sKE<sCB||rKE<rCB)                  // => "KinEn is below CB, try once more" case
    31793217      if(sKE<sCB)                             // => "KinEn is below CB, try once more" case
    3180              {
     3218      {
    31813219#ifdef ppdebug
    31823220        G4cout<<"****G4Q::HQ:E-9: sKE="<<sKE<<"<sCB="<<sCB<<G4endl;
     
    31863224        qEnv=theEnvironment;
    31873225        return theQHadrons;
    3188              }
     3226      }
    31893227      else if(abs(reMass-freeRQM)<fRQW||envPDG==NUCPDG)//=>"ResidQ is a GSHadron/Frag" case
    31903228      {
     
    31943232        FillHadronVector(curHadr2);                  // Fill "new curHadr2" (del. eq.)
    31953233#ifdef rdebug
    3196                G4cout<<"G4Q::HQ:DecayQuasmon "<<q4Mom<<" in 4M="<<r4Mom+s4Mom<<" RQ="<<rPDG<<r4Mom
     3234        G4cout<<"G4Q::HQ:DecayQuasmon "<<q4Mom<<" in 4M="<<r4Mom+s4Mom<<" RQ="<<rPDG<<r4Mom
    31973235              <<" + Fragment="<<sPDG<<s4Mom<<", Env="<<theEnvironment<<G4endl;
    31983236#endif
     
    32013239        qEnv=theEnvironment;                        // Update the QEnvironment
    32023240        return theQHadrons;                         // This is theLastDecay of the quasmon
    3203              }
     3241      }
    32043242      else                                           // => "Virtual Residual Quasmon" case
    3205              {
     3243      {
    32063244        G4LorentzVector resTotN4Mom=r4Mom+G4LorentzVector(0.,0.,0.,envM);
    32073245        G4QContent resTotNQC=envQC+curQ;             // QCof possible residual nucleus
     
    32103248        G4double   resTotNM=resTotN.GetMZNS();       // Mass of the Total Residual Nucleus
    32113249        if(resTotN4Mom.m()<resTotNM)                 // Needs total evaporation
    3212                       {
     3250        {
    32133251          //if(totBN>1&&totMass>totM&&totS>=0)         //@@ ??
    32143252#ifdef ppdebug
     
    32213259        }
    32223260        else                                         // Only theTotResidNucl can evaporate
    3223                       {
     3261        {
    32243262          G4QHadron* curHadr2 = new G4QHadron(sPDG,s4Mom);// Create Hadron for theOutHadron
    32253263          FillHadronVector(curHadr2);                // Fill "new curHadr2" (del.equiv.)
     
    32493287        }
    32503288      }
    3251            }
     3289    }
    32523290#ifdef rdebug
    3253            else G4cout<<"G4Q::HQ:NO-OK,h="<<hsflag<<",d="<<fdul<<",M="<<rMass<<"<"<<reMass<<",M2="
     3291    else G4cout<<"G4Q::HQ:NO-OK,h="<<hsflag<<",d="<<fdul<<",M="<<rMass<<"<"<<reMass<<",M2="
    32543292               <<reTNM2<<"<I="<<tmpTM2<<",sP="<<sPDG<<",eP="<<envPDG<<",pP="<<pPDG<<G4endl;
    32553293#endif
    3256            if(!fskip)                                       // Continue search for fragmentation
    3257            {
     3294    if(!fskip)                                       // Continue search for fragmentation
     3295    {
    32583296      // ==== From this point for nuclear fragments the procedure is just filling =====
    32593297#ifdef debug
    3260              G4int ePDG=theEnvironment.GetPDG();
     3298      G4int ePDG=theEnvironment.GetPDG();
    32613299      G4double frKin=fr4Mom.e()-sMass;
    3262              G4cout<<"G4Q::HQ:>>"<<sPDG<<fr4Mom<<fr4Mom.m()<<"="<<sMass<<",T="<<frKin<<",E="<<ePDG
     3300      G4cout<<"G4Q::HQ:>>"<<sPDG<<fr4Mom<<fr4Mom.m()<<"="<<sMass<<",T="<<frKin<<",E="<<ePDG
    32633301            <<G4endl;
    32643302#endif
    32653303      //if(sPDG<MINPDG&&(ePDG==NUCPDG||nQuasms==1)) //==>>"Hadron candidate in Vacuum" case
    32663304      //if(sPDG<MINPDG&&nQuasms==1) // ==>> "Hadron candidate with the only Quasmon" case
    3267              if(sPDG<MINPDG)                         // Hadronic decay is always in vacuum @@??
     3305      if(sPDG<MINPDG)                         // Hadronic decay is always in vacuum @@??
    32683306      {
    32693307        G4int SQ=totQC.GetStrangeness();
    32703308#ifdef debug
    3271                G4cout<<"G4Q::HQ: sPDG="<<sPDG<<", sM="<<sMass<<", SQ="<<SQ<<G4endl;
     3309        G4cout<<"G4Q::HQ: sPDG="<<sPDG<<", sM="<<sMass<<", SQ="<<SQ<<G4endl;
    32723310#endif
    32733311        if(!sPDG&&SQ<0&&nQuasms==1) // decay Of Tot(Q+Env) in K+/aK0 & residual
    3274                       //if(!sPDG&&SQ<0)           // decay in K+/aK0 & residual
    3275                       {
     3312        //if(!sPDG&&SQ<0)           // decay in K+/aK0 & residual
     3313        {
    32763314          sPDG=321;
    32773315          sMass=mK;
     
    32893327          {
    32903328#ifdef ppdebug
    3291             G4cout<<"G4Q::HQ:***PANIC#2***tM="<<totMass<<"<KM="<<mK<<","<<mK0<<",rM="<<rKPM
     3329            G4cout<<"G4Q::HQ:***PANIC#2***tM="<<totMass<<"<KM="<<mK<<","<<mK0<<",rM="<<rKPM
    32923330                  <<","<<rK0M<<",d="<<mK+rKPM-totMass<<","<<mK0+rK0M-totMass<<G4endl;
    32933331            throw G4QException("G4Quasmon::HadronizeQuasmon: Why PANIC? (2)"); //@@ TMP
     
    32963334            qEnv=theEnvironment;                     // Update the QEnvironment
    32973335            return theQHadrons;
    3298                         }
     3336          }
    32993337          if(rKPM + mK > rK0M + mK0)
    3300                         {
     3338          {
    33013339            rPDG  = rK0PDG;                          // PDG of the Residual System to K0
    33023340            rMass = rK0M;
    33033341            sPDG  = 311;
    33043342            sMass = mK0;
    3305                         }
     3343          }
    33063344          else
    3307                         {
     3345          {
    33083346            rPDG  = rKPPDG;                          // PDG of the Residual System to K+
    33093347            rMass = rKPM;
    33103348            sPDG  = 321;
    33113349            sMass = mK;
    3312                         }
     3350          }
    33133351          G4double ctM=tot4M.m();
    33143352          G4LorentzVector r4Mom(0.,0.,0.,rMass);
     
    33163354          G4double sum=rMass+sMass;
    33173355          if(fabs(ctM-sum)<eps)
    3318                         {
     3356          {
    33193357            r4Mom=tot4M*(rMass/sum);
    33203358            s4Mom=tot4M*(sMass/sum);
     
    33243362            G4cerr<<"***G4Q::HQ:tM="<<ctM<<totQC<<" => rPDG="<<rPDG<<"(rM="<<rMass
    33253363                  <<") + sPDG="<<sPDG<<"(sM="<<sMass<<")="<<sum<<G4endl;
    3326                throw G4QException("***G4Quasmon::HadrQuasm:K+ResNuc DecayIn2 didn't succeed");
    3327           }
    3328 #ifdef debug
    3329                  G4cout<<"G4Q::HQ:===2.4===>HadrVec s="<<sPDG<<s4Mom<<",r="<<rPDG<<r4Mom<<G4endl;
     3364            throw G4QException("***G4Quasmon::HadrQuasm:K+ResNuc DecayIn2 didn't succeed");
     3365          }
     3366#ifdef debug
     3367          G4cout<<"G4Q::HQ:===2.4===>HadrVec s="<<sPDG<<s4Mom<<",r="<<rPDG<<r4Mom<<G4endl;
    33303368#endif
    33313369          //@@CHECK CoulBar and may be evaporate instead
     
    33373375          qEnv=vacuum;
    33383376          return theQHadrons;                        // This is theLastDecay of the Quasmon
    3339                       }
     3377        }
    33403378        G4bool ffin=false;                           // Flag of FinalDecayInGamma+Residual
    33413379        if(quasM<rMass+sMass&&(sPDG==221||sPDG==331))// Change eta-Candidate or any to pi
    3342                {
     3380        {
    33433381          sPDG = 111;
    33443382          sMass=mPi0;
    3345                }
     3383        }
    33463384        else if(!sPDG)
    3347                       {
     3385        {
    33483386          if     (iniS<0&&iniQChg+iniQChg>=iniBN)    // Try to decay in K+
    3349                         {
     3387          {
    33503388            sPDG = 321;
    33513389            sMass= mK;
    33523390            G4QNucleus totQN(valQ+KpQC);             // Nucleus Residual after Kp sub.
    33533391            rPDG = totQN.GetPDG();
    3354                           rMass= totQN.GetMZNS();
    3355                         }
     3392            rMass= totQN.GetMZNS();
     3393          }
    33563394          else if(iniS<0)                            // Try to decay in K0
    3357                         {
     3395          {
    33583396            sPDG = 311;
    33593397            sMass= mK0;
    33603398            G4QNucleus totQN(valQ+K0QC);             // Nucleus Residual after K0 sub.
    33613399            rPDG = totQN.GetPDG();
    3362                           rMass= totQN.GetMZNS();
    3363                         }
     3400            rMass= totQN.GetMZNS();
     3401          }
    33643402          else if(iniQChg>iniBN-iniS)                // Try to decay in Pi+
    3365                         {
     3403          {
    33663404            sPDG = 211;
    33673405            sMass= mPi;
    33683406            G4QNucleus totQN(valQ-PiQC);             // Nucleus Residual after Pi+ sub.
    33693407            rPDG = totQN.GetPDG();
    3370                           rMass= totQN.GetMZNS();
    3371                         }
     3408            rMass= totQN.GetMZNS();
     3409          }
    33723410          else if(iniQChg<0)                         // Try to decay in Pi-
    3373                         {
     3411          {
    33743412            sPDG = -211;
    33753413            sMass= mPi;
    33763414            G4QNucleus totQN(valQ+PiQC);             // Nucleus Residual after Pi- sub.
    33773415            rPDG = totQN.GetPDG();
    3378                           rMass= totQN.GetMZNS();
    3379                         }
     3416            rMass= totQN.GetMZNS();
     3417          }
    33803418          else if(quasM>iniQM+mPi0)                  // Try to decay in Pi0
    3381                         {
     3419          {
    33823420            sPDG = 111;
    33833421            sMass= mPi0;
    33843422            rPDG = iniPDG;
    3385                           rMass= iniQM;
    3386                         }
    3387                         else                                       // Decay in gamma as a final decision
    3388                         {
     3423            rMass= iniQM;
     3424          }
     3425          else                                       // Decay in gamma as a final decision
     3426          {
    33893427            sPDG = 22;
    33903428            sMass= 0.;
    33913429            rPDG = iniPDG;
    3392                           rMass= iniQM;
    3393                         }
     3430            rMass= iniQM;
     3431          }
    33943432          ffin = true;
    3395                       }
    3396 #ifdef debug
    3397                G4cout<<"G4Q::HQ:MQ="<<q4Mom.m()<<"->sPDG="<<sPDG<<"(M="<<sMass<<") + rPDG="<<rPDG
     3433        }
     3434#ifdef debug
     3435        G4cout<<"G4Q::HQ:MQ="<<q4Mom.m()<<"->sPDG="<<sPDG<<"(M="<<sMass<<") + rPDG="<<rPDG
    33983436              <<"(M="<<rMass<<")"<<",S="<<rMass+sMass<<G4endl;
    33993437#endif
    34003438        if(q4Mom.m()+.003<rMass+sMass)
    3401                       {
    3402 #ifdef debug
    3403                  G4cerr<<"G4Q::HQ:***PANIC#3***tM="<<q4Mom.m()<<"<rM="<<rMass<<",sM="<<sMass
     3439        {
     3440#ifdef debug
     3441          G4cerr<<"G4Q::HQ:***PANIC#3***tM="<<q4Mom.m()<<"<rM="<<rMass<<",sM="<<sMass
    34043442                <<",d="<<rMass+sMass-q4Mom.m()<<G4endl;
    34053443#endif
     
    34103448          qEnv=theEnvironment;                       // Update the QEnvironment
    34113449          return theQHadrons;
    3412                       }
     3450        }
    34133451        G4double cqM=q4Mom.m();
    34143452        G4LorentzVector resQ4Mom(0.,0.,0.,rMass);    // 4-mom of residual Quasmon in CMS
     
    34163454        G4double sum=rMass+sMass;
    34173455        if(fabs(cqM-sum)<eps)
    3418                       {
     3456        {
    34193457          resQ4Mom=q4Mom*(rMass/sum);
    34203458          s4Mom=q4Mom*(sMass/sum);
     
    34243462          G4cerr<<"***G4Quasmon::HadronizeQuasmon: MQ="<<cqM<<"-> rPDG="<<rPDG<<", (M="
    34253463                <<rMass<<") + sPDG="<<sPDG<<"(M="<<sMass<<")="<<sum<<G4endl;
    3426                  throw G4QException("G4Quasmon::HadronizeQuas:Quasm+Hadr DecayIn2 error");
    3427         }
    3428 #ifdef debug
    3429                G4cout<<"G4Q::HQ:Decay of Quasmon="<<q4Mom<<"->s="<<sPDG<<s4Mom<<"+R="<<resQ4Mom
     3464          throw G4QException("G4Quasmon::HadronizeQuas:Quasm+Hadr DecayIn2 error");
     3465        }
     3466#ifdef debug
     3467        G4cout<<"G4Q::HQ:Decay of Quasmon="<<q4Mom<<"->s="<<sPDG<<s4Mom<<"+R="<<resQ4Mom
    34303468              <<",f="<<ffin<<G4endl;
    34313469#endif
    34323470        G4QHadron* candHadr = new G4QHadron(sPDG,s4Mom);// Creation Hadron for Candidate
    34333471        if(ffin)
    3434                       {
     3472        {
    34353473          //@@CHECK CoulBar and may be evaporate instead
    34363474          theQHadrons.push_back(candHadr);           // Fill the emergency PHOTON (del.eq.)
    34373475          G4QHadron* candHRes = new G4QHadron(rPDG,resQ4Mom);// Creation Hadron for QResid
    34383476          FillHadronVector(candHRes);                // Fill "new candHRes" (del.equiv.)
    3439 #ifdef debug
    3440           G4cerr<<"---Warning---G4Q::HQ:EmergencyHd="<<sPDG<<",E="<<theEnvironment<<G4endl;
    3441 #endif
    34423477          ClearQuasmon();                            // This Quasmon is done
    34433478          qEnv=theEnvironment;
    34443479          return theQHadrons;
    3445                       }
     3480        }
    34463481        else
    3447                       {
     3482        {
    34483483          G4QContent outQC = G4QPDGCode(sPDG).GetQuarkContent();
    34493484          G4int outChg     = outQC.GetCharge();
    3450           G4double outProb=1.;
     3485          G4double outProb = 1.;
    34513486          if(theEnvironment.GetPDG()>NUCPDG)
    3452                                                                                 {
     3487          {
    34533488            G4int outBar   = outQC.GetBaryonNumber();
    34543489            G4double outCB = theEnvironment.CoulombBarrier(outChg,outBar);//ChrgIsNeglected
     
    34783513            delete candHadr;                         // As a result DoNothing
    34793514          }
    3480                       }
     3515        }
    34813516      }
    34823517      else                                           // ===>"HadronInNuclMedia or NuclCand"
    3483              {
     3518      {
    34843519        // Now the CoulBar reflection should be taken into account
    34853520        G4QContent outQC = G4QPDGCode(sPDG).GetQuarkContent();
     
    35233558#ifdef debug
    35243559          G4cout<<"G4Q::HQ:QuarkExchHadronizThroughCB Q="<<valQ<<",trQC="<<transQC<<G4endl;
    3525 #endif   
     3560#endif  
    35263561          sumL-=theEnvironment.Get4Momentum()+q4Mom+fr4Mom;
    35273562#ifdef debug
    35283563          G4cout<<"G4Q::HQ:status=1,>>>>>>>>> NuclearMatter SUBCHECK >>>>>>"<<sumL<<G4endl;
    3529 #endif   
     3564#endif  
    35303565          status=1;                                  // Something was successfuly done
    35313566          phot4M=zeroLV;
    35323567          piF=false;
    35333568          gaF=false;
    3534                }
     3569        }
    35353570        else
    35363571        {
     
    35433578            status=3;
    35443579            if(gaF)
    3545                                  {
     3580            {
    35463581              phot4M=zeroLV;
    35473582              gaF=false;
    35483583            }
    3549                         //}
    3550                       }
    3551       }
    3552            } // End of skip
     3584          //}
     3585        }
     3586      }
     3587    } // End of skip
    35533588    // === Check of boundary to escape not existing state of residual nucleus ===
    35543589    if(CheckGroundState())
    3555            //if(CheckGroundState(true))
    3556            {
     3590    //if(CheckGroundState(true))
     3591    {
    35573592      ClearQuasmon();                           // This Quasmon is done
    35583593      qEnv=theEnvironment;
    35593594      return theQHadrons;     
    3560            }
     3595    }
    35613596    G4LorentzVector sumLor=theEnvironment.Get4Momentum()+q4Mom+check;
    35623597#ifdef debug
     
    36643699#endif
    36653700  if(thePDG>80000000 && (thePDG<90000000 || thePDG%1000>500 || thePDG%1000000>500000)
    3666         && thePDG!=90002999 && thePDG!=89999003 && thePDG!=90003998 && thePDG!=89998004
    3667         && thePDG!=90003999 && thePDG!=89999004 && thePDG!=90004998 && thePDG!=89998005)
     3701  && thePDG!=90002999 && thePDG!=89999003 && thePDG!=90003998 && thePDG!=89998004
     3702  && thePDG!=90003999 && thePDG!=89999004 && thePDG!=90004998 && thePDG!=89998005)
    36683703  { // Translation from CHIPS encoding to PDG encoding @@ change to NuclToHadr
    36693704    if     (thePDG==90999999) thePDG=-311;  // anti-K0 === Meson OCTET
     
    37013736    G4int h2PDG = h2QC.GetSPDGCode();        // PDGCode of the First Hadron
    37023737    if(!h1PDG || !h2PDG)
    3703            {
     3738    {
    37043739      G4cerr<<"***FillHV:h1QC="<<h1QC<<"(PDG="<<h1PDG<<"),h2QC="<<h2QC<<"(PDG="<<h2PDG<<")"
    37053740            <<G4endl;
    3706              throw G4QException("G4Quasmon::FillHadronVector: Cipolino cann't be defragmented");
    3707            }
     3741      throw G4QException("G4Quasmon::FillHadronVector: Cipolino cann't be defragmented");
     3742    }
    37083743    G4QHadron* fHadr = new G4QHadron(h1PDG); // the First Hadron is created
    37093744    G4QHadron* sHadr = new G4QHadron(h2PDG); // the Second Hadron is created
     
    37163751      G4cerr<<"***G4Q::FillHadrV:ChipQC"<<chipQC<<":PDG1="<<h1PDG<<",PDG2="<<h2PDG<<G4endl;
    37173752      theQHadrons.push_back(qH);             // No decay (delete equivalent)
    3718            }
     3753    }
    37193754    else
    37203755    {
     
    37383773    G4int    bA     =qNuc.GetA();            // A#of baryons in the Nucleus
    37393774#ifdef pdebug
    3740            G4cout<<"G4Quasm::FillHadrVect:Nucl="<<qNuc<<",nPDG="<<thePDG<<",GSM="<<GSMass<<G4endl;
     3775    G4cout<<"G4Quasm::FillHadrVect:Nucl="<<qNuc<<",nPDG="<<thePDG<<",GSM="<<GSMass<<G4endl;
    37413776#endif
    37423777    if((nN<0||nZ<0||nS<0)&&bA>0)             // => "Anti-strangeness or ISOBAR" case
    3743            {
     3778    {
    37443779      G4double m1=mPi;                       // Prototypes for the nZ<0 case
    37453780      G4int  PDG1=-211;
     
    37653800          PDG2=newN0.GetPDG();
    37663801        }
    3767              }
     3802      }
    37683803      else if(nS>0&&nZ+nN>0)
    37693804      {
     
    37843819          m2         =newNp.GetMZNS();
    37853820        }
    3786              }
     3821      }
    37873822      else if(nN<0)
    3788              {
     3823      {
    37893824        PDG1       =211;
    37903825        G4QNucleus  newNpp(totQC-PiQC);
    37913826        PDG2       =newNpp.GetPDG();
    37923827        m2         =newNpp.GetMZNS();
    3793              }
     3828      }
    37943829      if(fragMas>m1+m2)                      // => "can decay" case
    37953830      {
     
    37973832        G4LorentzVector qe4M(0.,0.,0.,m2);
    37983833        if(!qH->DecayIn2(fq4M,qe4M))
    3799                {
     3834        {
    38003835          G4cerr<<"***G4Quasm::FillHadrV: QM="<<t.m()<<"-> Mes="<<PDG1<<"(M="
    3801                         <<m1<<") + ResA="<<PDG2<<"(M="<<m2<<")"<<G4endl;
    3802                  throw G4QException("G4Quasm::FillHadrV: Mes+ResA DecayIn2 did not succeed");
    3803                }
     3836            <<m1<<") + ResA="<<PDG2<<"(M="<<m2<<")"<<G4endl;
     3837          throw G4QException("G4Quasm::FillHadrV: Mes+ResA DecayIn2 did not succeed");
     3838        }
    38043839        delete qH;
    38053840        G4QHadron* H1 = new G4QHadron(PDG1,fq4M);
     
    38073842        G4QHadron* H2 = new G4QHadron(PDG2,qe4M);
    38083843        FillHadronVector(H2);                // (delete equivalent)
    3809              }
     3844      }
    38103845      else if(fabs(m1+m2-fragMas)<0.01)      // Split the 4-momentum
    3811              {
     3846      {
    38123847        G4double r1=m1/fragMas;
    38133848        G4double r2=1.-r1;
     
    38213856        G4QHadron* H2 = new G4QHadron(PDG2,r2*t);
    38223857        FillHadronVector(H2);                  // (delete equivalent)
    3823              }
     3858      }
    38243859      else
    3825              {
     3860      {
    38263861#ifdef pdebug
    38273862        G4cerr<<"-Warning-G4Q::FillHVec:PDG="<<thePDG<<"("<<t.m()<<","<<fragMas<<") < Mes="
    38283863              <<PDG1<<"("<<m1<<") + ResA="<<PDG2<<"("<<m2<<"), d="<<fragMas-m1-m2<<G4endl;
    3829                //throw G4QException("G4Quasm::FillHadrVec: mass of decaying hadron is too small");
     3864        //throw G4QException("G4Quasm::FillHadrVec: mass of decaying hadron is too small");
    38303865#endif
    38313866        theQHadrons.push_back(qH); // FillAsIs to correct later in G4QEnvironment (Warning)
    3832              }
    3833            }
     3867      }
     3868    }
    38343869    else if(abs(fragMas-GSMass)<.1)            // the Nucleus is too close the Ground State
    38353870    {
    38363871#ifdef pdebug
    3837              G4cout<<"G4Quasm::FillHadrVect: Ground state"<<G4endl;
     3872      G4cout<<"G4Quasm::FillHadrVect: Ground state"<<G4endl;
    38383873#endif
    38393874      G4double nResM  =1000000.;               // Prototype of residualMass for the neutron
    38403875      G4int    nResPDG=0;                      // Prototype of PDGCode for the neutron
    38413876      if(nN>0&&bA>1)                           // It's nucleus and there is the neutron
    3842              {
     3877      {
    38433878        G4QContent resQC=totQC-neutQC;
    38443879        G4QNucleus resN(resQC);                // Pseudo nucleus for the Residual Nucleus
     
    38483883        else if(nResPDG==91000000) nResM=mLamb;
    38493884        else nResM=resN.GetMZNS();             // min mass of the Residual Nucleus
    3850              }
     3885      }
    38513886      G4double pResM  =1000000.;               // Prototype of residualMass for the proton
    38523887      G4int    pResPDG=0;                      // Prototype of PDGCode of the proton
    38533888      if(nZ>0&&bA>1)                           // It's nucleus and there is theroton
    3854              {
     3889      {
    38553890        G4QContent resQC=totQC-protQC;
    38563891        G4QNucleus resN(resQC);                // Pseudo nucleus for the Residual Nucleus
     
    38603895        else if(pResPDG==91000000) pResM=mLamb;
    38613896        else pResM  =resN.GetMZNS();           // min mass of the Residual Nucleus
    3862              }
     3897      }
    38633898      G4double lResM  =1000000.;               // Prototype of residualMass for the Lambda
    38643899      G4int    lResPDG=0;                      // Prototype of PDGCode of the Lambda
    38653900      if(nS>0&&bA>1)                           // It's nucleus and there is the Lambda
    3866              {
     3901      {
    38673902        G4QContent resQC=totQC-lambQC;
    38683903        G4QNucleus resN(resQC);                // Pseudo nucleus for the Residual Nucleus
     
    38723907        else if(lResPDG==91000000) lResM=mLamb;
    38733908        else lResM  =resN.GetMZNS();           // min mass of the Residual Nucleus
    3874              }
     3909      }
    38753910#ifdef pdebug
    38763911      G4cout<<"G4Quasm::FillHadrVec:rP="<<pResPDG<<",rN="<<nResPDG<<",rL="<<lResPDG<<",nN="
     
    38813916           (bA > 1 && ( (nN > 0 && fragMas > nResM+mNeut) ||
    38823917                        (nZ > 0 && fragMas > pResM+mProt) ||
    3883                         (nS > 0 && fragMas > lResM+mLamb) ) ) )
     3918   (nS > 0 && fragMas > lResM+mLamb) ) ) )
    38843919      {
    38853920        G4int barPDG = 90002002;
     
    38883923        G4double resM= mAlph;
    38893924
    3890         if (fragMas > nResM+mNeut) {  // Can radiate a neutron (priority 1)
     3925 if (fragMas > nResM+mNeut) {  // Can radiate a neutron (priority 1)
    38913926          barPDG = 90000001;
    38923927          resPDG = nResPDG;
    38933928          barM= mNeut;
    38943929          resM= nResM;
    3895         }
    3896         else if(fragMas>pResM+mProt)  // Can radiate a proton (priority 2)
    3897         {
     3930 }
     3931 else if(fragMas>pResM+mProt)  // Can radiate a proton (priority 2)
     3932 {
    38983933          barPDG=90001000;
    38993934          resPDG=pResPDG;
    39003935          barM  =mProt;
    39013936          resM  =pResM;
    3902         }
    3903         else if(fragMas>lResM+mLamb)  // Can radiate a Lambda (priority 3)
    3904         {
     3937 }
     3938 else if(fragMas>lResM+mLamb)  // Can radiate a Lambda (priority 3)
     3939     {
    39053940          barPDG=91000000;
    39063941          resPDG=lResPDG;
    39073942          barM  =mLamb;
    39083943          resM  =lResM;
    3909         }
     3944 }
    39103945        else if(thePDG!=90004004&&fragMas>GSMass)// If it's not Be8 decay in gamma
    3911         {
     3946 {
    39123947          barPDG=22;
    39133948          resPDG=thePDG;
    39143949          barM  =0.;
    39153950          resM  =pResM;
    3916         }
     3951 }
    39173952        else if(thePDG!=90004004)
    3918         {
     3953 {
    39193954          G4cerr<<"***G4Q::FillHadV:PDG="<<thePDG<<",M="<<fragMas<<"<GSM="<<GSMass<<G4endl;
    39203955          throw G4QException("***G4Quasmon::FillHadronVector: Below GSM but cann't decay");
    3921         }
     3956 }
    39223957
    39233958        G4LorentzVector a4Mom(0.,0.,0.,barM);
     
    39273962          theQHadrons.push_back(qH);            // No decay (delete equivalent)
    39283963          G4cerr<<"---Warning---G4Q::FillHadronVector: Be8 decay did not succeed"<<G4endl;
    3929                }
     3964        }
    39303965        else
    39313966        {
     
    39403975          FillHadronVector(HadrR);             // Fill 2nd Hadron (delete equivalent)
    39413976        }
    3942              }
     3977      }
    39433978      else
    39443979      {
    39453980#ifdef pdebug
    3946                G4cout<<"G4Quasm::FillHadrVect: Leave as it is"<<G4endl;
     3981        G4cout<<"G4Quasm::FillHadrVect: Leave as it is"<<G4endl;
    39473982#endif
    39483983        theQHadrons.push_back(qH);             // No decay  (delete equivalent)
    3949              }
     3984      }
    39503985    }
    39513986    else if (fragMas<GSMass)
    3952            {
     3987    {
    39533988      G4cerr<<"***G4Q::FillHV:M="<<fragMas<<">GSM="<<GSMass<<",d="<<fragMas-GSMass<<G4endl;
    3954       throw G4QException("***G4Quasmon::FillHadronVector:Mass is below theGroundStateVal");
    3955            }
     3989      //throw G4QException("*G4Quasmon::FillHadronVector:Mass is below theGroundStateVal");
     3990      G4cout<<"***>>>G4Quasm::FillHadrVect: Leave as it is Instead of Exception"<<G4endl;
     3991      theQHadrons.push_back(qH);              // Fill As Is  (delete equivalent)
     3992    }
    39563993    else if (bA==1&&fragMas>GSMass)
    3957            {
     3994    {
    39583995      G4int gamPDG=22;
    39593996      G4double gamM=0.;
    39603997      if(fragMas>mPi0+GSMass)
    3961              {
     3998      {
    39623999        gamPDG=111;
    39634000        gamM=mPi0;
    3964              }
     4001      }
    39654002      G4LorentzVector a4Mom(0.,0.,0.,gamM);
    39664003      G4LorentzVector b4Mom(0.,0.,0.,GSMass);
     
    39694006        theQHadrons.push_back(qH);         // No decay (delete equivalent)
    39704007        G4cerr<<"---Warning---G4Q::FillHadrVect:N*->gamma/pi0+N decay error"<<G4endl;
    3971              }
     4008      }
    39724009      else
    39734010      {
     
    39794016    }
    39804017    else                                   // ===> Evaporation of excited system
    3981            {
     4018    {
    39824019#ifdef pdebug
    39834020      G4cout<<"G4Quasm::FillHadrVect:Evaporate "<<thePDG<<",tM="<<fragMas<<" > GS="<<GSMass
     
    39874024      G4QHadron* rHadron = new G4QHadron;
    39884025      if(!qNuc.EvaporateBaryon(bHadron,rHadron))
    3989              {
     4026      {
    39904027        G4cerr<<"---Warning---G4Q::FillHV:Evaporate PDG="<<thePDG<<",M="<<fragMas<<G4endl;
    39914028        delete bHadron;
    39924029        delete rHadron;
    39934030        theQHadrons.push_back(qH);         // Fill hadron in the HadronVector as it is
    3994              }
     4031      }
    39954032      else
    3996              {
     4033      {
    39974034#ifdef pdebug
    39984035        G4cout<<"G4Q::FlHV:Done,b="<<bHadron->GetQPDG()<<",r="<<rHadron->GetQPDG()<<G4endl;
     
    40024039        FillHadronVector(rHadron);          // Fill Residual Nucl. (delete equivalent)
    40034040      }
    4004            }
     4041    }
    40054042  }
    40064043  else                                 // Try to decay the QHadron (delete equivalent)
     
    40594096    G4cerr<<"***G4Q::GetQPM: kMax="<<kMax<<", kMin="<<kMin<<", kLim="<<kLim<<", MQ="<<qMass
    40604097          <<", n="<<nOfQ<<G4endl;
    4061            throw G4QException("G4Quasmon::GetQPartonMomentum: Can not generate quark-parton");   
     4098    throw G4QException("G4Quasmon::GetQPartonMomentum: Can not generate quark-parton");   
    40624099  }
    40634100#ifdef pdebug
     
    40764113    if (kMax>=kLim) vRndm = vRndm*pow((1.-xMin),n)*(1.+n*xMin);   // "xMin - 1." Range
    40774114    else
    4078            {
     4115    {
    40794116      G4double xMax=kMax/kLim;
    40804117      G4double vRmin = pow((1.-xMin),n)*(1.+n*xMin);
     
    40914128  if (vRndm<=0. || vRndm>1.)
    40924129  {
    4093     //G4cout<<"-Warning-G4Quasmon::GetQPM: R="<<vRndm<<",kMi="<<kMin<<",kMa="<<kMax<<",kLi="
    4094     //      <<kLim<<G4endl;
     4130    //G4cout<<"-Warning-G4Quasmon::GetQPM: R="<<vRndm<<",kMi="<<kMin<<",kMa="<<kMax
     4131    //      <<",kLi="<<kLim<<G4endl;
    40954132    if(vRndm<=0.) vRndm=1.e-9;
    40964133    else if(vRndm>1.) vRndm=1.;
     
    41284165    G4double od = c - vRndm;   // the old Residual Difference
    41294166#ifdef pdebug
    4130            G4cout<<"G4Q::GetQPMom:>>>First x="<<x<<", n="<<n<<", f="<<f<<", d/R(first)="
     4167    G4cout<<"G4Q::GetQPMom:>>>First x="<<x<<", n="<<n<<", f="<<f<<", d/R(first)="
    41314168            <<od/vRndm<<G4endl;
    41324169#endif
     
    41344171    if(nitMax>100)nitMax=100; // But it is limited by 100
    41354172    while( abs(d/vRndm) > 0.001 && it <= nitMax) // Solve the equation by Newton method
    4136            {
     4173    {
    41374174      x  = x + f*od/(r*nx*(fn+1.)); // Calculate the new x value
    41384175      if(x<1.e-27) x=1.e-27;
     
    41594196      }
    41604197      else
    4161              {
     4198      {
    41624199        if (f>1.0001&&f<27.) f=1.+(f-1.)*2; // Make a regular correction of OptStepFactor
    41634200        if (f<0.99999999999) f=1.+(1.-f)/2.;
    41644201        if (f>=27.) f=27.;
    4165              }
    4166 #ifdef pdebug
    4167              G4cout<<"G4Q::GetQPMom: Iter#"<<it<<": (c="<<c<<" - R="<<vRndm<<")/R ="<<d/vRndm
     4202      }
     4203#ifdef pdebug
     4204      G4cout<<"G4Q::GetQPMom: Iter#"<<it<<": (c="<<c<<" - R="<<vRndm<<")/R ="<<d/vRndm
    41684205            <<", x="<<x<<", f="<<f<<G4endl;
    41694206#endif
     
    41784215      ox = x;
    41794216      it++;
    4180            }
     4217    }
    41814218#ifdef pdebug
    41824219    if(it>nitMax) G4cout<<"G4Q::GetQPMom: a#of iterations > nitMax="<<nitMax<<G4endl;
     
    41974234  //  if (kMax>=kLim) vRndm = vRndm*pow((1.-xMin),n);   // Shrink to the "xMin - 1." Range
    41984235  //  else
    4199         //  {
     4236  //  {
    42004237  //    G4double xMax=kMax/kLim;          // Maximum value for "x"
    42014238  //    G4double vRmin = pow((1.-xMin),n);
     
    42904327    if(asSea<sSea) sSea=asSea;
    42914328    if(sSea>nMaxStrangeSea) // @@@@@@@ Too many strange sea ??????
    4292            {
     4329    {
    42934330#ifdef pdebug
    42944331      G4cout<<"G4Q::Calc#ofQP:**Reduce** S="<<sSea<<",aS="<<asSea<<",maxS="<<nMaxStrangeSea
     
    42994336      valQ.DecAS(sSea);
    43004337      valQ.IncQAQ(sSea,0.); // Add notstrange sea ????????
    4301            }
     4338    }
    43024339  }
    43034340  // @@ Chocolate rule --- Temporary (?)
     
    43384375    G4double   frM=cQPDG.GetMass();            // Vacuum mass of the candidate
    43394376    if(cPDG>80000000&&cPDG!=90000000)          // Modify Fragments toTakeIntoAccount CurNuc
    4340            {
     4377    {
    43414378      if(totMass<tmpTM+frM)
    43424379      {
     
    43464383#endif
    43474384        curCand->SetPossibility(false);
    4348              }
     4385      }
    43494386      G4QNucleus cNuc(cPDG);                   // Fake nucleus for the Candidate
    43504387      G4int cP = cNuc.GetZ();                  // A#of protons in the Current Environment
     
    43624399        if(cP==eP&&cN==eN&&cL==eL)clME=cQPDG.GetMass();// The only notBoundCluster of Envir
    43634400        else                                   // Bound Cluster in the Environment
    4364                       {
     4401        {
    43654402          renvM = cQPDG.GetNuclMass(eP-cP,eN-cN,eL-cL); // Mass of residual for Environment
    43664403          clME  = envM-renvM;
     
    43684405        if(cP==tP&&cN==tN&&cL==tL)clMN=cQPDG.GetMass(); // The only NotBoundCluster of TotN
    43694406        else                                   // Bound Cluster in Total Nucleus
    4370                       {
     4407        {
    43714408          renvM = cQPDG.GetNuclMass(tP-cP,tN-cN,tL-cL); // TotalResidualNucleus Mass
    43724409          clMN   = totM-renvM;
     
    43804417              <<renvM<<G4endl;
    43814418#endif
    4382              }
     4419      }
    43834420      else curCand->SetParPossibility(false);
    4384            } // @@ Modification of hadron masses in nuclear matter are not implemented yet
     4421    } // @@ Modification of hadron masses in nuclear matter are not implemented yet
    43854422  }
    43864423} // End of "ModifyInMatterCandidates"
     
    44504487    G4double probability = 0.;
    44514488    G4double secondProbab = 0.;
    4452     if ( (aPDG > 80000000 && envA > 0) || aPDG < 80000000) {
     4489    if ( (aPDG > 80000000 && envA > 0) || aPDG < 80000000)
     4490    {
    44534491      G4int resPDG=0;
    44544492      G4double comb=0.;                       // Combinatorial factor for quark exchange
     
    44714509        cPDG==90000002||cPDG==90001001||cPDG==90001002||cPDG==90002001||cPDG==90002002;
    44724510      if(pPrint) G4cout<<"G4Q::CHP:==****==>>>c="<<cPDG<<",dUD="<<dUD<<",pos="<<pos<<",eA="
    4473                      <<envA<<",tM="<<totMass<<" > tmpTM+frM="<<tmpTM+frM<<G4endl;
    4474 #endif
    4475              //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<1)))// 1 ** never try
    4476              if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<2)))//2 ***The best***
    4477              //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<3))) // 3 *** good ***
    4478                                   //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<4)))//4 almost the same
    4479                                   //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000))) // no restrictions
    4480              {
     4511                       <<envA<<",tM="<<totMass<<" > tmpTM+frM="<<tmpTM+frM<<G4endl;
     4512#endif
     4513      //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<1)))// 1 ** never try
     4514      if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<2)))//2 ***The best***
     4515      //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<3))) // 3 *** good ***
     4516      //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000&&dUD<4)))//4 almost the same
     4517      //if(pos&&(cPDG<80000000||(cPDG>80000000&&cPDG!=90000000))) // no restrictions
     4518      {
    44814519        G4QContent curQ = valQ;                 // Make current copy of theQuasmonQuarkCont
    44824520        G4int baryn= candQC.GetBaryonNumber();  // Baryon number of the Candidate
     
    45054543          G4int oQmin=0;                        // Returning from cluster quarks: d=0,u=1
    45064544          G4int oQmax=2;                        // 2 is bigger than u-quark (1, oq<2) @@ 3?
    4507                         if     (dofU<=nofD) iQmax=1;          // Too many Dquarks (in-Uquark is forbiden)
     4545          if     (dofU<=nofD) iQmax=1;          // Too many Dquarks (in-Uquark is forbiden)
    45084546          else if(dofD<=nofU) iQmin=1;          // Too many Uquarks (in-Dquark is forbiden)
    45094547          // @@ This is how netrons are increased for the pion capture at rest case @@
    45104548          if(piF)                             // force Pi- transfer its charge to a quark
    4511                         {
     4549          {
    45124550            iQmin=0;
    45134551            iQmax=1;
    4514                         }
     4552          }
    45154553#ifdef pdebug
    45164554          if(pPrint)G4cout<<"G4Q::CHP:***!!!***>>F="<<cPDG<<",mF="<<frM<<",iq:"<<iQmin<<","
     
    45184556#endif
    45194557          if(iQmax>iQmin) for(int iq=iQmin; iq<iQmax; iq++) // Entering (fromQuasmon) quark
    4520                         {
     4558          {
    45214559            G4double qFact=1.;
    45224560            //if(iq==1&&addPhoton>0.) qFact=4.; // @@ taftology
     
    45274565              if(pPrint) G4cout<<"G4Q::CHP:photon cap(gaF) is enhanced for Uquark"<<G4endl;
    45284566#endif
    4529                           }
     4567            }
    45304568            G4double nqInQ=0.;                 // A#of quarks of this sort in a Quasmon
    45314569            if     (!iq)   nqInQ=valQ.GetD();
     
    45384576#endif
    45394577            if(oQmax>oQmin) for(int oq=oQmin; oq<oQmax; oq++) // Exiting (to Quasmon) quark
    4540                           {
     4578            {
    45414579              G4int shift= cQPDG.GetRelCrossIndex(iq, oq);
    45424580              G4QContent ioQC=cQPDG.GetExQContent(iq, oq);
    45434581              G4QContent resQC=valQ+ioQC;         // Quark Content of the residual Quasmon
    45444582#ifdef sdebug
    4545                                    G4cout<<"G4Q::CHP:iq="<<iq<<",oq="<<oq<<",QC="<<ioQC<<",rQC="<<resQC<<G4endl;
     4583              G4cout<<"G4Q::CHP:iq="<<iq<<",oq="<<oq<<",QC="<<ioQC<<",rQC="<<resQC<<G4endl;
    45464584#endif
    45474585              G4QPDGCode resQPDG(resQC);          // QPDG of the residual Quasmon
     
    45594597                       (resU+resS>resD+resD||resD+resS>resU+resU);
    45604598              //if(resQ>-2&&resPDG&&resPDG!=10&&!rI)// The Residual Quasmon is possible
    4561               //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&!piF) // *** Never try this
    4562               //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&(!piF||cPDG==90000001))
     4599              //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&!piF) // *** Never try this
     4600              //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&(!piF||cPDG==90000001))
    45634601              //G4cout<<"G4Q::CHP:PiF="<<piF<<G4endl;
    45644602              // The best:
    4565               //if(resQ>-2 &&resPDG && resPDG!=10 && !rI && (!piF||piF && cPDG!=90001000 ))
    4566 
    4567               if (resQ > -2 && resPDG && resPDG != 10 && !rI &&
    4568                  (!piF ||
    4569                   (piF &&
    4570                    (cPDG != 90001000 || G4UniformRand() < .333333) &&
    4571                    cPDG != 90002001 &&
    4572                    cPDG != 90002002) ) )
    4573 
    4574                 //cPDG!=90001000||G4UniformRand()<.333333))
    4575                 //(cPDG!=90001000||G4UniformRand()<.5)&&cPDG!=90002001&&cPDG!=90002002))
    4576                 //cPDG!=90001000&&cPDG!=90002001&&cPDG!=90002002))
    4577                 //-----------------------------------------------------------------
    4578                                    //if(resQ>-2 && resPDG && resPDG!=10 && !rI && (!piF||piF&&baryn>1))
    4579                                    //if(resQ>-2 && resPDG && resPDG!=10 && !rI) // baryons are too energetic
    4580                                    //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&(!piF||baryn==1)) // bad
    4581               {
     4603              //if(resQ>-2 &&resPDG && resPDG!=10 && !rI && (!piF||piF && cPDG!=90001000 ))
     4604              if (resQ > -2 && resPDG && resPDG != 10 && !rI &&
     4605                   (!piF || ( piF && (cPDG != 90001000 || G4UniformRand() < .333333) &&
     4606                              cPDG != 90002001 && cPDG != 90002002
     4607                            )
     4608                   )
     4609                 )
     4610              //cPDG!=90001000||G4UniformRand()<.333333))
     4611              //(cPDG!=90001000||G4UniformRand()<.5)&&cPDG!=90002001&&cPDG!=90002002))
     4612              //cPDG!=90001000&&cPDG!=90002001&&cPDG!=90002002))
     4613              //-----------------------------------------------------------------
     4614              //if(resQ>-2 && resPDG && resPDG!=10 && !rI && (!piF||piF&&baryn>1))
     4615              //if(resQ>-2 && resPDG && resPDG!=10 && !rI) // baryons are too energetic
     4616              //if(resQ>-2&&resPDG&&resPDG!=10&&!rI&&(!piF||baryn==1)) // bad
     4617              {
    45824618                G4int is=index+shift;
    45834619                if(shift!=7&&is<maxC)             // This quark exchange is possible
    4584                                      {
     4620                {
    45854621                  G4QCandidate* parCand=theQCandidates[is];//Pointer to ParentClusterOfCand
    45864622                  G4QContent parQC = parCand->GetQC();     // QuarkCont of theParentCluster
     
    46114647                    //********* ISOTOPIC  FOCUSING  *******************
    46124648                    // ==== Old (First Publication) Complicated rule ====
    4613                                                 //if(
    4614                                                 //  //zZ<3 &&
     4649                    //if(
     4650                    //  //zZ<3 &&
    46154651                    //  //(
    4616                                                 //  abs(dI)<1 ||
    4617                                                 //  (barot==1 && (
     4652                    //  abs(dI)<1 ||
     4653                    //  (barot==1 && (
    46184654                    //     abs(dI)<2&&abs(cC-charge)<2 ||
    4619                                                 //     (dI>=2&&cC<charge)   || (dI<=-2&&cC>charge)
     4655                    //     (dI>=2&&cC<charge)   || (dI<=-2&&cC>charge)
    46204656                    //     //dI==2&&cC<=charge || dI==-2&&cC>=charge ||
    46214657                    //     //dI>2&&cC<charge   || dI<-2&&cC>charge
    4622                                                 //   )) ||
    4623                                                 //   (barot>1&&barot<3
    4624                                                 //     && (
    4625                                                 //     abs(dI)<2&&abs(cC-charge)<2 ||
     4658                    //   )) ||
     4659                    //   (barot>1&&barot<3
     4660                    //     && (
     4661                    //     abs(dI)<2&&abs(cC-charge)<2 ||
    46264662                    //     //dI>=2&&cC<charge   || dI<=-2&&cC>charge
    4627                                                 //     dI<=2&&cC<=charge || dI==-2&&cC>=charge ||
    4628                                                 //     dI>2&&cC<charge   || dI<-2&&cC>charge
    4629                                                 //   )) ||
    4630                                                 //   (barot>2&&barot<4
    4631                                                 //    && (
    4632                                                 //     abs(dI)<2&&abs(cC-charge)<2 ||
     4663                    //     dI<=2&&cC<=charge || dI==-2&&cC>=charge ||
     4664                    //     dI>2&&cC<charge   || dI<-2&&cC>charge
     4665                    //   )) ||
     4666                    //   (barot>2&&barot<4
     4667                    //    && (
     4668                    //     abs(dI)<2&&abs(cC-charge)<2 ||
    46334669                    //     //dI>=2&&cC<charge   || dI<=-2&&cC>charge
    4634                                                 //     dI<=2&&cC<=charge || dI==-3&&cC>=charge ||
    4635                                                 //     dI>2&&cC<charge   || dI<-3&&cC>charge
    4636                                                 //   )) ||
    4637                                                 //   (barot>3
    4638                                                 //    && (
    4639                                                 //     abs(dI)<2&&abs(cC-charge)<2 ||
     4670                    //     dI<=2&&cC<=charge || dI==-3&&cC>=charge ||
     4671                    //     dI>2&&cC<charge   || dI<-3&&cC>charge
     4672                    //   )) ||
     4673                    //   (barot>3
     4674                    //    && (
     4675                    //     abs(dI)<2&&abs(cC-charge)<2 ||
    46404676                    //     dI>=2&&cC<charge   || dI<=-2&&cC>charge
    4641                                                 //     //dI<=2&&cC<=charge || dI==-3&&cC>=charge ||
    4642                                                 //     //dI>2&&cC<charge   || dI<-3&&cC>charge
    4643                                                 //    )
     4677                    //     //dI<=2&&cC<=charge || dI==-3&&cC>=charge ||
     4678                    //     //dI>2&&cC<charge   || dI<-3&&cC>charge
     4679                    //    )
    46444680                    //   )
    4645                                                 //  )
     4681                    //  )
    46464682                    // ==== Just a coridor =======
    4647                                                 //if(abs(dS)<3||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//StrForB=1(old)
    4648                                                 //if(abs(dS)<4||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//StrongFor1(<4)
    4649                                                 //if(baryn>1||abs(dS)<4||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//SIFF1
    4650                                                 //if(!piF&&abs(dS)<4 || piF&&abs(dS)<3) // UniversalIsoFocusing
    4651                                                 //if(!piF&&first&&abs(dS)<4 || (!piF&&!first||piF)&&abs(dS)<3)//ExpIsoF
    4652 
    4653                     if ( (!piF && first && baryn < 3) ||
    4654                          (!piF && !first) ||
    4655                          (piF && abs(dS) < 3) )
    4656                                                 // ExpIsoFoc
    4657                                                 //if(!qIso&&!dC||qIso>0&&dC<0||qIso<0&&dC>0)//MediumIsoFocusingForAll
    4658                                                 //if(abs(dS)<3) // Universal IsotopeFocusing(<3) (Best for pi-capture)
    4659                                                 //if(abs(dS)<4) // Never try this (**)
     4683                    //if(abs(dS)<3||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//StrForB=1(old)
     4684                    //if(abs(dS)<4||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//StrongFor1(<4)
     4685                    //if(baryn>1||abs(dS)<4||(qIso>0&&dC<0||qIso<0&&dC>0)&&baryn==1)//SIFF1
     4686                    //if(!piF&&abs(dS)<4 || piF&&abs(dS)<3) // UniversalIsoFocusing
     4687                    //if(!piF&&first&&abs(dS)<4 || (!piF&&!first||piF)&&abs(dS)<3)//ExpIsoF
     4688                    // *** Recent correction (****
     4689                    //if ( (!piF && first && baryn < 3) ||
     4690                    //     (!piF && !first) ||
     4691                    if ( (!piF && first && baryn < 3) ||
     4692                         (!piF && !first && baryn < 5 ) ||
     4693                         (piF && abs(dS) < 3) ) // Isotopic focusing for AtRest Reactions
     4694                    //if(!qIso&&!dC||qIso>0&&dC<0||qIso<0&&dC>0)//MediumIsoFocusingForAll
     4695                    //if(abs(dS)<3) // Universal IsotopeFocusing(<3) (Best for pi-capture)
     4696                    //if(abs(dS)<4) // Never try this (**)
    46604697                    //if(3>2)       //***>>> ***NO*** Isotope Focusing ***
    46614698                    {
     
    46744711                      else if(resPDG)minM=G4QPDGCode(resPDG).GetMass();//ResidQuasmonHadron
    46754712                      G4double bNM2=nucBM*nucBM;
    4676                       G4double nDelta=(frM2-bNM2)/(nucBM+nucBM);
     4713                      G4double nDelta=0.;
     4714                      if(nucBM)nDelta=(frM2-bNM2)/(nucBM+nucBM);    // Safety check
    46774715#ifdef pdebug
    46784716                      G4int    iniPDG =valQ.GetSPDGCode();
     
    46834721                                      <<kCut<<",E="<<E<<">"<<nDelta<<",p="<<parPDG<<G4endl;
    46844722#endif
    4685                                                          if(resPDG&&minM>0.) // Kinematical analysis of hadronization
     4723                      if(resPDG&&minM>0.) // Kinematical analysis of hadronization
    46864724                      {
    46874725#ifdef pdebug
     
    47384776                        //if(envM>boundM)
    47394777                        if ( (envA-barot <= bEn && envM > boundM) || envA-barot > bEn)
    4740                                //if(2>3)
     4778                        //if(2>3)        // *** Recent correction ***
    47414779                        {
    47424780                          minBM=rtM;
    47434781                          // *** LIM ***
    4744                           if(envA-barot>bEn) minBM-=mbEn;
    4745                           else
    4746                             minBM-=envM-boundM; // MinResidualBoundedQuasmonMass
    4747                                                            }
     4782                          if(envA-barot > bEn) minBM-=mbEn;
     4783                          else         minBM-=envM-boundM; // MinResidualBoundedQuasmonMass
     4784                        }
    47484785                        G4double minBM2=minBM*minBM+.1;
    47494786                        G4double minM2=minM*minM+.1;
     
    47544791                                         <<(mintM2-rtQ2)/rtEP/2<<G4endl;
    47554792#endif
    4756                                                            G4double newh=1.;
     4793                        G4double newh=1.;
    47574794                        // == (@@) Historical additional cuts for q_min ===
    47584795                        //G4double nc=1.-(dkLS-E-E)/boundM;   // q_min=k-E
    47594796                        G4double nc=1.-(dkLS-E-E+CB+CB)/boundM;   // q_min=k-E+CB
    4760                                                            G4double newl=0.;
     4797                        G4double newl=0.;
    47614798#ifdef pdebug
    47624799                        if(pPrint) G4cout<<"G4Q::CHP:qi_k-E="<<nc<<",k="<<kLS<<",E="<<E
    47634800                                         <<",M="<<boundM<<G4endl;
    47644801#endif
    4765                         if(nc>0.&&nc<1.&&nc<ne)
     4802                        if(nc > 0. && nc < 1. && nc < ne)
    47664803                        {
    47674804                          ne=nc;
    47684805                          newh=pow(nc,cNQ);
    4769                           if(newh<kf) kf=newh;
     4806                          if(newh < kf) kf=newh;
    47704807                        }
    4771                         else if(nc<=0.)kf=0.;
     4808                        else if(nc <= 0.) kf=0.;
    47724809
    47734810                        //G4double nk=1.-(dkd-Em-Em)/boundM;  // q_min=(k-delta)-E*(M-m)/M
     
    47764813                        //               <<",M="<<totMass<<G4endl;
    47774814#endif
    4778                         //if(nk>0.&&nk<1.&&nk<ne)
     4815                        //if(nk > 0. && nk < 1. && nk < ne)
    47794816                        //{
    47804817                        //  ne=nk;
     
    47824819                        //  if(newh<kf) kf=newh;
    47834820                        //}
    4784                         //else if(nk<=0.)kf=0.;
     4821                        //else if(nk <= 0.) kf=0.;
    47854822
    47864823                        //G4double mex=frM+Em;
     
    47914828                        //                <<",M="<<frM<<G4endl;
    47924829#endif
    4793                         //if(np>0.&&np<1.&&np<ne)
     4830                        //if(np > 0. && np < 1. && np < ne)
    47944831                        //{
    47954832                        //  ne=np;
     
    47974834                        //  if(newh<kf) kf=newh;
    47984835                        //}
    4799                         //else if(np<=0.)kf=0.;
     4836                        //else if(np <= 0.) kf=0.;
    48004837
    48014838                        //G4double mix=boundM+E;
     
    48044841                        ////G4double mix=nucBM+E-CB;
    48054842                        G4double st=0.;
    4806                         if(mix>frM) st=sqrt(mix*mix-frM2);
     4843                        if(mix > frM) st=sqrt(mix*mix-frM2);
    48074844                        G4double nq=1.-(dkLS-st-st)/boundM;//qi=k-sq((m+E*(M-m)/M)^2-m^2)
    48084845#ifdef pdebug
     
    48104847                                         <<mix<<",M="<<frM<<G4endl;
    48114848#endif
    4812                         if(nq>0.&&nq<1.&&nq<ne)
    4813                                                                                                                                                                                                 //if(2>3)  // Does not make any difference
     4849                        if(nq > 0. && nq < 1. && nq < ne)
     4850                        //if(2>3)  // Does not make any difference
    48144851                        {
    48154852                          ne=nq;
    48164853                          newh=pow(nq,cNQ);
    4817                           if(newh<kf) kf=newh;
     4854                          if(newh < kf) kf=newh;
    48184855                        }
    48194856                        else if(nq<=0.)kf=0.;
     
    48254862                        //G4bool atrest=(eQ-mQ)/mQ<.001; // Q at rest (only PiCap)
    48264863                        // ***VTN*** CHECK IsNecessety toRecover theColTotRes to MinMassTot
    4827                                                            if(mintM2>rtQ2) //==> Check of ResidualTotalNucleus ** Always **
    4828                                                                                                                                                                                                 //if(2>3)  // Negligable difference difference
     4864                        if(mintM2>rtQ2) //==> Check of ResidualTotalNucleus ** Always **
     4865                        //if(2>3)  // Negligable difference difference
    48294866                        {
    48304867                          G4double nz=0.;
    4831                                                                     if(atrest) nz=1.-(mintM2-rtQ2+pmk*dked)/(boundM*(rtEP+pmk));
     4868                          if(atrest) nz=1.-(mintM2-rtQ2+pmk*dked)/(boundM*(rtEP+pmk));
    48324869                          else       nz=1.-(mintM2-rtQ2)/(boundM*rtEP);
    4833                                                                     //if(atrest) nz=1.-(mintM2-rtQ2+pmk*dkd)/(nucBM*(rtEP+pmk));
     4870                          //if(atrest) nz=1.-(mintM2-rtQ2+pmk*dkd)/(nucBM*(rtEP+pmk));
    48344871                          //else       nz=1.-(mintM2-rtQ2)/(nucBM*rtEP);
    48354872#ifdef pdebug
     
    48374874                                           <<mintM2<<">"<<rtQ2<<G4endl;
    48384875#endif
    4839                           if(nz>0.&&nz<1.&&nz<ne)
     4876                          if(nz > 0. && nz < 1. && nz < ne)
    48404877                          {
    48414878                            ne=nz;
    48424879                            newh=pow(nz,cNQ);
    4843                             if(newh<kf) kf=newh;
     4880                            if(newh < kf) kf=newh;
    48444881                          }
    4845                           else if(nz<=0.)kf=0.;
     4882                          else if(nz <= 0.) kf=0.;
    48464883                        }
    48474884                        // *** VBQ *** CHECK Residual Quazmon (Never use: reduces PS)
    4848                                                            //if(minBM2>rQ2&&!piF&&!gaF&&baryn>3) // ==>Check ResidVirtualQuasm
    4849                                                            //if(minBM2>rQ2&&!piF&&!gaF&&baryn>2) // ==>Check ResidVirtualQuasm
     4885                        //if(minBM2>rQ2&&!piF&&!gaF&&baryn>3) // ==>Check ResidVirtualQuasm
     4886                        //if(minBM2>rQ2&&!piF&&!gaF&&baryn>2) // ==>Check ResidVirtualQuasm
    48504887                        //if(minBM2>rQ2&&!piF&&!gaF) // ==> Check of ResidualVirtualQuasmon
    4851                                                            //if(minBM2>rQ2&&baryn>2)//==>Check of ResidualVirtualQuasmon**OK**
    4852                                                            //if(minBM2>rQ2&&baryn>1)//==>Check ResidualVirtualQuasm **Better**
    4853                                                            //if(minBM2>rQ2&&piF&&(cPDG==90000001||cPDG==90002002))//CheckRVirQ
    4854                                                            //if(minBM2>rQ2&&piF&&(cPDG==90000001||baryn>3))//CheckResidVirtQua
    4855                                                            //if(minBM2>rQ2&&(piF&&cPDG==90000001||baryn>2))//CheckResidVirtQua
    4856                                                            //if(minBM2>rQ2&&baryn>2) // ==> Check of Residual Virtual Quasmon
    4857                                                            //if(minBM2>rQ2&&!piF&&baryn>2&&cPDG!=90001002)//ResidVirtQuasmon
    4858                                                            //if(minBM2>rQ2&&!piF&&baryn>2)//==>Check of ResidualVirtualQuasmon
    4859                                                            //if(minBM2>rQ2&&!piF&&baryn>3)//==>Check of ResidualVirtualQuasmon
    4860                                                            //if(minBM2>rQ2&&!piF&&baryn>1)//==>Check of ResidualVirtualQuasmon
    4861                                                            //if(minBM2>rQ2&&!piF&&!gaF)// ==> Check of ResidualVirtualQuasmon
    4862                                                            //if(minBM2>rQ2&&!piF)// ==> Check of ResidualVirtualQuasmon ALWAYS
    4863                                                            //if(minBM2>rQ2&&piF&&baryn>3)//==>Check of ResidualVirtualQuasmon
    4864                                                            //if(minBM2>rQ2&&piF&&(baryn==1||baryn>2))//==>Check ResidVirtQ
    4865                                                            //if(minBM2>rQ2&&(!piF||piF&&(cPDG!=90000001||G4UniformRand()<.5)))
    4866                                                            //if(minBM2>rQ2&&(!piF||piF&&(cPDG!=90000001)))
     4888                        //if(minBM2>rQ2&&baryn>2)//==>Check of ResidualVirtualQuasmon**OK**
     4889                        //if(minBM2>rQ2&&baryn>1)//==>Check ResidualVirtualQuasm **Better**
     4890                        //if(minBM2>rQ2&&piF&&(cPDG==90000001||cPDG==90002002))//CheckRVirQ
     4891                        //if(minBM2>rQ2&&piF&&(cPDG==90000001||baryn>3))//CheckResidVirtQua
     4892                        //if(minBM2>rQ2&&(piF&&cPDG==90000001||baryn>2))//CheckResidVirtQua
     4893                        //if(minBM2>rQ2&&baryn>2) // ==> Check of Residual Virtual Quasmon
     4894                        //if(minBM2>rQ2&&!piF&&baryn>2&&cPDG!=90001002)//ResidVirtQuasmon
     4895                        //if(minBM2>rQ2&&!piF&&baryn>2)//==>Check of ResidualVirtualQuasmon
     4896                        //if(minBM2>rQ2&&!piF&&baryn>3)//==>Check of ResidualVirtualQuasmon
     4897                        //if(minBM2>rQ2&&!piF&&baryn>1)//==>Check of ResidualVirtualQuasmon
     4898                        //if(minBM2>rQ2&&!piF&&!gaF)// ==> Check of ResidualVirtualQuasmon
     4899                        //if(minBM2>rQ2&&!piF)// ==> Check of ResidualVirtualQuasmon ALWAYS
     4900                        //if(minBM2>rQ2&&piF&&baryn>3)//==>Check of ResidualVirtualQuasmon
     4901                        //if(minBM2>rQ2&&piF&&(baryn==1||baryn>2))//==>Check ResidVirtQ
     4902                        //if(minBM2>rQ2&&(!piF||piF&&(cPDG!=90000001||G4UniformRand()<.5)))
     4903                        //if(minBM2>rQ2&&(!piF||piF&&(cPDG!=90000001)))
    48674904                        //if(minBM2>rQ2&&(!piF&&baryn>4 || piF && cPDG!=90000001 &&
    4868                         if (minBM2 > rQ2 &&
    4869                             (!piF ||
    4870                             (piF &&
    4871                              cPDG != 90000001 &&
    4872                              cPDG != 90001001 &&
    4873                              cPDG != 90001002) ) )     
    4874                                                            //if(minBM2>rQ2) // ==> Check of Residual (Virtual?) Quasmon
    4875                                                            //if(2>3)
     4905                        if (minBM2 > rQ2 &&
     4906                             ( !piF ||
     4907                               ( piF
     4908                                 && cPDG != 90000001
     4909                                 &&  cPDG != 90001001
     4910                                 &&  cPDG != 90001002
     4911                               )
     4912                             )
     4913                           )     
     4914                        //if(minBM2>rQ2) // ==> Check of Residual (Virtual?) Quasmon
     4915                        //if(2>3)
    48764916                        {
    48774917                          G4double nz=0.;
     
    48804920                          //if(atrest) nz=1.-(minBM2-rQ2+pmk*dkd)/(nucBM*(rEP+pmk));
    48814921                          //else       nz=1.-(minBM2-rQ2)/(nucBM*rEP);
    4882 #ifdef pdebug            
     4922#ifdef pdebug   
    48834923                          if(pPrint) G4cout<<"G4Q::CHP:q="<<nz<<",a="<<atrest<<",QM2="
    48844924                                           <<minM2<<">"<<rQ2<<G4endl;
    4885 #endif                           
     4925#endif     
    48864926                          if(nz>0.&&nz<1.&&nz<ne)
    48874927                          {
     
    48934933                        }
    48944934                        // *** VRQ *** CHECK Min Residual Quazmon (Never use: reduces PS)
    4895                                                            //if(minM2>rQ2&&baryn>3)       // ==> Check of Residual Quasmon
    4896                                                            //if(minM2>rQ2&&!piF&&!gaF&&baryn>3)// ==> Check of ResidualQuasmon
    4897                                                            //if(minM2>rQ2&&!piF&&baryn>1)      // ==> Check of ResidualQuasmon
    4898                                                            //if(minM2>rQ2&&!piF&&baryn>2)      // ==> Check of ResidualQuasmon
    4899                                                            //if(minM2>rQ2&&!piF&&baryn>2&&cPDG!=90001002)//=>CheckResidQuasmon
    4900                                                            //if(minM2>rQ2&&!piF&&baryn>3) // ==> Check Residual Quasmon **OK**
    4901                                                            //if(minM2>rQ2&&!piF&&!gaF)       // ==> Check of Residual Quasmon
    4902                                                            //if(minM2>rQ2&&!piF)       // ==> Check of Residual Quasmon
    4903                                                            //if(minM2>rQ2&&piF)       // ==> Check of Residual Quasmon
    4904                                                            //if(minM2>rQ2&&baryn>1) // ==> Check Residual Quasmon **Better**
    4905                                                            //if(minM2>rQ2&&(baryn>1||!piF))//==>CheckResidualQuasmon**Better**
    4906                                                            //if(minM2>rQ2&&baryn>1&&cPDG!=90002002) //==> CheckResidualQuasmon
    4907                                                            //if(minM2>rQ2&&!piF) // ==> Check of Residual Quasmon
    4908                                                            //if(minM2>rQ2&&baryn>3) //=>CheckResidQuasmon *** The Best ***
    4909                                                            //if(minM2>rQ2 && (!piF || piF &&
     4935                        //if(minM2>rQ2&&baryn>3)       // ==> Check of Residual Quasmon
     4936                        //if(minM2>rQ2&&!piF&&!gaF&&baryn>3)// ==> Check of ResidualQuasmon
     4937                        //if(minM2>rQ2&&!piF&&baryn>1)      // ==> Check of ResidualQuasmon
     4938                        //if(minM2>rQ2&&!piF&&baryn>2)      // ==> Check of ResidualQuasmon
     4939                        //if(minM2>rQ2&&!piF&&baryn>2&&cPDG!=90001002)//=>CheckResidQuasmon
     4940                        //if(minM2>rQ2&&!piF&&baryn>3) // ==> Check Residual Quasmon **OK**
     4941                        //if(minM2>rQ2&&!piF&&!gaF)       // ==> Check of Residual Quasmon
     4942                        //if(minM2>rQ2&&!piF)       // ==> Check of Residual Quasmon
     4943                        //if(minM2>rQ2&&piF)       // ==> Check of Residual Quasmon
     4944                        //if(minM2>rQ2&&baryn>1) // ==> Check Residual Quasmon **Better**
     4945                        //if(minM2>rQ2&&(baryn>1||!piF))//==>CheckResidualQuasmon**Better**
     4946                        //if(minM2>rQ2&&baryn>1&&cPDG!=90002002) //==> CheckResidualQuasmon
     4947                        //if(minM2>rQ2&&!piF) // ==> Check of Residual Quasmon
     4948                        //if(minM2>rQ2&&baryn>3) //=>CheckResidQuasmon *** The Best ***
     4949                        //if(minM2>rQ2 && (!piF || piF &&
    49104950                        //if(minM2>rQ2 && (!piF&&baryn>3 || piF &&
    4911 
    4912                         if (minM2 > rQ2 &&
    4913                             ( (!piF && baryn > 4) ||
    4914                               (piF &&
    4915                               (cPDG != 90000001 || G4UniformRand() > .3333333) &&
    4916                                cPDG != 90001001) ) )
    4917                             //cPDG!=90001001) )
    4918                             //if(minM2>rQ2)            // ==> Check of Residual Quasmon
    4919                             //if(2>3)
     4951                        if ( minM2 > rQ2 &&
     4952                             ( (!piF && baryn > 4) ||
     4953                               (piF && (cPDG != 90000001 || G4UniformRand() > .3333333) &&
     4954                                cPDG != 90001001)
     4955                             )
     4956                          )
     4957                        //cPDG!=90001001) )
     4958                        //if(minM2>rQ2)            // ==> Check of Residual Quasmon
     4959                        //if(2>3)
    49204960                        {
    49214961                          G4double nz=0.;
     
    50725112                        curParC->SetNQPart2(cNQ);  // Keep #of quark-partons in theFragment
    50735113#ifdef sdebug
    5074                                             G4cout<<"G4Q::CalcHP: FillParentClaster="<<*curParC<<G4endl;
     5114                        G4cout<<"G4Q::CalcHP: FillParentClaster="<<*curParC<<G4endl;
    50755115#endif
    50765116                        curCand->FillPClustVec(curParC);//FillParentClust to ParClVec(d.e.)
    50775117                        comb += probab;
    50785118#ifdef pdebug
    5079                                             if(pPrint) G4cout<<"G4Q::CHP:in="<<index<<",cPDG="<<cPDG<<",pc"<<pc
     5119                        if(pPrint) G4cout<<"G4Q::CHP:in="<<index<<",cPDG="<<cPDG<<",pc"<<pc
    50805120                                         <<parQC<<",Env="<<theEnvironment<<",comb="<<comb
    50815121                                         <<",posib="<<parCand->GetParPossibility()<<G4endl;
    50825122#endif
    50835123                        pc++;
    5084                                                          }
    5085                                                 }
     5124                      }
     5125                    }
    50865126#ifdef sdebug
    5087                                                 else G4cout<<"***G4Q::CHP:dI="<<dI<<",cC="<<cC<<G4endl;
    5088 #endif
    5089                                               }
    5090                                      }                             // >>>> End of if of QuarkExchangePossibility
    5091                                    }                               // +++> End of if of existinr residual Q Code
     5127                    else G4cout<<"***G4Q::CHP:dI="<<dI<<",cC="<<cC<<G4endl;
     5128#endif
     5129                  }
     5130                }                             // >>>> End of if of QuarkExchangePossibility
     5131              }                               // +++> End of if of existinr residual Q Code
    50925132              probability+=comb;              // Collect the probability for the fragment
    50935133#ifdef pdebug
    5094                            if(pPrint) G4cout<<"G4Q::CHPr: probab="<<probability<<"("<<comb<<"),iq="<<iq
     5134              if(pPrint) G4cout<<"G4Q::CHPr: probab="<<probability<<"("<<comb<<"),iq="<<iq
    50955135                               <<",oq="<<oq<<G4endl;
    50965136#endif
    5097                           }                                 // ...> End of Quark Exchange "oq" Test LOOP
    5098                         }                                   // ...> End of Quark Exchange "iq" Test LOOP
    5099                }                                     // ---> End of Nuclear Case of fragmentation
     5137            }                                 // ...> End of Quark Exchange "oq" Test LOOP
     5138          }                                   // ...> End of Quark Exchange "iq" Test LOOP
     5139        }                                     // ---> End of Nuclear Case of fragmentation
    51005140        else if(cPDG<80000000)                // ===> Hadron case (QUark FUsion mechanism)
    51015141        {
     
    51115151            if (curhPDG== 211) npip++;
    51125152            if (curhPDG==-211) npin++;
    5113                         }
    5114                         // End of the hadron counting
     5153          }
     5154          // End of the hadron counting
    51155155          comb = valQ.NOfCombinations(candQC);
    51165156          if(!comb)
     
    51635203          if (comb && resPDG && totMass > frM-CB+resTM &&
    51645204             ((resPDG > 80000000 && resPDG != 90000000) || resPDG<10000) )
    5165           {
     5205   {
    51665206#ifdef pdebug
    51675207            if(priCon) G4cout<<"G4Q::CHP:ind="<<index<<",qQC="<<valQ<<mQ<<",cPDG="<<cPDG
     
    51965236#endif
    51975237            if(resM>0. && resQCode>-2)
    5198                    {
     5238            {
    51995239              G4double limM=mQ-resM;
    52005240              G4double rndM=GetRandomMass(cPDG,limM);// Candidate's Mass randomization
     
    52025242              G4double cMass=G4QPDGCode(cPDG).GetMass();
    52035243              if(aPDG<10000&&aPDG%10<3)
    5204                                    //if(aPDG<10000&&aPDG%10<5)
    5205                                    G4cout<<"G4Q::CHP:rndM="<<rndM<<",limM="<<limM<<" > cM="<<cMass<<" ,rM+fM="
     5244              //if(aPDG<10000&&aPDG%10<5)
     5245              G4cout<<"G4Q::CHP:rndM="<<rndM<<",limM="<<limM<<" > cM="<<cMass<<" ,rM+fM="
    52065246                    <<resM+rndM<<" < mQ="<<mQ<<G4endl;
    52075247#endif
    52085248              // --- Kinematical Factors ---
    52095249              if(rndM>0. && resM+rndM<mQ)
    5210                      {
     5250              {
    52115251                curCand->SetEBMass(rndM);   // Set RandomizedEnvBoundMass of the Candidate
    52125252                curCand->SetNBMass(rndM);   // Set RandomizedNotBoundMass of the Candidate
     
    52195259                //zMin= mR2/mQ/(mQ-dk);       // z_min for Quasmon-Baryon @@ ?? @@
    52205260                if(qBar) zMin= mR2/mQ/(mQ-dk);       // z_min for Quasmon-Baryon @@ ?? @@
    5221                                      G4double possibility=zMax-zMin;
     5261                G4double possibility=zMax-zMin;
    52225262#ifdef pdebug
    52235263                if(priCon) G4cout<<"G4Q::CHP:M="<<rndM<<",ps="<<possibility<<",zMax="<<zMax
     
    52265266#endif
    52275267                if (resPDG==10)                      // Chipolino case - check minimum
    5228                               {
     5268                {
    52295269                  G4double rM2 = mQk*(mQ-rHk);
    52305270                  if(rM2<resM*resM) possibility = 0.;
    52315271                }
    52325272                if (possibility>0. && vap>0 && zMax>zMin)
    5233                        {
     5273                {
    52345274                  probability = vaf*(pow(zMax, vap)-pow(zMin, vap));
    52355275#ifdef pdebug
     
    52495289                  {
    52505290                    if(cPDG==110||cPDG==220||cPDG==330) probability*=comb; // f0 has spin 0
    5251                                          else probability*=comb*(abs(cPDG)%10); // Spin of resonance
    5252                                               }
    5253                        }
     5291                    else probability*=comb*(abs(cPDG)%10); // Spin of resonance
     5292                  }
     5293                }
    52545294              }
    52555295              else
    5256                             {
     5296              {
    52575297#ifdef pdebug
    52585298                if(priCon) G4cout<<"G4Q::CHP:cM=0[cPDG"<<cPDG<<"],mQ/QC="<<mQ<<valQ<<",rM="
     
    52605300#endif
    52615301              }
    5262                    }
     5302            }
    52635303            else
    5264                    {
     5304            {
    52655305#ifdef pdebug
    52665306              if(priCon) G4cout<<"***G4Q::CHP: M=0, #"<<index<<valQ<<",cPDH="<<cPDG<<"+rP="
    52675307                               <<resPDG<<curQ<<G4endl;
    52685308#endif
    5269                    }
     5309            }
    52705310          }
    52715311          else
    5272                  {
     5312          {
    52735313            probability=0.;
    52745314#ifdef pdebug
     
    52775317                             <<"+rTM="<<resTM<<"-CB="<<CB<< G4endl;
    52785318#endif
    5279                  }
     5319          }
    52805320          //if(cPDG==111) secondProbab = 1.;
    52815321        }// ---> End of Hadronic Case of fragmentation
     
    53445384#endif
    53455385    if(bsCond)                           // Decay rignht away in Fragment & residual
    5346            {
     5386    {
    53475387      G4QContent fragmQC=protQC;
    5348              G4double fragmM=mProt;
     5388      G4double fragmM=mProt;
    53495389      if(bsCond==2112)
    5350              {
     5390      {
    53515391        fragmQC=neutQC;
    5352                fragmM=mNeut;
    5353              }
     5392        fragmM=mNeut;
     5393      }
    53545394      else if(bsCond==3122)
    5355              {
     5395      {
    53565396        fragmQC=lambQC;
    5357                fragmM=mLamb;
    5358              }
     5397        fragmM=mLamb;
     5398      }
    53595399      else if(bsCond==90001001)
    5360              {
     5400      {
    53615401        fragmQC=deutQC;
    5362                fragmM=mDeut;
    5363              }
     5402        fragmM=mDeut;
     5403      }
    53645404      else if(bsCond==90002002)
    5365              {
     5405      {
    53665406        fragmQC=alphQC;
    5367                fragmM=mAlph;
    5368              }
     5407        fragmM=mAlph;
     5408      }
    53695409      G4QContent rsQC=valQ-fragmQC;
    53705410      G4QNucleus rsQN(rsQC);              // TemporaryNucleus for the ResidualVacuumQuasmon
     
    53815421        FillHadronVector(fragH);          // Fill ResidQuasmHadron (delete equivalent)
    53825422        return true;
    5383              }
     5423      }
    53845424      else
    5385              {
     5425      {
    53865426        delete quasH;
    53875427        delete fragH;
    5388              }
     5428      }
    53895429    }
    53905430  }
     
    54025442    G4QHadron*  theLast = theQHadrons[nOfOUT-1];
    54035443    if(!(theLast->GetNFragments()) && theLast->GetPDGCode()!=22)//NotDecayedHadron & NotGam
    5404            {
     5444    {
    54055445      G4LorentzVector hadr4M=theLast->Get4Momentum();
    54065446      G4double  hadrMa=hadr4M.m();        // Mass of the Last hadron (==GSMass)
    54075447      G4LorentzVector tmpTLV=reTLV+hadr4M;// Tot (ResidNucl+LastHadron) 4-Mom
    54085448#ifdef pdebug
    5409              G4cout<<"G4Q::CheckGS:YES,T="<<tmpTLV<<tmpTLV.m()<<">rM+hM="<<resSMa+hadrMa<<G4endl;
     5449      G4cout<<"G4Q::CheckGS:YES,T="<<tmpTLV<<tmpTLV.m()<<">rM+hM="<<resSMa+hadrMa<<G4endl;
    54105450#endif
    54115451      if(tmpTLV.m()>resSMa+hadrMa)        // resMa contains 2 Hadrons: resQ and Environ
     
    54305470            FillHadronVector(quasH);              // Fill ResidQuasm Hadron (del.equiv.)
    54315471            theLast->Set4Momentum(hadr4M);
    5432                         }
    5433                }
     5472          }
     5473        }
    54345474        else                                      //=>"The Env is vacuum" case (DecayIn2)
    54355475        {
     
    54485488            quasH->Set4Momentum(quas4M);
    54495489            FillHadronVector(quasH);              // Fill ResidQuasmHadron (del.equivalent)
    5450                         }
    5451                }
     5490          }
     5491        }
    54525492      }
    54535493      else                                        // "CORRECTION" !!!!
    54545494      {
    54555495        if(nOfOUT>1 && corFlag)
    5456                {
     5496        {
    54575497          G4QHadron*  thePrev = theQHadrons[nOfOUT-2];// Get pointer to prev-before-lastHad
    54585498          if(thePrev->GetNFragments()||thePrev->GetPDGCode()==22)return false;//DecH or Gam
     
    54655505          G4double   totNMa=tmpTLV.m();                   // RealMass of TotResidualNucleus
    54665506#ifdef pdebug
    5467                  G4cout<<"G4Q::CheckGS:NO, M="<<tmpTLV<<totNMa<<">"<<totQMa+hadrMa+prevMa<<G4endl;
     5507          G4cout<<"G4Q::CheckGS:NO, M="<<tmpTLV<<totNMa<<">"<<totQMa+hadrMa+prevMa<<G4endl;
    54685508#endif
    54695509          if(totNMa>totQMa+hadrMa+prevMa)
     
    54845524              thePrev->Set4Momentum(prev4M);
    54855525#ifdef pdebug
    5486                   G4cout<<"G4Q::CheckGS: Yes, Check D4M="<<tmpTLV-hadr4M-prev4M-nuc4M<<G4endl;
    5487 #endif
    5488                    }
    5489                         }
     5526           G4cout<<"G4Q::CheckGS: Yes, Check D4M="<<tmpTLV-hadr4M-prev4M-nuc4M<<G4endl;
     5527#endif
     5528            }
     5529          }
    54905530          else                                         // Decay in one hadron, absorb other
    5491                         {
     5531          {
    54925532            G4QContent tmpLNQ=totQC+thePrev->GetQC();
    54935533            G4int    resLPDG =tmpLNQ.GetSPDGCode();
     
    54985538            //////G4bool    which = true;          // LastH is absorbed, PrevH is radiated
    54995539#ifdef pdebug
    5500                    G4cout<<"G4Quasm::CheckGS: NO, tM="<<totNMa<<" > rp+l="<<resLastM+hadrMa
     5540            G4cout<<"G4Quasm::CheckGS: NO, tM="<<totNMa<<" > rp+l="<<resLastM+hadrMa
    55015541                  <<" || > rl+p="<<resPrevM+prevMa<<G4endl;
    55025542#endif
    55035543            if      (totNMa>resLastM+hadrMa)       // "Just exclude the Prev" case
    5504                           {
     5544            {
    55055545              theQHadrons.pop_back();              // theLast* is excluded from OUTPUT HV
    55065546              theQHadrons.pop_back();              // thePrev* is excluded from OUTPUT HV
     
    55115551              resPrevM=resLastM;
    55125552              prev4M  = hadr4M;
    5513                           }
     5553            }
    55145554            else if (totNMa>resPrevM+prevMa)              // "Just exclude the Last" case
    5515                           {
     5555            {
    55165556              theQHadrons.pop_back();
    55175557              delete theLast;
    5518                           }
     5558            }
    55195559            else return false;
    55205560            G4LorentzVector nuc4M = G4LorentzVector(0.,0.,0.,resPrevM);//ResNucl4m to PrevH
     
    55325572              thePrev->Set4Momentum(prev4M);
    55335573#ifdef pdebug
    5534                      G4cout<<"G4Q::CheckGS:Yes, Check D4M="<<tmpTLV-prev4M-nuc4M<<G4endl;
    5535 #endif
    5536                    }
    5537                         }
    5538                }
     5574              G4cout<<"G4Q::CheckGS:Yes, Check D4M="<<tmpTLV-prev4M-nuc4M<<G4endl;
     5575#endif
     5576            }
     5577          }
     5578        }
    55395579        else return false;
    55405580      }
    5541            }
     5581    }
    55425582    else return false;
    55435583  }
     
    55665606    G4int i=0;
    55675607    if(nChan>1)
    5568            {
     5608    {
    55695609      G4double rnd = G4UniformRand();            // Random value to select a Decay Channel
    55705610      for(i=0; i<nChan; i++)
    5571              {
     5611      {
    55725612        G4QDecayChan* dC = decV[i];              // The i-th Decay Channel
    55735613#ifdef pdebug
     
    55765616#endif
    55775617        if(rnd<dC->GetDecayChanLimit() && m>dC->GetMinMass()) break;
    5578              }
     5618      }
    55795619      if(i>nChan-1) i=nChan-1;
    5580            }
     5620    }
    55815621    G4QPDGCodeVector cV=decV[i]->GetVecOfSecHadrons();// PDGVector of theSelectedDecChannel
    55825622    G4int nPart=cV.size();                         // A#of particles to decay in
    55835623#ifdef pdebug
    5584            G4cout<<"G4Quasmon::DecayQHadron: resi="<<i<<",nP="<<nPart<<":"<<cV[0]->GetPDGCode()
     5624    G4cout<<"G4Quasmon::DecayQHadron: resi="<<i<<",nP="<<nPart<<":"<<cV[0]->GetPDGCode()
    55855625          <<","<<cV[1]->GetPDGCode();
    55865626    if(nPart>2) G4cout<<","<<cV[2]->GetPDGCode();
     
    55915631      G4cerr<<"---Warning---G4Q::DecayQHadr:n="<<nPart<<",ch#"<<i<<",PDG="<<thePDG<<G4endl;
    55925632      return false;
    5593            }
     5633    }
    55945634#ifdef pdebug
    55955635    G4cout<<"G4Q::DecQH:Decay("<<ElMaDecays<<") PDG="<<thePDG<<t<<m<<",nP="<<nPart<<G4endl;
    55965636#endif
    55975637    if(nPart==2)
    5598            {
     5638    {
    55995639      G4QHadron* fHadr;
    56005640      G4QHadron* sHadr;
     
    56075647#endif
    56085648        if(cV[0]->GetWidth()==0.)
    5609                { // Randomize only the second Hardon or none
     5649        { // Randomize only the second Hardon or none
    56105650          fHadr = new G4QHadron(cV[0]->GetPDGCode());   // the First Hadron is created *1*
    56115651          if(cV[1]->GetWidth()==0.)sHadr = new G4QHadron(sPDG);//theSecondHadron is created
    56125652          else
    5613                         {
     5653          {
    56145654            G4QParticle* sPart=theWorld->GetQParticle(cV[1]);// Pt for theSecondHadron
    56155655            G4double sdm = m - fHadr->GetMass();        // MaxMassLimit for the 2-nd Hadron
     
    56175657            if(sPDG<0) sHadr->MakeAntiHadron();
    56185658          }
    5619                }
     5659        }
    56205660        else                                              // Randomize masses ofBothHadrons
    5621                {
     5661        {
    56225662          G4QParticle* sPart=theWorld->GetQParticle(cV[1]);// Pt for theSecondHadron
    56235663          G4double mim = sPart->MinMassOfFragm();         // MinMassLimit for theSecondHadr
     
    56505690          delete sHadr;                                   // Delete "new sHadr"
    56515691          G4cerr<<"---Warning---G4Q::DecayQHadron:in2,PDGC="<<thePDG<<", ch#"<<i<<": 4M="
    5652                                                                                                     <<qH->Get4Momentum()<<"("<<qH->GetMass()<<")->"<<f4Mom<<"+"<<s4Mom<<G4endl;
     5692                <<qH->Get4Momentum()<<"("<<qH->GetMass()<<")->"<<f4Mom<<"+"<<s4Mom<<G4endl;
    56535693          //throw G4QException("***Exception***G4Q::DecayQHadron: Failed to decay in 2");
    56545694          theFragments->push_back(qH);                    // Fill as it is (del.equiv.)
    56555695          return theFragments;
    5656                }
     5696        }
    56575697        else
    56585698        {
     
    56695709#endif
    56705710          if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);// Final = no Further Decay
    5671                                                                                 else for(G4int ip1=0; ip1<nProd; ip1++)
     5711          else for(G4int ip1=0; ip1<nProd; ip1++)
    56725712          {
    56735713            G4QHadronVector* intTmpQHV = DecayQHadron((*theTmpQHV)[ip1]);
     
    56945734#endif
    56955735          if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);// Final = no Further Decay
    5696                                                                                 else for(G4int ip1=0; ip1<nProd; ip1++)
     5736          else for(G4int ip1=0; ip1<nProd; ip1++)
    56975737          {
    56985738            G4QHadronVector* intTmpQHV = DecayQHadron((*theTmpQHV)[ip1]);
     
    57165756        G4cout<<"G4Q::DecQHadr: DecayIn2 is made with nH="<<theFragments->size()<<G4endl;
    57175757#endif
    5718              }
     5758      }
    57195759      else
    57205760      {
     
    57235763#endif
    57245764        theFragments->push_back(qH);               // Fill hadron as it is (del.equivalent)
    5725              }
     5765      }
    57265766    }
    57275767    else if(nPart==3)
    5728            {
     5768    {
    57295769      G4QHadron* fHadr;
    57305770      G4QHadron* sHadr;
     
    57405780#endif
    57415781        if(cV[0]->GetWidth()==0.)                        // Don't randomize theFirstHardon
    5742                {
     5782        {
    57435783          fHadr = new G4QHadron(fPDG);                   // theFirst Hadron is created  *1*
    57445784          if(cV[1]->GetWidth()==0.)
     
    57475787            if(cV[2]->GetWidth()==0.)tHadr = new G4QHadron(tPDG);//theThirdHadron isCreated
    57485788            else
    5749                           {
     5789            {
    57505790              G4QParticle* tPart=theWorld->GetQParticle(cV[2]);// Pt for the3-rdH
    57515791              G4double tdm = m-fHadr->GetMass()-sHadr->GetMass();// MaxMass for the 2d Hadr
    57525792              tHadr = new G4QHadron(tPart,tdm);                  //the3rdHadron is created
    57535793              if(tPDG<0) tHadr->MakeAntiHadron();
    5754                           }
     5794            }
    57555795          }
    57565796          else                                              // Randomize 2nd & 3rd Hadrons
    5757                         {
     5797          {
    57585798            m-=fHadr->GetMass();                            // Reduce the residual MaxMass
    57595799            G4QParticle* tPart=theWorld->GetQParticle(cV[2]);// Pt for the 3-rd Hadron
     
    57675807            if(tPDG<0) tHadr->MakeAntiHadron();
    57685808          }
    5769                }
     5809        }
    57705810        else  // Randomize masses of all three Hadrons
    5771                {
     5811        {
    57725812          G4QParticle* sPart=theWorld->GetQParticle(cV[1]);//Pt for theSecondHadr
    57735813          G4double smim = sPart->MinMassOfFragm();        // MinMassLim for theSecondHadron
     
    58075847          theFragments->push_back(qH);             // Fill as it is (delete equivalent)
    58085848          return false;
    5809                }
     5849        }
    58105850        else
    58115851        {
     
    58225862#endif
    58235863          if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);// Final = no Further Decay
    5824                                                                                 else for(G4int ip1=0; ip1<nProd; ip1++)
     5864          else for(G4int ip1=0; ip1<nProd; ip1++)
    58255865          {
    58265866            G4QHadronVector* intTmpQHV = DecayQHadron((*theTmpQHV)[ip1]);
     
    58485888#endif
    58495889          if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);// Final = no Further Decay
    5850                                                                                 else for(G4int ip1=0; ip1<nProd; ip1++)
     5890          else for(G4int ip1=0; ip1<nProd; ip1++)
    58515891          {
    58525892            G4QHadronVector* intTmpQHV = DecayQHadron((*theTmpQHV)[ip1]);
     
    58745914#endif
    58755915          if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);// Final = no Further Decay
    5876                                                                                 else for(G4int ip1=0; ip1<nProd; ip1++)
     5916          else for(G4int ip1=0; ip1<nProd; ip1++)
    58775917          {
    58785918            G4QHadronVector* intTmpQHV = DecayQHadron((*theTmpQHV)[ip1]);
     
    58975937        G4cout<<"G4Q::DecQHadr: DecayIn3 is made with nH="<<theFragments->size()<<G4endl;
    58985938#endif
    5899              }
     5939      }
    59005940      else theFragments->push_back(qH);            // Fill hadron as it is (del.equivalent)
    59015941    }
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QuasmonString.cc

    r1007 r1055  
    2828//
    2929//
    30 // $Id: G4QuasmonString.cc,v 1.7 2006/11/27 10:44:55 mkossov Exp $
    31 // GEANT4 tag $Name: geant4-09-02 $
     30// $Id: G4QuasmonString.cc,v 1.8 2009/02/23 09:49:24 mkossov Exp $
     31// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3232//
    3333//      ---------------- G4QuasmonString ----------------
    3434//             by Mikhail Kossov, August 2000.
    3535//  class for Hadron-Hadron String Interaction used by the CHIPS Model
     36// -------------------------------------------------------------------
     37// Short description: The Quark-Gluon String can fragment in hadrons
     38// (QGS), small hadronic clusters (HERWIG) or in unlimited in mass
     39// Quasmons, defined by the G4QPartonPair. This class is made to
     40// simulate the string fragmentation in Quasmons, which hadronize in
     41// vacuuum or in nuclear environment.
    3642// -------------------------------------------------------------------
    3743 
     
    7177  theWorld= G4QCHIPSWorld::Get();             // Get a pointer to the CHIPS World
    7278#ifdef debug
    73   G4cout<<"-->G4QString::Constr:pPDG="<<projHadron.GetPDGCode()<<",tPDG="<<targPDG<<G4endl;
     79  G4cout<<"-->G4QuasStr::Constr:pPDG="<<projHadron.GetPDGCode()<<",tPDG="<<targPDG<<G4endl;
    7480#endif
    7581  // Target initialization
     
    8490  // Projectile initialization
    8591  theProj4Mom = projHadron.Get4Momentum();
    86                 G4ThreeVector projBoost = theProj4Mom.boostVector(); // Projectile BoostVector to LS
     92  G4ThreeVector projBoost = theProj4Mom.boostVector(); // Projectile BoostVector to LS
    8793  G4ThreeVector projRBoost= -projBoost;       // Projevtile Boost vector to projectile CMS
    8894  G4QPDGCode projQPDG(projHadron.GetPDGCode());
     
    97103  G4double tM2 = tM*tM;
    98104  G4double dM2 = fabs(pM2-projM2);
    99   if(dM2>1.) G4cout<<"-Wor-G4QS::Constr:dM2="<<dM2<<",M2="<<projM2<<",LVM2="<<pM2<<G4endl;
     105  if(dM2>1.) G4cout<<"-Wor-G4QuStr::Cons:dM2="<<dM2<<",M2="<<projM2<<",LVM2="<<pM2<<G4endl;
    100106  G4double pM=sqrt(pM2);                     // @@ do we need pM ? @@ (in print)
    101107
    102108  // === Print out of the input information at Creation time & tot 4-mom Calculation ======
    103109#ifdef pdebug
    104   G4cout<<"G4QS::Cons:PQC="<<theProjQC<<",TQC="<<theTargQC<<",P4Mom="<<theProj4Mom<<
    105                                 theProj4Mom.m2()<<theProj4Mom.m()<<G4endl;
    106   G4cout<<"G4QStr::Constr: tC="<<totCharge<<",tB="<<totBaryNum<<",tot4M="<<tot4Mom<<G4endl;
     110  G4cout<<"G4QuaString::Cons:PQC="<<theProjQC<<",TQC="<<theTargQC<<",P4Mom="<<theProj4Mom<<
     111    theProj4Mom.m2()<<theProj4Mom.m()<<G4endl;
     112  G4cout<<"G4QuaString::C: tC="<<totCharge<<",tB="<<totBaryNum<<",tot4M="<<tot4Mom<<G4endl;
    107113#endif
    108114  //G4int nP=theWorld->GetQPEntries();       // A#of init'ed particles in CHIPS World (@@?)
    109115  //G4int nCl=nP-90;                          // A#of init'ed clusters in CHIPS World (@@?)
    110                 //#ifdef pdebug
     116  //#ifdef pdebug
    111117  //G4cout<<"G4QS:Const:Before QEX:n="<<nP<<G4endl;
    112                 //#endif
     118  //#endif
    113119  // @@@@@@ ===> Here the Quark Exchange Quasmon Creation must be added <=== @@@@@@
    114120  // @@ --- old ---
     
    136142  // @@ --- end ---
    137143#ifdef pdebug
    138   G4cout<<"G4QStr::Constr: nP="<<nQProj<<", nT="<<nQTarg<<G4endl;
     144  G4cout<<"G4QuasmonString::Constr: nP="<<nQProj<<", nT="<<nQTarg<<G4endl;
    139145#endif
    140146  // @@ Now projectile can be only meson or baryon @@ -- @@ Improve for clusters @@ --
     
    143149  G4bool FreeFraF=false;                     // Prototype of the free exchange Flag
    144150  if(G4UniformRand()<FreeFra) FreeFraF=true; // Confirm the free exchange
    145   if(nQProj<2)  G4cout<<"***G4QSt::Constr: nQProj="<<nQProj<<"<2 ***FatalError***"<<G4endl;
    146                 else if(nQProj>2)                          // ---> Baryon case (clusters are not implem.)
    147                 {
     151  if(nQProj<2)  G4cout<<"***G4QuaStr::Con: nQProj="<<nQProj<<"<2 ***FatalError***"<<G4endl;
     152  else if(nQProj>2)                          // ---> Baryon case (clusters are not implem.)
     153  {
    148154    //if(nQProj>3)G4cout<<"-Wor-G4QS::Const:nQProj="<<nQProj<<">3 is not implem'd"<<G4endl;
    149155    G4double xP=0.;
     
    153159      xP=RandomizeMomFractionString(nQProj);
    154160      theWeight*=pow(xP,interc);
    155       G4cout<<"************G4QS::C: string xP="<<xP<<G4endl;
     161      G4cout<<"************G4QuasmonString::Constr: string xP="<<xP<<G4endl;
    156162    }
    157163    rPMass = sqrt(pM2*(1.-xP));              // Residual Projectile mass
     
    166172  if(tmpBl) projFl=true;                     // Proj decay is OK
    167173  //if(projHadron.DecayIn2(pq4Mom,pr4Mom)) projFl=true;
    168   else G4cout<<"**Worning**G4QuasmonString::Constr:ProjDecIn2 rpM="<<rPMass<<", pM="<<pM<<G4endl;
    169 #ifdef pdebug
    170   G4cout<<"G4QStr::Con:"<<projFl<<" split PROJ in R4M="<<pr4Mom<<" & Q4M="<<pq4Mom<<G4endl;
     174  else G4cout<<"**Warning**G4QuasmonString::C:ProjDecIn2 rpM="<<rPMass<<",pM="<<pM<<G4endl;
     175#ifdef pdebug
     176  G4cout<<"G4QuaStr::C:"<<projFl<<" split PROJ in R4M="<<pr4Mom<<" & Q4M="<<pq4Mom<<G4endl;
    171177#endif
    172178  G4LorentzVector tq4Mom(0.,0.,0.,0.);       // Prototype of LV of quark of the target 
     
    179185    xT=RandomizeMomFractionString(nQTarg);
    180186    theWeight*=pow(xT,interc);
    181     G4cout<<"************G4QS::C: string xT="<<xT<<G4endl;
     187    G4cout<<"************G4QuaString::Constr: string xT="<<xT<<G4endl;
    182188  }
    183189  G4double rTMass = sqrt(tM2*(1.-xT));       // Residual Target mass
    184190#ifdef pdebug
    185   G4cout<<"G4QS::C: nQTarg="<<nQTarg<<", xProj="<<xT<<", rTMass="<<rTMass<<G4endl;
     191  G4cout<<"G4QuaString::C: nQTarg="<<nQTarg<<", xProj="<<xT<<", rTMass="<<rTMass<<G4endl;
    186192#endif
    187193  G4LorentzVector tr4Mom(0.,0.,0.,rTMass);   // Prototype of LV of the residual projectile
    188194  if(targHadron.DecayIn2(tq4Mom,tr4Mom)) targFl=true; // Targ decay is OK
    189   else G4cout<<"**Worning**G4QStr::Constr:TargDecIn2 rtM="<<rTMass<<", tM="<<tM<<G4endl;
    190 #ifdef pdebug
    191   G4cout<<"G4QStr::Con:"<<targFl<<" split TARG in R4M="<<tr4Mom<<" & Q4M="<<tq4Mom<<G4endl;
     195  else G4cout<<"**Worning**G4QuaStr::Constr:TargDecIn2 rtM="<<rTMass<<", tM="<<tM<<G4endl;
     196#ifdef pdebug
     197  G4cout<<"G4QuaStr::C:"<<targFl<<" split TARG in R4M="<<tr4Mom<<" & Q4M="<<tq4Mom<<G4endl;
    192198#endif
    193199  G4bool elasFl=false;                       // ByDefault avoid the elastic scattering
     
    208214    // @@ Just to try ---- End
    209215#ifdef pdebug
    210     G4cout<<"G4QS::Cons: npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
     216    G4cout<<"G4QuaStr::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
    211217#endif
    212218    if(npM<pM+mPi0) // The projectile is under min mass (@@ In Future put other cut @@)
    213219    {
    214220      G4double valk=tq4Mom.e();         // Momentum of the target quark
    215                                                 //#ifdef pdebug
     221      //#ifdef pdebug
    216222      G4double dvalk=valk-tq4Mom.rho();
    217       if(fabs(dvalk)>.00001) G4cout<<"***kp***G4QS::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
    218                                                 //#endif
     223      if(fabs(dvalk)>.00001) G4cout<<"**kp**G4QuaStr::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
     224      //#endif
    219225      G4double dmas=pM2-pr4Mom.m2();    // Difference of squared masses
    220226      G4double vale=pr4Mom.e();
     
    226232      {
    227233#ifdef pdebug
    228         G4cout<<"***p***>>>G4QS::C: cost="<<cost<<G4endl;
     234        G4cout<<"***p***>>>G4QuasmonString::Constr: cost="<<cost<<G4endl;
    229235#endif
    230236        // Get max value of |cos(theta)| and change tq value to get the pM on mass shell
     
    238244        }
    239245        else                               // --->>> cost<0.
    240                                                                 {
     246        {
    241247          G4double hvalk=dmas/(vale+valp); // Momentum's too small (must be increased, LIM)
    242248          if(hvalk>tM)                     // Momentum can not be increased to this value
    243249          {
    244250#ifdef pdebug
    245             G4cout<<"**p-Cor**>G4QS::C: hvalk="<<hvalk<<" > tM="<<tM<<", dm="<<dmas<<", e="
    246                   <<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
     251            G4cout<<"**p-Cor**>G4QuaStr::C: hvalk="<<hvalk<<" > tM="<<tM<<", dm="<<dmas
     252                  <<", e="<<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
    247253#endif
    248254            // Put the scatteredProjectile on the massShell, and rescatter the target quark
     
    252258            pq4Mom=G4LorentzVector(0.,0.,0.,0.);        // NewProjParton on lightMassShell
    253259            tmpBl=tmpHadron.DecayIn2(newProj4M,pq4Mom); // Decay the Compound in newProg+pQ
    254             if(!tmpBl)G4cout<<"G4QS::C:DecIn2 err "<<sqrt(tmpProj4M.m2())<<"<"<<pM<<G4endl;
     260            if(!tmpBl)
     261              G4cout<<"G4QuaStr::Con: DecIn2 err "<<sqrt(tmpProj4M.m2())<<"<"<<pM<<G4endl;
    255262          }
    256263          else
    257                                                                                 {
    258 #ifdef pdebug
    259             G4cout<<"***---***>G4QS::C: hvalk="<<hvalk<<" < tM="<<tM<<G4endl;
     264          {
     265#ifdef pdebug
     266            G4cout<<"***---***>G4QuasmonStr::Constr: hvalk="<<hvalk<<" < tM="<<tM<<G4endl;
    260267#endif
    261268            valk=hvalk/2;                  // Momentum is too small (must be reduced)
     
    266273          }
    267274        }
    268         if(fabs(newProj4M.m()-pM)>.0001)G4cout<<"G4QS::C:"<<newProj4M.m()<<","<<pM<<G4endl;
     275        if(fabs(newProj4M.m()-pM)>.0001)
     276          G4cout<<"*G4QuaString::Constr: Change of mass "<<newProj4M.m()<<"#"<<pM<<G4endl;
    269277      }
    270278      else
     
    272280        // Turn the target quark-parton to the projectile residual in LS = CMSofTheTarget
    273281#ifdef pdebug
    274         G4cout<<"---p--->>>G4QS::C: cost="<<cost<<G4endl;
     282        G4cout<<"---p--->>>G4QuasmonString::Constr: cost="<<cost<<G4endl;
    275283#endif
    276284        G4ThreeVector tq=tq4Mom.v();           // 3-mom of the targetQ (LS)
     
    286294        tq4Mom.setV(tqf);                      // Change the momentum direction of targetQ
    287295        tr4Mom.setV(-tqf);                     // Change the momentum direction of targetR
    288         if(fabs(tqf.mag()-valk)>.0001)G4cout<<"*G4QS::C:||="<<tqf.mag()<<","<<valk<<G4endl;
     296        if(fabs(tqf.mag()-valk)>.0001)
     297          G4cout<<"*G4QuasmonString::Constr: |k|="<<tqf.mag()<<" # "<<valk<<G4endl;
    289298        newProj4M=tq4Mom+pr4Mom;
    290         if(fabs(newProj4M.m()-pM)>.001)G4cout<<"*G4QS::C:"<<newProj4M.m()<<","<<pM<<G4endl;
     299        if(fabs(newProj4M.m()-pM)>.001)
     300          G4cout<<"*G4QuasmonString::Constr: M="<<newProj4M.m()<<" # "<<pM<<G4endl;
    291301      }
    292302#ifdef pdebug
    293       G4cout<<"G4QStr::C: Proj under GS, newP4M="<<newProj4M<<", pq4M="<<pq4Mom<<G4endl;
     303      G4cout<<"G4QuaStr::C: Proj under GS, newP4M="<<newProj4M<<", pq4M="<<pq4Mom<<G4endl;
    294304#endif
    295305      pcorFl=true;                           // Projectile is on the GS mass shell
     
    303313    //ntM=sqrt(nTM2);
    304314#ifdef pdebug
    305     G4cout<<"G4QStr::C: ntM="<<ntM<<" <? tM="<<tM<<"+mPi0="<<mPi0<<" = "<<tM+mPi0<<G4endl;
     315    G4cout<<"G4QuaStr::C:ntM="<<ntM<<" <? tM="<<tM<<"+mPi0="<<mPi0<<" = "<<tM+mPi0<<G4endl;
    306316#endif
    307317    if(ntM<tM+mPi0 && !pcorFl) // The target is under min mass (@@ InFut put another cut@@)
     
    311321      pqc4M.boost(projRBoost);             // projectileQuark => projCM system <step2>
    312322      G4double valk=pqc4M.e();             // Momentum of the target quark in projCM
    313                                                 //#ifdef pdebug
     323      //#ifdef pdebug
    314324      G4double dvalk=valk-pqc4M.rho();
    315       if(fabs(dvalk)>.00001) G4cout<<"***kt***G4QS::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
    316                                                 //#endif
     325      if(fabs(dvalk)>.00001) G4cout<<"***kt***G4QuaS::C:vk="<<valk<<",dvk="<<dvalk<<G4endl;
     326      //#endif
    317327      G4double dmas=tM2-tr4Mom.m2();       // Difference of squared masses (targ - targRes)
    318328      G4LorentzVector trc4M=tr4Mom;        // targetResidual => projCM system <step1>
     
    321331      G4ThreeVector tr=trc4M.v();          // 3-mom of the targetResidual in projCM
    322332      G4double valp=tr.mag();              // momentum of the targetResidual in projCM
    323       if(fabs(dmas-tM2+trc4M.m2())>.1) G4cout<<"**t**G4QS::C: trM2="<<tr4Mom.m2()<<"="
     333      if(fabs(dmas-tM2+trc4M.m2())>.1) G4cout<<"**t**G4QuaStr::C: trM2="<<tr4Mom.m2()<<"="
    324334                                            <<trc4M.m2()<<","<<vale*vale-valp*valp<<G4endl;
    325335      G4ThreeVector utr=tr/valp;           // Unit vector in the tr direction in projCM
     
    328338      {
    329339#ifdef pdebug
    330         G4cout<<"***t***>>>G4QS::C: cost="<<cost<<G4endl;
     340        G4cout<<"***t***>>>G4QuasmonString::Constr: cost="<<cost<<G4endl;
    331341#endif
    332342        // Get max value of |cos(theta)| and change pq value to get the tM on mass shell
     
    344354        }
    345355        else                                   // --->>> cost<-1 => cost=-1
    346                                                                 {
     356        {
    347357          G4double hvalk=dmas/(vale+valp); // Momentum's too small (must be increased, LIM)
    348358          if(hvalk>pM)                     // Momentum can not be increased to this value
    349359          {
    350360#ifdef pdebug
    351             G4cout<<"**t-Cor**>G4QS::C: hvalk="<<hvalk<<" > pM="<<pM<<", dm="<<dmas<<", e="
    352                   <<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
     361            G4cout<<"**t-Cor**>G4QuasmonString::C: hvalk="<<hvalk<<" > pM="<<pM<<", dm="
     362                  <<dmas<<", e="<<vale<<", p="<<valp<<", ct="<<cost<<G4endl;
    353363#endif
    354364            // Put the scatteredProjectile on the massShell, rescatter the targetQuark (LS)
     
    358368            tq4Mom=G4LorentzVector(0.,0.,0.,0.);        // NewTargParton on lightMassShell
    359369            tmpBl=tmpHadron.DecayIn2(newTarg4M,tq4Mom); // Decay the Compound in newTarg+tQ
    360             if(!tmpBl)G4cout<<"G4QS::C:DecIn2-err "<<sqrt(tmpTarg4M.m2())<<"<"<<tM<<G4endl;
     370            if(!tmpBl)
     371              G4cout<<"G4QuaString::C: DecIn2-err "<<sqrt(tmpTarg4M.m2())<<"<"<<tM<<G4endl;
    361372          }
    362373          else
    363                                                                                 {
    364 #ifdef pdebug
    365             G4cout<<"***---***>G4QS::C: hvalk="<<hvalk<<" < pM="<<pM<<G4endl;
     374          {
     375#ifdef pdebug
     376            G4cout<<"***---***>G4QuaString::Constr: hvalk="<<hvalk<<" < pM="<<pM<<G4endl;
    366377#endif
    367378            valk=hvalk/2;                        // Momentum is too small (mustBeIncreased)
     
    372383            G4LorentzVector nTc4M=pqc4M+trc4M;
    373384#ifdef pdebug
    374             G4cout<<"G4QS::C:After Boost="<<projBoost<<G4endl;
    375             G4cout<<"G4QS::C:Aft: q="<<pqc4M<<pqc4M.m2()<<",t="<<nTc4M<<nTc4M.m2()<<G4endl;
    376             G4cout<<"G4QS::C:E="<<nTc4M.e()<<" = q="<<pqc4M.e()<<"="<<valk<<" + r="<<
    377                   trc4M.e()<<"="<<vale<<" = "<<pqc4M.e()+trc4M.e()<<",c="<<pq4Mom<<G4endl;
    378             if(fabs(nTc4M.m()-tM)>.0001) G4cout<<"*G4QS::C:"<<nTc4M.m()<<"!="<<tM<<G4endl;
     385            G4cout<<"G4QuasmonString::Constr:After Boost="<<projBoost<<G4endl;
     386            G4cout<<"G4QuS::C:Aft:q="<<pqc4M<<pqc4M.m2()<<",t="<<nTc4M<<nTc4M.m2()<<G4endl;
     387            G4cout<<"G4QuaStr::C:E="<<nTc4M.e()<<" = q="<<pqc4M.e()<<"="<<valk<<" + r="<<
     388                   trc4M.e()<<"="<<vale<<" = "<<pqc4M.e()+trc4M.e()<<",c="<<pq4Mom<<G4endl;
     389            if(fabs(nTc4M.m()-tM)>.0001) G4cout<<"*G4QuS::C:"<<nTc4M.m()<<"!="<<tM<<G4endl;
    379390            G4double pp=pqf.dot(tr);             // trc3M*pqc=-valk*valp
    380391            G4double ee=vale*valk;
     
    383394            G4double sen=nTc4M.e();
    384395            G4double smo=nTc4M.rho();
    385             G4cout<<"G4QS::C:qM2="<<pqc4M.m2()<<",rM2="<<trc4M.m2()<<",E="<<sen<<"="<<
    386                                                                                                                 vale+valk<<",P="<<smo<<"="<<valp-valk<<",M="<<sqrt(sen*sen-smo*smo)<<G4endl;
     396            G4cout<<"G4QuaStr::C: qM2="<<pqc4M.m2()<<",rM2="<<trc4M.m2()<<",E="<<sen<<"="<<
     397              vale+valk<<", P="<<smo<<"="<<valp-valk<<",M="<<sqrt(sen*sen-smo*smo)<<G4endl;
    387398#endif
    388399            G4LorentzVector prc4M(pM-valk,-pqf); // Fill new 4-mom for projectResid in CM
     
    393404        }
    394405        if(fabs(newTarg4M.m()-tM)>.0001)
    395           G4cout<<"******************************G4QS::C:"<<newTarg4M.m()<<"="<<pM<<G4endl;
     406          G4cout<<"****************G4QuasmonString::C: M="<<newTarg4M.m()<<"="<<pM<<G4endl;
    396407      }
    397408      else // -1<cos(theta)<1 - only rotate the projQ
     
    399410        // Turn the projectile quark-parton to the target residual in CMS of the Projectile
    400411#ifdef pdebug
    401         G4cout<<"---t--->>>G4QS::C: cost="<<cost<<G4endl;
     412        G4cout<<"---t--->>>G4QuasmonString::Constr: cost="<<cost<<G4endl;
    402413#endif
    403414        G4LorentzVector prc4M=pr4Mom;          // projectileQuark => projCM system <step1>
     
    419430#ifdef pdebug
    420431        G4LorentzVector nT4M=pqc4M+trc4M;
    421         if(fabs(nT4M.m()-tM)>.001)G4cout<<"****t****G4QS::C:M="<<nT4M.m()<<"="<<tM<<G4endl;
     432        if(fabs(nT4M.m()-tM)>.001)G4cout<<"**t**G4QuaStr::C:M="<<nT4M.m()<<"="<<tM<<G4endl;
    422433#endif
    423434        pr4Mom=prc4M;               // <step1> // Fill new 4-mom for projResidual in LS
    424435        pr4Mom.boost(projBoost);    // <step2> // Fill new 4-mom for projResidual in LS
    425         if(fabs(pqf.mag()-valk)>.0001)G4cout<<"*G4QS::C:||="<<pqf.mag()<<"="<<valk<<G4endl;
     436        if(fabs(pqf.mag()-valk)>.0001)
     437          G4cout<<"*G4QuasmonString::Constr: |k|="<<pqf.mag()<<"="<<valk<<G4endl;
    426438        newTarg4M=pq4Mom+tr4Mom;
    427         if(fabs(newTarg4M.m()-tM)>.001)G4cout<<"*G4QS::C:"<<newTarg4M.m()<<"="<<tM<<G4endl;
     439        if(fabs(newTarg4M.m()-tM)>.001)
     440          G4cout<<"*G4QuasmonString::Constr: M="<<newTarg4M.m()<<"="<<tM<<G4endl;
    428441      }
    429442#ifdef pdebug
    430       G4cout<<"G4QStr::C: Targ under GS, newT4M="<<newTarg4M<<", tq4M="<<tq4Mom<<G4endl;
     443      G4cout<<"*G4QuaStr::C: Targ under GS, newT4M="<<newTarg4M<<", tq4M="<<tq4Mom<<G4endl;
    431444#endif
    432445      tcorFl=true;                  // Target is on the GS mass shell
     
    435448      npM=sqrt(nPM2);
    436449#ifdef pdebug
    437       G4cout<<"G4QStr::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<" = "<<pM+mPi0<<G4endl;
     450      G4cout<<"G4QuaStr::C:npM="<<npM<<" <? pM="<<pM<<"+mPi0="<<mPi0<<"="<<pM+mPi0<<G4endl;
    438451#endif
    439452      if(npM<pM+mPi0) elasFl=true;    // Force elastic scattering (@@InFut putAnotherCut@@)
     
    444457      // **** Put the hadrons on the mass shell conserving the CMS scattering angle ****
    445458      G4LorentzVector theTot4M=theProj4Mom+theTarg4Mom;// 4-momentum of CMS of "targ+proj"
    446                     G4ThreeVector cmsBoost = theTot4M.boostVector(); // CMS Boost Vector "CMS to LS"
     459      G4ThreeVector cmsBoost = theTot4M.boostVector(); // CMS Boost Vector "CMS to LS"
    447460      G4ThreeVector cmsRBoost= -cmsBoost;              // CMS Boost Vector "LS to CMS"
    448461      G4LorentzVector cmsProj4M=theProj4Mom; // LS projectile => CMS <step1>
     
    454467      if(fabs(cmsTarg4M.rho()-pcm) > 0.0001)
    455468        G4cout<<"-Worning-G4QuasmonString::Constr: P="<<cmsTarg4M.rho()<<"#"<<pcm<<G4endl;
    456                                                 //#endif
     469      //#endif
    457470      G4LorentzVector cmsNewPr4M=newProj4M;  // LS finalProj => CMS <step1>
    458471      cmsNewPr4M.boost(cmsRBoost);           // LS finalProj => CMS <step2>
     
    464477      if(1.+puV.dot(tuV) > 0.001)
    465478        G4cout<<"-Worning-G4QuasmonString::Constr: ct="<<puV.dot(tuV)<<G4endl;
    466                                                 //#endif
     479      //#endif
    467480      cmsProj4M.setV(puV*pcm);
    468481      newProj4M=cmsProj4M;
     
    501514        theQHadrons.push_back(targH);        // Fill the Target Hadron (delete equivalent)
    502515      }
    503                                                 else                                   // Both are excited (two Quasmons only)
     516      else                                   // Both are excited (two Quasmons only)
    504517      {
    505518        G4Quasmon* projQ = new G4Quasmon(projHadron.GetQC(),newProj4M);
     
    530543    finBaryoN+=theQuasmons[iq]->GetBaryonNumber();
    531544  }
    532   G4cout<<"G4QStr::C:nH="<<nHad<<",nQ="<<nQuas<<",C="<<finCharge<<",B="<<finBaryoN<<G4endl;
     545  G4cout<<"G4QuaStr::C:n="<<nHad<<",N="<<nQuas<<",C="<<finCharge<<",B="<<finBaryoN<<G4endl;
    533546  if(finCharge!=totCharge || finBaryoN!=totBaryNum)
    534547  {
    535     G4cerr<<"***G4QStr::C:tC="<<totCharge<<",C="<<finCharge<<",tB="<<totBaryNum
     548    G4cerr<<"***G4QuasmonString::C: tC="<<totCharge<<",C="<<finCharge<<",tB="<<totBaryNum
    536549          <<",B="<<finBaryoN<<G4endl;
    537550    if(nHad) for(G4int h=0; h<nHad; h++)
    538551    {
    539552      G4QHadron* cH = theQHadrons[h];
    540       G4cerr<<"::G4QS::C:h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
     553      G4cerr<<">G4QuaStr::C:h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
    541554    }
    542555    if(nQuas) for(G4int q=0; q<nQuas; q++)
    543556    {
    544557      G4Quasmon* cQ = theQuasmons[q];
    545       G4cerr<<"::G4QS::C:q#"<<q<<",C="<<cQ->GetCharge()<<",QuarkCon="<<cQ->GetQC()<<G4endl;
     558      G4cerr<<">G4QuaStr::C:q#"<<q<<",C="<<cQ->GetCharge()<<",QCont="<<cQ->GetQC()<<G4endl;
    546559    }
    547560  }
     
    557570    G4Quasmon* curQ    = new G4Quasmon(right.theQuasmons[iq]);
    558571#ifdef fdebug
    559     G4cout<<"G4QS::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     572    G4cout<<"G4QuaStr::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    560573#endif
    561574    theQuasmons.push_back(curQ);             // (delete equivalent)
     
    570583 
    571584  theWorld        =  right.theWorld;
    572                 tot4Mom         =        right.tot4Mom;
    573                 totCharge       =        right.totCharge;
    574                 totBaryNum      =        right.totBaryNum;
     585  tot4Mom         = right.tot4Mom;
     586  totCharge       = right.totCharge;
     587  totBaryNum      = right.totBaryNum;
    575588}
    576589
     
    588601      G4Quasmon* curQ    = new G4Quasmon(right.theQuasmons[iq]);
    589602#ifdef fdebug
    590       G4cout<<"G4QS::CopyByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     603      G4cout<<"G4QuaStr::CpByVal:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    591604#endif
    592605      theQuasmons.push_back(curQ);             // (delete equivalent)
     
    601614 
    602615    theWorld        =  right.theWorld;
    603                   tot4Mom         =      right.tot4Mom;
    604                   totCharge       =      right.totCharge;
    605                   totBaryNum      =      right.totBaryNum;
     616    tot4Mom         = right.tot4Mom;
     617    totCharge       = right.totCharge;
     618    totBaryNum      = right.totBaryNum;
    606619  }
    607620  return *this;
     
    616629    G4Quasmon* curQ    = new G4Quasmon(right->theQuasmons[iq]);
    617630#ifdef fdebug
    618     G4cout<<"G4QS::CopyByPoint:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
     631    G4cout<<"G4QuaStr::CpByPoint:Q#"<<iq<<","<<curQ->GetQC()<<curQ->Get4Momentum()<<G4endl;
    619632#endif
    620633    theQuasmons.push_back(curQ);             // (delete equivalent)
     
    629642 
    630643  theWorld        =  right->theWorld;
    631                 tot4Mom         =        right->tot4Mom;
    632                 totCharge       =        right->totCharge;
    633                 totBaryNum      =        right->totBaryNum;
     644  tot4Mom         = right->tot4Mom;
     645  totCharge       = right->totCharge;
     646  totBaryNum      = right->totBaryNum;
    634647}
    635648
     
    664677G4QHadronVector* G4QuasmonString::Fragment()
    665678{//              ========================== -- @@ Must be changed @@ --
    666                 // Make the final check before filling the output -- @@ Must be changed @@ --
     679  // Make the final check before filling the output -- @@ Must be changed @@ --
    667680#ifdef chdebug
    668681  G4int fCharge=0;
     
    682695  if(fCharge!=totCharge || fBaryoN!=totBaryNum)
    683696  {
    684     G4cerr<<"***G4QS::Frag:tC="<<totCharge<<",C="<<fCharge<<",tB="<<totBaryNum
    685           <<",B="<<fBaryoN<<G4endl;
     697    G4cerr<<"***G4QuasmonString::Fragment: tC="<<totCharge<<", C="<<fCharge<<", tB="
     698          <<totBaryNum<<", B="<<fBaryoN<<G4endl;
    686699    if(nHad) for(G4int h=0; h<nHad; h++)
    687700    {
    688701      G4QHadron* cH = theQHadrons[h];
    689       G4cerr<<":G4QS::HQ:h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
     702      G4cerr<<":G4QuaSt::HQ:h#"<<h<<",QC="<<cH->GetQC()<<",PDG="<<cH->GetPDGCode()<<G4endl;
    690703    }
    691704    if(nQuas) for(G4int q=0; q<nQuas; q++)
    692705    {
    693706      G4Quasmon* cQ = theQuasmons[q];
    694       G4cerr<<":G4QS::HQ:q#"<<q<<",C="<<cQ->GetCharge()<<",QCont="<<cQ->GetQC()<<G4endl;
     707      G4cerr<<":G4QuaSt::HQ:q#"<<q<<",C="<<cQ->GetCharge()<<",QCont="<<cQ->GetQC()<<G4endl;
    695708    }
    696709  }
     
    781794  // @@ TMP --- Begin ---
    782795  if(2>1)
    783                 {
     796  {
    784797    if(nPart<2)
    785798    {
     
    792805    if(r==0.) return 0.;
    793806    if(r==1.) return 1.;
    794                   if     (nPart==3) x=r;          // GS baryon
    795                   else if(nPart==4) x=1.-sqrt(r); // GS quaternion
     807    if     (nPart==3) x=r;          // GS baryon
     808    else if(nPart==4) x=1.-sqrt(r); // GS quaternion
    796809    else x=1.-pow(r,1./(nPart-2.)); // nPart>4
    797810    return x;
     
    809822  if(r==0.) return 0.;
    810823  if(r==1.) return 1.;
    811                 if(nPart==3) x=sqrt(r);      // GS baryon
    812                 else if(nPart==4)            // GS quaternion
    813                 {
     824  if(nPart==3) x=sqrt(r);      // GS baryon
     825  else if(nPart==4)            // GS quaternion
     826  {
    814827    if    (r==0.5) x=0.5;
    815828    else if(r<0.5) x=sqrt(r+r)*(.5+.1579*(r-.5));
     
    817830  }
    818831  else
    819                 {
     832  {
    820833    G4int n1=nPart-2;
    821834    G4double r1=n1;
     
    826839    if  (r==rr)  x=p2;
    827840    else
    828                                 {
     841    {
    829842      if(r<rr)
    830843      {
    831                                                                 G4double pr=0.;
    832                                                                 G4double pra=0.;
     844        G4double pr=0.;
     845        G4double pra=0.;
    833846        if(nPart>8)
    834                                                                 {
     847        {
    835848          if(nPart>10)
    836                                                                   {
     849          {
    837850            if(nPart>11)                      // >11
    838851            {
     
    840853              pra=.915/pow((nPart+6.7),1.75);
    841854            }
    842                                                                                                 else                              // 11
     855            else                              // 11
    843856            {
    844857              pr=.09945;
     
    847860          }
    848861          else
    849                                                                   {
     862          {
    850863            if(nPart>9)                       // 10
    851864            {
     
    853866              pra=.00741;
    854867            }
    855                                                                                                 else                              // 9
     868            else                              // 9
    856869            {
    857870              pr=.11425;
     
    861874        }
    862875        else
    863                                                                 {
     876        {
    864877          if(nPart>6)
    865                                                                   {
     878          {
    866879            if(nPart>7)                       // 8
    867880            {
     
    869882              pra=.00926;
    870883            }
    871                                                                                                 else                              // 7
     884            else                              // 7
    872885            {
    873886              pr=.13405;
     
    876889          }
    877890          else
    878                                                                   {
     891          {
    879892            if(nPart>5)                       // 6
    880893            {
     
    882895              pra=.01112;
    883896            }
    884                                                                                                 else                              // 5
     897            else                              // 5
    885898            {
    886899              pr=.15765;
     
    893906      else
    894907      {
    895                                                                 G4double sr=0.;
     908        G4double sr=0.;
    896909        if(nPart>8)
    897                                                                 {
     910        {
    898911          if(nPart>10)
    899                                                                   {
     912          {
    900913            if(nPart>11) sr=.86/(nPart+1.05); // >11
    901                                                                                                 else         sr=.0774;            // 11
     914            else         sr=.0774;            // 11
    902915          }
    903916          else
    904                                                                   {
     917          {
    905918            if(nPart>9) sr=.0849;             // 10
    906                                                                                                 else        sr=.0938;             // 9
     919            else        sr=.0938;             // 9
    907920          }
    908921        }
    909922        else
    910                                                                 {
     923        {
    911924          if(nPart>6)
    912                                                                   {
     925          {
    913926            if(nPart>7) sr=.1047;             // 8
    914                                                                                                 else        sr=.1179;             // 7
     927            else        sr=.1179;             // 7
    915928          }
    916929          else
    917                                                                   {
     930          {
    918931            if(nPart>5) sr=.1339;             // 6
    919                                                                                                 else        sr=.15135;            // 5
     932            else        sr=.15135;            // 5
    920933          }
    921934        }
     
    940953  if(r==0.) return 0.;
    941954  if(r==1.) return 1.;
    942                 if     (nPart==3) x=r;          // GS baryon
    943                 else if(nPart==4) x=1.-sqrt(r); // GS quaternion
     955  if     (nPart==3) x=r;          // GS baryon
     956  else if(nPart==4) x=1.-sqrt(r); // GS quaternion
    944957  else x=1.-pow(r,1./(nPart-2.)); // nPart>4
    945958  return x;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/History

    r1007 r1055  
    1212     * Please list in reverse chronological order (last date on top)
    1313     ---------------------------------------------------------------
     14
     15
     1623-Jan-2009 M.Kosov (hadr-chips-inter-V09-02-06)
     17------------------------------------------------------
     18- Change of GetNuclearMass(A-1.,Z-1.) (and similar) to GetNuclearMass(A-1,Z-1)
     19  To be consistent with the new Hisaya's developments. The changes are made in
     20  the G4Q(Photon,Electron,Muon,Tau)NuclearCrossSection classes
     21
     2223-Jan-2009 V.Ivanchenko (hadr-chips-inter-V09-02-00)
     23------------------------------------------------------
     24- added deregistration in destructor of G4QCaptureAtRest
     25- added string decay destruction to G4ElectroNuclearReaction
    1426
    152724-Oct-2008 Dennis Wright (hadr-chips-inter-V09-01-09)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4ChiralInvariantPhaseSpace.hh

    r962 r1055  
    2828
    2929//
    30 // Modified:
    31 // 16.01.08 V.Ivanchenko move inlined method to source
     30// Created: H.-P. Wellicsh: GHAD model wrapper for the CHIPS model (1997)
     31// Modified: 16.01.08 V.Ivanchenko move inlined method to source
    3232//
    3333
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4ElectroNuclearReaction.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //
    27 //
    28 // $Id: G4ElectroNuclearReaction.hh,v 1.25 2008/09/01 19:04:54 vnivanch Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
    30 //
    31 //
    32 // GEANT4 physics class: G4ElectroNuclearReaction -- header file
    33 // Created: J.P. Wellisch, 12/11/2001
     26// $Id: G4ElectroNuclearReaction.hh,v 1.27 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// GEANT4 physics class: G4ElectroNuclearReaction -- header file for CHIPS
     30// Created: J.P. Wellisch, following M. Kossov's algorithm. 12/11/2001
    3431// The last update: J.P. Wellisch, 06-June-02
     32// 17.02.2009 M.Kossov, now it is recommended to use the G4QCollision process
    3533//
    3634#ifndef G4ElectroNuclearReaction_h
     
    7472  }
    7573
    76   virtual ~G4ElectroNuclearReaction() {};
     74  virtual ~G4ElectroNuclearReaction() {delete  theStringDecay;};
    7775   
    7876  G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
    79                                 G4Nucleus& aTargetNucleus);
     77    G4Nucleus& aTargetNucleus);
    8078
    8179private:
     
    9492inline   
    9593G4HadFinalState* G4ElectroNuclearReaction::ApplyYourself(const G4HadProjectile& aTrack,
    96                                                         G4Nucleus& aTargetNucleus)
     94        G4Nucleus& aTargetNucleus)
    9795{
    9896  theResult.Clear();
    99   static const G4double dM=G4Proton::Proton()->GetPDGMass()+G4Neutron::Neutron()->GetPDGMass(); // Mean double nucleon mass = m_n+m_p (@@ no binding)
    100   static const G4double me=G4Electron::Electron()->GetPDGMass();      // electron mass
    101   static const G4double me2=me*me;        // squared electron mass
    102   static const G4double dpi=twopi; // 2*pi
     97  static const G4double dM=G4Proton::Proton()->GetPDGMass()+
     98    G4Neutron::Neutron()->GetPDGMass(); // MeanDoubleNucleon Mass = m_n+m_p (@@ no binding)
     99  static const G4double me=G4Electron::Electron()->GetPDGMass(); // electron mass
     100  static const G4double me2=me*me;                               // squared electron mass
    103101  G4DynamicParticle theTempEl(const_cast<G4ParticleDefinition *>(aTrack.GetDefinition()),
    104102                              aTrack.Get4Momentum().vect());
     
    106104  const G4ParticleDefinition* aD = theElectron->GetDefinition();
    107105  if((aD != G4Electron::ElectronDefinition()) && (aD != G4Positron::PositronDefinition()))
    108     throw G4HadronicException(__FILE__, __LINE__, "G4ElectroNuclearReaction::ApplyYourself called for neither electron or positron");
    109  
     106    throw G4HadronicException(__FILE__, __LINE__,
     107        "G4ElectroNuclearReaction::ApplyYourself called for neither electron or positron");
    110108  const G4ElementTable* aTab = G4Element::GetElementTable();
    111109  G4Element * anElement = 0;
     
    121119  if(0==anElement)
    122120  {
    123     G4cerr<<"***G4ElectroNuclearReaction::ApplyYourself: element with Z="<<aTargetNucleus.GetZ()<<
    124           " is not in the element table"<<G4endl; // @@ how to retrieve A or N for the isotop?
     121    G4cerr<<"***G4ElectroNuclearReaction::ApplyYourself: element with Z="
     122          <<aTargetNucleus.GetZ()<<" is not in the element table"<<G4endl;
    125123    throw G4HadronicException(__FILE__, __LINE__, "Anomalous element error.");
    126124  }
    127125
    128126  // Note: high energy gamma nuclear now implemented.
    129  
    130   G4double xSec = theElectronData.GetCrossSection(theElectron, anElement); // Check cross section
     127  G4double xSec = theElectronData.GetCrossSection(theElectron, anElement);// Check XSection
    131128  if(xSec<=0.)
    132129  {
    133130    theResult.SetStatusChange(isAlive);
    134131    theResult.SetEnergyChange(theElectron->GetKineticEnergy());
    135     theResult.SetMomentumChange(theElectron->GetMomentumDirection()); // new direction for the electron
     132    // new direction for the electron
     133    theResult.SetMomentumChange(theElectron->GetMomentumDirection());
    136134    return &theResult;        // DO-NOTHING condition
    137135  }
     
    140138  if( theElectronKinEnergy < photonEnergy )
    141139  {
    142     G4cout << "G4ElectroNuclearReaction::ApplyYourself: photonEnergy is very high"<<G4endl;
    143     G4cout << "If this condition appears frequently, please contact Hans-Peter.Wellisch@cern.ch"<<G4endl;
    144     theResult.SetStatusChange(isAlive);
    145     theResult.SetEnergyChange(theElectron->GetKineticEnergy());
    146     theResult.SetMomentumChange(theElectron->GetMomentumDirection()); // new direction for the electron
     140    G4cout<<"G4ElectroNuclearReaction::ApplyYourself: photonEnergy is very high"<<G4endl;
     141    G4cout<<">>> If this condition persists, please contact Geant4 group"<<G4endl;
     142    theResult.SetStatusChange(isAlive);
     143    theResult.SetEnergyChange(theElectron->GetKineticEnergy());
     144    // new direction for the electron
     145    theResult.SetMomentumChange(theElectron->GetMomentumDirection());
    147146    return &theResult;        // DO-NOTHING condition
    148147  }
    149148  G4double photonQ2 = theElectronData.GetEquivalentPhotonQ2(photonEnergy);
    150   G4double W=photonEnergy-photonQ2/dM;   // Hadronic energy flow (W-energy) from the virtual photon
     149  G4double W=photonEnergy-photonQ2/dM; // Hadronic energy flow from the virtual photon
    151150  if(getenv("debug_G4ElectroNuclearReaction") )
    152151  {
     
    157156    theResult.SetStatusChange(isAlive);
    158157    theResult.SetEnergyChange(theElectron->GetKineticEnergy());
    159     theResult.SetMomentumChange(theElectron->GetMomentumDirection()); // new direction for the electron
     158    // new direction for the electron
     159    theResult.SetMomentumChange(theElectron->GetMomentumDirection());
    160160    return &theResult;        // DO-NOTHING condition
    161     throw G4HadronicException(__FILE__, __LINE__, "G4ElectroNuclearReaction::ApplyYourself: negative equivalent energy");
     161    throw G4HadronicException(__FILE__, __LINE__,
     162                    "G4ElectroNuclearReaction::ApplyYourself: negative equivalent energy");
    162163  }
    163164  G4DynamicParticle* theDynamicPhoton = new
    164165                     G4DynamicParticle(G4Gamma::GammaDefinition(),
    165                      G4ParticleMomentum(1.,0.,0.), photonEnergy*MeV);            //->-*
     166                     G4ParticleMomentum(1.,0.,0.), photonEnergy*MeV);        //----->-*
    166167  G4double sigNu=thePhotonData.GetCrossSection(theDynamicPhoton, anElement); //       |
    167168  theDynamicPhoton->SetKineticEnergy(W); // Redefine photon with equivalent energy    |
     
    173174    theResult.SetStatusChange(isAlive);
    174175    theResult.SetEnergyChange(theElectron->GetKineticEnergy());
    175     theResult.SetMomentumChange(theElectron->GetMomentumDirection()); // new direction for the electron
     176    // new direction for the electron
     177    theResult.SetMomentumChange(theElectron->GetMomentumDirection());
    176178    return &theResult; // DO-NOTHING condition
    177179  }
     
    180182  G4double iniE=theElectronKinEnergy+me; // Initial total energy of electron
    181183  G4double finE=iniE-photonEnergy;       // Final total energy of electron
    182   theResult.SetEnergyChange(std::max(0.,finE-me));    // Modifies the KINETIC ENERGY (Why not in the name?)
     184  theResult.SetEnergyChange(std::max(0.,finE-me)); // Modifies the KINETIC ENERGY
    183185  G4double EEm=iniE*finE-me2;            // Just an intermediate value to avoid "2*"
    184   G4double iniP=std::sqrt(iniE*iniE-me2);     // Initial momentum of the electron
    185   G4double finP=std::sqrt(finE*finE-me2);     // Final momentum of the electron
    186   G4double cost=(EEm+EEm-photonQ2)/iniP/finP; // std::cos(theta) for the electron scattering
     186  G4double iniP=std::sqrt(iniE*iniE-me2);          // Initial momentum of the electron
     187  G4double finP=std::sqrt(finE*finE-me2);          // Final momentum of the electron
     188  G4double cost=(EEm+EEm-photonQ2)/iniP/finP;// std::cos(theta) for the electron scattering
    187189  if(cost>1.) cost=1.;
    188190  if(cost<-1.) cost=-1.;
     
    192194  G4ThreeVector orty = dir.cross(ortx);  // Second unit vector orthoganal to the direction
    193195  G4double sint=std::sqrt(1.-cost*cost);      // Perpendicular component
    194   G4double phi=dpi*G4UniformRand();      // phi of scattered electron
     196  G4double phi=twopi*G4UniformRand();      // phi of scattered electron
    195197  G4double sinx=sint*std::sin(phi);           // x-component
    196198  G4double siny=sint*std::cos(phi);           // y-component
     
    199201  G4ThreeVector photonMomentum=iniP*dir-finP*findir;
    200202  G4DynamicParticle localGamma(G4Gamma::GammaDefinition(), photonEnergy, photonMomentum);
    201   //G4DynamicParticle localGamma(G4Gamma::GammaDefinition(), photonDirection, photonEnergy);
     203  //G4DynamicParticle localGamma(G4Gamma::GammaDefinition(),photonDirection, photonEnergy);
    202204  //G4DynamicParticle localGamma(G4Gamma::GammaDefinition(), photonLorentzVector);
    203205  G4ThreeVector position(0,0,0);
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4GammaNuclearReaction.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4GammaNuclearReaction.hh,v 1.14 2008/09/01 17:30:42 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4GammaNuclearReaction.hh,v 1.15 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // GEANT4 physics class: G4GammaNuclearReaction -- header file
    32 // Created: J.P. Wellisch, 2000/08/18
     31// GEANT4 physics class: G4GammaNuclearReaction - header file for CHIPS
     32// Created: J.P. Wellisch, following M.Kossov's algorithm. 2000/08/18
    3333// The last update: J.P. Wellisch, Thu Jun  6 2002.
    3434// 01.09.2008 V.Ivanchenko move inline to source and define interaction name
    35 //
     35// 17.02.2009 M.Kossov, now it is recommended to use the G4QCollision process
    3636
    3737#ifndef G4GammaNuclearReaction_h
     
    5151   
    5252  virtual G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
    53                                         G4Nucleus& aTargetNucleus);
     53                                        G4Nucleus& aTargetNucleus);
    5454
    5555private:
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4PionMinusNuclearAtRestChips.hh

    r962 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// 17.02.2009 M.Kossov, now it is recommended to use the G4QCaptureAtRest process
    2526//
    2627#ifndef G4PionMinusNuclearAtRestChips_h
     
    4344  public:
    4445 
    45      G4PionMinusNuclearAtRestChips(const G4String& processName ="PionMinusAnnihilationAtRest")
     46     G4PionMinusNuclearAtRestChips(const G4String& processName ="PionMinusCaptureAtRest")
    4647      : G4VRestProcess (processName, fHadronic)
    4748     {
     
    5657     }
    5758
    58   // null physics table
     59     // null physics table
    5960     void BuildPhysicsTable(const G4ParticleDefinition&){}
    6061
    6162     G4double AtRestGetPhysicalInteractionLength(const G4Track&track,
    62                                                 G4ForceCondition*condition);
     63      G4ForceCondition*condition);
    6364
    64   // zero mean lifetime
     65     // zero mean lifetime
    6566     G4double GetMeanLifeTime(const G4Track& aTrack,
    66                               G4ForceCondition* condition) {return 0.0;}
     67         G4ForceCondition* condition) {return 0.0;}
    6768
    6869     G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
     
    7980  if(aTrack.GetDynamicParticle()->GetDefinition() != G4PionMinus::PionMinus())
    8081  {
    81     throw G4HadronicException(__FILE__, __LINE__, "Calling G4PionMinusNuclearAtRestChips with particle other than pi-!!!");
     82    throw G4HadronicException(__FILE__, __LINE__,
     83                  "Calling G4PionMinusNuclearAtRestChips with particle other than pi-!!!");
    8284  }
    8385 
     
    9193
    9294G4double G4PionMinusNuclearAtRestChips::
    93 AtRestGetPhysicalInteractionLength(const G4Track&track,
    94                                    G4ForceCondition*condition)
     95AtRestGetPhysicalInteractionLength(const G4Track&track, G4ForceCondition*condition)
    9596{
    9697  ResetNumberOfInteractionLengthLeft();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4PionMinusNuclearReaction.hh

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 //
     25// (@@ Why only pi-, why not pi+? - Looks like a dummy CHIPS pocess - M.K.)
     26// 17.02.2009 M.Kossov, now it is recommended to use the G4QCollision process
     27
    2628#ifndef G4PionMinusNuclearReaction_h
    2729#define G4PionMinusNuclearReaction_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4ProtonAntiProtonAtRestChips.hh

    r962 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 //
     25// (Why only antiproton-proton, when the antiproton-nucleus is made? - M.K.)
     26// 17.02.2009 M.Kossov, now it is recommended to use the G4QCaptureAtRest process
    2627#ifndef G4ProtonAntiProtonAtRestChips_h
    2728#define G4ProtonAntiProtonAtRestChips_h
     
    5051  public:
    5152 
    52      G4ProtonAntiProtonAtRestChips(const G4String& processName ="AntiProtonAnnihilationAtRest")
     53     G4ProtonAntiProtonAtRestChips(const G4String& processName=
     54                                                            "AntiProtonAnnihilationAtRest")
    5355      : G4VRestProcess (processName, fHadronic)
    5456     {
     
    5658     }
    5759 
    58     ~G4ProtonAntiProtonAtRestChips() {}
     60     ~G4ProtonAntiProtonAtRestChips() {}
    5961
    6062     G4bool IsApplicable(const G4ParticleDefinition& aParticle)
     
    6769
    6870     G4double AtRestGetPhysicalInteractionLength(const G4Track&track,
    69                                                 G4ForceCondition*condition);
     71      G4ForceCondition*condition);
    7072
    7173  // zero mean lifetime
    7274     G4double GetMeanLifeTime(const G4Track& aTrack,
    73                               G4ForceCondition* condition) {return 0.0;}
     75         G4ForceCondition* condition) {return 0.0;}
    7476
    7577     G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
     
    9294  if(aTrack.GetDynamicParticle()->GetDefinition() != G4AntiProton::AntiProton())
    9395  {
    94     throw G4HadronicException(__FILE__, __LINE__, "Calling G4ProtonAntiProtonAtRestChips with particle other than p-bar!!!");
     96    throw G4HadronicException(__FILE__, __LINE__,
     97                "Calling G4ProtonAntiProtonAtRestChips with particle other than p-bar!!!");
    9598  }
    9699  if(aTargetNucleus.GetZ() != 1)
    97100  {
    98     throw G4HadronicException(__FILE__, __LINE__, "Calling G4ProtonAntiProtonAtRestChips for target other than Hydrogen!!!");
     101    throw G4HadronicException(__FILE__, __LINE__,
     102                "Calling G4ProtonAntiProtonAtRestChips for target other than Hydrogen!!!");
    99103  }
    100104 
     
    105109G4double G4ProtonAntiProtonAtRestChips::
    106110AtRestGetPhysicalInteractionLength(const G4Track&track,
    107                                    G4ForceCondition*condition)
     111       G4ForceCondition*condition)
    108112{
    109113  ResetNumberOfInteractionLengthLeft();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4ProtonAntiProtonReaction.hh

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 //
     25// (Why only antiproton-proton, when the antiproton-nucleus is made? - M.K.)
     26// 17.02.2009 M.Kossov, now it is recommended to use the G4QCollision process
    2627#ifndef G4ProtonAntiProtonReaction_h
    2728#define G4ProtonAntiProtonReaction_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QANuANuNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuANuNuclearCrossSection.hh,v 1.1 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuANuNuclearCrossSection.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-DEC-2005
    3434//
    35 // Short description: this G4 singletone class calculates (nu_mu,mu) Nuclear cross section
     35// Short description: this G4 singletone class calculates (an-nu,an-nu)A cross section
    3636// (Energy limit: E<320GeV->badExtrapolation) for a particular isotope (proportional to A)
    3737// ****************************************************************************************
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QANuENuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuENuclearCrossSection.hh,v 1.1 2007/10/02 10:00:37 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuENuclearCrossSection.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-SEP-2007
    3434//
    35 // Short description: this G4 singletone class calculates (nu_e,e) Nuclear cross section
     35// Short description: this G4 singletone class calculates (anu_e,e+) Nuclear cross section
    3636// (Energy limit: E<320GeV->badExtrapolation) for a particular isotope (proportional to A)
    3737// ****************************************************************************************
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QANuMuNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuMuNuclearCrossSection.hh,v 1.6 2006/12/01 10:57:46 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuMuNuclearCrossSection.hh,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // GEANT4 physics class: G4QANuMuNuclearCrossSection -- header file
     31// GEANT4 physics class: G4QANuMuNuclearCrossSection -- header file for (anu_mu,mu+)A XS
    3232// M.V. Kossov, CERN-ITEP(Moscow), 20-DEC-2005
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-DEC-2005
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QAtomicElectronScattering.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QAtomicElectronScattering.hh,v 1.2 2006/12/13 15:45:16 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QAtomicElectronScattering.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QAtomicElectronScattering header ----------------
    3030//                 by Mikhail Kossov, December 2003.
    31 //  Header of G4QAtomicElectronScattering class (mu-,pi-,K-) of the CHIPS Simulation Branch in GEANT4
     31// Header of G4QAtomicElectronScattering class of the CHIPS Simulation Branch in GEANT4
    3232// -------------------------------------------------------------------------------
    33 // This is a unique CHIPS class for the Nuclear Capture At Rest Prosesses.
     33// This is a unique CHIPS class for the Nuclear Interactions with Atomic electrons.
    3434// -------------------------------------------------------------------------------
    35 // At present (Dec.04) only pi+/-, K+/- proton, neutron, antiproton and antineutron
    36 // collisions with protons are implemented, which are fundamental for the in matter
    37 // simulation of hadronic reactions. The interactions of the same particles with
    38 // nuclei are planned only. The collisions of nuclei with nuclei are possible...
    39 // The simulation is based on the G4QuasmonString class, which extends the CHIPS model
    40 // to the highest energyes, implementing the Quasmon string with the
    41 // String->Quasmons->Hadrons scenario of the quark-gluon string fragmentation
    42 // --> CHIPS is a SU(3) event generator, so it does not include reactions with the
    43 // heavy (c,b,t), which can be simulated only by the SU(6) QUIPS (QUark Invariant
    44 // Phase Space) model which is an expantion of the CHIPS.-December 2003.M.Kossov.-
    45 // -------------------------------------------------------------------------------
    46 // Algorithms: the interactions in CHIPS are described by the quark exchange (QE) process.
    47 // The first step is the low energy quark exchange. If as a result of the QE one or
    48 // both secondary hadrons are below the pi0 threshold (roughly) they are pushed to the
    49 // Ground State (GS) value(s). The excited (above the pi0 production threshold) hadronic
    50 // state is considered as a Quasmon, which is filled in the G4QuasmonVector of the
    51 // G4QuasmonString class. On the second step all G4Quasmons are decayed by the
    52 // G4Quasmon class and fiill the G4QHadronVector output. If the exchange quark is too far
    53 // in the rapidity space (a parameter of the G4QuasmonString class) from any of the quarks
    54 // of the other hadron it creates a string with the nearest in the rapidity space quark.
    55 // This string is converted into a Quasmon. This forces the coalescence of the residuals
    56 // in the another Quasmon, while the possibility exist to create more residual Quasmons
    57 // instead of one - one per each target-quark+projectile-antiquark(diquark) pair. This
    58 // possibility is tuned by the Drell-Yan pair production process. If the target (or
    59 // pojectile) are nuclei, then the Quasmons are created not only in vacuum, where they
    60 // can be fragmented by the G4Quasmon class, but in nuclear matter of the residual target
    61 // (or projectile). If the Quasmons are crated in nuclear matter, they are fragmented by
    62 // the G4QEnvironment class with the subsequent Quark Exchange nuclear fragmentation.
    63 // This is the planned scenario.- December 2004.Mikhail Kossov.-
    64 // --------------------------------------------------------------------------------
    6535// ****************************************************************************************
    6636// ********* This HEADER is temporary moved from the photolepton_hadron directory *********
    6737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    6838// ****************************************************************************************
     39// Short description: CHIPS is re3sponsible for photo- and lepto-nuclear
     40// reactions. In particular for thr electron-nuclear reactions. At High
     41// Energies the nucleons (including neutrons) and nuclear fragments can
     42// interact with atomic electrons (reversed electro-nuclear reaction -
     43// antilab), while they are missing the nucler-nuclear (ion-ion) reac-
     44// tions. This nucleo-electron process comes "for-free" in CHIPS, as the
     45// cross-sections of the interaction is known from the electro-nuclear
     46// reactions. The only problem is to move the output from the antilab to
     47// lab system. This is what this process is aiming to do. It can be used
     48// for the ion transport in Geant4.
     49// ---------------------------------------------------------------------
    6950
    7051#ifndef G4QAtomicElectronScattering_hh
     
    11697  // (energy, material)
    11798  // The previousStepSize and G4ForceCondition* are not used.
    118   // This function overloads a virtual function of the base class.                   
     99  // This function overloads a virtual function of the base class.       
    119100  // It is invoked by the ProcessManager of the Particle.
    120101 
     
    122103  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    123104  // It computes the final state of the process (at end of step),
    124   // returned as a ParticleChange object.                          
     105  // returned as a ParticleChange object.      
    125106  // This function overloads a virtual function of the base class.
    126107  // It is invoked by the ProcessManager of the Particle.
     
    147128  G4QAtomicElectronScattering(const G4QAtomicElectronScattering&);
    148129
    149                 // BODY
     130  // BODY
    150131  // Static Parameters
    151132  static G4bool   manualFlag;  // If false then standard parameters are used
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QCaptureAtRest.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCaptureAtRest.hh,v 1.6 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCaptureAtRest.hh,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCaptureAtRest header ----------------
    3030//                 by Mikhail Kossov, December 2003.
    31 //  Header of G4QCaptureAtRest class (mu-,pi-,K-) of the CHIPS Simulation Branch in GEANT4
     31// Header of G4QCaptureAtRest class of the CHIPS Simulation Branch in GEANT4
    3232// -------------------------------------------------------------------------------
    3333// This is a unique CHIPS class for the Nuclear Capture At Rest Prosesses.
     
    7878// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    7979// ****************************************************************************************
     80// Short Description: This is a universal process for nuclear capture
     81// (including annihilation) of all negative particles (negative hadrons,
     82// negative leptons: mu- & tau-). It can be used for the cold neutron
     83// capture, but somebody should decide what is the probability (defined
     84// by the capture cross-section and atomic material properties) to switch
     85// the cold neutron to the at-rest neutron. - M.K.2009.
     86// ----------------------------------------------------------------------
    8087
    8188#ifndef G4QCaptureAtRest_hh
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QCoherentChargeExchange.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCoherentChargeExchange.hh,v 1.5 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCoherentChargeExchange.hh,v 1.6 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCoherentChargeExchange header ----------------
     
    3333// This is a unique CHIPS class for the Hadron-Nuclear Elastic Scattering Prosesses
    3434// -------------------------------------------------------------------------------
    35 // At present (Jan-06) only proton-proton scattering is implemented The interaction with
    36 // nuclei are planned only. The scattering of nuclei on nuclei are possible...
     35// At present (Jan-06) only proton-to-neutron & neutron-to-proton scattering on nuclei
     36// are implemented. The scattering of mesons and nuclei on nuclei are possible...
    3737// The simulation is based on the CHIPS approximation of total elastic and differential
    3838// elastic cross sections from E=0 to the highest energyes.
    3939// -------------------------------------------------------------------------------
     40// Short description: This class resolves an ambiguity in the definition of the
     41// "inelastic" cross section. As it was shown in Ph.D.Thesis (M.Kosov,ITEP,1979)
     42// it is more reasonable to subdivide the total cross-section in the coherent &
     43// incoherent parts, but the measuring method for the "inelastic" cross-sections
     44// consideres the lack of the projectile within the narrow forward solid angle
     45// with the consequent extrapolation of these partial cross-sections, corresponding
     46// to the particular solid angle, to the zero solid angle. The low angle region
     47// is shadowed by the elastic (coherent) scattering. BUT the coherent charge
     48// exchange (e.g. conversion p->n) is included by this procedure as a constant term
     49// in the extrapolation, so the "inelastic" cross-section differes from the
     50// incoherent cross-section by the value of the coherent charge exchange cross
     51// section. Fortunately, this cross-sectoion drops ruther fast with energy increasing.
     52// All Geant4 inelastic hadronic models (including CHIPS) simulate the incoherent
     53// reactions. So the incoherent (including quasielastic) cross-section must be used
     54// instead of the inelastic cross-section. For that the "inelastic" cross-section
     55// must be reduced by the value of the coherent charge-exchange cross-section, which
     56// is estimated (it must be tuned!) in this CHIPS class. The angular distribution
     57// is made (at present) identical to the corresponding coherent-elastic scattering
     58// -----------------------------------------------------------------------------------
    4059
    4160#ifndef G4QCoherentChargeExchange_hh
     
    84103  // (energy, material)
    85104  // The previousStepSize and G4ForceCondition* are not used.
    86   // This function overloads a virtual function of the base class.                   
     105  // This function overloads a virtual function of the base class.       
    87106  // It is invoked by the ProcessManager of the Particle.
    88107 
     
    90109  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    91110  // It computes the final state of the process (at end of step),
    92   // returned as a ParticleChange object.                          
     111  // returned as a ParticleChange object.      
    93112  // This function overloads a virtual function of the base class.
    94113  // It is invoked by the ProcessManager of the Particle.
     
    110129  G4double CalculateXSt(G4bool oxs, G4bool xst, G4double p, G4int Z, G4int N, G4int pPDG);
    111130
    112                 // BODY
     131  // BODY
    113132  // Static Parameters --------------------------------------------------------------------
    114133  static G4int    nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
     
    128147};
    129148#endif
    130 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QCollision.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCollision.hh,v 1.11 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCollision.hh,v 1.13 2009/03/23 14:12:49 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCollision header ----------------
     
    6767// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    6868// ****************************************************************************************
     69// Short description: This is a universal class for the incoherent (inelastic)
     70// nuclear interactions in the CHIPS model.
     71// ---------------------------------------------------------------------------
    6972
    7073#ifndef G4QCollision_hh
     
    8689#include "G4LorentzVector.hh"
    8790#include "G4HadronicProcessType.hh"
     91#include "G4RandomDirection.hh"
    8892
    8993// CHIPS Headers
     
    124128  // (energy, material)
    125129  // The previousStepSize and G4ForceCondition* are not used.
    126   // This function overloads a virtual function of the base class.                   
     130  // This function overloads a virtual function of the base class.       
    127131  // It is invoked by the ProcessManager of the Particle.
    128132 
     
    130134  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    131135  // It computes the final state of the process (at end of step),
    132   // returned as a ParticleChange object.                          
     136  // returned as a ParticleChange object.      
    133137  // This function overloads a virtual function of the base class.
    134138  // It is invoked by the ProcessManager of the Particle.
     
    170174  std::pair<G4double,G4double> Random2DDirection();
    171175
    172                 // BODY
     176  // BODY
    173177  // Static Parameters --------------------------------------------------------------------
    174178  static G4bool   manualFlag;  // If false then standard parameters are used
     
    207211};
    208212#endif
    209 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QDiffraction.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QDiffraction.hh,v 1.2 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QDiffraction.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QDiffraction header ----------------
     
    3636// The normalization is based on the temporary G4QProtonNuclearCrossSection class
    3737// -------------------------------------------------------------------------------
     38// Short description: This is a process, which describes the diffraction
     39// excitation of the projectile and the nucleus. On nuclei in addition there
     40// can be a coherent diffraction process for the projectile, but it is
     41// comparably small. The most important part of the diffraction is the
     42// progectile diffraction excitation, as in this interaction proton can lose
     43// only a small part of its energy and make the shower longer. This is because
     44// only 1-2 (n) pions are produce in the diffraction escitation, and the mean
     45// kept energy of the nucleon is (1-n/7)=80%. For kaons the kept energy is much
     46// smaller (1-n/3.5)=60%, and for pions it is less important (about 40%).
     47// ----------------------------------------------------------------------------
    3848
    3949#ifndef G4QDiffraction_hh
     
    8292  // (energy, material)
    8393  // The previousStepSize and G4ForceCondition* are not used.
    84   // This function overloads a virtual function of the base class.                   
     94  // This function overloads a virtual function of the base class.       
    8595  // It is invoked by the ProcessManager of the Particle.
    8696 
     
    8898  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    8999  // It computes the final state of the process (at end of step),
    90   // returned as a ParticleChange object.                          
     100  // returned as a ParticleChange object.      
    91101  // This function overloads a virtual function of the base class.
    92102  // It is invoked by the ProcessManager of the Particle.
     
    108118  G4double CalculateXS(G4double p, G4int Z, G4int N, G4int pPDG);
    109119
    110                 // BODY
     120  // BODY
    111121  // Static Parameters --------------------------------------------------------------------
    112122  static G4int    nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
     
    126136};
    127137#endif
    128 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QDiffractionRatio.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3232// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-2006
    3333//
     34//=======================================================================
     35// Short description: Difraction excitation is a part of the incoherent
     36// (inelastic) interaction. This part is calculated in the class.
     37// --------------------------------------------------------------------
    3438
    3539#ifndef G4QDiffractionRatio_h
     
    8892 // Body
    8993 private:
    90 };                                      
     94};      
    9195#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QDiscProcessMixer.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QDiscProcessMixer.hh,v 1.3 2008/07/09 19:45:09 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QDiscProcessMixer.hh,v 1.6 2009/04/17 15:22:31 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QDiscProcessMixer header ----------------
    3030//                 by Mikhail Kossov, Aug 2007.
    31 //  Header of G4QDiscProcessMixer class (hadron+A) of the CHIPS Simulation Branch in GEANT4
    32 // -------------------------------------------------------------------------------
    33 // This is a unique CHIPS class for the Hadron-Nuclear Diffractive Interaction Prosesses
    34 // -------------------------------------------------------------------------------
    35 // At present (Aug-07) it is not tested.
    36 // The normalization is based on the temporary G4QIonIonCrossSection class
    37 // -------------------------------------------------------------------------------
     31//  Header of G4QDiscProcessMixer class of the CHIPS Simulation Branch in GEANT4
     32// -----------------------------------------------------------------------------
     33// Short description: universal mixer of processes (NOT models as in GHAD!)
     34// depending on the application energy region (defined by users).
     35// ------------------------------------------------------------------------
    3836
    3937#ifndef G4QDiscProcessMixer_hh
     
    6866                      const G4ParticleDefinition* proj = G4Gamma::Gamma(),
    6967                      G4ProcessType pType = fHadronic );
    70 
    7168  // Destructor
    7269  ~G4QDiscProcessMixer();
     
    7673  G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
    7774                                                G4double previousStepSize,
    78                                                                      G4ForceCondition* condition);
     75                                                G4ForceCondition* condition);
     76
     77  G4double GetMeanFreePath(const G4Track& aTrack, G4double previousStepSize,
     78                           G4ForceCondition* condition);
    7979
    8080  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    8181
    82   void AddDiscreteProcess(G4VDiscreteProcess* DP, G4double ME);
     82  // DP is the name of the Discrete Process, MaxE is the maximum energy for this process
     83  // The processes must be defined, starting from high energy processes (MaxE decreasing)
     84  // The MaxE for the first (highest energy process) is always infinity (automatic)
     85  // The MinE = MaxE of the lower energy process (MinE=0 for the lowest energy process)
     86
     87  void AddDiscreteProcess(G4VDiscreteProcess* DP, G4double MaxE);
    8388
    8489  //G4LorentzVector GetEnegryMomentumConservation();
     
    9499  G4QDiscProcessMixer(const G4QDiscProcessMixer& DPM);
    95100
    96                 // BODY
     101  // BODY
    97102  const G4ParticleDefinition* DPParticle;             // Particle for DiscreteProc mixture
    98103  G4QDiscreteProcessVector theDPVector;               // Vector of Discrete Processes
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QDiscreteProcessVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QDiscreteProcessVector.hh,v 1.1 2007/08/28 15:48:15 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QDiscreteProcessVector.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//      ---------------- G4QDiscreteProcessVector ----------------
     
    3232// Type defenition for Vectors of DiscreteProcesses (G4VDiscreteProcess)
    3333// ---------------------------------------------------------------------
     34// Short description: universal mixer of processes (NOT models as in GHAD!)
     35// depending on the application energy region G4QDiscProcessMixer is using
     36// this vector of the Geant4 processes.
     37// ------------------------------------------------------------------------
    3438
    3539#ifndef G4QDiscreteProcessVector_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QElastic.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QElastic.hh,v 1.4 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QElastic.hh,v 1.5 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QElastic header ----------------
     
    3838// elastic cross sections from E=0 to the highest energyes.
    3939// -------------------------------------------------------------------------------
     40// Short description: At present this is a process for nucleon-nucleus
     41// elastic scattering. Mesons and hyperons exist only for the Hydrogen
     42// target (see G4QuasiFreeRatios).
     43// ---------------------------------------------------------------
    4044
    4145#ifndef G4QElastic_hh
     
    8387  // (energy, material)
    8488  // The previousStepSize and G4ForceCondition* are not used.
    85   // This function overloads a virtual function of the base class.                   
     89  // This function overloads a virtual function of the base class.       
    8690  // It is invoked by the ProcessManager of the Particle.
    8791 
     
    8993  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    9094  // It computes the final state of the process (at end of step),
    91   // returned as a ParticleChange object.                          
     95  // returned as a ParticleChange object.      
    9296  // This function overloads a virtual function of the base class.
    9397  // It is invoked by the ProcessManager of the Particle.
     
    109113  G4double CalculateXSt(G4bool oxs, G4bool xst, G4double p, G4int Z, G4int N, G4int pPDG);
    110114
    111                 // BODY
     115  // BODY
    112116  // Static Parameters --------------------------------------------------------------------
    113117  static G4int    nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
     
    127131};
    128132#endif
    129 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QElasticCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3232// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-2006
    3333//
     34//================================================================================
     35// Short description: Interaction cross-sections for the G4QElastic process
     36// -------------------------------------------------------------------------------
    3437
    3538#ifndef G4QElasticCrossSection_h
     
    121124  static G4double* lastCST;  // Last cross-section table
    122125  static G4double* lastPAR;  // Last parameters for functional calculation
    123   static G4double* lastSST;  // E-dep of squared slope of the first difruction 
    124   static G4double* lastS1T;  // E-dep of mantissa of the first difruction       
     126  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
     127  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
    125128  static G4double* lastB1T;  // E-dep of the slope of the first difruction
    126129  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
    127130  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
    128   static G4double* lastS3T;  // E-dep of mantissa of the third difruction       
     131  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
    129132  static G4double* lastB3T;  // E-dep of the slope of the third difruction
    130   static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction       
     133  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
    131134  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
    132135
     
    142145  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
    143146  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
    144  };                                     
     147 };
    145148#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QElectronNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3232// The last update: M.V. Kossov, CERN/ITEP (Moscow) 25-Sept-03
    3333//
     34// --------------------------------------------------------------------------------
     35// Short description: reaction cross-sections for electron-nuclear reactions, which
     36// are integrals over virtual equivalent photons photons.
     37// --------------------------------------------------------------------------------
    3438
    3539#ifndef G4QElectronNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QGluonString.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QGluonString.hh,v 1.2 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QGluonString.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QGluonString header ----------------
     
    4444// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
    4545// ****************************************************************************************
     46// Short description: CHIPS object for the Quark-Gluon String
     47// ---------------------------------------------------------------
    4648
    4749#ifndef G4QGluonString_hh
     
    8991  // (energy, material)
    9092  // The previousStepSize and G4ForceCondition* are not used.
    91   // This function overloads a virtual function of the base class.                   
     93  // This function overloads a virtual function of the base class.       
    9294  // It is invoked by the ProcessManager of the Particle.
    9395 
    9496  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    9597  // It computes the final state of the process (at end of step),
    96   // returned as a ParticleChange object.                          
     98  // returned as a ParticleChange object.      
    9799  // This function overloads a virtual function of the base class.
    98100  // It is invoked by the ProcessManager of the Particle.
     
    126128  G4QGluonString(const G4QGluonString&);
    127129
    128                 // BODY
     130  // BODY
    129131  // Static Parameters --------------------------------------------------------------------
    130132  static G4bool   manualFlag;  // If false then standard parameters are used
     
    160162};
    161163#endif
    162 
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QIonIonCrossSection.hh

    r1007 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// Short description: CHIPS cross-sectons for Ion-Ion interactions
     26// ---------------------------------------------------------------
    2527//
    2628//
    27 // GEANT4 tag $Name: geant4-09-02 $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2830//
    2931//
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QIonIonElastic.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QIonIonElastic.hh,v 1.2 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QIonIonElastic.hh,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QIonIonElastic header ----------------
     
    3535// @@ This class is on the testing level @@
    3636// -------------------------------------------------------------------------------
    37 // ****************************************************************************************
    38 // ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    39 // ****************************************************************************************
     37// Short description: a simple process for the Ion-Ion elastic scattering.
     38// For heavy by heavy ions it can reach 50% of the total cross-section.
     39// -----------------------------------------------------------------------
    4040
    4141#ifndef G4QIonIonElastic_hh
     
    8484  // (energy, material)
    8585  // The previousStepSize and G4ForceCondition* are not used.
    86   // This function overloads a virtual function of the base class.                   
     86  // This function overloads a virtual function of the base class.       
    8787  // It is invoked by the ProcessManager of the Particle.
    8888 
     
    9090  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    9191  // It computes the final state of the process (at end of step),
    92   // returned as a ParticleChange object.                          
     92  // returned as a ParticleChange object.      
    9393  // This function overloads a virtual function of the base class.
    9494  // It is invoked by the ProcessManager of the Particle.
     
    107107  G4QIonIonElastic(const G4QIonIonElastic&);
    108108
    109                 // BODY
     109  // BODY
    110110  // Static Parameters --------------------------------------------------------------------
    111111  static G4int    nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QLowEnergy.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QLowEnergy.hh,v 1.4 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QLowEnergy.hh,v 1.6 2009/03/09 15:41:17 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QLowEnergy header ----------------
     
    3131//  Header of G4QLowEnergy class (A+A) of the CHIPS Simulation Branch in GEANT4
    3232// -------------------------------------------------------------------------------
    33 // This is a unique CHIPS class for the Ion-Ion Low Energy Inelastic Interaction Prosesses
     33// This is a unique CHIPS class for the Ion-Ion Low Energy Inelastic Interactions
    3434// -------------------------------------------------------------------------------
    3535// At present (Aug-07) it is not tested.
    3636// The normalization is based on the temporary G4QIonIonCrossSection class
    3737// -------------------------------------------------------------------------------
     38// Short description: This is a fast low energy algorithm for the
     39// inelastic interactions of nucleons and nuclei (ions) with nuclei.
     40// This is a fase-space algorithm, but not quark level. Provides
     41// nuclear fragments upto alpha only. Never was tumed (but can be).
     42// ---------------------------------------------------------------
    3843
    3944#ifndef G4QLowEnergy_hh
     
    6065#include "G4QNucleus.hh"
    6166#include "G4QIonIonCrossSection.hh"
     67#include "G4QProtonNuclearCrossSection.hh"
    6268#include "G4QIsotope.hh"
    6369#include "G4QPDGToG4Particle.hh"
     
    8389  // (energy, material)
    8490  // The previousStepSize and G4ForceCondition* are not used.
    85   // This function overloads a virtual function of the base class.                   
     91  // This function overloads a virtual function of the base class.       
    8692  // It is invoked by the ProcessManager of the Particle.
    8793 
     
    8995  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
    9096  // It computes the final state of the process (at end of step),
    91   // returned as a ParticleChange object.                          
     97  // returned as a ParticleChange object.      
    9298  // This function overloads a virtual function of the base class.
    9399  // It is invoked by the ProcessManager of the Particle.
     
    112118  G4double CalculateXS(G4double p, G4int Z, G4int N, G4int pPDG);
    113119
    114                 // BODY
     120  // BODY
    115121  // Static Parameters --------------------------------------------------------------------
    116122  static G4int    nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QMuonNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QMuonNuclearCrossSection.hh,v 1.6 2008/10/24 19:23:25 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QMuonNuclearCrossSection.hh,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3939// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    4040// ****************************************************************************************
     41// Short description: reaction cross-sections for muon-nuclear reactions, which
     42// are integrals over virtual equivalent photons photons. The muon-nuclear GHAD
     43// model (not CHIPS) gives 2-3 times smaller scattering angle and deposited energy.
     44// --------------------------------------------------------------------------------
    4145
    4246#ifndef G4QMuonNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QNeutronNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3232// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-May-02
    3333//
    34 // ****************************************************************************************
    35 // ********* This HEADER is temporary moved from the photolepton_hadron directory *********
    36 // ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    37 // ****************************************************************************************
     34// -------------------------------------------------------------------
     35// Short description: neutron-nuclear cross-section for hadronic CHIPS
     36// -------------------------------------------------------------------
    3837
    3938#ifndef G4QNeutronNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QNuENuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuENuclearCrossSection.hh,v 1.1 2007/10/02 10:00:37 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuENuclearCrossSection.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-SEP-2007
    3434//
    35 // Short description: this G4 singletone class calculates (nu_e,e) Nuclear cross section
     35// Short description: this G4 singletone class calculates (nu_e,e-) Nuclear cross section
    3636// (Energy limit: E<320GeV->badExtrapolation) for a particular isotope (proportional to A)
    3737// ****************************************************************************************
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QNuMuNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuMuNuclearCrossSection.hh,v 1.6 2006/12/01 10:57:46 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuMuNuclearCrossSection.hh,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-DEC-2005
    3434//
    35 // Short description: this G4 singletone class calculates (nu_mu,mu) Nuclear cross section
     35// Short description: this G4 singletone class calculates (nu_mu,mu-) Nuclear cross section
    3636// (Energy limit: E<320GeV->badExtrapolation) for a particular isotope (proportional to A)
    3737// ****************************************************************************************
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QNuNuNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuNuNuclearCrossSection.hh,v 1.1 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuNuNuclearCrossSection.hh,v 1.2 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 20-DEC-2005
    3434//
    35 // Short description: this G4 singletone class calculates (nu_mu,mu) Nuclear cross section
     35// Short description: this G4 singletone class calculates (nu,nu) Nuclear cross section
    3636// (Energy limit: E<320GeV->badExtrapolation) for a particular isotope (proportional to A)
    3737// ****************************************************************************************
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QPhotonNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3636// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3737// ****************************************************************************************
     38// Short description: This is an original CHIPS process for photo-nuclear
     39// interactions, which does not include "fast and dirty" corrections for
     40// reactions near threshold, with respect to the GHAD application of CHIPS.
     41// ------------------------------------------------------------------------
    3842
    3943#ifndef G4QPhotonNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QProtonNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3636// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3737// ****************************************************************************************
     38// Short description: CHIPS cross-sections for proton-nuclear interactions
     39// -----------------------------------------------------------------------
    3840
    3941#ifndef G4QProtonNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QStringChipsParticleLevelInterface.hh

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// Short description: Interface of QGSC to CHIPS (Energy Flow of soft hadrons)
     26// ---------------------------------------------------------------------------
    2527//
    2628#ifndef G4QStringChipsParticleLevelInterface_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QTauNuclearCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QTauNuclearCrossSection.hh,v 1.6 2008/10/24 19:23:48 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QTauNuclearCrossSection.hh,v 1.7 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3939// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    4040// ****************************************************************************************
     41// Short description: reaction cross-sections for tau-nuclear reactions, which
     42// are integrals over virtual equivalent photons photons. The tau-nuclear
     43// reactions do not exist in GHAD, so by the present physics lists it is not
     44// simulated at all.
     45// --------------------------------------------------------------------------------
    4146
    4247#ifndef G4QTauNuclearCrossSection_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QuasiFreeRatios.hh

    r1007 r1055  
    2525//
    2626//
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    3131// M.V. Kossov, ITEP(Moscow), 24-OCT-01
    3232// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-2006
    33 //
     33// ----------------------------------------------------------------------
     34// Short description: Provides percentage of quasi-free and quasi-elastic
     35// reactions in the inelastic reactions.
     36// ----------------------------------------------------------------------
    3437
    3538#ifndef G4QuasiFreeRatios_h
     
    6871  std::pair<G4double,G4double> GetChExFactor(G4double pIU, G4int pPDG, G4int Z, G4int N);
    6972  // scatter (pPDG,p4M) on a virtual nucleon (NPDG,N4M), result: final pair(newN4M,newp4M)
    70   // if(newN4M.e()==0.) - below threshold, XS=0, no scattering of the progectile happened
     73  // if(newN4M.e()==0.) - below threshold, XS=0, no scattering of the projectile happened
    7174  std::pair<G4LorentzVector,G4LorentzVector> Scatter(G4int NPDG, G4LorentzVector N4M,
    7275                                                     G4int pPDG, G4LorentzVector p4M);
     
    9699  static std::vector<G4double*> vL;     // Vector of pointers to LogTable
    97100  static std::vector<std::pair<G4double,G4double>*> vX; // Vector of ETPointers to LogTable
    98 };                                     
     101};
    99102#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4StringChipsInterface.hh

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// !!! Was used in QBBC PL, NOW it is not. Must be absolete !!!
     26// ============================================================
    2527//
    2628#ifndef G4StringChipsInterface_h
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4StringChipsParticleLevelInterface.hh

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// Short description: Interface of QGSC to CHIPS (all soft hadrons)
     26// ----------------------------------------------------------------
    2527//
    2628#ifndef G4StringChipsParticleLevelInterface_h
     
    5961
    6062#ifdef hdebug_SCPLI
    61                 //Static variables for histogramming
     63    //Static variables for histogramming
    6264    static const G4int nbh;
    6365    static       G4double bhmax;
     
    7173    static       G4int*   ehis;
    7274  public:
    73                 //Static functions
    74                   static void Reset()
    75                   {
     75    //Static functions
     76    static void Reset()
     77    {
    7678      bhdb=bhmax/nbh;
    7779      ehde=bhmax/nbh;
     
    8587      }
    8688    }
    87                   static void SetMaxB(G4double mB) {bhmax=mB;}
    88                   static void SetMaxE(G4double mE) {ehmax=mE;}
    89                   static G4int GetB(G4int i){return bhis[i];}
    90                   static G4int GetE(G4int i){return ehis[i];}
    91                   static G4double GetTot()  {return toth;}
    92                   static G4int GetNbn()     {return nbh;}
    93                   static G4double GetDB()   {return bhdb;}
    94                   static G4double GetDE()   {return ehde;}
    95                   static G4int GetBov()     {return bover;}
    96                   static G4int GetEov()     {return eover;}
     89    static void SetMaxB(G4double mB) {bhmax=mB;}
     90    static void SetMaxE(G4double mE) {ehmax=mE;}
     91    static G4int GetB(G4int i){return bhis[i];}
     92    static G4int GetE(G4int i){return ehis[i];}
     93    static G4double GetTot()  {return toth;}
     94    static G4int GetNbn()     {return nbh;}
     95    static G4double GetDB()   {return bhdb;}
     96    static G4double GetDE()   {return ehde;}
     97    static G4int GetBov()     {return bover;}
     98    static G4int GetEov()     {return eover;}
    9799#endif
    98100};
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4VQCrossSection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VQCrossSection.hh,v 1.9 2007/11/15 09:36:43 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VQCrossSection.hh,v 1.10 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    7373// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    7474// ****************************************************************************************
     75// Short description: a basic class for all CHIPS reaction cross-sections.
     76// -----------------------------------------------------------------------
    7577
    7678#ifndef G4VQCrossSection_h
     
    98100  // At present momentum (pMom) must be in GeV (@@ Units)
    99101  virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)
    100                                                                                 {return G4double(pPDG);}
     102                                                                   {return G4double(pPDG);}
    101103
    102104  virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0); // Gives 0 by default
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4ChiralInvariantPhaseSpace.cc

    r819 r1055  
    2424// ********************************************************************
    2525//
    26 
    2726//
    28 // Created:
     27// Created: H.-P. Wellicsh: GHAD model wrapper for the CHIPS model (1997)
    2928// 16.01.08 V.Ivanchenko use initialization similar to other CHIPS models
    3029//
     
    9695                           etaToEtaPrime);
    9796  //  G4QEnvironment::SetParameters(solidAngle);
    98 //  G4cout << "Input info "<< projectilePDGCode << " "
    99 //         << targetPDGCode <<" "
    100 //       << 1./MeV*proj4Mom<<" "
    101 //       << 1./MeV*targ4Mom << " "
    102 //       << nop << G4endl;
     97  //  G4cout << "Input info "<< projectilePDGCode << " "
     98  //         << targetPDGCode <<" "
     99  //     << 1./MeV*proj4Mom<<" "
     100  //     << 1./MeV*targ4Mom << " "
     101  //     << nop << G4endl;
    103102  G4QHadronVector projHV;
    104103  G4QHadron* iH = new G4QHadron(projectilePDGCode, 1./MeV*proj4Mom);
    105104  projHV.push_back(iH);
    106105  G4QEnvironment* pan= new G4QEnvironment(projHV, targetPDGCode);
    107   //G4Quasmon* pan= new G4Quasmon(projectilePDGCode, targetPDGCode, 1./MeV*proj4Mom, 1./MeV*targ4Mom, nop);
     106  //G4Quasmon* pan= new G4Quasmon(projectilePDGCode, targetPDGCode,
     107  //                              1./MeV*proj4Mom, 1./MeV*targ4Mom, nop);
    108108  G4QHadronVector* output=0;
    109109  try
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4GammaNuclearReaction.cc

    r968 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// Short description: The CHIPS model provides the G4QHadronVector
     26// output, which is converted to the G4 particle-singletons
     27// --------------------------------------------------------------------
    2528//
    26 
    27 //
    28 // Created:
     29// Created: J.P. Wellisch, 2000/08/18
    2930// 01.09.2008 V.Ivanchenko
    3031//
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QANuANuNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuANuNuclearCrossSection.cc,v 1.2 2007/11/02 15:57:16 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuANuNuclearCrossSection.cc,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
     40// Short description: Provides the (anti-nu,anti-nu)A cross-section (Created by M. Kossov)
     41// ----------------------------------------------------------------------------------------
    4042
    4143//#define debug
     
    9092        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9193        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     94  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9395#endif
    9496  if(pPDG!=-14)
     
    111113    j  = 0;                            // A#0f records found in DB for this projectile
    112114    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     115    {                                  // The nucleus with projPDG is found in AMDB
    114116      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     117      {
    116118        lastI=i;
    117119        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163165#endif
    164166      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     167    }
     168    if(!in)                            // This nucleus has not been calculated previously
     169    {
    168170#ifdef pdebug
    169171      G4cout<<"G4QAMNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lstI="<<lastI<<G4endl;
     
    172174      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173175      if(lastCS<=0.)
    174                                                 {
     176      {
    175177        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176178#ifdef pdebug
     
    184186          lastTH=pEn;
    185187        }
    186                                                 }
     188      }
    187189#ifdef pdebug
    188190      G4cout<<"G4QAMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200202#endif
    201203      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     204    } // End of creation of the new set of parameters
    203205    else
    204                                 {
     206    {
    205207#ifdef pdebug
    206208      G4cout<<"G4QAMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    274276  {
    275277    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    276                                 {
     278    {
    277279      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    278280      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    279           }
    280           else                              // This isotope wasn't calculated previously => CREATE
    281           {
     281   }
     282   else                              // This isotope wasn't calculated previously => CREATE
     283   {
    282284      if(first)
    283285      {
     
    295297      TX.push_back(lastTX);
    296298      QE.push_back(lastQE);
    297            } // End of creation of the new set of parameters
     299    } // End of creation of the new set of parameters
    298300  } // End of parameters udate
    299301  // ============================== NOW Calculate the Cross Section =====================
     
    310312    G4int sep=ran;  // as a result = an index of the left edge of the interval
    311313    while(ran>=2)
    312                                 {
     314    {
    313315      G4int newran=ran/2;
    314316      if(lastE<=lastEN[sep]) sep-=newran;
     
    357359  static const G4int nE=65; // !! If change this, change it in GetCrossSection() (*.cc) !!
    358360  static const G4double nuEn[nE]={0.,
    359 1.00463e-5,1.05336e-5,1.10692e-5,1.16592e-5,1.23109e-5,1.30323e-5,1.38331e-5,1.47245e-5,
    360 1.57194e-5,1.68335e-5,1.80848e-5,1.94948e-5,2.10894e-5,2.28991e-5,2.49608e-5,2.73189e-5,
    361 3.00273e-5,3.31516e-5,3.67722e-5,4.09881e-5,4.59217e-5,5.17255e-5,5.85908e-5,6.67583e-5,
    362 7.65338e-5,8.83078e-5,.000102583,.000120011,.000141441,.000167995,.000201160,.000242926,
    363 .000295985,.000364008,.000452051,.000567152,.000719210,.000922307,.001196710,.001571930,
    364 .002091530,.002820590,.003857810,.005354930,.007548840,.010815300,.015760100,.023376900,
    365 .035325600,.054430800,.085595700,.137508000,.225898000,.379892000,.654712000,1.15767000,
    366 2.10277000,3.92843000,7.55861000,14.9991000,30.7412000,65.1734000,143.155000,326.326000};
     361  1.00463e-5,1.05336e-5,1.10692e-5,1.16592e-5,1.23109e-5,1.30323e-5,1.38331e-5,1.47245e-5,
     362  1.57194e-5,1.68335e-5,1.80848e-5,1.94948e-5,2.10894e-5,2.28991e-5,2.49608e-5,2.73189e-5,
     363  3.00273e-5,3.31516e-5,3.67722e-5,4.09881e-5,4.59217e-5,5.17255e-5,5.85908e-5,6.67583e-5,
     364  7.65338e-5,8.83078e-5,.000102583,.000120011,.000141441,.000167995,.000201160,.000242926,
     365  .000295985,.000364008,.000452051,.000567152,.000719210,.000922307,.001196710,.001571930,
     366  .002091530,.002820590,.003857810,.005354930,.007548840,.010815300,.015760100,.023376900,
     367  .035325600,.054430800,.085595700,.137508000,.225898000,.379892000,.654712000,1.15767000,
     368  2.10277000,3.92843000,7.55861000,14.9991000,30.7412000,65.1734000,143.155000,326.326000};
    367369  static const G4double TOTX[nE]={0.,
    368 3.63538e-5,3.81165e-5,4.00539e-5,4.21884e-5,4.45454e-5,4.71548e-5,5.00511e-5,5.32747e-5,
    369 5.68730e-5,6.09016e-5,6.54261e-5,7.05246e-5,7.62894e-5,8.28315e-5,9.02838e-5,9.88066e-5,
    370 .000108594,.000119884,.000132964,.000148191,.000166007,.000186959,.000211736,.000241202,
    371 .000276453,.000318890,.000370311,.000433042,.000510116,.000605516,.000724514,.000874144,
    372 .001063870,.001306520,.001619660,.002027520,.002563780,.003275710,.004230080,.005521890,
    373 .007286920,.009719890,.013099700,.018695100,.029208400,.042095000,.059253700,.082373900,
    374 .113071000,.151041000,.191803000,.224208000,.234187000,.217774000,.187139000,.157818000,
    375 .137494000,.125872000,.120462000,.119148000,.120418000,.123027000,.126408000,.129071000};
     370  3.63538e-5,3.81165e-5,4.00539e-5,4.21884e-5,4.45454e-5,4.71548e-5,5.00511e-5,5.32747e-5,
     371  5.68730e-5,6.09016e-5,6.54261e-5,7.05246e-5,7.62894e-5,8.28315e-5,9.02838e-5,9.88066e-5,
     372  .000108594,.000119884,.000132964,.000148191,.000166007,.000186959,.000211736,.000241202,
     373  .000276453,.000318890,.000370311,.000433042,.000510116,.000605516,.000724514,.000874144,
     374  .001063870,.001306520,.001619660,.002027520,.002563780,.003275710,.004230080,.005521890,
     375  .007286920,.009719890,.013099700,.018695100,.029208400,.042095000,.059253700,.082373900,
     376  .113071000,.151041000,.191803000,.224208000,.234187000,.217774000,.187139000,.157818000,
     377  .137494000,.125872000,.120462000,.119148000,.120418000,.123027000,.126408000,.129071000};
    376378  static const G4double QELX[nE]={0.,
    377 .365220e-9,.401502e-9,.443364e-9,.491885e-9,.548393e-9,.614536e-9,.692362e-9,.784441e-9,
    378 .894012e-9,1.02519e-9,1.18322e-9,1.37487e-9,1.60890e-9,1.89677e-9,2.25355e-9,2.69928e-9,
    379 3.26079e-9,3.97433e-9,4.88937e-9,6.07407e-9,7.62331e-9,9.67058e-9,1.24058e-8,1.61022e-8,
    380 2.11580e-8,2.81605e-8,3.79876e-8,5.19696e-8,7.21515e-8,1.01724e-7,1.45743e-7,2.12353e-7,
    381 3.14890e-7,4.75585e-7,7.32171e-7,1.14991e-6,1.84390e-6,3.02121e-6,5.06217e-6,8.68002e-6,
    382 1.52408e-5,2.74159e-5,5.05363e-5,.000100111,.000220489,.000455269,.000933841,.001925650,
    383 .003994300,.008221270,.016417600,.030830400,.052902400,.082519200,.115560000,.149598000,
    384 .184112000,.215102000,.238253000,.252949000,.261267000,.265626000,.267782000,.268791000};
     379  .365220e-9,.401502e-9,.443364e-9,.491885e-9,.548393e-9,.614536e-9,.692362e-9,.784441e-9,
     380  .894012e-9,1.02519e-9,1.18322e-9,1.37487e-9,1.60890e-9,1.89677e-9,2.25355e-9,2.69928e-9,
     381  3.26079e-9,3.97433e-9,4.88937e-9,6.07407e-9,7.62331e-9,9.67058e-9,1.24058e-8,1.61022e-8,
     382  2.11580e-8,2.81605e-8,3.79876e-8,5.19696e-8,7.21515e-8,1.01724e-7,1.45743e-7,2.12353e-7,
     383  3.14890e-7,4.75585e-7,7.32171e-7,1.14991e-6,1.84390e-6,3.02121e-6,5.06217e-6,8.68002e-6,
     384  1.52408e-5,2.74159e-5,5.05363e-5,.000100111,.000220489,.000455269,.000933841,.001925650,
     385  .003994300,.008221270,.016417600,.030830400,.052902400,.082519200,.115560000,.149598000,
     386  .184112000,.215102000,.238253000,.252949000,.261267000,.265626000,.267782000,.268791000};
    385387  // --------------------------------
    386388  G4int first=0;
    387389  if(z<0.)
    388                 {
     390  {
    389391    first=1;
    390392    z=-z;
     
    405407    t[k]=TOTX[k]*nuEn[k]*(za+za)/ta+QELX[k]*(dz+dz-da)/ta; // TotalCrossSection
    406408    q[k]=QELX[k]*dz/a;                                     // QuasiElasticCrossSection
    407         }
     409  }
    408410  return first;
    409411}
     
    421423  static const G4double Xl[nQ2]={5.20224e-16,
    422424 .006125,.0137008,.0218166,.0302652,.0389497,.0478144,.0568228,.0659497,.0751768,.0844898,
    423         .093878,        .103332,        .112844,        .122410,        .132023,        .141680,        .151376,        .161109,        .170875,        .180672,
    424         .190499,        .200352,        .210230,        .220131,        .230055,        .239999,        .249963,        .259945,        .269944,        .279960,
    425         .289992,        .300039,        .310099,        .320173,        .330260,        .340359,        .350470,        .360592,        .370724,        .380867,
    426         .391019,        .401181,        .411352,        .421531,        .431719,        .441915,        .452118,        .462329,        .472547,        .482771,
    427         .493003,        .503240,        .513484,        .523734,        .533989,        .544250,        .554517,        .564788,        .575065,        .585346,
    428         .595632,        .605923,        .616218,        .626517,        .636820,        .647127,        .657438,        .667753,        .678072,        .688394,
    429         .698719,        .709048,        .719380,        .729715,        .740053,        .750394,        .760738,        .771085,        .781434,        .791786,
    430         .802140,        .812497,        .822857,        .833219,        .843582,        .853949,        .864317,        .874687,        .885060,        .895434,
    431         .905810,        .916188,        .926568,        .936950,        .947333,        .957719,        .968105,        .978493,        .988883,        .999275};
    432           // Direct table
     425 .093878, .103332, .112844, .122410, .132023, .141680, .151376, .161109, .170875, .180672,
     426 .190499, .200352, .210230, .220131, .230055, .239999, .249963, .259945, .269944, .279960,
     427 .289992, .300039, .310099, .320173, .330260, .340359, .350470, .360592, .370724, .380867,
     428 .391019, .401181, .411352, .421531, .431719, .441915, .452118, .462329, .472547, .482771,
     429 .493003, .503240, .513484, .523734, .533989, .544250, .554517, .564788, .575065, .585346,
     430 .595632, .605923, .616218, .626517, .636820, .647127, .657438, .667753, .678072, .688394,
     431 .698719, .709048, .719380, .729715, .740053, .750394, .760738, .771085, .781434, .791786,
     432 .802140, .812497, .822857, .833219, .843582, .853949, .864317, .874687, .885060, .895434,
     433 .905810, .916188, .926568, .936950, .947333, .957719, .968105, .978493, .988883, .999275};
     434   // Direct table
    433435  static const G4double Xmax=Xl[lQ2];
    434436  static const G4double Xmin=Xl[0];
    435437  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    436438  static const G4double inl[nQ2]={0,
    437         1.52225,        2.77846,        3.96651,        5.11612,        6.23990,        7.34467,        8.43466,        9.51272,        10.5809,        11.6406,
    438         12.6932,        13.7394,        14.7801,        15.8158,        16.8471,        17.8743,        18.8979,        19.9181,        20.9353,        21.9496,
    439         22.9614,        23.9707,        24.9777,        25.9826,        26.9855,        27.9866,        28.9860,        29.9837,        30.9798,        31.9745,
    440         32.9678,        33.9598,        34.9505,        35.9400,        36.9284,        37.9158,        38.9021,        39.8874,        40.8718,        41.8553,
    441         42.8379,        43.8197,        44.8007,        45.7810,        46.7605,        47.7393,        48.7174,        49.6950,        50.6718,        51.6481,
    442         52.6238,        53.5990,        54.5736,        55.5476,        56.5212,        57.4943,        58.4670,        59.4391,        60.4109,        61.3822,
    443         62.3531,        63.3236,        64.2937,        65.2635,        66.2329,        67.2019,        68.1707,        69.1390,        70.1071,        71.0748,
    444         72.0423,        73.0095,        73.9763,        74.9429,        75.9093,        76.8754,        77.8412,        78.8068,        79.7721,        80.7373,
    445         81.7022,        82.6668,        83.6313,        84.5956,        85.5596,        86.5235,        87.4872,        88.4507,        89.4140,        90.3771,
    446         91.3401,        92.3029,        93.2656,        94.2281,        95.1904,        96.1526,        97.1147,        98.0766,        99.0384,        100.000};
     439 1.52225, 2.77846, 3.96651, 5.11612, 6.23990, 7.34467, 8.43466, 9.51272, 10.5809, 11.6406,
     440 12.6932, 13.7394, 14.7801, 15.8158, 16.8471, 17.8743, 18.8979, 19.9181, 20.9353, 21.9496,
     441 22.9614, 23.9707, 24.9777, 25.9826, 26.9855, 27.9866, 28.9860, 29.9837, 30.9798, 31.9745,
     442 32.9678, 33.9598, 34.9505, 35.9400, 36.9284, 37.9158, 38.9021, 39.8874, 40.8718, 41.8553,
     443 42.8379, 43.8197, 44.8007, 45.7810, 46.7605, 47.7393, 48.7174, 49.6950, 50.6718, 51.6481,
     444 52.6238, 53.5990, 54.5736, 55.5476, 56.5212, 57.4943, 58.4670, 59.4391, 60.4109, 61.3822,
     445 62.3531, 63.3236, 64.2937, 65.2635, 66.2329, 67.2019, 68.1707, 69.1390, 70.1071, 71.0748,
     446 72.0423, 73.0095, 73.9763, 74.9429, 75.9093, 76.8754, 77.8412, 78.8068, 79.7721, 80.7373,
     447 81.7022, 82.6668, 83.6313, 84.5956, 85.5596, 86.5235, 87.4872, 88.4507, 89.4140, 90.3771,
     448 91.3401, 92.3029, 93.2656, 94.2281, 95.1904, 96.1526, 97.1147, 98.0766, 99.0384, 100.000};
    447449  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    448450  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    503505  // Reversed table
    504506  static const G4double X0[nX]={5.21412e-05,
    505         .437860,        .681908,        .891529,        1.08434,        1.26751,        1.44494,        1.61915,        1.79198,        1.96493,        2.13937,
    506         2.31664,        2.49816,        2.68559,        2.88097,        3.08705,        3.30774,        3.54917,        3.82233,        4.15131, 4.62182};
     507 .437860, .681908, .891529, 1.08434, 1.26751, 1.44494, 1.61915, 1.79198, 1.96493, 2.13937,
     508 2.31664, 2.49816, 2.68559, 2.88097, 3.08705, 3.30774, 3.54917, 3.82233, 4.15131, 4.62182};
    507509  static const G4double X1[nX]={.00102591,
    508         1.00443,        1.55828,        2.03126,        2.46406,        2.87311,        3.26723,        3.65199,        4.03134,        4.40835,        4.78561,
    509         5.16549,        5.55031,        5.94252,        6.34484,        6.76049,        7.19349,        7.64917,        8.13502,        8.66246, 9.25086};
     510 1.00443, 1.55828, 2.03126, 2.46406, 2.87311, 3.26723, 3.65199, 4.03134, 4.40835, 4.78561,
     511 5.16549, 5.55031, 5.94252, 6.34484, 6.76049, 7.19349, 7.64917, 8.13502, 8.66246, 9.25086};
    510512  static const G4double X2[nX]={.0120304,
    511         2.59903,        3.98637,        5.15131,        6.20159,        7.18024,        8.10986,        9.00426,        9.87265,        10.7217,        11.5564,
    512         12.3808,        13.1983,        14.0116,        14.8234,        15.6359,        16.4515,        17.2723,        18.1006,        18.9386, 19.7892};
     513 2.59903, 3.98637, 5.15131, 6.20159, 7.18024, 8.10986, 9.00426, 9.87265, 10.7217, 11.5564,
     514 12.3808, 13.1983, 14.0116, 14.8234, 15.6359, 16.4515, 17.2723, 18.1006, 18.9386, 19.7892};
    513515  static const G4double X3[nX]={.060124,
    514         5.73857,        8.62595,        10.9849,        13.0644,        14.9636,        16.7340,        18.4066,        20.0019,        21.5342,        23.0142,
    515         24.4497,        25.8471,        27.2114,        28.5467,        29.8564,        31.1434,        32.4102,        33.6589,        34.8912, 36.1095};
     516 5.73857, 8.62595, 10.9849, 13.0644, 14.9636, 16.7340, 18.4066, 20.0019, 21.5342, 23.0142,
     517 24.4497, 25.8471, 27.2114, 28.5467, 29.8564, 31.1434, 32.4102, 33.6589, 34.8912, 36.1095};
    516518  static const G4double X4[nX]={.0992363,
    517         8.23746,        12.1036,        15.1740,        17.8231,        20.1992,        22.3792,        24.4092,        26.3198,        28.1320,        29.8615,
    518         31.5200,        33.1169,        34.6594,        36.1536,        37.6044,        39.0160,        40.3920,        41.7353,        43.0485, 44.3354};
     519 8.23746, 12.1036, 15.1740, 17.8231, 20.1992, 22.3792, 24.4092, 26.3198, 28.1320, 29.8615,
     520 31.5200, 33.1169, 34.6594, 36.1536, 37.6044, 39.0160, 40.3920, 41.7353, 43.0485, 44.3354};
    519521  static const G4double X5[nX]={.0561127,
    520         7.33661,        10.5694,        13.0778,        15.2061,        17.0893,        18.7973,        20.3717,        21.8400,        23.2211,        24.5291,
    521         25.7745,        26.9655,        28.1087,        29.2094,        30.2721,        31.3003,        32.2972,        33.2656,        34.2076, 35.1265};
     522 7.33661, 10.5694, 13.0778, 15.2061, 17.0893, 18.7973, 20.3717, 21.8400, 23.2211, 24.5291,
     523 25.7745, 26.9655, 28.1087, 29.2094, 30.2721, 31.3003, 32.2972, 33.2656, 34.2076, 35.1265};
    522524  static const G4double X6[nX]={.0145859,
    523         4.81774,        6.83565,        8.37399,        9.66291,        10.7920,        11.8075,        12.7366,        13.5975,        14.4025,        15.1608,
    524         15.8791,        16.5628,        17.2162,        17.8427,        18.4451,        19.0259,        19.5869,        20.1300,        20.6566, 21.1706};
     525 4.81774, 6.83565, 8.37399, 9.66291, 10.7920, 11.8075, 12.7366, 13.5975, 14.4025, 15.1608,
     526 15.8791, 16.5628, 17.2162, 17.8427, 18.4451, 19.0259, 19.5869, 20.1300, 20.6566, 21.1706};
    525527  static const G4double X7[nX]={.00241155,
    526         2.87095,        4.02492,        4.89243,        5.61207,        6.23747,        6.79613,        7.30433,        7.77270,        8.20858,        8.61732,
    527         9.00296,        9.36863,        9.71682,        10.0495,        10.3684,        10.6749,        10.9701,        11.2550,        11.5306, 11.7982};
     528 2.87095, 4.02492, 4.89243, 5.61207, 6.23747, 6.79613, 7.30433, 7.77270, 8.20858, 8.61732,
     529 9.00296, 9.36863, 9.71682, 10.0495, 10.3684, 10.6749, 10.9701, 11.2550, 11.5306, 11.7982};
    528530  static const G4double X8[nX]={.000316863,
    529         1.76189,        2.44632,        2.95477,        3.37292,        3.73378,        4.05420,        4.34415,        4.61009,        4.85651,        5.08666,
    530         5.30299,        5.50738,        5.70134,        5.88609,        6.06262,        6.23178,        6.39425,        6.55065,        6.70149, 6.84742};
     531 1.76189, 2.44632, 2.95477, 3.37292, 3.73378, 4.05420, 4.34415, 4.61009, 4.85651, 5.08666,
     532 5.30299, 5.50738, 5.70134, 5.88609, 6.06262, 6.23178, 6.39425, 6.55065, 6.70149, 6.84742};
    531533  static const G4double X9[nX]={3.73544e-05,
    532         1.17106,        1.61289,        1.93763,        2.20259,        2.42976,        2.63034,        2.81094,        2.97582,        3.12796,        3.26949,
    533         3.40202,        3.52680,        3.64482,        3.75687,        3.86360,        3.96557,        4.06323,        4.15697,        4.24713, 4.33413};
     534 1.17106, 1.61289, 1.93763, 2.20259, 2.42976, 2.63034, 2.81094, 2.97582, 3.12796, 3.26949,
     535 3.40202, 3.52680, 3.64482, 3.75687, 3.86360, 3.96557, 4.06323, 4.15697, 4.24713, 4.33413};
    534536  static const G4double XA[nX]={4.19131e-06,
    535         .849573,        1.16208,        1.38955,        1.57379,        1.73079,        1.86867,        1.99221,        2.10451,        2.20770,        2.30332,
    536         2.39252,        2.47622,        2.55511,        2.62977,        2.70066,        2.76818,        2.83265,        2.89437,        2.95355, 3.01051};
     537 .849573, 1.16208, 1.38955, 1.57379, 1.73079, 1.86867, 1.99221, 2.10451, 2.20770, 2.30332,
     538 2.39252, 2.47622, 2.55511, 2.62977, 2.70066, 2.76818, 2.83265, 2.89437, 2.95355, 3.01051};
    537539  static const G4double XB[nX]={4.59981e-07,
    538         .666131,        .905836,        1.07880,        1.21796,        1.33587,        1.43890,        1.53080,        1.61399,        1.69011,        1.76040,
    539         1.82573,        1.88682,        1.94421,        1.99834,        2.04959,        2.09824,        2.14457,        2.18878,        2.23107, 2.27162};
     540 .666131, .905836, 1.07880, 1.21796, 1.33587, 1.43890, 1.53080, 1.61399, 1.69011, 1.76040,
     541 1.82573, 1.88682, 1.94421, 1.99834, 2.04959, 2.09824, 2.14457, 2.18878, 2.23107, 2.27162};
    540542  static const G4double XC[nX]={4.99861e-08,
    541         .556280,        .752730,        .893387,        1.00587,        1.10070,        1.18317,        1.25643,        1.32247,        1.38269,        1.43809,
    542         1.48941,        1.53724,        1.58203,        1.62416,        1.66391,        1.70155,        1.73728,        1.77128,        1.80371, 1.83473};
     543 .556280, .752730, .893387, 1.00587, 1.10070, 1.18317, 1.25643, 1.32247, 1.38269, 1.43809,
     544 1.48941, 1.53724, 1.58203, 1.62416, 1.66391, 1.70155, 1.73728, 1.77128, 1.80371, 1.83473};
    543545  static const G4double XD[nX]={5.40832e-09,
    544         .488069,        .657650,        .778236,        .874148,        .954621,        1.02432,        1.08599,        1.14138,        1.19172,        1.23787,
    545         1.28049,        1.32008,        1.35705,        1.39172,        1.42434,        1.45514,        1.48429,        1.51197,        1.53829, 1.56339};
     546 .488069, .657650, .778236, .874148, .954621, 1.02432, 1.08599, 1.14138, 1.19172, 1.23787,
     547 1.28049, 1.32008, 1.35705, 1.39172, 1.42434, 1.45514, 1.48429, 1.51197, 1.53829, 1.56339};
    546548  static const G4double XE[nX]={5.84029e-10,
    547         .445057,        .597434,        .705099,        .790298,        .861468,        .922865,        .976982,        1.02542,        1.06930,        1.10939,
    548         1.14630,        1.18050,        1.21233,        1.24208,        1.27001,        1.29630,        1.32113,        1.34462,        1.36691, 1.38812};
     549 .445057, .597434, .705099, .790298, .861468, .922865, .976982, 1.02542, 1.06930, 1.10939,
     550 1.14630, 1.18050, 1.21233, 1.24208, 1.27001, 1.29630, 1.32113, 1.34462, 1.36691, 1.38812};
    549551  static const G4double XF[nX]={6.30137e-11,
    550         .418735,        .560003,        .659168,        .737230,        .802138,        .857898,        .906854,        .950515,        .989915,        1.02580,
    551         1.05873,        1.08913,        1.11734,        1.14364,        1.16824,        1.19133,        1.21306,        1.23358,        1.25298, 1.27139};
     552 .418735, .560003, .659168, .737230, .802138, .857898, .906854, .950515, .989915, 1.02580,
     553 1.05873, 1.08913, 1.11734, 1.14364, 1.16824, 1.19133, 1.21306, 1.23358, 1.25298, 1.27139};
    552554  static const G4double XG[nX]={6.79627e-12,
    553         .405286,        .539651,        .633227,        .706417,        .766929,        .818642,        .863824,        .903931,        .939963,        .972639,
    554         1.00250,        1.02995,        1.05532,        1.07887,        1.10082,        1.12134,        1.14058,        1.15867,        1.17572, 1.19183};
     555 .405286, .539651, .633227, .706417, .766929, .818642, .863824, .903931, .939963, .972639,
     556 1.00250, 1.02995, 1.05532, 1.07887, 1.10082, 1.12134, 1.14058, 1.15867, 1.17572, 1.19183};
    555557  static const G4double XH[nX]={7.32882e-13,
    556         .404391,        .535199,        .625259,        .695036,        .752243,        .800752,        .842823,        .879906,        .912994,        .942802,
    557         .969862,        .994583,        1.01729,        1.03823,        1.05763,        1.07566,        1.09246,        1.10816,        1.12286, 1.13667};
     558 .404391, .535199, .625259, .695036, .752243, .800752, .842823, .879906, .912994, .942802,
     559 .969862, .994583, 1.01729, 1.03823, 1.05763, 1.07566, 1.09246, 1.10816, 1.12286, 1.13667};
    558560  static const G4double XI[nX]={7.90251e-14,
    559         .418084,        .548382,        .636489,        .703728,        .758106,        .803630,        .842633,        .876608,        .906576,        .933269,
    560         .957233,        .978886,        .998556,        1.01651,        1.03295,        1.04807,        1.06201,        1.07489,        1.08683, 1.09792};
     561 .418084, .548382, .636489, .703728, .758106, .803630, .842633, .876608, .906576, .933269,
     562 .957233, .978886, .998556, 1.01651, 1.03295, 1.04807, 1.06201, 1.07489, 1.08683, 1.09792};
    561563  static const G4double XJ[nX]={8.52083e-15,
    562         .447299,        .579635,        .666780,        .731788,        .783268,        .825512,        .861013,        .891356,        .917626,        .940597,
    563         .960842,        .978802,        .994820,        1.00917,        1.02208,        1.03373,        1.04427,        1.05383,        1.06253, 1.07046};
     564 .447299, .579635, .666780, .731788, .783268, .825512, .861013, .891356, .917626, .940597,
     565 .960842, .978802, .994820, 1.00917, 1.02208, 1.03373, 1.04427, 1.05383, 1.06253, 1.07046};
    564566  // Direct table
    565567  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    574576                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    575577  static const G4double I0[nX]={0,
    576         .354631,        1.08972,        2.05138,        3.16564,        4.38343,        5.66828,        6.99127,        8.32858,        9.65998,        10.9680,
    577         12.2371,        13.4536,        14.6050,        15.6802,        16.6686,        17.5609,        18.3482,        19.0221,        19.5752,        20.0000};
     578 .354631, 1.08972, 2.05138, 3.16564, 4.38343, 5.66828, 6.99127, 8.32858, 9.65998, 10.9680,
     579 12.2371, 13.4536, 14.6050, 15.6802, 16.6686, 17.5609, 18.3482, 19.0221, 19.5752, 20.0000};
    578580  static const G4double I1[nX]={0,
    579         .281625,        .877354,        1.67084,        2.60566,        3.64420,        4.75838,        5.92589,        7.12829,        8.34989,        9.57708,
    580         10.7978,        12.0014,        13.1781,        14.3190,        15.4162,        16.4620,        17.4496,        18.3724,        19.2245,        20.0000};
     581 .281625, .877354, 1.67084, 2.60566, 3.64420, 4.75838, 5.92589, 7.12829, 8.34989, 9.57708,
     582 10.7978, 12.0014, 13.1781, 14.3190, 15.4162, 16.4620, 17.4496, 18.3724, 19.2245, 20.0000};
    581583  static const G4double I2[nX]={0,
    582         .201909,        .642991,        1.24946,        1.98463,        2.82370,        3.74802,        4.74263,        5.79509,        6.89474,        8.03228,
    583         9.19947,        10.3889,        11.5938,        12.8082,        14.0262,        15.2427,        16.4527,        17.6518,        18.8356,        20.0000};
     584 .201909, .642991, 1.24946, 1.98463, 2.82370, 3.74802, 4.74263, 5.79509, 6.89474, 8.03228,
     585 9.19947, 10.3889, 11.5938, 12.8082, 14.0262, 15.2427, 16.4527, 17.6518, 18.8356, 20.0000};
    584586  static const G4double I3[nX]={0,
    585         .140937,        .461189,        .920216,        1.49706,        2.17728,        2.94985,        3.80580,        4.73758,        5.73867,        6.80331,
    586         7.92637,        9.10316,        10.3294,        11.6013,        12.9150,        14.2672,        15.6548,        17.0746,        18.5239,        20.0000};
     587 .140937, .461189, .920216, 1.49706, 2.17728, 2.94985, 3.80580, 4.73758, 5.73867, 6.80331,
     588 7.92637, 9.10316, 10.3294, 11.6013, 12.9150, 14.2672, 15.6548, 17.0746, 18.5239, 20.0000};
    587589  static const G4double I4[nX]={0,
    588         .099161,        .337358,        .694560,        1.16037,        1.72761,        2.39078,        3.14540,        3.98768,        4.91433,        5.92245,
    589         7.00942,        8.17287,        9.41060,        10.7206,        12.1010,        13.5500,        15.0659,        16.6472,        18.2924,        20.0000};
     590 .099161, .337358, .694560, 1.16037, 1.72761, 2.39078, 3.14540, 3.98768, 4.91433, 5.92245,
     591 7.00942, 8.17287, 9.41060, 10.7206, 12.1010, 13.5500, 15.0659, 16.6472, 18.2924, 20.0000};
    590592  static const G4double I5[nX]={0,
    591         .071131,        .255084,        .543312,        .932025,        1.41892,        2.00243,        2.68144,        3.45512,        4.32283,        5.28411,
    592         6.33859,        7.48602,        8.72621,        10.0590,        11.4844,        13.0023,        14.6128,        16.3158,        18.1115,        20.0000};
     593 .071131, .255084, .543312, .932025, 1.41892, 2.00243, 2.68144, 3.45512, 4.32283, 5.28411,
     594 6.33859, 7.48602, 8.72621, 10.0590, 11.4844, 13.0023, 14.6128, 16.3158, 18.1115, 20.0000};
    593595  static const G4double I6[nX]={0,
    594         .053692,        .202354,        .443946,        .778765,        1.20774,        1.73208,        2.35319,        3.07256,        3.89177,        4.81249,
    595         5.83641,        6.96528,        8.20092,        9.54516,        10.9999,        12.5670,        14.2486,        16.0466,        17.9630,        20.0000};
     596 .053692, .202354, .443946, .778765, 1.20774, 1.73208, 2.35319, 3.07256, 3.89177, 4.81249,
     597 5.83641, 6.96528, 8.20092, 9.54516, 10.9999, 12.5670, 14.2486, 16.0466, 17.9630, 20.0000};
    596598  static const G4double I7[nX]={0,
    597         .043065,        .168099,        .376879,        .672273,        1.05738,        1.53543,        2.10973,        2.78364,        3.56065,        4.44429,
    598         5.43819,        6.54610,        7.77186,        9.11940,        10.5928,        12.1963,        13.9342,        15.8110,        17.8313,        20.0000};
     599 .043065, .168099, .376879, .672273, 1.05738, 1.53543, 2.10973, 2.78364, 3.56065, 4.44429,
     600 5.43819, 6.54610, 7.77186, 9.11940, 10.5928, 12.1963, 13.9342, 15.8110, 17.8313, 20.0000};
    599601  static const G4double I8[nX]={0,
    600         .036051,        .143997,        .327877,        .592202,        .941572,        1.38068,        1.91433,        2.54746,        3.28517,        4.13277,
    601         5.09574,        6.17984,        7.39106,        8.73568,        10.2203,        11.8519,        13.6377,        15.5854,        17.7033,        20.0000};
     602 .036051, .143997, .327877, .592202, .941572, 1.38068, 1.91433, 2.54746, 3.28517, 4.13277,
     603 5.09574, 6.17984, 7.39106, 8.73568, 10.2203, 11.8519, 13.6377, 15.5854, 17.7033, 20.0000};
    602604  static const G4double I9[nX]={0,
    603         .030977,        .125727,        .289605,        .528146,        .846967,        1.25183,        1.74871,        2.34384,        3.04376,        3.85535,
    604         4.78594,        5.84329,        7.03567,        8.37194,        9.86163,        11.5150,        13.3430,        15.3576,        17.5719,        20.0000};
     605 .030977, .125727, .289605, .528146, .846967, 1.25183, 1.74871, 2.34384, 3.04376, 3.85535,
     606 4.78594, 5.84329, 7.03567, 8.37194, 9.86163, 11.5150, 13.3430, 15.3576, 17.5719, 20.0000};
    605607  static const G4double IA[nX]={0,
    606         .027129,        .111420,        .258935,        .475812,        .768320,        1.14297,        1.60661,        2.16648,        2.83034,        3.60650,
    607         4.50394,        5.53238,        6.70244,        8.02569,        9.51488,        11.1841,        13.0488,        15.1264,        17.4362,        20.0000};
     608 .027129, .111420, .258935, .475812, .768320, 1.14297, 1.60661, 2.16648, 2.83034, 3.60650,
     609 4.50394, 5.53238, 6.70244, 8.02569, 9.51488, 11.1841, 13.0488, 15.1264, 17.4362, 20.0000};
    608610  static const G4double IB[nX]={0,
    609         .024170,        .100153,        .234345,        .433198,        .703363,        1.05184,        1.48607,        2.01409,        2.64459,        3.38708,
    610         4.25198,        5.25084,        6.39647,        7.70319,        9.18708,        10.8663,        12.7617,        14.8968,        17.2990,        20.0000};
     611 .024170, .100153, .234345, .433198, .703363, 1.05184, 1.48607, 2.01409, 2.64459, 3.38708,
     612 4.25198, 5.25084, 6.39647, 7.70319, 9.18708, 10.8663, 12.7617, 14.8968, 17.2990, 20.0000};
    611613  static const G4double IC[nX]={0,
    612         .021877,        .091263,        .214670,        .398677,        .650133,        .976322,        1.38510,        1.88504,        2.48555,        3.19709,
    613         4.03129,        5.00127,        6.12184,        7.40989,        8.88482,        10.5690,        12.4888,        14.6748,        17.1638,        20.0000};
     614 .021877, .091263, .214670, .398677, .650133, .976322, 1.38510, 1.88504, 2.48555, 3.19709,
     615 4.03129, 5.00127, 6.12184, 7.40989, 8.88482, 10.5690, 12.4888, 14.6748, 17.1638, 20.0000};
    614616  static const G4double ID[nX]={0,
    615         .020062,        .084127,        .198702,        .370384,        .606100,        .913288,        1.30006,        1.77535,        2.34912,        3.03253,
    616         3.83822,        4.78063,        5.87634,        7.14459,        8.60791,        10.2929,        12.2315,        14.4621,        17.0320,        20.0000};
     617 .020062, .084127, .198702, .370384, .606100, .913288, 1.30006, 1.77535, 2.34912, 3.03253,
     618 3.83822, 4.78063, 5.87634, 7.14459, 8.60791, 10.2929, 12.2315, 14.4621, 17.0320, 20.0000};
    617619  static const G4double IE[nX]={0,
    618         .018547,        .078104,        .185102,        .346090,        .567998,        .858331,        1.22535,        1.67824,        2.22735,        2.88443,
    619         3.66294,        4.57845,        5.64911,        6.89637,        8.34578,        10.0282,        11.9812,        14.2519,        16.8993,        20.0000};
     620 .018547, .078104, .185102, .346090, .567998, .858331, 1.22535, 1.67824, 2.22735, 2.88443,
     621 3.66294, 4.57845, 5.64911, 6.89637, 8.34578, 10.0282, 11.9812, 14.2519, 16.8993, 20.0000};
    620622  static const G4double IF[nX]={0,
    621         .017143,        .072466,        .172271,        .323007,        .531545,        .805393,        1.15288,        1.58338,        2.10754,        2.73758,
    622         3.48769,        4.37450,        5.41770,        6.64092,        8.07288,        9.74894,        11.7135,        14.0232,        16.7522,        20.0000};
     623 .017143, .072466, .172271, .323007, .531545, .805393, 1.15288, 1.58338, 2.10754, 2.73758,
     624 3.48769, 4.37450, 5.41770, 6.64092, 8.07288, 9.74894, 11.7135, 14.0232, 16.7522, 20.0000};
    623625  static const G4double IG[nX]={0,
    624         .015618,        .066285,        .158094,        .297316,        .490692,        .745653,        1.07053,        1.47479,        1.96931,        2.56677,
    625         3.28205,        4.13289,        5.14068,        6.33158,        7.73808,        9.40133,        11.3745,        13.7279,        16.5577,        20.0000};
     626 .015618, .066285, .158094, .297316, .490692, .745653, 1.07053, 1.47479, 1.96931, 2.56677,
     627 3.28205, 4.13289, 5.14068, 6.33158, 7.73808, 9.40133, 11.3745, 13.7279, 16.5577, 20.0000};
    626628  static const G4double IH[nX]={0,
    627         .013702,        .058434,        .139923,        .264115,        .437466,        .667179,        .961433,        1.32965,        1.78283,        2.33399,
    628         2.99871,        3.79596,        4.74916,        5.88771,        7.24937,        8.88367,        10.8576,        13.2646,        16.2417,        20.0000};
     629 .013702, .058434, .139923, .264115, .437466, .667179, .961433, 1.32965, 1.78283, 2.33399,
     630 2.99871, 3.79596, 4.74916, 5.88771, 7.24937, 8.88367, 10.8576, 13.2646, 16.2417, 20.0000};
    629631  static const G4double II[nX]={0,
    630         .011264,        .048311,        .116235,        .220381,        .366634,        .561656,        .813132,        1.13008,        1.52322,        2.00554,
    631         2.59296,        3.30542,        4.16834,        5.21490,        6.48964,        8.05434,        9.99835,        12.4580,        15.6567,        20.0000};
     632 .011264, .048311, .116235, .220381, .366634, .561656, .813132, 1.13008, 1.52322, 2.00554,
     633 2.59296, 3.30542, 4.16834, 5.21490, 6.48964, 8.05434, 9.99835, 12.4580, 15.6567, 20.0000};
    632634  static const G4double IJ[nX]={0,
    633         .008628,        .037206,        .089928,        .171242,        .286114,        .440251,        .640343,        .894382,        1.21208,        1.60544,
    634         2.08962,        2.68414,        3.41486,        4.31700,        5.44048,        6.85936,        8.69067,        11.1358,        14.5885,        20.0000};
     635 .008628, .037206, .089928, .171242, .286114, .440251, .640343, .894382, 1.21208, 1.60544,
     636 2.08962, 2.68414, 3.41486, 4.31700, 5.44048, 6.85936, 8.69067, 11.1358, 14.5885, 20.0000};
    635637  static const G4double* Il[nE]=
    636638                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    637639  static const G4double lE[nE]={
    638 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    639  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     640-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     641 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    640642  static const G4double lEmi=lE[0];
    641643  static const G4double lEma=lE[nE-1];
    642644  static const G4double dlE=(lEma-lEmi)/bE;
    643         //***************************************************************************************
     645  //***************************************************************************************
    644646  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    645647  G4double lEn=std::log(Enu);         // log(E) for interpolation
     
    727729}
    728730
    729 // This class can provide only virtual exchange pi+ (a substitute for W+ boson)
     731// This class can provide only virtual exchange by gamma (a substitute for Z0 boson)
    730732G4int G4QANuANuNuclearCrossSection::GetExchangePDGCode() {return 22;}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QANuENuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuENuclearCrossSection.cc,v 1.2 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuENuclearCrossSection.cc,v 1.4 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // G4 Physics class: G4QANuENuclearCrossSection for (anti_ni_e,e+) cross sections
     31// G4 Physics class: G4QANuENuclearCrossSection for (anti_nu_e,e+) cross sections
    3232// Created: M.V. Kossov, CERN/ITEP(Moscow), 24-SEP-2007
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 24-SEP-2007
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
    4040
    4141//#define debug
     
    9090        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9191        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     92  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9393#endif
    9494  if(pPDG!=-12)
     
    111111    j  = 0;                            // A#0f records found in DB for this projectile
    112112    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     113    {                                  // The nucleus with projPDG is found in AMDB
    114114      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     115      {
    116116        lastI=i;
    117117        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163163#endif
    164164      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    168168#ifdef pdebug
    169169      G4cout<<"G4QAENCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lstI="<<lastI<<G4endl;
     
    172172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173173      if(lastCS<=0.)
    174                                                 {
     174      {
    175175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176176#ifdef pdebug
     
    184184          lastTH=pEn;
    185185        }
    186                                                 }
     186      }
    187187#ifdef pdebug
    188188      G4cout<<"G4QAENCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200200#endif
    201201      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    203203    else
    204                                 {
     204    {
    205205#ifdef pdebug
    206206      G4cout<<"G4QAENCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    245245G4double G4QANuENuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
    246246{
    247   //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1.,0.)/GeV;
    248   //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1.,1.)/GeV;
    249   //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2.,1.)/GeV/2.;
     247  //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/GeV;
     248  //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/GeV;
     249  //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2,1)/GeV/2.;
    250250  static const G4double mN=.931494043;// Nucleon mass (inside nucleus, AtomicMassUnit, GeV)
    251251  static const G4double dmN=mN+mN;    // Doubled nucleon mass (2*AtomicMassUnit, GeV)
     
    294294  {
    295295    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    296                                 {
     296    {
    297297      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    298298      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    299           }
    300           else                              // This isotope wasn't calculated previously => CREATE
    301           {
     299   }
     300   else                              // This isotope wasn't calculated previously => CREATE
     301   {
    302302      if(first)
    303303      {
     
    315315      TX.push_back(lastTX);
    316316      QE.push_back(lastQE);
    317            } // End of creation of the new set of parameters
     317    } // End of creation of the new set of parameters
    318318  } // End of parameters udate
    319319  // ============================== NOW Calculate the Cross Section =====================
     
    330330    G4int sep=ran;  // as a result = an index of the left edge of the interval
    331331    while(ran>=2)
    332                                 {
     332    {
    333333      G4int newran=ran/2;
    334334      G4double oldL=lastEN[sep];
     
    386386  static const G4int nE=65; // !! If change this, change it in CalculateCrossSection() !!
    387387  static const G4double nuEn[nE]={thresh,
    388 .00051331,.00053602,.00056078,.00058783,.00061743,.00064990,.00068559,.00072492,
    389 .00076834,.00081641,.00086975,.00092912,.00099536,.00106950,.00115273,.00124646,
    390 .00135235,.00147241,.00160901,.00176503,.00194392,.00214986,.00238797,.00266448,
    391 .00298709,.00336531,.00381094,.00433879,.00496745,.00572047,.00662785,.00772806,
    392 .00907075,.01072050,.01276190,.01530660,.01850330,.02255110,.02771990,.03437780,
    393 .04303240,.05438970,.06944210,.08959920,.11688400,.15423600,.20597200,.27851200,
    394 .38153100,.52979600,.74616300,1.0665200,1.5480900,2.2834800,3.4251100,5.2281000,
    395 8.1270200,12.875900,20.808500,34.331200,57.877800,99.796200,176.16300,318.68200};
     388    .00051331,.00053602,.00056078,.00058783,.00061743,.00064990,.00068559,.00072492,
     389    .00076834,.00081641,.00086975,.00092912,.00099536,.00106950,.00115273,.00124646,
     390    .00135235,.00147241,.00160901,.00176503,.00194392,.00214986,.00238797,.00266448,
     391    .00298709,.00336531,.00381094,.00433879,.00496745,.00572047,.00662785,.00772806,
     392    .00907075,.01072050,.01276190,.01530660,.01850330,.02255110,.02771990,.03437780,
     393    .04303240,.05438970,.06944210,.08959920,.11688400,.15423600,.20597200,.27851200,
     394    .38153100,.52979600,.74616300,1.0665200,1.5480900,2.2834800,3.4251100,5.2281000,
     395    8.1270200,12.875900,20.808500,34.331200,57.877800,99.796200,176.16300,318.68200};
    396396  static const G4double TOTX[nE]={0.,
    397 .00046923,.00160693,.00229560,.00288772,.00344344,.00398831,.00453725,.00510087,
    398 .00568797,.00630663,.00696489,.00767121,.00843477,.00926586,.01017610,.01117910,
    399 .01229040,.01352820,.01491430,.01647420,.01823820,.02024280,.02253130,.02515600,
    400 .02818010,.03167950,.03574640,.04049260,.04605330,.05739330,.07028190,.08396290,
    401 .09969400,.11756200,.13812500,.16207000,.19099600,.22447700,.26434900,.31051900,
    402 .36357400,.42242900,.48500000,.54692800,.60140500,.63996800,.65519300,.64339200,
    403 .60784300,.55734400,.50212600,.45116800,.40962600,.37854800,.35702100,.34330900,
    404 .33576200,.33300100,.33387100,.33737700,.34235200,.34880100,.35507500,.35961200};
     397    .00046923,.00160693,.00229560,.00288772,.00344344,.00398831,.00453725,.00510087,
     398    .00568797,.00630663,.00696489,.00767121,.00843477,.00926586,.01017610,.01117910,
     399    .01229040,.01352820,.01491430,.01647420,.01823820,.02024280,.02253130,.02515600,
     400    .02818010,.03167950,.03574640,.04049260,.04605330,.05739330,.07028190,.08396290,
     401    .09969400,.11756200,.13812500,.16207000,.19099600,.22447700,.26434900,.31051900,
     402    .36357400,.42242900,.48500000,.54692800,.60140500,.63996800,.65519300,.64339200,
     403    .60784300,.55734400,.50212600,.45116800,.40962600,.37854800,.35702100,.34330900,
     404    .33576200,.33300100,.33387100,.33737700,.34235200,.34880100,.35507500,.35961200};
    405405  static const G4double QELX[nE]={0.,
    406 2.40856e-7,8.61338e-7,1.28732e-6,1.69747e-6,2.12608e-6,2.59201e-6,3.11071e-6,3.69770e-6,
    407 4.37028e-6,5.14877e-6,6.05773e-6,7.12746e-6,8.39567e-6,9.90987e-6,1.17304e-5,1.39343e-5,
    408 1.66209e-5,1.99191e-5,2.39974e-5,2.90775e-5,3.54536e-5,4.35191e-5,5.38039e-5,6.70278e-5,
    409 8.41765e-5,.000106611,.000136228,.000175689,.000228768,.000328317,.000465818,.000648870,
    410 .000904299,.001260330,.001762740,.002480740,.003534040,.005062210,.007327720,.010675000,
    411 .015645500,.022975800,.033679400,.049004300,.070294800,.098706100,.134951000,.179193000,
    412 .231297000,.287287000,.344760000,.404397000,.465915000,.527060000,.584085000,.632748000,
    413 .671346000,.699744000,.719355000,.732541000,.740996000,.746249000,.749265000,.751160000};
     406  2.40856e-7,8.61338e-7,1.28732e-6,1.69747e-6,2.12608e-6,2.59201e-6,3.11071e-6,3.69770e-6,
     407  4.37028e-6,5.14877e-6,6.05773e-6,7.12746e-6,8.39567e-6,9.90987e-6,1.17304e-5,1.39343e-5,
     408  1.66209e-5,1.99191e-5,2.39974e-5,2.90775e-5,3.54536e-5,4.35191e-5,5.38039e-5,6.70278e-5,
     409  8.41765e-5,.000106611,.000136228,.000175689,.000228768,.000328317,.000465818,.000648870,
     410  .000904299,.001260330,.001762740,.002480740,.003534040,.005062210,.007327720,.010675000,
     411  .015645500,.022975800,.033679400,.049004300,.070294800,.098706100,.134951000,.179193000,
     412  .231297000,.287287000,.344760000,.404397000,.465915000,.527060000,.584085000,.632748000,
     413  .671346000,.699744000,.719355000,.732541000,.740996000,.746249000,.749265000,.751160000};
    414414  // --------------------------------
    415415  G4int first=0;
    416416  if(z<0.)
    417                 {
     417  {
    418418    first=1;
    419419    z=-z;
     
    434434    t[k]=TOTX[k]*nuEn[k]*(za+za)/ta+QELX[k]*(dz+dz-da)/ta; // TotalCrossSection
    435435    q[k]=QELX[k]*dz/a;                                     // QuasiElasticCrossSection
    436         }
     436  }
    437437  return first;
    438438}
     
    454454  static const G4double Xl[nQ2]={5.20224e-16,
    455455 .006125,.0137008,.0218166,.0302652,.0389497,.0478144,.0568228,.0659497,.0751768,.0844898,
    456         .093878,        .103332,        .112844,        .122410,        .132023,        .141680,        .151376,        .161109,        .170875,        .180672,
    457         .190499,        .200352,        .210230,        .220131,        .230055,        .239999,        .249963,        .259945,        .269944,        .279960,
    458         .289992,        .300039,        .310099,        .320173,        .330260,        .340359,        .350470,        .360592,        .370724,        .380867,
    459         .391019,        .401181,        .411352,        .421531,        .431719,        .441915,        .452118,        .462329,        .472547,        .482771,
    460         .493003,        .503240,        .513484,        .523734,        .533989,        .544250,        .554517,        .564788,        .575065,        .585346,
    461         .595632,        .605923,        .616218,        .626517,        .636820,        .647127,        .657438,        .667753,        .678072,        .688394,
    462         .698719,        .709048,        .719380,        .729715,        .740053,        .750394,        .760738,        .771085,        .781434,        .791786,
    463         .802140,        .812497,        .822857,        .833219,        .843582,        .853949,        .864317,        .874687,        .885060,        .895434,
    464         .905810,        .916188,        .926568,        .936950,        .947333,        .957719,        .968105,        .978493,        .988883,        .999275};
    465           // Direct table
     456 .093878, .103332, .112844, .122410, .132023, .141680, .151376, .161109, .170875, .180672,
     457 .190499, .200352, .210230, .220131, .230055, .239999, .249963, .259945, .269944, .279960,
     458 .289992, .300039, .310099, .320173, .330260, .340359, .350470, .360592, .370724, .380867,
     459 .391019, .401181, .411352, .421531, .431719, .441915, .452118, .462329, .472547, .482771,
     460 .493003, .503240, .513484, .523734, .533989, .544250, .554517, .564788, .575065, .585346,
     461 .595632, .605923, .616218, .626517, .636820, .647127, .657438, .667753, .678072, .688394,
     462 .698719, .709048, .719380, .729715, .740053, .750394, .760738, .771085, .781434, .791786,
     463 .802140, .812497, .822857, .833219, .843582, .853949, .864317, .874687, .885060, .895434,
     464 .905810, .916188, .926568, .936950, .947333, .957719, .968105, .978493, .988883, .999275};
     465   // Direct table
    466466  static const G4double Xmax=Xl[lQ2];
    467467  static const G4double Xmin=Xl[0];
    468468  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    469469  static const G4double inl[nQ2]={0,
    470         1.52225,        2.77846,        3.96651,        5.11612,        6.23990,        7.34467,        8.43466,        9.51272,        10.5809,        11.6406,
    471         12.6932,        13.7394,        14.7801,        15.8158,        16.8471,        17.8743,        18.8979,        19.9181,        20.9353,        21.9496,
    472         22.9614,        23.9707,        24.9777,        25.9826,        26.9855,        27.9866,        28.9860,        29.9837,        30.9798,        31.9745,
    473         32.9678,        33.9598,        34.9505,        35.9400,        36.9284,        37.9158,        38.9021,        39.8874,        40.8718,        41.8553,
    474         42.8379,        43.8197,        44.8007,        45.7810,        46.7605,        47.7393,        48.7174,        49.6950,        50.6718,        51.6481,
    475         52.6238,        53.5990,        54.5736,        55.5476,        56.5212,        57.4943,        58.4670,        59.4391,        60.4109,        61.3822,
    476         62.3531,        63.3236,        64.2937,        65.2635,        66.2329,        67.2019,        68.1707,        69.1390,        70.1071,        71.0748,
    477         72.0423,        73.0095,        73.9763,        74.9429,        75.9093,        76.8754,        77.8412,        78.8068,        79.7721,        80.7373,
    478         81.7022,        82.6668,        83.6313,        84.5956,        85.5596,        86.5235,        87.4872,        88.4507,        89.4140,        90.3771,
    479         91.3401,        92.3029,        93.2656,        94.2281,        95.1904,        96.1526,        97.1147,        98.0766,        99.0384,        100.000};
     470 1.52225, 2.77846, 3.96651, 5.11612, 6.23990, 7.34467, 8.43466, 9.51272, 10.5809, 11.6406,
     471 12.6932, 13.7394, 14.7801, 15.8158, 16.8471, 17.8743, 18.8979, 19.9181, 20.9353, 21.9496,
     472 22.9614, 23.9707, 24.9777, 25.9826, 26.9855, 27.9866, 28.9860, 29.9837, 30.9798, 31.9745,
     473 32.9678, 33.9598, 34.9505, 35.9400, 36.9284, 37.9158, 38.9021, 39.8874, 40.8718, 41.8553,
     474 42.8379, 43.8197, 44.8007, 45.7810, 46.7605, 47.7393, 48.7174, 49.6950, 50.6718, 51.6481,
     475 52.6238, 53.5990, 54.5736, 55.5476, 56.5212, 57.4943, 58.4670, 59.4391, 60.4109, 61.3822,
     476 62.3531, 63.3236, 64.2937, 65.2635, 66.2329, 67.2019, 68.1707, 69.1390, 70.1071, 71.0748,
     477 72.0423, 73.0095, 73.9763, 74.9429, 75.9093, 76.8754, 77.8412, 78.8068, 79.7721, 80.7373,
     478 81.7022, 82.6668, 83.6313, 84.5956, 85.5596, 86.5235, 87.4872, 88.4507, 89.4140, 90.3771,
     479 91.3401, 92.3029, 93.2656, 94.2281, 95.1904, 96.1526, 97.1147, 98.0766, 99.0384, 100.000};
    480480  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    481481  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    544544  // Reversed table
    545545  static const G4double X0[nX]={5.21412e-05,
    546         .437860,        .681908,        .891529,        1.08434,        1.26751,        1.44494,        1.61915,        1.79198,        1.96493,        2.13937,
    547         2.31664,        2.49816,        2.68559,        2.88097,        3.08705,        3.30774,        3.54917,        3.82233,        4.15131, 4.62182};
     546 .437860, .681908, .891529, 1.08434, 1.26751, 1.44494, 1.61915, 1.79198, 1.96493, 2.13937,
     547 2.31664, 2.49816, 2.68559, 2.88097, 3.08705, 3.30774, 3.54917, 3.82233, 4.15131, 4.62182};
    548548  static const G4double X1[nX]={.00102591,
    549         1.00443,        1.55828,        2.03126,        2.46406,        2.87311,        3.26723,        3.65199,        4.03134,        4.40835,        4.78561,
    550         5.16549,        5.55031,        5.94252,        6.34484,        6.76049,        7.19349,        7.64917,        8.13502,        8.66246, 9.25086};
     549 1.00443, 1.55828, 2.03126, 2.46406, 2.87311, 3.26723, 3.65199, 4.03134, 4.40835, 4.78561,
     550 5.16549, 5.55031, 5.94252, 6.34484, 6.76049, 7.19349, 7.64917, 8.13502, 8.66246, 9.25086};
    551551  static const G4double X2[nX]={.0120304,
    552         2.59903,        3.98637,        5.15131,        6.20159,        7.18024,        8.10986,        9.00426,        9.87265,        10.7217,        11.5564,
    553         12.3808,        13.1983,        14.0116,        14.8234,        15.6359,        16.4515,        17.2723,        18.1006,        18.9386, 19.7892};
     552 2.59903, 3.98637, 5.15131, 6.20159, 7.18024, 8.10986, 9.00426, 9.87265, 10.7217, 11.5564,
     553 12.3808, 13.1983, 14.0116, 14.8234, 15.6359, 16.4515, 17.2723, 18.1006, 18.9386, 19.7892};
    554554  static const G4double X3[nX]={.060124,
    555         5.73857,        8.62595,        10.9849,        13.0644,        14.9636,        16.7340,        18.4066,        20.0019,        21.5342,        23.0142,
    556         24.4497,        25.8471,        27.2114,        28.5467,        29.8564,        31.1434,        32.4102,        33.6589,        34.8912, 36.1095};
     555 5.73857, 8.62595, 10.9849, 13.0644, 14.9636, 16.7340, 18.4066, 20.0019, 21.5342, 23.0142,
     556 24.4497, 25.8471, 27.2114, 28.5467, 29.8564, 31.1434, 32.4102, 33.6589, 34.8912, 36.1095};
    557557  static const G4double X4[nX]={.0992363,
    558         8.23746,        12.1036,        15.1740,        17.8231,        20.1992,        22.3792,        24.4092,        26.3198,        28.1320,        29.8615,
    559         31.5200,        33.1169,        34.6594,        36.1536,        37.6044,        39.0160,        40.3920,        41.7353,        43.0485, 44.3354};
     558 8.23746, 12.1036, 15.1740, 17.8231, 20.1992, 22.3792, 24.4092, 26.3198, 28.1320, 29.8615,
     559 31.5200, 33.1169, 34.6594, 36.1536, 37.6044, 39.0160, 40.3920, 41.7353, 43.0485, 44.3354};
    560560  static const G4double X5[nX]={.0561127,
    561         7.33661,        10.5694,        13.0778,        15.2061,        17.0893,        18.7973,        20.3717,        21.8400,        23.2211,        24.5291,
    562         25.7745,        26.9655,        28.1087,        29.2094,        30.2721,        31.3003,        32.2972,        33.2656,        34.2076, 35.1265};
     561 7.33661, 10.5694, 13.0778, 15.2061, 17.0893, 18.7973, 20.3717, 21.8400, 23.2211, 24.5291,
     562 25.7745, 26.9655, 28.1087, 29.2094, 30.2721, 31.3003, 32.2972, 33.2656, 34.2076, 35.1265};
    563563  static const G4double X6[nX]={.0145859,
    564         4.81774,        6.83565,        8.37399,        9.66291,        10.7920,        11.8075,        12.7366,        13.5975,        14.4025,        15.1608,
    565         15.8791,        16.5628,        17.2162,        17.8427,        18.4451,        19.0259,        19.5869,        20.1300,        20.6566, 21.1706};
     564 4.81774, 6.83565, 8.37399, 9.66291, 10.7920, 11.8075, 12.7366, 13.5975, 14.4025, 15.1608,
     565 15.8791, 16.5628, 17.2162, 17.8427, 18.4451, 19.0259, 19.5869, 20.1300, 20.6566, 21.1706};
    566566  static const G4double X7[nX]={.00241155,
    567         2.87095,        4.02492,        4.89243,        5.61207,        6.23747,        6.79613,        7.30433,        7.77270,        8.20858,        8.61732,
    568         9.00296,        9.36863,        9.71682,        10.0495,        10.3684,        10.6749,        10.9701,        11.2550,        11.5306, 11.7982};
     567 2.87095, 4.02492, 4.89243, 5.61207, 6.23747, 6.79613, 7.30433, 7.77270, 8.20858, 8.61732,
     568 9.00296, 9.36863, 9.71682, 10.0495, 10.3684, 10.6749, 10.9701, 11.2550, 11.5306, 11.7982};
    569569  static const G4double X8[nX]={.000316863,
    570         1.76189,        2.44632,        2.95477,        3.37292,        3.73378,        4.05420,        4.34415,        4.61009,        4.85651,        5.08666,
    571         5.30299,        5.50738,        5.70134,        5.88609,        6.06262,        6.23178,        6.39425,        6.55065,        6.70149, 6.84742};
     570 1.76189, 2.44632, 2.95477, 3.37292, 3.73378, 4.05420, 4.34415, 4.61009, 4.85651, 5.08666,
     571 5.30299, 5.50738, 5.70134, 5.88609, 6.06262, 6.23178, 6.39425, 6.55065, 6.70149, 6.84742};
    572572  static const G4double X9[nX]={3.73544e-05,
    573         1.17106,        1.61289,        1.93763,        2.20259,        2.42976,        2.63034,        2.81094,        2.97582,        3.12796,        3.26949,
    574         3.40202,        3.52680,        3.64482,        3.75687,        3.86360,        3.96557,        4.06323,        4.15697,        4.24713, 4.33413};
     573 1.17106, 1.61289, 1.93763, 2.20259, 2.42976, 2.63034, 2.81094, 2.97582, 3.12796, 3.26949,
     574 3.40202, 3.52680, 3.64482, 3.75687, 3.86360, 3.96557, 4.06323, 4.15697, 4.24713, 4.33413};
    575575  static const G4double XA[nX]={4.19131e-06,
    576         .849573,        1.16208,        1.38955,        1.57379,        1.73079,        1.86867,        1.99221,        2.10451,        2.20770,        2.30332,
    577         2.39252,        2.47622,        2.55511,        2.62977,        2.70066,        2.76818,        2.83265,        2.89437,        2.95355, 3.01051};
     576 .849573, 1.16208, 1.38955, 1.57379, 1.73079, 1.86867, 1.99221, 2.10451, 2.20770, 2.30332,
     577 2.39252, 2.47622, 2.55511, 2.62977, 2.70066, 2.76818, 2.83265, 2.89437, 2.95355, 3.01051};
    578578  static const G4double XB[nX]={4.59981e-07,
    579         .666131,        .905836,        1.07880,        1.21796,        1.33587,        1.43890,        1.53080,        1.61399,        1.69011,        1.76040,
    580         1.82573,        1.88682,        1.94421,        1.99834,        2.04959,        2.09824,        2.14457,        2.18878,        2.23107, 2.27162};
     579 .666131, .905836, 1.07880, 1.21796, 1.33587, 1.43890, 1.53080, 1.61399, 1.69011, 1.76040,
     580 1.82573, 1.88682, 1.94421, 1.99834, 2.04959, 2.09824, 2.14457, 2.18878, 2.23107, 2.27162};
    581581  static const G4double XC[nX]={4.99861e-08,
    582         .556280,        .752730,        .893387,        1.00587,        1.10070,        1.18317,        1.25643,        1.32247,        1.38269,        1.43809,
    583         1.48941,        1.53724,        1.58203,        1.62416,        1.66391,        1.70155,        1.73728,        1.77128,        1.80371, 1.83473};
     582 .556280, .752730, .893387, 1.00587, 1.10070, 1.18317, 1.25643, 1.32247, 1.38269, 1.43809,
     583 1.48941, 1.53724, 1.58203, 1.62416, 1.66391, 1.70155, 1.73728, 1.77128, 1.80371, 1.83473};
    584584  static const G4double XD[nX]={5.40832e-09,
    585         .488069,        .657650,        .778236,        .874148,        .954621,        1.02432,        1.08599,        1.14138,        1.19172,        1.23787,
    586         1.28049,        1.32008,        1.35705,        1.39172,        1.42434,        1.45514,        1.48429,        1.51197,        1.53829, 1.56339};
     585 .488069, .657650, .778236, .874148, .954621, 1.02432, 1.08599, 1.14138, 1.19172, 1.23787,
     586 1.28049, 1.32008, 1.35705, 1.39172, 1.42434, 1.45514, 1.48429, 1.51197, 1.53829, 1.56339};
    587587  static const G4double XE[nX]={5.84029e-10,
    588         .445057,        .597434,        .705099,        .790298,        .861468,        .922865,        .976982,        1.02542,        1.06930,        1.10939,
    589         1.14630,        1.18050,        1.21233,        1.24208,        1.27001,        1.29630,        1.32113,        1.34462,        1.36691, 1.38812};
     588 .445057, .597434, .705099, .790298, .861468, .922865, .976982, 1.02542, 1.06930, 1.10939,
     589 1.14630, 1.18050, 1.21233, 1.24208, 1.27001, 1.29630, 1.32113, 1.34462, 1.36691, 1.38812};
    590590  static const G4double XF[nX]={6.30137e-11,
    591         .418735,        .560003,        .659168,        .737230,        .802138,        .857898,        .906854,        .950515,        .989915,        1.02580,
    592         1.05873,        1.08913,        1.11734,        1.14364,        1.16824,        1.19133,        1.21306,        1.23358,        1.25298, 1.27139};
     591 .418735, .560003, .659168, .737230, .802138, .857898, .906854, .950515, .989915, 1.02580,
     592 1.05873, 1.08913, 1.11734, 1.14364, 1.16824, 1.19133, 1.21306, 1.23358, 1.25298, 1.27139};
    593593  static const G4double XG[nX]={6.79627e-12,
    594         .405286,        .539651,        .633227,        .706417,        .766929,        .818642,        .863824,        .903931,        .939963,        .972639,
    595         1.00250,        1.02995,        1.05532,        1.07887,        1.10082,        1.12134,        1.14058,        1.15867,        1.17572, 1.19183};
     594 .405286, .539651, .633227, .706417, .766929, .818642, .863824, .903931, .939963, .972639,
     595 1.00250, 1.02995, 1.05532, 1.07887, 1.10082, 1.12134, 1.14058, 1.15867, 1.17572, 1.19183};
    596596  static const G4double XH[nX]={7.32882e-13,
    597         .404391,        .535199,        .625259,        .695036,        .752243,        .800752,        .842823,        .879906,        .912994,        .942802,
    598         .969862,        .994583,        1.01729,        1.03823,        1.05763,        1.07566,        1.09246,        1.10816,        1.12286, 1.13667};
     597 .404391, .535199, .625259, .695036, .752243, .800752, .842823, .879906, .912994, .942802,
     598 .969862, .994583, 1.01729, 1.03823, 1.05763, 1.07566, 1.09246, 1.10816, 1.12286, 1.13667};
    599599  static const G4double XI[nX]={7.90251e-14,
    600         .418084,        .548382,        .636489,        .703728,        .758106,        .803630,        .842633,        .876608,        .906576,        .933269,
    601         .957233,        .978886,        .998556,        1.01651,        1.03295,        1.04807,        1.06201,        1.07489,        1.08683, 1.09792};
     600 .418084, .548382, .636489, .703728, .758106, .803630, .842633, .876608, .906576, .933269,
     601 .957233, .978886, .998556, 1.01651, 1.03295, 1.04807, 1.06201, 1.07489, 1.08683, 1.09792};
    602602  static const G4double XJ[nX]={8.52083e-15,
    603         .447299,        .579635,        .666780,        .731788,        .783268,        .825512,        .861013,        .891356,        .917626,        .940597,
    604         .960842,        .978802,        .994820,        1.00917,        1.02208,        1.03373,        1.04427,        1.05383,        1.06253, 1.07046};
     603 .447299, .579635, .666780, .731788, .783268, .825512, .861013, .891356, .917626, .940597,
     604 .960842, .978802, .994820, 1.00917, 1.02208, 1.03373, 1.04427, 1.05383, 1.06253, 1.07046};
    605605  // Direct table
    606606  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    615615                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    616616  static const G4double I0[nX]={0,
    617         .354631,        1.08972,        2.05138,        3.16564,        4.38343,        5.66828,        6.99127,        8.32858,        9.65998,        10.9680,
    618         12.2371,        13.4536,        14.6050,        15.6802,        16.6686,        17.5609,        18.3482,        19.0221,        19.5752,        20.0000};
     617 .354631, 1.08972, 2.05138, 3.16564, 4.38343, 5.66828, 6.99127, 8.32858, 9.65998, 10.9680,
     618 12.2371, 13.4536, 14.6050, 15.6802, 16.6686, 17.5609, 18.3482, 19.0221, 19.5752, 20.0000};
    619619  static const G4double I1[nX]={0,
    620         .281625,        .877354,        1.67084,        2.60566,        3.64420,        4.75838,        5.92589,        7.12829,        8.34989,        9.57708,
    621         10.7978,        12.0014,        13.1781,        14.3190,        15.4162,        16.4620,        17.4496,        18.3724,        19.2245,        20.0000};
     620 .281625, .877354, 1.67084, 2.60566, 3.64420, 4.75838, 5.92589, 7.12829, 8.34989, 9.57708,
     621 10.7978, 12.0014, 13.1781, 14.3190, 15.4162, 16.4620, 17.4496, 18.3724, 19.2245, 20.0000};
    622622  static const G4double I2[nX]={0,
    623         .201909,        .642991,        1.24946,        1.98463,        2.82370,        3.74802,        4.74263,        5.79509,        6.89474,        8.03228,
    624         9.19947,        10.3889,        11.5938,        12.8082,        14.0262,        15.2427,        16.4527,        17.6518,        18.8356,        20.0000};
     623 .201909, .642991, 1.24946, 1.98463, 2.82370, 3.74802, 4.74263, 5.79509, 6.89474, 8.03228,
     624 9.19947, 10.3889, 11.5938, 12.8082, 14.0262, 15.2427, 16.4527, 17.6518, 18.8356, 20.0000};
    625625  static const G4double I3[nX]={0,
    626         .140937,        .461189,        .920216,        1.49706,        2.17728,        2.94985,        3.80580,        4.73758,        5.73867,        6.80331,
    627         7.92637,        9.10316,        10.3294,        11.6013,        12.9150,        14.2672,        15.6548,        17.0746,        18.5239,        20.0000};
     626 .140937, .461189, .920216, 1.49706, 2.17728, 2.94985, 3.80580, 4.73758, 5.73867, 6.80331,
     627 7.92637, 9.10316, 10.3294, 11.6013, 12.9150, 14.2672, 15.6548, 17.0746, 18.5239, 20.0000};
    628628  static const G4double I4[nX]={0,
    629         .099161,        .337358,        .694560,        1.16037,        1.72761,        2.39078,        3.14540,        3.98768,        4.91433,        5.92245,
    630         7.00942,        8.17287,        9.41060,        10.7206,        12.1010,        13.5500,        15.0659,        16.6472,        18.2924,        20.0000};
     629 .099161, .337358, .694560, 1.16037, 1.72761, 2.39078, 3.14540, 3.98768, 4.91433, 5.92245,
     630 7.00942, 8.17287, 9.41060, 10.7206, 12.1010, 13.5500, 15.0659, 16.6472, 18.2924, 20.0000};
    631631  static const G4double I5[nX]={0,
    632         .071131,        .255084,        .543312,        .932025,        1.41892,        2.00243,        2.68144,        3.45512,        4.32283,        5.28411,
    633         6.33859,        7.48602,        8.72621,        10.0590,        11.4844,        13.0023,        14.6128,        16.3158,        18.1115,        20.0000};
     632 .071131, .255084, .543312, .932025, 1.41892, 2.00243, 2.68144, 3.45512, 4.32283, 5.28411,
     633 6.33859, 7.48602, 8.72621, 10.0590, 11.4844, 13.0023, 14.6128, 16.3158, 18.1115, 20.0000};
    634634  static const G4double I6[nX]={0,
    635         .053692,        .202354,        .443946,        .778765,        1.20774,        1.73208,        2.35319,        3.07256,        3.89177,        4.81249,
    636         5.83641,        6.96528,        8.20092,        9.54516,        10.9999,        12.5670,        14.2486,        16.0466,        17.9630,        20.0000};
     635 .053692, .202354, .443946, .778765, 1.20774, 1.73208, 2.35319, 3.07256, 3.89177, 4.81249,
     636 5.83641, 6.96528, 8.20092, 9.54516, 10.9999, 12.5670, 14.2486, 16.0466, 17.9630, 20.0000};
    637637  static const G4double I7[nX]={0,
    638         .043065,        .168099,        .376879,        .672273,        1.05738,        1.53543,        2.10973,        2.78364,        3.56065,        4.44429,
    639         5.43819,        6.54610,        7.77186,        9.11940,        10.5928,        12.1963,        13.9342,        15.8110,        17.8313,        20.0000};
     638 .043065, .168099, .376879, .672273, 1.05738, 1.53543, 2.10973, 2.78364, 3.56065, 4.44429,
     639 5.43819, 6.54610, 7.77186, 9.11940, 10.5928, 12.1963, 13.9342, 15.8110, 17.8313, 20.0000};
    640640  static const G4double I8[nX]={0,
    641         .036051,        .143997,        .327877,        .592202,        .941572,        1.38068,        1.91433,        2.54746,        3.28517,        4.13277,
    642         5.09574,        6.17984,        7.39106,        8.73568,        10.2203,        11.8519,        13.6377,        15.5854,        17.7033,        20.0000};
     641 .036051, .143997, .327877, .592202, .941572, 1.38068, 1.91433, 2.54746, 3.28517, 4.13277,
     642 5.09574, 6.17984, 7.39106, 8.73568, 10.2203, 11.8519, 13.6377, 15.5854, 17.7033, 20.0000};
    643643  static const G4double I9[nX]={0,
    644         .030977,        .125727,        .289605,        .528146,        .846967,        1.25183,        1.74871,        2.34384,        3.04376,        3.85535,
    645         4.78594,        5.84329,        7.03567,        8.37194,        9.86163,        11.5150,        13.3430,        15.3576,        17.5719,        20.0000};
     644 .030977, .125727, .289605, .528146, .846967, 1.25183, 1.74871, 2.34384, 3.04376, 3.85535,
     645 4.78594, 5.84329, 7.03567, 8.37194, 9.86163, 11.5150, 13.3430, 15.3576, 17.5719, 20.0000};
    646646  static const G4double IA[nX]={0,
    647         .027129,        .111420,        .258935,        .475812,        .768320,        1.14297,        1.60661,        2.16648,        2.83034,        3.60650,
    648         4.50394,        5.53238,        6.70244,        8.02569,        9.51488,        11.1841,        13.0488,        15.1264,        17.4362,        20.0000};
     647 .027129, .111420, .258935, .475812, .768320, 1.14297, 1.60661, 2.16648, 2.83034, 3.60650,
     648 4.50394, 5.53238, 6.70244, 8.02569, 9.51488, 11.1841, 13.0488, 15.1264, 17.4362, 20.0000};
    649649  static const G4double IB[nX]={0,
    650         .024170,        .100153,        .234345,        .433198,        .703363,        1.05184,        1.48607,        2.01409,        2.64459,        3.38708,
    651         4.25198,        5.25084,        6.39647,        7.70319,        9.18708,        10.8663,        12.7617,        14.8968,        17.2990,        20.0000};
     650 .024170, .100153, .234345, .433198, .703363, 1.05184, 1.48607, 2.01409, 2.64459, 3.38708,
     651 4.25198, 5.25084, 6.39647, 7.70319, 9.18708, 10.8663, 12.7617, 14.8968, 17.2990, 20.0000};
    652652  static const G4double IC[nX]={0,
    653         .021877,        .091263,        .214670,        .398677,        .650133,        .976322,        1.38510,        1.88504,        2.48555,        3.19709,
    654         4.03129,        5.00127,        6.12184,        7.40989,        8.88482,        10.5690,        12.4888,        14.6748,        17.1638,        20.0000};
     653 .021877, .091263, .214670, .398677, .650133, .976322, 1.38510, 1.88504, 2.48555, 3.19709,
     654 4.03129, 5.00127, 6.12184, 7.40989, 8.88482, 10.5690, 12.4888, 14.6748, 17.1638, 20.0000};
    655655  static const G4double ID[nX]={0,
    656         .020062,        .084127,        .198702,        .370384,        .606100,        .913288,        1.30006,        1.77535,        2.34912,        3.03253,
    657         3.83822,        4.78063,        5.87634,        7.14459,        8.60791,        10.2929,        12.2315,        14.4621,        17.0320,        20.0000};
     656 .020062, .084127, .198702, .370384, .606100, .913288, 1.30006, 1.77535, 2.34912, 3.03253,
     657 3.83822, 4.78063, 5.87634, 7.14459, 8.60791, 10.2929, 12.2315, 14.4621, 17.0320, 20.0000};
    658658  static const G4double IE[nX]={0,
    659         .018547,        .078104,        .185102,        .346090,        .567998,        .858331,        1.22535,        1.67824,        2.22735,        2.88443,
    660         3.66294,        4.57845,        5.64911,        6.89637,        8.34578,        10.0282,        11.9812,        14.2519,        16.8993,        20.0000};
     659 .018547, .078104, .185102, .346090, .567998, .858331, 1.22535, 1.67824, 2.22735, 2.88443,
     660 3.66294, 4.57845, 5.64911, 6.89637, 8.34578, 10.0282, 11.9812, 14.2519, 16.8993, 20.0000};
    661661  static const G4double IF[nX]={0,
    662         .017143,        .072466,        .172271,        .323007,        .531545,        .805393,        1.15288,        1.58338,        2.10754,        2.73758,
    663         3.48769,        4.37450,        5.41770,        6.64092,        8.07288,        9.74894,        11.7135,        14.0232,        16.7522,        20.0000};
     662 .017143, .072466, .172271, .323007, .531545, .805393, 1.15288, 1.58338, 2.10754, 2.73758,
     663 3.48769, 4.37450, 5.41770, 6.64092, 8.07288, 9.74894, 11.7135, 14.0232, 16.7522, 20.0000};
    664664  static const G4double IG[nX]={0,
    665         .015618,        .066285,        .158094,        .297316,        .490692,        .745653,        1.07053,        1.47479,        1.96931,        2.56677,
    666         3.28205,        4.13289,        5.14068,        6.33158,        7.73808,        9.40133,        11.3745,        13.7279,        16.5577,        20.0000};
     665 .015618, .066285, .158094, .297316, .490692, .745653, 1.07053, 1.47479, 1.96931, 2.56677,
     666 3.28205, 4.13289, 5.14068, 6.33158, 7.73808, 9.40133, 11.3745, 13.7279, 16.5577, 20.0000};
    667667  static const G4double IH[nX]={0,
    668         .013702,        .058434,        .139923,        .264115,        .437466,        .667179,        .961433,        1.32965,        1.78283,        2.33399,
    669         2.99871,        3.79596,        4.74916,        5.88771,        7.24937,        8.88367,        10.8576,        13.2646,        16.2417,        20.0000};
     668 .013702, .058434, .139923, .264115, .437466, .667179, .961433, 1.32965, 1.78283, 2.33399,
     669 2.99871, 3.79596, 4.74916, 5.88771, 7.24937, 8.88367, 10.8576, 13.2646, 16.2417, 20.0000};
    670670  static const G4double II[nX]={0,
    671         .011264,        .048311,        .116235,        .220381,        .366634,        .561656,        .813132,        1.13008,        1.52322,        2.00554,
    672         2.59296,        3.30542,        4.16834,        5.21490,        6.48964,        8.05434,        9.99835,        12.4580,        15.6567,        20.0000};
     671 .011264, .048311, .116235, .220381, .366634, .561656, .813132, 1.13008, 1.52322, 2.00554,
     672 2.59296, 3.30542, 4.16834, 5.21490, 6.48964, 8.05434, 9.99835, 12.4580, 15.6567, 20.0000};
    673673  static const G4double IJ[nX]={0,
    674         .008628,        .037206,        .089928,        .171242,        .286114,        .440251,        .640343,        .894382,        1.21208,        1.60544,
    675         2.08962,        2.68414,        3.41486,        4.31700,        5.44048,        6.85936,        8.69067,        11.1358,        14.5885,        20.0000};
     674 .008628, .037206, .089928, .171242, .286114, .440251, .640343, .894382, 1.21208, 1.60544,
     675 2.08962, 2.68414, 3.41486, 4.31700, 5.44048, 6.85936, 8.69067, 11.1358, 14.5885, 20.0000};
    676676  static const G4double* Il[nE]=
    677677                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    678678  static const G4double lE[nE]={
    679 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    680  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     679-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     680 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    681681  static const G4double lEmi=lE[0];
    682682  static const G4double lEma=lE[nE-1];
    683683  static const G4double dlE=(lEma-lEmi)/bE;
    684         //***************************************************************************************
     684  //***************************************************************************************
    685685  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    686686  G4double lEn=std::log(Enu);         // log(E) for interpolation
     
    772772}
    773773
    774 // This class can provide only virtual exchange pi+ (a substitute for W+ boson)
     774// This class can provide only virtual exchange pi- (a substitute for W- boson)
    775775G4int G4QANuENuclearCrossSection::GetExchangePDGCode() {return -211;}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QANuMuNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QANuMuNuclearCrossSection.cc,v 1.11 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QANuMuNuclearCrossSection.cc,v 1.13 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // G4 Physics class: G4QANuMuNuclearCrossSection for gamma+A cross sections
     31// G4 Physics class: G4QANuMuNuclearCrossSection for (anu_mu,mu+)A cross sections
    3232// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
    4040
    4141//#define debug
     
    9090        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9191        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     92  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9393#endif
    9494  if(pPDG!=-14)
     
    111111    j  = 0;                            // A#0f records found in DB for this projectile
    112112    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     113    {                                  // The nucleus with projPDG is found in AMDB
    114114      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     115      {
    116116        lastI=i;
    117117        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163163#endif
    164164      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    168168#ifdef pdebug
    169169      G4cout<<"G4QAMNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lstI="<<lastI<<G4endl;
     
    172172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173173      if(lastCS<=0.)
    174                                                 {
     174      {
    175175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176176#ifdef pdebug
     
    184184          lastTH=pEn;
    185185        }
    186                                                 }
     186      }
    187187#ifdef pdebug
    188188      G4cout<<"G4QAMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200200#endif
    201201      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    203203    else
    204                                 {
     204    {
    205205#ifdef pdebug
    206206      G4cout<<"G4QAMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    245245G4double G4QANuMuNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
    246246{
    247   //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1.,0.)/GeV;
    248   //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1.,1.)/GeV;
    249   //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2.,1.)/GeV/2.;
     247  //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/GeV;
     248  //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/GeV;
     249  //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2,1)/GeV/2.;
    250250  static const G4double mN=.931494043;// Nucleon mass (inside nucleus, AtomicMassUnit, GeV)
    251251  static const G4double dmN=mN+mN;    // Doubled nucleon mass (2*AtomicMassUnit, GeV)
     
    294294  {
    295295    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    296                                 {
     296    {
    297297      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    298298      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    299           }
    300           else                              // This isotope wasn't calculated previously => CREATE
    301           {
     299   }
     300   else                              // This isotope wasn't calculated previously => CREATE
     301   {
    302302      if(first)
    303303      {
     
    315315      TX.push_back(lastTX);
    316316      QE.push_back(lastQE);
    317            } // End of creation of the new set of parameters
     317    } // End of creation of the new set of parameters
    318318  } // End of parameters udate
    319319  // ============================== NOW Calculate the Cross Section =====================
     
    330330    G4int sep=ran;  // as a result = an index of the left edge of the interval
    331331    while(ran>=2)
    332                                 {
     332    {
    333333      G4int newran=ran/2;
    334334      if(lastE<=lastEN[sep]) sep-=newran;
     
    382382  static const G4int nE=65; // !! If change this, change it in GetCrossSection() (*.cc) !!
    383383  static const G4double nuEn[nE]={thresh,
    384 .112039,.116079,.120416,.125076,.130090,.135494,.141324,.147626,.154445,.161838,
    385 .169864,.178594,.188105,.198485,.209836,.222272,.235923,.250941,.267497,.285789,
    386 .306045,.328530,.353552,.381466,.412689,.447710,.487101,.531538,.581820,.638893,
    387 .703886,.778147,.863293,.961275,1.07445,1.20567,1.35843,1.53701,1.74667,1.99390,
    388 2.28679,2.63542,3.05245,3.55386,4.15990,4.89644,5.79665,6.90336,8.27224,9.97606,
    389 12.1106,14.8029,18.2223,22.5968,28.2351,35.5587,45.1481,57.8086,74.6682,97.3201,
    390 128.036,170.085,228.220,309.420};
     384    .112039,.116079,.120416,.125076,.130090,.135494,.141324,.147626,.154445,.161838,
     385    .169864,.178594,.188105,.198485,.209836,.222272,.235923,.250941,.267497,.285789,
     386    .306045,.328530,.353552,.381466,.412689,.447710,.487101,.531538,.581820,.638893,
     387    .703886,.778147,.863293,.961275,1.07445,1.20567,1.35843,1.53701,1.74667,1.99390,
     388    2.28679,2.63542,3.05245,3.55386,4.15990,4.89644,5.79665,6.90336,8.27224,9.97606,
     389    12.1106,14.8029,18.2223,22.5968,28.2351,35.5587,45.1481,57.8086,74.6682,97.3201,
     390    128.036,170.085,228.220,309.420};
    391391  static const G4double TOTX[nE]={0.,
    392 .077498,.247583,.329691,.386384,.429087,.462699,.489899,.512316,.530996,.546614,
    393 .559616,.570292,.578840,.585395,.590053,.593083,.594197,.593614,.591396,.587611,
    394 .582335,.575653,.567667,.558490,.548417,.537270,.525352,.512825,.499857,.486620,
    395 .473283,.460014,.446970,.434294,.422116,.410656,.399782,.389665,.380349,.371860,
    396 .364207,.357387,.351388,.346192,.341778,.338122,.335198,.332980,.331439,.330544,
    397 .330263,.330558,.331391,.332718,.334494,.336667,.339182,.341697,.344470,.348125,
    398 .351322,.354481,.357507,.359239};
     392    .077498,.247583,.329691,.386384,.429087,.462699,.489899,.512316,.530996,.546614,
     393    .559616,.570292,.578840,.585395,.590053,.593083,.594197,.593614,.591396,.587611,
     394    .582335,.575653,.567667,.558490,.548417,.537270,.525352,.512825,.499857,.486620,
     395    .473283,.460014,.446970,.434294,.422116,.410656,.399782,.389665,.380349,.371860,
     396    .364207,.357387,.351388,.346192,.341778,.338122,.335198,.332980,.331439,.330544,
     397    .330263,.330558,.331391,.332718,.334494,.336667,.339182,.341697,.344470,.348125,
     398    .351322,.354481,.357507,.359239};
    399399  static const G4double QELX[nE]={0.,
    400 .008683,.028739,.039700,.048327,.055820,.062693,.069235,.075631,.082010,.088463,
    401 .095059,.101851,.108883,.116192,.123814,.131826,.140185,.148962,.158197,.167933,
    402 .178221,.189119,.200700,.213045,.226326,.240454,.255277,.270612,.286388,.302608,
    403 .319318,.336582,.354468,.373031,.392427,.412445,.433146,.454448,.476222,.498289,
    404 .520430,.542558,.564130,.585003,.604928,.623680,.641266,.657255,.671704,.684586,
    405 .696111,.706028,.714553,.721951,.728085,.733182,.737348,.740958,.743716,.746059,
    406 .747806,.749129,.750331,.751100};
     400    .008683,.028739,.039700,.048327,.055820,.062693,.069235,.075631,.082010,.088463,
     401    .095059,.101851,.108883,.116192,.123814,.131826,.140185,.148962,.158197,.167933,
     402    .178221,.189119,.200700,.213045,.226326,.240454,.255277,.270612,.286388,.302608,
     403    .319318,.336582,.354468,.373031,.392427,.412445,.433146,.454448,.476222,.498289,
     404    .520430,.542558,.564130,.585003,.604928,.623680,.641266,.657255,.671704,.684586,
     405    .696111,.706028,.714553,.721951,.728085,.733182,.737348,.740958,.743716,.746059,
     406    .747806,.749129,.750331,.751100};
    407407
    408408  // --------------------------------
    409409  G4int first=0;
    410410  if(z<0.)
    411                 {
     411  {
    412412    first=1;
    413413    z=-z;
     
    428428    t[k]=TOTX[k]*nuEn[k]*(za+za)/ta+QELX[k]*(dz+dz-da)/ta; // TotalCrossSection
    429429    q[k]=QELX[k]*dz/a;                                     // QuasiElasticCrossSection
    430         }
     430  }
    431431  return first;
    432432}
     
    448448  static const G4double Xl[nQ2]={5.20224e-16,
    449449 .006125,.0137008,.0218166,.0302652,.0389497,.0478144,.0568228,.0659497,.0751768,.0844898,
    450         .093878,        .103332,        .112844,        .122410,        .132023,        .141680,        .151376,        .161109,        .170875,        .180672,
    451         .190499,        .200352,        .210230,        .220131,        .230055,        .239999,        .249963,        .259945,        .269944,        .279960,
    452         .289992,        .300039,        .310099,        .320173,        .330260,        .340359,        .350470,        .360592,        .370724,        .380867,
    453         .391019,        .401181,        .411352,        .421531,        .431719,        .441915,        .452118,        .462329,        .472547,        .482771,
    454         .493003,        .503240,        .513484,        .523734,        .533989,        .544250,        .554517,        .564788,        .575065,        .585346,
    455         .595632,        .605923,        .616218,        .626517,        .636820,        .647127,        .657438,        .667753,        .678072,        .688394,
    456         .698719,        .709048,        .719380,        .729715,        .740053,        .750394,        .760738,        .771085,        .781434,        .791786,
    457         .802140,        .812497,        .822857,        .833219,        .843582,        .853949,        .864317,        .874687,        .885060,        .895434,
    458         .905810,        .916188,        .926568,        .936950,        .947333,        .957719,        .968105,        .978493,        .988883,        .999275};
    459           // Direct table
     450 .093878, .103332, .112844, .122410, .132023, .141680, .151376, .161109, .170875, .180672,
     451 .190499, .200352, .210230, .220131, .230055, .239999, .249963, .259945, .269944, .279960,
     452 .289992, .300039, .310099, .320173, .330260, .340359, .350470, .360592, .370724, .380867,
     453 .391019, .401181, .411352, .421531, .431719, .441915, .452118, .462329, .472547, .482771,
     454 .493003, .503240, .513484, .523734, .533989, .544250, .554517, .564788, .575065, .585346,
     455 .595632, .605923, .616218, .626517, .636820, .647127, .657438, .667753, .678072, .688394,
     456 .698719, .709048, .719380, .729715, .740053, .750394, .760738, .771085, .781434, .791786,
     457 .802140, .812497, .822857, .833219, .843582, .853949, .864317, .874687, .885060, .895434,
     458 .905810, .916188, .926568, .936950, .947333, .957719, .968105, .978493, .988883, .999275};
     459   // Direct table
    460460  static const G4double Xmax=Xl[lQ2];
    461461  static const G4double Xmin=Xl[0];
    462462  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    463463  static const G4double inl[nQ2]={0,
    464         1.52225,        2.77846,        3.96651,        5.11612,        6.23990,        7.34467,        8.43466,        9.51272,        10.5809,        11.6406,
    465         12.6932,        13.7394,        14.7801,        15.8158,        16.8471,        17.8743,        18.8979,        19.9181,        20.9353,        21.9496,
    466         22.9614,        23.9707,        24.9777,        25.9826,        26.9855,        27.9866,        28.9860,        29.9837,        30.9798,        31.9745,
    467         32.9678,        33.9598,        34.9505,        35.9400,        36.9284,        37.9158,        38.9021,        39.8874,        40.8718,        41.8553,
    468         42.8379,        43.8197,        44.8007,        45.7810,        46.7605,        47.7393,        48.7174,        49.6950,        50.6718,        51.6481,
    469         52.6238,        53.5990,        54.5736,        55.5476,        56.5212,        57.4943,        58.4670,        59.4391,        60.4109,        61.3822,
    470         62.3531,        63.3236,        64.2937,        65.2635,        66.2329,        67.2019,        68.1707,        69.1390,        70.1071,        71.0748,
    471         72.0423,        73.0095,        73.9763,        74.9429,        75.9093,        76.8754,        77.8412,        78.8068,        79.7721,        80.7373,
    472         81.7022,        82.6668,        83.6313,        84.5956,        85.5596,        86.5235,        87.4872,        88.4507,        89.4140,        90.3771,
    473         91.3401,        92.3029,        93.2656,        94.2281,        95.1904,        96.1526,        97.1147,        98.0766,        99.0384,        100.000};
     464 1.52225, 2.77846, 3.96651, 5.11612, 6.23990, 7.34467, 8.43466, 9.51272, 10.5809, 11.6406,
     465 12.6932, 13.7394, 14.7801, 15.8158, 16.8471, 17.8743, 18.8979, 19.9181, 20.9353, 21.9496,
     466 22.9614, 23.9707, 24.9777, 25.9826, 26.9855, 27.9866, 28.9860, 29.9837, 30.9798, 31.9745,
     467 32.9678, 33.9598, 34.9505, 35.9400, 36.9284, 37.9158, 38.9021, 39.8874, 40.8718, 41.8553,
     468 42.8379, 43.8197, 44.8007, 45.7810, 46.7605, 47.7393, 48.7174, 49.6950, 50.6718, 51.6481,
     469 52.6238, 53.5990, 54.5736, 55.5476, 56.5212, 57.4943, 58.4670, 59.4391, 60.4109, 61.3822,
     470 62.3531, 63.3236, 64.2937, 65.2635, 66.2329, 67.2019, 68.1707, 69.1390, 70.1071, 71.0748,
     471 72.0423, 73.0095, 73.9763, 74.9429, 75.9093, 76.8754, 77.8412, 78.8068, 79.7721, 80.7373,
     472 81.7022, 82.6668, 83.6313, 84.5956, 85.5596, 86.5235, 87.4872, 88.4507, 89.4140, 90.3771,
     473 91.3401, 92.3029, 93.2656, 94.2281, 95.1904, 96.1526, 97.1147, 98.0766, 99.0384, 100.000};
    474474  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    475475  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    538538  // Reversed table
    539539  static const G4double X0[nX]={5.21412e-05,
    540         .437860,        .681908,        .891529,        1.08434,        1.26751,        1.44494,        1.61915,        1.79198,        1.96493,        2.13937,
    541         2.31664,        2.49816,        2.68559,        2.88097,        3.08705,        3.30774,        3.54917,        3.82233,        4.15131, 4.62182};
     540 .437860, .681908, .891529, 1.08434, 1.26751, 1.44494, 1.61915, 1.79198, 1.96493, 2.13937,
     541 2.31664, 2.49816, 2.68559, 2.88097, 3.08705, 3.30774, 3.54917, 3.82233, 4.15131, 4.62182};
    542542  static const G4double X1[nX]={.00102591,
    543         1.00443,        1.55828,        2.03126,        2.46406,        2.87311,        3.26723,        3.65199,        4.03134,        4.40835,        4.78561,
    544         5.16549,        5.55031,        5.94252,        6.34484,        6.76049,        7.19349,        7.64917,        8.13502,        8.66246, 9.25086};
     543 1.00443, 1.55828, 2.03126, 2.46406, 2.87311, 3.26723, 3.65199, 4.03134, 4.40835, 4.78561,
     544 5.16549, 5.55031, 5.94252, 6.34484, 6.76049, 7.19349, 7.64917, 8.13502, 8.66246, 9.25086};
    545545  static const G4double X2[nX]={.0120304,
    546         2.59903,        3.98637,        5.15131,        6.20159,        7.18024,        8.10986,        9.00426,        9.87265,        10.7217,        11.5564,
    547         12.3808,        13.1983,        14.0116,        14.8234,        15.6359,        16.4515,        17.2723,        18.1006,        18.9386, 19.7892};
     546 2.59903, 3.98637, 5.15131, 6.20159, 7.18024, 8.10986, 9.00426, 9.87265, 10.7217, 11.5564,
     547 12.3808, 13.1983, 14.0116, 14.8234, 15.6359, 16.4515, 17.2723, 18.1006, 18.9386, 19.7892};
    548548  static const G4double X3[nX]={.060124,
    549         5.73857,        8.62595,        10.9849,        13.0644,        14.9636,        16.7340,        18.4066,        20.0019,        21.5342,        23.0142,
    550         24.4497,        25.8471,        27.2114,        28.5467,        29.8564,        31.1434,        32.4102,        33.6589,        34.8912, 36.1095};
     549 5.73857, 8.62595, 10.9849, 13.0644, 14.9636, 16.7340, 18.4066, 20.0019, 21.5342, 23.0142,
     550 24.4497, 25.8471, 27.2114, 28.5467, 29.8564, 31.1434, 32.4102, 33.6589, 34.8912, 36.1095};
    551551  static const G4double X4[nX]={.0992363,
    552         8.23746,        12.1036,        15.1740,        17.8231,        20.1992,        22.3792,        24.4092,        26.3198,        28.1320,        29.8615,
    553         31.5200,        33.1169,        34.6594,        36.1536,        37.6044,        39.0160,        40.3920,        41.7353,        43.0485, 44.3354};
     552 8.23746, 12.1036, 15.1740, 17.8231, 20.1992, 22.3792, 24.4092, 26.3198, 28.1320, 29.8615,
     553 31.5200, 33.1169, 34.6594, 36.1536, 37.6044, 39.0160, 40.3920, 41.7353, 43.0485, 44.3354};
    554554  static const G4double X5[nX]={.0561127,
    555         7.33661,        10.5694,        13.0778,        15.2061,        17.0893,        18.7973,        20.3717,        21.8400,        23.2211,        24.5291,
    556         25.7745,        26.9655,        28.1087,        29.2094,        30.2721,        31.3003,        32.2972,        33.2656,        34.2076, 35.1265};
     555 7.33661, 10.5694, 13.0778, 15.2061, 17.0893, 18.7973, 20.3717, 21.8400, 23.2211, 24.5291,
     556 25.7745, 26.9655, 28.1087, 29.2094, 30.2721, 31.3003, 32.2972, 33.2656, 34.2076, 35.1265};
    557557  static const G4double X6[nX]={.0145859,
    558         4.81774,        6.83565,        8.37399,        9.66291,        10.7920,        11.8075,        12.7366,        13.5975,        14.4025,        15.1608,
    559         15.8791,        16.5628,        17.2162,        17.8427,        18.4451,        19.0259,        19.5869,        20.1300,        20.6566, 21.1706};
     558 4.81774, 6.83565, 8.37399, 9.66291, 10.7920, 11.8075, 12.7366, 13.5975, 14.4025, 15.1608,
     559 15.8791, 16.5628, 17.2162, 17.8427, 18.4451, 19.0259, 19.5869, 20.1300, 20.6566, 21.1706};
    560560  static const G4double X7[nX]={.00241155,
    561         2.87095,        4.02492,        4.89243,        5.61207,        6.23747,        6.79613,        7.30433,        7.77270,        8.20858,        8.61732,
    562         9.00296,        9.36863,        9.71682,        10.0495,        10.3684,        10.6749,        10.9701,        11.2550,        11.5306, 11.7982};
     561 2.87095, 4.02492, 4.89243, 5.61207, 6.23747, 6.79613, 7.30433, 7.77270, 8.20858, 8.61732,
     562 9.00296, 9.36863, 9.71682, 10.0495, 10.3684, 10.6749, 10.9701, 11.2550, 11.5306, 11.7982};
    563563  static const G4double X8[nX]={.000316863,
    564         1.76189,        2.44632,        2.95477,        3.37292,        3.73378,        4.05420,        4.34415,        4.61009,        4.85651,        5.08666,
    565         5.30299,        5.50738,        5.70134,        5.88609,        6.06262,        6.23178,        6.39425,        6.55065,        6.70149, 6.84742};
     564 1.76189, 2.44632, 2.95477, 3.37292, 3.73378, 4.05420, 4.34415, 4.61009, 4.85651, 5.08666,
     565 5.30299, 5.50738, 5.70134, 5.88609, 6.06262, 6.23178, 6.39425, 6.55065, 6.70149, 6.84742};
    566566  static const G4double X9[nX]={3.73544e-05,
    567         1.17106,        1.61289,        1.93763,        2.20259,        2.42976,        2.63034,        2.81094,        2.97582,        3.12796,        3.26949,
    568         3.40202,        3.52680,        3.64482,        3.75687,        3.86360,        3.96557,        4.06323,        4.15697,        4.24713, 4.33413};
     567 1.17106, 1.61289, 1.93763, 2.20259, 2.42976, 2.63034, 2.81094, 2.97582, 3.12796, 3.26949,
     568 3.40202, 3.52680, 3.64482, 3.75687, 3.86360, 3.96557, 4.06323, 4.15697, 4.24713, 4.33413};
    569569  static const G4double XA[nX]={4.19131e-06,
    570         .849573,        1.16208,        1.38955,        1.57379,        1.73079,        1.86867,        1.99221,        2.10451,        2.20770,        2.30332,
    571         2.39252,        2.47622,        2.55511,        2.62977,        2.70066,        2.76818,        2.83265,        2.89437,        2.95355, 3.01051};
     570 .849573, 1.16208, 1.38955, 1.57379, 1.73079, 1.86867, 1.99221, 2.10451, 2.20770, 2.30332,
     571 2.39252, 2.47622, 2.55511, 2.62977, 2.70066, 2.76818, 2.83265, 2.89437, 2.95355, 3.01051};
    572572  static const G4double XB[nX]={4.59981e-07,
    573         .666131,        .905836,        1.07880,        1.21796,        1.33587,        1.43890,        1.53080,        1.61399,        1.69011,        1.76040,
    574         1.82573,        1.88682,        1.94421,        1.99834,        2.04959,        2.09824,        2.14457,        2.18878,        2.23107, 2.27162};
     573 .666131, .905836, 1.07880, 1.21796, 1.33587, 1.43890, 1.53080, 1.61399, 1.69011, 1.76040,
     574 1.82573, 1.88682, 1.94421, 1.99834, 2.04959, 2.09824, 2.14457, 2.18878, 2.23107, 2.27162};
    575575  static const G4double XC[nX]={4.99861e-08,
    576         .556280,        .752730,        .893387,        1.00587,        1.10070,        1.18317,        1.25643,        1.32247,        1.38269,        1.43809,
    577         1.48941,        1.53724,        1.58203,        1.62416,        1.66391,        1.70155,        1.73728,        1.77128,        1.80371, 1.83473};
     576 .556280, .752730, .893387, 1.00587, 1.10070, 1.18317, 1.25643, 1.32247, 1.38269, 1.43809,
     577 1.48941, 1.53724, 1.58203, 1.62416, 1.66391, 1.70155, 1.73728, 1.77128, 1.80371, 1.83473};
    578578  static const G4double XD[nX]={5.40832e-09,
    579         .488069,        .657650,        .778236,        .874148,        .954621,        1.02432,        1.08599,        1.14138,        1.19172,        1.23787,
    580         1.28049,        1.32008,        1.35705,        1.39172,        1.42434,        1.45514,        1.48429,        1.51197,        1.53829, 1.56339};
     579 .488069, .657650, .778236, .874148, .954621, 1.02432, 1.08599, 1.14138, 1.19172, 1.23787,
     580 1.28049, 1.32008, 1.35705, 1.39172, 1.42434, 1.45514, 1.48429, 1.51197, 1.53829, 1.56339};
    581581  static const G4double XE[nX]={5.84029e-10,
    582         .445057,        .597434,        .705099,        .790298,        .861468,        .922865,        .976982,        1.02542,        1.06930,        1.10939,
    583         1.14630,        1.18050,        1.21233,        1.24208,        1.27001,        1.29630,        1.32113,        1.34462,        1.36691, 1.38812};
     582 .445057, .597434, .705099, .790298, .861468, .922865, .976982, 1.02542, 1.06930, 1.10939,
     583 1.14630, 1.18050, 1.21233, 1.24208, 1.27001, 1.29630, 1.32113, 1.34462, 1.36691, 1.38812};
    584584  static const G4double XF[nX]={6.30137e-11,
    585         .418735,        .560003,        .659168,        .737230,        .802138,        .857898,        .906854,        .950515,        .989915,        1.02580,
    586         1.05873,        1.08913,        1.11734,        1.14364,        1.16824,        1.19133,        1.21306,        1.23358,        1.25298, 1.27139};
     585 .418735, .560003, .659168, .737230, .802138, .857898, .906854, .950515, .989915, 1.02580,
     586 1.05873, 1.08913, 1.11734, 1.14364, 1.16824, 1.19133, 1.21306, 1.23358, 1.25298, 1.27139};
    587587  static const G4double XG[nX]={6.79627e-12,
    588         .405286,        .539651,        .633227,        .706417,        .766929,        .818642,        .863824,        .903931,        .939963,        .972639,
    589         1.00250,        1.02995,        1.05532,        1.07887,        1.10082,        1.12134,        1.14058,        1.15867,        1.17572, 1.19183};
     588 .405286, .539651, .633227, .706417, .766929, .818642, .863824, .903931, .939963, .972639,
     589 1.00250, 1.02995, 1.05532, 1.07887, 1.10082, 1.12134, 1.14058, 1.15867, 1.17572, 1.19183};
    590590  static const G4double XH[nX]={7.32882e-13,
    591         .404391,        .535199,        .625259,        .695036,        .752243,        .800752,        .842823,        .879906,        .912994,        .942802,
    592         .969862,        .994583,        1.01729,        1.03823,        1.05763,        1.07566,        1.09246,        1.10816,        1.12286, 1.13667};
     591 .404391, .535199, .625259, .695036, .752243, .800752, .842823, .879906, .912994, .942802,
     592 .969862, .994583, 1.01729, 1.03823, 1.05763, 1.07566, 1.09246, 1.10816, 1.12286, 1.13667};
    593593  static const G4double XI[nX]={7.90251e-14,
    594         .418084,        .548382,        .636489,        .703728,        .758106,        .803630,        .842633,        .876608,        .906576,        .933269,
    595         .957233,        .978886,        .998556,        1.01651,        1.03295,        1.04807,        1.06201,        1.07489,        1.08683, 1.09792};
     594 .418084, .548382, .636489, .703728, .758106, .803630, .842633, .876608, .906576, .933269,
     595 .957233, .978886, .998556, 1.01651, 1.03295, 1.04807, 1.06201, 1.07489, 1.08683, 1.09792};
    596596  static const G4double XJ[nX]={8.52083e-15,
    597         .447299,        .579635,        .666780,        .731788,        .783268,        .825512,        .861013,        .891356,        .917626,        .940597,
    598         .960842,        .978802,        .994820,        1.00917,        1.02208,        1.03373,        1.04427,        1.05383,        1.06253, 1.07046};
     597 .447299, .579635, .666780, .731788, .783268, .825512, .861013, .891356, .917626, .940597,
     598 .960842, .978802, .994820, 1.00917, 1.02208, 1.03373, 1.04427, 1.05383, 1.06253, 1.07046};
    599599  // Direct table
    600600  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    609609                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    610610  static const G4double I0[nX]={0,
    611         .354631,        1.08972,        2.05138,        3.16564,        4.38343,        5.66828,        6.99127,        8.32858,        9.65998,        10.9680,
    612         12.2371,        13.4536,        14.6050,        15.6802,        16.6686,        17.5609,        18.3482,        19.0221,        19.5752,        20.0000};
     611 .354631, 1.08972, 2.05138, 3.16564, 4.38343, 5.66828, 6.99127, 8.32858, 9.65998, 10.9680,
     612 12.2371, 13.4536, 14.6050, 15.6802, 16.6686, 17.5609, 18.3482, 19.0221, 19.5752, 20.0000};
    613613  static const G4double I1[nX]={0,
    614         .281625,        .877354,        1.67084,        2.60566,        3.64420,        4.75838,        5.92589,        7.12829,        8.34989,        9.57708,
    615         10.7978,        12.0014,        13.1781,        14.3190,        15.4162,        16.4620,        17.4496,        18.3724,        19.2245,        20.0000};
     614 .281625, .877354, 1.67084, 2.60566, 3.64420, 4.75838, 5.92589, 7.12829, 8.34989, 9.57708,
     615 10.7978, 12.0014, 13.1781, 14.3190, 15.4162, 16.4620, 17.4496, 18.3724, 19.2245, 20.0000};
    616616  static const G4double I2[nX]={0,
    617         .201909,        .642991,        1.24946,        1.98463,        2.82370,        3.74802,        4.74263,        5.79509,        6.89474,        8.03228,
    618         9.19947,        10.3889,        11.5938,        12.8082,        14.0262,        15.2427,        16.4527,        17.6518,        18.8356,        20.0000};
     617 .201909, .642991, 1.24946, 1.98463, 2.82370, 3.74802, 4.74263, 5.79509, 6.89474, 8.03228,
     618 9.19947, 10.3889, 11.5938, 12.8082, 14.0262, 15.2427, 16.4527, 17.6518, 18.8356, 20.0000};
    619619  static const G4double I3[nX]={0,
    620         .140937,        .461189,        .920216,        1.49706,        2.17728,        2.94985,        3.80580,        4.73758,        5.73867,        6.80331,
    621         7.92637,        9.10316,        10.3294,        11.6013,        12.9150,        14.2672,        15.6548,        17.0746,        18.5239,        20.0000};
     620 .140937, .461189, .920216, 1.49706, 2.17728, 2.94985, 3.80580, 4.73758, 5.73867, 6.80331,
     621 7.92637, 9.10316, 10.3294, 11.6013, 12.9150, 14.2672, 15.6548, 17.0746, 18.5239, 20.0000};
    622622  static const G4double I4[nX]={0,
    623         .099161,        .337358,        .694560,        1.16037,        1.72761,        2.39078,        3.14540,        3.98768,        4.91433,        5.92245,
    624         7.00942,        8.17287,        9.41060,        10.7206,        12.1010,        13.5500,        15.0659,        16.6472,        18.2924,        20.0000};
     623 .099161, .337358, .694560, 1.16037, 1.72761, 2.39078, 3.14540, 3.98768, 4.91433, 5.92245,
     624 7.00942, 8.17287, 9.41060, 10.7206, 12.1010, 13.5500, 15.0659, 16.6472, 18.2924, 20.0000};
    625625  static const G4double I5[nX]={0,
    626         .071131,        .255084,        .543312,        .932025,        1.41892,        2.00243,        2.68144,        3.45512,        4.32283,        5.28411,
    627         6.33859,        7.48602,        8.72621,        10.0590,        11.4844,        13.0023,        14.6128,        16.3158,        18.1115,        20.0000};
     626 .071131, .255084, .543312, .932025, 1.41892, 2.00243, 2.68144, 3.45512, 4.32283, 5.28411,
     627 6.33859, 7.48602, 8.72621, 10.0590, 11.4844, 13.0023, 14.6128, 16.3158, 18.1115, 20.0000};
    628628  static const G4double I6[nX]={0,
    629         .053692,        .202354,        .443946,        .778765,        1.20774,        1.73208,        2.35319,        3.07256,        3.89177,        4.81249,
    630         5.83641,        6.96528,        8.20092,        9.54516,        10.9999,        12.5670,        14.2486,        16.0466,        17.9630,        20.0000};
     629 .053692, .202354, .443946, .778765, 1.20774, 1.73208, 2.35319, 3.07256, 3.89177, 4.81249,
     630 5.83641, 6.96528, 8.20092, 9.54516, 10.9999, 12.5670, 14.2486, 16.0466, 17.9630, 20.0000};
    631631  static const G4double I7[nX]={0,
    632         .043065,        .168099,        .376879,        .672273,        1.05738,        1.53543,        2.10973,        2.78364,        3.56065,        4.44429,
    633         5.43819,        6.54610,        7.77186,        9.11940,        10.5928,        12.1963,        13.9342,        15.8110,        17.8313,        20.0000};
     632 .043065, .168099, .376879, .672273, 1.05738, 1.53543, 2.10973, 2.78364, 3.56065, 4.44429,
     633 5.43819, 6.54610, 7.77186, 9.11940, 10.5928, 12.1963, 13.9342, 15.8110, 17.8313, 20.0000};
    634634  static const G4double I8[nX]={0,
    635         .036051,        .143997,        .327877,        .592202,        .941572,        1.38068,        1.91433,        2.54746,        3.28517,        4.13277,
    636         5.09574,        6.17984,        7.39106,        8.73568,        10.2203,        11.8519,        13.6377,        15.5854,        17.7033,        20.0000};
     635 .036051, .143997, .327877, .592202, .941572, 1.38068, 1.91433, 2.54746, 3.28517, 4.13277,
     636 5.09574, 6.17984, 7.39106, 8.73568, 10.2203, 11.8519, 13.6377, 15.5854, 17.7033, 20.0000};
    637637  static const G4double I9[nX]={0,
    638         .030977,        .125727,        .289605,        .528146,        .846967,        1.25183,        1.74871,        2.34384,        3.04376,        3.85535,
    639         4.78594,        5.84329,        7.03567,        8.37194,        9.86163,        11.5150,        13.3430,        15.3576,        17.5719,        20.0000};
     638 .030977, .125727, .289605, .528146, .846967, 1.25183, 1.74871, 2.34384, 3.04376, 3.85535,
     639 4.78594, 5.84329, 7.03567, 8.37194, 9.86163, 11.5150, 13.3430, 15.3576, 17.5719, 20.0000};
    640640  static const G4double IA[nX]={0,
    641         .027129,        .111420,        .258935,        .475812,        .768320,        1.14297,        1.60661,        2.16648,        2.83034,        3.60650,
    642         4.50394,        5.53238,        6.70244,        8.02569,        9.51488,        11.1841,        13.0488,        15.1264,        17.4362,        20.0000};
     641 .027129, .111420, .258935, .475812, .768320, 1.14297, 1.60661, 2.16648, 2.83034, 3.60650,
     642 4.50394, 5.53238, 6.70244, 8.02569, 9.51488, 11.1841, 13.0488, 15.1264, 17.4362, 20.0000};
    643643  static const G4double IB[nX]={0,
    644         .024170,        .100153,        .234345,        .433198,        .703363,        1.05184,        1.48607,        2.01409,        2.64459,        3.38708,
    645         4.25198,        5.25084,        6.39647,        7.70319,        9.18708,        10.8663,        12.7617,        14.8968,        17.2990,        20.0000};
     644 .024170, .100153, .234345, .433198, .703363, 1.05184, 1.48607, 2.01409, 2.64459, 3.38708,
     645 4.25198, 5.25084, 6.39647, 7.70319, 9.18708, 10.8663, 12.7617, 14.8968, 17.2990, 20.0000};
    646646  static const G4double IC[nX]={0,
    647         .021877,        .091263,        .214670,        .398677,        .650133,        .976322,        1.38510,        1.88504,        2.48555,        3.19709,
    648         4.03129,        5.00127,        6.12184,        7.40989,        8.88482,        10.5690,        12.4888,        14.6748,        17.1638,        20.0000};
     647 .021877, .091263, .214670, .398677, .650133, .976322, 1.38510, 1.88504, 2.48555, 3.19709,
     648 4.03129, 5.00127, 6.12184, 7.40989, 8.88482, 10.5690, 12.4888, 14.6748, 17.1638, 20.0000};
    649649  static const G4double ID[nX]={0,
    650         .020062,        .084127,        .198702,        .370384,        .606100,        .913288,        1.30006,        1.77535,        2.34912,        3.03253,
    651         3.83822,        4.78063,        5.87634,        7.14459,        8.60791,        10.2929,        12.2315,        14.4621,        17.0320,        20.0000};
     650 .020062, .084127, .198702, .370384, .606100, .913288, 1.30006, 1.77535, 2.34912, 3.03253,
     651 3.83822, 4.78063, 5.87634, 7.14459, 8.60791, 10.2929, 12.2315, 14.4621, 17.0320, 20.0000};
    652652  static const G4double IE[nX]={0,
    653         .018547,        .078104,        .185102,        .346090,        .567998,        .858331,        1.22535,        1.67824,        2.22735,        2.88443,
    654         3.66294,        4.57845,        5.64911,        6.89637,        8.34578,        10.0282,        11.9812,        14.2519,        16.8993,        20.0000};
     653 .018547, .078104, .185102, .346090, .567998, .858331, 1.22535, 1.67824, 2.22735, 2.88443,
     654 3.66294, 4.57845, 5.64911, 6.89637, 8.34578, 10.0282, 11.9812, 14.2519, 16.8993, 20.0000};
    655655  static const G4double IF[nX]={0,
    656         .017143,        .072466,        .172271,        .323007,        .531545,        .805393,        1.15288,        1.58338,        2.10754,        2.73758,
    657         3.48769,        4.37450,        5.41770,        6.64092,        8.07288,        9.74894,        11.7135,        14.0232,        16.7522,        20.0000};
     656 .017143, .072466, .172271, .323007, .531545, .805393, 1.15288, 1.58338, 2.10754, 2.73758,
     657 3.48769, 4.37450, 5.41770, 6.64092, 8.07288, 9.74894, 11.7135, 14.0232, 16.7522, 20.0000};
    658658  static const G4double IG[nX]={0,
    659         .015618,        .066285,        .158094,        .297316,        .490692,        .745653,        1.07053,        1.47479,        1.96931,        2.56677,
    660         3.28205,        4.13289,        5.14068,        6.33158,        7.73808,        9.40133,        11.3745,        13.7279,        16.5577,        20.0000};
     659 .015618, .066285, .158094, .297316, .490692, .745653, 1.07053, 1.47479, 1.96931, 2.56677,
     660 3.28205, 4.13289, 5.14068, 6.33158, 7.73808, 9.40133, 11.3745, 13.7279, 16.5577, 20.0000};
    661661  static const G4double IH[nX]={0,
    662         .013702,        .058434,        .139923,        .264115,        .437466,        .667179,        .961433,        1.32965,        1.78283,        2.33399,
    663         2.99871,        3.79596,        4.74916,        5.88771,        7.24937,        8.88367,        10.8576,        13.2646,        16.2417,        20.0000};
     662 .013702, .058434, .139923, .264115, .437466, .667179, .961433, 1.32965, 1.78283, 2.33399,
     663 2.99871, 3.79596, 4.74916, 5.88771, 7.24937, 8.88367, 10.8576, 13.2646, 16.2417, 20.0000};
    664664  static const G4double II[nX]={0,
    665         .011264,        .048311,        .116235,        .220381,        .366634,        .561656,        .813132,        1.13008,        1.52322,        2.00554,
    666         2.59296,        3.30542,        4.16834,        5.21490,        6.48964,        8.05434,        9.99835,        12.4580,        15.6567,        20.0000};
     665 .011264, .048311, .116235, .220381, .366634, .561656, .813132, 1.13008, 1.52322, 2.00554,
     666 2.59296, 3.30542, 4.16834, 5.21490, 6.48964, 8.05434, 9.99835, 12.4580, 15.6567, 20.0000};
    667667  static const G4double IJ[nX]={0,
    668         .008628,        .037206,        .089928,        .171242,        .286114,        .440251,        .640343,        .894382,        1.21208,        1.60544,
    669         2.08962,        2.68414,        3.41486,        4.31700,        5.44048,        6.85936,        8.69067,        11.1358,        14.5885,        20.0000};
     668 .008628, .037206, .089928, .171242, .286114, .440251, .640343, .894382, 1.21208, 1.60544,
     669 2.08962, 2.68414, 3.41486, 4.31700, 5.44048, 6.85936, 8.69067, 11.1358, 14.5885, 20.0000};
    670670  static const G4double* Il[nE]=
    671671                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    672672  static const G4double lE[nE]={
    673 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    674  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     673-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     674 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    675675  static const G4double lEmi=lE[0];
    676676  static const G4double lEma=lE[nE-1];
    677677  static const G4double dlE=(lEma-lEmi)/bE;
    678         //***************************************************************************************
     678  //***************************************************************************************
    679679  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    680680  G4double lEn=std::log(Enu);         // log(E) for interpolation
     
    766766}
    767767
    768 // This class can provide only virtual exchange pi+ (a substitute for W+ boson)
     768// This class can provide only virtual exchange pi- (a substitute for W- boson)
    769769G4int G4QANuMuNuclearCrossSection::GetExchangePDGCode() {return -211;}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QAtomicElectronScattering.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QAtomicElectronScattering.cc,v 1.4 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QAtomicElectronScattering.cc,v 1.5 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QAtomicElectronScattering class -----------------
     
    3434// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    3535// ****************************************************************************************
    36 
     36// Short description: CHIPS is re3sponsible for photo- and lepto-nuclear
     37// reactions. In particular for thr electron-nuclear reactions. At High
     38// Energies the nucleons (including neutrons) and nuclear fragments can
     39// interact with atomic electrons (reversed electro-nuclear reaction -
     40// antilab), while they are missing the nucler-nuclear (ion-ion) reac-
     41// tions. This nucleo-electron process comes "for-free" in CHIPS, as the
     42// cross-sections of the interaction is known from the electro-nuclear
     43// reactions. The only problem is to move the output from the antilab to
     44// lab system. This is what this process is aiming to do. It can be used
     45// for the ion transport in Geant4.
     46// ---------------------------------------------------------------------
     47   
    3748//#define debug
    3849//#define pdebug
     
    7485
    7586// Fill the private parameters
    76 void G4QAtomicElectronScattering::SetParameters(G4double temper, G4double ssin2g, G4double etaetap,
    77                                      G4double fN, G4double fD, G4double cP, G4double mR,
    78                                      G4int nParCW, G4double solAn, G4bool efFlag,
    79                                      G4double piThresh, G4double mpisq, G4double dinum)
     87void G4QAtomicElectronScattering::SetParameters(G4double temper, G4double ssin2g,
     88                                                G4double etaetap, G4double fN, G4double fD,
     89                                                G4double cP, G4double mR, G4int nParCW,
     90                                                G4double solAn, G4bool efFlag,
     91                                                G4double piThresh, G4double mpisq,
     92                                                G4double dinum)
    8093{//  =============================================================================
    8194  Temperature=temper;
     
    263276#ifdef debug
    264277  G4int prPDG=particle->GetPDGEncoding();
    265                 G4cout<<"G4QAtomElScat::PostStepRestDoIt: projPDG="<<projPDG<<",stPDG="<<prPDG<<G4endl;
     278  G4cout<<"G4QAtomElScat::PostStepRestDoIt: projPDG="<<projPDG<<",stPDG="<<prPDG<<G4endl;
    266279#endif
    267280  if(!projPDG)
     
    274287  for(i=0; i<nE; ++i)
    275288  {
    276            G4double frac=material->GetFractionVector()[i];
     289    G4double frac=material->GetFractionVector()[i];
    277290    sum+=frac;
    278291    sumfra.push_back(sum);             // remember the summation steps
     
    299312    G4int curInd=G4QIsotope::Get()->GetLastIndex(Z);
    300313    if(!curInd)                       // The new artificial element must be defined
    301                                 {
     314    {
    302315      std::vector<std::pair<G4int,G4double>*>* newAbund =
    303316                                               new std::vector<std::pair<G4int,G4double>*>;
     
    307320        N=pElement->GetIsotope(j)->GetN()-Z;
    308321        if(pElement->GetIsotope(j)->GetZ()!=Z) G4cerr<<"*G4QCaptureAtRest::AtRestDoIt: Z="
    309                                                                                                                                                                                                                                                                                                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
     322                                        <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    310323        G4double abund=abuVector[j];
    311                                                                 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     324        std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    312325#ifdef debug
    313326        G4cout<<"G4QAtomElScat::PostStepDoIt:pair#="<<j<<", N="<<N<<",ab="<<abund<<G4endl;
    314327#endif
    315328        newAbund->push_back(pr);
    316                                                 }
     329      }
    317330#ifdef debug
    318331      G4cout<<"G4QAtomElectScat::PostStepDoIt:pairVectorLength="<<newAbund->size()<<G4endl;
     
    333346  if(dsr<dd)dsr=dd;
    334347  if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // ManualP
    335                 else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
     348  else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
    336349  else if(projPDG==-211)  G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);//Pi- ClustPars
    337350#ifdef debug
     
    343356    return 0;
    344357  }
    345                 if(projPDG==11||projPDG==-11||projPDG==13||projPDG==-13||projPDG==15||projPDG==-15)
    346                 { // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + neutrino & QE
     358  if(projPDG==11||projPDG==-11||projPDG==13||projPDG==-13||projPDG==15||projPDG==-15)
     359  { // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + neutrino & QE
    347360    G4double kinEnergy= projHadron->GetKineticEnergy();
    348361    G4ParticleMomentum dir = projHadron->GetMomentumDirection();
     
    443456  G4cout<<"G4QAtomElScat::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
    444457#endif
    445   G4QHadron* pH = new G4QHadron(projPDG,proj4M);                // ---> DELETED -->--   -+
     458  G4QHadron* pH = new G4QHadron(projPDG,proj4M);                // ---> DELETED -->------*
    446459  if(momentum<1000.) // Condition for using G4QEnvironment (not G4QuasmonString)         |
    447                 { //                                                                                   |
     460  { //                                                                                   |
    448461    G4QHadronVector projHV;                                 //                           |
    449     projHV.push_back(pH);                                   // DESTROYED over 2 lines -+ |
    450     G4QEnvironment* pan= new G4QEnvironment(projHV,targPDG);// ---> DELETED --->-----+ | |
    451     std::for_each(projHV.begin(), projHV.end(), DeleteQHadron()); // <---<------<----+-+-+
    452     projHV.clear(); // <------------<---------------<-------------------<------------+-+ .
     462    projHV.push_back(pH);                                   // DESTROYED over 2 lines -* |
     463    G4QEnvironment* pan= new G4QEnvironment(projHV,targPDG);// ---> DELETED --->-----* | |
     464    std::for_each(projHV.begin(), projHV.end(), DeleteQHadron()); // <---<------<----+-+-*
     465    projHV.clear(); // <------------<---------------<-------------------<------------+-* .
    453466#ifdef debug
    454467    G4cout<<"G4QAtomElectScat::PostStepDoIt: pPDG="<<projPDG<<", mp="<<mp<<G4endl;// |   .
    455468#endif
    456     try                                                           //                 |   .
    457            {                                                             //                 |   .
    458              delete output;                                              //                 |   .
     469    try                                                           //                 |   ^
     470    {                                                             //                 |   .
     471      delete output;                                              //                 |   ^
    459472      output = pan->Fragment();// DESTROYED in the end of the LOOP work space        |   .
    460     }                                                             //                 |   .
     473    }                                                             //                 |   ^
    461474    catch (G4QException& error)//                                                    |   .
    462            {                                                             //                 |   .
    463              //#ifdef pdebug
     475    {                                                             //                 |   ^
     476      //#ifdef pdebug
    464477      G4cerr<<"**G4QAtomElectScat::PostStepDoIt:G4QE Exception is catched"<<G4endl;//|   .
    465              //#endif
     478      //#endif
    466479      G4Exception("G4QAtomElScat::PostStepDoIt:","27",FatalException,"CHIPScrash");//|   .
    467     }                                                             //                 |   .
    468     delete pan;                              // Delete the Nuclear Environment <--<--+   .
    469   } //                                                                                   .
     480    }                                                             //                 |   ^
     481    delete pan;                              // Delete the Nuclear Environment <--<--*   .
     482  } //                                                                                   ^
    470483  else               // Use G4QuasmonString                                              .
    471                 { //                                                                                   ^
    472     G4QuasmonString* pan= new G4QuasmonString(pH,false,targPDG,false);//-> DELETED --+   |
     484  { //                                                                                   ^
     485    G4QuasmonString* pan= new G4QuasmonString(pH,false,targPDG,false);//-> DELETED --*   .
    473486    delete pH;                                                    // --------<-------+---+
    474487#ifdef debug
     
    478491    //G4int tNH=0;                    // Prototype of the number of secondaries inOut|
    479492    try                                                           //                 |
    480            {                                                             //                 |
    481                                   delete output;                                            //                   |
     493    {                                                             //                 |
     494      delete output;                                              //                 |
    482495      output = pan->Fragment();// DESTROYED in the end of the LOOP work space        |
    483496      // @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin                 |
    484497      //tNH=pan->GetNOfHadrons();     // For the test purposes of the String         |
    485498      //if(tNH==2)                    // At least 2 hadrons are in the Constr.Output |
    486                                   //{//                                                                          |
     499      //{//                                                                          |
    487500      //  elF=true;                   // Just put a flag for the ellastic Scattering |
    488              //  delete output;              // Delete a prototype of dummy G4QHadronVector |
     501      //  delete output;              // Delete a prototype of dummy G4QHadronVector |
    489502      //  output = pan->GetHadrons(); // DESTROYED in the end of the LOOP work space |
    490503      //}//                                                                          |
     
    496509    }                                                             //                 |
    497510    catch (G4QException& error)//                                                    |
    498            {                                                             //                 |
    499              //#ifdef pdebug
     511    {                                                             //                 |
     512      //#ifdef pdebug
    500513      G4cerr<<"**G4QAtomElectScat::PostStepDoIt: GEN Exception is catched"<<G4endl;//|
    501              //#endif
     514      //#endif
    502515      G4Exception("G4QAtomElSct::AtRestDoIt:","27",FatalException,"QString Excep");//|
    503516    }                                                             //                 |
    504     delete pan;                              // Delete the Nuclear Environment ---<--+
     517    delete pan;                              // Delete the Nuclear Environment ---<--*
    505518  }
    506519  aParticleChange.Initialize(track);
     
    534547    {
    535548#ifdef debug
    536              G4cout<<"G4QAtomElScat::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
     549      G4cout<<"G4QAtomElScat::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
    537550#endif
    538551      delete hadr;
     
    547560    {
    548561      if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong();   // K_L
    549                                                 else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
     562      else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
    550563    }
    551564    else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
     
    554567    else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
    555568    else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
    556            else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
     569    else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
    557570    {
    558571      G4int aZ = hadr->GetCharge();
    559572      G4int aA = hadr->GetBaryonNumber();
    560573#ifdef pdebug
    561                                                 G4cout<<"G4QAtomicElectronScattering::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
     574      G4cout<<"G4QAtomicElectronScattering::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
    562575#endif
    563576      theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
     
    567580    {
    568581#ifdef pdebug
    569                                                 G4cout<<"G4QAtomElectScat::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
     582      G4cout<<"G4QAtomElectScat::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
    570583#endif
    571584      theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
    572585#ifdef pdebug
    573                                                 G4cout<<"G4QAtomElScat::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
     586      G4cout<<"G4QAtomElScat::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
    574587#endif
    575588    }
     
    593606#endif
    594607    theSec->Set4Momentum(h4M); //                                                         ^
    595     delete hadr; // <-----<-----------<-------------<---------------------<---------<-----+
     608    delete hadr; // <-----<-----------<-------------<---------------------<---------<-----*
    596609#ifdef debug
    597610    G4ThreeVector curD=theSec->GetMomentumDirection();              //                    ^
     
    607620#endif
    608621  } //                                                                                    |
    609   delete output; // instances of the G4QHadrons from the output are already deleted above +
     622  delete output; // instances of the G4QHadrons from the output are already deleted above *
    610623  aParticleChange.ProposeTrackStatus(fStopAndKill);        // Kill the absorbed particle
    611624  //return &aParticleChange;                               // This is not enough (ClearILL)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QCaptureAtRest.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCaptureAtRest.cc,v 1.18 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCaptureAtRest.cc,v 1.20 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCaptureAtRest class -----------------
     
    3535// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3636// ****************************************************************************************
     37// Short Description: This is a universal process for nuclear capture
     38// (including annihilation) of all negative particles (negative hadrons,
     39// negative leptons: mu- & tau-). It can be used for the cold neutron
     40// capture, but somebody should decide what is the probability (defined
     41// by the capture cross-section and atomic material properties) to switch
     42// the cold neutron to the at-rest neutron. - M.K.2009.
     43// ----------------------------------------------------------------------
     44
    3745
    3846//#define debug
     
    105113
    106114G4QCaptureAtRest::~G4QCaptureAtRest()
    107 {}
     115{
     116  // deregister in the store
     117  G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this);
     118}
    108119
    109120G4LorentzVector G4QCaptureAtRest::GetEnegryMomentumConservation()
     
    170181  static G4bool CWinit = true;                       // CHIPS Warld needs to be initted
    171182  if(CWinit)
    172                 {
     183  {
    173184    CWinit=false;
    174185    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    219230  for(i=0; i<nE; ++i)
    220231  {
    221         G4double frac=material->GetFractionVector()[i];
     232    G4double frac=material->GetFractionVector()[i];
    222233    if(projPDG==13||projPDG==15)
    223234    {
     
    258269#endif
    259270    if(!Isotopes->IsDefined(Z,indEl))      // This index is not defined for this Z: define
    260                                 {
     271    {
    261272      std::vector<std::pair<G4int,G4double>*>* newAbund =
    262273                                               new std::vector<std::pair<G4int,G4double>*>;
     
    266277        N=pElement->GetIsotope(j)->GetN()-Z;
    267278        if(pElement->GetIsotope(j)->GetZ()!=Z) G4cerr<<"*G4QCaptureAtRest::AtRestDoIt: Z="
    268                                                                                                                                                                                                                                                                                                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
     279                                        <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    269280        G4double abund=abuVector[j];
    270                                                                 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     281        std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    271282#ifdef debug
    272283        G4cout<<"G4QCaptureAtRest::AtRestDoIt:pair#="<<j<<", N="<<N<<",ab="<<abund<<G4endl;
    273284#endif
    274285        newAbund->push_back(pr);
    275                                                 }
     286      }
    276287#ifdef debug
    277288      G4cout<<"G4QCaptureAtRest::AtRestDoIt: pairVectorLength="<<newAbund->size()<<G4endl;
     
    292303  if(dsr<dd)dsr=dd;
    293304  if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // ManualP
    294                 else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
     305  else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
    295306  else if(projPDG==-211)  G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);//Pi- ClustPars
    296307#ifdef debug
     
    330341#endif
    331342  localtime += Time;
    332         std::vector<G4double>* cascE = new std::vector<G4double>;
    333         std::vector<G4Track*>* cascT = new std::vector<G4Track*>;
     343  std::vector<G4double>* cascE = new std::vector<G4double>;
     344  std::vector<G4Track*>* cascT = new std::vector<G4Track*>;
    334345  G4bool neutronElastic = false;             // Flag of elastic neutro-nucleeus Scattering
    335346  G4bool chargExElastic = false;             // Flag of charge exchange Quasi-Elastic Scat.
     
    361372      if(eNeut<.0001) chargExElastic=true;    // neutron is too soft -> charge Exchange
    362373      else
    363                                                 {
     374      {
    364375        G4double probP=std::sqrt(eProt*(dmProt+eProt));
    365376        G4double probN=std::sqrt(eNeut*(dmNeut+eNeut));
     
    368379      }
    369380    }
    370                                 else if(mAR<=mAN||(mAR<=mAP+mProt&&mAR<=mAA+mAlph)) // Impossible to radiate n or Alpha
     381    else if(mAR<=mAN||(mAR<=mAP+mProt&&mAR<=mAA+mAlph)) // Impossible to radiate n or Alpha
    371382    {
    372383#ifdef debug
     
    383394  if(projPDG==15) nuPDG=16;
    384395#ifdef debug
    385                 G4int CV=0;
     396  G4int CV=0;
    386397  G4cout<<"G4QCaptureAtRest::AtRestDoIt:DecayIf is reached CV="<<CV<<G4endl;
    387398#endif
     
    431442#endif
    432443  }
    433                 else if(projPDG==-211 && targPDG==90001000)// Use Panofsky Ratio for (p+pi-) system decay
     444  else if(projPDG==-211 && targPDG==90001000)// Use Panofsky Ratio for (p+pi-) system decay
    434445  {                                          // (p+pi-=>n+pi0)/p+pi-=>n+gamma) = 3/2
    435446#ifdef debug
     
    440451    G4double pigamM=mPi0;
    441452    if(G4UniformRand()>0.6)
    442            {
     453    {
    443454      pigamPDG=22;
    444455      pigamM=0.;
     
    463474    G4LorentzVector totLV(0.,0.,0.,mp+mt);   // 4-momentum of the (A+pi-) compound system
    464475    if(Z==1 && N==1)                         // Quasi-Free process on Deuteron
    465            {
     476    {
    466477      G4LorentzVector f4Mom(0.,0.,0.,mNeut); // First neutron
    467478      G4LorentzVector s4Mom(0.,0.,0.,mNeut); // Second neutron
     
    505516      G4int nsec=cascE->size();
    506517      G4DynamicParticle* theSec = 0; // Prototype to fill particle in the G4ParticleChange
    507              for(G4int is=0; is<nsec; is++)
    508              {
     518      for(G4int is=0; is<nsec; is++)
     519      {
    509520        G4double ener=cascE->operator[](is);
    510521        if(ener>0) theSec = new G4DynamicParticle(G4Electron::Electron(),RndmDir(),ener);
     
    517528      }
    518529#ifdef debug
    519              G4cout<<"G4QCaptureAtRest::AtRestDoIt: e+nu+nu decay 4M="<<totLV<<totLV.m()<<G4endl;
     530      G4cout<<"G4QCaptureAtRest::AtRestDoIt: e+nu+nu decay 4M="<<totLV<<totLV.m()<<G4endl;
    520531#endif
    521532      G4double mt=G4QPDGCode(targPDG).GetMass();// Mass of the target Nucleus
     
    524535      G4double mmt=totLV.m();                   // Total energy of the compound system
    525536      if(ee>=mbm*(mmt-mbm/2)/mmt)
    526                                   {
    527              G4cout<<"-W-G4QCaptureAtRest::AtRestDoIt: Unrealistic E="<<ee<<", m="<<mMu<<G4endl;
     537      {
     538        G4cout<<"-W-G4QCaptureAtRest::AtRestDoIt: Unrealistic E="<<ee<<", m="<<mMu<<G4endl;
    528539        G4LorentzVector f4Mom(0.,0.,0.,mEl);    // Electron
    529540        G4LorentzVector s4Mom(0.,0.,0.,mt);     // Quark-A
     
    551562#ifdef debug
    552563        G4double fe=f4Mom.e();
    553                G4cout<<"G4QCaptureAtRest::AtRestDoIt: Ei="<<ee<<",Ef="<<fe<<",de="<<fe-ee<<G4endl;
     564        G4cout<<"G4QCaptureAtRest::AtRestDoIt: Ei="<<ee<<",Ef="<<fe<<",de="<<fe-ee<<G4endl;
    554565#endif
    555566        G4QHadron* electron = new G4QHadron(11,f4Mom); // Create Electron
     
    564575        }
    565576#ifdef debug
    566                G4cout<<"G4QCaptureAtRest::AtRestDoIt: (A+2nu) Decay is successful - 2"<<G4endl;
     577        G4cout<<"G4QCaptureAtRest::AtRestDoIt: (A+2nu) Decay is successful - 2"<<G4endl;
    567578#endif
    568579        G4QHadron* resnuc = new G4QHadron(targPDG,r4Mom); // Creation Hadron for ResidNucl
    569580#ifdef debug
    570                G4cout<<"G4QCaptureAtRest::AtRestDoIt: ResNuc 4M="<<mt<<r4Mom<<r4Mom.m()<<G4endl;
     581        G4cout<<"G4QCaptureAtRest::AtRestDoIt: ResNuc 4M="<<mt<<r4Mom<<r4Mom.m()<<G4endl;
    571582#endif
    572583        output->push_back(resnuc);               // Fill the Residual Nucleus to the output
    573584#ifdef debug
    574                G4cout<<"G4QCaptureAtRest::AtRestDoIt: ResNuc is filled nu="<<n4Mom<<nuPDG<<G4endl;
     585        G4cout<<"G4QCaptureAtRest::AtRestDoIt: ResNuc is filled nu="<<n4Mom<<nuPDG<<G4endl;
    575586#endif
    576587        G4QHadron* numu = new G4QHadron(nuPDG,n4Mom); // Create Hadron for LeptonicNeutrino
    577588        output->push_back(numu);                      // Fill Muonic Neutrino to the output
    578589#ifdef debug
    579                G4cout<<"G4QCaptureAtRest::AtRestDoIt:Nu is filled,anu="<<a4Mom<<a4Mom.m()<<G4endl;
     590        G4cout<<"G4QCaptureAtRest::AtRestDoIt:Nu is filled,anu="<<a4Mom<<a4Mom.m()<<G4endl;
    580591#endif
    581592        G4QHadron* anue = new G4QHadron(-12,a4Mom); // Create Hadron for the AntiE Neutrino
    582593        output->push_back(anue);                    // Fill the AntiENeutrino to the output
    583594#ifdef debug
    584                G4cout<<"G4QCaptureAtRest::AtRestDoIt: anu is filled == Success of Mu-cap"<<G4endl;
     595        G4cout<<"G4QCaptureAtRest::AtRestDoIt: anu is filled == Success of Mu-cap"<<G4endl;
    585596#endif
    586597      }
    587598    }
    588599    else                                            // @@Should be developed for tau-lepton
    589                                 {
    590                                                 G4int deL=11;                                 // Prototype of decay lepton
     600    {
     601      G4int deL=11;                                 // Prototype of decay lepton
    591602      G4int deN=-12;                                // Prototype of decay neutrino
    592603      G4double mdl=mEl;                             // Prototype of the decay mass
    593604      if(G4UniformRand()>.55)                       // Use mu decay instead of e-decay
    594                                                 {
     605      {
    595606        deL=13;
    596607        deN=-14;
     
    606617      }
    607618#ifdef debug
    608              G4cout<<"G4QCaptureAtRest::AtRestDoIt: Tau Decay is successful"<<G4endl;
     619      G4cout<<"G4QCaptureAtRest::AtRestDoIt: Tau Decay is successful"<<G4endl;
    609620#endif
    610621      G4QHadron* lept = new G4QHadron(deL,e4Mom);   // Creation Hadron for the Electron
    611622#ifdef debug
    612              G4cout<<"G4QCaptureAtRest::AtRestDoIt: lepton 4M="<<e4Mom<<e4Mom.m()<<G4endl;
     623      G4cout<<"G4QCaptureAtRest::AtRestDoIt: lepton 4M="<<e4Mom<<e4Mom.m()<<G4endl;
    613624#endif
    614625      output->push_back(lept);                      // Fill the Electron in the output
    615626#ifdef debug
    616              G4cout<<"G4QCaptureAtRest::AtRestDoIt: lepton is filled nu="<<n4Mom<<nuPDG<<G4endl;
     627      G4cout<<"G4QCaptureAtRest::AtRestDoIt: lepton is filled nu="<<n4Mom<<nuPDG<<G4endl;
    617628#endif
    618629      G4QHadron* nuta = new G4QHadron(nuPDG,n4Mom); // Create Hadron for LeptonicNeutrino
    619630#ifdef debug
    620              G4cout<<"G4QCaptureAtRest::AtRestDoIt: nu 4M="<<n4Mom<<n4Mom.m()<<G4endl;
     631      G4cout<<"G4QCaptureAtRest::AtRestDoIt: nu 4M="<<n4Mom<<n4Mom.m()<<G4endl;
    621632#endif
    622633      output->push_back(nuta);                      // Fill Muonic Neutrino to the output
    623634      G4QHadron* anul = new G4QHadron(deN,a4Mom);   // Create Hadron for the AntiE Neutrino
    624635#ifdef debug
    625            G4cout<<"G4QCaptureAtRest::AtRestDoIt: antiNu 4M="<<a4Mom<<a4Mom.m()<<G4endl;
     636      G4cout<<"G4QCaptureAtRest::AtRestDoIt: antiNu 4M="<<a4Mom<<a4Mom.m()<<G4endl;
    626637#endif
    627638      output->push_back(anul);                      // Fill the AntiENeutrino to the output
     
    632643    G4LorentzVector totLV(0.,0.,0.,mp+mProt-EnergyDeposition);// 4-mom of theCompoundSystem
    633644#ifdef debug
    634            G4cout<<"G4QCaptureAtRest::AtRestDoIt:CapOnProton decay 4M="<<totLV<<totLV.m()<<G4endl;
     645    G4cout<<"G4QCaptureAtRest::AtRestDoIt:CapOnProton decay 4M="<<totLV<<totLV.m()<<G4endl;
    635646#endif
    636647    G4LorentzVector g4Mom(0.,0.,0.,0.);      // mass of the muon neutrino
     
    650661    G4LorentzVector totLV(0.,0.,0.,mp+mDeut-EnergyDeposition);// 4-mom of theCompoundSystem
    651662#ifdef debug
    652            G4cout<<"G4QCaptureAtRest::AtRestDoIt: CapOnDeutr decay 4M="<<totLV<<totLV.m()<<G4endl;
     663    G4cout<<"G4QCaptureAtRest::AtRestDoIt: CapOnDeutr decay 4M="<<totLV<<totLV.m()<<G4endl;
    653664#endif
    654665    G4LorentzVector g4Mom(0.,0.,0.,0.);      // mass of the muon neutrino
     
    673684    G4LorentzVector totLV(0.,0.,0.,mp+mt-EnergyDeposition);// 4-mom of the(A+mu-) compound
    674685#ifdef debug
    675            G4cout<<"G4QCaptureAtRest::AtRestDoIt: Quasi-Free decay 4M="<<totLV<<totLV.m()<<G4endl;
     686    G4cout<<"G4QCaptureAtRest::AtRestDoIt: Quasi-Free decay 4M="<<totLV<<totLV.m()<<G4endl;
    676687#endif
    677688    G4int rPDG=targPDG-1000;                  // Subtract one proton from the nucleus
     
    693704  }
    694705  else                                        // *** THIS works for all particles ! ***
    695                 //else if(1>2)// !! Immediately change back - Very temporary to avoid nuclear capture !!
     706  //else if(1>2)// !! Immediately change back - Very temporary to avoid nuclear capture !!
    696707  {
    697708    G4QHadron* neutr = 0; // Create Neutrino
    698709    if(projPDG==13||projPDG==15) mp-=EnergyDeposition;//TheEnergyDeposit is only for LepCap
    699710#ifdef debug
    700            G4cout<<"G4QCaptureAtRest::AtRestDoIt: CHIPS M="<<mp<<",dE="<<EnergyDeposition<<G4endl;
     711    G4cout<<"G4QCaptureAtRest::AtRestDoIt: CHIPS M="<<mp<<",dE="<<EnergyDeposition<<G4endl;
    701712#endif
    702713    G4LorentzVector projLV(0.,0.,0.,mp);
     
    706717      G4int nsec=cascE->size();
    707718      G4DynamicParticle* theSec = 0; // Prototype to fill particle in the G4ParticleChange
    708              for(G4int is=0; is<nsec; is++)
    709              {
     719      for(G4int is=0; is<nsec; is++)
     720      {
    710721        G4double ener=cascE->operator[](is);
    711722        if(ener>0) theSec = new G4DynamicParticle(G4Electron::Electron(),RndmDir(),ener);
     
    737748        G4double qp=std::pow((std::pow(1.+ga*std::pow(hmm,b1),G4UniformRand())-1.)/ga,rb);
    738749        G4double mqq=0.;
    739                                                   if(qp<hmm) mqq=std::sqrt(mmu2-dmm*qp);
     750        if(qp<hmm) mqq=std::sqrt(mmu2-dmm*qp);
    740751        G4LorentzVector f4Mom(0.,0.,0.,0.);      // Muon neutrino
    741752        G4LorentzVector s4Mom(0.,0.,0.,mqq);     // Quark-Antiquark
     
    767778#endif
    768779    try                                                           //                 |
    769            {                                                             //                 |
    770              delete output;                                              //                 |
     780    {                                                             //                 |
     781      delete output;                                              //                 |
    771782      output = pan->Fragment();// DESTROYED in the end of the LOOP work space        |
    772783    }                                                             //                 |
    773784    catch (G4QException& error)//                                                    |
    774            {                                                             //                 |
    775              //#ifdef pdebug
     785    {                                                             //                 |
     786      //#ifdef pdebug
    776787      G4cerr<<"***G4QCaptureAtRest::AtRestDoIt: Exception is catched"<<G4endl; //    |
    777              //#endif
     788      //#endif
    778789      G4Exception("G4QCaptureAtRest::AtRestDoIt:","27",FatalException,"Gen.CHIPS Except.");
    779790    }                                                             //                 |
    780791    delete pan;                              // Delete the Nuclear Environment <--<--+
    781792#ifdef debug
    782            G4cout<<"G4QCaptureAtRest::AtRestDoIt: CHIPS fragmentation is done, CV="<<CV<<G4endl;
     793    G4cout<<"G4QCaptureAtRest::AtRestDoIt: CHIPS fragmentation is done, CV="<<CV<<G4endl;
    783794#endif
    784795    // ----- Ericson mu to pi conversion ----- ????? -----
     
    790801  G4int nsec=cascE->size();
    791802  aParticleChange.SetNumberOfSecondaries(tNH+nsec);
    792         for(G4int is=0; is<nsec; is++) aParticleChange.AddSecondary((*cascT)[is]);
     803  for(G4int is=0; is<nsec; is++) aParticleChange.AddSecondary((*cascT)[is]);
    793804  cascE->clear();
    794805  delete cascE;
     
    809820    {
    810821#ifdef debug
    811              G4cout<<"G4QCaptureAtRest::AtRestDoIt: Intermediate particle is found i="<<i<<G4endl;
     822      G4cout<<"G4QCaptureAtRest::AtRestDoIt: Intermediate particle is found i="<<i<<G4endl;
    812823#endif
    813824      delete hadr;
     
    826837    {
    827838      if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong();   // K_L
    828                                                 else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
     839      else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
    829840    }
    830841    else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
     
    833844    else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
    834845    else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
    835            else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
     846    else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
    836847    {
    837848      G4int aZ = hadr->GetCharge();
    838849      G4int aA = hadr->GetBaryonNumber();
    839850#ifdef pdebug
    840                                                 G4cout<<"G4QCaptureAtRest::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
     851      G4cout<<"G4QCaptureAtRest::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
    841852#endif
    842853      //if      (PDGCode==90001001) theDefinition = G4Deuteron::Deuteron();
     
    850861    {
    851862#ifdef pdebug
    852                                                 G4cout<<"G4QCaptureAtRest::AtRestDoIt:Define particle with PDG="<<PDGCode<<G4endl;
     863      G4cout<<"G4QCaptureAtRest::AtRestDoIt:Define particle with PDG="<<PDGCode<<G4endl;
    853864#endif
    854865      theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
    855866#ifdef pdebug
    856                                                 G4cout<<"G4QCaptureAtRest::AtRestDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
     867      G4cout<<"G4QCaptureAtRest::AtRestDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
    857868#endif
    858869    }
     
    925936  static const G4double rate[nAZ]={.00000045, .00000047, .00000215, .000000356, .00000468,
    926937                                   .00000226, .00000610, .00002750, .000023500, .00003790,
    927                                                                                                                                                                                                                                                                                         .00003500, .00006600, .00006200, .000102500, .00009500,
     938                                   .00003500, .00006600, .00006200, .000102500, .00009500,
    928939                                   .00008800, .00022900};
    929940#ifdef debug
     
    944955  else G4cout<<"--Warning--G4QCaptureAtRest::RandomizeMuDecayOrCapture: NEG Z="<<Z<<G4endl;
    945956  mZ=Z; mN=N; mH=Huff; mR=pC;    // Remember the last calculated parameters
    946   //G4double DLifeT=-std::log(G4UniformRand())/pD; // Time of the muon decay inside the atom
    947   //G4double CLifeT=-std::log(G4UniformRand())/pC; // Time of the muon capture by nucleus
     957  //G4double DLifeT=-std::log(G4UniformRand())/pD;// Time of the muon decay inside the atom
     958  //G4double CLifeT=-std::log(G4UniformRand())/pC;// Time of the muon capture by nucleus
    948959  //if(DLifeT<CLifeT)
    949960  //{
     
    958969  //  Time=CLifeT;
    959970#ifdef debug
    960   //  G4cout<<"G4QCaptureAtRest::RandomizeMuDecayOrCapture: CaptureLifeTime="<<Time<<G4endl;
    961 #endif
    962                 //  return true;
     971  //  G4cout<<"G4QCaptureAtRest::RandomizeMuDecayOrCapture:CaptureLifeTime="<<Time<<G4endl;
     972#endif
     973  //  return true;
    963974  //}
    964975  if((pD+pC)*G4UniformRand()>pD) // CAPTURE @@ Cash pD+pC
    965                 {
     976  {
    966977     Time=-std::log(G4UniformRand())/pC;
    967978     return true;
    968979  }
    969980  else
    970                 {
     981  {
    971982     Time=-std::log(G4UniformRand())/pD;
    972983     return false;
     
    10351046    if((nAuger < Z) && ((pGamma + 10000.0) * G4UniformRand() < 10000.0) ) // 10000 (? M.K.)
    10361047    {
    1037           nAuger++;                       // Radiate one more Auger electron
     1048      nAuger++;                       // Radiate one more Auger electron
    10381049      DeltaE = EnergyLevel[nLevel-1] - EnergyLevel[nLevel];
    10391050      nLevel--;
    10401051#ifdef debug
    1041           G4cout<<"G4QCaptureAtR::MuCaptureEMCascade: Auger_e E="<<DeltaE<<G4endl;
     1052   G4cout<<"G4QCaptureAtR::MuCaptureEMCascade: Auger_e E="<<DeltaE<<G4endl;
    10421053#endif
    10431054      dV->push_back(DeltaE);
     
    10521063      nLevel = iLevel;
    10531064#ifdef debug
    1054              G4cout<<"G4QCaptureAtR::MuCaptureEMCascade: photon E="<<DeltaE<<G4endl;
     1065      G4cout<<"G4QCaptureAtR::MuCaptureEMCascade: photon E="<<DeltaE<<G4endl;
    10551066#endif
    10561067      dV->push_back(-DeltaE);
     
    10721083  G4double Z227=Z27*Z27;
    10731084  G4double Z427=Z227*Z227;
    1074   G4double Zeff=(Z-0.13782)*(1.2162-(0.09118-Z427)*std::sqrt((G4double)Z)); // EffNuclear Charge
     1085  G4double Zeff=(Z-0.13782)*(1.2162-(0.09118-Z427)*std::sqrt((G4double)Z));// EffNuclCharge
    10751086  G4double Ze2=Zeff*Zeff;      // Squared effective charge of the Nucleus
    10761087  G4double pD=3436.*(1.-Ze2*.00014658);     //@@ 1./MeanLifeTime of Tau in atoms (in ns^-1)
     
    12251236          49.5635,49.6993,49.8367,49.9760,50.1175,50.2617,50.4091,50.5605,50.7166,50.8785,
    12261237          51.0475,51.2256,51.4151,51.6195,51.8439,52.0962,52.3897,52.7496,53.2325,54.0205};
    1227                 //Na23(Z=11)
     1238  //Na23(Z=11)
    12281239  static G4double P5[nE]={
    12291240          0.00000,7.00695,8.86633,10.1943,11.2667,12.1832,12.9928,13.7237,14.3938,15.0151,
     
    13841395  static const G4int mZ=mZ1-1;    // MaxPossibleZ
    13851396  static G4double* P[mZ1]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    1386                                                                                                                                                                                                                         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    1387                                                                                                                                                                                                                         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     1397                           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     1398                           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    13881399  //---------------------------------------------------------------------------------------
    13891400  if(z<1 || z>mZ)
    1390                 {
    1391                                 G4cout<<"-W-G4QCapAtRest::RandomizeDecayElectron: <=0 or big(>"<<mZ<<") Z="<<z<<G4endl;
     1401  {
     1402    G4cout<<"-W-G4QCapAtRest::RandomizeDecayElectron: <=0 or big(>"<<mZ<<") Z="<<z<<G4endl;
    13921403    return 0.;
    13931404  }
     
    13951406  G4double* nP = 0;
    13961407  if(!P[z])          // The table for this element must be created
    1397                 {
     1408  {
    13981409    for(G4int i=0; i<nZ; i++)
    1399                                 {
     1410    {
    14001411      G4double fZ=tZ[i];
    14011412      if(Z<=fZ)      // The extrapolation bin is found
    1402                                                 {
    1403 #ifdef debug
    1404                       G4cout<<"G4QCapAtRest::RandomizeDecayElectron: Z="<<Z<<", fZ="<<fZ<<G4endl;
     1413      {
     1414#ifdef debug
     1415        G4cout<<"G4QCapAtRest::RandomizeDecayElectron: Z="<<Z<<", fZ="<<fZ<<G4endl;
    14051416#endif
    14061417        nP = new G4double[nE];
     
    14081419        if(Z==fZ) for(G4int j=0; j<nE; j++) nP[j]=fP[j];
    14091420        else
    1410                                                                 {
    1411                                                                                 G4int i1=i-1;  // i>2, asthe first tabilated Z are 1,2,4,... and min_i=3
    1412                                                                                 G4double  iZ=tZ[i1];
     1421        {
     1422          G4int i1=i-1;  // i>2, asthe first tabilated Z are 1,2,4,... and min_i=3
     1423          G4double  iZ=tZ[i1];
    14131424          G4double* iP=PP[i1];
    14141425          G4double rZ=(Z-iZ)/(fZ-iZ);
     
    14161427        }
    14171428#ifdef debug
    1418                                     for(G4int k=0; k<nE; k++)G4cout<<"G4QCAR::RandDecEle:P["<<k<<"]="<<nP[k]<<G4endl;
     1429        for(G4int k=0; k<nE; k++)G4cout<<"G4QCAR::RandDecEle:P["<<k<<"]="<<nP[k]<<G4endl;
    14191430#endif
    14201431        P[z]=nP;
     
    14321443  G4double nPf=0.;
    14331444  if(iR<nEl) nPf=nP[iR+1];
    1434                 else       nPf=nP[nEl]+(nP[nEl]-nP[nEb])/2; // An artificial tail
    1435 #ifdef debug
    1436                 G4cout<<"G4QCapAtR::RaDEl:R="<<R<<",Ei="<<nPi<<",E="<<MeV*(nPi+(R-iR)*(nPf-nPi))<<G4endl;
     1445  else       nPf=nP[nEl]+(nP[nEl]-nP[nEb])/2; // An artificial tail
     1446#ifdef debug
     1447  G4cout<<"G4QCapAtR::RaDEl:R="<<R<<",Ei="<<nPi<<",E="<<MeV*(nPi+(R-iR)*(nPf-nPi))<<G4endl;
    14371448#endif
    14381449  return MeV*(nPi+(R-iR)*(nPf-nPi));
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QCoherentChargeExchange.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCoherentChargeExchange.cc,v 1.7 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCoherentChargeExchange.cc,v 1.8 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCoherentChargeExchange class -----------------
     
    3434// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    3535// ****************************************************************************************
    36 
     36// Short description: This class resolves an ambiguity in the definition of the
     37// "inelastic" cross section. As it was shown in Ph.D.Thesis (M.Kosov,ITEP,1979)
     38// it is more reasonable to subdivide the total cross-section in the coherent &
     39// incoherent parts, but the measuring method for the "inelastic" cross-sections
     40// consideres the lack of the projectile within the narrow forward solid angle
     41// with the consequent extrapolation of these partial cross-sections, corresponding
     42// to the particular solid angle, to the zero solid angle. The low angle region
     43// is shadowed by the elastic (coherent) scattering. BUT the coherent charge
     44// exchange (e.g. conversion p->n) is included by this procedure as a constant term
     45// in the extrapolation, so the "inelastic" cross-section differes from the
     46// incoherent cross-section by the value of the coherent charge exchange cross
     47// section. Fortunately, this cross-sectoion drops ruther fast with energy increasing.
     48// All Geant4 inelastic hadronic models (including CHIPS) simulate the incoherent
     49// reactions. So the incoherent (including quasielastic) cross-section must be used
     50// instead of the inelastic cross-section. For that the "inelastic" cross-section
     51// must be reduced by the value of the coherent charge-exchange cross-section, which
     52// is estimated (it must be tuned!) in this CHIPS class. The angular distribution
     53// is made (at present) identical to the corresponding coherent-elastic scattering
     54// -----------------------------------------------------------------------------------
    3755//#define debug
    3856//#define pdebug
     
    146164                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    147165          G4double abund=abuVector[j];
    148                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     166          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    149167#ifdef debug
    150168          G4cout<<"G4QCohChEx::GetMeanFreePath:pair#="<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    151169#endif
    152170          newAbund->push_back(pr);
    153                                                   }
     171        }
    154172#ifdef debug
    155173        G4cout<<"G4QCohChEx::GetMeanFreePath: pairVectorLength="<<newAbund->size()<<G4endl;
     
    178196      G4cout<<"G4QCCX::GMFP:true, P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
    179197#endif
    180                     G4bool ccsf=true;
     198      G4bool ccsf=true;
    181199      if(Q==-27.) ccsf=false;
    182200#ifdef debug
     
    251269  static G4bool CWinit = true;                       // CHIPS Warld needs to be initted
    252270  if(CWinit)
    253                 {
     271  {
    254272    CWinit=false;
    255273    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    323341#ifdef debug
    324342  G4int prPDG=particle->GetPDGEncoding();
    325                 G4cout<<"G4QCohChrgExchange::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     343  G4cout<<"G4QCohChrgExchange::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    326344#endif
    327345  if(!projPDG)
     
    340358  }
    341359  G4double pM2=pM*pM;
    342                 // Element treatment
     360  // Element treatment
    343361  G4int EPIM=ElProbInMat.size();
    344362#ifdef debug
    345                 G4cout<<"G4QCohChEx::PostStDoIt:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     363  G4cout<<"G4QCohChEx::PostStDoIt:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    346364#endif
    347365  G4int i=0;
     
    350368    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    351369    for(i=0; i<nE; ++i)
    352                   {
    353 #ifdef debug
    354                                   G4cout<<"G4QCohChEx::PostStepDoIt:EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
     370    {
     371#ifdef debug
     372      G4cout<<"G4QCohChEx::PostStepDoIt:EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
    355373#endif
    356374      if (rnd<ElProbInMat[i]) break;
     
    361379  Z=static_cast<G4int>(pElement->GetZ());
    362380#ifdef debug
    363                                 G4cout<<"G4QCoherentChargeExchange::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     381    G4cout<<"G4QCoherentChargeExchange::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    364382#endif
    365383  if(Z<=0)
     
    372390  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    373391#ifdef debug
    374                 G4cout<<"G4QCohChargeExchange::PosStDoIt:nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
     392  G4cout<<"G4QCohChargeExchange::PosStDoIt:nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
    375393#endif
    376394  G4int j=0;
     
    381399    {
    382400#ifdef debug
    383                                   G4cout<<"G4QCohChargEx::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
     401      G4cout<<"G4QCohChargEx::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
    384402#endif
    385403      if(rndI < (*SPI)[j]) break;
     
    389407  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    390408#ifdef debug
    391                 G4cout<<"G4QCohChargeEx::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
     409  G4cout<<"G4QCohChargeEx::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
    392410#endif
    393411  if(N<0)
     
    505523  aParticleChange.ProposeTrackStatus(fStopAndKill);
    506524  // Definition of the scattered nucleon
    507                 G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
     525  G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
    508526  G4ParticleDefinition* theDefinition=G4Proton::Proton();
    509527  if(projPDG==2212) theDefinition=G4Neutron::Neutron();
     
    516534  aParticleChange.AddSecondary( aNewTrack );
    517535  // Filling the recoil nucleus
    518                 theSec = new G4DynamicParticle; // A secondary for the recoil hadron
     536  theSec = new G4DynamicParticle; // A secondary for the recoil hadron
    519537  G4int aA = Z+N;
    520538#ifdef pdebug
    521                 G4cout<<"G4QCoherentChargeExchange::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
     539  G4cout<<"G4QCoherentChargeExchange::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
    522540#endif
    523541  theDefinition=G4ParticleTable::GetParticleTable()->FindIon(Z,aA,0,Z);
     
    577595  {
    578596    if(oxs) res=CSmanager->GetHMaxT();   // Calculate the max_t value
    579                                 else res=CSmanager->GetExchangeT(Z, N, pPDG); // fanctionally randomized -t in MeV^2
     597    else res=CSmanager->GetExchangeT(Z, N, pPDG); // fanctionally randomized -t in MeV^2
    580598  }
    581599  else G4cout<<"*Warning*G4QCohChrgExchange::CalculateXSt: NotInitiatedScattering"<<G4endl;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QCollision.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QCollision.cc,v 1.28 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QCollision.cc,v 1.32 2009/04/17 15:22:31 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QCollision class -----------------
     
    3434// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    3535// ****************************************************************************************
    36 
     36// Short description: This is a universal class for the incoherent (inelastic)
     37// nuclear interactions in the CHIPS model.
     38// ---------------------------------------------------------------------------
    3739//#define debug
    3840//#define pdebug
     41//#define ldebug
    3942//#define ppdebug
    4043//#define qedebug
     
    250253    G4cout<<"G4QCollision::GetMeanFreePath: isovectorLength="<<isoSize<<G4endl; // Result
    251254#endif
    252     if(isoSize)                             // The Element has non-trivial abumdance set
     255    if(isoSize)                             // The Element has non-trivial abundance set
    253256    {
    254257      indEl=pElement->GetIndex()+1;         // Index of the non-trivial element
     
    262265          G4int N=pElement->GetIsotope(j)->GetN()-Z; // N means A=N+Z !
    263266          if(pElement->GetIsotope(j)->GetZ()!=Z)G4cerr<<"G4QCollision::GetMeanFreePath"
    264                                                                                                                                                                                                                                                                         <<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
     267                                 <<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    265268          G4double abund=abuVector[j];
    266                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     269          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    267270#ifdef debug
    268271          G4cout<<"G4QCollision::GetMeanFreePath: p#="<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    269272#endif
    270273          newAbund->push_back(pr);
    271                                                   }
     274        }
    272275#ifdef debug
    273276        G4cout<<"G4QCollision::GetMeanFreePath: pairVectLength="<<newAbund->size()<<G4endl;
     
    384387  static const G4double mPi0s= mPi0*mPi0;
    385388  static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);// Mass of deuteron
     389  //static const G4double mDeut2=mDeut*mDeut;                      // SquaredMassOfDeuteron
    386390  static const G4double mTrit= G4QPDGCode(2112).GetNuclMass(1,2,0);// Mass of tritium
    387391  static const G4double mHel3= G4QPDGCode(2112).GetNuclMass(2,1,0);// Mass of Helium3
     
    432436  static G4bool CWinit = true;              // CHIPS Warld needs to be initted
    433437  if(CWinit)
    434                 {
     438  {
    435439    CWinit=false;
    436440    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    457461#ifdef debug
    458462  G4double mp=proj4M.m();
    459   G4cout<<"G4QCollis::PostStepDoIt:called, P="<<Momentum<<"="<<momentum<<",m="<<mp<<G4endl;
     463  G4cout<<"-->G4QCollis::PostStDoIt:called,P="<<Momentum<<"="<<momentum<<",m="<<mp<<G4endl;
    460464#endif
    461465  if (!IsApplicable(*particle))  // Check applicability
     
    507511#ifdef debug
    508512  G4int prPDG=particle->GetPDGEncoding();
    509                 G4cout<<"G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     513  G4cout<<"G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    510514#endif
    511515  if(!projPDG)
     
    516520  G4int EPIM=ElProbInMat.size();
    517521#ifdef debug
    518                 G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     522  G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    519523#endif
    520524  G4int i=0;
     
    523527    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    524528    for(i=0; i<nE; ++i)
    525                   {
    526 #ifdef debug
    527                                   G4cout<<"G4QCollision::PostStepDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
     529    {
     530#ifdef debug
     531      G4cout<<"G4QCollision::PostStepDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
    528532#endif
    529533      if (rnd<ElProbInMat[i]) break;
     
    534538  Z=static_cast<G4int>(pElement->GetZ());
    535539#ifdef debug
    536                                 G4cout<<"G4QCollision::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     540    G4cout<<"G4QCollision::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    537541#endif
    538542  if(Z<=0)
     
    545549  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    546550#ifdef debug
    547                 G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
     551  G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
    548552#endif
    549553  G4int j=0;
     
    554558    {
    555559#ifdef debug
    556                                   G4cout<<"G4QCollision::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
     560      G4cout<<"G4QCollision::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
    557561#endif
    558562      if(rndI < (*SPI)[j]) break;
     
    562566  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    563567#ifdef debug
    564                 G4cout<<"G4QCollision::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<G4endl;
     568  G4cout<<"G4QCollision::PostStepDoIt: Z="<<Z<<", j="<<i<<", N(isotope)="<<N<<G4endl;
    565569#endif
    566570  if(N<0)
     
    576580  if(dsr<dd)dsr=dd;
    577581  if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // ManualP
    578                 else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
     582  else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
    579583  else if(projPDG==-211)  G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);//Pi- ClustPars
    580584#ifdef debug
     
    607611  // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + NC (?)
    608612  //
    609   if (aProjPDG == 11 || aProjPDG == 13 || aProjPDG == 15) {
    610 
     613  if (aProjPDG == 11 || aProjPDG == 13 || aProjPDG == 15)
     614  {
    611615#ifdef debug
    612616    G4cout<<"G4QCollision::PostStDoIt:startSt="<<aParticleChange.GetTrackStatus()<<G4endl;
     
    646650    G4double photonEnergy = CSmanager->GetExchangeEnergy(); // Energy of EqivExchangePart
    647651#ifdef debug
    648                                 G4cout<<"G4QCol::PStDoIt: kE="<<kinEnergy<<",dir="<<dir<<",phE="<<photonEnergy<<G4endl;
     652    G4cout<<"G4QCol::PStDoIt: kE="<<kinEnergy<<",dir="<<dir<<",phE="<<photonEnergy<<G4endl;
    649653#endif
    650654    if( kinEnergy < photonEnergy || photonEnergy < 0.)
     
    708712    G4double cost=(iniE*finE-ml2-photonQ2/2)/iniP/finP; // cos(scat_ang_of_lepton)
    709713#ifdef pdebug
    710                   G4cout<<"G4QC::PSDoIt:Q2="<<photonQ2<<",ct="<<cost<<",Pi="<<iniP<<",Pf="<<finP<<G4endl;
     714    G4cout<<"G4QC::PSDoIt:Q2="<<photonQ2<<",ct="<<cost<<",Pi="<<iniP<<",Pf="<<finP<<G4endl;
    711715#endif
    712716    if(cost>1.) cost=1.;                 // To avoid the accuracy of calculation problem
     
    717721    G4double absEn = std::pow(am,third)*GeV;  // @@(b) Mean Energy Absorbed by a Nucleus
    718722    //if(am>1 && absEn < photonEnergy)     // --> the absorption of energy can happen
    719                                 if(absEn < photonEnergy)     // --> the absorption of energy can happen
     723    if(absEn < photonEnergy)     // --> the absorption of energy can happen
    720724    {
    721725      G4double abtEn = absEn+hdM;        // @@(b) MeanEnergyAbsorbed by a nucleus (+M_N)
     
    727731      absMom         = std::sqrt(abMo2); // Absorbed Momentum
    728732      if(absMom < phMo)                  // --> the absorption of momentum can happen
    729                                   {
     733      {
    730734        G4double dEn = photonEnergy - absEn; // Leading energy
    731735        G4double dMo = phMo - absMom;    // Leading momentum
    732736        G4double sF  = dEn*dEn - dMo*dMo;// s of leading particle
    733737#ifdef ppdebug
    734                                     G4cout<<"-PhotoAbsorption-G4QCol::PStDoIt:sF="<<sF<<",phEn="<<photonEnergy<<G4endl;
     738        G4cout<<"-PhotoAbsorption-G4QCol::PStDoIt:sF="<<sF<<",phEn="<<photonEnergy<<G4endl;
    735739#endif
    736740        if(sF > stmPi)                   // --> Leading fragmentation is possible
    737                                                                 {
     741        {
    738742          photonEnergy = absEn;          // New value of the photon energy
    739743          photonQ2=abMo2-absEn*absEn;    // New value of the photon Q2
     
    757761    aParticleChange.ProposeMomentumDirection(findir); // new direction for the lepton
    758762#ifdef pdebug
    759                   G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()<<"="<<finE<<"-"
     763    G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()<<"="<<finE<<"-"
    760764          <<ml<<", d="<<*aParticleChange.GetMomentumDirection()<<","<<findir<<G4endl;
    761765#endif
     
    765769      G4double ptm=photon3M.mag();                    // 3M of the virtual photon
    766770#ifdef ppdebug
    767                     G4cout<<"-Absorption-G4QCollision::PostStepDoIt: ph3M="<<photon3M<<", eIn3M="
     771      G4cout<<"-Absorption-G4QCollision::PostStepDoIt: ph3M="<<photon3M<<", eIn3M="
    768772            <<iniP*dir<<", eFin3M="<<finP*findir<<", abs3M="<<absMom<<"<ptm="<<ptm<<G4endl;
    769773#endif
     
    772776      proj4M=G4LorentzVector(lead3M,absEn); // 4-momentum of leading System
    773777#ifdef ppdebug
    774                     G4cout<<"-->G4QC::PoStDoIt: new sF="<<proj4M.m2()<<", lead4M="<<proj4M<<G4endl;
     778      G4cout<<"-->G4QC::PoStDoIt: new sF="<<proj4M.m2()<<", lead4M="<<proj4M<<G4endl;
    775779#endif
    776780      lead4M=proj4M;                        // Remember 4-mom for the total 4-momentum
    777781      G4Quasmon* pan= new G4Quasmon(G4QContent(1,1,0,1,1,0),proj4M);// ---> DELETED -->---+
    778782      try                                                           //                    |
    779              {                                                             //                    |
    780                delete leadhs;                                              //                    |
     783      {                                                             //                    |
     784        delete leadhs;                                              //                    |
    781785        G4QNucleus vac(90000000);                                   //                    |
    782786        leadhs=pan->Fragment(vac,1);  // DELETED after it is copied to output vector      |
    783787      }                                                             //                    |
    784788      catch (G4QException& error)                                   //                    |
    785              {                                                             //                    |
     789      {                                                             //                    |
    786790        G4cerr<<"***G4QCollision::PostStepDoIt: G4Quasmon Exception is catched"<<G4endl;//|
    787791        G4Exception("G4QCollision::PostStepDoIt:","72",FatalException,"QuasmonCrash");  //|
     
    789793      delete pan;                              // Delete the Nuclear Environment <----<---+
    790794#ifdef ppdebug
    791                                                 G4cout<<"G4QCol::PStDoIt: l4M="<<proj4M<<proj4M.m2()<<", N="<<leadhs->size()<<",pt="
     795      G4cout<<"G4QCol::PStDoIt: l4M="<<proj4M<<proj4M.m2()<<", N="<<leadhs->size()<<",pt="
    792796            <<ptm<<",pa="<<absMom<<",El="<<absEn<<",Pl="<<ptm-absMom<<G4endl;
    793797#endif
     
    796800    proj4M=G4LorentzVector(photon3M,photonEnergy);
    797801#ifdef debug
    798                   G4cout<<"G4QCollision::PostStDoIt: St="<<aParticleChange.GetTrackStatus()<<", g4m="
     802    G4cout<<"G4QCollision::PostStDoIt: St="<<aParticleChange.GetTrackStatus()<<", g4m="
    799803          <<proj4M<<", lE="<<finE<<", lP="<<finP*findir<<", d="<<findir.mag2()<<G4endl;
    800804#endif
     
    803807  // neutrinoNuclear interactions (nu_e, nu_mu only)
    804808  //
    805   } else if (aProjPDG == 12 || aProjPDG == 14) {
    806 
     809  }
     810  else if (aProjPDG == 12 || aProjPDG == 14)
     811  {
    807812    G4double kinEnergy= projHadron->GetKineticEnergy()/MeV; // Total energy of the neutrino
    808813    G4double dKinE=kinEnergy+kinEnergy;  // doubled energy for s calculation
    809814#ifdef debug
    810                   G4cout<<"G4QCollision::PostStDoIt: 2*nuEnergy="<<dKinE<<"(MeV), PDG="<<projPDG<<G4endl;
     815    G4cout<<"G4QCollision::PostStDoIt: 2*nuEnergy="<<dKinE<<"(MeV), PDG="<<projPDG<<G4endl;
    811816#endif
    812817    G4ParticleMomentum dir = projHadron->GetMomentumDirection(); // unit vector
    813818    G4double ml  = mu;
    814     G4double ml2 =      mu2;
    815     //G4double mlN =    muN;
    816     G4double mlN2=      muN2;
    817     G4double fmlN=      fmuN;
    818     G4double mlsN=      musN;
    819     //G4double mlP =    muP;
    820     G4double mlP2=      muP2;
    821     G4double fmlP=      fmuP;
    822     G4double mlsP=      musP;
    823     G4double mldM=      mudM;
    824     //G4double mlD =    muD;
    825     G4double mlD2=      muD2;
     819    G4double ml2 = mu2;
     820    //G4double mlN = muN;
     821    G4double mlN2= muN2;
     822    G4double fmlN= fmuN;
     823    G4double mlsN= musN;
     824    //G4double mlP = muP;
     825    G4double mlP2= muP2;
     826    G4double fmlP= fmuP;
     827    G4double mlsP= musP;
     828    G4double mldM= mudM;
     829    //G4double mlD = muD;
     830    G4double mlD2= muD2;
    826831    if(aProjPDG==12)
    827832    {
    828833      ml  = me;
    829       ml2 =     me2;
    830       //mlN =   meN;
    831       mlN2=     meN2;
    832       fmlN=     fmeN;
    833       mlsN=     mesN;
    834       //mlP =   meP;
    835       mlP2=     meP2;
    836       fmlP=     fmeP;
    837       mlsP=     mesP;
    838       mldM=     medM;
    839       //mlD =   meD;
    840       mlD2=     meD2;
     834      ml2 = me2;
     835      //mlN = meN;
     836      mlN2= meN2;
     837      fmlN= fmeN;
     838      mlsN= mesN;
     839      //mlP = meP;
     840      mlP2= meP2;
     841      fmlP= fmeP;
     842      mlsP= mesP;
     843      mldM= medM;
     844      //mlD = meD;
     845      mlD2= meD2;
    841846    }
    842847    G4VQCrossSection* CSmanager =G4QNuMuNuclearCrossSection::GetPointer(); // (nu,l)
     
    881886    G4bool secnu=false;
    882887    if(xSec*G4UniformRand()>xSec1)               // recover neutrino/antineutrino
    883                                 {
     888    {
    884889      if(scatPDG>0) scatPDG++;
    885890      else          scatPDG--;
     
    900905      totCS1 = qelCS1;
    901906      totCS2 = qelCS2;
    902                                 }
     907    }
    903908    // make different definitions for neutrino and antineutrino
    904909    G4double mIN=mProt;                          // Just a prototype (for anu, Z=1, N=0)
     
    956961    {
    957962      if(Z>1||N>0)                               // Calculate the splitted mass
    958                                                 {
     963      {
    959964        targPDG-=1000;                           // Anti-Neutrino -> subtract proton
    960965        G4QPDGCode targQPDG(targPDG);
     
    973978    G4double s=mIN*(mIN+dKinE);                  // s=(M_cm)^2=m2+2mE (m=targetMass,E=E_nu)
    974979#ifdef debug
    975                   G4cout<<"G4QCollision::PostStDoIt: s="<<s<<" >? OT="<<OT<<", mlD2="<<mlD2<<G4endl;
     980    G4cout<<"G4QCollision::PostStDoIt: s="<<s<<" >? OT="<<OT<<", mlD2="<<mlD2<<G4endl;
    976981#endif
    977982    if(s<=OT)                                    // *** Do nothing solution ***
     
    986991    }
    987992#ifdef debug
    988                 G4cout<<"G4QCollision::PostStDoIt: Stop and kill the projectile neutrino"<<G4endl;
     993    G4cout<<"G4QCollision::PostStDoIt: Stop and kill the projectile neutrino"<<G4endl;
    989994#endif
    990995    aParticleChange.ProposeEnergy(0.);
     
    9981003      else      Q2=CSmanager->GetQEL_ExchangeQ2();
    9991004#ifdef debug
    1000                   G4cout<<"G4QCollision::PostStDoIt:QuasiEl(nu="<<secnu<<"),s="<<s<<",Q2="<<Q2<<G4endl;
     1005      G4cout<<"G4QCollision::PostStDoIt:QuasiEl(nu="<<secnu<<"),s="<<s<<",Q2="<<Q2<<G4endl;
    10011006#endif
    10021007      //G4double ds=s+s;                          // doubled s
     
    10321037      else      Q2=CSmanager2->GetNQE_ExchangeQ2();
    10331038#ifdef debug
    1034                   G4cout<<"G4QColl::PStDoIt: MultiPeriferal s="<<s<<",Q2="<<Q2<<",T="<<targPDG<<G4endl;
     1039      G4cout<<"G4QColl::PStDoIt: MultiPeriferal s="<<s<<",Q2="<<Q2<<",T="<<targPDG<<G4endl;
    10351040#endif
    10361041      if(secnu) projPDG=CSmanager2->GetExchangePDGCode();// PDG Code of the effective gamma
     
    10551060      {
    10561061#ifdef debug
    1057                     G4cout<<"*G4QCollision::PostStDoIt: cost="<<cost<<", Q2="<<Q2<<", nu="<<we<<", mx="
     1062        G4cout<<"*G4QCollision::PostStDoIt: cost="<<cost<<", Q2="<<Q2<<", nu="<<we<<", mx="
    10581063              <<mx<<", pot="<<pot<<", 2KE="<<dKinE<<G4endl;
    10591064#endif
     
    10771082      proj4M-=scat4M;                           // 4mom of the W/Z (effective pion/gamma)
    10781083#ifdef debug
    1079                   G4cout<<"G4QCollision::PostStDoIt: proj4M="<<proj4M<<", ml="<<ml<<G4endl;
     1084      G4cout<<"G4QCollision::PostStDoIt: proj4M="<<proj4M<<", ml="<<ml<<G4endl;
    10801085#endif
    10811086      // Check that the en/mom transfer is possible, if not -> elastic
     
    11621167      }
    11631168    }
    1164 
    11651169  //
    1166   // quasi-elastic for p+A(Z,N)
     1170  // quasi-elastic (& pickup process) for p+A(Z,N)
    11671171  //
    1168   } else if (aProjPDG == 2212 && Z > 0 && N > 0) {
    1169     //else if(2>3)
    1170 
     1172  }
     1173  else if (aProjPDG == 2212 && Z > 0 && N > 0)
     1174  //else if(2>3)
     1175  {
    11711176    G4QuasiFreeRatios* qfMan=G4QuasiFreeRatios::GetPointer();
    11721177    std::pair<G4double,G4double> fief=qfMan->GetRatios(momentum, aProjPDG, Z, N);
    11731178    G4double qepart=fief.first*fief.second;
    1174 #ifdef qedebug
    1175     G4cout<<"G4QCol::PSD:QE[p("<<proj4M<<")+(Z="<<Z<<",N="<<N<<",)="<<qepart<<G4endl;
    1176 #endif
    1177     if(G4UniformRand()<qepart) // Make a quasi free scattering (out:A-1,h,N) @@ KinLim
    1178     {
    1179       // First decay a nucleus in a nucleon and a residual (A-1) nucleus
    1180       G4double dmom=91.; // Fermi momentum (proto default for a deuteron)
    1181       if(Z>1||N>1) dmom=286.2*std::pow(-std::log(G4UniformRand()),third);// p_max=250 MeV/c
    1182 
     1179    // Keep QE part for the quasi-free nucleons
     1180    const G4int lCl=3; // The last clProb[lCl]==1. by definition, MUST be increasing
     1181    G4double clProb[lCl]={.65,.85,.95};// N/P,D,t/He3,He4, integratedProb for .65,.2,.1,.05
     1182    if(qepart>0.45) qepart=.45; // Quasielastic part is too large - shrink
     1183    else qepart/=clProb[0];     // Add corresponding number of 2N, 3N, & 4N clusters
     1184    G4double pickup=1.-qepart;  // Estimate the rest of the cross-section
     1185    G4double thresh=100.;
     1186    if(momentum > thresh) pickup*=50./momentum/std::pow(Z+N,third); // 50. is a par(!)
     1187    // pickup = 0.;               // To exclude the pickup process
     1188    if (N) pickup+=qepart;
     1189    else   pickup =qepart;
     1190    G4double rnd=G4UniformRand();
     1191#ifdef ldebug
     1192    G4cout<<"-->G4QCol::PSD:QE[p("<<proj4M<<")+(Z="<<Z<<",N="<<N<<")]="<<qepart
     1193          <<", pickup="<<pickup<<G4endl;
     1194#endif
     1195    if(rnd<pickup) // Make a quasi free scattering (out:A-1,h,N) @@ KinLim,CoulBar,PauliBl
     1196    {
     1197     G4double dmom=91.;  // Fermi momentum (proto default for a deuteron)
     1198     G4double fmm=287.;  // @@ Can be A-dependent
     1199     if(Z>1||N>1) dmom=fmm*std::pow(-std::log(G4UniformRand()),third);
     1200     // Values to be redefined for quasi-elastic
     1201     G4LorentzVector r4M(0.,0.,0.,0.);      // Prototype of 4mom of the residual nucleus
     1202     G4LorentzVector n4M(0.,0.,0.,0.);      // Prototype of 4mom of the quasi-cluster
     1203     G4int nPDG=90000001;                   // Prototype for quasi-cluster mass calculation
     1204     G4int restPDG=targPDG;                 // Prototype should be reduced by quasi-cluster
     1205     G4int rA=Z+N-1;                        // Prototype for the residualNucl definition
     1206     G4int rZ=Z;                            // residZ: OK for the quasi-free neutron
     1207     G4int nA=1;                            // Prototype for the quasi-cluster definition
     1208     G4int nZ=0;                            // nA=1,nZ=0: OK for the quasi-free neutron
     1209     G4double qM=mNeut;                     // Free mass of the quasi-free cluster
     1210     G4int A = Z + N;                       // Baryon number of the nucleus
     1211     if(rnd<qepart)
     1212     {
     1213      // ===> First decay a nucleus in a nucleon and a residual (A-1) nucleus
    11831214      // Calculate cluster probabilities (n,p,d,t,he3,he4 now only, can use UpdateClusters)
    1184       const G4int lCl=3; // The last clProb[lCl]==1. by definition, MUST be increasing
    1185       G4double clProb[lCl]={0.6,0.7,0.8}; // N/P,D,t/He3,Alpha, integrated prob for .6,.1,.1,.2
    11861215      G4double base=1.;  // Base for randomization (can be reduced by totZ & totN)
    1187       G4int max=lCl;   // Number of boundaries (can be reduced by totZ & totN)
    1188 
     1216      G4int max=lCl;     // Number of boundaries (can be reduced by totZ & totN)
    11891217      // Take into account that at least one nucleon must be left !
    1190       // Change max-- to --max - DHW 05/08
    1191       G4int A = Z + N;       // Baryon number of the nucleus
    11921218      if (Z<2 || N<2 || A<5) base = clProb[--max]; // Alpha cluster is impossible
    11931219      if ( (Z > 1 && N < 2) || (Z < 2 && N > 1) )
    11941220        base=(clProb[max]+clProb[max-1])/2; // t or He3 is impossible
    1195 
    1196       if ( (Z < 2 && N < 2) || A < 4) base=clProb[--max]; // Both He3 and t clusters are impossible
    1197 
     1221      if ( (Z < 2 && N < 2) || A < 4) base=clProb[--max];// He3 & t clusters are impossible
    11981222      if(A<3)           base=clProb[--max]; // Deuteron cluster is impossible
    11991223      G4int cln=0;                          // Cluster#0 (Default for the selected nucleon)
     
    12071231      G4ParticleDefinition* theDefinition;  // Prototype for qfNucleon
    12081232      G4bool cp1 = cln+2==A;                // A=ClusterBN+1 condition
    1209       // Values to be defined in the following IF/ELSE
    1210       G4LorentzVector r4M(0.,0.,0.,0.);     // Prototype of 4mom of the residual nucleus
    1211       G4LorentzVector n4M(0.,0.,0.,0.);     // Prototype of 4mom of the quasi-cluster
    1212       G4int nPDG=90000001;                  // Prototype for quasi-cluster mass calculation
    1213       G4int restPDG=targPDG;                // Prototype should be reduced by quasi-cluster
    1214       G4int rA=Z+N-1;                       // Prototype for the residualNucl definition
    1215       G4int rZ=Z;                           // residZ: OK for the quasi-free neutron
    1216       G4int nA=1;                           // Prototype for the quasi-cluster definition
    1217       G4int nZ=0;                           // nA=1,nZ=0: OK for the quasi-free neutron
    1218       G4double qM=mNeut;                    // Free mass of the quasi-free cluster
    12191233      if(!cln || cp1)                       // Split in nucleon + (A-1) with Fermi momentum
    12201234      {
     
    12391253        n4M=G4LorentzVector(0.,0.,0.,nM);         // 4mom of the quasi-nucleon
    12401254#ifdef qedebug
    1241                       G4cout<<"G4QCollis::PStDoIt:QE,p="<<dmom<<",tM="<<tM<<",R="<<rM<<",N="<<nM<<G4endl;
     1255        G4cout<<"G4QCollis::PStDoIt:QE,p="<<dmom<<",tM="<<tM<<",R="<<rM<<",N="<<nM<<G4endl;
    12421256#endif
    12431257        if(!G4QHadron(t4M).DecayIn2(r4M, n4M))
     
    12471261        }
    12481262#ifdef qedebug
    1249                       G4cout<<"G4QCol::PStDoIt:QE-N,RA="<<r4M.rho()<<r4M<<",QN="<<n4M.rho()<<n4M<<G4endl;
     1263        G4cout<<"G4QCol::PStDoIt:QE-N,RA="<<r4M.rho()<<r4M<<",QN="<<n4M.rho()<<n4M<<G4endl;
    12501264#endif
    12511265        if(cp1 && cln)                           // Quasi-cluster case: swap the output
     
    12661280        }
    12671281      }
    1268       else // Split a cluster (w or w/o "Fermi motion" and "Fermi decay")
     1282      else // Split the cluster (with or w/o "Fermi motion" and "Fermi decay")
    12691283      {
    12701284        if(cln==1)
     
    12751289          nZ=1;
    12761290          restPDG-=1001;
     1291          // Recalculate dmom
     1292          G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) +
     1293                      fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1294          dmom=sumv.mag();
    12771295        }
    12781296        else if(cln==2)
    12791297        {
    12801298          nA=3;
    1281                                                                                 if(G4UniformRand()*(A-2)>(N-1)) // He3
     1299          if(G4UniformRand()*(A-2)>(N-1)) // He3
    12821300          {
    12831301            nPDG=90002001;
     
    12931311            restPDG-=1002;
    12941312          }
     1313          // Recalculate dmom
     1314          G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) +
     1315                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+
     1316                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1317          dmom=sumv.mag();
    12951318        }
    12961319        else
     
    13011324          nZ=2;
    13021325          restPDG-=2002;
     1326          G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) +
     1327                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+
     1328                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+
     1329                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1330          dmom=sumv.mag();
    13031331        }
    13041332        rA=A-nA;
     
    13171345        n4M=G4LorentzVector(0.,0.,0.,nM);         // 4mom of the quasi-nucleon
    13181346#ifdef qedebug
    1319                       G4cout<<"G4QCollis::PStDoIt:QEC,p="<<dmom<<",T="<<tM<<",R="<<rM<<",N="<<nM<<G4endl;
     1347        G4cout<<"G4QCollis::PStDoIt:QEC,p="<<dmom<<",T="<<tM<<",R="<<rM<<",N="<<nM<<G4endl;
    13201348#endif
    13211349        if(!G4QHadron(t4M).DecayIn2(r4M, n4M))
     
    13261354        // --- End of the moving cluster implementation ---
    13271355#ifdef qedebug
    1328                       G4cout<<"G4QCol::PStDoIt:QEC,RN="<<r4M.rho()<<r4M<<",QCl="<<n4M.rho()<<n4M<<G4endl;
     1356        G4cout<<"G4QCol::PStDoIt:QEC,RN="<<r4M.rho()<<r4M<<",QCl="<<n4M.rho()<<n4M<<G4endl;
    13291357#endif
    13301358      }
    13311359      G4LorentzVector s4M=n4M+proj4M;             // Tot 4-momentum for scattering
    1332       G4double prjM2 = proj4M.m2();
     1360      G4double prjM2 = proj4M.m2();               // Squared mass of the projectile
    13331361      G4double prjM = std::sqrt(prjM2);           // @@ Get from pPDG (?)
    13341362      G4double minM = prjM+qM;                    // Min mass sum for the final products
     
    13371365      {
    13381366#ifdef qedebug
    1339                       G4cout<<"G4QCol::PStDoIt:***Enter***,cmM2="<<cmM2<<" > minM2="<<minM*minM<<G4endl;
     1367        G4cout<<"G4QCol::PStDoIt:***Enter***,cmM2="<<cmM2<<" > minM2="<<minM*minM<<G4endl;
    13401368#endif
    13411369        // Estimate and randomize charge-exchange with quasi-free cluster
    13421370        G4bool chex=false;                        // Flag of the charge exchange scattering
    13431371        G4ParticleDefinition* projpt=G4Proton::Proton(); // Prototype, only for chex=true
     1372        // This is reserved for the charge-exchange scattering (to help neutron spectras)
    13441373        //if(cln&&!cp1 &&(projPDG==2212&&rA>rZ || projPDG==2112&&rZ>1))// @@ Use proj chex
    1345                if(2>3)
     1374        if(2>3)
    13461375        {
    13471376#ifdef qedebug
    1348                         G4cout<<"G4QCol::PStDoIt:-Enter,P="<<projPDG<<",cln="<<cln<<",cp1="<<cp1<<G4endl;
     1377          G4cout<<"G4QCol::PStDoIt:-Enter,P="<<projPDG<<",cln="<<cln<<",cp1="<<cp1<<G4endl;
    13491378#endif
    13501379          G4double tprM=mProt;
     
    13651394          G4double chl=qfMan->ChExElCoef(efP*MeV, nZ, nA-nZ, projPDG); // ChEx/Elast(pPDG!)
    13661395#ifdef qedebug
    1367                         G4cout<<"G4QCol::PStDoIt:chl="<<chl<<",P="<<efP<<",nZ="<<nZ<<",nA="<<nA<<G4endl;
     1396          G4cout<<"G4QCol::PStDoIt:chl="<<chl<<",P="<<efP<<",nZ="<<nZ<<",nA="<<nA<<G4endl;
    13681397#endif
    13691398          if(chl>0.&&cmM2>minM*minM&&G4UniformRand()<chl/(1.+chl))     // minM is redefined
     
    13811410                                                                         projPDG, proj4M);
    13821411#ifdef qedebug
    1383                       G4cout<<"G4QCollis::PStDoIt:QElS,proj="<<prjM<<sctout.second<<",qfCl="<<qM
     1412        G4cout<<"G4QCollis::PStDoIt:QElS,proj="<<prjM<<sctout.second<<",qfCl="<<qM
    13841413              <<sctout.first<<",chex="<<chex<<",nA="<<nA<<",nZ="<<nZ<<G4endl;
    13851414#endif
     
    14311460      else G4cout<<"G4QCol::PSD: OUT, M2="<<s4M.m2()<<"<"<<minM*minM<<", N="<<nPDG<<G4endl;
    14321461#endif
    1433     }
     1462     } // end of proton quasi-elastic (including QE on NF)
     1463     else // @@ make cost-condition @@ Pickup process (pickup 1 or 2 n and make d or t)
     1464     {
     1465       restPDG--;                // Res. nucleus PDG is one neutron less than targ. PDG
     1466       G4double mPUF=mDeut;      // Prototype of the mass of the created pickup fragment
     1467       G4ParticleDefinition* theDefinition = G4Deuteron::Deuteron();
     1468       //theDefinition = G4ParticleTable::GetParticleTable()->FindIon(nZ,nA,0,nZ);//ion
     1469       G4bool din=false;         // Flag of picking up 2 neutrons to create t (tritium)
     1470       //G4bool hin=false;         // Flag of picking up 1 n + 1 p to create He3 (NOT IMPL)
     1471       G4bool tin=false;         // Flag of picking up 2 n + 1 p to create alpha (He4)
     1472       G4double frn=G4UniformRand();
     1473       if(N>2 && frn > 0.95)      // .95 is a parameter to pickup 2n (cteate t or +1p=alph)
     1474       {
     1475         theDefinition = G4Triton::Triton();
     1476         restPDG--;              // Res. nucleus PDG is two neutrons less than target PDG
     1477         rA--;                   // Reduce the baryon number of the residual nucleus
     1478         mPUF=mTrit;             // The mass of the created pickup fragment (triton)
     1479         // Recalculate dmom
     1480         G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) +
     1481                       fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1482         dmom=sumv.mag();
     1483         din=true;
     1484         if(Z>1 && frn > 0.99)  // 0.99 is a parameter to pickup 2n + 1p and create alpha
     1485         {
     1486           theDefinition = G4Alpha::Alpha();
     1487           restPDG-=1000;        // Res. nucleus PDG is (2 n + 1 p) less than target PDG
     1488           rA--;                 // Reduce the baryon number of the residual nucleus
     1489           rZ--;                 // Reduce the charge of the residual nucleus
     1490           mPUF=mAlph;           // The mass of the created pickup fragment (triton)
     1491           // Recalculate dmom
     1492           sumv += fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1493           dmom=sumv.mag();
     1494           tin=true;
     1495         }
     1496       }
     1497       G4double mPUF2=mPUF*mPUF;
     1498       G4LorentzVector t4M(0.,0.,0.,tM);         // 4m of the target nucleus to be decayed
     1499       G4double rM=G4QPDGCode(restPDG).GetMass();// Mass of the residual nucleus
     1500       G4double rM2=rM*rM;                       // Squared mass of the residual nucleus
     1501       G4double nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom);// M2 of boundQF-nucleon(2N)
     1502       if(nM2 < 0) nM2=0.;
     1503       G4double nM=std::sqrt(nM2);               // M of bQF-nucleon
     1504       G4double den2=(dmom*dmom+nM2);            // squared energy of bQF-nucleon
     1505       G4double den=std::sqrt(den2);             // energy of bQF-nucleon
     1506#ifdef qedebug
     1507       G4cout<<"G4QCollis::PStDoIt:PiU,p="<<dmom<<",tM="<<tM<<",R="<<rM<<",N="<<nM<<G4endl;
     1508#endif
     1509       G4double qp=momentum*dmom;
     1510       G4double srm=proj4M.e()*den;
     1511       G4double cost=(nM2+mProt2+srm+srm-mPUF2)/(qp+qp);
     1512       G4int ict=0;
     1513       while(std::fabs(cost)>1. && ict<3)
     1514       {
     1515         dmom=91.;  // Fermi momentum (proto default for a deuteron)
     1516         if(Z>1||N>1) dmom=fmm*std::pow(-std::log(G4UniformRand()),third);
     1517         if(din)          // Recalculate dmom for the final triton
     1518         {
     1519          G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) +
     1520                        fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1521          if(tin) sumv+=fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection();
     1522          dmom=sumv.mag();
     1523         }
     1524         nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom); // M2 of bQF-nucleon
     1525         if(nM2 < 0) nM2=0.;
     1526         nM=std::sqrt(nM2);                      // M of bQF-nucleon
     1527         den2=(dmom*dmom+nM2);                   // squared energy of bQF-nucleon
     1528         den=std::sqrt(den2);                    // energy of bQF-nucleon
     1529         qp=momentum*dmom;
     1530         srm=proj4M.e()*den;
     1531         cost=(nM2+mProt2+srm+srm-mPUF2)/(qp+qp);
     1532         ict++;
     1533#ifdef ldebug
     1534         if(ict>2)G4cout<<"G4QCollis::PStDoIt:i="<<ict<<",d="<<dmom<<",ct="<<cost<<G4endl;
     1535#endif
     1536       }
     1537       if(std::fabs(cost)<=1.)
     1538       {// ---- @@ From here can be a MF for QF nucleon extraction (if used by others)
     1539        G4ThreeVector vdir = proj4M.vect();  // 3-Vector in the projectile direction
     1540        G4ThreeVector vx(0.,0.,1.);          // ProtoOrt in theDirection of the projectile
     1541        G4ThreeVector vy(0.,1.,0.);          // First ProtoOrt orthogonal to the direction
     1542        G4ThreeVector vz(1.,0.,0.);          // SecondProtoOrt orthoganal to the direction
     1543        if(vdir.mag2() > 0.)                 // the projectile isn't at rest
     1544        {
     1545          vx = vdir.unit();                  // Ort in the direction of the projectile
     1546          G4ThreeVector vv= vx.orthogonal(); // Not normed orthogonal vector (!)
     1547          vy = vv.unit();                    // First ort orthogonal to the proj direction
     1548          vz = vx.cross(vy);                 // Second ort orthoganal to the projDirection
     1549        }
     1550        // ---- @@ End of possible MF (Similar is in G4QEnvironment)
     1551        G4double tdom=dmom*std::sqrt(1-cost*cost);// Transversal component of the Fermi-Mom
     1552        G4double phi=twopi*G4UniformRand();  // Phi of the Fermi-Mom
     1553        G4ThreeVector vedm=vx*dmom*cost+vy*tdom*std::sin(phi)+vz*tdom*std::cos(phi);// bQFN
     1554        G4LorentzVector bqf(vedm,den);      // 4-mom of the bQF nucleon
     1555        r4M=t4M-bqf;                         // 4mom of the residual nucleus
     1556        if(std::fabs(r4M.m()-rM)>.001) G4cout<<"G4QCol::PSD:rM="<<rM<<"#"<<r4M.m()<<G4endl;
     1557        G4LorentzVector f4M=proj4M+bqf;      // Prototype of 4-mom of Deuteron
     1558        if(std::fabs(f4M.m()-mPUF)>.001)
     1559                              G4cout<<"G4QCol::PSD:mDeut="<<mPUF<<" # "<<f4M.m()<<G4endl;
     1560        aParticleChange.ProposeEnergy(0.);   // @@ ??
     1561        aParticleChange.ProposeTrackStatus(fStopAndKill);// projectile nucleon is killed
     1562        aParticleChange.SetNumberOfSecondaries(2);
     1563        // Fill pickup hadron
     1564        G4DynamicParticle* theQFN = new G4DynamicParticle(theDefinition,f4M);
     1565        G4Track* scatQFN = new G4Track(theQFN, localtime, position ); //    pickup
     1566        scatQFN->SetWeight(weight);                                   //    weighted
     1567        scatQFN->SetTouchableHandle(trTouchable);                     //    nuclear
     1568        aParticleChange.AddSecondary(scatQFN);                        //    cluster
     1569        // ----------------------------------------------------
     1570        // Fill residual nucleus
     1571        if     (restPDG==90000001) theDefinition = G4Neutron::Neutron();
     1572        else if(restPDG==90001000) theDefinition = G4Proton::Proton();
     1573        else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(rZ,rA,0,rZ);//ion
     1574        G4DynamicParticle* theReN = new G4DynamicParticle(theDefinition,r4M);
     1575        G4Track* scatReN = new G4Track(theReN, localtime, position ); //    scattered
     1576        scatReN->SetWeight(weight);                                   //    weighted
     1577        scatReN->SetTouchableHandle(trTouchable);                     //    residual
     1578        aParticleChange.AddSecondary(scatReN);                        //    nucleus
     1579        return G4VDiscreteProcess::PostStepDoIt(track, step);
     1580         }
     1581     }
     1582    } // end of decoupled processes for the proton projectile
    14341583  }  // end lepto-nuclear, neutrino-nuclear, proton quasi-elastic
    1435 
    14361584  EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM);    // Total 4-mom of the reaction
    14371585  if(absMom) EnMomConservation+=lead4M;         // Add E/M of leading System
     
    14441592  //G4double eWei=1.;
    14451593  // @@@@@@@@@@@@@@ Temporary for the testing purposes --- End 
    1446 #ifdef debug
    1447   G4cout<<"G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
    1448 #endif
    1449   G4QHadron* pH = new G4QHadron(projPDG,proj4M);                // ---> DELETED -->--  -+
     1594#ifdef ldebug
     1595  G4cout<<"^^G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
     1596#endif
     1597  G4QHadron* pH = new G4QHadron(projPDG,proj4M);                // ---> DELETED -->----+*
    14501598  //if(momentum<1000.) // Condition for using G4QEnvironment (not G4QuasmonString)      |
    14511599  { //                                                                                  |
     
    14651613    catch (G4QException& error)//                                                   |   .
    14661614    {                                                             //                |   .
    1467              //#ifdef pdebug
     1615      //#ifdef pdebug
    14681616      G4cerr<<"***G4QCollision::PostStepDoIt: G4QE Exception is catched"<<G4endl;// |   .
    1469              //#endif
     1617      //#endif
    14701618      G4Exception("G4QCollision::PostStepDoIt:","27",FatalException,"CHIPSCrash");//|   .
    14711619    }                                                             //                |   .
     
    14831631  //  try                                                           //                 |
    14841632  //  {                                                             //                 |
    1485   //              delete output;                                  //                   |
     1633  //    delete output;                                  //                   |
    14861634  //    output = pan->Fragment();// DESTROYED in the end of the LOOP work space        |
    14871635  //    // @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin                 |
    14881636  //    //tNH=pan->GetNOfHadrons();     // For the test purposes of the String         |
    14891637  //    //if(tNH==2)                    // At least 2 hadrons are in the Constr.Output |
    1490   //    //{//                                                                          |
     1638  // //{//                                                                          |
    14911639  //    //  elF=true;                   // Just put a flag for the ellastic Scattering |
    14921640  //    //  delete output;              // Delete a prototype of dummy G4QHadronVector |
     
    15031651  //    //#ifdef pdebug
    15041652  //    G4cerr<<"***G4QCollision::PostStepDoIt: GEN Exception is catched"<<G4endl; //  |
    1505         //    //#endif
     1653  //    //#endif
    15061654  //    G4Exception("G4QCollision::PostStDoIt:","27",FatalException,"QString Excep");//|
    15071655  //  }                                                             //                 |
     
    15241672    delete leadhs;
    15251673  }
    1526 
    1527 
    15281674  // ------------- From here the secondaries are filled -------------------------
    15291675  G4int tNH = output->size();       // A#of hadrons in the output
     
    15651711    {
    15661712#ifdef debug
    1567              G4cout<<"G4QCollision::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
     1713      G4cout<<"G4QCollision::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
    15681714#endif
    15691715      delete hadr;
     
    15781724    {
    15791725      if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong();   // K_L
    1580                                                 else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
     1726      else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
    15811727    }
    15821728    else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
     
    15851731    else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
    15861732    else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
    1587            else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
     1733    else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
    15881734    {
    15891735      G4int aZ = hadr->GetCharge();
    15901736      G4int aA = hadr->GetBaryonNumber();
    15911737#ifdef pdebug
    1592                                                 G4cout<<"G4QCollision::PostStepDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
     1738      G4cout<<"G4QCollision::PostStepDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
    15931739#endif
    15941740      theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
     
    15981744    {
    15991745#ifdef pdebug
    1600                                                 G4cout<<"G4QCollision::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
     1746      G4cout<<"G4QCollision::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
    16011747#endif
    16021748      theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
    16031749#ifdef pdebug
    1604                                                 G4cout<<"G4QCollision::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
     1750      G4cout<<"G4QCollision::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
    16051751#endif
    16061752    }
     
    16431789  delete output; // instances of the G4QHadrons from the output are already deleted above +
    16441790#ifdef debug
    1645                 G4cout<<"G4QCollision::PostStDoIt: after St="<<aParticleChange.GetTrackStatus()<<G4endl;
     1791  G4cout<<"G4QCollision::PostStDoIt: after St="<<aParticleChange.GetTrackStatus()<<G4endl;
    16461792#endif
    16471793  if(aProjPDG!=11 && aProjPDG!=13 && aProjPDG!=15)
     
    16491795  //return &aParticleChange;                               // This is not enough (ClearILL)
    16501796#ifdef pdebug
    1651                   G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()
     1797    G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()
    16521798          <<", d="<<*aParticleChange.GetMomentumDirection()<<G4endl;
    16531799#endif
    1654 #ifdef debug
    1655                 G4cout<<"G4QCollision::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG<<", St="
     1800#ifdef ldebug
     1801  G4cout<<"G4QCollision::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG<<", St="
    16561802        <<aParticleChange.GetTrackStatus()<<G4endl;
    16571803#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QDiffraction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QDiffraction.cc,v 1.5 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QDiffraction.cc,v 1.6 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QDiffraction class -----------------
     
    3131// G4QDiffraction class of the CHIPS Simulation Branch in GEANT4
    3232// ---------------------------------------------------------------
    33 // ****************************************************************************************
    34 // ********** This CLASS is temporary moved from the "chips/interface" directory *********
    35 // ****************************************************************************************
     33// Short description: This is a process, which describes the diffraction
     34// excitation of the projectile and the nucleus. On nuclei in addition there
     35// can be a coherent diffraction process for the projectile, but it is
     36// comparably small. The most important part of the diffraction is the
     37// progectile diffraction excitation, as in this interaction proton can lose
     38// only a small part of its energy and make the shower longer. This is because
     39// only 1-2 (n) pions are produce in the diffraction escitation, and the mean
     40// kept energy of the nucleon is (1-n/7)=80%. For kaons the kept energy is much
     41// smaller (1-n/3.5)=60%, and for pions it is less important (about 40%).
     42// ----------------------------------------------------------------------------
    3643
    3744//#define debug
     
    144151                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    145152          G4double abund=abuVector[j];
    146                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     153          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    147154#ifdef debug
    148155          G4cout<<"G4QDiffract::GetMeanFreePath:pair#"<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    149156#endif
    150157          newAbund->push_back(pr);
    151                                                   }
     158        }
    152159#ifdef debug
    153160        G4cout<<"G4QDiffract::GetMeanFreePath:pairVectorLength="<<newAbund->size()<<G4endl;
     
    176183      G4cout<<"G4QDiff::GMFP:true,P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
    177184#endif
    178                     G4bool ccsf=true;
     185      G4bool ccsf=true;
    179186      if(Q==-27.) ccsf=false;
    180187#ifdef debug
     
    250257  static G4bool CWinit = true;                       // CHIPS Warld needs to be initted
    251258  if(CWinit)
    252                 {
     259  {
    253260    CWinit=false;
    254261    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    323330#ifdef debug
    324331  G4int prPDG=particle->GetPDGEncoding();
    325                 G4cout<<"G4QDiffraction::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     332  G4cout<<"G4QDiffraction::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    326333#endif
    327334  if(!projPDG)
     
    339346    fPDG=2212;
    340347  }
    341                 // Element treatment
     348  // Element treatment
    342349  G4int EPIM=ElProbInMat.size();
    343350#ifdef debug
    344                 G4cout<<"G4QDiffra::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     351  G4cout<<"G4QDiffra::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    345352#endif
    346353  G4int i=0;
     
    349356    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    350357    for(i=0; i<nE; ++i)
    351                   {
    352 #ifdef debug
    353                                   G4cout<<"G4QDiffra::PostStepDoIt: EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
     358    {
     359#ifdef debug
     360      G4cout<<"G4QDiffra::PostStepDoIt: EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
    354361#endif
    355362      if (rnd<ElProbInMat[i]) break;
     
    360367  Z=static_cast<G4int>(pElement->GetZ());
    361368#ifdef debug
    362                                 G4cout<<"G4QDiffraction::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     369    G4cout<<"G4QDiffraction::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    363370#endif
    364371  if(Z<=0)
     
    371378  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    372379#ifdef debug
    373                 G4cout<<"G4QDiffraction::PostStepDoIt: nI="<<nofIsot<<", T="<<(*SPI)[nofIsot-1]<<G4endl;
     380  G4cout<<"G4QDiffraction::PostStepDoIt: nI="<<nofIsot<<", T="<<(*SPI)[nofIsot-1]<<G4endl;
    374381#endif
    375382  G4int j=0;
     
    380387    {
    381388#ifdef debug
    382                                   G4cout<<"G4QDiffraction::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<",r="<<rndI<<G4endl;
     389      G4cout<<"G4QDiffraction::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<",r="<<rndI<<G4endl;
    383390#endif
    384391      if(rndI < (*SPI)[j]) break;
     
    388395  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    389396#ifdef debug
    390                 G4cout<<"G4QDiffraction::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
     397  G4cout<<"G4QDiffraction::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
    391398#endif
    392399  if(N<0)
     
    470477  G4QHadronVector* out=diffRatio->TargFragment(projPDG, proj4M, Z, N);
    471478  G4int nSec=out->size();             // #of secondaries in the diffraction reaction
    472                 G4DynamicParticle* theSec=0;        // A prototype for secondary for the secondary
     479  G4DynamicParticle* theSec=0;        // A prototype for secondary for the secondary
    473480  G4LorentzVector dif4M(0.,0.,0.,0.); // Prototype for the secondary 4-momentum
    474481  G4int difPDG=0;                     // PDG code of the secondary
    475482  G4QHadron* difQH=0;                 // Prototype for a Q-secondary
    476483#ifdef pdebug
    477                 G4cout<<"G4QDiffraction::PostStepDoIt: =====found===== nSecondaries="<<nSec<<G4endl;
     484  G4cout<<"G4QDiffraction::PostStepDoIt: =====found===== nSecondaries="<<nSec<<G4endl;
    478485#endif
    479486  for(G4int i=0; i<nSec; i++)
     
    522529      theDefinition = G4ParticleTable::GetParticleTable()->FindIon(Z,B,0,0);
    523530#ifdef pdebug
    524                     G4cout<<"G4QDiffraction::PoStDoIt:Ion,Z="<<Z<<",A="<<B<<",D="<<theDefinition<<G4endl;
     531      G4cout<<"G4QDiffraction::PoStDoIt:Ion,Z="<<Z<<",A="<<B<<",D="<<theDefinition<<G4endl;
    525532#endif
    526533    }
    527534    if(theDefinition)
    528535    {
    529                 theSec = new G4DynamicParticle;       // A secondary for the recoil hadron
     536      theSec = new G4DynamicParticle;       // A secondary for the recoil hadron
    530537      theSec->SetDefinition(theDefinition);
    531538      dif4M  = difQH->Get4Momentum();
     
    537544      aParticleChange.AddSecondary( aNewTrack );
    538545#ifdef pdebug
    539                     G4cout<<"G4QDiffraction::PostStepDoIt: Filled 4M="<<dif4M<<", PDG="<<difPDG<<G4endl;
     546      G4cout<<"G4QDiffraction::PostStepDoIt: Filled 4M="<<dif4M<<", PDG="<<difPDG<<G4endl;
    540547#endif
    541548    }
     
    568575  G4double s=diffRatio->GetTargSingDiffXS(p, PDG, Z, N);     // XS for target diffraction
    569576#ifdef debug
    570                 G4cout<<"G4QDiff::CXS:p="<<p<<",Z="<<Z<<",N="<<N<<",C="<<PDG<<",XS="<<s<<G4endl;
     577  G4cout<<"G4QDiff::CXS:p="<<p<<",Z="<<Z<<",N="<<N<<",C="<<PDG<<",XS="<<s<<G4endl;
    571578#endif
    572579  return s;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QDiffractionRatio.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QDiffractionRatio.cc,v 1.9 2008/03/21 21:40:08 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QDiffractionRatio.cc,v 1.10 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // G4 Physics class: G4QDiffractionRatio for N+A elastic cross sections
     31// G4 Physics class: G4QDiffractionRatio for N+A Diffraction Interactions
    3232// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-06
    3434//
    35 //================================================================================
     35//=======================================================================
     36// Short description: Difraction excitation is a part of the incoherent
     37// (inelastic) interaction. This part is calculated in the class.
     38// --------------------------------------------------------------------
    3639
    3740//#define debug
     
    114117  G4bool found=false;
    115118  G4int i=-1;
    116                 if(nDB) for (i=0; i<nDB; i++) if(A==vA[i]) // Sirch for this A in AMDB
     119  if(nDB) for (i=0; i<nDB; i++) if(A==vA[i]) // Sirch for this A in AMDB
    117120  {
    118121    found=true;                         // The A value is found
     
    120123  }
    121124  if(!nDB || !found)                    // Create new line in the AMDB
    122         {
     125  {
    123126    lastA = A;
    124127    lastT = new G4double[mps];          // Create the linear Table
     
    152155      {
    153156        lastL[j]=CalcDiff2Prod_Ratio(sv,A);
    154                if(j!=lastK) sv*=edl;
     157        if(j!=lastK) sv*=edl;
    155158      }
    156159    }
     
    171174  }
    172175  else                                  // The A value was found in AMDB
    173         {
     176  {
    174177    lastA=vA[i];
    175178    lastH=vH[i];
     
    199202      } // End of LinTab update
    200203      if(lastN>=nextN)
    201                                                 {
     204      {
    202205        vH[i]=lastH;
    203206        vN[i]=lastN;
     
    205208      G4int nextK=lastK+1;
    206209      if(s>sma && lastK<nls)             // LogTab must be updated
    207                                                 {
     210      {
    208211        G4double sv=std::exp(lastM+lsi); // Define starting poit (lastM will be changed)
    209212        G4double ls=std::log(s);
     
    217220        for(G4int j=nextK; j<=lastK; j++)// Calculate LogTab values
    218221        {
    219                  sv*=edl;
     222          sv*=edl;
    220223          lastL[j]=CalcDiff2Prod_Ratio(sv,A);
    221224        }
    222225      } // End of LogTab update
    223226      if(lastK>=nextK)
    224                                                 {
     227      {
    225228        vM[i]=lastM;
    226229        vK[i]=lastK;
     
    230233  // Now one can use tabeles to calculate the value
    231234  if(s<sma)                             // Use linear table
    232                 {
     235  {
    233236    G4int n=static_cast<int>(s/ds);     // Low edge number of the bin
    234237    G4double d=s-n*ds;                  // Linear shift
     
    236239    lastR=v+d*(lastT[n+1]-v)/ds;        // Result
    237240  }
    238                 else                                  // Use log table
    239                 {
     241  else                                  // Use log table
     242  {
    240243    G4double ls=std::log(s)-lsi;        // ln(s)-l_min
    241244    G4int n=static_cast<int>(ls/dl);    // Low edge number of the bin
     
    263266  if(s<=0. || A<=1) return 0.;
    264267  if(A!=mA && A!=1)
    265                 {
     268  {
    266269    mA=A;
    267270    G4double a=mA;
     
    281284    G4double q=std::pow(a,0.7);
    282285    p4=(.036/q+.0009*q)/(1.+6./a3+1.e-7*a3);
    283                                 p5=1.3*std::pow(a,0.1168)/(1.+1.2e-8*a3);
     286    p5=1.3*std::pow(a,0.1168)/(1.+1.2e-8*a3);
    284287    p6=.00046*(a+11830./a2);
    285288    p7=1./(1.+6.17/a2+.00406*a);
     
    297300  G4double s2=s*s;
    298301  G4double s4=s2*s2;
    299                 G4double dl=std::log(s)-p5;
     302  G4double dl=std::log(s)-p5;
    300303  R=1./(1.+1./(p1+p2/s4+p4*dl*dl/(1.+p6*std::pow(s,p7))));
    301         return R;
     304  return R;
    302305} // End of CalcQF2IN_Ratio
    303306
     
    350353  G4double mT=mNeut;                       // Prototype of mass of QF nucleon
    351354  G4double mT2=mNeut2;                     // Squared mass of a free nucleon to be excited
    352   G4double dmT=dmNeut;                     // Doubled mass                                                                                                             
     355  G4double dmT=dmNeut;                     // Doubled mass             
    353356  G4int Z=0;                               // Prototype of the isotope Z
    354357  G4int N=1;                               // Prototype of the Isotope N
     
    357360    mT=mProt;                              // Prototype of mass of QF nucleon to be excited
    358361    mT2=mProt2;                            // Squared mass of the free nucleon
    359     dmT=dmProt;                            // Doubled mass                                                                                                             
    360     Z=1;                                                                                    // Z of the isotope
    361     N=0;                                                                                    // N of the Isotope
     362    dmT=dmProt;                            // Doubled mass             
     363    Z=1;                                   // Z of the isotope
     364    N=0;                                   // N of the Isotope
    362365  }
    363366  G4double mP2=pr4M.m2();                  // Squared mass of the projectile
     
    396399  G4double ds=s-mP2-mDif2;               
    397400  G4double e=ds/dmP;
    398                 G4double P=std::sqrt(e*e-mDif2);      // Momentum in pseudo laboratory system
     401  G4double P=std::sqrt(e*e-mDif2);      // Momentum in pseudo laboratory system
    399402  G4VQCrossSection* CSmanager=G4QElasticCrossSection::GetPointer();
    400403#ifdef debug
     
    442445    else if(cost<-1.) cost=-1.;
    443446    else
    444                                 {
     447    {
    445448      G4cerr<<"G4QDiffRat::TargFragm: *NAN* cost="<<cost<<",t="<<t<<",tmax="<<maxt<<G4endl;
    446449      return ResHV;                     // Do Nothing Action
     
    457460  }
    458461#ifdef debug
    459                 G4cout<<"G4QDifRat::TargFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
     462  G4cout<<"G4QDifRat::TargFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
    460463#endif
    461464  // Now everything is ready for fragmentation and DoNothing projHadron must be wiped out
     
    465468  ResHV->push_back(hadron);             // Fill the recoil nucleon
    466469#ifdef debug
    467                 G4cout<<"G4QDiffractionRatio::TargFragm: *Filled* LeadingNuc="<<r4M<<pPDG<<G4endl;
    468 #endif
    469   G4QHadronVector* leadhs=new G4QHadronVector;// Quasmon Output G4QHadronVectorum --->---+
     470  G4cout<<"G4QDiffractionRatio::TargFragm: *Filled* LeadingNuc="<<r4M<<pPDG<<G4endl;
     471#endif
     472  G4QHadronVector* leadhs=new G4QHadronVector;// Quasmon Output G4QHadronVectorum --->---*
    470473  G4QContent dQC=G4QPDGCode(rPDG).GetQuarkContent(); // QuarkContent of quasiFreeNucleon |
    471   G4Quasmon* quasm = new G4Quasmon(dQC,d4M); // Quasmon=DiffractionExcitationQuasmon-+   |
     474  G4Quasmon* quasm = new G4Quasmon(dQC,d4M); // Quasmon=DiffractionExcitationQuasmon-*   |
    472475#ifdef debug
    473                 G4cout<<"G4QDiffRatio::TgFrag:tPDG="<<tPDG<<",rPDG="<<rPDG<<",d4M="<<d4M<<G4endl;//|   |
    474 #endif
    475   G4QEnvironment* pan= new G4QEnvironment(G4QNucleus(tPDG));// --> DELETED --->---+  |   |
     476  G4cout<<"G4QDiffRatio::TgFrag:tPDG="<<tPDG<<",rPDG="<<rPDG<<",d4M="<<d4M<<G4endl;//|   |
     477#endif
     478  G4QEnvironment* pan= new G4QEnvironment(G4QNucleus(tPDG));// --> DELETED --->---*  |   |
    476479  pan->AddQuasmon(quasm);                    // Add diffractiveQuasmon to Environ.|  |   |
    477480#ifdef debug
     
    479482#endif
    480483  try                                                           //                |  |   |
    481         {                                                             //                |  |   |
    482            delete leadhs;                                              //                |  |   |
     484  {                                                             //                |  |   |
     485    delete leadhs;                                              //                |  |   |
    483486    leadhs = pan->Fragment();// DESTROYED in the end of the LOOP work space       |  |   |
    484487  }                                                             //                |  |   |
    485488  catch (G4QException& error)//                                                   |  |   |
    486         {                                                             //                |  |   |
    487            //#ifdef pdebug
     489  {                                                             //                |  |   |
     490    //#ifdef pdebug
    488491    G4cerr<<"***G4QCollision::PostStepDoIt: G4QE Exception is catched"<<G4endl;// |  |   |
    489            //#endif
     492    //#endif
    490493    G4Exception("G4QCollision::PostStepDoIt:","27",FatalException,"CHIPSCrash");//|  |   |
    491494  }                                                             //                |  |   |
    492   delete pan;                              // Delete the Nuclear Environment <-<--+--+   |
     495  delete pan;                              // Delete the Nuclear Environment <-<--*--*   |
    493496  G4int qNH=leadhs->size();                // A#of collected hadrons from diff.frag.     |
    494497  if(qNH) for(G4int iq=0; iq<qNH; iq++)    // Loop over hadrons to fill the result       |
     
    498501  }                                        //                                            |
    499502  delete leadhs; // <----<----<----<----<----<----<----<----<----<----<----<----<----<---*
    500                 return ResHV; // Result
     503  return ResHV; // Result
    501504} // End of TargFragment
    502505
     
    588591  G4double ds=s-mT2-mDif2;
    589592  G4double e=ds/dmT;
    590                 G4double P=std::sqrt(e*e-mDif2);          // Momentum in pseudo laboratory system
     593  G4double P=std::sqrt(e*e-mDif2);          // Momentum in pseudo laboratory system
    591594  G4VQCrossSection* CSmanager=G4QElasticCrossSection::GetPointer();
    592595#ifdef debug
     
    632635    else if(cost<-1.) cost=-1.;
    633636    else
    634                                 {
     637    {
    635638      G4cerr<<"G4QDiffRat::ProjFragm: *NAN* cost="<<cost<<",t="<<t<<",tmax="<<maxt<<G4endl;
    636639      return ResHV; // Do Nothing Action
     
    647650  }
    648651#ifdef debug
    649                 G4cout<<"G4QDiffR::ProjFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
     652  G4cout<<"G4QDiffR::ProjFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
    650653#endif
    651654  // Now everything is ready for fragmentation and DoNothing projHadron must be wiped out
     
    655658  ResHV->push_back(hadron);          // Fill the recoil nucleus
    656659#ifdef debug
    657                 G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleus="<<t4M<<tPDG<<G4endl;
     660  G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleus="<<t4M<<tPDG<<G4endl;
    658661#endif
    659662  hadron = new G4QHadron(rPDG,r4M);  // Hadron for the recoil nucleon
    660663  ResHV->push_back(hadron);          // Fill the recoil nucleon
    661664#ifdef debug
    662                 G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleon="<<r4M<<rPDG<<G4endl;
     665  G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleon="<<r4M<<rPDG<<G4endl;
    663666#endif
    664667  G4LorentzVector sum4M(0.,0.,0.,0.);
     
    668671  G4Quasmon* pan= new G4Quasmon(dQC,d4M); // --->---->---->----->-----> DELETED -->---*
    669672  try                                                           //                    |
    670         {                                                             //                    |
     673  {                                                             //                    |
    671674    G4QNucleus vac(90000000);                                   //                    |
    672675    leadhs=pan->Fragment(vac,1);  // DELETED after it is copied to ResHV vector -->---+-*
    673676  }                                                             //                    | |
    674677  catch (G4QException& error)                                   //                    | |
    675         {                                                             //                    | |
     678  {                                                             //                    | |
    676679    G4cerr<<"***G4QDiffractionRatio::ProjFragment: G4Quasmon Exception"<<G4endl;    //| |
    677680    G4Exception("G4QDiffractionRatio::ProjFragment","72",FatalException,"*Quasmon");//| |
     
    789792        }
    790793        else                                          //(2) n*N+m*(Pi-)   (nL=0)        |
    791                {
     794        {
    792795          sPDG = -211;
    793796          qPN  = -nC;
     
    839842          nB  = nC;
    840843          fMass= mProt;
    841                }
     844        }
    842845        else if(nL  && nC<nB-nL) //(3)n*L+m*P+k*N ***Should not be here***              |
    843846        {
     
    10051008#ifdef fdebug
    10061009            sum4M+=r4M;                      // Sum 4-momenta for the EnMom check       |
    1007                         G4cout<<"G4QDR::ProjFrag: *additional Nucleon*="<<f4Mom<<fPDG<<G4endl; //   |
     1010            G4cout<<"G4QDR::ProjFrag: *additional Nucleon*="<<f4Mom<<fPDG<<G4endl; //   |
    10081011#endif
    10091012          }
     
    10261029#ifdef fdebug
    10271030            sum4M+=r4M;                      // Sum 4-momenta for the EnMom check       |
    1028                         G4cout<<"G4QDR::ProjFragm: *additional Pion*="<<f4Mom<<fPDG<<G4endl; //     |
     1031            G4cout<<"G4QDR::ProjFragm: *additional Pion*="<<f4Mom<<fPDG<<G4endl; //     |
    10291032#endif
    10301033          }
     
    10471050#ifdef fdebug
    10481051            sum4M+=r4M;                    // Sum 4-momenta for the EnMom check         |
    1049                         G4cout<<"G4QDR::ProjFragm: *additional Hyperon*="<<f4Mom<<fPDG<<G4endl; //  |
     1052            G4cout<<"G4QDR::ProjFragm: *additional Hyperon*="<<f4Mom<<fPDG<<G4endl; //  |
    10501053#endif
    10511054          }
    10521055        }
    10531056      }                                    // --> End of decay                          |
    1054                                 }                                      // -> End of Iso-nuclear treatment           |
     1057    }                                      // -> End of Iso-nuclear treatment           |
    10551058    else if( (nL > 0 && nB > 1) || (nL < 0 && nB < -1) )
    10561059    {     // Hypernucleus is found                                                      |
     
    10671070      G4int nSP=0;                         // A#0f unavoidable Sigma+                   |
    10681071      if(nC<0)                             // Negative hypernucleus                     |
    1069              {
     1072      {
    10701073        if(-nC<=nL)                        // Partial compensation by Sigma-            |
    1071                       {
     1074        {
    10721075          nSM=-nC;                         // Can be compensated by Sigma-              |
    10731076          nL+=nC;                          // Reduce the residual strangeness           |
    10741077        }
    10751078        else                               // All Charge is compensated by Sigma-       |
    1076                       {
     1079        {
    10771080          nSM=nL;                          // The maximum number of Sigma-              |
    10781081          nL=0;                            // Kill the residual strangeness             |
     
    10801083      }
    10811084      else if(nC>nB-nL)                    // Extra positive hypernucleus               |
    1082              {
     1085      {
    10831086        if(nC<=nB)                         // Partial compensation by Sigma+            |
    1084                       {
     1087        {
    10851088          G4int dH=nB-nC;                  // Isotopic shift                            |
    10861089          nSP=nL-dH;                       // Can be compensated by Sigma+              |
     
    10881091        }
    10891092        else                               // All Charge is compensated by Sigma+       |
    1090                       {
     1093        {
    10911094          nSP=nL;                          // The maximum number of Sigma+              |
    10921095          nL=0;                            // Kill the residual strangeness             |
     
    11051108#endif
    11061109      if(nSP||nSM)                         // Sigma+/- improvement                      |
    1107              {
     1110      {
    11081111        if(nL)                             // By mistake Lambda improvement is found    |
    11091112        {
     
    11151118        }
    11161119        if(nSP)                            // Sibma+ should be decayed                  |
    1117                       {
     1120        {
    11181121          nL=nSP;                          // #of decaying hyperons                     |
    11191122          sPDG=3222;                       // PDG code of decaying hyperons             |
     
    11211124        }
    11221125        else                               // Sibma+ should be decayed                  |
    1123                       {
     1126        {
    11241127          nL=nSM;                          // #of decaying hyperons                     |
    11251128          sPDG=3112;                       // PDG code of decaying hyperons             |
     
    11331136      G4double rlM=G4QNucleus(rlPDG).GetMZNS();// Mass of the NonstrangeNucleus         |
    11341137      if(!nSP&&!nSM&&nL==1&&reM>rlM+mSigZ&&G4UniformRand()>.5) // Conv Lambda->Sigma0   |
    1135              {
     1138      {
    11361139        sPDG=3212;                         // PDG code of a decaying hyperon            |
    11371140        MLa=mSigZ;                         // Mass of the decaying hyperon              |
     
    11421145      // @@ In future take into account Iso-Hypernucleus (Add PI+,R & Pi-,R decays)     |
    11431146      if(rlPDG==90000000)                  // Multy Hyperon (HyperNuc of only hyperons) |
    1144              {
     1147      {
    11451148        if(nL>1) r4M=r4M/nL;               // split the 4-mom for the MultyLambda       |
    11461149        for(G4int il=0; il<nL; il++)       // loop over Lambdas                         |
     
    11511154#ifdef fdebug
    11521155          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1153                       G4cout<<"G4QDR::ProjFrag: *additional Lambda*="<<r4M<<sPDG<<G4endl; //        |
    1154 #endif
    1155         }
    1156       }
    1157              else if(reM>rlM+MLa-eps)              // Lambda (or Sigma) can be split           |
    1158              {
     1156          G4cout<<"G4QDR::ProjFrag: *additional Lambda*="<<r4M<<sPDG<<G4endl; //        |
     1157#endif
     1158        }
     1159      }
     1160      else if(reM>rlM+MLa-eps)              // Lambda (or Sigma) can be split           |
     1161      {
    11591162        G4LorentzVector n4M(0.,0.,0.,rlM);  // 4-mom of the residual nucleus            |
    11601163        G4LorentzVector h4M(0.,0.,0.,MLa);  // 4-mom of the Hyperon                     |
    11611164        G4double sum=rlM+MLa;               // Safety sum                               |
    1162         if(std::fabs(reM-sum)<eps)               // At rest in CMS                           |
    1163                {
     1165        if(std::fabs(reM-sum)<eps)          // At rest in CMS                           |
     1166        {
    11641167          n4M=r4M*(rlM/sum);                // Split tot 4-mom for resNuc               |
    11651168          h4M=r4M*(MLa/sum);                // Split tot 4-mom for Hyperon              |
     
    11781181        loh->SetQPDG(G4QPDGCode(rlPDG));   // ConvertedHypernucleus to nonstrange(@anti)|
    11791182        if(rlPDG==90000002)                // Additional action with loH changed to 2n  |
    1180                {
     1183        {
    11811184          G4LorentzVector newLV=n4M/2.;    // Split 4-momentum                          |
    11821185          loh->Set4Momentum(newLV);        // Reupdate the hadron                       |
     
    11871190#ifdef fdebug
    11881191          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1189                       G4cout<<"G4QDR::ProgFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; //       |
     1192          G4cout<<"G4QDR::ProgFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; //       |
    11901193#endif
    11911194        }
    11921195        else if(rlPDG==90002000)           // Additional action with loH change to 2p   |
    1193                {
     1196        {
    11941197          G4LorentzVector newLV=n4M/2.;    // Split 4-momentum                          |
    11951198          loh->Set4Momentum(newLV);        // Reupdate the hadron                       |
     
    12001203#ifdef fdebug
    12011204          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1202                       G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; //        |
     1205          G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; //        |
    12031206#endif
    12041207        }
     
    12151218#ifdef fdebug
    12161219          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1217                       G4cout<<"G4QDR::ProjFrag: *additional Hyperon*="<<r4M<<sPDG<<G4endl; //       |
    1218 #endif
    1219         }
    1220       }
    1221              else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)// Lambda->N only if Sigmas are absent       |
    1222              {
     1220          G4cout<<"G4QDR::ProjFrag: *additional Hyperon*="<<r4M<<sPDG<<G4endl; //       |
     1221#endif
     1222        }
     1223      }
     1224      else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)// Lambda->N only if Sigmas are absent       |
     1225      {
    12231226        G4int nPi=static_cast<G4int>((reM-rnM)/mPi0); // Calc. pion multiplicity        |
    12241227        if (nPi>nL) nPi=nL;                // Cut the pion multiplicity                 |
     
    12271230        G4LorentzVector h4M(0.,0.,0.,npiM);// 4-momentum of pions                       |
    12281231        G4double sum=rnM+npiM;             // Safety sum                                |
    1229         if(std::fabs(reM-sum)<eps)              // At rest                                   |
    1230                {
     1232        if(std::fabs(reM-sum)<eps)         // At rest                                   |
     1233        {
    12311234          n4M=r4M*(rnM/sum);               // The residual nucleus part                 |
    12321235          h4M=r4M*(npiM/sum);              // The pion part                             |
     
    12511254#ifdef fdebug
    12521255          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1253                       G4cout<<"G4QDR::ProjFrag: *additional Pion*="<<r4M<<sPDG<<G4endl; //          |
     1256          G4cout<<"G4QDR::ProjFrag: *additional Pion*="<<r4M<<sPDG<<G4endl; //          |
    12541257#endif
    12551258        }
    12561259        if(rnPDG==90000002)                // Additional action with loH change to 2n   |
    1257                {
     1260        {
    12581261          G4LorentzVector newLV=n4M/2.;    // Split 4-momentum                          |
    12591262          loh->Set4Momentum(newLV);        // Reupdate the hadron                       |
     
    12641267#ifdef fdebug
    12651268          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1266                       G4cout<<"G4QDR::ProjFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; //       |
     1269          G4cout<<"G4QDR::ProjFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; //       |
    12671270#endif
    12681271        }
    12691272        else if(rnPDG==90002000)           // Additional action with loH change to 2p   |
    1270                {
     1273        {
    12711274          G4LorentzVector newLV=n4M/2.;    // Split 4-momentum                          |
    12721275          loh->Set4Momentum(newLV);        // Reupdate the hadron                       |
     
    12771280#ifdef fdebug
    12781281          sum4M+=r4M;                      // Sum 4-momenta for the EnMom check         |
    1279                       G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; //        |
     1282          G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; //        |
    12801283#endif
    12811284        }
     
    12831286      }
    12841287      else // If this Excepton shows up (lowProbable appearance) => include gamma decay |
    1285              {
     1288      {
    12861289        G4double d=rlM+MLa-reM;            // Hyperon Excessive energy                  |
    1287                       G4cerr<<"G4QDR::PF:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl;
     1290        G4cerr<<"G4QDR::PF:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl;
    12881291        d=rnM+mPi0-reM;                    // Pion Excessive energy                     |
    1289                       G4cerr<<"G4QDR::PF:"<<oPDG<<","<<hPDG<<",M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl;
     1292        G4cerr<<"G4QDR::PF:"<<oPDG<<","<<hPDG<<",M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl;
    12901293        throw G4QException("G4QDiffractionRatio::ProjFragment: Hypernuclear conver");// |
    12911294      }
    1292                   }                                      // => End of G4 Hypernuclear decay           |
     1295    }                                      // => End of G4 Hypernuclear decay           |
    12931296    ResHV->push_back(loh);                 // Fill in the result                        |
    12941297#ifdef debug
    12951298    sum4M+=loh->Get4Momentum();            // Sum 4-momenta for the EnMom check         |
    1296                 G4cout<<"G4QDR::PrFra:#"<<iq<<","<<loh->Get4Momentum()<<loh->GetPDGCode()<<G4endl;//|
     1299    G4cout<<"G4QDR::PrFra:#"<<iq<<","<<loh->Get4Momentum()<<loh->GetPDGCode()<<G4endl;//|
    12971300#endif
    12981301  }                                        //                                           |
    12991302  delete leadhs; // <----<----<----<----<----<----<----<----<----<----<----<----<----<--*
    13001303#ifdef debug
    1301                 G4cout<<"G4QDiffractionRatio::ProjFragment: *End* Sum="<<sum4M<<" =?= d4M="<<d4M<<G4endl;
    1302 #endif
    1303                 return ResHV; // Result
     1304  G4cout<<"G4QDiffractionRatio::ProjFragment: *End* Sum="<<sum4M<<" =?= d4M="<<d4M<<G4endl;
     1305#endif
     1306  return ResHV; // Result
    13041307} // End of ProjFragment
    13051308
     
    13121315         <<pPDG<<G4endl;
    13131316  G4double A=Z+N;                        // A of the target
    1314                 //return 4.5*std::pow(A,.364)*millibarn; // Result
     1317  //return 4.5*std::pow(A,.364)*millibarn; // Result
    13151318  return 3.7*std::pow(A,.364)*millibarn; // Result after mpi0 correction
    13161319
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QDiscProcessMixer.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QDiscProcessMixer.cc,v 1.4 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QDiscProcessMixer.cc,v 1.8 2009/04/22 12:26:13 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    29 //      ---------------- G4QDiscProcessMixer class -----------------
     29//      ---------------- G4QDiscProcessMixer class -------------------
    3030//                 by Mikhail Kossov, Aug 2007.
    3131// G4QDiscProcessMixer class of the CHIPS Simulation Branch in GEANT4
    32 // ---------------------------------------------------------------
    33 // ****************************************************************************************
    34 // ********** This CLASS is temporary moved from the "chips/interface" directory *********
    35 // ****************************************************************************************
     32// ------------------------------------------------------------------------
     33// Short description: universal mixer of processes (NOT models as in GHAD!)
     34// depending on the application energy region (defined by users).
     35// ------------------------------------------------------------------------
    3636
    3737//#define debug
     
    5454G4QDiscProcessMixer::~G4QDiscProcessMixer()
    5555{
    56   for_each(theDPVector.begin(), theDPVector.end(), DeleteDiscreteProcess());
     56  // Now the responsibility of deleting is deligated to the user, who created them
     57  //for_each(theDPVector.begin(), theDPVector.end(), DeleteDiscreteProcess());
    5758}
    5859
    5960void G4QDiscProcessMixer::AddDiscreteProcess(G4VDiscreteProcess* DP, G4double ME)
    6061{
    61   if(ME>theDPVector[theDPVector.size()-1]->second)
     62  static const G4double maxEn = 1.E8*megaelectronvolt; // Conditional INF
     63  if(!theDPVector.size()) // The first process in the DiscreteProcessVector (MaxE=INF)
    6264  {
    6365    std::pair<G4VDiscreteProcess*, G4double>* QDiscProc =
    64       new std::pair<G4VDiscreteProcess*, G4double>(DP, ME);
     66      new std::pair<G4VDiscreteProcess*, G4double>(DP, maxEn);
    6567    theDPVector.push_back( QDiscProc );
    6668  }
    67   else // Wrong Max Energy Order for the new process in the sequence of processes
     69  else
    6870  {
    69     G4cerr<<"G4QDiscProcessMixer::AddDiscreteProcess:LastMaxE("<<theDPVector.size()-1<<")="
    70           <<theDPVector[theDPVector.size()-1]->second<<" >= MaxE="<<ME<<G4endl;
    71     G4Exception("G4QDiscProcessMixer::AddDiscreteProcess: Wrong Max Energy Order");
     71    if(ME<theDPVector[theDPVector.size()-1]->second)
     72    {
     73      std::pair<G4VDiscreteProcess*, G4double>* QDiscProc =
     74        new std::pair<G4VDiscreteProcess*, G4double>(DP, ME);
     75      theDPVector.push_back( QDiscProc );
     76    }
     77    else // Wrong Max Energy Order for the new process in the sequence of processes
     78    {
     79      G4cerr<<"G4QDiscProcessMixer::AddDiscreteProcess:LastMaxE("<<theDPVector.size()-1
     80            <<")="<<theDPVector[theDPVector.size()-1]->second<<" <= MaxE="<<ME<<G4endl;
     81      G4Exception("G4QDiscProcessMixer::AddDiscreteProcess: Wrong Max Energy Order");
     82    }
    7283  }
    7384}
     
    8091
    8192G4double G4QDiscProcessMixer::PostStepGetPhysicalInteractionLength(const G4Track& Track,
    82                                                                                  G4double   PrevStSize,
    83                                                                                  G4ForceCondition* F)
     93                                                                   G4double  PrevStSize,
     94                                                                   G4ForceCondition* F)
    8495{
    8596  G4double kEn=Track.GetDynamicParticle()->GetKineticEnergy(); // Projectile kinetic energy
    8697  G4int maxDP=theDPVector.size();
    87   if(maxDP) for(G4int i=0; i<maxDP; ++i) if(kEn < theDPVector[i]->second)
     98  if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second)
    8899    return theDPVector[i]->first->PostStepGetPhysicalInteractionLength(Track,PrevStSize,F);
     100  return DBL_MAX;
     101}
     102
     103// A fake class for compilation only
     104G4double G4QDiscProcessMixer::GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*)
     105{
    89106  return DBL_MAX;
    90107}
     
    95112  G4double kEn=Track.GetDynamicParticle()->GetKineticEnergy(); // Projectile kinetic energy
    96113  G4int maxDP=theDPVector.size();
    97   if(maxDP) for(G4int i=0; i<maxDP; ++i) if(kEn < theDPVector[i]->second)
     114  if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second)
    98115  {
    99116    //EnMomConservation= theDPVector[i]->first->GetEnegryMomentumConservation();
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QElastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QElastic.cc,v 1.27 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QElastic.cc,v 1.28 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QElastic class -----------------
    3030//                 by Mikhail Kossov, December 2003.
    3131// G4QElastic class of the CHIPS Simulation Branch in GEANT4
    32 // ---------------------------------------------------------------
    33 // ****************************************************************************************
    34 // ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    35 // ****************************************************************************************
     32// --------------------------------------------------------------------
     33// Short description: At present this is a process for nucleon-nucleus
     34// elastic scattering. Mesons and hyperons exist only for the Hydrogen
     35// target (see G4QuasiFreeRatios).
     36// --------------------------------------------------------------------
    3637
    3738//#define debug
     
    145146                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    146147          G4double abund=abuVector[j];
    147                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     148          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    148149#ifdef debug
    149150          G4cout<<"G4QElastic::GetMeanFreePath:pair#="<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    150151#endif
    151152          newAbund->push_back(pr);
    152                                                   }
     153        }
    153154#ifdef debug
    154155        G4cout<<"G4QElastic::GetMeanFreePath: pairVectorLength="<<newAbund->size()<<G4endl;
     
    177178      G4cout<<"G4QEl::GMFP:*true*,P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
    178179#endif
    179                     G4bool ccsf=true;
     180      G4bool ccsf=true;
    180181      if(Q==-27.) ccsf=false;
    181182#ifdef debug
     
    244245G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step& step)
    245246{
    246   //static const G4double mProt=G4Proton::Proton()->GetPDGMass()*GeV; // proton mass (in GeV)
    247   //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001;   // CHIPS in GeV
    248   //static const G4double mP2=mProt*mProt;                            // squared proton mass
     247  //static const G4double mProt=G4Proton::Proton()->GetPDGMass()*GeV;// proton mass in GeV
     248  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001;    // CHIPS m_p in GeV
     249  //static const G4double mP2=mProt*mProt;                           // squared proton mass
    249250  //
    250251  //-------------------------------------------------------------------------------------
    251252  static G4bool CWinit = true;                       // CHIPS Warld needs to be initted
    252253  if(CWinit)
    253                 {
     254  {
    254255    CWinit=false;
    255256    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    326327#ifdef debug
    327328  G4int prPDG=particle->GetPDGEncoding();
    328                 G4cout<<"G4QElastic::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     329  G4cout<<"G4QElastic::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    329330#endif
    330331  if(!projPDG)
     
    335336  G4int EPIM=ElProbInMat.size();
    336337#ifdef debug
    337                 G4cout<<"G4QElastic::PostStDoIt:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     338  G4cout<<"G4QElastic::PostStDoIt:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    338339#endif
    339340  G4int i=0;
     
    342343    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    343344    for(i=0; i<nE; ++i)
    344                   {
    345 #ifdef debug
    346                                   G4cout<<"G4QElastic::PostStepDoIt:EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
     345    {
     346#ifdef debug
     347      G4cout<<"G4QElastic::PostStepDoIt:EPM["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
    347348#endif
    348349      if (rnd<ElProbInMat[i]) break;
     
    353354  Z=static_cast<G4int>(pElement->GetZ());
    354355#ifdef debug
    355                                 G4cout<<"G4QElastic::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     356    G4cout<<"G4QElastic::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    356357#endif
    357358  if(Z<=0)
     
    364365  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    365366#ifdef debug
    366                 G4cout<<"G4QElastic::PosStDoIt: nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
     367  G4cout<<"G4QElastic::PosStDoIt: nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
    367368#endif
    368369  G4int j=0;
     
    373374    {
    374375#ifdef debug
    375                                   G4cout<<"G4QElastic::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
     376      G4cout<<"G4QElastic::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
    376377#endif
    377378      if(rndI < (*SPI)[j]) break;
     
    381382  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    382383#ifdef debug
    383                 G4cout<<"G4QElastic::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
     384  G4cout<<"G4QElastic::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
    384385#endif
    385386  if(N<0)
     
    507508  EnMomConservation-=scat4M;                        // It must be initialized by (pE+tM,pP)
    508509  // This is how in general the secondary should be identified
    509                 G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
     510  G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
    510511  //G4int targPDG=2212;                      // PDG for the recoil proton @@only for p targ
    511512  //G4ParticleDefinition* theDefinition=G4Proton::Proton(); // @@ only for p target
    512513  G4int aA = Z+N;
    513514#ifdef pdebug
    514                 G4cout<<"G4QElastic::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
     515  G4cout<<"G4QElastic::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
    515516#endif
    516517  G4ParticleDefinition* theDefinition=G4ParticleTable::GetParticleTable()
     
    570571  {
    571572    if(oxs) res=CSmanager->GetHMaxT();   // Calculate the max_t value
    572                                 else res=CSmanager->GetExchangeT(Z, N, pPDG); // functionally randomized -t in MeV^2
     573    else res=CSmanager->GetExchangeT(Z, N, pPDG); // functionally randomized -t in MeV^2
    573574  }
    574575  else G4cout<<"*Warning*G4QElastic::CalculateXSt:*NotInitiatedScattering"<<G4endl;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QElasticCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QElasticCrossSection.cc,v 1.36 2008/03/21 21:42:44 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QElasticCrossSection.cc,v 1.37 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3434//
    3535//================================================================================
     36// Short description: Interaction cross-sections for the G4QElastic process
     37// -------------------------------------------------------------------------------
    3638
    3739//#define debug
     
    5052G4double  G4QElasticCrossSection::lPMax= 8.;  // Max tabulated logarithmic Momentum     (D)
    5153G4double  G4QElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// Log step in the table     (D)
    52 G4bool    G4QElasticCrossSection::onlyCS=true;// Flag to calculate only CS (not Si/Bi)          (L)
    53 G4double  G4QElasticCrossSection::lastSIG=0.; // Last calculated cross section                                                            (L)
     54G4bool    G4QElasticCrossSection::onlyCS=true;// Flag to calculate only CS (not Si/Bi)  (L)
     55G4double  G4QElasticCrossSection::lastSIG=0.; // Last calculated cross section          (L)
    5456G4double  G4QElasticCrossSection::lastLP=-10.;// Last log(mom_of_the_incident_hadron)   (L)
    5557G4double  G4QElasticCrossSection::lastTM=0.;  // Last t_maximum                         (L)
     
    6365G4double  G4QElasticCrossSection::theS4=0.;   // The Last mantissa of 4-th difruction   (L)
    6466G4double  G4QElasticCrossSection::theB4=0.;   // The Last slope of 4-th difruction      (L)
    65 G4int     G4QElasticCrossSection::lastTZ=0;   // Last atomic number of the target                               
     67G4int     G4QElasticCrossSection::lastTZ=0;   // Last atomic number of the target   
    6668G4int     G4QElasticCrossSection::lastTN=0;   // Last number of neutrons of the target
    6769G4double  G4QElasticCrossSection::lastPIN=0.; // Last initialized max momentum
    68 G4double* G4QElasticCrossSection::lastCST=0;  // Elastic cross-section table                                                                                                                   
    69 G4double* G4QElasticCrossSection::lastPAR=0;  // Parameters for functional calculation                                 
    70 G4double* G4QElasticCrossSection::lastSST=0;  // E-dep of sq.slope of the first difruction     
    71 G4double* G4QElasticCrossSection::lastS1T=0;  // E-dep of mantissa of the first difruction     
     70G4double* G4QElasticCrossSection::lastCST=0;  // Elastic cross-section table               
     71G4double* G4QElasticCrossSection::lastPAR=0;  // Parameters for functional calculation     
     72G4double* G4QElasticCrossSection::lastSST=0;  // E-dep of sq.slope of the first difruction 
     73G4double* G4QElasticCrossSection::lastS1T=0;  // E-dep of mantissa of the first difruction 
    7274G4double* G4QElasticCrossSection::lastB1T=0;  // E-dep of the slope of the first difruction
    7375G4double* G4QElasticCrossSection::lastS2T=0;  // E-dep of mantissa of the second difruction
    7476G4double* G4QElasticCrossSection::lastB2T=0;  // E-dep of the slope of theSecond difruction
    75 G4double* G4QElasticCrossSection::lastS3T=0;  // E-dep of mantissa of the third difruction     
     77G4double* G4QElasticCrossSection::lastS3T=0;  // E-dep of mantissa of the third difruction 
    7678G4double* G4QElasticCrossSection::lastB3T=0;  // E-dep of the slope of the third difruction
    77 G4double* G4QElasticCrossSection::lastS4T=0;  // E-dep of mantissa of the 4-th difruction       
     79G4double* G4QElasticCrossSection::lastS4T=0;  // E-dep of mantissa of the 4-th difruction 
    7880G4double* G4QElasticCrossSection::lastB4T=0;  // E-dep of the slope of the 4-th difruction
    7981G4int     G4QElasticCrossSection::lastPDG=0;  // The last PDG code of the projectile
     
    159161  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
    160162  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    161                 {
     163  {
    162164    tgZ=1;
    163165    tgN=1;
     
    171173        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    172174        <<colN.size()<<G4endl;
    173                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     175  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    174176#endif
    175177  if(!pPDG)
     
    183185  G4bool in=false;                     // By default the isotope must be found in the AMDB
    184186//GF the block will update parameters, needed for quasi-eleastic
    185 //GF  if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
     187//GF if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus isn't the LastUsedIsotope
    186188  {
    187189    in = false;                        // By default the isotope haven't be found in AMDB 
     
    192194    lastI   = colN.size();             // Size of the Associative Memory DB in the heap
    193195    if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
    194            {                                  // The nucleus with projPDG is found in AMDB
     196    {                                  // The nucleus with projPDG is found in AMDB
    195197      if(colPDG[i]==pPDG && colN[i]==tgN && colZ[i]==tgZ)
    196                                                 {
     198      {
    197199        lastI=i;
    198200        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    211213        lastP  =colP [i];                // Last Momentum  (A-dependent)
    212214        lastCS =colCS[i];                // Last CrossSect (A-dependent)
    213         //        if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
     215        //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
    214216        if(lastP == pMom)   // V.Ivanchenko safe solution
    215217        {
     
    244246      //CalculateCrossSection(fCS,-27,i,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    245247#endif
    246            }
    247            if(!in)                            // This nucleus has not been calculated previously
    248            {
     248    }
     249    if(!in)                            // This nucleus has not been calculated previously
     250    {
    249251#ifdef pdebug
    250252      G4cout<<"G4QElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    253255      lastCS=CalculateCrossSection(fCS,0,lastI,lastPDG,lastZ,lastN,pMom);//calculate&create
    254256      if(lastCS<=0.)
    255                                                 {
     257      {
    256258        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    257259#ifdef pdebug
     
    265267          lastTH=pEn;
    266268        }
    267                                                 }
     269      }
    268270#ifdef pdebug
    269271      G4cout<<"G4QElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    281283#endif
    282284      return lastCS*millibarn;
    283            } // End of creation of the new set of parameters
     285    } // End of creation of the new set of parameters
    284286    else
    285                                 {
     287    {
    286288#ifdef pdebug
    287289      G4cout<<"G4QElCS::GetCS: Update lastI="<<lastI<<G4endl;
     
    293295  } // End of parameters udate
    294296
    295 // GF
    296 //        else if(pEn<=lastTH)
    297 //        {
    298 //      #ifdef pdebug
    299 //          G4cout<<"G4QElCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
    300 //          //CalculateCrossSection(fCS,-27,lastI,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    301 //      #endif
    302 //          return 0.;                         // Momentum is below the Threshold Value -> CS=0
    303 //        }
    304 //        //  else if(std::fabs(lastP/pMom-1.)<tolerance)
    305 //        else if(lastP == pMom) // V.Ivanchenko safe solution
    306 //        {
    307 //      #ifdef pdebug
    308 //          G4cout<<"G4QElCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
    309 //          //CalculateCrossSection(fCS,-27,lastI,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    310 //          G4cout<<"G4QElCS::GetCrSec:***SAME***, onlyCS="<<onlyCS<<G4endl;
    311 //      #endif
    312 //          return lastCS*millibarn;     // Use theLastCS
    313 //        }
    314 //        else
    315 //        {
    316 //      #ifdef pdebug
    317 //          G4cout<<"G4QElCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
    318 //      #endif
    319 //          lastCS=CalculateCrossSection(fCS,1,lastI,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
    320 //          lastP=pMom;
    321 //        }
    322 // GF
     297//GF
     298// else if(pEn<=lastTH)
     299// {
     300//#ifdef pdebug
     301//  G4cout<<"G4QElCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
     302//  //CalculateCrossSection(fCS,-27,lastI,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     303//#endif
     304//  return 0.;                         // Momentum is below the Threshold Value -> CS=0
     305// }
     306// //  else if(std::fabs(lastP/pMom-1.)<tolerance)
     307// else if(lastP == pMom) // V.Ivanchenko safe solution
     308// {
     309//#ifdef pdebug
     310//  G4cout<<"G4QElCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
     311//  //CalculateCrossSection(fCS,-27,lastI,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     312//  G4cout<<"G4QElCS::GetCrSec:***SAME***, onlyCS="<<onlyCS<<G4endl;
     313//#endif
     314//  return lastCS*millibarn;     // Use theLastCS
     315// }
     316// else
     317// {
     318//#ifdef pdebug
     319//  G4cout<<"G4QElCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
     320//#endif
     321//  lastCS=CalculateCrossSection(fCS,1,lastI,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
     322//  lastP=pMom;
     323// }
     324//GF
    323325
    324326#ifdef pdebug
     
    339341  // *** End of Static Definitions (Associative Memory Data Base) ***
    340342  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    341                 {
     343  {
    342344    tgZ=1;
    343345    tgN=1;
     
    352354  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
    353355  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
    354                 {
     356  {
    355357    if(F<0)                             // the AMDB must be loded
    356358    {
     
    378380      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
    379381#ifdef pdebug
    380                                                 G4cout<<"G4QElCS::CalcCS:*updated(I)*,LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
     382      G4cout<<"G4QElCS::CalcCS:*updated(I)*,LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
    381383#endif
    382384      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
    383385    }
    384         }
    385         else                                  // This isotope wasn't initialized => CREATE
    386         {
     386  }
     387  else                                  // This isotope wasn't initialized => CREATE
     388  {
    387389    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
    388390    lastPAR[nLast]=0;                   // Initialization for VALGRIND
    389     lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function                           
    390     lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope     
    391     lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
    392     lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope                           
     391    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function   
     392    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
     393    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
     394    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope   
    393395    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
    394     lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope                   
    395     lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
     396    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
     397    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
    396398    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope   
    397     lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
     399    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
    398400    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope   
    399401#ifdef pdebug
     
    406408    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
    407409    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
    408     CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB                           
    409     SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB       
    410     S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB       
     410    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB   
     411    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
     412    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
    411413    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB   
    412     S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB       
     414    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
    413415    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB   
    414     S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB       
     416    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
    415417    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB   
    416     S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
     418    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
    417419    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB   
    418         } // End of creation/update of the new set of parameters and tables
     420  } // End of creation/update of the new set of parameters and tables
    419421  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
    420422#ifdef pdebug
     
    459461      G4cout<<"G4QElasticCrossSection::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
    460462#endif
    461                                 }
     463    }
    462464    else
    463465    {
     
    540542  //                      -0- -1--2- -3-  -4-  -5-  -6-    -7-  -8- -9- -10--11--12--13-
    541543  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    542                 {
     544  {
    543545    tgZ=1;
    544546    tgN=1;
     
    550552    // --- Total np elastic cross section cs & s1/b1 (t), s2/b2 (u) --- NotTuned for highE
    551553    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(5.=par(3));p4=p2*p2; p=|3-mom|
    552                                 //CS=12./(p2s+.05*p+.0001/sqrt(sp))+.35/p+(6.75+.14*dl1*dl1+19./p)/(1.+.6/p4);
     554    //CS=12./(p2s+.05*p+.0001/sqrt(sp))+.35/p+(6.75+.14*dl1*dl1+19./p)/(1.+.6/p4);
    553555    //  par(0)   par(1) par(2)        par(4) par(5) par(6)     par(7)     par(8)
    554556    //s1=(6.75+.14*dl2*dl2+13./p)/(1.+.14/p4)+.6/(p4+.00013), s2=(75.+.001/p4/p)/p3
     
    559561    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
    560562    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
    561                                 //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
     563    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
    562564    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
    563565    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
     
    602604        G4double pa10=5.e-27*a10;
    603605        // Reaction cross-section parameters (pel=peh_fit.f)
    604         lastPAR[0]=.28*a;                                                        // p1
    605         lastPAR[1]=4.8*std::pow(a,1.14)/(1.+3.6/a3);                             // p2(p/n)
    606         lastPAR[2]=3.3/a+.5*ssa/(1.+2.e7/a8);                                    // p3
    607         if(PDG==2112)
     606        lastPAR[0]=a/3.;                                                       // p1(p/n)
     607        //lastPAR[0]=.28*a;                                                      // p1(p/n)
     608        lastPAR[1]=4.5*a*ssa/(1.+6./a3)/(1.+1.e-2*a);                          // p2(p/n)
     609        //lastPAR[1]=4.8*std::pow(a,1.14)/(1.+3.6/a3);                           // p2(p/n)
     610        if(PDG==2112)                           // Neutron projectile
    608611        {
     612          lastPAR[2]=3.3/a+.5*ssa/(1.+2.e7/a8);                                // p3 (old)
    609613          if(a<6.5)
    610                                                                   {
    611             lastPAR[3]=1./(1.+.00123*a4);                                        // p4
    612             lastPAR[4]=1.5e-4/a2/(a+1.2e-6*a12)+1.5e-6;                          // p5
    613             lastPAR[5]=.0062/(a+5.e-11*a16);                                     // p6
    614             lastPAR[6]=3.2e-14/a6/(1.+4.e-10*a17);                               // p7
    615             lastPAR[7]=.847/a4/(a+.0005*a8)+.00045;                              // p8
    616             lastPAR[8]=.413/a16+7.e-7;                                           // p10
    617                                                                   }
     614          {
     615            lastPAR[3]=1./(1.+.00123*a4);                                      // p4
     616            lastPAR[4]=1.5e-4/a2/(a+1.2e-6*a12)+1.5e-6;                        // p5
     617            lastPAR[5]=.0062/(a+5.e-11*a16);                                   // p6
     618            lastPAR[6]=3.2e-14/a6/(1.+4.e-10*a17);                             // p7
     619            lastPAR[7]=.847/a4/(a+.0005*a8)+.00045;                            // p8
     620            lastPAR[8]=.413/a16+7.e-7;                                         // p9
     621          }
    618622          else
    619623          {
    620             lastPAR[1]/=1.+4.e-3*a;      // @@ reduction for n, can be for p too // p2(n)
    621             lastPAR[3]=a*(.5+1.e-10*a4)/(1.+7.e5/a6);                            // p4
    622             lastPAR[4]=a*3.e-5/(1.+2.e12/a12);                                   // p5
    623             lastPAR[5]=(.0006+1.e-14*a5)/(1.+4.e5/a3)/(1.+3.e23/a16/a8);         // p6
    624             lastPAR[6]=1.e-22*a4/(1.+5.e16*(1.+5e31/a32)/a16);                   // p7
    625             lastPAR[7]=(8.+.00016*a2)/(1.+1.4e14/a16);                           // p8
    626             lastPAR[8]=.0013;                                                    // p10
     624            lastPAR[3]=a*(.5+1.e-10*a4)/(1.+7.e5/a6);                          // p4
     625            lastPAR[4]=a*3.e-5/(1.+2.e12/a12);                                 // p5
     626            lastPAR[5]=(.0006+1.e-14*a5)/(1.+4.e5/a3)/(1.+3.e23/a16/a8);       // p6
     627            lastPAR[6]=1.e-22*a4/(1.+5.e16*(1.+5e31/a32)/a16);                 // p7
     628            lastPAR[7]=(8.+.00016*a2)/(1.+1.4e14/a16);                         // p8
     629            lastPAR[8]=.0013;                                                  // p9
    627630          }
    628                                                   }
    629         else
     631        }
     632        else                                   // Proton projectile
    630633        {
    631           lastPAR[2]=3.3/a+.7*ssa/(1.+2.e7/a8);                                  // p3
    632           lastPAR[3]=1./(1.+6.e-9*a12)+.6*a/(1.+1.6e15/a16);                     // p4
    633           lastPAR[4]=6.e-4/(a4+3.e-6*a12)+.16/(a+9.e5/a3+r1a16*r1a16);           // p5
    634           lastPAR[5]=3.e-4/a2+(1.5e-3+3.e-14*a7)/(1.+r2a16*r2a16+3.e-12*a6);     // p6
    635           lastPAR[6]=4.e-30+(1.2e-28*a3+pa10*pa10)/(1.+r3a16*r3a16+4.e-26*a14);  // p7
    636           lastPAR[7]=.07/(1.+1.7e-8*a16)+.5/(1.+1.7e18/a16+4.5e-7*a4);           // p8
    637           lastPAR[8]=(1.5e-10+2.e-18*a8)/(1.+3.e-25*a16);                        // p10
     634          lastPAR[2]=3.3/a+.8*ssa/(1.+2.e7/a8);                                // p3
     635          //lastPAR[2]=3.3/a+.7*ssa/(1.+2.e7/a8);                                // p3(old)
     636          lastPAR[3]=1./(1.+6.e-9*a12)+.6*a/(1.+1.6e15/a16);                   // p4
     637          lastPAR[4]=6.e-4/(a4+3.e-6*a12)+.16/(a+9.e5/a3+r1a16*r1a16);         // p5
     638          lastPAR[5]=3.e-4/a2+(1.5e-3+3.e-14*a7)/(1.+r2a16*r2a16+3.e-12*a6);   // p6
     639          lastPAR[6]=4.e-30+(1.2e-28*a3+pa10*pa10)/(1.+r3a16*r3a16+4.e-26*a14);// p7
     640          lastPAR[7]=.1/(1.+1.7e-8*a16)+1./(1.+1.7e18/a16+2.e-6*a4);         // p8
     641          //lastPAR[7]=.07/(1.+1.7e-8*a16)+.5/(1.+1.7e18/a16+4.5e-7*a4);         // p8(old)
     642          lastPAR[8]=(1.5e-10+2.e-18*a8)/(1.+3.e-25*a16);                      // p9
    638643        }
    639644        // @@ the differential cross-section is parameterized separately for A>6 & A<7
    640645        if(a<6.5)
    641                                                                 {
    642           // a11
    643           // a13
     646        {
    644647          G4double a28=a16*a12;
    645           // a31
    646           // a40
    647648          // The main pre-exponent      (pel_sg)
    648649          lastPAR[ 9]=4000*a;                                // p1
     
    664665          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
    665666          // The 1st max pre-exponent   (pel_qq)
    666           lastPAR[24]=8.e4/(a8+2.5e12/a16);                  // p1
    667           lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2
    668           lastPAR[26]=.0011*a3;                              // p3
     667          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
     668          //lastPAR[24]=8.e4/(a8+2.5e12/a16);                  // p1 (old)
     669          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2
     670          lastPAR[26]=.0006*a3;                              // p3
     671          //lastPAR[26]=.0011*a3;                              // p3 (old)
    669672          // The 1st max slope          (pel_qs)
    670673          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
     
    682685          lastPAR[37]=64./a3;                                // p4
    683686          // The gloria pre-exponent    (pel_us)
    684           lastPAR[38]=1.05e8*std::exp(.32*asa);              // p1
    685           lastPAR[39]=19.5*std::exp(.45*asa);                // p2
     687          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
     688          //lastPAR[38]=1.05e8*std::exp(.32*asa);              // p1 (old)
     689          lastPAR[39]=20.*std::exp(.45*asa);                // p2
     690          //lastPAR[39]=19.5*std::exp(.45*asa);                // p2 (old)
    686691          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
    687692          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
     
    696701        }
    697702        else
    698                                                                 {
     703        {
    699704          G4double p1a10=2.2e-28*a10;
    700705          G4double r4a16=6.e14/a16;
     
    779784#ifdef pdebug
    780785      G4cout<<"G4QElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="<<theS1
    781                                                                                                 <<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
     786            <<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
    782787            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
    783788#endif
    784789    }
    785790    if(LP>ILP)
    786                                 {
     791    {
    787792      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
    788793      if(ini<0) ini=0;
     
    795800          G4double lp=0.;
    796801          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
    797                                                                                 {
     802          {
    798803            lp=lPMin+ip*dlnP;                     // ln(momentum)
    799804            G4bool memCS=onlyCS;
     
    848853  static const G4double sevth=1./7.;
    849854  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    850                 {
     855  {
    851856    tgZ=1;
    852857    tgN=1;
     
    855860  }
    856861#ifdef tdebug
    857   G4cout<<"G4QElasticCS::GetExchangeT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
    858 #endif
    859   if(onlyCS) G4cout<<"*Warning*G4QElasticCrossSection::GetExchangeQ2: onlyCS=true"<<G4endl;
     862  G4cout<<"G4QElasticCS::GetExcT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
     863#endif
     864  if(onlyCS) G4cout<<"**Warning*G4QElasticCrossSection::GetExchangeT: onlyCS=true"<<G4endl;
    860865  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
    861866  G4double q2=0.;
     
    867872#endif
    868873    G4double E1=lastTM*theB1;
    869                 G4double R1=(1.-std::exp(-E1));
     874    G4double R1=(1.-std::exp(-E1));
    870875#ifdef tdebug
    871876    G4double ts1=-std::log(1.-R1)/theB1;
     
    876881#endif
    877882    G4double E2=lastTM*theB2;
    878                 G4double R2=(1.-std::exp(-E2));
     883    G4double R2=(1.-std::exp(-E2));
    879884#ifdef tdebug
    880885    G4double ts2=-std::log(1.-R2)/theB2;
     
    885890#endif
    886891    //G4double E3=lastTM*theB3;
    887                 //G4double R3=(1.-std::exp(-E3));
     892    //G4double R3=(1.-std::exp(-E3));
    888893#ifdef tdebug
    889894    //G4double ts3=-std::log(1.-R3)/theB3;
     
    891896    //if(ds3>.01)G4cout<<"*Warn*G4QElCS::GetExT:3n "<<ts3<<"#"<<lastTM<<",d="<<ds3<<G4endl;
    892897#endif
    893                 G4double I1=R1*theS1;
    894                 G4double I2=R2*theS2/theB2;
    895                                 //G4double I3=R3*theS3/theB3;
     898    G4double I1=R1*theS1;
     899    G4double I2=R2*theS2/theB2;
     900    //G4double I3=R3*theS3/theB3;
    896901    G4double I12=I1+I2;
    897902    //G4double rand=(I12+I3)*G4UniformRand();
     
    903908      q2=-std::log(1.-ran)/theB1;       // t-chan
    904909    }
    905                                 else
     910    else
    906911    {
    907912      G4double ran=R2*G4UniformRand();
     
    917922#endif
    918923    G4double E1=lastTM*theB1;
    919                 G4double R1=(1.-std::exp(-E1));
     924    G4double R1=(1.-std::exp(-E1));
    920925#ifdef tdebug
    921926    G4double ts1=-std::log(1.-R1)/theB1;
     
    926931#endif
    927932    G4double E2=lastTM*theB2;
    928                 G4double R2=(1.-std::exp(-E2*E2*E2));
     933    G4double R2=(1.-std::exp(-E2*E2*E2));
    929934#ifdef tdebug
    930935    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
     
    935940#endif
    936941    G4double E3=lastTM*theB3;
    937                 G4double R3=(1.-std::exp(-E3));
     942    G4double R3=(1.-std::exp(-E3));
    938943#ifdef tdebug
    939944    G4double ts3=-std::log(1.-R3)/theB3;
     
    943948            <<",R3="<<R1<<",E3="<<E3<<G4endl;
    944949#endif
    945                 G4double I1=R1*theS1/theB1;
    946                 G4double I2=R2*theS2;
    947                                 G4double I3=R3*theS3;
     950    G4double I1=R1*theS1/theB1;
     951    G4double I2=R2*theS2;
     952    G4double I3=R3*theS3;
    948953    G4double I12=I1+I2;
    949954    G4double rand=(I12+I3)*G4UniformRand();
     
    954959      q2=-std::log(1.-ran)/theB1;
    955960    }
    956                                 else if(rand<I12)
     961    else if(rand<I12)
    957962    {
    958963      G4double ran=R2*G4UniformRand();
     
    978983#endif
    979984    G4double E1=lastTM*(theB1+lastTM*theSS);
    980                 G4double R1=(1.-std::exp(-E1));
     985    G4double R1=(1.-std::exp(-E1));
    981986    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
    982987#ifdef tdebug
     
    991996    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
    992997    if(a>6.5)E2*=tm2;                               // for heavy nuclei
    993                 G4double R2=(1.-std::exp(-E2));
     998    G4double R2=(1.-std::exp(-E2));
    994999#ifdef tdebug
    9951000    G4double ts2=-std::log(1.-R2)/theB2;
     
    10031008    G4double E3=lastTM*theB3;
    10041009    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
    1005                 G4double R3=(1.-std::exp(-E3));
     1010    G4double R3=(1.-std::exp(-E3));
    10061011#ifdef tdebug
    10071012    G4double ts3=-std::log(1.-R3)/theB3;
     
    10131018#endif
    10141019    G4double E4=lastTM*theB4;
    1015                 G4double R4=(1.-std::exp(-E4));
     1020    G4double R4=(1.-std::exp(-E4));
    10161021#ifdef tdebug
    10171022    G4double ts4=-std::log(1.-R4)/theB4;
     
    10211026            <<",R4="<<R4<<",E4="<<E4<<G4endl;
    10221027#endif
    1023                 G4double I1=R1*theS1;
    1024                 G4double I2=R2*theS2;
    1025                                 G4double I3=R3*theS3;
    1026                                 G4double I4=R4*theS4;
     1028    G4double I1=R1*theS1;
     1029    G4double I2=R2*theS2;
     1030    G4double I3=R3*theS3;
     1031    G4double I4=R4*theS4;
    10271032    G4double I12=I1+I2;
    10281033    G4double I13=I12+I3;
     
    10411046#endif
    10421047    }
    1043                                 else if(rand<I12)
     1048    else if(rand<I12)
    10441049    {
    10451050      G4double ran=R2*G4UniformRand();
     
    11241129{
    11251130  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    1126                 {
     1131  {
    11271132    tgZ=1;
    11281133    tgN=1;
     
    11371142  G4int iZ=tgZ-1; // Z index
    11381143  if(iZ<0)
    1139                 {
     1144  {
    11401145    iZ=0;         // conversion of the neutron target to the proton target
    11411146    tgZ=1;
     
    11621167    G4double ssp=std::sqrt(sp);           // sqrt(sqrt(p))=p^.25
    11631168    G4double p2s=p2*sp;
    1164                   G4double dl1=lp-lastPAR[3];
     1169    G4double dl1=lp-lastPAR[3];
    11651170    theSS=lastPAR[21];
    11661171    theS1=(lastPAR[9]+lastPAR[10]*dl1*dl1+lastPAR[11]/p)/(1.+lastPAR[12]/p4)
     
    11851190
    11861191    G4double p2s=p2*sp;
    1187                   G4double dl1=lp-lastPAR[3];
    1188                   G4double dl2=lp-lastPAR[8];
     1192    G4double dl1=lp-lastPAR[3];
     1193    G4double dl2=lp-lastPAR[8];
    11891194    theSS=lastPAR[31];
    11901195    theS1=(lastPAR[9]+lastPAR[10]*dl2*dl2)/(1.+lastPAR[11]/p4/p)+
     
    12141219    G4double p16=p8*p8;
    12151220    //G4double p24=p16*p8;
    1216                   G4double dl=lp-5.;
     1221    G4double dl=lp-5.;
    12171222    G4double a=tgZ+tgN;
    12181223    G4double pah=std::pow(p,a/2);
     
    12261231      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
    12271232      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
    1228                                   theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
    1229                                   theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
    1230                                   theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
    1231                                   theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
     1233      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
     1234      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
     1235      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
     1236      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
    12321237                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
    1233                                   theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
     1238      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
    12341239#ifdef tdebug
    12351240      G4cout<<"G4QElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
     
    12461251      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
    12471252      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
    1248                                   theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
    1249                                   theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
     1253      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
     1254      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
    12501255            lastPAR[33]/(1.+lastPAR[34]/p6);
    1251                                   theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
    1252                                   theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
     1256      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
     1257      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
    12531258            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
    1254                                   theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
     1259      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
    12551260#ifdef tdebug
    12561261      G4cout<<"G4QElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
     
    12761281     return (lastPAR[0]*dl*dl+lastPAR[1])/(1.+lastPAR[2]/p)+lastPAR[3]/(p4+lastPAR[4]/p2)+
    12771282            lastPAR[5]/(p8+lastPAR[6]/p8)+lastPAR[7]/(p2+lastPAR[8]);
    1278                                 //else
     1283    //else
    12791284    //{
    12801285    //  G4int nI=nn[iZ];
     
    12861291#endif
    12871292    //    if(kE<nT[iZ][i]) return 0.;    // 0 below the threshold (in MeV)
    1288                                 //   if(p<2.) return nX[iZ][i];     // At very low momentum(<2MeV/c) -> only LECS
    1289     //                          return lastPAR[3]/(p4+lastPAR[4]/p2)+lastPAR[5]/(p5+rp16*rp16)+
     1293    //   if(p<2.) return nX[iZ][i];     // At very low momentum(<2MeV/c) -> only LECS
     1294    //    return lastPAR[3]/(p4+lastPAR[4]/p2)+lastPAR[5]/(p5+rp16*rp16)+
    12901295    //           lastPAR[7]/(p4+lastPAR[8]/p4)+nX[iZ][i]/(1.+lastPAR[51]*p16);
    12911296    //  }
     
    13151320  //static const G4double mDeut2= mDeut*mDeut;
    13161321  if(tgZ==0 && tgN==1)                 // Temporary change for Quasi-Elastic
    1317                 {
     1322  {
    13181323    tgZ=1;
    13191324    tgN=1;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QElectronNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QElectronNuclearCrossSection.cc,v 1.13 2008/10/24 19:25:41 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QElectronNuclearCrossSection.cc,v 1.15 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
    3434//
    35 //================================================================================
     35//=================================================================================
     36// Short description: reaction cross-sections for electron-nuclear reactions, which
     37// are integrals over virtual equivalent photons photons.
     38// --------------------------------------------------------------------------------
    3639
    3740//#define debug
     
    9093        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9194        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     95  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9396#endif
    9497  if(std::abs(pPDG)!=11)
     
    111114    j  = 0;                            // A#0f records found in DB for this projectile
    112115    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     116    {                                  // The nucleus with projPDG is found in AMDB
    114117      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     118      {
    116119        lastI=i;
    117120        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    130133        lastP  =colP [i];                // Last Momentum  (A-dependent)
    131134        lastCS =colCS[i];                // Last CrossSect (A-dependent)
    132         //       if(std::fabs(lastP/pMom-1.)<tolerance) // VI (do not use tolerance)
     135 //       if(std::fabs(lastP/pMom-1.)<tolerance) // VI (do not use tolerance)
    133136        if(lastP == pMom)
    134137        {
     
    164167#endif
    165168      j++;                             // Increment a#0f records found in DB for this pPDG
    166            }
    167            if(!in)                            // This nucleus has not been calculated previously
    168            {
     169    }
     170    if(!in)                            // This nucleus has not been calculated previously
     171    {
    169172#ifdef pdebug
    170173      G4cout<<"G4QENCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    173176      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    174177      if(lastCS<=0.)
    175                                                 {
     178      {
    176179        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    177180#ifdef pdebug
     
    185188          lastTH=pEn;
    186189        }
    187                                                 }
     190      }
    188191#ifdef pdebug
    189192      G4cout<<"G4QENCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    201204#endif
    202205      return lastCS*millibarn;
    203            } // End of creation of the new set of parameters
     206    } // End of creation of the new set of parameters
    204207    else
    205                                 {
     208    {
    206209#ifdef pdebug
    207210      G4cout<<"G4QENCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    274277  //if(Z) mP= G4QPDGCode(111).GetNuclMass(Z-1,N,0);
    275278  if(Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
    276             mP = G4NucleiProperties::GetNuclearMass(A-1.,Z-1.)/MeV; // ResNucMass for a proton
     279         mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV; // ResNucMass for a proton
    277280  G4double mN= infEn;
    278281  //if(N) mN= G4QPDGCode(111).GetNuclMass(Z,N-1,0);
    279282  if(N&&G4NucleiProperties::IsInStableTable(A-1,Z))
    280             mN = G4NucleiProperties::GetNuclearMass(A-1.,Z-0.)/MeV;  // ResNucMass for a neutron
     283         mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV;    // ResNucMass for a neutron
    281284
    282285  G4double mA= infEn;
    283286  if(N>1&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
    284             mA = G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV; // ResNucMass for an alpha
     287         mA = G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV;// ResNucMass for an alpha
    285288
    286289  G4double dP= mP +mProt - mT;
     
    288291  G4double dA= mA +mAlph - mT;
    289292#ifdef pdebug
    290                 G4cout<<"G4QElectronNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
     293  G4cout<<"G4QElectronNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
    291294        <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
    292295#endif
     
    318321  static std::vector <G4double*> J3;   // Vector of pointers to the J3 tabulated functions
    319322#ifdef pdebug
    320                 G4cout<<"G4QElectronNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
     323  G4cout<<"G4QElectronNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
    321324  if(J3.size()) G4cout<<", p="<<J3[0];
    322325  G4cout<<G4endl;
     
    330333  lastE=TotEnergy-mel;                 // Kinetic energy of the electron
    331334#ifdef pdebug
    332                 G4cout<<"G4QElectronNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ;
     335  G4cout<<"G4QElectronNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ;
    333336  if(J3.size()) G4cout<<", p="<<J3[0];
    334337  G4cout<<", N="<<targN<<", onlyCS="<<CS<<",E="<<lastE<<",th="<<EMi<<G4endl;
     
    338341  {
    339342    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    340                                 {                                // ...........................................========
     343    {                                // ...........................................========
    341344      if (lastE<=EMi)                // Energy is below the minimum energy in the table
    342345      {
     
    345348        lastSig=0.;
    346349#ifdef pdebug
    347                                     G4cout<<"G4QElectronNucCS::CalcCS: Old CS=0 as lastE="<<lastE<<" < "<<EMi<<G4endl;
     350        G4cout<<"G4QElectronNucCS::CalcCS: Old CS=0 as lastE="<<lastE<<" < "<<EMi<<G4endl;
    348351#endif
    349352        return 0.;
     
    354357      lastF  =colF[I];               // Last ZeroPosition in the J-functions
    355358      lastH  =colH[I];               // Last High Energy Coefficient (A-dependent)
    356            }
    357            else                             // This isotope wasn't calculated previously => CREATE
    358            {
     359    }
     360    else                             // This isotope wasn't calculated previously => CREATE
     361    {
    359362      lastJ1 = new G4double[nE];     // Allocate memory for the new J1 function
    360363      lastJ2 = new G4double[nE];     // Allocate memory for the new J2 function
     
    375378      colF.push_back(lastF);
    376379      colH.push_back(lastH);
    377            } // End of creation of the new set of parameters
     380    } // End of creation of the new set of parameters
    378381  } // End of parameters udate
    379382  // ============================== NOW Calculate the Cross Section =====================
     
    384387    lastSig=0.;
    385388#ifdef pdebug
    386                                 G4cout<<"G4QElectronNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
     389    G4cout<<"G4QElectronNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
    387390#endif
    388391    return 0.;
     
    398401#ifdef pdebug
    399402    G4cout<<"-->G4QElectronNuclearCS::CalcCrossSect:LOGfit b="<<blast<<",max="<<mL<<",lJ1="
    400                                                     <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<",lEmin="<<lEMi<<",d="<<dlnE<<G4endl;
     403          <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<",lEmin="<<lEMi<<",d="<<dlnE<<G4endl;
    401404#endif
    402405    if(blast<0)   blast=0;
     
    25872590              <<y[k]<<",J3="<<z[k]<<G4endl;
    25882591#endif
    2589              }
     2592      }
    25902593      r=L[i];                             // Low channel for the J-functions
    25912594    }
     
    26142617      r=L[k];
    26152618      if(L[k1]<r) r=L[k1];
    2616            }
     2619    }
    26172620  }
    26182621  return r;
     
    26482651  if(ris<Y[lastL])                      // Search in the table
    26492652  {
    2650         G4int j=lastF;
     2653 G4int j=lastF;
    26512654    G4double Yj=Y[j];                   // It mast be 0 (some times just very small)
    26522655    while (ris>Yj && j<lastL)           // Associative search
    2653            {
     2656    {
    26542657      j++;
    26552658      Yj=Y[j];                          // High value
    2656            }
     2659    }
    26572660    G4int j1=j-1;
    26582661    G4double Yi=Y[j1];                  // Low value
    26592662    phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
    26602663#ifdef debug
    2661         G4cout<<"G4QElectronNucCS::GetExchEn="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="
     2664 G4cout<<"G4QElectronNucCS::GetExchEn="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="
    26622665       <<Yi<<",Y="<<Yj<<G4endl;
    26632666#endif
     
    26682671    G4double f=(ris-Y[lastL])/lastH;    // ScaledResidualValue of the CrossSection integral
    26692672#ifdef pdebug
    2670            G4cout<<"G4QElNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
     2673    G4cout<<"G4QElNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
    26712674#endif
    26722675    phLE=SolveTheEquation(f);      // Solve equation to find Log(phE) (compare with lastLE)
    26732676#ifdef pdebug
    2674            G4cout<<"G4QElectronNuclearCS::GetExchangeEnergy: HighEnergy lphE="<<phLE<<G4endl;
     2677    G4cout<<"G4QElectronNuclearCS::GetExchangeEnergy: HighEnergy lphE="<<phLE<<G4endl;
    26752678#endif
    26762679  }
     
    27182721#endif
    27192722    if(x>=lastLE)
    2720            {
     2723    {
    27212724      G4cerr<<"*G4QElNCS::SolveTheEq:*Correction*"<<i<<",d="<<d<<",x="<<x<<">lE="<<lastLE
    27222725            <<",f="<<f<<",fx="<<fx<<",df="<<df<<",A(Z="<<lastZ<<",N="<<lastN<<")"<<G4endl;
     
    28062809    return 0.;
    28072810  }
    2808   G4double lK=std::log(K);                     // ln(K)
    2809   G4double x=1.-K/nu;                          // This definitin saves one div.
    2810   G4double GD=1.+Q2/Q02;                       // Reversed nucleonic form-factor
    2811   G4double b=std::exp(bp*(lK-blK0));           // b-factor
    2812   G4double c=std::exp(cp*(lK-clK0));           // c-factor
    2813   G4double r=.5*std::log(Q2+nu*nu)-lK;         // r=.5*log((Q^2+nu^2)/K^2)
    2814   G4double ef=std::exp(r*(b-c*r*r));           // exponential factor
     2811  G4double lK=std::log(K);               // ln(K)
     2812  G4double x=1.-K/nu;                    // This definitin saves one div.
     2813  G4double GD=1.+Q2/Q02;                 // Reversed nucleonic form-factor
     2814  G4double b=std::exp(bp*(lK-blK0));     // b-factor
     2815  G4double c=std::exp(cp*(lK-clK0));     // c-factor
     2816  G4double r=.5*std::log(Q2+nu*nu)-lK;   // r=.5*log((Q^2+nu^2)/K^2)
     2817  G4double ef=std::exp(r*(b-c*r*r));     // exponential factor
    28152818  return (1.-x)*ef/GD/GD;
    28162819}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QGluonString.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QGluonString.cc,v 1.3 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QGluonString.cc,v 1.4 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QGluonString class -----------------
     
    3131// G4QGluonString class of the CHIPS Simulation Branch in GEANT4
    3232// ---------------------------------------------------------------
    33 // ****************************************************************************************
    34 // ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    35 // ****************************************************************************************
     33// Short description: CHIPS object for the Quark-Gluon String
     34// ---------------------------------------------------------------
    3635
    3736//#define debug
     
    206205          G4int N=pElement->GetIsotope(j)->GetN()-Z; // N means A=N+Z !
    207206          if(pElement->GetIsotope(j)->GetZ()!=Z)G4cerr<<"G4QCaptureAtRest::GetMeanFreePath"
    208                                                                                                                                                                                                                                                                         <<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
     207                                 <<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    209208          G4double abund=abuVector[j];
    210                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     209          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    211210#ifdef debug
    212211          G4cout<<"G4QGluonString::GetMeanFreePath:p#"<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    213212#endif
    214213          newAbund->push_back(pr);
    215                                                   }
     214        }
    216215#ifdef debug
    217216        G4cout<<"G4QGluonString::PostStepDoIt:pairVectorLength="<<newAbund->size()<<G4endl;
     
    370369#ifdef debug
    371370  G4int prPDG=particle->GetPDGEncoding();
    372                 G4cout<<"G4QGluonString::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     371  G4cout<<"G4QGluonString::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    373372#endif
    374373  if(!projPDG)
     
    379378  G4int EPIM=ElProbInMat.size();
    380379#ifdef debug
    381                 G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     380  G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    382381#endif
    383382  G4int i=0;
     
    386385    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    387386    for(i=0; i<nE; ++i)
    388                   {
    389 #ifdef debug
    390                                   G4cout<<"G4QGluonString::PostStepDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
     387    {
     388#ifdef debug
     389      G4cout<<"G4QGluonString::PostStDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
    391390#endif
    392391      if (rnd<ElProbInMat[i]) break;
     
    397396  Z=static_cast<G4int>(pElement->GetZ());
    398397#ifdef debug
    399                                 G4cout<<"G4QGluonString::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     398    G4cout<<"G4QGluonString::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    400399#endif
    401400  if(Z<=0)
     
    408407  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    409408#ifdef debug
    410                 G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
     409  G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
    411410#endif
    412411  G4int j=0;
     
    417416    {
    418417#ifdef debug
    419                                   G4cout<<"G4QGluonString::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
     418      G4cout<<"G4QGluonString::PostStepDoIt:SP["<<j<<"]="<<(*SPI)[j]<<",r="<<rndI<<G4endl;
    420419#endif
    421420      if(rndI < (*SPI)[j]) break;
     
    425424  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    426425#ifdef debug
    427                 G4cout<<"G4QGluonString::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<G4endl;
     426  G4cout<<"G4QGluonString::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<G4endl;
    428427#endif
    429428  if(N<0)
     
    439438  if(dsr<dd)dsr=dd;
    440439  if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio);// ManualPa
    441                 //else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP CluPars
     440  //else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP CluPars
    442441  //else if(projPDG==-211)  G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.); //Pi- CluPars
    443442#ifdef debug
     
    517516    {
    518517#ifdef debug
    519              G4cout<<"G4QGluonString::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
     518      G4cout<<"G4QGluonString::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
    520519#endif
    521520      delete hadr;
     
    530529    {
    531530      if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong();   // K_L
    532                                                 else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
     531      else                   theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
    533532    }
    534533    else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
     
    537536    else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
    538537    else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
    539            else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
     538    else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
    540539    {
    541540      G4int aZ = hadr->GetCharge();
    542541      G4int aA = hadr->GetBaryonNumber();
    543542#ifdef pdebug
    544                                                 G4cout<<"G4QGluonString::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
     543      G4cout<<"G4QGluonString::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
    545544#endif
    546545      theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
     
    550549    {
    551550#ifdef pdebug
    552                                                 G4cout<<"G4QGluonString::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
     551      G4cout<<"G4QGluonString::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
    553552#endif
    554553      theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
    555554#ifdef pdebug
    556                                                 G4cout<<"G4QGluonString::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
     555      G4cout<<"G4QGluonString::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
    557556#endif
    558557    }
     
    594593  delete output; // instances of the G4QHadrons from the output are already deleted above +
    595594#ifdef debug
    596                 G4cout<<"G4QGluonString::PostStDoIt: afterSt="<<aParticleChange.GetTrackStatus()<<G4endl;
     595  G4cout<<"G4QGluonString::PostStDoIt: afterSt="<<aParticleChange.GetTrackStatus()<<G4endl;
    597596#endif
    598597  aParticleChange.ProposeTrackStatus(fStopAndKill);        // Kill the absorbed particle
    599598#ifdef debug
    600                 G4cout<<"G4QGluonString::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG
     599  G4cout<<"G4QGluonString::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG
    601600        <<", St="<<aParticleChange.GetTrackStatus()<<G4endl;
    602601#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QIonIonCrossSection.cc

    r1007 r1055  
    2626//
    2727// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 19-Aug-07
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3737// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
    3838// ****************************************************************************************
     39// Short description: CHIPS cross-sectons for Ion-Ion interactions
     40// ---------------------------------------------------------------
    3941//
    4042//#define debug
     
    8587        <<"),PDG="<<pPDG<<"("<<lastPDG<<"), p="<<pMom<<"("<<lastTH<<")"<<",Sz="
    8688        <<colN.size()<<G4endl;
    87                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     89  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    8890#endif
    8991  if(!pPDG)
     
    106108    j  = 0;                            // A#0f records found in DB for this projectile
    107109    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    108            {                                  // The nucleus with projPDG is found in AMDB
     110    {                                  // The nucleus with projPDG is found in AMDB
    109111      if(colN[i]==tN && colZ[i]==tZ)
    110                                                 {
     112      {
    111113        lastI=i;
    112114        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    129131        {
    130132#ifdef pdebug
    131           G4cout<<"G4QIonIonCS::GetCS:P="<<pMom<<",InXS="<<lastICS*millibarn<<",ElXS="<<lastECS*millibarn
    132                 <<G4endl;
     133          G4cout<<"G4QIonIonCS::GetCS:P="<<pMom<<",InXS="<<lastICS*millibarn<<",ElXS="
     134                <<lastECS*millibarn<<G4endl;
    133135#endif
    134136          CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
     
    161163#endif
    162164      j++;                             // Increment a#0f records found in DB for this pPDG
    163            }
    164            if(!in)                            // This nucleus has not been calculated previously
    165            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    166168#ifdef pdebug
    167169      G4cout<<"G4QIICS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    171173      lastECS=CalculateCrossSection(false,0,j,lastPDG,lastZ,lastN,pMom); //calculate&create
    172174      if(lastICS<=0. || lastECS<=0.)
    173                                                 {
     175      {
    174176        lastTH = ThresholdEnergy(tZ, tN); // The Threshold Energy which is now the last
    175177#ifdef pdebug
     
    183185          lastTH=pMom;
    184186        }
    185                                                 }
     187      }
    186188#ifdef pdebug
    187189      G4cout<<"G4QIICS::GetCS: *New* ICS="<<lastICS<<", ECS="<<lastICS<<",N="<<lastN<<",Z="
     
    201203      if(fCS) return lastICS*millibarn;     // Use theLastInelasticCS
    202204      return         lastECS*millibarn;     // Use theLastElasticCS
    203            } // End of creation of the new set of parameters
     205    } // End of creation of the new set of parameters
    204206    else
    205                                 {
     207    {
    206208#ifdef pdebug
    207209      G4cout<<"G4QIICS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    286288  {
    287289    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    288                                 {
     290    {
    289291      lastLENI=LENI[I];              // Pointer to Low Energy inelastic cross sections
    290292      lastHENI=HENI[I];              // Pointer to High Energy inelastic cross sections
     
    292294      lastHENE=HENE[I];              // Pointer to High Energy inelastic cross sections
    293295    }
    294            else                             // This isotope wasn't calculated previously => CREATE
    295            {
     296    else                             // This isotope wasn't calculated previously => CREATE
     297    {
    296298      lastLENI = new G4double[nL];   // Allocate memory for the new LEN cross sections
    297299      lastHENI = new G4double[nH];   // Allocate memory for the new HEN cross sections
     
    299301      lastHENE = new G4double[nH];   // Allocate memory for the new HEN cross sections
    300302      G4int er=GetFunctions(pZ,pN,tZ,tN,lastLENI,lastHENI,lastLENE,lastHENE);
    301              if(er<1) G4cerr<<"*W*G4QIonIonCroSec::CalcCrossSection: pA="<<tA<<",tA="<<tA<<G4endl;
     303      if(er<1) G4cerr<<"*W*G4QIonIonCroSec::CalcCrossSection: pA="<<tA<<",tA="<<tA<<G4endl;
    302304#ifdef debug
    303305      G4cout<<"G4QIonIonCrossSection::CalcCS: GetFunctions er="<<er<<",pA="<<pA<<",tA="<<tA
     
    311313      LENE.push_back(lastLENE);      // added LEN Elastic
    312314      HENE.push_back(lastHENE);      // added HEN Elastic
    313            } // End of creation of the new set of parameters
     315    } // End of creation of the new set of parameters
    314316  } // End of parameters udate
    315317  // ============================== NOW the Magic Formula =================================
    316318  if (Momentum<lastTH) return 0.;    // It must be already checked in the interface class
    317                 else if (Momentum<Pmin)            // LEN region (approximated in E, not in lnE)
     319  else if (Momentum<Pmin)            // LEN region (approximated in E, not in lnE)
    318320  {
    319321#ifdef debug
    320            G4cout<<"G4QIICS::CalCS:p="<<pA<<",t="<<tA<<",n="<<nL<<",T="<<THmin<<",d="<<dP<<G4endl;
     322    G4cout<<"G4QIICS::CalCS:p="<<pA<<",t="<<tA<<",n="<<nL<<",T="<<THmin<<",d="<<dP<<G4endl;
    321323#endif
    322324    if(tA<1. || pA<1.)
    323325    {
    324            G4cout<<"-Warning-G4QIICS::CalcCS: pA="<<pA<<" or tA="<<tA<<" aren't nuclei"<<G4endl;
     326      G4cout<<"-Warning-G4QIICS::CalcCS: pA="<<pA<<" or tA="<<tA<<" aren't nuclei"<<G4endl;
    325327      sigma=0.;
    326328    }
     
    331333    }
    332334#ifdef debugn
    333            if(sigma<0.) G4cout<<"-Warning-G4QIICS::CalcCS:pA="<<pA<<",tA="<<tA<<",XS="<<XS<<",P="
     335    if(sigma<0.) G4cout<<"-Warning-G4QIICS::CalcCS:pA="<<pA<<",tA="<<tA<<",XS="<<XS<<",P="
    334336                       <<Momentum<<", Th="<<THmin<<", dP="<<dP<<G4endl;
    335337#endif
     
    343345    if(tA<=1. || pA<=1.)
    344346    {
    345            G4cout<<"-Warning-G4QIICS::CalcCS:pA="<<pA<<"or tA="<<tA<<" aren't composit"<<G4endl;
     347      G4cout<<"-Warning-G4QIICS::CalcCS:pA="<<pA<<"or tA="<<tA<<" aren't composit"<<G4endl;
    346348      sigma=0.;
    347349    }
     
    354356  else                                      // UltraHighE region (not frequent)
    355357  {
    356                                 std::pair<G4double, G4double> inelel = CalculateXS(pZ, pN, tZ, tN, Momentum);
     358    std::pair<G4double, G4double> inelel = CalculateXS(pZ, pN, tZ, tN, Momentum);
    357359    if(XS) sigma=inelel.first;
    358360    else   sigma=inelel.second;
     
    423425  G4double elCS=0.;
    424426  if(pA<1.1 || tA<1.1) // Ion-nucleon/nucleon-ion interaction use NA(in,el)
    425                 {
     427  {
    426428    if ( (pZ == 1 && !pN) || (tZ == 1 && !tN) ) // proton-nuclear
    427429    {
     
    434436      inCS=ElCSman->GetCrossSection(true, Mom, tZ, tN, 2112);
    435437    }
    436                                 else G4cerr<<"-Warn-G4QIICS::CaCS:pZ="<<pZ<<",pN="<<pN<<",tZ="<<tZ<<",tN="<<tN<<G4endl;
     438    else G4cerr<<"-Warn-G4QIICS::CaCS:pZ="<<pZ<<",pN="<<pN<<",tZ="<<tZ<<",tN="<<tN<<G4endl;
    437439  }
    438440  else
    439                 {
     441  {
    440442    G4double P2=Mom*Mom;
    441443    G4double P4=P2*P2;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QIonIonElastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QIonIonElastic.cc,v 1.3 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QIonIonElastic.cc,v 1.4 2009/02/23 09:49:24 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QIonIonElastic class -----------------
     
    3434// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
    3535// ****************************************************************************************
     36// Short description: a simple process for the Ion-Ion elastic scattering.
     37// For heavy by heavy ions it can reach 50% of the total cross-section.
     38// -----------------------------------------------------------------------
    3639
    3740//#define debug
     
    153156                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    154157          G4double abund=abuVector[j];
    155                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     158          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    156159#ifdef debug
    157160          G4cout<<"G4QIonIonElastic::GetMeanFP:pair#="<<j<<",N="<<N<<",ab="<<abund<<G4endl;
    158161#endif
    159162          newAbund->push_back(pr);
    160                                                   }
     163        }
    161164#ifdef debug
    162165        G4cout<<"G4QIonIonElastic::GetMeanFP: pairVectorLength="<<newAbund->size()<<G4endl;
     
    185188      G4cout<<"G4QIIEl::GMFP:true,P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
    186189#endif
    187                     G4bool ccsf=false;                    // Extract elastic Ion-Ion cross-section
     190      G4bool ccsf=false;                    // Extract elastic Ion-Ion cross-section
    188191#ifdef debug
    189192      G4cout<<"G4QIonIonElastic::GMFP: GetCS #1 j="<<j<<G4endl;
     
    232235  static G4bool CWinit = true;                   // CHIPS Warld needs to be initted
    233236  if(CWinit)
    234                 {
     237  {
    235238    CWinit=false;
    236239    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    292295#ifdef debug
    293296  G4int prPDG=particle->GetPDGEncoding();
    294                 G4cout<<"G4QIonIonElastic::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     297  G4cout<<"G4QIonIonElastic::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    295298#endif
    296299  if(!projPDG)
     
    304307  G4int EPIM=ElProbInMat.size();
    305308#ifdef debug
    306                 G4cout<<"G4QIonIonElastic::PSDI:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     309  G4cout<<"G4QIonIonElastic::PSDI:m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    307310#endif
    308311  G4int i=0;
     
    311314    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    312315    for(i=0; i<nE; ++i)
    313                   {
    314 #ifdef debug
    315                                   G4cout<<"G4QIonIonElastic::PSDI: EPM["<<i<<"]="<<ElProbInMat[i]<<", r="<<rnd<<G4endl;
     316    {
     317#ifdef debug
     318      G4cout<<"G4QIonIonElastic::PSDI: EPM["<<i<<"]="<<ElProbInMat[i]<<", r="<<rnd<<G4endl;
    316319#endif
    317320      if (rnd<ElProbInMat[i]) break;
     
    322325  Z=static_cast<G4int>(pElement->GetZ());
    323326#ifdef debug
    324                                 G4cout<<"G4QIonIonElastic::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
     327    G4cout<<"G4QIonIonElastic::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
    325328#endif
    326329  if(Z<=0)
     
    333336  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    334337#ifdef debug
    335                 G4cout<<"G4QIonIonElastic::PosStDoIt: nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
     338  G4cout<<"G4QIonIonElastic::PosStDoIt: nI="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
    336339#endif
    337340  G4int j=0;
     
    342345    {
    343346#ifdef debug
    344                                   G4cout<<"G4QIonIonElastic::PostStDI: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
     347      G4cout<<"G4QIonIonElastic::PostStDI: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
    345348#endif
    346349      if(rndI < (*SPI)[j]) break;
     
    350353  G4int N =(*IsN)[j]; ;                    // Randomized number of neutrons
    351354#ifdef debug
    352                 G4cout<<"G4QIonIonElastic::PostStepDoIt:j="<<i<<",N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
     355  G4cout<<"G4QIonIonElastic::PostStepDoIt:j="<<i<<",N(isotope)="<<N<<", MeV="<<MeV<<G4endl;
    353356#endif
    354357  if(N<0)
     
    492495  EnMomConservation-=scat4M;                        // It must be initialized by (pE+tM,pP)
    493496  // This is how in general the secondary should be identified
    494                 G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
     497  G4DynamicParticle* theSec = new G4DynamicParticle; // A secondary for the recoil hadron
    495498  G4int aA = Z+N;
    496499#ifdef pdebug
    497                 G4cout<<"G4QIonIonElastic::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
     500  G4cout<<"G4QIonIonElastic::PostStepDoIt: Ion Z="<<Z<<", A="<<aA<<G4endl;
    498501#endif
    499502  G4ParticleDefinition* theDefinition=G4ParticleTable::GetParticleTable()
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QLowEnergy.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4QLowEnergy.cc,v 1.7 2008/10/02 21:10:07 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4QLowEnergy.cc,v 1.9 2009/03/09 15:41:17 mkossov Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//      ---------------- G4QLowEnergy class -----------------
     
    3131// G4QLowEnergy class of the CHIPS Simulation Branch in GEANT4
    3232// ---------------------------------------------------------------
    33 // ****************************************************************************************
    34 // ********** This CLASS is temporary moved from the "chips/interface" directory *********
    35 // ****************************************************************************************
     33// Short description: This is a fast low energy algorithm for the
     34// inelastic interactions of nucleons and nuclei (ions) with nuclei.
     35// This is a fase-space algorithm, but not quark level. Provides
     36// nuclear fragments upto alpha only. Never was tumed (but can be).
     37// ---------------------------------------------------------------
    3638
    3739//#define debug
     
    9395  G4cout<<"G4QLowEnergy::GetMeanFreePath:"<<nE<<" Elems"<<G4endl;
    9496#endif
    95   G4VQCrossSection* CSmanager=G4QIonIonCrossSection::GetPointer();
    9697  G4int pPDG=0;
    97   // @@ At present it is made only for n & p, but can be extended if inXS are available
    98   if      ( incidentParticleDefinition ==  G4Deuteron::Deuteron()     ) pPDG = 100001002;
     98  if      ( incidentParticleDefinition ==  G4Proton::Proton()         ) pPDG = 2212;
     99  else if ( incidentParticleDefinition ==  G4Deuteron::Deuteron()     ) pPDG = 100001002;
    99100  else if ( incidentParticleDefinition ==  G4Alpha::Alpha()           ) pPDG = 100002004;
    100101  else if ( incidentParticleDefinition ==  G4Triton::Triton()         ) pPDG = 100001003;
     
    110111#endif
    111112  }
    112   else G4cout<<"-Warning-G4QLowEnergy::GetMeanFreePath: only AA are implemented"<<G4endl; 
     113  else G4cout<<"-Warning-G4QLowEnergy::GetMeanFreePath: only AA & pA implemented"<<G4endl;
     114  G4VQCrossSection* CSmanager=G4QIonIonCrossSection::GetPointer();
     115  if(pPDG == 2212) CSmanager=G4QProtonNuclearCrossSection::GetPointer();
    113116  Momentum/=incidentParticleDefinition->GetBaryonNumber(); // Divide Mom by projectile A
    114117  G4QIsotope* Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
     
    157160                                         <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
    158161          G4double abund=abuVector[j];
    159                                                                   std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
     162          std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
    160163#ifdef debug
    161164          G4cout<<"G4QLowEnergy::GetMeanFreePath:pair#"<<j<<",N="<<N<<",a="<<abund<<G4endl;
    162165#endif
    163166          newAbund->push_back(pr);
    164                                                   }
     167        }
    165168#ifdef debug
    166169        G4cout<<"G4QLowEnergy::GetMeanFreePath: pairVectLength="<<newAbund->size()<<G4endl;
     
    189192      G4cout<<"G4QLowE::GMFP:true,P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
    190193#endif
    191                     G4bool ccsf=true;                    // Extract inelastic Ion-Ion cross-section
     194      G4bool ccsf=true;                    // Extract inelastic Ion-Ion cross-section
    192195#ifdef debug
    193196      G4cout<<"G4QLowEnergy::GMFP: GetCS #1 j="<<j<<G4endl;
     
    256259  static G4bool CWinit = true;                       // CHIPS Warld needs to be initted
    257260  if(CWinit)
    258                 {
     261  {
    259262    CWinit=false;
    260263    G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max)
     
    314317#ifdef debug
    315318  G4int prPDG=particle->GetPDGEncoding();
    316                 G4cout<<"G4QLowEnergy::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
     319  G4cout<<"G4QLowEnergy::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
    317320#endif
    318321  if(!projPDG)
     
    321324    return 0;
    322325  }
    323                 // Element treatment
     326  // Element treatment
    324327  G4int EPIM=ElProbInMat.size();
    325328#ifdef debug
    326                 G4cout<<"G4QLowEn::PostStDoIt: m="<<EPIM<<", n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
     329  G4cout<<"G4QLowEn::PostStDoIt: m="<<EPIM<<", n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
    327330#endif
    328331  G4int i=0;
     
    331334    G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
    332335    for(i=0; i<nE; ++i)
    333                   {
    334 #ifdef debug
    335                                   G4cout<<"G4QLowEn::PostStepDoIt: EPM["<<i<<"]="<<ElProbInMat[i]<<", r="<<rnd<<G4endl;
     336    {
     337#ifdef debug
     338      G4cout<<"G4QLowEn::PostStepDoIt: EPM["<<i<<"]="<<ElProbInMat[i]<<", r="<<rnd<<G4endl;
    336339#endif
    337340      if (rnd<ElProbInMat[i]) break;
     
    342345  G4int tZ=static_cast<G4int>(pElement->GetZ());
    343346#ifdef debug
    344                                 G4cout<<"G4QLowEnergy::PostStepDoIt: i="<<i<<", Z(element)="<<tZ<<G4endl;
     347    G4cout<<"G4QLowEnergy::PostStepDoIt: i="<<i<<", Z(element)="<<tZ<<G4endl;
    345348#endif
    346349  if(tZ<=0)
     
    353356  G4int nofIsot=SPI->size();               // #of isotopes in the element i
    354357#ifdef debug
    355                 G4cout<<"G4QLowEnergy::PostStepDoIt: nI="<<nofIsot<<", T="<<(*SPI)[nofIsot-1]<<G4endl;
     358  G4cout<<"G4QLowEnergy::PostStepDoIt: nI="<<nofIsot<<", T="<<(*SPI)[nofIsot-1]<<G4endl;
    356359#endif
    357360  G4int j=0;
     
    362365    {
    363366#ifdef debug
    364                                   G4cout<<"G4QLowEnergy::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<",r="<<rndI<<G4endl;
     367      G4cout<<"G4QLowEnergy::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<",r="<<rndI<<G4endl;
    365368#endif
    366369      if(rndI < (*SPI)[j]) break;
     
    370373  G4int tN =(*IsN)[j]; ;                    // Randomized number of neutrons
    371374#ifdef debug
    372                 G4cout<<"G4QLowEnergy::PostStepDoIt: j="<<i<<", N(isotope)="<<tN<<", MeV="<<MeV<<G4endl;
     375  G4cout<<"G4QLowEnergy::PostStepDoIt: j="<<i<<", N(isotope)="<<tN<<", MeV="<<MeV<<G4endl;
    373376#endif
    374377  if(tN<0)
     
    451454  // algorithm implementation --- STARTS HERE --- All calculations are in IU --------
    452455  G4double totM=tot4M.m(); // total CMS mass of the reaction
    453                 G4int totN=tN+pN;
     456  G4int totN=tN+pN;
    454457  G4int totZ=tZ+pZ;
    455458  // @@ Here mass[i] can be calculated if mass=0
     
    980983  if(!G4QHadron(tot4M).CopDecayIn3(fst4Mom,snd4Mom,res4Mom,dir4Mom,cosp))
    981984  {                   //                                         
    982                   G4cerr<<"**G4LowEnergy::PoStDoIt:i="<<index<<",tM="<<totM<<"->M1="<<res4Mom.m()<<"+M2="
     985    G4cerr<<"**G4LowEnergy::PoStDoIt:i="<<index<<",tM="<<totM<<"->M1="<<res4Mom.m()<<"+M2="
    983986     <<fst4Mom.m()<<"+M3="<<snd4Mom.m()<<"=="<<res4Mom.m()+fst4Mom.m()+snd4Mom.m()<<G4endl;
    984987    throw G4QException("G4QLowEnergy::PostStepDoIt: Can't decay the Compound");
    985                 }                   //                                         
     988  }                   //                                         
    986989#ifdef debug
    987990  G4cout<<"G4QLowEn::PSDI:r4M="<<res4Mom<<",f4M="<<fst4Mom<<",s4M="<<snd4Mom<<G4endl;
     
    10751078  {
    10761079    CSmanager=G4QIonIonCrossSection::GetPointer();
     1080    if(PDG == 2212) CSmanager=G4QProtonNuclearCrossSection::GetPointer();
    10771081    first=false;
    10781082  }
    10791083#ifdef debug
    1080                 G4cout<<"G4QLowE::CXS: *DONE* p="<<p<<",Z="<<Z<<",N="<<N<<",PDG="<<PDG<<G4endl;
     1084  G4cout<<"G4QLowE::CXS: *DONE* p="<<p<<",Z="<<Z<<",N="<<N<<",PDG="<<PDG<<G4endl;
    10811085#endif
    10821086  return CSmanager->GetCrossSection(true, p, Z, N, PDG);
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QMuonNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QMuonNuclearCrossSection.cc,v 1.13 2008/10/24 19:24:59 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QMuonNuclearCrossSection.cc,v 1.15 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3838// ****************************************************************************************
    3939//=========================================================================================
     40// Short description: reaction cross-sections for muon-nuclear reactions, which
     41// are integrals over virtual equivalent photons photons. The muon-nuclear GHAD
     42// model (not CHIPS) gives 2-3 times smaller scattering angle and deposited energy.
     43// --------------------------------------------------------------------------------
    4044
    4145//#define debug
     
    9498        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9599        <<colN.size()<<G4endl;
    96                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     100  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    97101#endif
    98102  if(std::abs(pPDG)!=13)
     
    115119    j  = 0;                            // A#0f records found in DB for this projectile
    116120    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    117            {                                  // The nucleus with projPDG is found in AMDB
     121    {                                  // The nucleus with projPDG is found in AMDB
    118122      if(colN[i]==tgN && colZ[i]==tgZ)
    119                                                 {
     123      {
    120124        lastI=i;
    121125        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    134138        lastP  =colP [i];                // Last Momentum  (A-dependent)
    135139        lastCS =colCS[i];                // Last CrossSect (A-dependent)
    136         //        if(std::fabs(lastP/pMom-1.)<tolerance)
     140 //        if(std::fabs(lastP/pMom-1.)<tolerance)
    137141        if(lastP==pMom)                  // VI do not use tolerance
    138142        {
     
    168172#endif
    169173      j++;                             // Increment a#0f records found in DB for this pPDG
    170            }
    171            if(!in)                            // This nucleus has not been calculated previously
    172            {
     174    }
     175    if(!in)                            // This nucleus has not been calculated previously
     176    {
    173177#ifdef pdebug
    174178      G4cout<<"G4QMNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    177181      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    178182      if(lastCS<=0.)
    179                                                 {
     183      {
    180184        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    181185#ifdef pdebug
     
    189193          lastTH=pEn;
    190194        }
    191                                                 }
     195      }
    192196#ifdef pdebug
    193197      G4cout<<"G4QMNCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    205209#endif
    206210      return lastCS*millibarn;
    207            } // End of creation of the new set of parameters
     211    } // End of creation of the new set of parameters
    208212    else
    209                                 {
     213    {
    210214#ifdef pdebug
    211215      G4cout<<"G4QMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    277281  G4double mP= infEn;
    278282  if(Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
    279             mP = G4NucleiProperties::GetNuclearMass(A-1.,Z-1.)/MeV; // ResNucMass for a proton
     283          mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV;// ResNucMass for a proton
    280284
    281285  G4double mN= infEn;
    282286  if(N&&G4NucleiProperties::IsInStableTable(A-1,Z))
    283             mN = G4NucleiProperties::GetNuclearMass(A-1.,Z)/MeV;  // ResNucMass for a neutron
     287          mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV;  // ResNucMass for a neutron
    284288
    285289  G4double mA= infEn;
    286290  if(N>1&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
    287             mA=G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV; // ResNucMass for an alpha
     291          mA=G4NucleiProperties::GetNuclearMass(A-4,Z-2)/MeV; // ResNucMass for an alpha
    288292
    289293  G4double dP= mP +mProt - mT;
     
    291295  G4double dA= mA +mAlph - mT;
    292296#ifdef pdebug
    293                 G4cout<<"G4QMuonNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
     297  G4cout<<"G4QMuonNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
    294298        <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
    295299#endif
     
    321325  static std::vector <G4double*> J3;   // Vector of pointers to the J3 tabulated functions
    322326#ifdef pdebug
    323                 G4cout<<"G4QMuonNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
     327  G4cout<<"G4QMuonNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
    324328  if(J3.size()) G4cout<<", p="<<J3[0];
    325329  G4cout<<G4endl;
     
    333337  lastE=TotEnergy-mmu;               // Kinetic energy of the muon
    334338#ifdef pdebug
    335                 G4cout<<"G4QMuonNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ
     339  G4cout<<"G4QMuonNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ
    336340        <<", N="<<targN<<", onlyCS="<<CS<<",E="<<lastE<<",th="<<EMi<<G4endl;
    337341#endif
     
    340344  {
    341345    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    342                         {                                // ...........................................========
     346    {                                // ...........................................========
    343347      if (lastE<=EMi)                // Energy is below the minimum energy in the table
    344348      {
     
    347351        lastSig=0.;
    348352#ifdef pdebug
    349                                     G4cout<<"--> G4QMuonNucCS::CalcCS: Old CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
     353        G4cout<<"--> G4QMuonNucCS::CalcCS: Old CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
    350354#endif
    351355        return 0.;
     
    356360      lastF  =colF[I];               // Last ZeroPosition in the J-functions
    357361      lastH  =colH[I];               // Last High Energy Coefficient (A-dependent)
    358            }
    359            else                             // This isotope wasn't calculated previously => CREATE
    360                         {                                // ............................................=======
     362    }
     363    else                             // This isotope wasn't calculated previously => CREATE
     364    {                                // ............................................=======
    361365      lastJ1 = new G4double[nE];     // Allocate memory for the new J1 function
    362366      lastJ2 = new G4double[nE];     // Allocate memory for the new J2 function
     
    375379      colF.push_back(lastF);
    376380      colH.push_back(lastH);
    377            } // End of creation of the new set of parameters
     381    } // End of creation of the new set of parameters
    378382  } // End of parameters udate
    379383  // ============================== NOW Calculate the Cross Section =====================
     
    384388    lastSig=0.;
    385389#ifdef pdebug
    386                                 G4cout<<"--> G4QMuonNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
     390    G4cout<<"--> G4QMuonNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
    387391#endif
    388392    return 0.;
     
    398402#ifdef pdebug
    399403    G4cout<<"-->G4QMuonNuclearCS::CalcCrossSect:LOGfit b="<<blast<<",max="<<mL<<",lJ1="
    400                                       <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
     404          <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
    401405#endif
    402406    if(blast<0)   blast=0;
     
    25722576        y[k]=P1[i][k];                 // J1
    25732577        z[k]=P2[i][k];                 // J2
    2574              }
     2578      }
    25752579      r=L[i];                          // Low channel for the J-functions
    25762580    }
     
    25952599      r=L[k];
    25962600      if(L[k1]<r) r=L[k1];
    2597            }
     2601    }
    25982602  }
    25992603  return r;
     
    26292633  if(ris<Y[lastL])                      // Search in the table
    26302634  {
    2631            G4int j=lastF;
     2635    G4int j=lastF;
    26322636    G4double Yj=Y[j];                   // It mast be 0 (some times just very small)
    26332637    while (ris>Yj && j<lastL)           // Associative search
    2634            {
     2638    {
    26352639      j++;
    26362640      Yj=Y[j];                          // High value
    2637            }
     2641    }
    26382642    G4int j1=j-1;
    26392643    G4double Yi=Y[j1];                  // Low value
    26402644    phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
    26412645#ifdef debug
    2642            G4cout<<"G4QMuNuclearCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi
     2646    G4cout<<"G4QMuNuclearCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi
    26432647          <<",Y="<<Yj<<G4endl;
    26442648#endif
     
    26502654    G4double f=(ris-Y[lastL])/lastH;    // ScaledResidualValue of the cross-sec. integral
    26512655#ifdef pdebug
    2652         G4cout<<"G4QMuNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
     2656    G4cout<<"G4QMuNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
    26532657#endif
    26542658    phLE=SolveTheEquation(f);           // Solve equation to find theLog(phE) (comp lastLE)
    26552659#ifdef pdebug
    2656            G4cout<<"G4QMuonNuclearCrossSection::GetExchangeEnergy:HighEnergy lphE="<<phLE<<G4endl;
     2660    G4cout<<"G4QMuonNuclearCrossSection::GetExchangeEnergy:HighEnergy lphE="<<phLE<<G4endl;
    26572661#endif
    26582662  }
     
    27012705#endif
    27022706    if(x>=lastLE)
    2703            {
     2707    {
    27042708      G4cerr<<"*G4QMuNCS::SolveTheEq:*Correction*"<<i<<",d="<<d<<",x="<<x<<">lE="<<lastLE
    27052709            <<",f="<<f<<",fx="<<fx<<",df="<<df<<",A(Z="<<lastZ<<",N="<<lastN<<")"<<G4endl;
     
    27892793    return 0.;
    27902794  }
    2791   G4double lK=std::log(K);                     // ln(K)
     2795  G4double lK=std::log(K);                // ln(K)
    27922796  G4double x=1.-K/nu;                     // This definitin saves one div.
    27932797  G4double GD=1.+Q2/Q02;                  // Reversed nucleonic form-factor
    2794   G4double b=std::exp(bp*(lK-blK0));           // b-factor
    2795   G4double c=std::exp(cp*(lK-clK0));           // c-factor
    2796   G4double r=.5*std::log(Q2+nu*nu)-lK;         // r=.5*log((Q^2+nu^2)/K^2)
    2797   G4double ef=std::exp(r*(b-c*r*r));           // exponential factor
     2798  G4double b=std::exp(bp*(lK-blK0));      // b-factor
     2799  G4double c=std::exp(cp*(lK-clK0));      // c-factor
     2800  G4double r=.5*std::log(Q2+nu*nu)-lK;    // r=.5*log((Q^2+nu^2)/K^2)
     2801  G4double ef=std::exp(r*(b-c*r*r));      // exponential factor
    27982802  return (1.-x)*ef/GD/GD;
    27992803}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QNeutronNuclearCrossSection.cc

    r1007 r1055  
    2626//
    2727// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3434// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
    3535// --------------------------------------------------------------------------------
    36 // ****************************************************************************************
    37 // ****** This CLASS is a property of the CHIPS hadronic package in Geant4 (M. Kosov) *****
    38 // *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
    39 // ****************************************************************************************
     36// Short description: neutron-nuclear cross-section for hadronic CHIPS
     37// -------------------------------------------------------------------
    4038//
    4139//#define debug
     
    4947// Initialization of the
    5048G4double* G4QNeutronNuclearCrossSection::lastLEN=0; // Pointer to the lastArray of LowEn CS
    51 G4double* G4QNeutronNuclearCrossSection::lastHEN=0; // Pointer to the lastArray of HighEn CS
     49G4double* G4QNeutronNuclearCrossSection::lastHEN=0; // Pointer to the lastArray of HighE CS
    5250G4int     G4QNeutronNuclearCrossSection::lastN=0;   // The last N of calculated nucleus
    5351G4int     G4QNeutronNuclearCrossSection::lastZ=0;   // The last Z of calculated nucleus
     
    9189    j  = 0;                            // A#0f records found in DB for this projectile
    9290    if(lastI) for(G4int i=0; i<lastI; i++) // The partType is found
    93            {                                  // The nucleus with is found in AMDB
     91    {                                  // The nucleus with is found in AMDB
    9492      if(colN[i]==tgN && colZ[i]==tgZ)
    95                                                 {
     93      {
    9694        lastI=i;
    9795        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    108106        lastP  =colP [i];                // Last Momentum  (A-dependent)
    109107        lastCS =colCS[i];                // Last CrossSect (A-dependent)
    110         //        if(std::fabs(lastP/pMom-1.)<tolerance)
     108 //        if(std::fabs(lastP/pMom-1.)<tolerance)
    111109        if(lastP==pMom)                 // VI do not use tolerance
    112110        {
     
    140138#endif
    141139      j++;                             // Increment a#0f records found in DB
    142            }
    143            if(!in)                            // This nucleus has not been calculated previously
    144            {
     140    }
     141    if(!in)                            // This nucleus has not been calculated previously
     142    {
    145143#ifdef pdebug
    146144      G4cout<<"G4QNtCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    149147      lastCS=CalculateCrossSection(fCS,0,j,2212,lastZ,lastN,pMom); //calculate & create
    150148      if(lastCS<=0.)
    151                                                 {
     149      {
    152150        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    153151#ifdef pdebug
     
    161159          lastTH=pEn;
    162160        }
    163                                                 }
     161      }
    164162#ifdef pdebug
    165163      G4cout<<"G4QNtCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    174172#endif
    175173      return lastCS*millibarn;
    176            } // End of creation of the new set of parameters
     174    } // End of creation of the new set of parameters
    177175    else
    178                                 {
     176    {
    179177#ifdef pdebug
    180178      G4cout<<"G4QNeutronNuclearCrossSect::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    228226  static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
    229227  static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
    230   static const G4double milPG=std::log(.001*Pmin);// Low logarithm energy for the HEN part GeV/c
     228  static const G4double milPG=std::log(.001*Pmin);// Low logEnergy for the HEN part GeV/c
    231229  //
    232230  // Associative memory for acceleration
     
    244242  {
    245243    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    246                                 {
     244    {
    247245      lastLEN=LEN[I];                // Pointer to prepared LowEnergy cross sections
    248246      lastHEN=HEN[I];                // Pointer to prepared High Energy cross sections
    249247    }
    250            else                             // This isotope wasn't calculated previously => CREATE
    251            {
     248    else                             // This isotope wasn't calculated previously => CREATE
     249    {
    252250      lastLEN = new G4double[nL];    // Allocate memory for the new LEN cross sections
    253251      lastHEN = new G4double[nH];    // Allocate memory for the new HEN cross sections
     
    271269      LEN.push_back(lastLEN);          // added LEN, found by AH 10/7/02
    272270      HEN.push_back(lastHEN);          // added HEN, found by AH 10/7/02
    273            } // End of creation of the new set of parameters
     271    } // End of creation of the new set of parameters
    274272  } // End of parameters udate
    275273  // ============================== NOW the Magic Formula =================================
     
    278276  {
    279277#ifdef debug
    280            G4cout<<"G4QNeutCS::CalcCS:bLEN A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
     278    G4cout<<"G4QNeutCS::CalcCS:bLEN A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
    281279#endif
    282280    if(A<=1.) sigma=0.;
    283281    else      sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
    284282#ifdef debugn
    285            if(sigma<0.)
     283    if(sigma<0.)
    286284      G4cout<<"G4QNeutCS::CalcCS:A="<<A<<",E="<<Momentum<<",T="<<THmin<<",dP="<<dP<<G4endl;
    287285#endif
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QNuENuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuENuclearCrossSection.cc,v 1.2 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuENuclearCrossSection.cc,v 1.4 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
    4040
    4141//#define debug
     
    9090        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9191        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     92  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9393#endif
    9494  if(pPDG!=12)
     
    111111    j  = 0;                            // A#0f records found in DB for this projectile
    112112    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     113    {                                  // The nucleus with projPDG is found in AMDB
    114114      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     115      {
    116116        lastI=i;
    117117        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163163#endif
    164164      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    168168#ifdef pdebug
    169169      G4cout<<"G4QNENCS::GetCrSec: CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    172172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173173      if(lastCS<=0.)
    174                                                 {
     174      {
    175175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176176#ifdef pdebug
     
    184184          lastTH=pEn;
    185185        }
    186                                                 }
     186      }
    187187#ifdef pdebug
    188188      G4cout<<"G4QNENCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200200#endif
    201201      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    203203    else
    204                                 {
     204    {
    205205#ifdef pdebug
    206206      G4cout<<"G4QNENCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    245245G4double G4QNuENuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
    246246{
    247   //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1.,0.)/GeV;
    248   //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1.,1.)/GeV;
    249   //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2.,1.)/GeV/2.;
     247  //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/GeV;
     248  //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/GeV;
     249  //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2,1)/GeV/2.;
    250250  static const G4double mN=.931494043;// Nucleon mass (inside nucleus, AtomicMassUnit, GeV)
    251251  static const G4double dmN=mN+mN;    // Doubled nucleon mass (2*AtomicMassUnit, GeV)
     
    294294  {
    295295    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    296                                 {
     296    {
    297297      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    298298      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    299           }
    300           else                              // This isotope wasn't calculated previously => CREATE
    301           {
     299   }
     300   else                              // This isotope wasn't calculated previously => CREATE
     301   {
    302302      if(first)
    303303      {
     
    315315      TX.push_back(lastTX);
    316316      QE.push_back(lastQE);
    317            } // End of creation of the new set of parameters
     317    } // End of creation of the new set of parameters
    318318  } // End of parameters udate
    319319  // ============================== NOW Calculate the Cross Section =====================
     
    330330    G4int sep=ran;  // as a result = an index of the left edge of the interval
    331331    while(ran>=2)
    332                                 {
     332    {
    333333      G4int newran=ran/2;
    334334      if(lastE<=lastEN[sep]) sep-=newran;
     
    382382  static const G4int nE=65; // !! If change this, change it in CalculateCrossSection() !!
    383383  static const G4double nuEn[nE]={thresh,
    384 .00051331,.00053602,.00056078,.00058783,.00061743,.00064990,.00068559,.00072492,
    385 .00076834,.00081641,.00086975,.00092912,.00099536,.00106950,.00115273,.00124646,
    386 .00135235,.00147241,.00160901,.00176503,.00194392,.00214986,.00238797,.00266448,
    387 .00298709,.00336531,.00381094,.00433879,.00496745,.00572047,.00662785,.00772806,
    388 .00907075,.01072050,.01276190,.01530660,.01850330,.02255110,.02771990,.03437780,
    389 .04303240,.05438970,.06944210,.08959920,.11688400,.15423600,.20597200,.27851200,
    390 .38153100,.52979600,.74616300,1.0665200,1.5480900,2.2834800,3.4251100,5.2281000,
    391 8.1270200,12.875900,20.808500,34.331200,57.877800,99.796200,176.16300,318.68200};
     384    .00051331,.00053602,.00056078,.00058783,.00061743,.00064990,.00068559,.00072492,
     385    .00076834,.00081641,.00086975,.00092912,.00099536,.00106950,.00115273,.00124646,
     386    .00135235,.00147241,.00160901,.00176503,.00194392,.00214986,.00238797,.00266448,
     387    .00298709,.00336531,.00381094,.00433879,.00496745,.00572047,.00662785,.00772806,
     388    .00907075,.01072050,.01276190,.01530660,.01850330,.02255110,.02771990,.03437780,
     389    .04303240,.05438970,.06944210,.08959920,.11688400,.15423600,.20597200,.27851200,
     390    .38153100,.52979600,.74616300,1.0665200,1.5480900,2.2834800,3.4251100,5.2281000,
     391    8.1270200,12.875900,20.808500,34.331200,57.877800,99.796200,176.16300,318.68200};
    392392  static const G4double TOTX[nE]={0.,
    393 .00047551,.00162896,.00232785,.00292938,.00349456,.00404939,.00460908,.00518455,
    394 .00578488,.00641848,.00709376,.00781964,.00860585,.00946334,.01040460,.01144420,
    395 .01259910,.01388920,.01533830,.01697480,.01883260,.02095280,.02338500,.02618960,
    396 .02944060,.03322870,.03766580,.04289050,.04907540,.06123530,.07521120,.09034730,
    397 .10803800,.12856800,.15277600,.18174900,.21764300,.26083100,.31424900,.37935600,
    398 .45871900,.55375100,.66506600,.79039400,.92276600,1.0489000,1.1500300,1.2071700,
    399 1.2096800,1.1612200,1.0782900,.98251100,.89137400,.81472700,.75500100,.71061200,
    400 .67873900,.65619000,.64098400,.63085100,.62389900,.61664900,.61261000,.60635700};
     393    .00047551,.00162896,.00232785,.00292938,.00349456,.00404939,.00460908,.00518455,
     394    .00578488,.00641848,.00709376,.00781964,.00860585,.00946334,.01040460,.01144420,
     395    .01259910,.01388920,.01533830,.01697480,.01883260,.02095280,.02338500,.02618960,
     396    .02944060,.03322870,.03766580,.04289050,.04907540,.06123530,.07521120,.09034730,
     397    .10803800,.12856800,.15277600,.18174900,.21764300,.26083100,.31424900,.37935600,
     398    .45871900,.55375100,.66506600,.79039400,.92276600,1.0489000,1.1500300,1.2071700,
     399    1.2096800,1.1612200,1.0782900,.98251100,.89137400,.81472700,.75500100,.71061200,
     400    .67873900,.65619000,.64098400,.63085100,.62389900,.61664900,.61261000,.60635700};
    401401  static const G4double QELX[nE]={0.,
    402 2.44084e-7,8.73147e-7,1.30540e-6,1.72196e-6,2.15765e-6,2.63171e-6,3.15996e-6,3.75836e-6,
    403 4.44474e-6,5.24008e-6,6.16982e-6,7.26537e-6,8.56595e-6,1.01211e-5,1.19937e-5,1.42647e-5,
    404 1.70384e-5,2.04506e-5,2.46796e-5,2.99611e-5,3.66090e-5,4.50456e-5,5.58425e-5,6.97817e-5,
    405 8.79417e-5,.000111825,.000143542,.000186093,.000243780,.000350295,.000498489,.000698209,
    406 .000979989,.001378320,.001949710,.002781960,.004027110,.005882030,.008710940,.013041400,
    407 .019739800,.030118300,.046183600,.070818700,.107857000,.161778000,.236873000,.336212000,
    408 .455841000,.565128000,.647837000,.701208000,.729735000,.742062000,.746495000,.748182000,
    409 .749481000,.750637000,.751471000,.752237000,.752763000,.753103000,.753159000,.753315000};
     402  2.44084e-7,8.73147e-7,1.30540e-6,1.72196e-6,2.15765e-6,2.63171e-6,3.15996e-6,3.75836e-6,
     403  4.44474e-6,5.24008e-6,6.16982e-6,7.26537e-6,8.56595e-6,1.01211e-5,1.19937e-5,1.42647e-5,
     404  1.70384e-5,2.04506e-5,2.46796e-5,2.99611e-5,3.66090e-5,4.50456e-5,5.58425e-5,6.97817e-5,
     405  8.79417e-5,.000111825,.000143542,.000186093,.000243780,.000350295,.000498489,.000698209,
     406  .000979989,.001378320,.001949710,.002781960,.004027110,.005882030,.008710940,.013041400,
     407  .019739800,.030118300,.046183600,.070818700,.107857000,.161778000,.236873000,.336212000,
     408  .455841000,.565128000,.647837000,.701208000,.729735000,.742062000,.746495000,.748182000,
     409  .749481000,.750637000,.751471000,.752237000,.752763000,.753103000,.753159000,.753315000};
    410410
    411411  // --------------------------------
    412412  G4int first=0;
    413413  if(z<0.)
    414                 {
     414  {
    415415    first=1;
    416416    z=-z;
     
    431431    t[k]=TOTX[k]*nuEn[k]*(na+na)/ta+QELX[k]*(dn+dn-da)/ta; // TotalCrossSection
    432432    q[k]=QELX[k]*dn/a;                                     // QuasiElasticCrossSection
    433         }
     433  }
    434434  return first;
    435435}
     
    450450  // Reversed table
    451451  static const G4double Xl[nQ2]={1.87905e-10,
    452         .005231,        .010602,        .016192,        .022038,        .028146,        .034513,        .041130,        .047986,        .055071,        .062374,
    453         .069883,        .077587,        .085475,        .093539,        .101766,        .110150,        .118680,        .127348,        .136147,        .145069,
    454         .154107,        .163255,        .172506,        .181855,        .191296,        .200825,        .210435,        .220124,        .229886,        .239718,
    455         .249617,        .259578,        .269598,        .279675,        .289805,        .299986,        .310215,        .320490,        .330808,        .341169,
    456         .351568,        .362006,        .372479,        .382987,        .393527,        .404099,        .414700,        .425330,        .435987,        .446670,
    457         .457379,        .468111,        .478866,        .489643,        .500441,        .511260,        .522097,        .532954,        .543828,        .554720,
    458         .565628,        .576553,        .587492,        .598447,        .609416,        .620398,        .631394,        .642403,        .653424,        .664457,
    459         .675502,        .686557,        .697624,        .708701,        .719788,        .730886,        .741992,        .753108,        .764233,        .775366,
    460         .786508,        .797658,        .808816,        .819982,        .831155,        .842336,        .853524,        .864718,        .875920,        .887128,
    461         .898342,        .909563,        .920790,        .932023,        .943261,        .954506,        .965755,        .977011,        .988271,        .999539};
     452 .005231, .010602, .016192, .022038, .028146, .034513, .041130, .047986, .055071, .062374,
     453 .069883, .077587, .085475, .093539, .101766, .110150, .118680, .127348, .136147, .145069,
     454 .154107, .163255, .172506, .181855, .191296, .200825, .210435, .220124, .229886, .239718,
     455 .249617, .259578, .269598, .279675, .289805, .299986, .310215, .320490, .330808, .341169,
     456 .351568, .362006, .372479, .382987, .393527, .404099, .414700, .425330, .435987, .446670,
     457 .457379, .468111, .478866, .489643, .500441, .511260, .522097, .532954, .543828, .554720,
     458 .565628, .576553, .587492, .598447, .609416, .620398, .631394, .642403, .653424, .664457,
     459 .675502, .686557, .697624, .708701, .719788, .730886, .741992, .753108, .764233, .775366,
     460 .786508, .797658, .808816, .819982, .831155, .842336, .853524, .864718, .875920, .887128,
     461 .898342, .909563, .920790, .932023, .943261, .954506, .965755, .977011, .988271, .999539};
    462462  // Direct table
    463463  static const G4double Xmax=Xl[lQ2];
     
    465465  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    466466  static const G4double inl[nQ2]={0,
    467         1.88843,        3.65455,        5.29282,        6.82878,        8.28390,        9.67403,        11.0109,        12.3034,        13.5583,        14.7811,
    468         15.9760,        17.1466,        18.2958,        19.4260,        20.5392,        21.6372,        22.7215,        23.7933,        24.8538,        25.9039,
    469         26.9446,        27.9766,        29.0006,        30.0171,        31.0268,        32.0301,        33.0274,        34.0192,        35.0058,        35.9876,
    470         36.9649,        37.9379,        38.9069,        39.8721,        40.8337,        41.7920,        42.7471,        43.6992,        44.6484,        45.5950,
    471         46.5390,        47.4805,        48.4197,        49.3567,        50.2916,        51.2245,        52.1554,        53.0846,        54.0120,        54.9377,
    472         55.8617,        56.7843,        57.7054,        58.6250,        59.5433,        60.4603,        61.3761,        62.2906,        63.2040,        64.1162,
    473         65.0274,        65.9375,        66.8467,        67.7548,        68.6621,        69.5684,        70.4738,        71.3784,        72.2822,        73.1852,
    474         74.0875,        74.9889,        75.8897,        76.7898,        77.6892,        78.5879,        79.4860,        80.3835,        81.2804,        82.1767,
    475         83.0724,        83.9676,        84.8622,        85.7563,        86.6499,        87.5430,        88.4356,        89.3277,        90.2194,        91.1106,
    476         92.0013,        92.8917,        93.7816,        94.6711,        95.5602,        96.4489,        97.3372,        98.2252,        99.1128,        100.000};
     467 1.88843, 3.65455, 5.29282, 6.82878, 8.28390, 9.67403, 11.0109, 12.3034, 13.5583, 14.7811,
     468 15.9760, 17.1466, 18.2958, 19.4260, 20.5392, 21.6372, 22.7215, 23.7933, 24.8538, 25.9039,
     469 26.9446, 27.9766, 29.0006, 30.0171, 31.0268, 32.0301, 33.0274, 34.0192, 35.0058, 35.9876,
     470 36.9649, 37.9379, 38.9069, 39.8721, 40.8337, 41.7920, 42.7471, 43.6992, 44.6484, 45.5950,
     471 46.5390, 47.4805, 48.4197, 49.3567, 50.2916, 51.2245, 52.1554, 53.0846, 54.0120, 54.9377,
     472 55.8617, 56.7843, 57.7054, 58.6250, 59.5433, 60.4603, 61.3761, 62.2906, 63.2040, 64.1162,
     473 65.0274, 65.9375, 66.8467, 67.7548, 68.6621, 69.5684, 70.4738, 71.3784, 72.2822, 73.1852,
     474 74.0875, 74.9889, 75.8897, 76.7898, 77.6892, 78.5879, 79.4860, 80.3835, 81.2804, 82.1767,
     475 83.0724, 83.9676, 84.8622, 85.7563, 86.6499, 87.5430, 88.4356, 89.3277, 90.2194, 91.1106,
     476 92.0013, 92.8917, 93.7816, 94.6711, 95.5602, 96.4489, 97.3372, 98.2252, 99.1128, 100.000};
    477477  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    478478  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    541541  // Reversed table
    542542  static const G4double X0[nX]={6.14081e-05,
    543         .413394,        .644455,        .843199,        1.02623,        1.20032,        1.36916,        1.53516,        1.70008,        1.86539,        2.03244,
    544         2.20256,        2.37723,        2.55818,        2.74762,        2.94857,        3.16550,        3.40582,        3.68379,        4.03589,        4.77419};
     543 .413394, .644455, .843199, 1.02623, 1.20032, 1.36916, 1.53516, 1.70008, 1.86539, 2.03244,
     544 2.20256, 2.37723, 2.55818, 2.74762, 2.94857, 3.16550, 3.40582, 3.68379, 4.03589, 4.77419};
    545545  static const G4double X1[nX]={.00125268,
    546         .861178,        1.34230,        1.75605,        2.13704,        2.49936,        2.85072,        3.19611,        3.53921,        3.88308,        4.23049,
    547         4.58423,        4.94735,        5.32342,        5.71700,        6.13428,        6.58447,        7.08267,        7.65782,        8.38299,        9.77330};
     546 .861178, 1.34230, 1.75605, 2.13704, 2.49936, 2.85072, 3.19611, 3.53921, 3.88308, 4.23049,
     547 4.58423, 4.94735, 5.32342, 5.71700, 6.13428, 6.58447, 7.08267, 7.65782, 8.38299, 9.77330};
    548548  static const G4double X2[nX]={.015694,
    549         1.97690,        3.07976,        4.02770,        4.90021,        5.72963,        6.53363,        7.32363,        8.10805,        8.89384,        9.68728,
    550         10.4947,        11.3228,        12.1797,        13.0753,        14.0234,        15.0439,        16.1692,        17.4599,        19.0626,        21.7276};
     549 1.97690, 3.07976, 4.02770, 4.90021, 5.72963, 6.53363, 7.32363, 8.10805, 8.89384, 9.68728,
     550 10.4947, 11.3228, 12.1797, 13.0753, 14.0234, 15.0439, 16.1692, 17.4599, 19.0626, 21.7276};
    551551  static const G4double X3[nX]={.0866877,
    552         4.03498,        6.27651,        8.20056,        9.96931,        11.6487,        13.2747,        14.8704,        16.4526,        18.0351,        19.6302,
    553         21.2501,        22.9075,        24.6174,        26.3979,        28.2730,        30.2770,        32.4631,        34.9243,        37.8590,        41.9115};
     552 4.03498, 6.27651, 8.20056, 9.96931, 11.6487, 13.2747, 14.8704, 16.4526, 18.0351, 19.6302,
     553 21.2501, 22.9075, 24.6174, 26.3979, 28.2730, 30.2770, 32.4631, 34.9243, 37.8590, 41.9115};
    554554  static const G4double X4[nX]={.160483,
    555         5.73111,        8.88884,        11.5893,        14.0636,        16.4054,        18.6651,        20.8749,        23.0578,        25.2318,        27.4127,
    556         29.6152,        31.8540,        34.1452,        36.5074,        38.9635,        41.5435,        44.2892,        47.2638,        50.5732,        54.4265};
     555 5.73111, 8.88884, 11.5893, 14.0636, 16.4054, 18.6651, 20.8749, 23.0578, 25.2318, 27.4127,
     556 29.6152, 31.8540, 34.1452, 36.5074, 38.9635, 41.5435, 44.2892, 47.2638, 50.5732, 54.4265};
    557557  static const G4double X5[nX]={.0999307,
    558         5.25720,        8.11389,        10.5375,        12.7425,        14.8152,        16.8015,        18.7296,        20.6194,        22.4855,        24.3398,
    559         26.1924,        28.0527,        29.9295,        31.8320,        33.7699,        35.7541,        37.7975,        39.9158,        42.1290,        44.4649};
     558 5.25720, 8.11389, 10.5375, 12.7425, 14.8152, 16.8015, 18.7296, 20.6194, 22.4855, 24.3398,
     559 26.1924, 28.0527, 29.9295, 31.8320, 33.7699, 35.7541, 37.7975, 39.9158, 42.1290, 44.4649};
    560560  static const G4double X6[nX]={.0276367,
    561         3.53378,        5.41553,        6.99413,        8.41629,        9.74057,        10.9978,        12.2066,        13.3796,        14.5257,        15.6519,
    562         16.7636,        17.8651,        18.9603,        20.0527,        21.1453,        22.2411,        23.3430,        24.4538,        25.5765,        26.7148};
     561 3.53378, 5.41553, 6.99413, 8.41629, 9.74057, 10.9978, 12.2066, 13.3796, 14.5257, 15.6519,
     562 16.7636, 17.8651, 18.9603, 20.0527, 21.1453, 22.2411, 23.3430, 24.4538, 25.5765, 26.7148};
    563563  static const G4double X7[nX]={.00472383,
    564         2.08253,        3.16946,        4.07178,        4.87742,        5.62140,        6.32202,        6.99034,        7.63368,        8.25720,        8.86473,
    565         9.45921,        10.0430,        10.6179,        11.1856,        11.7475,        12.3046,        12.8581,        13.4089,        13.9577,        14.5057};
     564 2.08253, 3.16946, 4.07178, 4.87742, 5.62140, 6.32202, 6.99034, 7.63368, 8.25720, 8.86473,
     565 9.45921, 10.0430, 10.6179, 11.1856, 11.7475, 12.3046, 12.8581, 13.4089, 13.9577, 14.5057};
    566566  static const G4double X8[nX]={.000630783,
    567         1.22723,        1.85845,        2.37862,        2.84022,        3.26412,        3.66122,        4.03811,        4.39910,        4.74725,        5.08480,
    568         5.41346,        5.73457,        6.04921,        6.35828,        6.66250,        6.96250,        7.25884,        7.55197,        7.84232,        8.13037};
     567 1.22723, 1.85845, 2.37862, 2.84022, 3.26412, 3.66122, 4.03811, 4.39910, 4.74725, 5.08480,
     568 5.41346, 5.73457, 6.04921, 6.35828, 6.66250, 6.96250, 7.25884, 7.55197, 7.84232, 8.13037};
    569569  static const G4double X9[nX]={7.49179e-05,
    570         .772574,        1.16623,        1.48914,        1.77460,        2.03586,        2.27983,        2.51069,        2.73118,        2.94322,        3.14823,
    571         3.34728,        3.54123,        3.73075,        3.91638,        4.09860,        4.27779,        4.45428,        4.62835,        4.80025,        4.97028};
     570 .772574, 1.16623, 1.48914, 1.77460, 2.03586, 2.27983, 2.51069, 2.73118, 2.94322, 3.14823,
     571 3.34728, 3.54123, 3.73075, 3.91638, 4.09860, 4.27779, 4.45428, 4.62835, 4.80025, 4.97028};
    572572  static const G4double XA[nX]={8.43437e-06,
    573         .530035,        .798454,        1.01797,        1.21156,        1.38836,        1.55313,        1.70876,        1.85712,        1.99956,        2.13704,
    574         2.27031,        2.39994,        2.52640,        2.65007,        2.77127,        2.89026,        3.00726,        3.12248,        3.23607, 3.34823};
     573 .530035, .798454, 1.01797, 1.21156, 1.38836, 1.55313, 1.70876, 1.85712, 1.99956, 2.13704,
     574 2.27031, 2.39994, 2.52640, 2.65007, 2.77127, 2.89026, 3.00726, 3.12248, 3.23607, 3.34823};
    575575  static const G4double XB[nX]={9.27028e-07,
    576         .395058,        .594211,        .756726,        .899794,        1.03025,        1.15167,        1.26619,        1.37523,        1.47979,        1.58059,
    577         1.67819,        1.77302,        1.86543,        1.95571,        2.04408,        2.13074,        2.21587,        2.29960,        2.38206, 2.46341};
     576 .395058, .594211, .756726, .899794, 1.03025, 1.15167, 1.26619, 1.37523, 1.47979, 1.58059,
     577 1.67819, 1.77302, 1.86543, 1.95571, 2.04408, 2.13074, 2.21587, 2.29960, 2.38206, 2.46341};
    578578  static const G4double XC[nX]={1.00807e-07,
    579         .316195,        .474948,        .604251,        .717911,        .821417,        .917635,        1.00829,        1.09452,        1.17712,        1.25668,
    580         1.33364,        1.40835,        1.48108,        1.55207,        1.62150,        1.68954,        1.75631,        1.82193,        1.88650, 1.95014};
     579 .316195, .474948, .604251, .717911, .821417, .917635, 1.00829, 1.09452, 1.17712, 1.25668,
     580 1.33364, 1.40835, 1.48108, 1.55207, 1.62150, 1.68954, 1.75631, 1.82193, 1.88650, 1.95014};
    581581  static const G4double XD[nX]={1.09102e-08,
    582         .268227,        .402318,        .511324,        .606997,        .694011,        .774803,        .850843,        .923097,        .992243,        1.05878,
    583         1.12309,        1.18546,        1.24613,        1.30530,        1.36313,        1.41974,        1.47526,        1.52978,        1.58338,        1.63617};
     582 .268227, .402318, .511324, .606997, .694011, .774803, .850843, .923097, .992243, 1.05878,
     583 1.12309, 1.18546, 1.24613, 1.30530, 1.36313, 1.41974, 1.47526, 1.52978, 1.58338, 1.63617};
    584584  static const G4double XE[nX]={1.17831e-09,
    585         .238351,        .356890,        .453036,        .537277,        .613780,        .684719,        .751405,        .814699,        .875208,        .933374,
    586         .989535,        1.04396,        1.09685,        1.14838,        1.19870,        1.24792,        1.29615,        1.34347,        1.38996, 1.43571};
     585 .238351, .356890, .453036, .537277, .613780, .684719, .751405, .814699, .875208, .933374,
     586 .989535, 1.04396, 1.09685, 1.14838, 1.19870, 1.24792, 1.29615, 1.34347, 1.38996, 1.43571};
    587587  static const G4double XF[nX]={1.27141e-10,
    588         .219778,        .328346,        .416158,        .492931,        .562525,        .626955,        .687434,        .744761,        .799494,        .852046,
    589         .902729,        .951786,        .999414,        1.04577,        1.09099,        1.13518,        1.17844,        1.22084,        1.26246,        1.30338};
     588 .219778, .328346, .416158, .492931, .562525, .626955, .687434, .744761, .799494, .852046,
     589 .902729, .951786, .999414, 1.04577, 1.09099, 1.13518, 1.17844, 1.22084, 1.26246, 1.30338};
    590590  static const G4double XG[nX]={1.3713e-11,
    591         .208748,        .310948,        .393310,        .465121,        .530069,        .590078,        .646306,        .699515,        .750239,        .798870,
    592         .845707,        .890982,        .934882,        .977559,        1.01914,        1.05973,        1.09941,        1.13827,        1.17637, 1.21379};
     591 .208748, .310948, .393310, .465121, .530069, .590078, .646306, .699515, .750239, .798870,
     592 .845707, .890982, .934882, .977559, 1.01914, 1.05973, 1.09941, 1.13827, 1.17637, 1.21379};
    593593  static const G4double XH[nX]={1.47877e-12,
    594         .203089,        .301345,        .380162,        .448646,        .510409,        .567335,        .620557,        .670820,        .718647,        .764421,
    595         .808434,        .850914,        .892042,        .931967,        .970812,        1.00868,        1.04566,        1.08182,        1.11724, 1.15197};
     594 .203089, .301345, .380162, .448646, .510409, .567335, .620557, .670820, .718647, .764421,
     595 .808434, .850914, .892042, .931967, .970812, 1.00868, 1.04566, 1.08182, 1.11724, 1.15197};
    596596  static const G4double XI[nX]={1.59454e-13,
    597         .201466,        .297453,        .374007,        .440245,        .499779,        .554489,        .605506,        .653573,        .699213,        .742806,
    598         .784643,        .824952,        .863912,        .901672,        .938353,        .974060,        1.00888,        1.04288,        1.07614,        1.10872};
     597 .201466, .297453, .374007, .440245, .499779, .554489, .605506, .653573, .699213, .742806,
     598 .784643, .824952, .863912, .901672, .938353, .974060, 1.00888, 1.04288, 1.07614, 1.10872};
    599599  static const G4double XJ[nX]={1.71931e-14,
    600         .202988,        .297870,        .373025,        .437731,        .495658,        .548713,        .598041,        .644395,        .688302,        .730147,
    601         .770224,        .808762,        .845943,        .881916,        .916805,        .950713,        .983728,        1.01592,        1.04737, 1.07813};
     600 .202988, .297870, .373025, .437731, .495658, .548713, .598041, .644395, .688302, .730147,
     601 .770224, .808762, .845943, .881916, .916805, .950713, .983728, 1.01592, 1.04737, 1.07813};
    602602  // Direct table
    603603  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    612612                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    613613  static const G4double I0[nX]={0,
    614         .411893,        1.25559,        2.34836,        3.60264,        4.96046,        6.37874,        7.82342,        9.26643,        10.6840,        12.0555,
    615         13.3628,        14.5898,        15.7219,        16.7458,        17.6495,        18.4217,        19.0523,        19.5314,        19.8501, 20.0000};
     614 .411893, 1.25559, 2.34836, 3.60264, 4.96046, 6.37874, 7.82342, 9.26643, 10.6840, 12.0555,
     615 13.3628, 14.5898, 15.7219, 16.7458, 17.6495, 18.4217, 19.0523, 19.5314, 19.8501, 20.0000};
    616616  static const G4double I1[nX]={0,
    617         .401573,        1.22364,        2.28998,        3.51592,        4.84533,        6.23651,        7.65645,        9.07796,        10.4780,        11.8365,
    618         13.1360,        14.3608,        15.4967,        16.5309,        17.4516,        18.2481,        18.9102,        19.4286,        19.7946, 20.0000};
     617 .401573, 1.22364, 2.28998, 3.51592, 4.84533, 6.23651, 7.65645, 9.07796, 10.4780, 11.8365,
     618 13.1360, 14.3608, 15.4967, 16.5309, 17.4516, 18.2481, 18.9102, 19.4286, 19.7946, 20.0000};
    619619  static const G4double I2[nX]={0,
    620         .387599,        1.17339,        2.19424,        3.37090,        4.65066,        5.99429,        7.37071,        8.75427,        10.1232,        11.4586,
    621         12.7440,        13.9644,        15.1065,        16.1582,        17.1083,        17.9465,        18.6634,        19.2501,        19.6982, 20.0000};
     620 .387599, 1.17339, 2.19424, 3.37090, 4.65066, 5.99429, 7.37071, 8.75427, 10.1232, 11.4586,
     621 12.7440, 13.9644, 15.1065, 16.1582, 17.1083, 17.9465, 18.6634, 19.2501, 19.6982, 20.0000};
    622622  static const G4double I3[nX]={0,
    623         .366444,        1.09391,        2.04109,        3.13769,        4.33668,        5.60291,        6.90843,        8.23014,        9.54840,        10.8461,
    624         12.1083,        13.3216,        14.4737,        15.5536,        16.5512,        17.4573,        18.2630,        18.9603,        19.5417, 20.0000};
     623 .366444, 1.09391, 2.04109, 3.13769, 4.33668, 5.60291, 6.90843, 8.23014, 9.54840, 10.8461,
     624 12.1083, 13.3216, 14.4737, 15.5536, 16.5512, 17.4573, 18.2630, 18.9603, 19.5417, 20.0000};
    625625  static const G4double I4[nX]={0,
    626         .321962,        .959681,        1.79769,        2.77753,        3.85979,        5.01487,        6.21916,        7.45307,        8.69991,        9.94515,
    627         11.1759,        12.3808,        13.5493,        14.6720,        15.7402,        16.7458,        17.6813,        18.5398,        19.3148, 20.0000};
     626 .321962, .959681, 1.79769, 2.77753, 3.85979, 5.01487, 6.21916, 7.45307, 8.69991, 9.94515,
     627 11.1759, 12.3808, 13.5493, 14.6720, 15.7402, 16.7458, 17.6813, 18.5398, 19.3148, 20.0000};
    628628  static const G4double I5[nX]={0,
    629         .257215,        .786302,        1.49611,        2.34049,        3.28823,        4.31581,        5.40439,        6.53832,        7.70422,        8.89040,
    630         10.0865,        11.2833,        12.4723,        13.6459,        14.7969,        15.9189,        17.0058,        18.0517,        19.0515, 20.0000};
     629 .257215, .786302, 1.49611, 2.34049, 3.28823, 4.31581, 5.40439, 6.53832, 7.70422, 8.89040,
     630 10.0865, 11.2833, 12.4723, 13.6459, 14.7969, 15.9189, 17.0058, 18.0517, 19.0515, 20.0000};
    631631  static const G4double I6[nX]={0,
    632         .201608,        .638914,        1.24035,        1.97000,        2.80354,        3.72260,        4.71247,        5.76086,        6.85724,        7.99243,
    633         9.15826,        10.3474,        11.5532,        12.7695,        13.9907,        15.2117,        16.4275,        17.6337,        18.8258, 20.0000};
     632 .201608, .638914, 1.24035, 1.97000, 2.80354, 3.72260, 4.71247, 5.76086, 6.85724, 7.99243,
     633 9.15826, 10.3474, 11.5532, 12.7695, 13.9907, 15.2117, 16.4275, 17.6337, 18.8258, 20.0000};
    634634  static const G4double I7[nX]={0,
    635         .168110,        .547208,        1.07889,        1.73403,        2.49292,        3.34065,        4.26525,        5.25674,        6.30654,        7.40717,
    636         8.55196,        9.73492,        10.9506,        12.1940,        13.4606,        14.7460,        16.0462,        17.3576,        18.6767, 20.0000};
     635 .168110, .547208, 1.07889, 1.73403, 2.49292, 3.34065, 4.26525, 5.25674, 6.30654, 7.40717,
     636 8.55196, 9.73492, 10.9506, 12.1940, 13.4606, 14.7460, 16.0462, 17.3576, 18.6767, 20.0000};
    637637  static const G4double I8[nX]={0,
    638         .150652,        .497557,        .990048,        1.60296,        2.31924,        3.12602,        4.01295,        4.97139,        5.99395,        7.07415,
    639         8.20621,        9.38495,        10.6057,        11.8641,        13.1561,        14.4781,        15.8267,        17.1985,        18.5906, 20.0000};
     638 .150652, .497557, .990048, 1.60296, 2.31924, 3.12602, 4.01295, 4.97139, 5.99395, 7.07415,
     639 8.20621, 9.38495, 10.6057, 11.8641, 13.1561, 14.4781, 15.8267, 17.1985, 18.5906, 20.0000};
    640640  static const G4double I9[nX]={0,
    641         .141449,        .470633,        .941304,        1.53053,        2.22280,        3.00639,        3.87189,        4.81146,        5.81837,        6.88672,
    642         8.01128,        9.18734,        10.4106,        11.6772,        12.9835,        14.3261,        15.7019,        17.1080,        18.5415, 20.0000};
     641 .141449, .470633, .941304, 1.53053, 2.22280, 3.00639, 3.87189, 4.81146, 5.81837, 6.88672,
     642 8.01128, 9.18734, 10.4106, 11.6772, 12.9835, 14.3261, 15.7019, 17.1080, 18.5415, 20.0000};
    643643  static const G4double IA[nX]={0,
    644         .136048,        .454593,        .912075,        1.48693,        2.16457,        2.93400,        3.78639,        4.71437,        5.71163,        6.77265,
    645         7.89252,        9.06683,        10.2916,        11.5631,        12.8780,        14.2331,        .625500,        17.0525,        18.5115, 20.0000};
     644 .136048, .454593, .912075, 1.48693, 2.16457, 2.93400, 3.78639, 4.71437, 5.71163, 6.77265,
     645 7.89252, 9.06683, 10.2916, 11.5631, 12.8780, 14.2331, .625500, 17.0525, 18.5115, 20.0000};
    646646  static const G4double IB[nX]={0,
    647         .132316,        .443455,        .891741,        1.45656,        2.12399,        2.88352,        3.72674,        4.64660,        5.63711,        6.69298,
    648         7.80955,        8.98262,        10.2084,        11.4833,        12.8042,        14.1681,        15.5721,        17.0137,        18.4905, 20.0000};
     647 .132316, .443455, .891741, 1.45656, 2.12399, 2.88352, 3.72674, 4.64660, 5.63711, 6.69298,
     648 7.80955, 8.98262, 10.2084, 11.4833, 12.8042, 14.1681, 15.5721, 17.0137, 18.4905, 20.0000};
    649649  static const G4double IC[nX]={0,
    650         .129197,        .434161,        .874795,        1.43128,        2.09024,        2.84158,        3.67721,        4.59038,        5.57531,        6.62696,
    651         7.74084,        8.91291,        10.1395,        11.4173,        12.7432,        14.1143,        15.5280,        16.9817,        18.4731, 20.0000};
     650 .129197, .434161, .874795, 1.43128, 2.09024, 2.84158, 3.67721, 4.59038, 5.57531, 6.62696,
     651 7.74084, 8.91291, 10.1395, 11.4173, 12.7432, 14.1143, 15.5280, 16.9817, 18.4731, 20.0000};
    652652  static const G4double ID[nX]={0,
    653         .126079,        .424911,        .857980,        1.40626,        2.05689,        2.80020,        3.62840,        4.53504,        5.51456,        6.56212,
    654         7.67342,        8.84458,        10.0721,        11.3527,        12.6836,        14.0618,        15.4849,        16.9504,        18.4562, 20.0000};
     653 .126079, .424911, .857980, 1.40626, 2.05689, 2.80020, 3.62840, 4.53504, 5.51456, 6.56212,
     654 7.67342, 8.84458, 10.0721, 11.3527, 12.6836, 14.0618, 15.4849, 16.9504, 18.4562, 20.0000};
    655655  static const G4double IE[nX]={0,
    656         .122530,        .414424,        .838964,        1.37801,        2.01931,        2.75363,        3.57356,        4.47293,        5.44644,        6.48949,
    657         7.59795,        8.76815,        9.99673,        11.2806,        12.6170,        14.0032,        15.4369,        16.9156,        18.4374, 20.0000};
     656 .122530, .414424, .838964, 1.37801, 2.01931, 2.75363, 3.57356, 4.47293, 5.44644, 6.48949,
     657 7.59795, 8.76815, 9.99673, 11.2806, 12.6170, 14.0032, 15.4369, 16.9156, 18.4374, 20.0000};
    658658  static const G4double IF[nX]={0,
    659         .118199,        .401651,        .815838,        1.34370,        1.97370,        2.69716,        3.50710,        4.39771,        5.36401,        6.40164,
    660         7.50673,        8.67581,        9.90572,        11.1936,        12.5367,        13.9326,        15.3790,        16.8737,        18.4146, 20.0000};
     659 .118199, .401651, .815838, 1.34370, 1.97370, 2.69716, 3.50710, 4.39771, 5.36401, 6.40164,
     660 7.50673, 8.67581, 9.90572, 11.1936, 12.5367, 13.9326, 15.3790, 16.8737, 18.4146, 20.0000};
    661661  static const G4double IG[nX]={0,
    662         .112809,        .385761,        .787075,        1.30103,        1.91700,        2.62697,        3.42451,        4.30424,        5.26158,        6.29249,
    663         7.39341,        8.56112,        9.79269,        11.0855,        12.4369,        13.8449,        15.3071,        16.8216,        18.3865, 20.0000};
     662 .112809, .385761, .787075, 1.30103, 1.91700, 2.62697, 3.42451, 4.30424, 5.26158, 6.29249,
     663 7.39341, 8.56112, 9.79269, 11.0855, 12.4369, 13.8449, 15.3071, 16.8216, 18.3865, 20.0000};
    664664  static const G4double IH[nX]={0,
    665         .106206,        .366267,        .751753,        1.24859,        1.84728,        2.54062,        3.32285,        .189160,        5.13543,        6.15804,
    666         7.25377,        8.41975,        9.65334,        10.9521,        12.3139,        13.7367,        15.2184,        16.7573,        18.3517, 20.0000};
     665 .106206, .366267, .751753, 1.24859, 1.84728, 2.54062, 3.32285, .189160, 5.13543, 6.15804,
     666 7.25377, 8.41975, 9.65334, 10.9521, 12.3139, 13.7367, 15.2184, 16.7573, 18.3517, 20.0000};
    667667  static const G4double II[nX]={0,
    668         .098419,        .343194,        .709850,        1.18628,        1.76430,        2.43772,        3.20159,        4.05176,        4.98467,        5.99722,
    669         7.08663,        8.25043,        9.48633,        10.7923,        12.1663,        13.6067,        15.1118,        16.6800,        18.3099,        20.0000};
     668 .098419, .343194, .709850, 1.18628, 1.76430, 2.43772, 3.20159, 4.05176, 4.98467, 5.99722,
     669 7.08663, 8.25043, 9.48633, 10.7923, 12.1663, 13.6067, 15.1118, 16.6800, 18.3099, 20.0000};
    670670  static const G4double IJ[nX]={0,
    671         .089681,        .317135,        .662319,        1.11536,        1.66960,        2.32002,        3.06260,        3.89397,        4.81126,        5.81196,
    672         6.89382,        8.05483,        9.29317,        10.6072,        11.9952,        13.4560,        14.9881,        16.5902,        18.2612, 20.0000};
     671 .089681, .317135, .662319, 1.11536, 1.66960, 2.32002, 3.06260, 3.89397, 4.81126, 5.81196,
     672 6.89382, 8.05483, 9.29317, 10.6072, 11.9952, 13.4560, 14.9881, 16.5902, 18.2612, 20.0000};
    673673  static const G4double* Il[nE]=
    674674                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    675675  static const G4double lE[nE]={
    676 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    677  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     676-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     677 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    678678  static const G4double lEmi=lE[0];
    679679  static const G4double lEma=lE[nE-1];
    680680  static const G4double dlE=(lEma-lEmi)/bE;
    681         //***************************************************************************************
     681  //***************************************************************************************
    682682  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    683683  G4double lEn=std::log(Enu);         // log(E) for interpolation
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QNuMuNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuMuNuclearCrossSection.cc,v 1.12 2007/11/01 16:09:38 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuMuNuclearCrossSection.cc,v 1.14 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // G4 Physics class: G4QNuMuNuclearCrossSection for gamma+A cross sections
     31// G4 Physics class: G4QNuMuNuclearCrossSection for (nu,mu-)A cross sections
    3232// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
    4040
    4141//#define debug
     
    9090        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9191        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     92  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9393#endif
    9494  if(pPDG!=14)
     
    111111    j  = 0;                            // A#0f records found in DB for this projectile
    112112    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     113    {                                  // The nucleus with projPDG is found in AMDB
    114114      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     115      {
    116116        lastI=i;
    117117        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163163#endif
    164164      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    168168#ifdef pdebug
    169169      G4cout<<"G4QNMNCS::GetCrSec: CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    172172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173173      if(lastCS<=0.)
    174                                                 {
     174      {
    175175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176176#ifdef pdebug
     
    184184          lastTH=pEn;
    185185        }
    186                                                 }
     186      }
    187187#ifdef pdebug
    188188      G4cout<<"G4QNMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200200#endif
    201201      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    203203    else
    204                                 {
     204    {
    205205#ifdef pdebug
    206206      G4cout<<"G4QNMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    245245G4double G4QNuMuNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
    246246{
    247   //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1.,0.)/GeV;
    248   //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1.,1.)/GeV;
    249   //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2.,1.)/GeV/2.;
     247  //static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/GeV;
     248  //static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/GeV;
     249  //static const G4double mDeut = G4NucleiProperties::GetNuclearMass(2,1)/GeV/2.;
    250250  static const G4double mN=.931494043;// Nucleon mass (inside nucleus, AtomicMassUnit, GeV)
    251251  static const G4double dmN=mN+mN;    // Doubled nucleon mass (2*AtomicMassUnit, GeV)
     
    294294  {
    295295    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    296                                 {
     296    {
    297297      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    298298      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    299           }
    300           else                              // This isotope wasn't calculated previously => CREATE
    301           {
     299   }
     300   else                              // This isotope wasn't calculated previously => CREATE
     301   {
    302302      if(first)
    303303      {
     
    315315      TX.push_back(lastTX);
    316316      QE.push_back(lastQE);
    317            } // End of creation of the new set of parameters
     317    } // End of creation of the new set of parameters
    318318  } // End of parameters udate
    319319  // ============================== NOW Calculate the Cross Section =====================
     
    330330    G4int sep=ran;  // as a result = an index of the left edge of the interval
    331331    while(ran>=2)
    332                                 {
     332    {
    333333      G4int newran=ran/2;
    334334      if(lastE<=lastEN[sep]) sep-=newran;
     
    382382  static const G4int nE=65; // !! If change this, change it in GetCrossSection() (*.cc) !!
    383383  static const G4double nuEn[nE]={thresh,
    384 .112039,.116079,.120416,.125076,.130090,.135494,.141324,.147626,.154445,.161838,
    385 .169864,.178594,.188105,.198485,.209836,.222272,.235923,.250941,.267497,.285789,
    386 .306045,.328530,.353552,.381466,.412689,.447710,.487101,.531538,.581820,.638893,
    387 .703886,.778147,.863293,.961275,1.07445,1.20567,1.35843,1.53701,1.74667,1.99390,
    388 2.28679,2.63542,3.05245,3.55386,4.15990,4.89644,5.79665,6.90336,8.27224,9.97606,
    389 12.1106,14.8029,18.2223,22.5968,28.2351,35.5587,45.1481,57.8086,74.6682,97.3201,
    390 128.036,170.085,228.220,309.420};
     384    .112039,.116079,.120416,.125076,.130090,.135494,.141324,.147626,.154445,.161838,
     385    .169864,.178594,.188105,.198485,.209836,.222272,.235923,.250941,.267497,.285789,
     386    .306045,.328530,.353552,.381466,.412689,.447710,.487101,.531538,.581820,.638893,
     387    .703886,.778147,.863293,.961275,1.07445,1.20567,1.35843,1.53701,1.74667,1.99390,
     388    2.28679,2.63542,3.05245,3.55386,4.15990,4.89644,5.79665,6.90336,8.27224,9.97606,
     389    12.1106,14.8029,18.2223,22.5968,28.2351,35.5587,45.1481,57.8086,74.6682,97.3201,
     390    128.036,170.085,228.220,309.420};
    391391  static const G4double TOTX[nE]={0.,
    392 .108618,.352160,.476083,.566575,.639014,.699871,.752634,.799407,.841524,.879844,
    393 .914908,.947050,.976456,1.00321,1.02734,1.04881,1.06755,1.08349,1.09653,1.10657,
    394 1.11355,1.11739,1.11806,1.11556,1.10992,1.10124,1.08964,1.07532,1.05851,1.03950,
    395 1.01859,.996169,.972593,.948454,.923773,.899081,.874713,.850965,.828082,.806265,
    396 .785659,.766367,.748450,.731936,.716824,.703098,.690723,.679652,.669829,.661187,
    397 .653306,.646682,.640986,.636125,.631993,.628479,.625458,.622800,.620364,.616231,
    398 .614986,.612563,.609807,.606511};
    399 
     392    .108618,.352160,.476083,.566575,.639014,.699871,.752634,.799407,.841524,.879844,
     393    .914908,.947050,.976456,1.00321,1.02734,1.04881,1.06755,1.08349,1.09653,1.10657,
     394    1.11355,1.11739,1.11806,1.11556,1.10992,1.10124,1.08964,1.07532,1.05851,1.03950,
     395    1.01859,.996169,.972593,.948454,.923773,.899081,.874713,.850965,.828082,.806265,
     396    .785659,.766367,.748450,.731936,.716824,.703098,.690723,.679652,.669829,.661187,
     397    .653306,.646682,.640986,.636125,.631993,.628479,.625458,.622800,.620364,.616231,
     398    .614986,.612563,.609807,.606511};
    400399  static const G4double QELX[nE]={0.,
    401 .012170,.040879,.057328,.070865,.083129,.094828,.106366,.118013,.129970,.142392,
    402 .155410,.169138,.183676,.199123,.215573,.233120,.251860,.271891,.293317,.316246,
    403 .340796,.367096,.395292,.425547,.458036,.491832,.524989,.556457,.585692,.612377,
    404 .636544,.657790,.676260,.692007,.705323,.716105,.724694,.731347,.736340,.740172,
    405 .742783,.744584,.745804,.746829,.747479,.747995,.748436,.749047,.749497,.749925,
    406 .750486,.750902,.751268,.751566,.752026,.752266,.752428,.752761,.752873,.753094,
    407 .753161,.753164,.753340,.753321};
     400    .012170,.040879,.057328,.070865,.083129,.094828,.106366,.118013,.129970,.142392,
     401    .155410,.169138,.183676,.199123,.215573,.233120,.251860,.271891,.293317,.316246,
     402    .340796,.367096,.395292,.425547,.458036,.491832,.524989,.556457,.585692,.612377,
     403    .636544,.657790,.676260,.692007,.705323,.716105,.724694,.731347,.736340,.740172,
     404    .742783,.744584,.745804,.746829,.747479,.747995,.748436,.749047,.749497,.749925,
     405    .750486,.750902,.751268,.751566,.752026,.752266,.752428,.752761,.752873,.753094,
     406    .753161,.753164,.753340,.753321};
    408407  // --------------------------------
    409408  G4int first=0;
    410409  if(z<0.)
    411                 {
     410  {
    412411    first=1;
    413412    z=-z;
     
    428427    t[k]=TOTX[k]*nuEn[k]*(na+na)/ta+QELX[k]*(dn+dn-da)/ta; // TotalCrossSection
    429428    q[k]=QELX[k]*dn/a;                                     // QuasiElasticCrossSection
    430         }
     429  }
    431430  return first;
    432431}
     
    447446  // Reversed table
    448447  static const G4double Xl[nQ2]={1.87905e-10,
    449         .005231,        .010602,        .016192,        .022038,        .028146,        .034513,        .041130,        .047986,        .055071,        .062374,
    450         .069883,        .077587,        .085475,        .093539,        .101766,        .110150,        .118680,        .127348,        .136147,        .145069,
    451         .154107,        .163255,        .172506,        .181855,        .191296,        .200825,        .210435,        .220124,        .229886,        .239718,
    452         .249617,        .259578,        .269598,        .279675,        .289805,        .299986,        .310215,        .320490,        .330808,        .341169,
    453         .351568,        .362006,        .372479,        .382987,        .393527,        .404099,        .414700,        .425330,        .435987,        .446670,
    454         .457379,        .468111,        .478866,        .489643,        .500441,        .511260,        .522097,        .532954,        .543828,        .554720,
    455         .565628,        .576553,        .587492,        .598447,        .609416,        .620398,        .631394,        .642403,        .653424,        .664457,
    456         .675502,        .686557,        .697624,        .708701,        .719788,        .730886,        .741992,        .753108,        .764233,        .775366,
    457         .786508,        .797658,        .808816,        .819982,        .831155,        .842336,        .853524,        .864718,        .875920,        .887128,
    458         .898342,        .909563,        .920790,        .932023,        .943261,        .954506,        .965755,        .977011,        .988271,        .999539};
     448 .005231, .010602, .016192, .022038, .028146, .034513, .041130, .047986, .055071, .062374,
     449 .069883, .077587, .085475, .093539, .101766, .110150, .118680, .127348, .136147, .145069,
     450 .154107, .163255, .172506, .181855, .191296, .200825, .210435, .220124, .229886, .239718,
     451 .249617, .259578, .269598, .279675, .289805, .299986, .310215, .320490, .330808, .341169,
     452 .351568, .362006, .372479, .382987, .393527, .404099, .414700, .425330, .435987, .446670,
     453 .457379, .468111, .478866, .489643, .500441, .511260, .522097, .532954, .543828, .554720,
     454 .565628, .576553, .587492, .598447, .609416, .620398, .631394, .642403, .653424, .664457,
     455 .675502, .686557, .697624, .708701, .719788, .730886, .741992, .753108, .764233, .775366,
     456 .786508, .797658, .808816, .819982, .831155, .842336, .853524, .864718, .875920, .887128,
     457 .898342, .909563, .920790, .932023, .943261, .954506, .965755, .977011, .988271, .999539};
    459458  // Direct table
    460459  static const G4double Xmax=Xl[lQ2];
     
    462461  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    463462  static const G4double inl[nQ2]={0,
    464         1.88843,        3.65455,        5.29282,        6.82878,        8.28390,        9.67403,        11.0109,        12.3034,        13.5583,        14.7811,
    465         15.9760,        17.1466,        18.2958,        19.4260,        20.5392,        21.6372,        22.7215,        23.7933,        24.8538,        25.9039,
    466         26.9446,        27.9766,        29.0006,        30.0171,        31.0268,        32.0301,        33.0274,        34.0192,        35.0058,        35.9876,
    467         36.9649,        37.9379,        38.9069,        39.8721,        40.8337,        41.7920,        42.7471,        43.6992,        44.6484,        45.5950,
    468         46.5390,        47.4805,        48.4197,        49.3567,        50.2916,        51.2245,        52.1554,        53.0846,        54.0120,        54.9377,
    469         55.8617,        56.7843,        57.7054,        58.6250,        59.5433,        60.4603,        61.3761,        62.2906,        63.2040,        64.1162,
    470         65.0274,        65.9375,        66.8467,        67.7548,        68.6621,        69.5684,        70.4738,        71.3784,        72.2822,        73.1852,
    471         74.0875,        74.9889,        75.8897,        76.7898,        77.6892,        78.5879,        79.4860,        80.3835,        81.2804,        82.1767,
    472         83.0724,        83.9676,        84.8622,        85.7563,        86.6499,        87.5430,        88.4356,        89.3277,        90.2194,        91.1106,
    473         92.0013,        92.8917,        93.7816,        94.6711,        95.5602,        96.4489,        97.3372,        98.2252,        99.1128,        100.000};
     463 1.88843, 3.65455, 5.29282, 6.82878, 8.28390, 9.67403, 11.0109, 12.3034, 13.5583, 14.7811,
     464 15.9760, 17.1466, 18.2958, 19.4260, 20.5392, 21.6372, 22.7215, 23.7933, 24.8538, 25.9039,
     465 26.9446, 27.9766, 29.0006, 30.0171, 31.0268, 32.0301, 33.0274, 34.0192, 35.0058, 35.9876,
     466 36.9649, 37.9379, 38.9069, 39.8721, 40.8337, 41.7920, 42.7471, 43.6992, 44.6484, 45.5950,
     467 46.5390, 47.4805, 48.4197, 49.3567, 50.2916, 51.2245, 52.1554, 53.0846, 54.0120, 54.9377,
     468 55.8617, 56.7843, 57.7054, 58.6250, 59.5433, 60.4603, 61.3761, 62.2906, 63.2040, 64.1162,
     469 65.0274, 65.9375, 66.8467, 67.7548, 68.6621, 69.5684, 70.4738, 71.3784, 72.2822, 73.1852,
     470 74.0875, 74.9889, 75.8897, 76.7898, 77.6892, 78.5879, 79.4860, 80.3835, 81.2804, 82.1767,
     471 83.0724, 83.9676, 84.8622, 85.7563, 86.6499, 87.5430, 88.4356, 89.3277, 90.2194, 91.1106,
     472 92.0013, 92.8917, 93.7816, 94.6711, 95.5602, 96.4489, 97.3372, 98.2252, 99.1128, 100.000};
    474473  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    475474  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    538537  // Reversed table
    539538  static const G4double X0[nX]={6.14081e-05,
    540         .413394,        .644455,        .843199,        1.02623,        1.20032,        1.36916,        1.53516,        1.70008,        1.86539,        2.03244,
    541         2.20256,        2.37723,        2.55818,        2.74762,        2.94857,        3.16550,        3.40582,        3.68379,        4.03589,        4.77419};
     539 .413394, .644455, .843199, 1.02623, 1.20032, 1.36916, 1.53516, 1.70008, 1.86539, 2.03244,
     540 2.20256, 2.37723, 2.55818, 2.74762, 2.94857, 3.16550, 3.40582, 3.68379, 4.03589, 4.77419};
    542541  static const G4double X1[nX]={.00125268,
    543         .861178,        1.34230,        1.75605,        2.13704,        2.49936,        2.85072,        3.19611,        3.53921,        3.88308,        4.23049,
    544         4.58423,        4.94735,        5.32342,        5.71700,        6.13428,        6.58447,        7.08267,        7.65782,        8.38299,        9.77330};
     542 .861178, 1.34230, 1.75605, 2.13704, 2.49936, 2.85072, 3.19611, 3.53921, 3.88308, 4.23049,
     543 4.58423, 4.94735, 5.32342, 5.71700, 6.13428, 6.58447, 7.08267, 7.65782, 8.38299, 9.77330};
    545544  static const G4double X2[nX]={.015694,
    546         1.97690,        3.07976,        4.02770,        4.90021,        5.72963,        6.53363,        7.32363,        8.10805,        8.89384,        9.68728,
    547         10.4947,        11.3228,        12.1797,        13.0753,        14.0234,        15.0439,        16.1692,        17.4599,        19.0626,        21.7276};
     545 1.97690, 3.07976, 4.02770, 4.90021, 5.72963, 6.53363, 7.32363, 8.10805, 8.89384, 9.68728,
     546 10.4947, 11.3228, 12.1797, 13.0753, 14.0234, 15.0439, 16.1692, 17.4599, 19.0626, 21.7276};
    548547  static const G4double X3[nX]={.0866877,
    549         4.03498,        6.27651,        8.20056,        9.96931,        11.6487,        13.2747,        14.8704,        16.4526,        18.0351,        19.6302,
    550         21.2501,        22.9075,        24.6174,        26.3979,        28.2730,        30.2770,        32.4631,        34.9243,        37.8590,        41.9115};
     548 4.03498, 6.27651, 8.20056, 9.96931, 11.6487, 13.2747, 14.8704, 16.4526, 18.0351, 19.6302,
     549 21.2501, 22.9075, 24.6174, 26.3979, 28.2730, 30.2770, 32.4631, 34.9243, 37.8590, 41.9115};
    551550  static const G4double X4[nX]={.160483,
    552         5.73111,        8.88884,        11.5893,        14.0636,        16.4054,        18.6651,        20.8749,        23.0578,        25.2318,        27.4127,
    553         29.6152,        31.8540,        34.1452,        36.5074,        38.9635,        41.5435,        44.2892,        47.2638,        50.5732,        54.4265};
     551 5.73111, 8.88884, 11.5893, 14.0636, 16.4054, 18.6651, 20.8749, 23.0578, 25.2318, 27.4127,
     552 29.6152, 31.8540, 34.1452, 36.5074, 38.9635, 41.5435, 44.2892, 47.2638, 50.5732, 54.4265};
    554553  static const G4double X5[nX]={.0999307,
    555         5.25720,        8.11389,        10.5375,        12.7425,        14.8152,        16.8015,        18.7296,        20.6194,        22.4855,        24.3398,
    556         26.1924,        28.0527,        29.9295,        31.8320,        33.7699,        35.7541,        37.7975,        39.9158,        42.1290,        44.4649};
     554 5.25720, 8.11389, 10.5375, 12.7425, 14.8152, 16.8015, 18.7296, 20.6194, 22.4855, 24.3398,
     555 26.1924, 28.0527, 29.9295, 31.8320, 33.7699, 35.7541, 37.7975, 39.9158, 42.1290, 44.4649};
    557556  static const G4double X6[nX]={.0276367,
    558         3.53378,        5.41553,        6.99413,        8.41629,        9.74057,        10.9978,        12.2066,        13.3796,        14.5257,        15.6519,
    559         16.7636,        17.8651,        18.9603,        20.0527,        21.1453,        22.2411,        23.3430,        24.4538,        25.5765,        26.7148};
     557 3.53378, 5.41553, 6.99413, 8.41629, 9.74057, 10.9978, 12.2066, 13.3796, 14.5257, 15.6519,
     558 16.7636, 17.8651, 18.9603, 20.0527, 21.1453, 22.2411, 23.3430, 24.4538, 25.5765, 26.7148};
    560559  static const G4double X7[nX]={.00472383,
    561         2.08253,        3.16946,        4.07178,        4.87742,        5.62140,        6.32202,        6.99034,        7.63368,        8.25720,        8.86473,
    562         9.45921,        10.0430,        10.6179,        11.1856,        11.7475,        12.3046,        12.8581,        13.4089,        13.9577,        14.5057};
     560 2.08253, 3.16946, 4.07178, 4.87742, 5.62140, 6.32202, 6.99034, 7.63368, 8.25720, 8.86473,
     561 9.45921, 10.0430, 10.6179, 11.1856, 11.7475, 12.3046, 12.8581, 13.4089, 13.9577, 14.5057};
    563562  static const G4double X8[nX]={.000630783,
    564         1.22723,        1.85845,        2.37862,        2.84022,        3.26412,        3.66122,        4.03811,        4.39910,        4.74725,        5.08480,
    565         5.41346,        5.73457,        6.04921,        6.35828,        6.66250,        6.96250,        7.25884,        7.55197,        7.84232,        8.13037};
     563 1.22723, 1.85845, 2.37862, 2.84022, 3.26412, 3.66122, 4.03811, 4.39910, 4.74725, 5.08480,
     564 5.41346, 5.73457, 6.04921, 6.35828, 6.66250, 6.96250, 7.25884, 7.55197, 7.84232, 8.13037};
    566565  static const G4double X9[nX]={7.49179e-05,
    567         .772574,        1.16623,        1.48914,        1.77460,        2.03586,        2.27983,        2.51069,        2.73118,        2.94322,        3.14823,
    568         3.34728,        3.54123,        3.73075,        3.91638,        4.09860,        4.27779,        4.45428,        4.62835,        4.80025,        4.97028};
     566 .772574, 1.16623, 1.48914, 1.77460, 2.03586, 2.27983, 2.51069, 2.73118, 2.94322, 3.14823,
     567 3.34728, 3.54123, 3.73075, 3.91638, 4.09860, 4.27779, 4.45428, 4.62835, 4.80025, 4.97028};
    569568  static const G4double XA[nX]={8.43437e-06,
    570         .530035,        .798454,        1.01797,        1.21156,        1.38836,        1.55313,        1.70876,        1.85712,        1.99956,        2.13704,
    571         2.27031,        2.39994,        2.52640,        2.65007,        2.77127,        2.89026,        3.00726,        3.12248,        3.23607, 3.34823};
     569 .530035, .798454, 1.01797, 1.21156, 1.38836, 1.55313, 1.70876, 1.85712, 1.99956, 2.13704,
     570 2.27031, 2.39994, 2.52640, 2.65007, 2.77127, 2.89026, 3.00726, 3.12248, 3.23607, 3.34823};
    572571  static const G4double XB[nX]={9.27028e-07,
    573         .395058,        .594211,        .756726,        .899794,        1.03025,        1.15167,        1.26619,        1.37523,        1.47979,        1.58059,
    574         1.67819,        1.77302,        1.86543,        1.95571,        2.04408,        2.13074,        2.21587,        2.29960,        2.38206, 2.46341};
     572 .395058, .594211, .756726, .899794, 1.03025, 1.15167, 1.26619, 1.37523, 1.47979, 1.58059,
     573 1.67819, 1.77302, 1.86543, 1.95571, 2.04408, 2.13074, 2.21587, 2.29960, 2.38206, 2.46341};
    575574  static const G4double XC[nX]={1.00807e-07,
    576         .316195,        .474948,        .604251,        .717911,        .821417,        .917635,        1.00829,        1.09452,        1.17712,        1.25668,
    577         1.33364,        1.40835,        1.48108,        1.55207,        1.62150,        1.68954,        1.75631,        1.82193,        1.88650, 1.95014};
     575 .316195, .474948, .604251, .717911, .821417, .917635, 1.00829, 1.09452, 1.17712, 1.25668,
     576 1.33364, 1.40835, 1.48108, 1.55207, 1.62150, 1.68954, 1.75631, 1.82193, 1.88650, 1.95014};
    578577  static const G4double XD[nX]={1.09102e-08,
    579         .268227,        .402318,        .511324,        .606997,        .694011,        .774803,        .850843,        .923097,        .992243,        1.05878,
    580         1.12309,        1.18546,        1.24613,        1.30530,        1.36313,        1.41974,        1.47526,        1.52978,        1.58338,        1.63617};
     578 .268227, .402318, .511324, .606997, .694011, .774803, .850843, .923097, .992243, 1.05878,
     579 1.12309, 1.18546, 1.24613, 1.30530, 1.36313, 1.41974, 1.47526, 1.52978, 1.58338, 1.63617};
    581580  static const G4double XE[nX]={1.17831e-09,
    582         .238351,        .356890,        .453036,        .537277,        .613780,        .684719,        .751405,        .814699,        .875208,        .933374,
    583         .989535,        1.04396,        1.09685,        1.14838,        1.19870,        1.24792,        1.29615,        1.34347,        1.38996, 1.43571};
     581 .238351, .356890, .453036, .537277, .613780, .684719, .751405, .814699, .875208, .933374,
     582 .989535, 1.04396, 1.09685, 1.14838, 1.19870, 1.24792, 1.29615, 1.34347, 1.38996, 1.43571};
    584583  static const G4double XF[nX]={1.27141e-10,
    585         .219778,        .328346,        .416158,        .492931,        .562525,        .626955,        .687434,        .744761,        .799494,        .852046,
    586         .902729,        .951786,        .999414,        1.04577,        1.09099,        1.13518,        1.17844,        1.22084,        1.26246,        1.30338};
     584 .219778, .328346, .416158, .492931, .562525, .626955, .687434, .744761, .799494, .852046,
     585 .902729, .951786, .999414, 1.04577, 1.09099, 1.13518, 1.17844, 1.22084, 1.26246, 1.30338};
    587586  static const G4double XG[nX]={1.3713e-11,
    588         .208748,        .310948,        .393310,        .465121,        .530069,        .590078,        .646306,        .699515,        .750239,        .798870,
    589         .845707,        .890982,        .934882,        .977559,        1.01914,        1.05973,        1.09941,        1.13827,        1.17637, 1.21379};
     587 .208748, .310948, .393310, .465121, .530069, .590078, .646306, .699515, .750239, .798870,
     588 .845707, .890982, .934882, .977559, 1.01914, 1.05973, 1.09941, 1.13827, 1.17637, 1.21379};
    590589  static const G4double XH[nX]={1.47877e-12,
    591         .203089,        .301345,        .380162,        .448646,        .510409,        .567335,        .620557,        .670820,        .718647,        .764421,
    592         .808434,        .850914,        .892042,        .931967,        .970812,        1.00868,        1.04566,        1.08182,        1.11724, 1.15197};
     590 .203089, .301345, .380162, .448646, .510409, .567335, .620557, .670820, .718647, .764421,
     591 .808434, .850914, .892042, .931967, .970812, 1.00868, 1.04566, 1.08182, 1.11724, 1.15197};
    593592  static const G4double XI[nX]={1.59454e-13,
    594         .201466,        .297453,        .374007,        .440245,        .499779,        .554489,        .605506,        .653573,        .699213,        .742806,
    595         .784643,        .824952,        .863912,        .901672,        .938353,        .974060,        1.00888,        1.04288,        1.07614,        1.10872};
     593 .201466, .297453, .374007, .440245, .499779, .554489, .605506, .653573, .699213, .742806,
     594 .784643, .824952, .863912, .901672, .938353, .974060, 1.00888, 1.04288, 1.07614, 1.10872};
    596595  static const G4double XJ[nX]={1.71931e-14,
    597         .202988,        .297870,        .373025,        .437731,        .495658,        .548713,        .598041,        .644395,        .688302,        .730147,
    598         .770224,        .808762,        .845943,        .881916,        .916805,        .950713,        .983728,        1.01592,        1.04737, 1.07813};
     596 .202988, .297870, .373025, .437731, .495658, .548713, .598041, .644395, .688302, .730147,
     597 .770224, .808762, .845943, .881916, .916805, .950713, .983728, 1.01592, 1.04737, 1.07813};
    599598  // Direct table
    600599  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    609608                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    610609  static const G4double I0[nX]={0,
    611         .411893,        1.25559,        2.34836,        3.60264,        4.96046,        6.37874,        7.82342,        9.26643,        10.6840,        12.0555,
    612         13.3628,        14.5898,        15.7219,        16.7458,        17.6495,        18.4217,        19.0523,        19.5314,        19.8501, 20.0000};
     610 .411893, 1.25559, 2.34836, 3.60264, 4.96046, 6.37874, 7.82342, 9.26643, 10.6840, 12.0555,
     611 13.3628, 14.5898, 15.7219, 16.7458, 17.6495, 18.4217, 19.0523, 19.5314, 19.8501, 20.0000};
    613612  static const G4double I1[nX]={0,
    614         .401573,        1.22364,        2.28998,        3.51592,        4.84533,        6.23651,        7.65645,        9.07796,        10.4780,        11.8365,
    615         13.1360,        14.3608,        15.4967,        16.5309,        17.4516,        18.2481,        18.9102,        19.4286,        19.7946, 20.0000};
     613 .401573, 1.22364, 2.28998, 3.51592, 4.84533, 6.23651, 7.65645, 9.07796, 10.4780, 11.8365,
     614 13.1360, 14.3608, 15.4967, 16.5309, 17.4516, 18.2481, 18.9102, 19.4286, 19.7946, 20.0000};
    616615  static const G4double I2[nX]={0,
    617         .387599,        1.17339,        2.19424,        3.37090,        4.65066,        5.99429,        7.37071,        8.75427,        10.1232,        11.4586,
    618         12.7440,        13.9644,        15.1065,        16.1582,        17.1083,        17.9465,        18.6634,        19.2501,        19.6982, 20.0000};
     616 .387599, 1.17339, 2.19424, 3.37090, 4.65066, 5.99429, 7.37071, 8.75427, 10.1232, 11.4586,
     617 12.7440, 13.9644, 15.1065, 16.1582, 17.1083, 17.9465, 18.6634, 19.2501, 19.6982, 20.0000};
    619618  static const G4double I3[nX]={0,
    620         .366444,        1.09391,        2.04109,        3.13769,        4.33668,        5.60291,        6.90843,        8.23014,        9.54840,        10.8461,
    621         12.1083,        13.3216,        14.4737,        15.5536,        16.5512,        17.4573,        18.2630,        18.9603,        19.5417, 20.0000};
     619 .366444, 1.09391, 2.04109, 3.13769, 4.33668, 5.60291, 6.90843, 8.23014, 9.54840, 10.8461,
     620 12.1083, 13.3216, 14.4737, 15.5536, 16.5512, 17.4573, 18.2630, 18.9603, 19.5417, 20.0000};
    622621  static const G4double I4[nX]={0,
    623         .321962,        .959681,        1.79769,        2.77753,        3.85979,        5.01487,        6.21916,        7.45307,        8.69991,        9.94515,
    624         11.1759,        12.3808,        13.5493,        14.6720,        15.7402,        16.7458,        17.6813,        18.5398,        19.3148, 20.0000};
     622 .321962, .959681, 1.79769, 2.77753, 3.85979, 5.01487, 6.21916, 7.45307, 8.69991, 9.94515,
     623 11.1759, 12.3808, 13.5493, 14.6720, 15.7402, 16.7458, 17.6813, 18.5398, 19.3148, 20.0000};
    625624  static const G4double I5[nX]={0,
    626         .257215,        .786302,        1.49611,        2.34049,        3.28823,        4.31581,        5.40439,        6.53832,        7.70422,        8.89040,
    627         10.0865,        11.2833,        12.4723,        13.6459,        14.7969,        15.9189,        17.0058,        18.0517,        19.0515, 20.0000};
     625 .257215, .786302, 1.49611, 2.34049, 3.28823, 4.31581, 5.40439, 6.53832, 7.70422, 8.89040,
     626 10.0865, 11.2833, 12.4723, 13.6459, 14.7969, 15.9189, 17.0058, 18.0517, 19.0515, 20.0000};
    628627  static const G4double I6[nX]={0,
    629         .201608,        .638914,        1.24035,        1.97000,        2.80354,        3.72260,        4.71247,        5.76086,        6.85724,        7.99243,
    630         9.15826,        10.3474,        11.5532,        12.7695,        13.9907,        15.2117,        16.4275,        17.6337,        18.8258, 20.0000};
     628 .201608, .638914, 1.24035, 1.97000, 2.80354, 3.72260, 4.71247, 5.76086, 6.85724, 7.99243,
     629 9.15826, 10.3474, 11.5532, 12.7695, 13.9907, 15.2117, 16.4275, 17.6337, 18.8258, 20.0000};
    631630  static const G4double I7[nX]={0,
    632         .168110,        .547208,        1.07889,        1.73403,        2.49292,        3.34065,        4.26525,        5.25674,        6.30654,        7.40717,
    633         8.55196,        9.73492,        10.9506,        12.1940,        13.4606,        14.7460,        16.0462,        17.3576,        18.6767, 20.0000};
     631 .168110, .547208, 1.07889, 1.73403, 2.49292, 3.34065, 4.26525, 5.25674, 6.30654, 7.40717,
     632 8.55196, 9.73492, 10.9506, 12.1940, 13.4606, 14.7460, 16.0462, 17.3576, 18.6767, 20.0000};
    634633  static const G4double I8[nX]={0,
    635         .150652,        .497557,        .990048,        1.60296,        2.31924,        3.12602,        4.01295,        4.97139,        5.99395,        7.07415,
    636         8.20621,        9.38495,        10.6057,        11.8641,        13.1561,        14.4781,        15.8267,        17.1985,        18.5906, 20.0000};
     634 .150652, .497557, .990048, 1.60296, 2.31924, 3.12602, 4.01295, 4.97139, 5.99395, 7.07415,
     635 8.20621, 9.38495, 10.6057, 11.8641, 13.1561, 14.4781, 15.8267, 17.1985, 18.5906, 20.0000};
    637636  static const G4double I9[nX]={0,
    638         .141449,        .470633,        .941304,        1.53053,        2.22280,        3.00639,        3.87189,        4.81146,        5.81837,        6.88672,
    639         8.01128,        9.18734,        10.4106,        11.6772,        12.9835,        14.3261,        15.7019,        17.1080,        18.5415, 20.0000};
     637 .141449, .470633, .941304, 1.53053, 2.22280, 3.00639, 3.87189, 4.81146, 5.81837, 6.88672,
     638 8.01128, 9.18734, 10.4106, 11.6772, 12.9835, 14.3261, 15.7019, 17.1080, 18.5415, 20.0000};
    640639  static const G4double IA[nX]={0,
    641         .136048,        .454593,        .912075,        1.48693,        2.16457,        2.93400,        3.78639,        4.71437,        5.71163,        6.77265,
    642         7.89252,        9.06683,        10.2916,        11.5631,        12.8780,        14.2331,        .625500,        17.0525,        18.5115, 20.0000};
     640 .136048, .454593, .912075, 1.48693, 2.16457, 2.93400, 3.78639, 4.71437, 5.71163, 6.77265,
     641 7.89252, 9.06683, 10.2916, 11.5631, 12.8780, 14.2331, .625500, 17.0525, 18.5115, 20.0000};
    643642  static const G4double IB[nX]={0,
    644         .132316,        .443455,        .891741,        1.45656,        2.12399,        2.88352,        3.72674,        4.64660,        5.63711,        6.69298,
    645         7.80955,        8.98262,        10.2084,        11.4833,        12.8042,        14.1681,        15.5721,        17.0137,        18.4905, 20.0000};
     643 .132316, .443455, .891741, 1.45656, 2.12399, 2.88352, 3.72674, 4.64660, 5.63711, 6.69298,
     644 7.80955, 8.98262, 10.2084, 11.4833, 12.8042, 14.1681, 15.5721, 17.0137, 18.4905, 20.0000};
    646645  static const G4double IC[nX]={0,
    647         .129197,        .434161,        .874795,        1.43128,        2.09024,        2.84158,        3.67721,        4.59038,        5.57531,        6.62696,
    648         7.74084,        8.91291,        10.1395,        11.4173,        12.7432,        14.1143,        15.5280,        16.9817,        18.4731, 20.0000};
     646 .129197, .434161, .874795, 1.43128, 2.09024, 2.84158, 3.67721, 4.59038, 5.57531, 6.62696,
     647 7.74084, 8.91291, 10.1395, 11.4173, 12.7432, 14.1143, 15.5280, 16.9817, 18.4731, 20.0000};
    649648  static const G4double ID[nX]={0,
    650         .126079,        .424911,        .857980,        1.40626,        2.05689,        2.80020,        3.62840,        4.53504,        5.51456,        6.56212,
    651         7.67342,        8.84458,        10.0721,        11.3527,        12.6836,        14.0618,        15.4849,        16.9504,        18.4562, 20.0000};
     649 .126079, .424911, .857980, 1.40626, 2.05689, 2.80020, 3.62840, 4.53504, 5.51456, 6.56212,
     650 7.67342, 8.84458, 10.0721, 11.3527, 12.6836, 14.0618, 15.4849, 16.9504, 18.4562, 20.0000};
    652651  static const G4double IE[nX]={0,
    653         .122530,        .414424,        .838964,        1.37801,        2.01931,        2.75363,        3.57356,        4.47293,        5.44644,        6.48949,
    654         7.59795,        8.76815,        9.99673,        11.2806,        12.6170,        14.0032,        15.4369,        16.9156,        18.4374, 20.0000};
     652 .122530, .414424, .838964, 1.37801, 2.01931, 2.75363, 3.57356, 4.47293, 5.44644, 6.48949,
     653 7.59795, 8.76815, 9.99673, 11.2806, 12.6170, 14.0032, 15.4369, 16.9156, 18.4374, 20.0000};
    655654  static const G4double IF[nX]={0,
    656         .118199,        .401651,        .815838,        1.34370,        1.97370,        2.69716,        3.50710,        4.39771,        5.36401,        6.40164,
    657         7.50673,        8.67581,        9.90572,        11.1936,        12.5367,        13.9326,        15.3790,        16.8737,        18.4146, 20.0000};
     655 .118199, .401651, .815838, 1.34370, 1.97370, 2.69716, 3.50710, 4.39771, 5.36401, 6.40164,
     656 7.50673, 8.67581, 9.90572, 11.1936, 12.5367, 13.9326, 15.3790, 16.8737, 18.4146, 20.0000};
    658657  static const G4double IG[nX]={0,
    659         .112809,        .385761,        .787075,        1.30103,        1.91700,        2.62697,        3.42451,        4.30424,        5.26158,        6.29249,
    660         7.39341,        8.56112,        9.79269,        11.0855,        12.4369,        13.8449,        15.3071,        16.8216,        18.3865, 20.0000};
     658 .112809, .385761, .787075, 1.30103, 1.91700, 2.62697, 3.42451, 4.30424, 5.26158, 6.29249,
     659 7.39341, 8.56112, 9.79269, 11.0855, 12.4369, 13.8449, 15.3071, 16.8216, 18.3865, 20.0000};
    661660  static const G4double IH[nX]={0,
    662         .106206,        .366267,        .751753,        1.24859,        1.84728,        2.54062,        3.32285,        .189160,        5.13543,        6.15804,
    663         7.25377,        8.41975,        9.65334,        10.9521,        12.3139,        13.7367,        15.2184,        16.7573,        18.3517, 20.0000};
     661 .106206, .366267, .751753, 1.24859, 1.84728, 2.54062, 3.32285, .189160, 5.13543, 6.15804,
     662 7.25377, 8.41975, 9.65334, 10.9521, 12.3139, 13.7367, 15.2184, 16.7573, 18.3517, 20.0000};
    664663  static const G4double II[nX]={0,
    665         .098419,        .343194,        .709850,        1.18628,        1.76430,        2.43772,        3.20159,        4.05176,        4.98467,        5.99722,
    666         7.08663,        8.25043,        9.48633,        10.7923,        12.1663,        13.6067,        15.1118,        16.6800,        18.3099,        20.0000};
     664 .098419, .343194, .709850, 1.18628, 1.76430, 2.43772, 3.20159, 4.05176, 4.98467, 5.99722,
     665 7.08663, 8.25043, 9.48633, 10.7923, 12.1663, 13.6067, 15.1118, 16.6800, 18.3099, 20.0000};
    667666  static const G4double IJ[nX]={0,
    668         .089681,        .317135,        .662319,        1.11536,        1.66960,        2.32002,        3.06260,        3.89397,        4.81126,        5.81196,
    669         6.89382,        8.05483,        9.29317,        10.6072,        11.9952,        13.4560,        14.9881,        16.5902,        18.2612, 20.0000};
     667 .089681, .317135, .662319, 1.11536, 1.66960, 2.32002, 3.06260, 3.89397, 4.81126, 5.81196,
     668 6.89382, 8.05483, 9.29317, 10.6072, 11.9952, 13.4560, 14.9881, 16.5902, 18.2612, 20.0000};
    670669  static const G4double* Il[nE]=
    671670                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    672671  static const G4double lE[nE]={
    673 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    674  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     672-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     673 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    675674  static const G4double lEmi=lE[0];
    676675  static const G4double lEma=lE[nE-1];
    677676  static const G4double dlE=(lEma-lEmi)/bE;
    678         //***************************************************************************************
     677  //***************************************************************************************
    679678  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    680679  G4double lEn=std::log(Enu);         // log(E) for interpolation
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QNuNuNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QNuNuNuclearCrossSection.cc,v 1.2 2007/11/02 15:57:16 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QNuNuNuclearCrossSection.cc,v 1.3 2009/02/23 09:49:24 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    31 // G4 Physics class: G4QNuNuNuclearCrossSection for gamma+A cross sections
     31// G4 Physics class: G4QNuNuNuclearCrossSection for (nu,nu)A cross sections
    3232// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
     
    3737// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3838// ****************************************************************************************
    39 //===============================================================================================
     39//=========================================================================================
    4040
    4141//#define debug
     
    9090        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    9191        <<colN.size()<<G4endl;
    92                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     92  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    9393#endif
    9494  if(pPDG!=14)
     
    111111    j  = 0;                            // A#0f records found in DB for this projectile
    112112    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    113            {                                  // The nucleus with projPDG is found in AMDB
     113    {                                  // The nucleus with projPDG is found in AMDB
    114114      if(colN[i]==tgN && colZ[i]==tgZ)
    115                                                 {
     115      {
    116116        lastI=i;
    117117        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    163163#endif
    164164      j++;                             // Increment a#0f records found in DB for this pPDG
    165            }
    166            if(!in)                            // This nucleus has not been calculated previously
    167            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    168168#ifdef pdebug
    169169      G4cout<<"G4QNMNCS::GetCrSec: CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    172172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    173173      if(lastCS<=0.)
    174                                                 {
     174      {
    175175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    176176#ifdef pdebug
     
    184184          lastTH=pEn;
    185185        }
    186                                                 }
     186      }
    187187#ifdef pdebug
    188188      G4cout<<"G4QNMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    200200#endif
    201201      return lastCS*millibarn;
    202            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    203203    else
    204                                 {
     204    {
    205205#ifdef pdebug
    206206      G4cout<<"G4QNMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    274274  {
    275275    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    276                                 {
     276    {
    277277      lastTX =TX[I];                 // Pointer to the prepared TX function (same isotope)
    278278      lastQE =QE[I];                 // Pointer to the prepared QE function (same isotope)
    279           }
    280           else                              // This isotope wasn't calculated previously => CREATE
    281           {
     279   }
     280   else                              // This isotope wasn't calculated previously => CREATE
     281   {
    282282      if(first)
    283283      {
     
    295295      TX.push_back(lastTX);
    296296      QE.push_back(lastQE);
    297            } // End of creation of the new set of parameters
     297    } // End of creation of the new set of parameters
    298298  } // End of parameters udate
    299299  // ============================== NOW Calculate the Cross Section =====================
     
    310310    G4int sep=ran;  // as a result = an index of the left edge of the interval
    311311    while(ran>=2)
    312                                 {
     312    {
    313313      G4int newran=ran/2;
    314314      if(lastE<=lastEN[sep]) sep-=newran;
     
    357357  static const G4int nE=65; // !! If change this, change it in GetCrossSection() (*.cc) !!
    358358  static const G4double nuEn[nE]={0.,
    359 1.00463e-5,1.05336e-5,1.10692e-5,1.16592e-5,1.23109e-5,1.30323e-5,1.38331e-5,1.47245e-5,
    360 1.57194e-5,1.68335e-5,1.80848e-5,1.94948e-5,2.10894e-5,2.28991e-5,2.49608e-5,2.73189e-5,
    361 3.00273e-5,3.31516e-5,3.67722e-5,4.09881e-5,4.59217e-5,5.17255e-5,5.85908e-5,6.67583e-5,
    362 7.65338e-5,8.83078e-5,.000102583,.000120011,.000141441,.000167995,.000201160,.000242926,
    363 .000295985,.000364008,.000452051,.000567152,.000719210,.000922307,.001196710,.001571930,
    364 .002091530,.002820590,.003857810,.005354930,.007548840,.010815300,.015760100,.023376900,
    365 .035325600,.054430800,.085595700,.137508000,.225898000,.379892000,.654712000,1.15767000,
    366 2.10277000,3.92843000,7.55861000,14.9991000,30.7412000,65.1734000,143.155000,326.326000};
     359  1.00463e-5,1.05336e-5,1.10692e-5,1.16592e-5,1.23109e-5,1.30323e-5,1.38331e-5,1.47245e-5,
     360  1.57194e-5,1.68335e-5,1.80848e-5,1.94948e-5,2.10894e-5,2.28991e-5,2.49608e-5,2.73189e-5,
     361  3.00273e-5,3.31516e-5,3.67722e-5,4.09881e-5,4.59217e-5,5.17255e-5,5.85908e-5,6.67583e-5,
     362  7.65338e-5,8.83078e-5,.000102583,.000120011,.000141441,.000167995,.000201160,.000242926,
     363  .000295985,.000364008,.000452051,.000567152,.000719210,.000922307,.001196710,.001571930,
     364  .002091530,.002820590,.003857810,.005354930,.007548840,.010815300,.015760100,.023376900,
     365  .035325600,.054430800,.085595700,.137508000,.225898000,.379892000,.654712000,1.15767000,
     366  2.10277000,3.92843000,7.55861000,14.9991000,30.7412000,65.1734000,143.155000,326.326000};
    367367  static const G4double TOTX[nE]={0.,
    368 3.18319e-5,3.33759e-5,3.50729e-5,3.69425e-5,3.90071e-5,4.12928e-5,4.38300e-5,4.66541e-5,
    369 4.98065e-5,5.33360e-5,5.73004e-5,6.17678e-5,6.68196e-5,7.25529e-5,7.90845e-5,8.65551e-5,
    370 9.51355e-5,.000105033,.000116503,.000129858,.000145486,.000163871,.000185616,.000211484,
    371 .000242444,.000279730,.000324932,.000380110,.000447953,.000531999,.000636946,.000769076,
    372 .000936873,.001151900,.001430050,.001793410,.002272980,.002912690,.003775490,.004952530,
    373 .006577150,.008846400,.012054100,.017404800,.027443300,.040285600,.058251500,.084054600,
    374 .121309000,.173273000,.240200000,.312865000,.367478000,.379071000,.348461000,.301143000,
    375 .259802000,.231449000,.214007000,.203827000,.198265000,.195186000,.192821000,.190555000};
     368  3.18319e-5,3.33759e-5,3.50729e-5,3.69425e-5,3.90071e-5,4.12928e-5,4.38300e-5,4.66541e-5,
     369  4.98065e-5,5.33360e-5,5.73004e-5,6.17678e-5,6.68196e-5,7.25529e-5,7.90845e-5,8.65551e-5,
     370  9.51355e-5,.000105033,.000116503,.000129858,.000145486,.000163871,.000185616,.000211484,
     371  .000242444,.000279730,.000324932,.000380110,.000447953,.000531999,.000636946,.000769076,
     372  .000936873,.001151900,.001430050,.001793410,.002272980,.002912690,.003775490,.004952530,
     373  .006577150,.008846400,.012054100,.017404800,.027443300,.040285600,.058251500,.084054600,
     374  .121309000,.173273000,.240200000,.312865000,.367478000,.379071000,.348461000,.301143000,
     375  .259802000,.231449000,.214007000,.203827000,.198265000,.195186000,.192821000,.190555000};
    376376  static const G4double QELX[nE]={0.,
    377 .319793e-9,.351567e-9,.388228e-9,.430721e-9,.480212e-9,.538141e-9,.606306e-9,.686956e-9,
    378 .782930e-9,.897832e-9,1.03626e-9,1.20415e-9,1.40918e-9,1.66139e-9,1.97401e-9,2.36458e-9,
    379 2.85666e-9,3.48202e-9,4.28408e-9,5.32264e-9,6.68098e-9,8.47630e-9,1.08754e-8,1.41183e-8,
    380 1.85552e-8,2.47023e-8,3.33325e-8,4.56172e-8,6.33590e-8,8.93735e-8,1.28128e-7,1.86829e-7,
    381 2.77301e-7,4.19300e-7,6.46455e-7,1.01714e-6,1.63475e-6,2.68640e-6,4.51816e-6,7.78503e-6,
    382 1.37563e-5,2.49521e-5,4.65025e-5,9.32015e-5,.000207165,.000435700,.000918046,.001964940,
    383 .004285300,.009431390,.020560100,.043021600,.083012600,.142280000,.194239000,.222213000,
    384 .231903000,.234030000,.234691000,.235204000,.235575000,.235793000,.235902000,.235946000};
     377  .319793e-9,.351567e-9,.388228e-9,.430721e-9,.480212e-9,.538141e-9,.606306e-9,.686956e-9,
     378  .782930e-9,.897832e-9,1.03626e-9,1.20415e-9,1.40918e-9,1.66139e-9,1.97401e-9,2.36458e-9,
     379  2.85666e-9,3.48202e-9,4.28408e-9,5.32264e-9,6.68098e-9,8.47630e-9,1.08754e-8,1.41183e-8,
     380  1.85552e-8,2.47023e-8,3.33325e-8,4.56172e-8,6.33590e-8,8.93735e-8,1.28128e-7,1.86829e-7,
     381  2.77301e-7,4.19300e-7,6.46455e-7,1.01714e-6,1.63475e-6,2.68640e-6,4.51816e-6,7.78503e-6,
     382  1.37563e-5,2.49521e-5,4.65025e-5,9.32015e-5,.000207165,.000435700,.000918046,.001964940,
     383  .004285300,.009431390,.020560100,.043021600,.083012600,.142280000,.194239000,.222213000,
     384  .231903000,.234030000,.234691000,.235204000,.235575000,.235793000,.235902000,.235946000};
    385385  // --------------------------------
    386386  G4int first=0;
    387387  if(z<0.)
    388                 {
     388  {
    389389    first=1;
    390390    z=-z;
     
    405405    t[k]=TOTX[k]*nuEn[k]*(na+na)/ta+QELX[k]*(dn+dn-da)/ta; // TotalCrossSection
    406406    q[k]=QELX[k]*dn/a;                                     // QuasiElasticCrossSection
    407         }
     407  }
    408408  return first;
    409409}
     
    420420  // Reversed table
    421421  static const G4double Xl[nQ2]={1.87905e-10,
    422         .005231,        .010602,        .016192,        .022038,        .028146,        .034513,        .041130,        .047986,        .055071,        .062374,
    423         .069883,        .077587,        .085475,        .093539,        .101766,        .110150,        .118680,        .127348,        .136147,        .145069,
    424         .154107,        .163255,        .172506,        .181855,        .191296,        .200825,        .210435,        .220124,        .229886,        .239718,
    425         .249617,        .259578,        .269598,        .279675,        .289805,        .299986,        .310215,        .320490,        .330808,        .341169,
    426         .351568,        .362006,        .372479,        .382987,        .393527,        .404099,        .414700,        .425330,        .435987,        .446670,
    427         .457379,        .468111,        .478866,        .489643,        .500441,        .511260,        .522097,        .532954,        .543828,        .554720,
    428         .565628,        .576553,        .587492,        .598447,        .609416,        .620398,        .631394,        .642403,        .653424,        .664457,
    429         .675502,        .686557,        .697624,        .708701,        .719788,        .730886,        .741992,        .753108,        .764233,        .775366,
    430         .786508,        .797658,        .808816,        .819982,        .831155,        .842336,        .853524,        .864718,        .875920,        .887128,
    431         .898342,        .909563,        .920790,        .932023,        .943261,        .954506,        .965755,        .977011,        .988271,        .999539};
     422 .005231, .010602, .016192, .022038, .028146, .034513, .041130, .047986, .055071, .062374,
     423 .069883, .077587, .085475, .093539, .101766, .110150, .118680, .127348, .136147, .145069,
     424 .154107, .163255, .172506, .181855, .191296, .200825, .210435, .220124, .229886, .239718,
     425 .249617, .259578, .269598, .279675, .289805, .299986, .310215, .320490, .330808, .341169,
     426 .351568, .362006, .372479, .382987, .393527, .404099, .414700, .425330, .435987, .446670,
     427 .457379, .468111, .478866, .489643, .500441, .511260, .522097, .532954, .543828, .554720,
     428 .565628, .576553, .587492, .598447, .609416, .620398, .631394, .642403, .653424, .664457,
     429 .675502, .686557, .697624, .708701, .719788, .730886, .741992, .753108, .764233, .775366,
     430 .786508, .797658, .808816, .819982, .831155, .842336, .853524, .864718, .875920, .887128,
     431 .898342, .909563, .920790, .932023, .943261, .954506, .965755, .977011, .988271, .999539};
    432432  // Direct table
    433433  static const G4double Xmax=Xl[lQ2];
     
    435435  static const G4double dX=(Xmax-Xmin)/lQ2;  // step in X(Q2, GeV^2)
    436436  static const G4double inl[nQ2]={0,
    437         1.88843,        3.65455,        5.29282,        6.82878,        8.28390,        9.67403,        11.0109,        12.3034,        13.5583,        14.7811,
    438         15.9760,        17.1466,        18.2958,        19.4260,        20.5392,        21.6372,        22.7215,        23.7933,        24.8538,        25.9039,
    439         26.9446,        27.9766,        29.0006,        30.0171,        31.0268,        32.0301,        33.0274,        34.0192,        35.0058,        35.9876,
    440         36.9649,        37.9379,        38.9069,        39.8721,        40.8337,        41.7920,        42.7471,        43.6992,        44.6484,        45.5950,
    441         46.5390,        47.4805,        48.4197,        49.3567,        50.2916,        51.2245,        52.1554,        53.0846,        54.0120,        54.9377,
    442         55.8617,        56.7843,        57.7054,        58.6250,        59.5433,        60.4603,        61.3761,        62.2906,        63.2040,        64.1162,
    443         65.0274,        65.9375,        66.8467,        67.7548,        68.6621,        69.5684,        70.4738,        71.3784,        72.2822,        73.1852,
    444         74.0875,        74.9889,        75.8897,        76.7898,        77.6892,        78.5879,        79.4860,        80.3835,        81.2804,        82.1767,
    445         83.0724,        83.9676,        84.8622,        85.7563,        86.6499,        87.5430,        88.4356,        89.3277,        90.2194,        91.1106,
    446         92.0013,        92.8917,        93.7816,        94.6711,        95.5602,        96.4489,        97.3372,        98.2252,        99.1128,        100.000};
     437 1.88843, 3.65455, 5.29282, 6.82878, 8.28390, 9.67403, 11.0109, 12.3034, 13.5583, 14.7811,
     438 15.9760, 17.1466, 18.2958, 19.4260, 20.5392, 21.6372, 22.7215, 23.7933, 24.8538, 25.9039,
     439 26.9446, 27.9766, 29.0006, 30.0171, 31.0268, 32.0301, 33.0274, 34.0192, 35.0058, 35.9876,
     440 36.9649, 37.9379, 38.9069, 39.8721, 40.8337, 41.7920, 42.7471, 43.6992, 44.6484, 45.5950,
     441 46.5390, 47.4805, 48.4197, 49.3567, 50.2916, 51.2245, 52.1554, 53.0846, 54.0120, 54.9377,
     442 55.8617, 56.7843, 57.7054, 58.6250, 59.5433, 60.4603, 61.3761, 62.2906, 63.2040, 64.1162,
     443 65.0274, 65.9375, 66.8467, 67.7548, 68.6621, 69.5684, 70.4738, 71.3784, 72.2822, 73.1852,
     444 74.0875, 74.9889, 75.8897, 76.7898, 77.6892, 78.5879, 79.4860, 80.3835, 81.2804, 82.1767,
     445 83.0724, 83.9676, 84.8622, 85.7563, 86.6499, 87.5430, 88.4356, 89.3277, 90.2194, 91.1106,
     446 92.0013, 92.8917, 93.7816, 94.6711, 95.5602, 96.4489, 97.3372, 98.2252, 99.1128, 100.000};
    447447  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    448448  G4double dEnu=Enu+Enu;              // doubled energy of nu/anu
     
    503503  // Reversed table
    504504  static const G4double X0[nX]={6.14081e-05,
    505         .413394,        .644455,        .843199,        1.02623,        1.20032,        1.36916,        1.53516,        1.70008,        1.86539,        2.03244,
    506         2.20256,        2.37723,        2.55818,        2.74762,        2.94857,        3.16550,        3.40582,        3.68379,        4.03589,        4.77419};
     505 .413394, .644455, .843199, 1.02623, 1.20032, 1.36916, 1.53516, 1.70008, 1.86539, 2.03244,
     506 2.20256, 2.37723, 2.55818, 2.74762, 2.94857, 3.16550, 3.40582, 3.68379, 4.03589, 4.77419};
    507507  static const G4double X1[nX]={.00125268,
    508         .861178,        1.34230,        1.75605,        2.13704,        2.49936,        2.85072,        3.19611,        3.53921,        3.88308,        4.23049,
    509         4.58423,        4.94735,        5.32342,        5.71700,        6.13428,        6.58447,        7.08267,        7.65782,        8.38299,        9.77330};
     508 .861178, 1.34230, 1.75605, 2.13704, 2.49936, 2.85072, 3.19611, 3.53921, 3.88308, 4.23049,
     509 4.58423, 4.94735, 5.32342, 5.71700, 6.13428, 6.58447, 7.08267, 7.65782, 8.38299, 9.77330};
    510510  static const G4double X2[nX]={.015694,
    511         1.97690,        3.07976,        4.02770,        4.90021,        5.72963,        6.53363,        7.32363,        8.10805,        8.89384,        9.68728,
    512         10.4947,        11.3228,        12.1797,        13.0753,        14.0234,        15.0439,        16.1692,        17.4599,        19.0626,        21.7276};
     511 1.97690, 3.07976, 4.02770, 4.90021, 5.72963, 6.53363, 7.32363, 8.10805, 8.89384, 9.68728,
     512 10.4947, 11.3228, 12.1797, 13.0753, 14.0234, 15.0439, 16.1692, 17.4599, 19.0626, 21.7276};
    513513  static const G4double X3[nX]={.0866877,
    514         4.03498,        6.27651,        8.20056,        9.96931,        11.6487,        13.2747,        14.8704,        16.4526,        18.0351,        19.6302,
    515         21.2501,        22.9075,        24.6174,        26.3979,        28.2730,        30.2770,        32.4631,        34.9243,        37.8590,        41.9115};
     514 4.03498, 6.27651, 8.20056, 9.96931, 11.6487, 13.2747, 14.8704, 16.4526, 18.0351, 19.6302,
     515 21.2501, 22.9075, 24.6174, 26.3979, 28.2730, 30.2770, 32.4631, 34.9243, 37.8590, 41.9115};
    516516  static const G4double X4[nX]={.160483,
    517         5.73111,        8.88884,        11.5893,        14.0636,        16.4054,        18.6651,        20.8749,        23.0578,        25.2318,        27.4127,
    518         29.6152,        31.8540,        34.1452,        36.5074,        38.9635,        41.5435,        44.2892,        47.2638,        50.5732,        54.4265};
     517 5.73111, 8.88884, 11.5893, 14.0636, 16.4054, 18.6651, 20.8749, 23.0578, 25.2318, 27.4127,
     518 29.6152, 31.8540, 34.1452, 36.5074, 38.9635, 41.5435, 44.2892, 47.2638, 50.5732, 54.4265};
    519519  static const G4double X5[nX]={.0999307,
    520         5.25720,        8.11389,        10.5375,        12.7425,        14.8152,        16.8015,        18.7296,        20.6194,        22.4855,        24.3398,
    521         26.1924,        28.0527,        29.9295,        31.8320,        33.7699,        35.7541,        37.7975,        39.9158,        42.1290,        44.4649};
     520 5.25720, 8.11389, 10.5375, 12.7425, 14.8152, 16.8015, 18.7296, 20.6194, 22.4855, 24.3398,
     521 26.1924, 28.0527, 29.9295, 31.8320, 33.7699, 35.7541, 37.7975, 39.9158, 42.1290, 44.4649};
    522522  static const G4double X6[nX]={.0276367,
    523         3.53378,        5.41553,        6.99413,        8.41629,        9.74057,        10.9978,        12.2066,        13.3796,        14.5257,        15.6519,
    524         16.7636,        17.8651,        18.9603,        20.0527,        21.1453,        22.2411,        23.3430,        24.4538,        25.5765,        26.7148};
     523 3.53378, 5.41553, 6.99413, 8.41629, 9.74057, 10.9978, 12.2066, 13.3796, 14.5257, 15.6519,
     524 16.7636, 17.8651, 18.9603, 20.0527, 21.1453, 22.2411, 23.3430, 24.4538, 25.5765, 26.7148};
    525525  static const G4double X7[nX]={.00472383,
    526         2.08253,        3.16946,        4.07178,        4.87742,        5.62140,        6.32202,        6.99034,        7.63368,        8.25720,        8.86473,
    527         9.45921,        10.0430,        10.6179,        11.1856,        11.7475,        12.3046,        12.8581,        13.4089,        13.9577,        14.5057};
     526 2.08253, 3.16946, 4.07178, 4.87742, 5.62140, 6.32202, 6.99034, 7.63368, 8.25720, 8.86473,
     527 9.45921, 10.0430, 10.6179, 11.1856, 11.7475, 12.3046, 12.8581, 13.4089, 13.9577, 14.5057};
    528528  static const G4double X8[nX]={.000630783,
    529         1.22723,        1.85845,        2.37862,        2.84022,        3.26412,        3.66122,        4.03811,        4.39910,        4.74725,        5.08480,
    530         5.41346,        5.73457,        6.04921,        6.35828,        6.66250,        6.96250,        7.25884,        7.55197,        7.84232,        8.13037};
     529 1.22723, 1.85845, 2.37862, 2.84022, 3.26412, 3.66122, 4.03811, 4.39910, 4.74725, 5.08480,
     530 5.41346, 5.73457, 6.04921, 6.35828, 6.66250, 6.96250, 7.25884, 7.55197, 7.84232, 8.13037};
    531531  static const G4double X9[nX]={7.49179e-05,
    532         .772574,        1.16623,        1.48914,        1.77460,        2.03586,        2.27983,        2.51069,        2.73118,        2.94322,        3.14823,
    533         3.34728,        3.54123,        3.73075,        3.91638,        4.09860,        4.27779,        4.45428,        4.62835,        4.80025,        4.97028};
     532 .772574, 1.16623, 1.48914, 1.77460, 2.03586, 2.27983, 2.51069, 2.73118, 2.94322, 3.14823,
     533 3.34728, 3.54123, 3.73075, 3.91638, 4.09860, 4.27779, 4.45428, 4.62835, 4.80025, 4.97028};
    534534  static const G4double XA[nX]={8.43437e-06,
    535         .530035,        .798454,        1.01797,        1.21156,        1.38836,        1.55313,        1.70876,        1.85712,        1.99956,        2.13704,
    536         2.27031,        2.39994,        2.52640,        2.65007,        2.77127,        2.89026,        3.00726,        3.12248,        3.23607, 3.34823};
     535 .530035, .798454, 1.01797, 1.21156, 1.38836, 1.55313, 1.70876, 1.85712, 1.99956, 2.13704,
     536 2.27031, 2.39994, 2.52640, 2.65007, 2.77127, 2.89026, 3.00726, 3.12248, 3.23607, 3.34823};
    537537  static const G4double XB[nX]={9.27028e-07,
    538         .395058,        .594211,        .756726,        .899794,        1.03025,        1.15167,        1.26619,        1.37523,        1.47979,        1.58059,
    539         1.67819,        1.77302,        1.86543,        1.95571,        2.04408,        2.13074,        2.21587,        2.29960,        2.38206, 2.46341};
     538 .395058, .594211, .756726, .899794, 1.03025, 1.15167, 1.26619, 1.37523, 1.47979, 1.58059,
     539 1.67819, 1.77302, 1.86543, 1.95571, 2.04408, 2.13074, 2.21587, 2.29960, 2.38206, 2.46341};
    540540  static const G4double XC[nX]={1.00807e-07,
    541         .316195,        .474948,        .604251,        .717911,        .821417,        .917635,        1.00829,        1.09452,        1.17712,        1.25668,
    542         1.33364,        1.40835,        1.48108,        1.55207,        1.62150,        1.68954,        1.75631,        1.82193,        1.88650, 1.95014};
     541 .316195, .474948, .604251, .717911, .821417, .917635, 1.00829, 1.09452, 1.17712, 1.25668,
     542 1.33364, 1.40835, 1.48108, 1.55207, 1.62150, 1.68954, 1.75631, 1.82193, 1.88650, 1.95014};
    543543  static const G4double XD[nX]={1.09102e-08,
    544         .268227,        .402318,        .511324,        .606997,        .694011,        .774803,        .850843,        .923097,        .992243,        1.05878,
    545         1.12309,        1.18546,        1.24613,        1.30530,        1.36313,        1.41974,        1.47526,        1.52978,        1.58338,        1.63617};
     544 .268227, .402318, .511324, .606997, .694011, .774803, .850843, .923097, .992243, 1.05878,
     545 1.12309, 1.18546, 1.24613, 1.30530, 1.36313, 1.41974, 1.47526, 1.52978, 1.58338, 1.63617};
    546546  static const G4double XE[nX]={1.17831e-09,
    547         .238351,        .356890,        .453036,        .537277,        .613780,        .684719,        .751405,        .814699,        .875208,        .933374,
    548         .989535,        1.04396,        1.09685,        1.14838,        1.19870,        1.24792,        1.29615,        1.34347,        1.38996, 1.43571};
     547 .238351, .356890, .453036, .537277, .613780, .684719, .751405, .814699, .875208, .933374,
     548 .989535, 1.04396, 1.09685, 1.14838, 1.19870, 1.24792, 1.29615, 1.34347, 1.38996, 1.43571};
    549549  static const G4double XF[nX]={1.27141e-10,
    550         .219778,        .328346,        .416158,        .492931,        .562525,        .626955,        .687434,        .744761,        .799494,        .852046,
    551         .902729,        .951786,        .999414,        1.04577,        1.09099,        1.13518,        1.17844,        1.22084,        1.26246,        1.30338};
     550 .219778, .328346, .416158, .492931, .562525, .626955, .687434, .744761, .799494, .852046,
     551 .902729, .951786, .999414, 1.04577, 1.09099, 1.13518, 1.17844, 1.22084, 1.26246, 1.30338};
    552552  static const G4double XG[nX]={1.3713e-11,
    553         .208748,        .310948,        .393310,        .465121,        .530069,        .590078,        .646306,        .699515,        .750239,        .798870,
    554         .845707,        .890982,        .934882,        .977559,        1.01914,        1.05973,        1.09941,        1.13827,        1.17637, 1.21379};
     553 .208748, .310948, .393310, .465121, .530069, .590078, .646306, .699515, .750239, .798870,
     554 .845707, .890982, .934882, .977559, 1.01914, 1.05973, 1.09941, 1.13827, 1.17637, 1.21379};
    555555  static const G4double XH[nX]={1.47877e-12,
    556         .203089,        .301345,        .380162,        .448646,        .510409,        .567335,        .620557,        .670820,        .718647,        .764421,
    557         .808434,        .850914,        .892042,        .931967,        .970812,        1.00868,        1.04566,        1.08182,        1.11724, 1.15197};
     556 .203089, .301345, .380162, .448646, .510409, .567335, .620557, .670820, .718647, .764421,
     557 .808434, .850914, .892042, .931967, .970812, 1.00868, 1.04566, 1.08182, 1.11724, 1.15197};
    558558  static const G4double XI[nX]={1.59454e-13,
    559         .201466,        .297453,        .374007,        .440245,        .499779,        .554489,        .605506,        .653573,        .699213,        .742806,
    560         .784643,        .824952,        .863912,        .901672,        .938353,        .974060,        1.00888,        1.04288,        1.07614,        1.10872};
     559 .201466, .297453, .374007, .440245, .499779, .554489, .605506, .653573, .699213, .742806,
     560 .784643, .824952, .863912, .901672, .938353, .974060, 1.00888, 1.04288, 1.07614, 1.10872};
    561561  static const G4double XJ[nX]={1.71931e-14,
    562         .202988,        .297870,        .373025,        .437731,        .495658,        .548713,        .598041,        .644395,        .688302,        .730147,
    563         .770224,        .808762,        .845943,        .881916,        .916805,        .950713,        .983728,        1.01592,        1.04737, 1.07813};
     562 .202988, .297870, .373025, .437731, .495658, .548713, .598041, .644395, .688302, .730147,
     563 .770224, .808762, .845943, .881916, .916805, .950713, .983728, 1.01592, 1.04737, 1.07813};
    564564  // Direct table
    565565  static const G4double Xmin[nE]={X0[0],X1[0],X2[0],X3[0],X4[0],X5[0],X6[0],X7[0],X8[0],
     
    574574                             {X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,XA,XB,XC,XD,XE,XF,XG,XH,XI,XJ};
    575575  static const G4double I0[nX]={0,
    576         .411893,        1.25559,        2.34836,        3.60264,        4.96046,        6.37874,        7.82342,        9.26643,        10.6840,        12.0555,
    577         13.3628,        14.5898,        15.7219,        16.7458,        17.6495,        18.4217,        19.0523,        19.5314,        19.8501, 20.0000};
     576 .411893, 1.25559, 2.34836, 3.60264, 4.96046, 6.37874, 7.82342, 9.26643, 10.6840, 12.0555,
     577 13.3628, 14.5898, 15.7219, 16.7458, 17.6495, 18.4217, 19.0523, 19.5314, 19.8501, 20.0000};
    578578  static const G4double I1[nX]={0,
    579         .401573,        1.22364,        2.28998,        3.51592,        4.84533,        6.23651,        7.65645,        9.07796,        10.4780,        11.8365,
    580         13.1360,        14.3608,        15.4967,        16.5309,        17.4516,        18.2481,        18.9102,        19.4286,        19.7946, 20.0000};
     579 .401573, 1.22364, 2.28998, 3.51592, 4.84533, 6.23651, 7.65645, 9.07796, 10.4780, 11.8365,
     580 13.1360, 14.3608, 15.4967, 16.5309, 17.4516, 18.2481, 18.9102, 19.4286, 19.7946, 20.0000};
    581581  static const G4double I2[nX]={0,
    582         .387599,        1.17339,        2.19424,        3.37090,        4.65066,        5.99429,        7.37071,        8.75427,        10.1232,        11.4586,
    583         12.7440,        13.9644,        15.1065,        16.1582,        17.1083,        17.9465,        18.6634,        19.2501,        19.6982, 20.0000};
     582 .387599, 1.17339, 2.19424, 3.37090, 4.65066, 5.99429, 7.37071, 8.75427, 10.1232, 11.4586,
     583 12.7440, 13.9644, 15.1065, 16.1582, 17.1083, 17.9465, 18.6634, 19.2501, 19.6982, 20.0000};
    584584  static const G4double I3[nX]={0,
    585         .366444,        1.09391,        2.04109,        3.13769,        4.33668,        5.60291,        6.90843,        8.23014,        9.54840,        10.8461,
    586         12.1083,        13.3216,        14.4737,        15.5536,        16.5512,        17.4573,        18.2630,        18.9603,        19.5417, 20.0000};
     585 .366444, 1.09391, 2.04109, 3.13769, 4.33668, 5.60291, 6.90843, 8.23014, 9.54840, 10.8461,
     586 12.1083, 13.3216, 14.4737, 15.5536, 16.5512, 17.4573, 18.2630, 18.9603, 19.5417, 20.0000};
    587587  static const G4double I4[nX]={0,
    588         .321962,        .959681,        1.79769,        2.77753,        3.85979,        5.01487,        6.21916,        7.45307,        8.69991,        9.94515,
    589         11.1759,        12.3808,        13.5493,        14.6720,        15.7402,        16.7458,        17.6813,        18.5398,        19.3148, 20.0000};
     588 .321962, .959681, 1.79769, 2.77753, 3.85979, 5.01487, 6.21916, 7.45307, 8.69991, 9.94515,
     589 11.1759, 12.3808, 13.5493, 14.6720, 15.7402, 16.7458, 17.6813, 18.5398, 19.3148, 20.0000};
    590590  static const G4double I5[nX]={0,
    591         .257215,        .786302,        1.49611,        2.34049,        3.28823,        4.31581,        5.40439,        6.53832,        7.70422,        8.89040,
    592         10.0865,        11.2833,        12.4723,        13.6459,        14.7969,        15.9189,        17.0058,        18.0517,        19.0515, 20.0000};
     591 .257215, .786302, 1.49611, 2.34049, 3.28823, 4.31581, 5.40439, 6.53832, 7.70422, 8.89040,
     592 10.0865, 11.2833, 12.4723, 13.6459, 14.7969, 15.9189, 17.0058, 18.0517, 19.0515, 20.0000};
    593593  static const G4double I6[nX]={0,
    594         .201608,        .638914,        1.24035,        1.97000,        2.80354,        3.72260,        4.71247,        5.76086,        6.85724,        7.99243,
    595         9.15826,        10.3474,        11.5532,        12.7695,        13.9907,        15.2117,        16.4275,        17.6337,        18.8258, 20.0000};
     594 .201608, .638914, 1.24035, 1.97000, 2.80354, 3.72260, 4.71247, 5.76086, 6.85724, 7.99243,
     595 9.15826, 10.3474, 11.5532, 12.7695, 13.9907, 15.2117, 16.4275, 17.6337, 18.8258, 20.0000};
    596596  static const G4double I7[nX]={0,
    597         .168110,        .547208,        1.07889,        1.73403,        2.49292,        3.34065,        4.26525,        5.25674,        6.30654,        7.40717,
    598         8.55196,        9.73492,        10.9506,        12.1940,        13.4606,        14.7460,        16.0462,        17.3576,        18.6767, 20.0000};
     597 .168110, .547208, 1.07889, 1.73403, 2.49292, 3.34065, 4.26525, 5.25674, 6.30654, 7.40717,
     598 8.55196, 9.73492, 10.9506, 12.1940, 13.4606, 14.7460, 16.0462, 17.3576, 18.6767, 20.0000};
    599599  static const G4double I8[nX]={0,
    600         .150652,        .497557,        .990048,        1.60296,        2.31924,        3.12602,        4.01295,        4.97139,        5.99395,        7.07415,
    601         8.20621,        9.38495,        10.6057,        11.8641,        13.1561,        14.4781,        15.8267,        17.1985,        18.5906, 20.0000};
     600 .150652, .497557, .990048, 1.60296, 2.31924, 3.12602, 4.01295, 4.97139, 5.99395, 7.07415,
     601 8.20621, 9.38495, 10.6057, 11.8641, 13.1561, 14.4781, 15.8267, 17.1985, 18.5906, 20.0000};
    602602  static const G4double I9[nX]={0,
    603         .141449,        .470633,        .941304,        1.53053,        2.22280,        3.00639,        3.87189,        4.81146,        5.81837,        6.88672,
    604         8.01128,        9.18734,        10.4106,        11.6772,        12.9835,        14.3261,        15.7019,        17.1080,        18.5415, 20.0000};
     603 .141449, .470633, .941304, 1.53053, 2.22280, 3.00639, 3.87189, 4.81146, 5.81837, 6.88672,
     604 8.01128, 9.18734, 10.4106, 11.6772, 12.9835, 14.3261, 15.7019, 17.1080, 18.5415, 20.0000};
    605605  static const G4double IA[nX]={0,
    606         .136048,        .454593,        .912075,        1.48693,        2.16457,        2.93400,        3.78639,        4.71437,        5.71163,        6.77265,
    607         7.89252,        9.06683,        10.2916,        11.5631,        12.8780,        14.2331,        .625500,        17.0525,        18.5115, 20.0000};
     606 .136048, .454593, .912075, 1.48693, 2.16457, 2.93400, 3.78639, 4.71437, 5.71163, 6.77265,
     607 7.89252, 9.06683, 10.2916, 11.5631, 12.8780, 14.2331, .625500, 17.0525, 18.5115, 20.0000};
    608608  static const G4double IB[nX]={0,
    609         .132316,        .443455,        .891741,        1.45656,        2.12399,        2.88352,        3.72674,        4.64660,        5.63711,        6.69298,
    610         7.80955,        8.98262,        10.2084,        11.4833,        12.8042,        14.1681,        15.5721,        17.0137,        18.4905, 20.0000};
     609 .132316, .443455, .891741, 1.45656, 2.12399, 2.88352, 3.72674, 4.64660, 5.63711, 6.69298,
     610 7.80955, 8.98262, 10.2084, 11.4833, 12.8042, 14.1681, 15.5721, 17.0137, 18.4905, 20.0000};
    611611  static const G4double IC[nX]={0,
    612         .129197,        .434161,        .874795,        1.43128,        2.09024,        2.84158,        3.67721,        4.59038,        5.57531,        6.62696,
    613         7.74084,        8.91291,        10.1395,        11.4173,        12.7432,        14.1143,        15.5280,        16.9817,        18.4731, 20.0000};
     612 .129197, .434161, .874795, 1.43128, 2.09024, 2.84158, 3.67721, 4.59038, 5.57531, 6.62696,
     613 7.74084, 8.91291, 10.1395, 11.4173, 12.7432, 14.1143, 15.5280, 16.9817, 18.4731, 20.0000};
    614614  static const G4double ID[nX]={0,
    615         .126079,        .424911,        .857980,        1.40626,        2.05689,        2.80020,        3.62840,        4.53504,        5.51456,        6.56212,
    616         7.67342,        8.84458,        10.0721,        11.3527,        12.6836,        14.0618,        15.4849,        16.9504,        18.4562, 20.0000};
     615 .126079, .424911, .857980, 1.40626, 2.05689, 2.80020, 3.62840, 4.53504, 5.51456, 6.56212,
     616 7.67342, 8.84458, 10.0721, 11.3527, 12.6836, 14.0618, 15.4849, 16.9504, 18.4562, 20.0000};
    617617  static const G4double IE[nX]={0,
    618         .122530,        .414424,        .838964,        1.37801,        2.01931,        2.75363,        3.57356,        4.47293,        5.44644,        6.48949,
    619         7.59795,        8.76815,        9.99673,        11.2806,        12.6170,        14.0032,        15.4369,        16.9156,        18.4374, 20.0000};
     618 .122530, .414424, .838964, 1.37801, 2.01931, 2.75363, 3.57356, 4.47293, 5.44644, 6.48949,
     619 7.59795, 8.76815, 9.99673, 11.2806, 12.6170, 14.0032, 15.4369, 16.9156, 18.4374, 20.0000};
    620620  static const G4double IF[nX]={0,
    621         .118199,        .401651,        .815838,        1.34370,        1.97370,        2.69716,        3.50710,        4.39771,        5.36401,        6.40164,
    622         7.50673,        8.67581,        9.90572,        11.1936,        12.5367,        13.9326,        15.3790,        16.8737,        18.4146, 20.0000};
     621 .118199, .401651, .815838, 1.34370, 1.97370, 2.69716, 3.50710, 4.39771, 5.36401, 6.40164,
     622 7.50673, 8.67581, 9.90572, 11.1936, 12.5367, 13.9326, 15.3790, 16.8737, 18.4146, 20.0000};
    623623  static const G4double IG[nX]={0,
    624         .112809,        .385761,        .787075,        1.30103,        1.91700,        2.62697,        3.42451,        4.30424,        5.26158,        6.29249,
    625         7.39341,        8.56112,        9.79269,        11.0855,        12.4369,        13.8449,        15.3071,        16.8216,        18.3865, 20.0000};
     624 .112809, .385761, .787075, 1.30103, 1.91700, 2.62697, 3.42451, 4.30424, 5.26158, 6.29249,
     625 7.39341, 8.56112, 9.79269, 11.0855, 12.4369, 13.8449, 15.3071, 16.8216, 18.3865, 20.0000};
    626626  static const G4double IH[nX]={0,
    627         .106206,        .366267,        .751753,        1.24859,        1.84728,        2.54062,        3.32285,        .189160,        5.13543,        6.15804,
    628         7.25377,        8.41975,        9.65334,        10.9521,        12.3139,        13.7367,        15.2184,        16.7573,        18.3517, 20.0000};
     627 .106206, .366267, .751753, 1.24859, 1.84728, 2.54062, 3.32285, .189160, 5.13543, 6.15804,
     628 7.25377, 8.41975, 9.65334, 10.9521, 12.3139, 13.7367, 15.2184, 16.7573, 18.3517, 20.0000};
    629629  static const G4double II[nX]={0,
    630         .098419,        .343194,        .709850,        1.18628,        1.76430,        2.43772,        3.20159,        4.05176,        4.98467,        5.99722,
    631         7.08663,        8.25043,        9.48633,        10.7923,        12.1663,        13.6067,        15.1118,        16.6800,        18.3099,        20.0000};
     630 .098419, .343194, .709850, 1.18628, 1.76430, 2.43772, 3.20159, 4.05176, 4.98467, 5.99722,
     631 7.08663, 8.25043, 9.48633, 10.7923, 12.1663, 13.6067, 15.1118, 16.6800, 18.3099, 20.0000};
    632632  static const G4double IJ[nX]={0,
    633         .089681,        .317135,        .662319,        1.11536,        1.66960,        2.32002,        3.06260,        3.89397,        4.81126,        5.81196,
    634         6.89382,        8.05483,        9.29317,        10.6072,        11.9952,        13.4560,        14.9881,        16.5902,        18.2612, 20.0000};
     633 .089681, .317135, .662319, 1.11536, 1.66960, 2.32002, 3.06260, 3.89397, 4.81126, 5.81196,
     634 6.89382, 8.05483, 9.29317, 10.6072, 11.9952, 13.4560, 14.9881, 16.5902, 18.2612, 20.0000};
    635635  static const G4double* Il[nE]=
    636636                             {I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH,II,IJ};
    637637  static const G4double lE[nE]={
    638 -1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215,  .459141,        .867068,        1.27499,        1.68292,
    639  2.09085,       2.49877,        2.90670,        3.31463,        3.72255,        4.13048,        4.53840,        4.94633,        5.35426,        5.76218};
     638-1.98842,-1.58049,-1.17256,-.764638,-.356711, .051215, .459141, .867068, 1.27499, 1.68292,
     639 2.09085, 2.49877, 2.90670, 3.31463, 3.72255, 4.13048, 4.53840, 4.94633, 5.35426, 5.76218};
    640640  static const G4double lEmi=lE[0];
    641641  static const G4double lEma=lE[nE-1];
    642642  static const G4double dlE=(lEma-lEmi)/bE;
    643         //***************************************************************************************
     643  //***************************************************************************************
    644644  G4double Enu=lastE;                 // Get energy of the last calculated cross-section
    645645  G4double lEn=std::log(Enu);         // log(E) for interpolation
     
    727727}
    728728
    729 // This class can provide only virtual exchange pi+ (a substitute for W+ boson)
     729// This class can provide only virtual exchange gamma (a substitute for Z0 boson)
    730730G4int G4QNuNuNuclearCrossSection::GetExchangePDGCode() {return 22;}
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QPhotonNuclearCrossSection.cc

    r1007 r1055  
    2626//
    2727// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3636// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3737// ****************************************************************************************
    38 //
     38// Short description: This is an original CHIPS process for photo-nuclear
     39// interactions, which does not include "fast and dirty" corrections for
     40// reactions near threshold, with respect to the GHAD application of CHIPS.
     41// ------------------------------------------------------------------------
     42
    3943//#define debug
    4044//#define pdebug
     
    8589        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    8690        <<colN.size()<<G4endl;
    87                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     91  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    8892#endif
    8993  if(!pPDG)
     
    106110    j  = 0;                            // A#0f records found in DB for this projectile
    107111    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    108            {                                  // The nucleus with projPDG is found in AMDB
     112    {                                  // The nucleus with projPDG is found in AMDB
    109113      if(colN[i]==tgN && colZ[i]==tgZ)
    110                                                 {
     114      {
    111115        lastI=i;
    112116        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    125129        lastP  =colP [i];                // Last Momentum  (A-dependent)
    126130        lastCS =colCS[i];                // Last CrossSect (A-dependent)
    127         //        if(std::fabs(lastP/pMom-1.)<tolerance) // VI do not use tolerance
     131 //        if(std::fabs(lastP/pMom-1.)<tolerance) // VI do not use tolerance
    128132        if(lastP == pMom)
    129133        {
     
    159163#endif
    160164      j++;                             // Increment a#0f records found in DB for this pPDG
    161            }
    162            if(!in)                            // This nucleus has not been calculated previously
    163            {
     165    }
     166    if(!in)                            // This nucleus has not been calculated previously
     167    {
    164168#ifdef pdebug
    165169      G4cout<<"G4QPhCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    168172      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    169173      if(lastCS<=0.)
    170                                                 {
     174      {
    171175        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    172176#ifdef pdebug
     
    180184          lastTH=pEn;
    181185        }
    182                                                 }
     186      }
    183187#ifdef pdebug
    184188      G4cout<<"G4QPhCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    196200#endif
    197201      return lastCS*millibarn;
    198            } // End of creation of the new set of parameters
     202    } // End of creation of the new set of parameters
    199203    else
    200                                 {
     204    {
    201205#ifdef pdebug
    202206      G4cout<<"G4QPrCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    266270  G4double mP= infEn;
    267271  if(Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
    268             mP = G4NucleiProperties::GetNuclearMass(A-1.,Z-1.)/MeV; // ResNucMass for a proton
     272          mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV;// ResNucMass for a proton
    269273
    270274  G4double mN= infEn;
    271275  if(N&&G4NucleiProperties::IsInStableTable(A-1,Z))
    272             mN = G4NucleiProperties::GetNuclearMass(A-1.,Z)/MeV;  // ResNucMass for a neutron
     276          mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV;  // ResNucMass for a neutron
    273277
    274278  G4double mA= infEn;
    275279  if(N>1&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
    276             mA=G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV; // ResNucMass for an alpha
     280          mA=G4NucleiProperties::GetNuclearMass(A-4,Z-2)/MeV; // ResNucMass for an alpha
    277281
    278282  G4double dP= mP +mProt - mT;
     
    280284  G4double dA= mA +mAlph - mT;
    281285#ifdef pdebug
    282                 G4cout<<"G4QPhotoNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
     286  G4cout<<"G4QPhotoNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
    283287        <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
    284288#endif
     
    293297{
    294298#ifdef pdebug
    295                 G4cout<<"G4QPhotonNucCrossSection::CalculateCrossSection: ***Called***"<<G4endl;
     299  G4cout<<"G4QPhotonNucCrossSection::CalculateCrossSection: ***Called***"<<G4endl;
    296300#endif
    297301  static const G4double THmin=2.;  // minimum Energy Threshold
     
    320324  onlyCS=CS;                         // Flag to calculate only CS (not Si/Bi)
    321325#ifdef pdebug
    322                 G4cout<<"G4QPhotonNucCS::CalcCS: P="<<Energy<<", F="<<F<<", I="<<I<<", Z="<<targZ
     326  G4cout<<"G4QPhotonNucCS::CalcCS: P="<<Energy<<", F="<<F<<", I="<<I<<", Z="<<targZ
    323327        <<", N="<<targN<<", onlyCS="<<CS<<",E="<<Energy<<",th="<<THmin<<G4endl;
    324328  if(F==-27) return 0.;
     
    329333    lastSig=0.;
    330334#ifdef pdebug
    331                                 G4cout<<"---> G4QMuonNucCS::CalcCS: CS=0  as E="<<Energy<<" < "<<THmin<<G4endl;
     335    G4cout<<"---> G4QMuonNucCS::CalcCS: CS=0  as E="<<Energy<<" < "<<THmin<<G4endl;
    332336#endif
    333337    return 0.;                      // @@ This can be dangerouse for the heaviest nuc.!
     
    338342  {
    339343    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    340                                 {
     344    {
    341345      lastGDR=GDR[I];                // Pointer to prepared GDR cross sections
    342346      lastHEN=HEN[I];                // Pointer to prepared High Energy cross sections
    343347      lastSP =spA[I];                // Shadowing coefficient for UHE
    344348    }
    345            else                             // This isotope wasn't calculated previously => CREATE
    346            {
     349    else                             // This isotope wasn't calculated previously => CREATE
     350    {
    347351      G4double lnA=std::log(A);          // The nucleus is not found in DB. It is new.
    348352      if(A==1.) lastSP=1.;               // The Reggeon shadowing (A=1)
     
    357361      lastHEN = new G4double[nH];        // Allocate memory for the new HEN cross sections
    358362      G4int er=GetFunctions(A,lastGDR,lastHEN);// set newZeroPosition and fill theFunctions
    359              if(er<1) G4cerr<<"***G4QPhotNucCrosSec::CalcCrossSection: A="<<A<<" failed"<<G4endl;
     363      if(er<1) G4cerr<<"***G4QPhotNucCrosSec::CalcCrossSection: A="<<A<<" failed"<<G4endl;
    360364#ifdef debug
    361365      G4cout<<"G4QPhotonNuclearCrossSec::CalcCS:**GDR/HEN're made** GetFunEr="<<er<<G4endl;
     
    367371      HEN.push_back(lastHEN);            // added HEN, found by AH 10/7/02
    368372      spA.push_back(lastSP);             // Pomeron Shadowing
    369            } // End of creation of the new set of parameters
     373    } // End of creation of the new set of parameters
    370374  } // End of parameters udate
    371375  // ============================== NOW the Magic Formula =================================
     
    374378  {
    375379#ifdef debug
    376            G4cout<<"G4QPhNCS::CalcCS:bGDR A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dE="<<dE<<G4endl;
     380    G4cout<<"G4QPhNCS::CalcCS:bGDR A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dE="<<dE<<G4endl;
    377381#endif
    378382    if(A<=1.) sigma=0.;
    379383    else      sigma=EquLinearFit(Energy,nL,THmin,dE,lastGDR);
    380384#ifdef debugn
    381            if(sigma<0.)
     385    if(sigma<0.)
    382386      G4cout<<"G4QPhoNucCS::CalcCS:A="<<A<<",E="<<Energy<<",T="<<THmin<<",dE="<<dE<<G4endl;
    383387#endif
     
    569573  static const G4double SL9[nL]={
    570574    3.243985e-4,1.122034e-3,3.000932e-3,6.850212e-3,1.414720e-2,2.751937e-2,5.204925e-2,
    571                                 9.887958e-2,1.966468e-1,4.282973e-1,1.041076e+0,2.706630e+0,6.509565e+0,1.085114e+1,
    572                                 1.162472e+1,1.124054e+1,1.202416e+1,1.402207e+1,1.659634e+1,1.891975e+1,2.032292e+1,
    573                                 2.059083e+1,1.993672e+1,1.873926e+1,1.732572e+1,1.590211e+1,1.457097e+1,1.336993e+1,
    574                                 1.230272e+1,1.135820e+1,1.052046e+1,9.773672e+0,9.103884e+0,8.499562e+0,7.951408e+0,
    575                                 7.451996e+0,6.995366e+0,6.576679e+0,6.191930e+0,5.837748e+0,5.511235e+0,5.209864e+0,
    576                                 4.931401e+0,4.673850e+0,4.435420e+0,4.214488e+0,4.009588e+0,3.819384e+0,3.642664e+0,
    577                                 3.478323e+0,3.325356e+0,3.182848e+0,3.049964e+0,2.925943e+0,2.810093e+0,2.701782e+0,
    578                                 2.600432e+0,2.505518e+0,2.416558e+0,2.333114e+0,2.254783e+0,2.181197e+0,2.112021e+0,
    579                                 2.046943e+0,1.985682e+0,1.927976e+0,1.873586e+0,1.822292e+0,1.773891e+0,1.728195e+0,
    580                                 1.685032e+0,1.644242e+0,1.605677e+0,1.569201e+0,1.534686e+0,1.502017e+0,1.471082e+0,
    581                                 1.441781e+0,1.414020e+0,1.387711e+0,1.362772e+0,1.339127e+0,1.316705e+0,1.295438e+0,
    582                                 1.275266e+0,1.256130e+0,1.237976e+0,1.220753e+0,1.204413e+0,1.188912e+0,1.174209e+0,
    583                                 1.160265e+0,1.147042e+0,1.134507e+0,1.122628e+0,1.111376e+0,1.100721e+0,1.090639e+0,
    584                                 1.081106e+0,1.072098e+0,1.063597e+0,1.055582e+0,1.048036e+0,1.040943e+0,1.034290e+0};
     575    9.887958e-2,1.966468e-1,4.282973e-1,1.041076e+0,2.706630e+0,6.509565e+0,1.085114e+1,
     576    1.162472e+1,1.124054e+1,1.202416e+1,1.402207e+1,1.659634e+1,1.891975e+1,2.032292e+1,
     577    2.059083e+1,1.993672e+1,1.873926e+1,1.732572e+1,1.590211e+1,1.457097e+1,1.336993e+1,
     578    1.230272e+1,1.135820e+1,1.052046e+1,9.773672e+0,9.103884e+0,8.499562e+0,7.951408e+0,
     579    7.451996e+0,6.995366e+0,6.576679e+0,6.191930e+0,5.837748e+0,5.511235e+0,5.209864e+0,
     580    4.931401e+0,4.673850e+0,4.435420e+0,4.214488e+0,4.009588e+0,3.819384e+0,3.642664e+0,
     581    3.478323e+0,3.325356e+0,3.182848e+0,3.049964e+0,2.925943e+0,2.810093e+0,2.701782e+0,
     582    2.600432e+0,2.505518e+0,2.416558e+0,2.333114e+0,2.254783e+0,2.181197e+0,2.112021e+0,
     583    2.046943e+0,1.985682e+0,1.927976e+0,1.873586e+0,1.822292e+0,1.773891e+0,1.728195e+0,
     584    1.685032e+0,1.644242e+0,1.605677e+0,1.569201e+0,1.534686e+0,1.502017e+0,1.471082e+0,
     585    1.441781e+0,1.414020e+0,1.387711e+0,1.362772e+0,1.339127e+0,1.316705e+0,1.295438e+0,
     586    1.275266e+0,1.256130e+0,1.237976e+0,1.220753e+0,1.204413e+0,1.188912e+0,1.174209e+0,
     587    1.160265e+0,1.147042e+0,1.134507e+0,1.122628e+0,1.111376e+0,1.100721e+0,1.090639e+0,
     588    1.081106e+0,1.072098e+0,1.063597e+0,1.055582e+0,1.048036e+0,1.040943e+0,1.034290e+0};
    585589  static const G4double SL10[nL]={
    586590    4.311217e-4,1.384716e-3,3.549518e-3,7.988549e-3,1.667330e-2,3.341344e-2,6.552895e-2,
     
    713717  static const G4double SL18[nL]={
    714718    2.220534e-3,5.640053e-3,1.253572e-2,2.881392e-2,7.191580e-2,1.859408e-1,4.687157e-1,
    715                                 1.115760e+0,2.485562e+0,5.183559e+0,1.013008e+1,1.847496e+1,3.103145e+1,4.701870e+1,
    716                                 6.345164e+1,7.777111e+1,8.950804e+1,9.321427e+1,8.410731e+1,6.975786e+1,5.670984e+1,
    717                                 4.641759e+1,3.856198e+1,3.257293e+1,2.796698e+1,2.438084e+1,2.154901e+1,1.927832e+1,
    718                                 1.742802e+1,1.589540e+1,1.460538e+1,1.350313e+1,1.254846e+1,1.171188e+1,1.097157e+1,
    719                                 1.031123e+1,9.718498e+0,9.183826e+0,8.699693e+0,8.260038e+0,7.859873e+0,7.495011e+0,
    720                                 7.161876e+0,6.857372e+0,6.578785e+0,6.323715e+0,6.090025e+0,5.875801e+0,5.679326e+0,
    721                                 5.499048e+0,5.333567e+0,5.181614e+0,5.042039e+0,4.913795e+0,4.795932e+0,4.687583e+0,
    722                                 4.587960e+0,4.496341e+0,4.412068e+0,4.334539e+0,4.263201e+0,4.197551e+0,4.137125e+0,
    723                                 4.081496e+0,4.030275e+0,3.983101e+0,3.939643e+0,3.899598e+0,3.862684e+0,3.828641e+0,
    724                                 3.797233e+0,3.768237e+0,3.741451e+0,3.716686e+0,3.693770e+0,3.672542e+0,3.652854e+0,
    725                                 3.634571e+0,3.617565e+0,3.601721e+0,3.586931e+0,3.573099e+0,3.560132e+0,3.547947e+0,
    726                                 3.536470e+0,3.525629e+0,3.515361e+0,3.505610e+0,3.496321e+0,3.487449e+0,3.478950e+0,
    727                                 3.470787e+0,3.462928e+0,3.455342e+0,3.448006e+0,3.440898e+0,3.434002e+0,3.427303e+0,
    728                                 3.420792e+0,3.414463e+0,3.408314e+0,3.402345e+0,3.396560e+0,3.390968e+0,3.385579e+0};
     719    1.115760e+0,2.485562e+0,5.183559e+0,1.013008e+1,1.847496e+1,3.103145e+1,4.701870e+1,
     720    6.345164e+1,7.777111e+1,8.950804e+1,9.321427e+1,8.410731e+1,6.975786e+1,5.670984e+1,
     721    4.641759e+1,3.856198e+1,3.257293e+1,2.796698e+1,2.438084e+1,2.154901e+1,1.927832e+1,
     722    1.742802e+1,1.589540e+1,1.460538e+1,1.350313e+1,1.254846e+1,1.171188e+1,1.097157e+1,
     723    1.031123e+1,9.718498e+0,9.183826e+0,8.699693e+0,8.260038e+0,7.859873e+0,7.495011e+0,
     724    7.161876e+0,6.857372e+0,6.578785e+0,6.323715e+0,6.090025e+0,5.875801e+0,5.679326e+0,
     725    5.499048e+0,5.333567e+0,5.181614e+0,5.042039e+0,4.913795e+0,4.795932e+0,4.687583e+0,
     726    4.587960e+0,4.496341e+0,4.412068e+0,4.334539e+0,4.263201e+0,4.197551e+0,4.137125e+0,
     727    4.081496e+0,4.030275e+0,3.983101e+0,3.939643e+0,3.899598e+0,3.862684e+0,3.828641e+0,
     728    3.797233e+0,3.768237e+0,3.741451e+0,3.716686e+0,3.693770e+0,3.672542e+0,3.652854e+0,
     729    3.634571e+0,3.617565e+0,3.601721e+0,3.586931e+0,3.573099e+0,3.560132e+0,3.547947e+0,
     730    3.536470e+0,3.525629e+0,3.515361e+0,3.505610e+0,3.496321e+0,3.487449e+0,3.478950e+0,
     731    3.470787e+0,3.462928e+0,3.455342e+0,3.448006e+0,3.440898e+0,3.434002e+0,3.427303e+0,
     732    3.420792e+0,3.414463e+0,3.408314e+0,3.402345e+0,3.396560e+0,3.390968e+0,3.385579e+0};
    729733  static const G4double SL19[nL]={
    730734    2.305897e-3,5.842654e-3,1.297593e-2,2.991119e-2,7.506153e-2,1.950960e-1,4.938019e-1,
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QProtonNuclearCrossSection.cc

    r1007 r1055  
    2626//
    2727// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3737// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
    3838// ****************************************************************************************
     39// Short description: CHIPS cross-sections for proton-nuclear interactions
     40// -----------------------------------------------------------------------
    3941//
    4042//#define debug
     
    6870                                                       G4int tgZ, G4int tgN, G4int)
    6971{
    70   static G4int j;                      // A#0f records found in DB for this projectile
     72  static G4double tolerance=0.001;     // Tolerance (0.1%) to consider as "the same mom"
     73  static G4int j;                      // A#0f Z/N-records already tested in AMDB
    7174  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
    7275  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
     
    7578  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
    7679  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
    77   G4double pEn=pMom;
    78 #ifdef pdebug
     80#ifdef debug
    7981  G4cout<<"G4QPrCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
    80         <<"("<<lastN<<"),PDG=2212, P="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
     82        <<"("<<lastN<<"),PDG=2212, thresh="<<lastTH<<",Sz="<<colN.size()<<G4endl;
    8183#endif
    8284  G4bool in=false;                     // By default the isotope must be found in the AMDB
     
    8991    lastI   = colN.size();             // Size of the Associative Memory DB in the heap
    9092    j  = 0;                            // A#0f records found in DB for this projectile
    91     if(lastI) for(G4int i=0; i<lastI; i++) // The partType is found
    92            {                                  // The nucleus with is found in AMDB
    93       if(colN[i]==tgN && colZ[i]==tgZ)
    94                                                 {
    95         lastI=i;
    96         lastTH =colTH[i];                // Last THreshold (A-dependent)
    97 #ifdef pdebug
     93#ifdef debug
     94    G4cout<<"G4QPrCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<G4endl;
     95#endif
     96    if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
     97    {
     98      if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
     99      {
     100        lastI=i;                       // Remember the index for future fast/last use
     101        lastTH =colTH[i];              // The last THreshold (A-dependent)
     102#ifdef debug
    98103        G4cout<<"G4QPrCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
    99104#endif
    100         if(pEn<=lastTH)
     105        if(pMom<=lastTH)
    101106        {
    102 #ifdef pdebug
    103           G4cout<<"G4QPrCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
    104 #endif
    105           return 0.;                     // Energy is below the Threshold value
     107#ifdef debug
     108          G4cout<<"G4QPCS::GetCS:Found,P="<<pMom<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
     109#endif
     110          return 0.;                   // Energy is below the Threshold value
    106111        }
    107         lastP  =colP [i];                // Last Momentum  (A-dependent)
    108         lastCS =colCS[i];                // Last CrossSect (A-dependent)
    109         //        if(std::fabs(lastP/pMom-1.)<tolerance)
    110         if(lastP==pMom)                  // VI do not use tolerance
     112        lastP  =colP [i];              // Last Momentum  (A-dependent)
     113        lastCS =colCS[i];              // Last CrossSect (A-dependent)
     114        if(std::fabs(lastP-pMom)<tolerance*pMom)
     115        //if(lastP==pMom)              // VI do not use tolerance
    111116        {
    112 #ifdef pdebug
    113           G4cout<<"G4QPrCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
    114 #endif
    115           CalculateCrossSection(fCS,-1,j,2212,lastZ,lastN,pMom); // Update param's only
     117#ifdef debug
     118          G4cout<<"..G4QPrCS::GetCS:.DoNothing.P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
     119#endif
     120          //CalculateCrossSection(fCS,-1,j,2212,lastZ,lastN,pMom); // Update param's only
    116121          return lastCS*millibarn;     // Use theLastCS
    117122        }
    118         in = true;                       // This is the case when the isotop is found in DB
     123        in = true;                     // This is the case when the isotop is found in DB
    119124        // Momentum pMom is in IU ! @@ Units
    120 #ifdef pdebug
     125#ifdef debug
    121126        G4cout<<"G4QPrCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
    122127#endif
    123128        lastCS=CalculateCrossSection(fCS,-1,j,2212,lastZ,lastN,pMom); // read & update
    124 #ifdef pdebug
     129#ifdef debug
    125130        G4cout<<"G4QPrCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
    126131#endif
    127         if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
     132        if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
    128133        {
    129 #ifdef pdebug
    130           G4cout<<"G4QPrCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
    131 #endif
    132           lastTH=pEn;
     134#ifdef debug
     135          G4cout<<"G4QPrCS::GetCS: New P="<<pMom<<"(CS=0) > Threshold="<<lastTH<<G4endl;
     136#endif
     137          lastCS=0.;
     138          lastTH=pMom;
    133139        }
    134         break;                           // Go out of the LOOP
    135       }
    136 #ifdef pdebug
     140        break;                         // Go out of the LOOP
     141      }
     142#ifdef debug
    137143      G4cout<<"-->G4QPrCrossSec::GetCrosSec: pPDG=2212, j="<<j<<", N="<<colN[i]
    138144            <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
    139145#endif
    140146      j++;                             // Increment a#0f records found in DB
    141            }
    142            if(!in)                            // This nucleus has not been calculated previously
    143            {
    144 #ifdef pdebug
    145       G4cout<<"G4QPrCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     147    }
     148#ifdef debug
     149    G4cout<<"-?-G4QPrCS::GetCS:RC Z="<<tgZ<<",N="<<tgN<<",in="<<in<<",j="<<j<<" ?"<<G4endl;
     150#endif
     151    if(!in)                            // This isotope has not been calculated previously
     152    {
     153#ifdef debug
     154      G4cout<<"^^^G4QPrCS::GetCS:CalcNew P="<<pMom<<", f="<<fCS<<", lastI="<<lastI<<G4endl;
    146155#endif
    147156      //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
    148157      lastCS=CalculateCrossSection(fCS,0,j,2212,lastZ,lastN,pMom); //calculate & create
    149       if(lastCS<=0.)
    150                                                 {
     158      if(lastCS>0.)                   // It means that the AMBD was initialized
     159      {
     160
    151161        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    152 #ifdef pdebug
    153         G4cout<<"G4QPrCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
    154 #endif
    155         if(pEn>lastTH)
    156         {
    157 #ifdef pdebug
    158           G4cout<<"G4QPrCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
    159 #endif
    160           lastTH=pEn;
    161         }
    162                                                 }
    163 #ifdef pdebug
    164       G4cout<<"G4QPrCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
    165 #endif
    166       colN.push_back(tgN);
    167       colZ.push_back(tgZ);
    168       colP.push_back(pMom);
    169       colTH.push_back(lastTH);
    170       colCS.push_back(lastCS);
     162#ifdef debug
     163        G4cout<<"G4QPrCrossSection::GetCrossSect: NewThresh="<<lastTH<<",P="<<pMom<<G4endl;
     164#endif
     165        colN.push_back(tgN);
     166        colZ.push_back(tgZ);
     167        colP.push_back(pMom);
     168        colTH.push_back(lastTH);
     169        colCS.push_back(lastCS);
     170#ifdef debug
     171        G4cout<<"G4QPrCS::GetCrosSec:recCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     172#endif
     173      }
    171174#ifdef pdebug
    172175      G4cout<<"G4QPrCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
    173176#endif
    174177      return lastCS*millibarn;
    175            } // End of creation of the new set of parameters
     178    } // End of creation of the new set of parameters
    176179    else
    177                                 {
    178 #ifdef pdebug
     180    {
     181#ifdef debug
    179182      G4cout<<"G4QPrCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
    180183#endif
     
    183186    }
    184187  } // End of parameters udate
    185   else if(pEn<=lastTH)
    186   {
    187 #ifdef pdebug
    188     G4cout<<"G4QPrCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
     188  else if(pMom<=lastTH)
     189  {
     190#ifdef debug
     191    G4cout<<"G4QPrCS::GetCS: Current P="<<pMom<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
    189192#endif
    190193    return 0.;                         // Momentum is below the Threshold Value -> CS=0
    191194  }
    192   //  else if(std::fabs(lastP/pMom-1.)<tolerance)
    193   else if(lastP==pMom)                // VI do not use tolerance
    194   {
    195 #ifdef pdebug
    196     G4cout<<"G4QPrCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
    197 #endif
    198     return lastCS*millibarn;     // Use theLastCS
    199   }
    200   else
    201   {
    202 #ifdef pdebug
    203     G4cout<<"G4QPrCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
    204 #endif
    205     lastCS=CalculateCrossSection(fCS,1,j,2212,lastZ,lastN,pMom); // Only UpdateDB
     195  else if(std::fabs(lastP-pMom)<tolerance*pMom)
     196  //else if(lastP==pMom)               // VI do not use tolerance
     197  {
     198#ifdef debug
     199    G4cout<<"..G4QPCS::GetCS:OldNZ&P="<<lastP<<"="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
     200#endif
     201    return lastCS*millibarn;           // Use theLastCS
     202  }
     203  else                                 // It is the last used -> use the current tables
     204  {
     205#ifdef debug
     206    G4cout<<"-!-G4QPCS::GetCS:UseCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
     207#endif
     208    lastCS=CalculateCrossSection(fCS,1,j,2212,lastZ,lastN,pMom); // Only read and UpdateDB
    206209    lastP=pMom;
    207210  }
    208 #ifdef pdebug
    209   G4cout<<"G4QPrCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
     211#ifdef debug
     212  G4cout<<"==>G4QPrCS::GetCroSec: P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
    210213#endif
    211214  return lastCS*millibarn;
     
    216219                                        G4int, G4int targZ, G4int targN, G4double Momentum)
    217220{
    218   static const G4double THmin=27.;     // minimum Momentum (MeV/c) Threshold
     221  static const G4double THmin=27.;     // default minimum Momentum (MeV/c) Threshold
    219222  static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
    220223  static const G4double dP=10.;        // step for the LEN (Low ENergy) table MeV/c
     
    227230  static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
    228231  static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
    229   static const G4double milPG=std::log(.001*Pmin);// Low logarithm energy for the HEN part GeV/c
     232  static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
    230233  //
    231234  // Associative memory for acceleration
     
    234237  static std::vector <G4double*> HEN;  // Vector of pointers to HighEnProtonCrossSection
    235238#ifdef debug
    236   G4cout<<"G4QProtonNuclearCS::CalcCS: N="<<targN<<",Z="<<targZ<<",P="<<Momentum<<G4endl;
    237 #endif
    238   if (Momentum<THmin) return 0.;       // @@ This can be dangerouse for the heaviest nuc.!
     239  G4cout<<"G4QProtNCS::CalCS:N="<<targN<<",Z="<<targZ<<",P="<<Momentum<<">"<<THmin<<G4endl;
     240#endif
     241  if (Momentum<THmin) return 0.;       // @@ This can be dangerouse for the heaviest nuc.?!
    239242  G4double sigma=0.;
    240243  if(F&&I) sigma=0.;                   // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
    241244  G4double A=targN+targZ;              // A of the target
    242   if(F<=0)                           // This isotope was not the last used isotop
    243   {
    244     if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    245                                 {
    246       lastLEN=LEN[I];                // Pointer to prepared LowEnergy cross sections
    247       lastHEN=HEN[I];                // Pointer to prepared High Energy cross sections
    248     }
    249            else                             // This isotope wasn't calculated previously => CREATE
    250            {
    251       lastLEN = new G4double[nL];    // Allocate memory for the new LEN cross sections
    252       lastHEN = new G4double[nH];    // Allocate memory for the new HEN cross sections
     245#ifdef debug
     246  G4cout<<"G4QProtNucCS::CalCS: A="<<A<<",F="<<F<<",I="<<I<<",nL="<<nL<<",nH="<<nH<<G4endl;
     247#endif
     248  if(F<=0)                             // This isotope was not the last used isotop
     249  {
     250    if(F<0)                            // This isotope was found in DAMDB =======> RETRIEVE
     251    {
     252      G4int sync=LEN.size();
     253      if(sync<=I) G4cerr<<"*!*G4QProtonNuclCS::CalcCrossSect:Sync="<<sync<<"<="<<I<<G4endl;
     254      lastLEN=LEN[I];                  // Pointer to prepared LowEnergy cross sections
     255      lastHEN=HEN[I];                  // Pointer to prepared High Energy cross sections
     256    }
     257    else if(Momentum<ThresholdMomentum(targZ,targN)) return 0.; // BelowThreshold -> NotIni
     258    else                               // This isotope wasn't calculated before => CREATE
     259    {
     260      lastLEN = new G4double[nL];      // Allocate memory for the new LEN cross sections
     261      lastHEN = new G4double[nH];      // Allocate memory for the new HEN cross sections
    253262      // --- Instead of making a separate function ---
    254       G4double P=THmiG;              // Table threshold in GeV/c
     263      G4double P=THmiG;                // Table threshold in GeV/c
    255264      for(G4int m=0; m<nL; m++)
    256265      {
     
    264273        lP+=dlP;
    265274      }
     275#ifdef debug
     276      G4cout<<"-*->G4QPr0tNucCS::CalcCS:Tab for Z="<<targZ<<",N="<<targN<<",I="<<I<<G4endl;
     277#endif
    266278      // --- End of possible separate function
    267279      // *** The synchronization check ***
    268280      G4int sync=LEN.size();
    269       if(sync!=I) G4cerr<<"**G4QPhortonNuclCS::CalcCrossSect: Sync="<<sync<<"#"<<I<<G4endl;
    270       LEN.push_back(lastLEN);          // added LEN, found by AH 10/7/02
    271       HEN.push_back(lastHEN);          // added HEN, found by AH 10/7/02
    272            } // End of creation of the new set of parameters
     281      if(sync!=I)
     282      {
     283        G4cerr<<"***G4QProtonNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
     284              <<", N="<<targN<<", F="<<F<<G4endl;
     285        //G4Exception("G4ProtonNuclearCS::CalculateCS:","39",FatalException,"overflow DB");
     286      }
     287      LEN.push_back(lastLEN);          // remember the Low Energy Table
     288      HEN.push_back(lastHEN);          // remember the High Energy Table
     289    } // End of creation of the new set of parameters
    273290  } // End of parameters udate
    274291  // ============================== NOW the Magic Formula =================================
     292#ifdef debug
     293  G4cout<<"G4QPrNCS::CalcCS:lTH="<<lastTH<<",Pmi="<<Pmin<<",dP="<<dP<<",dlP="<<dlP<<G4endl;
     294#endif
    275295  if (Momentum<lastTH) return 0.;      // It must be already checked in the interface class
    276   else if (Momentum<Pmin)                     // High Energy region
    277   {
    278 #ifdef debug
    279            G4cout<<"G4QPrNCS::CalcCS:bLEN A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
     296  else if (Momentum<Pmin)              // High Energy region
     297  {
     298#ifdef debug
     299    G4cout<<"G4QPrNCS::CalcCS:bLEN A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
    280300#endif
    281301    if(A<=1.) sigma=0.;
    282302    else      sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
    283303#ifdef debugn
    284            if(sigma<0.)
     304    if(sigma<0.)
    285305      G4cout<<"G4QPrNuCS::CalcCS:A="<<A<<",E="<<Momentum<<",T="<<THmin<<",dP="<<dP<<G4endl;
    286306#endif
    287307  }
    288   else if (Momentum<Pmax)                     // High Energy region
     308  else if (Momentum<Pmax)              // High Energy region
    289309  {
    290310    G4double lP=std::log(Momentum);
     
    294314    sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
    295315  }
    296   else                                      // UHE region (calculation, not frequent)
    297   {
    298     G4double P=0.001*Momentum;              // Approximation formula is for P in GeV/c
     316  else                                 // UHE region (calculation, not frequent)
     317  {
     318    G4double P=0.001*Momentum;         // Approximation formula is for P in GeV/c
    299319    sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
    300320  }
    301321#ifdef debug
    302   G4cout<<"G4QProtonNuclearCrossSection::CalcCS: sigma="<<sigma<<G4endl;
     322  G4cout<<"G4QProtonNuclearCrossSection::CalcCS: CS="<<sigma<<G4endl;
    303323#endif
    304324  if(sigma<0.) return 0.;
     
    314334  G4double tA=tZ+tN;
    315335  if(tZ<.99 || tN<0.) return 0.;
     336  else if(tZ==1 && tN==0) return 800.;    // A threshold on the free proton
    316337  //G4double dE=1.263*tZ/(1.+std::pow(tA,third));
    317338  G4double dE=tZ/(1.+std::pow(tA,third)); // Safety for diffused edge of the nucleus (QE)
     
    374395    {
    375396      G4double dp=P-pos;
    376       sigma+=pex*std::exp(dp*dp/wid);
     397      sigma+=pex*std::exp(-dp*dp/wid);
    377398    }
    378399  }
     
    407428  else if(tZ<93 && tN<146)                // General solution
    408429  {
    409     G4double lP=std::log(P);
     430    //G4double lP=std::log(P);            // Already calculated
    410431    G4double d=lP-4.2;
    411432    G4double p2=P*P;
     
    427448    G4double h=(.01/a4+2.5e-6/a)*(1.+7.e-8*a4)/(1.+6.e7/a12/a2);
    428449    sigma=(c+d*d)/(1.+r/p4)+(g+e*std::exp(-s*P))/(1.+h/p4/p4);
     450#ifdef pdebug
     451  G4cout<<"G4QProtNucCS::CSForm: A="<<a<<",P="<<P<<",CS="<<sigma<<",c="<<c<<",g="<<g<<",d="
     452        <<d<<",r="<<r<<",e="<<e<<",h="<<h<<G4endl;
     453#endif
    429454  }
    430455  else
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QStringChipsParticleLevelInterface.cc

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 //
     25// Short description: Interface of QGSC to CHIPS (Energy Flow  of soft hadrons)
     26// ----------------------------------------------------------------------------
    2627
    2728//#define debug
     
    143144  }
    144145  G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);    // PDG of theResidualNucleus
    145   G4double targetMass = theNucleus->GetMass();                 // Its mass
    146   targetMass -= hitMass; // subtract masses of knocked out nucleons (binding?! M.K.) E/M
     146  G4double targetMass=mNeut;
     147  if (!resZ)                                                   // Nucleus of only neutrons
     148  {
     149    if (resA>1) targetMass*=resA;
     150  }
     151  else targetMass=G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ)
     152                                                                            ->GetPDGMass();
    147153  G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
    148154  // !! @@ Target should be at rest: hitMomentum=(0,0,0) @@ !! M.K. (go to this system)
     
    153159  G4double impactX = theImpact.first;
    154160  G4double impactY = theImpact.second;
    155   G4double inpactPar2 = impactX*impactX + impactY*impactY;
     161  G4double impactPar2 = impactX*impactX + impactY*impactY;
    156162 
    157163  G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
     
    160166#ifdef pdebug
    161167  G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
    162         <<", b="<<std::sqrt(inpactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
    163         <<", b/r="<<std::sqrt(inpactPar2/radius2)<<G4endl;
    164 #endif
    165   if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2);
     168        <<", b="<<std::sqrt(impactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
     169        <<", b/r="<<std::sqrt(impactPar2/radius2)<<G4endl;
     170#endif
     171  if(radius2 - impactPar2>0) pathlength = 2.*std::sqrt(radius2 - impactPar2);
    166172  G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
    167173 
     
    176182          << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<" "
    177183          << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
    178           << a4Mom <<G4endl;
     184          << a4Mom <<G4endl;
    179185#endif
    180186#ifdef pdebug
     
    193199      if((*current).first > toSort)        // The current is smaller then existing
    194200      {
    195                theSorted.insert(current, it);     // It shifts the others up
    196                inserted = true;
    197                break;
     201        theSorted.insert(current, it);     // It shifts the others up
     202        inserted = true;
     203        break;
    198204      }
    199205    }
     
    234240        <<theSorted.size()<<G4endl;
    235241#endif
    236  
     242  G4bool EscapeExists = false;
    237243  for(current = theSorted.begin(); current!=theSorted.end(); current++)
    238244  {
    239245#ifdef pdebug
    240                                 G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: nq="
     246    G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: nq="
    241247          <<(*current).second->GetDefinition()->GetQuarkContent(3)<<", naq="
    242248          <<(*current).second->GetDefinition()->GetAntiQuarkContent(3)<<", PDG="
     
    306312
    307313#ifdef pdebug
    308                                 G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
     314    G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
    309315                                                    <<theEnergyLostInFragmentation<<G4endl;
    310316#endif
    311 
    312     if(runningEnergy > theEnergyLostInFragmentation) break;
    313    
     317    if(runningEnergy > theEnergyLostInFragmentation)
     318    {
     319      EscapeExists = true;
     320      break;
     321    }
    314322#ifdef CHIPSdebug
    315323    G4cout <<"G4QStringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
    316324           <<(*current).second->GetDefinition()->GetPDGCharge()<<" "
    317325           << (*current).second->GetDefinition()->GetPDGEncoding()<<" "
    318                   << (*current).second->Get4Momentum() <<G4endl;
     326           << (*current).second->Get4Momentum() <<G4endl;
    319327#endif
    320328#ifdef pdebug
     
    322330          <<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
    323331          <<current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
    324                  <<current->second->Get4Momentum()<<G4endl;
     332          <<current->second->Get4Momentum()<<G4endl;
    325333#endif
    326334
     
    382390      {
    383391        theFinalContents[hp] +=theContents[running];
    384                *(theFinalMomenta[hp])+=*(theMomenta[running]);
    385                running++;
    386                if(running == theContents.size()) break;
     392        *(theFinalMomenta[hp])+=*(theMomenta[running]);
     393        running++;
     394        if(running == theContents.size()) break;
    387395      }
    388396    }
     
    402410  G4QNucleus::SetParameters(fractionOfSingleQuasiFreeNucleons,
    403411                            fractionOfPairedQuasiFreeNucleons,
    404                                                  clusteringCoefficient,
    405                                                                fusionToExchange);
     412                            clusteringCoefficient,
     413                            fusionToExchange);
    406414  G4Quasmon::SetParameters(temperature, halfTheStrangenessOfSee, etaToEtaPrime);
    407415
     
    424432    G4QCHIPSWorld::Get()->GetParticles(nop);
    425433    G4QEnvironment* pan= new G4QEnvironment(projHV, targetPDGCode);
     434#ifdef pdebug
     435      G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: CHIPS fragmentation, rA="
     436            <<resA<<", #AbsPt="<<particleCount<<G4endl;
     437#endif
    426438    try
    427439    {
     
    438450      {
    439451        G4cerr <<"  Incoming 4-momentum and PDG code of "<<i<<"'th hadron: "
    440                <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
     452        <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
    441453      }
    442454      throw;
     
    447459    delete pan;
    448460  }
    449   else output = new G4QHadronVector;
    450    
     461  else
     462  {
     463#ifdef pdebug
     464    G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: NO CHIPS fragmentation, rA="
     465          <<resA<<", #AbsPt="<<particleCount<<G4endl;
     466#endif
     467    output = new G4QHadronVector;
     468  }   
    451469  // Fill the result.
    452470#ifdef CHIPSdebug
    453   G4cout << "NEXT EVENT"<<endl;
     471  G4cout << "NEXT EVENT, EscapeExists="<<EscapeExists<<G4endl;
    454472#endif
    455473
    456474  // first decay and add all escaping particles.
    457   for(current = firstEscape; current!=theSorted.end(); current++)
     475  if (EscapeExists) for (current = firstEscape; current!=theSorted.end(); current++)
    458476  {
    459477    G4KineticTrack* aResult = (*current).second;
     
    472490      theSec->SetMomentum(current4Mom.vect());
    473491#ifdef pdebug
    474                                   G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
     492      G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
    475493            <<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    476494#endif
     
    487505        theSec->SetMomentum(current4Mom.vect());
    488506#ifdef pdebug
    489                                     G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
     507        G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
    490508              <<secondaries->operator[](aSecondary)->GetDefinition()->GetPDGEncoding()
    491509              <<",4M="<<current4Mom<<G4endl;
     
    561579      theSec->SetMomentum(current4Mom.vect());
    562580#ifdef pdebug
    563                                   G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
     581      G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
    564582              <<theDefinition->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    565583#endif
     
    576594    G4cout <<"CHIPS particles "<<theDefinition->GetPDGCharge()<<" "
    577595           << theDefinition->GetPDGEncoding()<<" "
    578            << output->operator[](particle)->Get4Momentum() <<G4endl;
     596    << output->operator[](particle)->Get4Momentum() <<G4endl;
    579597#endif
    580598
    581599    delete output->operator[](particle);
     600  }
     601  else
     602  {
     603    if(resA>0)
     604    {
     605      G4ParticleDefinition* theDefinition = G4Neutron::Neutron();
     606      if(resA==1) // The residual nucleus at rest must be added to conserve BaryN & Charge
     607      {
     608        if(resZ == 1) theDefinition = G4Proton::Proton();
     609      }
     610      else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);
     611      theSec = new G4ReactionProduct(theDefinition);
     612      theSec->SetTotalEnergy(theDefinition->GetPDGMass());
     613      theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
     614      theResult->push_back(theSec);
     615      if(!resZ && resA>0) for(G4int ni=1; ni<resA; ni++)
     616      {
     617        theSec = new G4ReactionProduct(theDefinition);
     618        theSec->SetTotalEnergy(theDefinition->GetPDGMass());
     619        theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
     620        theResult->push_back(theSec);
     621      }
     622    }
    582623  }
    583624  delete output;
     
    588629  G4cout << "QUASMON preparation info "
    589630         << 1./MeV*proj4Mom<<" "
    590         << 1./MeV*targ4Mom<<" "
    591         << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
    592         << hitCount<<" "
    593         << particleCount<<" "
    594         << theLow<<" "
    595         << theHigh<<" "
    596         << G4endl;
     631  << 1./MeV*targ4Mom<<" "
     632  << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
     633  << hitCount<<" "
     634  << particleCount<<" "
     635  << theLow<<" "
     636  << theHigh<<" "
     637  << G4endl;
    597638#endif
    598639
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QTauNuclearCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QTauNuclearCrossSection.cc,v 1.11 2008/10/24 19:24:29 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QTauNuclearCrossSection.cc,v 1.13 2009/05/08 15:16:26 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3838// ****************************************************************************************
    3939//=========================================================================================
     40// Short description: reaction cross-sections for tau-nuclear reactions, which
     41// are integrals over virtual equivalent photons photons. The tau-nuclear
     42// reactions do not exist in GHAD, so by the present physics lists it is not
     43// simulated at all.
     44// --------------------------------------------------------------------------------
    4045
    4146///#define debug
     
    9499        <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
    95100        <<colN.size()<<G4endl;
    96                 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
     101  //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
    97102#endif
    98103  if(std::abs(pPDG)!=15)
     
    115120    j  = 0;                            // A#0f records found in DB for this projectile
    116121    if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
    117            {                                  // The nucleus with projPDG is found in AMDB
     122    {                                  // The nucleus with projPDG is found in AMDB
    118123      if(colN[i]==tgN && colZ[i]==tgZ)
    119                                                 {
     124      {
    120125        lastI=i;
    121126        lastTH =colTH[i];                // Last THreshold (A-dependent)
     
    167172#endif
    168173      j++;                             // Increment a#0f records found in DB for this pPDG
    169            }
    170            if(!in)                            // This nucleus has not been calculated previously
    171            {
     174    }
     175    if(!in)                            // This nucleus has not been calculated previously
     176    {
    172177#ifdef pdebug
    173178      G4cout<<"G4QTNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
     
    176181      lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
    177182      if(lastCS<=0.)
    178                                                 {
     183      {
    179184        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
    180185#ifdef pdebug
     
    188193          lastTH=pEn;
    189194        }
    190                                                 }
     195      }
    191196#ifdef pdebug
    192197      G4cout<<"G4QTNCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
     
    204209#endif
    205210      return lastCS*millibarn;
    206            } // End of creation of the new set of parameters
     211    } // End of creation of the new set of parameters
    207212    else
    208                                 {
     213    {
    209214#ifdef pdebug
    210215      G4cout<<"G4QTNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
     
    275280  G4double mP= infEn;
    276281  if(Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
    277             mP = G4NucleiProperties::GetNuclearMass(A-1.,Z-1.)/MeV; // ResNucMass for a proton
     282          mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV; // ResNucMass for a proton
    278283
    279284  G4double mN= infEn;
    280285  if(N&&G4NucleiProperties::IsInStableTable(A-1,Z))
    281             mN = G4NucleiProperties::GetNuclearMass(A-1.,Z)/MeV;  // ResNucMass for a neutron
     286          mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV;  // ResNucMass for a neutron
    282287
    283288  G4double mA= infEn;
    284289  if(N>1&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
    285             mA = G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV; // ResNucMass for an alpha
     290          mA = G4NucleiProperties::GetNuclearMass(A-4,Z-2)/MeV; // ResNucMass for an alpha
    286291
    287292  G4double dP= mP +mProt - mT;
     
    289294  G4double dA= mA +mAlph - mT;
    290295#ifdef pdebug
    291                 G4cout<<"G4TauNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
     296  G4cout<<"G4TauNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
    292297        <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
    293298#endif
     
    319324  static std::vector <G4double*> J3;   // Vector of pointers to the J3 tabulated functions
    320325#ifdef pdebug
    321                 G4cout<<"G4QTauNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
     326  G4cout<<"G4QTauNucCrossSection::CalculateCrossSection: ***Called*** "<<J3.size();
    322327  if(J3.size()) G4cout<<", p="<<J3[0];
    323328  G4cout<<G4endl;
     
    331336  lastE=TotEnergy-mtu;               // Kinetic energy of the muon
    332337#ifdef pdebug
    333                 G4cout<<"G4QElectronNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ
     338  G4cout<<"G4QElectronNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ
    334339        <<", N="<<targN<<", onlyCS="<<CS<<",E="<<lastE<<",th="<<EMi<<G4endl;
    335340#endif
     
    338343  {
    339344    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
    340                                 {                                // ...........................................========
     345    {                                // ...........................................========
    341346      if (lastE<=EMi)                // Energy is below the minimum energy in the table
    342347      {
     
    345350        lastSig=0.;
    346351#ifdef pdebug
    347                                     G4cout<<"---> G4QTauNucCS::CalcCS: Old CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
     352        G4cout<<"---> G4QTauNucCS::CalcCS: Old CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
    348353#endif
    349354        return 0.;
     
    355360      lastH  =colH[I];               // Last High Energy Coefficient (A-dependent)
    356361#ifdef pdebug
    357                                 G4cout<<"---> G4QTauNucCS::CalcCS: CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
    358 #endif
    359           }
    360           else                              // This isotope wasn't calculated previously => CREATE
    361           {
     362    G4cout<<"---> G4QTauNucCS::CalcCS: CS=0  as lastE="<<lastE<<" < "<<EMi<<G4endl;
     363#endif
     364   }
     365   else                              // This isotope wasn't calculated previously => CREATE
     366   {
    362367      lastJ1 = new G4double[nE];     // Allocate memory for the new J1 function
    363368      lastJ2 = new G4double[nE];     // Allocate memory for the new J2 function
     
    376381      colF.push_back(lastF);
    377382      colH.push_back(lastH);
    378            } // End of creation of the new set of parameters
     383    } // End of creation of the new set of parameters
    379384  } // End of parameters udate
    380385  // ============================== NOW Calculate the Cross Section =====================
     
    385390    lastSig=0.;
    386391#ifdef pdebug
    387                                 G4cout<<"---> G4QTauNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
     392    G4cout<<"---> G4QTauNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
    388393#endif
    389394    return 0.;
     
    399404#ifdef pdebug
    400405    G4cout<<"-->G4QTauNuclearCS::CalcCrossSect:LOGfit b="<<blast<<",max="<<mL<<",lJ1="
    401                                       <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
     406          <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
    402407#endif
    403408    if(blast<0)   blast=0;
     
    25752580        y[k]=P1[i][k];                 // J1
    25762581        z[k]=P2[i][k];                 // J2
    2577           }
     2582   }
    25782583      r=L[i];                          // Low channel for the J-functions
    25792584    }
     
    25982603      r=L[k];
    25992604      if(L[k1]<r) r=L[k1];
    2600         }
     2605 }
    26012606  }
    26022607  return r;
     
    26322637  if(ris<Y[lastL])                      // Search in the table
    26332638  {
    2634            G4int j=lastF;
     2639    G4int j=lastF;
    26352640    G4double Yj=Y[j];                   // It mast be 0 (some times just very small)
    26362641    while (ris>Yj && j<lastL)           // Associative search
    2637            {
     2642    {
    26382643      j++;
    26392644      Yj=Y[j];                          // High value
    2640            }
     2645    }
    26412646    G4int j1=j-1;
    26422647    G4double Yi=Y[j1];                  // Low value
    26432648    phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
    26442649#ifdef debug
    2645         G4cout<<"G4QTauNuclearCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi
     2650 G4cout<<"G4QTauNuclearCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi
    26462651          <<",Y="<<Yj<<G4endl;
    26472652#endif
     
    26532658    G4double f=(ris-Y[lastL])/lastH;    // ScaledResidualValue of the cross-sec. integral
    26542659#ifdef pdebug
    2655            G4cout<<"G4QTauNucCS::GetExEn:HighEnergy f="<<f<<", ris="<<ris<<", lH="<<lastH<<G4endl;
     2660    G4cout<<"G4QTauNucCS::GetExEn:HighEnergy f="<<f<<", ris="<<ris<<", lH="<<lastH<<G4endl;
    26562661#endif
    26572662    phLE=SolveTheEquation(f);           // Solve equation to find theLog(phE) (comp lastLE)
    26582663#ifdef pdebug
    2659         G4cout<<"G4QTauNuclearCrossSection::GetExchangeEnergy: HighEnergy lphE="<<phLE<<G4endl;
     2664    G4cout<<"G4QTauNuclearCrossSection::GetExchangeEnergy: HighEnergy lphE="<<phLE<<G4endl;
    26602665#endif
    26612666  }
     
    27042709#endif
    27052710    if(x>=lastLE)
    2706            {
     2711    {
    27072712      G4cerr<<"*G4QTauNCS::SolveTheEq:*Correction*"<<i<<",d="<<d<<",x="<<x<<">lE="<<lastLE
    27082713            <<",f="<<f<<",fx="<<fx<<",df="<<df<<",A(Z="<<lastZ<<",N="<<lastN<<")"<<G4endl;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QuasiFreeRatios.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QuasiFreeRatios.cc,v 1.19 2008/03/21 21:44:39 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QuasiFreeRatios.cc,v 1.21 2009/04/09 08:25:46 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-06
    3434//
    35 //================================================================================
     35//=======================================================================
     36// Short description: Provides percentage of quasi-free and quasi-elastic
     37// reactions in the inelastic reactions.
     38// ----------------------------------------------------------------------
    3639
    3740//#define debug
     
    5053{
    5154#ifdef pdebug
    52                 G4cout<<"***^^^*** G4QuasiFreeRatios singletone is created ***^^^***"<<G4endl;
     55  G4cout<<"***^^^*** G4QuasiFreeRatios singletone is created ***^^^***"<<G4endl;
    5356#endif
    5457}
     
    8184                                                           G4int tgZ,    G4int tgN)
    8285{
    83                 std::pair<G4double,G4double> ElTot=GetElTot(pIU, pPDG, tgZ, tgN); // mean hN El&Tot(IU)
     86#ifdef pdebug
     87  G4cout<<">>>IN>>>G4QFRat::GetQF:P="<<pIU<<",pPDG="<<pPDG<<",Z="<<tgZ<<",N="<<tgN<<G4endl;
     88#endif
    8489  G4double R=0.;
    85   G4double QF2In=1.;               // Prototype of QuasiFree/Inelastic ratio for hN_tot
    86   if(ElTot.second>0.)
    87   {
    88     R=ElTot.first/ElTot.second;    // Elastic/Total ratio (does not depend on units
    89     QF2In=GetQF2IN_Ratio(ElTot.second/millibarn, tgZ+tgN); // QuasiFree/Inelastic ratio
    90   }
     90  G4double QF2In=1.;                        // Prototype of QuasiFree/Inel ratio for hN_tot
     91  G4int tgA=tgZ+tgN;
     92  if(tgA<2) return std::make_pair(QF2In,R); // No quasi-elastic on the only nucleon
     93  std::pair<G4double,G4double> ElTot=GetElTot(pIU, pPDG, tgZ, tgN); // mean hN El&Tot(IU)
     94  //if( ( (pPDG>999 && pIU<227.) || pIU<27.) && tgA>1) R=1.; // @@ TMP to accelerate @lowE
     95  if(pPDG>999 && pIU<227. && tgZ+tgN>1) R=1.;                // To accelerate @lowE
     96  else if(ElTot.second>0.)
     97  {
     98    R=ElTot.first/ElTot.second;             // El/Total ratio (does not depend on units
     99    QF2In=GetQF2IN_Ratio(ElTot.second/millibarn, tgZ+tgN);   // QuasiFree/Inelastic ratio
     100  }
     101#ifdef pdebug
     102  G4cout<<">>>OUT>>>G4QuasiFreeRatio::GetQF2IN_Ratio: QF2In="<<QF2In<<", R="<<R<<G4endl;
     103#endif
    91104  return std::make_pair(QF2In,R);
    92105}
     
    125138  static G4double* lastL=0;             // theLast of pointer to LogTable in the C++ heap
    126139  // LogTable is created only if necessary. The ratio R(s>8100 mb) = 0 for any nuclei
     140#ifdef pdebug
     141  G4cout<<"+++G4QuasiFreeRatio::GetQF2IN_Ratio:A="<<A<<", s="<<s<<G4endl;
     142#endif
    127143  if(s<toler || A<2) return 1.;
    128144  if(s>ms) return 0.;
     
    137153  G4bool found=false;
    138154  G4int i=-1;
    139                 if(nDB) for (i=0; i<nDB; i++) if(A==vA[i]) // Sirch for this A in AMDB
     155  if(nDB) for (i=0; i<nDB; i++) if(A==vA[i]) // Sirch for this A in AMDB
    140156  {
    141157    found=true;                         // The A value is found
    142158    break;
    143159  }
     160#ifdef pdebug
     161  G4cout<<"+++G4QuasiFreeRatio::GetQF2IN_Ratio: nDB="<<nDB<<", found="<<found<<G4endl;
     162#endif
    144163  if(!nDB || !found)                    // Create new line in the AMDB
    145         {
     164  {
    146165    lastA = A;
    147166#ifdef pdebug
    148                                 G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: NewT, A="<<A<<", nDB="<<nDB<<G4endl;
     167    G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: NewT, A="<<A<<", nDB="<<nDB<<G4endl;
    149168#endif
    150169    lastT = new G4double[mps];          // Create the linear Table
     
    163182      lastT[j]=CalcQF2IN_Ratio(sv,A);
    164183    }
     184    lastL=new G4double[mls];          // Create the logarithmic Table
    165185    if(s>sma)                           // Initialize the logarithmic Table
    166186    {
    167187#ifdef pdebug
    168                                 G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: NewL, A="<<A<<", nDB="<<nDB<<G4endl;
    169 #endif
    170       lastL=new G4double[mls];          // Create the logarithmic Table
     188      G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: NewL, A="<<A<<", nDB="<<nDB<<G4endl;
     189#endif
    171190      G4double ls=std::log(s);
    172191      lastK = static_cast<int>((ls-lsi)/dl)+1; // MaxBin to be initialized in LogTaB
     
    181200      {
    182201        lastL[j]=CalcQF2IN_Ratio(sv,A);
    183                if(j!=lastK) sv*=edl;
     202        if(j!=lastK) sv*=edl;
    184203      }
    185204    }
    186205    else                                // LogTab is not initialized
    187206    {
    188       lastL = 0;
    189207      lastK = 0;
    190208      lastM = 0.;
     
    200218  }
    201219  else                                  // The A value was found in AMDB
    202         {
     220  {
    203221    lastA=vA[i];
    204222    lastH=vH[i];
     
    208226    lastT=vT[i];
    209227    lastL=vL[i];
     228#ifdef pdebug
     229    G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: Found, s="<<s<<", lastM="<<lastM<<G4endl;
     230#endif
    210231    if(s>lastM)                          // At least LinTab must be updated
    211232    {
    212233      G4int nextN=lastN+1;               // The next bin to be initialized
     234#ifdef pdebug
     235      G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: lastN="<<lastN<<" ?< nps="<<nps<<G4endl;
     236#endif
    213237      if(lastN<nps)
    214238      {
     
    226250          lastT[j]=CalcQF2IN_Ratio(sv,A);
    227251        }
     252#ifdef pdebug
     253        G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: End of LinTab update"<<G4endl;
     254#endif
    228255      } // End of LinTab update
     256#ifdef pdebug
     257      G4cout<<"G4QFRatios::GetQF2IN_Ratio: lN="<<lastN<<", nN="<<nextN<<", i="<<i<<G4endl;
     258#endif
    229259      if(lastN>=nextN)
    230                                                 {
     260      {
    231261        vH[i]=lastH;
    232262        vN[i]=lastN;
    233263      }
    234264      G4int nextK=lastK+1;
     265      if(!lastK) nextK=0;
     266#ifdef pdebug
     267      G4cout<<"G4QFRat::GetQF2IN_Ratio: sma="<<sma<<", lastK="<<lastK<<" < "<<nls<<G4endl;
     268#endif
    235269      if(s>sma && lastK<nls)             // LogTab must be updated
    236                                                 {
     270      {
    237271        G4double sv=std::exp(lastM+lsi); // Define starting poit (lastM will be changed)
    238272        G4double ls=std::log(s);
     
    244278        }
    245279        else lastM = lastK*dl;           // Calculate max initialized ln(s)-lsi for LogTab
     280#ifdef pdebug
     281        G4cout<<"G4QFRat::GetQF2IN_Ratio: nK="<<nextK<<", lK="<<lastK<<", sv="<<sv<<G4endl;
     282#endif
    246283        for(G4int j=nextK; j<=lastK; j++)// Calculate LogTab values
    247284        {
    248                  sv*=edl;
     285          sv*=edl;
     286#ifdef pdebug
     287          G4cout<<"G4QFRat::GetQF2IN_Ratio: j="<<j<<", sv="<<sv<<", A="<<A<<G4endl;
     288#endif
    249289          lastL[j]=CalcQF2IN_Ratio(sv,A);
    250290        }
     291#ifdef pdebug
     292        G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: End of LinTab update"<<G4endl;
     293#endif
    251294      } // End of LogTab update
     295#ifdef pdebug
     296      G4cout<<"G4QFRatios::GetQF2IN_Ratio: lK="<<lastK<<", nK="<<nextK<<", i="<<i<<G4endl;
     297#endif
    252298      if(lastK>=nextK)
    253                                                 {
     299      {
    254300        vM[i]=lastM;
    255301        vK[i]=lastK;
     
    257303    }
    258304  }
     305#ifdef pdebug
     306  G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: BeforeTab s="<<s<<", sma="<<sma<<G4endl;
     307#endif
    259308  // Now one can use tabeles to calculate the value
    260309  if(s<sma)                             // Use linear table
    261                 {
     310  {
    262311    G4int n=static_cast<int>(s/ds);     // Low edge number of the bin
    263312    G4double d=s-n*ds;                  // Linear shift
     
    265314    lastR=v+d*(lastT[n+1]-v)/ds;        // Result
    266315  }
    267                 else                                  // Use log table
    268                 {
     316  else                                  // Use log table
     317  {
    269318    G4double ls=std::log(s)-lsi;        // ln(s)-l_min
    270319    G4int n=static_cast<int>(ls/dl);    // Low edge number of the bin
     
    275324  if(lastR<0.) lastR=0.;
    276325  if(lastR>1.) lastR=1.;
     326#ifdef pdebug
     327  G4cout<<"G4QuasiFreeRatios::GetQF2IN_Ratio: BeforeRet lastR="<<lastR<<G4endl;
     328#endif
    277329  return lastR;
    278330} // End of CalcQF2IN_Ratio
     
    282334{
    283335  static const G4double C=1.246;
    284                 G4double s2=s*s;
     336  G4double s2=s*s;
    285337  G4double s4=s2*s2;
    286                 G4double ss=std::sqrt(std::sqrt(s));
     338  G4double ss=std::sqrt(std::sqrt(s));
    287339  G4double P=7.48e-5*s2/(1.+8.77e12/s4/s4/s2);
    288340  G4double E=.2644+.016/(1.+std::exp((29.54-s)/2.49));
    289341  G4double F=ss*.1526*std::exp(-s2*ss*.0000859);
    290         return C*std::exp(-E*std::pow(G4double(A-1.),F))/std::pow(G4double(A),P);
     342  return C*std::exp(-E*std::pow(G4double(A-1.),F))/std::pow(G4double(A),P);
    291343} // End of CalcQF2IN_Ratio
    292344
     
    309361  }
    310362  if     (!I)                          // pp/nn
    311                 {
     363  {
    312364#ifdef debug
    313                                 G4cout<<"G4QuasiFreeR::CalcElTot:I=0, p="<<p<<", pmi="<<pmi<<", pma="<<pma<<G4endl;
     365    G4cout<<"G4QuasiFreeR::CalcElTot:I=0, p="<<p<<", pmi="<<pmi<<", pma="<<pma<<G4endl;
    314366#endif
    315367    if(p<pmi)
     
    319371      To=El;
    320372#ifdef debug
    321                                   G4cout<<"G4QuasiFreeR::CalcElTot:I=0i, El="<<El<<", To="<<To<<", p2="<<p2<<G4endl;
     373      G4cout<<"G4QuasiFreeR::CalcElTot:I=0i, El="<<El<<", To="<<To<<", p2="<<p2<<G4endl;
    322374#endif
    323375    }
     
    329381      To=pbt*lp2+38.2;
    330382#ifdef debug
    331                                   G4cout<<"G4QuasiFreeR::CalcElTot:I=0a, El="<<El<<", To="<<To<<", lp2="<<lp2<<G4endl;
     383      G4cout<<"G4QuasiFreeR::CalcElTot:I=0a, El="<<El<<", To="<<To<<", lp2="<<lp2<<G4endl;
    332384#endif
    333385    }
     
    342394      To=LE+(pbt*lp2+38.2+52.7*rp2)/(1.+2.72*rp2*rp2);
    343395#ifdef debug
    344                                   G4cout<<"G4QuasiFreeR::CalcElTot:0,E="<<El<<",T="<<To<<",s="<<p2<<",l="<<lp2<<G4endl;
     396      G4cout<<"G4QuasiFreeR::CalcElTot:0,E="<<El<<",T="<<To<<",s="<<p2<<",l="<<lp2<<G4endl;
    345397#endif
    346398    }
    347399  }
    348400  else if(I==1)                        // np/pn
    349                 {
     401  {
    350402    if(p<pmi)
    351403    {
     
    373425  }
    374426  else if(I==2)                        // pimp/pipn
    375                 {
     427  {
    376428    G4double lp=std::log(p);
    377429    if(p<pmi)
     
    407459  }
    408460  else if(I==3)                        // pipp/pimn
    409                 {
     461  {
    410462    G4double lp=std::log(p);
    411463    if(p<pmi)
     
    440492    }
    441493  }
    442                 else if(I==4)                        // Kmp/Kmn/K0p/K0n
    443                 {
     494  else if(I==4)                        // Kmp/Kmn/K0p/K0n
     495  {
    444496
    445497    if(p<pmi)
     
    473525  }
    474526  else if(I==5)                        // Kpp/Kpn/aKp/aKn
    475                 {
     527  {
    476528    if(p<pmi)
    477529    {
     
    505557  }
    506558  else if(I==6)                        // hyperon-N
    507                 {
     559  {
    508560    if(p<pmi)
    509561    {
     
    533585  }
    534586  else if(I==7)                        // antibaryon-N
    535                 {
     587  {
    536588    if(p>pma)
    537589    {
     
    571623  static const G4double dl=(lpa-lpi)/nlp;// Step of the logarithmic Table
    572624  static const G4double edl=std::exp(dl);// Multiplication step of the logarithmic Table
    573   //  static const G4double toler=.001;      // Relative tolarence defining "the same momentum"
     625  //static const G4double toler=.001;      // Relative Tolarence defining "theSameMomentum"
    574626  static G4double lastP=0.;              // The last momentum for which XS was calculated
    575627  static G4int    lastH=0;               // The last projPDG for which XS was calculated
     
    590642  G4cout<<"G4QuasiFreeR::FetchElTot:p="<<p<<",PDG="<<PDG<<",F="<<F<<",nDB="<<nDB<<G4endl;
    591643#endif
    592   if(nDB && lastH==PDG && lastF==F && p>0. && p==lastP) return lastR; // VI do not use toler
     644  if(nDB && lastH==PDG && lastF==F && p>0. && p==lastP) return lastR;// VI don't use toler.
    593645  //  if(nDB && lastH==PDG && lastF==F && p>0. && std::fabs(p-lastP)/p<toler) return lastR;
    594646  lastH=PDG;
     
    596648  G4int ind=-1;                          // Prototipe of the index of the PDG/F combination
    597649  // i=0: pp(nn), i=1: np(pn), i=2: pimp(pipn), i=3: pipp(pimn), i=4: Kmp(Kmn,K0n,K0p),
    598                 // i=5: Kpp(Kpn,aK0n,aK0p), i=6: Hp(Hn), i=7: app(apn,ann,anp)
     650  // i=5: Kpp(Kpn,aK0n,aK0p), i=6: Hp(Hn), i=7: app(apn,ann,anp)
    599651  G4bool kfl=true;                             // Flag of K0/aK0 oscillation
    600652  G4bool kf=false;
     
    630682  G4bool found=false;
    631683  G4int i=-1;
    632                 if(nDB) for (i=0; i<nDB; i++) if(ind==vI[i])  // Sirch for this index in AMDB
     684  if(nDB) for (i=0; i<nDB; i++) if(ind==vI[i])  // Sirch for this index in AMDB
    633685  {
    634686    found=true;                                 // The index is found
     
    637689  G4double lp=std::log(p);
    638690#ifdef pdebug
    639                 G4cout<<"G4QuasiFreeR::FetchElTot:I="<<ind<<",i="<<i<<",fd="<<found<<",lp="<<lp<<G4endl;
     691  G4cout<<"G4QuasiFreeR::FetchElTot:I="<<ind<<",i="<<i<<",fd="<<found<<",lp="<<lp<<G4endl;
    640692#endif
    641693  if(!nDB || !found)                            // Create new line in the AMDB
    642         {
    643 #ifdef pdebug
    644                                 G4cout<<"G4QuasiFreeRatios::FetchElTot: NewX, ind="<<ind<<", nDB="<<nDB<<G4endl;
     694  {
     695#ifdef pdebug
     696    G4cout<<"G4QuasiFreeRatios::FetchElTot: NewX, ind="<<ind<<", nDB="<<nDB<<G4endl;
    645697#endif
    646698    lastX = new std::pair<G4double,G4double>[mlp]; // Create logarithmic Table for ElTot
     
    658710      lastX[j]=CalcElTot(pv,ind);
    659711#ifdef pdebug
    660                     G4cout<<"G4QuasiFreeR::FetchElTot:I,j="<<j<<",pv="<<pv<<",E="<<lastX[j].first<<",T="
     712      G4cout<<"G4QuasiFreeR::FetchElTot:I,j="<<j<<",pv="<<pv<<",E="<<lastX[j].first<<",T="
    661713            <<lastX[j].second<<G4endl;
    662714#endif
     
    670722  }
    671723  else                                   // The A value was found in AMDB
    672         {
     724  {
    673725    lastI=vI[i];
    674726    lastM=vM[i];
     
    678730    G4double lpM=lastM+lpi;
    679731#ifdef pdebug
    680                   G4cout<<"G4QuasiFreeR::FetchElTo:M="<<lpM<<",l="<<lp<<",K="<<lastK<<",n="<<nlp<<G4endl;
     732    G4cout<<"G4QuasiFreeR::FetchElTo:M="<<lpM<<",l="<<lp<<",K="<<lastK<<",n="<<nlp<<G4endl;
    681733#endif
    682734    if(lp>lpM && lastK<nlp)              // LogTab must be updated
    683                                 {
     735    {
    684736      lastK = static_cast<int>((lp-lpi)/dl)+1; // MaxBin to be initialized in LogTab
    685737#ifdef pdebug
    686                     G4cout<<"G4QuasiFreeR::FetET:K="<<lastK<<",lp="<<lp<<",li="<<lpi<<",dl="<<dl<<G4endl;
     738      G4cout<<"G4QuasiFreeR::FetET:K="<<lastK<<",lp="<<lp<<",li="<<lpi<<",dl="<<dl<<G4endl;
    687739#endif
    688740      if(lastK>nlp)
     
    698750        lastX[j]=CalcElTot(pv,ind);
    699751#ifdef pdebug
    700                       G4cout<<"G4QuasiFreeR::FetchElTot:U:j="<<j<<",p="<<pv<<",E="<<lastX[j].first<<",T="
     752        G4cout<<"G4QuasiFreeR::FetchElTot:U:j="<<j<<",p="<<pv<<",E="<<lastX[j].first<<",T="
    701753              <<lastX[j].second<<G4endl;
    702754#endif
     
    704756    } // End of LogTab update
    705757    if(lastK>=nextK)                   // The AMDB was apdated
    706                                 {
     758    {
    707759      vM[i]=lastM;
    708760      vK[i]=lastK;
     
    719771  lastR.second=t+d*(lastX[n+1].second-t)/dl; // T-Result
    720772  if(lastR.second<0.) lastR.second= 0.;
     773#ifdef pdebug
     774  G4cout<<"=O=>G4QuasiFreeR::FetchElTot:1st="<<lastR.first<<", 2nd="<<lastR.second<<G4endl;
     775#endif
    721776  if(lastR.first>lastR.second) lastR.first = lastR.second;
    722777  return lastR;
     
    728783{
    729784  G4double pGeV=pIU/gigaelectronvolt;
     785#ifdef pdebug
     786  G4cout<<"-->G4QuasiFreeR::GetElTot: P="<<pIU<<",pPDG="<<hPDG<<",Z="<<Z<<",N="<<N<<G4endl;
     787#endif
    730788  if(Z<1 && N<1)
    731789  {
     
    735793  std::pair<G4double,G4double> hp=FetchElTot(pGeV, hPDG, true);
    736794  std::pair<G4double,G4double> hn=FetchElTot(pGeV, hPDG, false);
     795#ifdef pdebug
     796  G4cout<<"-OUT->G4QFRat::GetElTot: hp("<<hp.first<<","<<hp.second<<"), hn("<<hn.first<<","
     797        <<hn.second<<")"<<G4endl;
     798#endif
    737799  G4double A=(Z+N)/millibarn;                // To make the result in independent units(IU)
    738800  return std::make_pair((Z*hp.first+N*hn.first)/A,(Z*hp.second+N*hn.second)/A);
     
    795857  N4M/=megaelectronvolt;
    796858  G4LorentzVector tot4M=N4M+p4M;
     859#ifdef ppdebug
     860  G4cerr<<"->G4QFR::Scat:p4M="<<pr4M<<",N4M="<<N4M<<",t4M="<<tot4M<<",NPDG="<<NPDG<<G4endl;
     861#endif
    797862  G4double mT=mNeut;
    798863  G4int Z=0;
     
    843908  if(E<0. || E2<mP2)
    844909  {
    845 #ifdef pdebug
     910#ifdef ppdebug
    846911    G4cerr<<"-Warning-G4QFR::Scat:*Negative Energy*E="<<E<<",E2="<<E2<<"<M2="<<mP2<<G4endl;
    847912#endif
    848913    return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
    849914  }
    850                 G4double P=std::sqrt(E2-mP2);                   // Momentum in pseudo laboratory system
     915  G4double P=std::sqrt(E2-mP2);                   // Momentum in pseudo laboratory system
    851916  G4VQCrossSection* CSmanager=G4QElasticCrossSection::GetPointer();
    852 #ifdef debug
     917#ifdef ppdebug
    853918  G4cout<<"G4QFR::Scatter: Before XS, P="<<P<<", Z="<<Z<<", N="<<N<<", PDG="<<pPDG<<G4endl;
    854919#endif
     
    859924  G4double xSec=CSmanager->GetCrossSection(false, P, Z, N, PDG); // Rec.CrossSect *TMP*
    860925  //G4double xSec=CSmanager->GetCrossSection(false, P, Z, N, pPDG); // Rec.CrossSect
    861 #ifdef debug
     926#ifdef ppdebug
    862927  G4cout<<"G4QElast::Scatter:pPDG="<<pPDG<<",P="<<P<<",CS="<<xSec/millibarn<<G4endl;
    863928#endif
     
    869934  if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
    870935  {
    871 #ifdef pdebug
     936#ifdef ppdebug
    872937    G4cerr<<"-Warning-G4QFR::Scat:**Zero XS**PDG="<<pPDG<<",NPDG="<<NPDG<<",P="<<P<<G4endl;
    873938#endif
     
    878943  G4double maxt=CSmanager->GetHMaxT();            // max possible -t
    879944#ifdef ppdebug
    880   G4cout<<"G4QFR::Scat:PDG="<<PDG<<",P="<<P<<",X="<<xSec<<",-t="<<mint<<"<"<<maxt<<", Z="<<Z<<",N="<<N<<G4endl;
     945  G4cout<<"G4QFR::Scat:PDG="<<PDG<<",P="<<P<<",X="<<xSec<<",-t="<<mint<<"<"<<maxt<<", Z="
     946        <<Z<<",N="<<N<<G4endl;
    881947#endif
    882948#ifdef nandebug
     
    893959    else if(cost<-1.) cost=-1.;
    894960    else
    895                                 {
     961    {
    896962      G4cerr<<"G4QFR::S:*NAN*c="<<cost<<",t="<<mint<<",tm="<<CSmanager->GetHMaxT()<<G4endl;
    897963      return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
     
    907973  }
    908974#ifdef ppdebug
    909                 G4cout<<"G4QFR::Scat:p4M="<<pr4M<<"+r4M="<<reco4M<<",dr="<<dir4M<<",t4M="<<tot4M<<G4endl;
    910 #endif
    911                 return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
     975  G4cout<<"G4QFR::Scat:p4M="<<pr4M<<"+r4M="<<reco4M<<",dr="<<dir4M<<",t4M="<<tot4M<<G4endl;
     976#endif
     977  return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
    912978} // End of Scatter
    913979
     
    9351001    N=0;
    9361002    RPDG=2112;                                         // PDG of the recoil nucleon
    937                 if(pPDG==-211) sPDG=111;                           // pi+    -> pi0
    938                 else if(pPDG==-321)
     1003    if(pPDG==-211) sPDG=111;                           // pi+    -> pi0
     1004    else if(pPDG==-321)
    9391005    {
    9401006      sPDG=310;                                        // K+     -> K0S
     
    9481014  else if(NPDG==2112) // Default
    9491015  {
    950                 if(pPDG==211)  sPDG=111;                           // pi+    -> pi0
    951                 else if(pPDG==321)
     1016    if(pPDG==211)  sPDG=111;                           // pi+    -> pi0
     1017    else if(pPDG==321)
    9521018    {
    9531019      sPDG=310;                                        // K+     -> K0S
     
    9831049    return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
    9841050  }
    985                 G4double P=std::sqrt(E2-mS2);                   // Momentum in pseudo laboratory system
     1051  G4double P=std::sqrt(E2-mS2);                   // Momentum in pseudo laboratory system
    9861052  G4VQCrossSection* CSmanager=G4QElasticCrossSection::GetPointer();
    9871053#ifdef debug
     
    10251091    else if(cost<-1.) cost=-1.;
    10261092    else
    1027                                 {
     1093    {
    10281094      G4cerr<<"G4QFR::C:*NAN*c="<<cost<<",t="<<mint<<",tm="<<CSmanager->GetHMaxT()<<G4endl;
    10291095      return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
     
    10401106  }
    10411107#ifdef debug
    1042                 G4cout<<"G4QFR::ChEx:p4M="<<p4M<<"+r4M="<<reco4M<<"="<<p4M+reco4M<<"="<<tot4M<<G4endl;
    1043 #endif
    1044                 return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
     1108  G4cout<<"G4QFR::ChEx:p4M="<<p4M<<"+r4M="<<reco4M<<"="<<p4M+reco4M<<"="<<tot4M<<G4endl;
     1109#endif
     1110  return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
    10451111} // End of ChExer
    10461112
     
    10601126  G4double p2=p*p;           
    10611127  G4double p4=p2*p2;
    1062                 G4double dl1=std::log(p)-5.;
     1128  G4double dl1=std::log(p)-5.;
    10631129  G4double T=(6.75+.14*dl1*dl1+13./p)/(1.+.14/p4)+.6/(p4+.00013);
    10641130  G4double U=(6.25+8.33e-5/p4/p)*(p*sp+.34)/p2/p;
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4StringChipsInterface.cc

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 //
     25// !!! Was used in QBBC PL, NOW it is not. Must be absolete !!!
     26// ============================================================
    2627
    2728//#define debug
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4StringChipsParticleLevelInterface.cc

    r819 r1055  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     25// Short description: Interface of QGSC to CHIPS (all soft hadrons)
     26// ----------------------------------------------------------------
    2527//
    2628
     
    175177  }
    176178  G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);    // PDG of theResidualNucleus
    177   G4double targetMass = theNucleus->GetMass();                 // Its mass
    178   targetMass -= hitMass; // subtract masses of knocked out nucleons (binding?! M.K.) E/M
     179  G4double targetMass=mNeut;
     180  if (!resZ)                                                   // Nucleus of only neutrons
     181  {
     182    if (resA>1) targetMass*=resA;
     183  }
     184  else targetMass=G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ)
     185                                                                            ->GetPDGMass();
    179186  G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
    180187  // !! @@ Target should be at rest: hitMomentum=(0,0,0) @@ !! M.K. (go to this system)
     
    185192  G4double impactX = theImpact.first;
    186193  G4double impactY = theImpact.second;
    187   G4double inpactPar2 = impactX*impactX + impactY*impactY;
     194  G4double impactPar2 = impactX*impactX + impactY*impactY;
    188195  G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
    189196  //G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
     
    192199#ifdef ppdebug
    193200  G4cout<<"G4StringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
    194         <<", b="<<std::sqrt(inpactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
    195         <<", b/r="<<std::sqrt(inpactPar2/radius2)<<G4endl;
    196 #endif
    197   if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2);
     201        <<", b="<<std::sqrt(impactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
     202        <<", b/r="<<std::sqrt(impactPar2/radius2)<<G4endl;
     203#endif
     204  if(radius2 - impactPar2>0) pathlength = 2.*std::sqrt(radius2 - impactPar2);
     205  //pathlength = 27.;                         // *** Only temporary *** Always CHIPS
    198206#ifdef hdebug_SCPLI
    199207  toth+=1.;                                 // increment total number of measurements
    200   G4double bfm=std::sqrt(inpactPar2)/fermi; // impact parameter
     208  G4double bfm=std::sqrt(impactPar2)/fermi; // impact parameter
    201209  G4double efm=pathlength/fermi;            // energy absorption length
    202210  G4int    nbi=static_cast<G4int>(bfm/bhdb);
     
    219227          << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<" "
    220228          << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
    221           << a4Mom <<G4endl;
     229          << a4Mom <<G4endl;
    222230#endif
    223231#ifdef pdebug
     
    236244      if((*current).first > toSort)        // The current is smaller then existing
    237245      {
    238                theSorted.insert(current, it);     // It shifts the others up
    239                inserted = true;
    240                break;
     246        theSorted.insert(current, it);     // It shifts the others up
     247        inserted = true;
     248        break;
    241249      }
    242250    }
    243     if(!inserted) theSorted.push_back(it); // It is bigger than any previous
     251    if(!inserted) theSorted.push_back(it); // It is bigger than any previous (@@Check this)
    244252  }
    245253 
     
    278286        <<theSorted.size()<<G4endl;
    279287#endif
    280  
     288  G4bool EscapeExists = false;
    281289  for(current = theSorted.begin(); current!=theSorted.end(); current++)
    282290  {
    283291#ifdef pdebug
    284                                 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nq="
     292    G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nq="
    285293          <<(*current).second->GetDefinition()->GetQuarkContent(3)<<", naq="
    286294          <<(*current).second->GetDefinition()->GetAntiQuarkContent(3)<<", PDG="
     
    350358
    351359#ifdef pdebug
    352                                 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
     360    G4cout<<"G4StringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
    353361                                                    <<theEnergyLostInFragmentation<<G4endl;
    354362#endif
    355 
    356     if(runningEnergy > theEnergyLostInFragmentation) break;
    357    
     363    if(runningEnergy > theEnergyLostInFragmentation)
     364    {
     365      EscapeExists = true;
     366      break;
     367    }
    358368#ifdef CHIPSdebug
    359369    G4cout <<"G4StringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
    360370           <<(*current).second->GetDefinition()->GetPDGCharge()<<" "
    361371           << (*current).second->GetDefinition()->GetPDGEncoding()<<" "
    362                   << (*current).second->Get4Momentum() <<G4endl;
     372           << (*current).second->Get4Momentum() <<G4endl;
    363373#endif
    364374#ifdef pdebug
     
    366376          <<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
    367377          <<current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
    368                  <<current->second->Get4Momentum()<<G4endl;
     378          <<current->second->Get4Momentum()<<G4endl;
    369379#endif
    370380
     
    428438      stras += stran;                           // Collected strangeness
    429439      chars += charg;                           // Collected charge
    430                                                 //empty = false;
     440      //empty = false;
    431441    }
    432442    if(barys>pcl)                               // Split in two or more parts (to survive!)
     
    451461        //@@ Convert it to a CHIPS function (Which class? G4QH::Conctruct?)
    452462        if(!strm)                               // --> The total strangness = 0 (n/p/pi-)
    453                                                                 {
    454                                                                                 if(chgm<0)                            // (n/pi-)
    455                                                                                 {
     463        {
     464          if(chgm<0)                            // (n/pi-)
     465          {
    456466            prtM=(-chgm)*mPiCh+brnm*mNeut;
    457467            prtQC=(-chgm)*PiMiQC+brnm*NeutQC;
    458468          }
    459469          else                                  // (n/p)
    460                                                                                 {
     470          {
    461471            prtM=chgm*mProt+(brnm-chgm)*mNeut;
    462472            prtQC=chgm*ProtQC+(brnm-chgm)*NeutQC;
     
    464474        }
    465475        else if(strm>=brnm)                     // ---> BigPositiveStrangeness(L/Pi+/K0/K-)
    466                                                                 {
     476        {
    467477          G4int stmb=strm-brnm;
    468                                                                                 if(chgm<0)                            // (L/K-/K0)
    469                                                                                 {
     478          if(chgm<0)                            // (L/K-/K0)
     479          {
    470480            prtM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
    471481            prtQC=(-chgm)*KMinQC+brnm*LambQC;
     
    473483            else if(stmb<-chgm) prtQC+=(-stmb-chgm)*AKZrQC;
    474484          }
    475                                                                                 else                                  // (L/K0/pi+)
    476                                                                                 {
     485          else                                  // (L/K0/pi+)
     486          {
    477487            prtM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
    478488            prtQC=chgm*PiPlQC+(strm-brnm)*KZerQC+brnm*LambQC;
     
    480490        }
    481491        else if(strm>0)                         // ---> PositiveStrangeness<B (L/n/p/Pi+-)
    482                                                                 {
     492        {
    483493          G4int bmst=brnm-strm;
    484                                                                                 if(chgm<0)                            // (L/n/Pi-)
    485                                                                                 {
     494          if(chgm<0)                            // (L/n/Pi-)
     495          {
    486496            prtM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
    487497            prtQC=(-chgm)*PiMiQC+strm*LambQC+bmst*NeutQC;
    488498          }
    489                                                                                 else if(chgm>=bmst)                   // (L/p/Pi+)
    490                                                                                 {
     499          else if(chgm>=bmst)                   // (L/p/Pi+)
     500          {
    491501            prtM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
    492502            prtQC=(chgm-bmst)*PiPlQC+strm*LambQC+bmst*ProtQC;
    493503          }
    494                                                                                 else                                  // ch<bmst (L/p/n)
    495                                                                                 {
     504          else                                  // ch<bmst (L/p/n)
     505          {
    496506            prtM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
    497507            prtQC=chgm*ProtQC+strm*LambQC+(bmst-chgm)*NeutQC;
     
    499509        }
    500510        else                                    // ---> NegativeStrangeness (N/K+/aK0/Pi-)
    501                                                                 {
     511        {
    502512          G4int bmst=brnm-strm;
    503                                                                                 if(chgm>=bmst)                        // (K+/p/Pi+)
    504                                                                                 {
     513          if(chgm>=bmst)                        // (K+/p/Pi+)
     514          {
    505515            prtM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
    506516            prtQC=(-strm)*KPlsQC+brnm*ProtQC+(chgm-bmst)*PiPlQC;
    507517          }
    508                                                                                 else if(chgm>=-strm)                  // (K+/p/n)
    509                                                                                 {
     518          else if(chgm>=-strm)                  // (K+/p/n)
     519          {
    510520            prtM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
    511521            prtQC=(-strm)*KPlsQC+chgm*ProtQC+(brnm-chgm)*NeutQC;
    512522          }
    513                                                                                 else if(chgm>=0)                      // (K+/aK0/n)
    514                                                                                 {
     523          else if(chgm>=0)                      // (K+/aK0/n)
     524          {
    515525            prtM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
    516526            prtQC=chgm*KPlsQC+(-chgm-strm)*AKZrQC+brnm*NeutQC;
    517527          }
    518                                                                                 else                                  // ch<0 (aK0/n/Pi-)
    519                                                                                 {
     528          else                                  // ch<0 (aK0/n/Pi-)
     529          {
    520530            prtM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
    521531            prtQC=(-strm)*KPlsQC+(-chgm)*PiMiQC+brnm*NeutQC;
     
    523533        }
    524534        EnFlowQC-=prtQC;
    525                                                                 chgm=chars-chgm;                        // Just to keep the same notation
     535        chgm=chars-chgm;                        // Just to keep the same notation
    526536        strm=stras-strm;
    527537        brnm=curb;
    528538        if(!strm)                               // --> The total strangness = 0 (n/p/pi-)
    529                                                                 {
    530                                                                                 if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
     539        {
     540          if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
    531541          else       resM=chgm*mProt+(brnm-chgm)*mNeut;
    532542        }
    533543        else if(strm>=brnm)                     // ---> BigPositiveStrangeness(L/Pi+/K0/K-)
    534                                                                 {
     544        {
    535545          G4int stmb=strm-brnm;
    536                                                                                 if(chgm<0) resM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
    537                                                                                 else       resM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
     546          if(chgm<0) resM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
     547          else       resM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
    538548        }
    539549        else if(strm>0)                         // ---> PositiveStrangeness<B (L/n/p/Pi+-)
    540                                                                 {
     550        {
    541551          G4int bmst=brnm-strm;
    542                                                                                 if     (chgm<0)     resM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
    543                                                                                 else if(chgm>=bmst) resM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
    544                                                                                 else                resM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
     552          if     (chgm<0)     resM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
     553          else if(chgm>=bmst) resM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
     554          else                resM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
    545555        }
    546556        else                                    // ---> NegativeStrangeness (N/K+/aK0/Pi-)
    547                                                                 {
     557        {
    548558          G4int bmst=brnm-strm;
    549                                                                                 if     (chgm>=bmst)  resM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
    550                                                                                 else if(chgm>=-strm) resM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
    551                                                                                 else if(chgm>=0)     resM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
    552                                                                                 else                 resM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
     559          if     (chgm>=bmst)  resM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
     560          else if(chgm>=-strm) resM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
     561          else if(chgm>=0)     resM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
     562          else                 resM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
    553563        }
    554564        G4LorentzVector prt4M=(prtM/(prtM+resM))*EnFlow4M;
     
    584594    //  G4int baryn = curQC.GetBaryonNumber();
    585595    //  if(baryn>0 && barys>0 && !empty) // New baryon and b-positive collection -> fill
    586            //  {
     596    //  {
    587597    //    G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
    588598    //    projHV.push_back(aHadron);
     
    620630      {
    621631        theFinalContents[hp] +=theContents[running];
    622                *(theFinalMomenta[hp])+=*(theMomenta[running]);
    623                running++;
    624                if(running == theContents.size()) break;
     632        *(theFinalMomenta[hp])+=*(theMomenta[running]);
     633        running++;
     634        if(running == theContents.size()) break;
    625635      }
    626636    }
     
    640650  G4QNucleus::SetParameters(fractionOfSingleQuasiFreeNucleons,
    641651                            fractionOfPairedQuasiFreeNucleons,
    642                                                  clusteringCoefficient,
    643                                                                fusionToExchange);
     652                            clusteringCoefficient,
     653                            fusionToExchange);
    644654  G4Quasmon::SetParameters(temperature, halfTheStrangenessOfSee, etaToEtaPrime);
    645655
     
    662672    G4QCHIPSWorld::Get()->GetParticles(nop);
    663673    G4QEnvironment* pan= new G4QEnvironment(projHV, targetPDGCode);
     674#ifdef pdebug
     675      G4cout<<"G4StringChipsParticleLevelInterface::Propagate: CHIPS fragmentation, rA="
     676            <<resA<<", #AbsPt="<<particleCount<<G4endl;
     677#endif
    664678    try
    665679    {
     
    676690      {
    677691        G4cerr <<"  Incoming 4-momentum and PDG code of "<<i<<"'th hadron: "
    678                <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
     692        <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
    679693      }
    680694      throw;
     
    682696    delete pan;
    683697  }
    684   else output = new G4QHadronVector;
     698  else
     699  {
     700#ifdef pdebug
     701    G4cout<<"G4StringChipsParticleLevelInterface::Propagate: NO CHIPS fragmentation, rA="
     702          <<resA<<", #AbsPt="<<particleCount<<G4endl;
     703#endif
     704    output = new G4QHadronVector;
     705  }   
    685706
    686707  // clean up impinging particles
     
    690711  // Fill the result.
    691712#ifdef CHIPSdebug
    692   G4cout << "NEXT EVENT"<<endl;
     713  G4cout << "NEXT EVENT, EscapeExists="<<EscapeExists<<G4endl;
    693714#endif
    694715
    695716  // first decay and add all escaping particles.
    696   for(current = firstEscape; current!=theSorted.end(); current++)
     717  if (EscapeExists) for (current = firstEscape; current!=theSorted.end(); current++)
    697718  {
    698719    G4KineticTrack* aResult = (*current).second;
     
    720741             theSec->SetMomentum(cur4Mom.vect());
    721742#ifdef trapdebug
    722                                          if(cdef->GetPDGEncoding()==113) G4cout
     743             if(cdef->GetPDGEncoding()==113) G4cout
    723744                <<"G4StringChipsParticleLevelInterface::Propagate: *Rho0* QGS dec2 PDG="
    724745                <<cdef->GetPDGEncoding()<<",4M="<<cur4Mom<<", grandparPDG= "
     
    726747#endif
    727748#ifdef pdebug
    728                                          G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
     749             G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
    729750              <<sdef->GetPDGEncoding()<<",4M="<<cur4Mom<<G4endl;
    730751#endif
     
    742763          theSec->SetMomentum(current4Mom.vect());
    743764#ifdef trapdebug
    744                                       if(sdef->GetPDGEncoding()==113)
     765          if(sdef->GetPDGEncoding()==113)
    745766            G4cout<<"G4StringChipsParticleLevelInterface::Propagate:*Rho0* QGS decay PDG="
    746767                  <<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<", parentPDG= "
     
    750771#endif
    751772#ifdef pdebug
    752                                       G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
     773          G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
    753774                <<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    754775#endif
     
    767788      theSec->SetMomentum(current4Mom.vect());
    768789#ifdef trapdebug
    769                                   if(aResult->GetDefinition()->GetPDGEncoding()==113)
     790      if(aResult->GetDefinition()->GetPDGEncoding()==113)
    770791        G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
    771792              <<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    772793#endif
    773794#ifdef pdebug
    774                                   G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
     795      G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
    775796            <<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    776797#endif
     
    849870      theSec->SetMomentum(current4Mom.vect());
    850871#ifdef pdebug
    851                                   G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
     872      G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
    852873              <<theDefinition->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
    853874#endif
     
    866887    G4cout <<"CHIPS particles "<<theDefinition->GetPDGCharge()<<" "
    867888           << theDefinition->GetPDGEncoding()<<" "
    868            << output->operator[](particle)->Get4Momentum() <<G4endl;
     889    << output->operator[](particle)->Get4Momentum() <<G4endl;
    869890#endif
    870891
    871892    delete output->operator[](particle);
     893  }
     894  else
     895  {
     896    if(resA>0)
     897    {
     898      G4ParticleDefinition* theDefinition = G4Neutron::Neutron();
     899      if(resA==1) // The residual nucleus at rest must be added to conserve BaryN & Charge
     900      {
     901        if(resZ == 1) theDefinition = G4Proton::Proton();
     902      }
     903      else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);
     904      theSec = new G4ReactionProduct(theDefinition);
     905      theSec->SetTotalEnergy(theDefinition->GetPDGMass());
     906      theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
     907      theResult->push_back(theSec);
     908      if(!resZ && resA>0) for(G4int ni=1; ni<resA; ni++)
     909      {
     910        theSec = new G4ReactionProduct(theDefinition);
     911        theSec->SetTotalEnergy(theDefinition->GetPDGMass());
     912        theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
     913        theResult->push_back(theSec);
     914      }
     915    }
    872916  }
    873917  delete output;
     
    878922  G4cout << "QUASMON preparation info "
    879923         << 1./MeV*proj4Mom<<" "
    880         << 1./MeV*targ4Mom<<" "
    881         << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
    882         << hitCount<<" "
    883         << particleCount<<" "
    884         << theLow<<" "
    885         << theHigh<<" "
    886         << G4endl;
     924  << 1./MeV*targ4Mom<<" "
     925  << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
     926  << hitCount<<" "
     927  << particleCount<<" "
     928  << theLow<<" "
     929  << theHigh<<" "
     930  << G4endl;
    887931#endif
    888932
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4VQCrossSection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VQCrossSection.cc,v 1.14 2007/11/15 09:36:43 mkossov Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VQCrossSection.cc,v 1.16 2009/03/09 15:41:17 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    3838// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
    3939// ****************************************************************************************
     40// Short description: a basic class for all CHIPS reaction cross-sections.
     41// -----------------------------------------------------------------------
    4042
    4143//#define debug
     
    9698{
    9799#ifdef pdebug
    98                 G4cout<<"G4VQCrossSection::EquLinearFit: ***Called*** X="<<DX<<", N="<<N<<", X0="<<X0
     100  G4cout<<"G4VQCrossSection::EquLinearFit: ***Called*** X="<<X<<", N="<<N<<", X0="<<X0
    99101        <<", DX="<<DX<<G4endl;
    100                 G4cout<<"G4VQCrossSection::EquLinearFit: Y[0]="<<Y[0]<<", Y[N-1]="<<Y[N-1]<<G4endl;
     102  G4cout<<"G4VQCrossSection::EquLinearFit: Y[0]="<<Y[0]<<", Y[N-1]="<<Y[N-1]<<G4endl;
     103  //for(G4int i=1; i<N; i++)G4cout<<"-----G4VQCS::EquLinearFit: Y["<<i<<"]="<<Y[i]<<G4endl;
    101104#endif
    102105  if(DX<=0. || N<2)
     
    113116  G4double yi=Y[j];
    114117  G4double sigma=yi+(Y[j+1]-yi)*d;
     118#ifdef pdebug
     119  G4cout<<"G4VQCrossSection::EquLinearFit: CS="<<sigma<<G4endl;
     120#endif
    115121  return sigma;
    116122}
  • trunk/source/processes/hadronic/models/coherent_elastic/History

    r962 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     17
     1802 March 2009 - D. Wright for V.Grichine (hadr-cohe-V09-02-00)
     19--------------------------------------------------------------
     20  Model precise sampling and 'on the fly' table preparation in
     21  G4DiffuseElastic.hh, .cc
    1622
    172327 November 2008 - V.Ivanchenko (hadr-cohe-V09-01-08)
  • trunk/source/processes/hadronic/models/coherent_elastic/include/G4DiffuseElastic.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4DiffuseElastic.hh,v 1.13 2007/11/06 17:01:20 grichine Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4DiffuseElastic.hh,v 1.15 2009/02/20 15:38:07 grichine Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    164164                                G4double tmass, G4double thetaLab);
    165165
    166 
     166  void TestAngleTable(const G4ParticleDefinition* theParticle, G4double partMom,
     167                      G4double Z, G4double A);
    167168
    168169
     
    175176  G4double GetDiffElasticProb(G4double theta);
    176177  G4double GetDiffElasticSumProb(G4double theta);
     178  G4double GetDiffElasticSumProbA(G4double alpha);
    177179  G4double GetIntegrandFunction(G4double theta);
    178180
     
    443445  G4double r0;
    444446
    445   if(A < 50.)
    446   {
    447     if(A > 10.) r0  = 1.16*( 1 - std::pow(A, -2./3.) )*fermi;   // 1.08*fermi;
    448     else        r0  = 1.1*fermi;
     447  if( A < 50. )
     448  {
     449    if( A > 10. ) r0  = 1.16*( 1 - std::pow(A, -2./3.) )*fermi;   // 1.08*fermi;
     450    else          r0  = 1.1*fermi;
    449451
    450452    fNuclearRadius = r0*std::pow(A, 1./3.);
     
    452454  else
    453455  {
    454     r0 = 1.7*fermi;
    455 
    456     fNuclearRadius = r0*std::pow(A, 0.27);
     456    r0 = 1.7*fermi;   // 1.7*fermi;
     457
     458    fNuclearRadius = r0*std::pow(A, 0.27); // 0.27);
    457459  }
    458460  return fNuclearRadius;
  • trunk/source/processes/hadronic/models/coherent_elastic/src/G4ChargeExchange.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ChargeExchange.cc,v 1.14 2008/12/18 13:01:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ChargeExchange.cc,v 1.13 2008/11/20 12:35:19 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    312312    dd = 10.;
    313313  }
    314   G4double x1 = (1.0 - std::exp(-tmax*bb))*aa/bb;
    315   G4double x2 = (1.0 - std::exp(-tmax*dd))*cc/dd;
     314  G4double x1 = (1.0 - exp(-tmax*bb))*aa/bb;
     315  G4double x2 = (1.0 - exp(-tmax*dd))*cc/dd;
    316316 
    317317  G4double t;
  • trunk/source/processes/hadronic/models/coherent_elastic/src/G4DiffuseElastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DiffuseElastic.cc,v 1.20 2008/01/14 10:39:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4DiffuseElastic.cc,v 1.23 2009/03/02 09:17:43 grichine Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    6767{
    6868  SetMinEnergy( 0.01*GeV );
    69   SetMaxEnergy( 100.*TeV );
     69  SetMaxEnergy( 1.*TeV );
    7070  verboseLevel = 0;
    7171  lowEnergyRecoilLimit = 100.*keV; 
     
    8383
    8484  fEnergyBin = 200;
    85   fAngleBin = 100;
    86 
    87   fEnergyVector = 0;
     85  fAngleBin  = 200;
     86
     87  fEnergyVector =  new G4PhysicsLogVector( theMinEnergy, theMaxEnergy, fEnergyBin );
    8888  fAngleTable = 0;
    8989
     
    107107{
    108108  SetMinEnergy( 0.01*GeV );
    109   SetMaxEnergy( 100.*TeV );
     109  SetMaxEnergy( 1.*TeV );
    110110  verboseLevel = 0;
    111111  lowEnergyRecoilLimit = 100.*keV; 
     
    122122  thePionMinus= G4PionMinus::PionMinus();
    123123
    124   fEnergyBin = 200;
    125   fAngleBin = 100;
     124  fEnergyBin = 200; // 200; // 100;
     125  fAngleBin  = 400; // 200; // 100;
    126126
    127127  // fEnergyVector = 0;
     
    174174    fAtomicWeight = (*theElementTable)[jEl]->GetN();     // number of nucleons
    175175    fNuclearRadius = CalculateNuclearRad(fAtomicWeight);
    176     if(verboseLevel > 0)   
     176
     177    if(verboseLevel > 0)
     178    {   
    177179      G4cout<<"G4DiffuseElastic::Initialise() the element: "
    178180            <<(*theElementTable)[jEl]->GetName()<<G4endl;
     181    }
    179182    fElementNumberVector.push_back(fAtomicNumber);
    180183    fElementNameVector.push_back((*theElementTable)[jEl]->GetName());
     
    183186    fAngleBank.push_back(fAngleTable);
    184187  } 
    185   return;
    186 }
    187 
    188 //////////////////////////////////////////////////////////////////////////////
    189 //
    190 // Initialisation for given particle on fly using new element number
    191 
    192 void G4DiffuseElastic::InitialiseOnFly(G4double Z, G4double A)
    193 {
    194   fAtomicNumber = Z;     // atomic number
    195   fAtomicWeight = A;     // number of nucleons
    196   fNuclearRadius = CalculateNuclearRad(fAtomicWeight);
    197   if(verboseLevel > 0)   
    198     G4cout<<"G4DiffuseElastic::Initialise() the element with Z = "
    199           <<Z<<"; and A = "<<A<<G4endl;
    200   fElementNumberVector.push_back(fAtomicNumber);
    201 
    202   BuildAngleTable();
    203   fAngleBank.push_back(fAngleTable);
    204   return;
    205 }
    206 
    207 ///////////////////////////////////////////////////////////////////////////////
    208 //
    209 // Build for given particle and element table of momentum, angle probability.
    210 // For the moment in lab system.
    211 
    212 void G4DiffuseElastic::BuildAngleTable()
    213 {
    214   G4int i, j;
    215   G4double partMom, kinE, a=0., z = fParticle->GetPDGCharge(), m1 = fParticle->GetPDGMass();
    216   G4double theta1, theta2, thetaMax, thetaCoulomb, sum = 0.;
    217 
    218   G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral;
    219  
    220   fAngleTable = new G4PhysicsTable(fEnergyBin);
    221 
    222   for(i = 0; i < fEnergyBin; i++)
    223   {
    224     kinE        = fEnergyVector->GetLowEdgeEnergy(i);
    225     partMom     = std::sqrt( kinE*(kinE + 2*m1) );
    226     fWaveVector = partMom/hbarc;
    227 
    228     thetaMax    = 10.174/fWaveVector/fNuclearRadius;
    229 
    230     if (thetaMax > pi) thetaMax = pi;
    231 
    232     thetaCoulomb = 0.2*thetaMax;
    233 
    234     if(z)
    235     {
    236       a = partMom/m1;
    237       fBeta          = a/std::sqrt(1+a*a);
    238       fZommerfeld    = CalculateZommerfeld( fBeta, z, fAtomicNumber);
    239       fAm            = CalculateAm( partMom, fZommerfeld, fAtomicNumber);
    240     }
    241     G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fAngleBin);
    242 
    243     G4PhysicsLogVector*  angleBins = new G4PhysicsLogVector( 0.01*thetaMax, thetaMax, fAngleBin );
    244 
    245     for(j = 1; j < fAngleBin; j++)
    246     {
    247       theta1 = angleBins->GetLowEdgeEnergy(j-1);
    248       theta2 = angleBins->GetLowEdgeEnergy(j);
    249 
    250       if(theta2 > thetaCoulomb && z) fAddCoulomb = true;
    251 
    252       sum   += integral.Legendre10(this,&G4DiffuseElastic::GetIntegrandFunction, theta1,theta2);
    253      
    254       angleVector->PutValue( j-1 , theta2, sum );
    255       // G4cout<<"j-1 = "<<j-1<<"; theta2 = "<<theta2<<"; sum = "<<sum<<G4endl;
    256     }
    257     fAddCoulomb = false;
    258 
    259     fAngleTable->insertAt(i,angleVector);
    260 
    261     // delete[] angleVector;
    262     // delete[] angleBins;
    263   }
    264188  return;
    265189}
     
    525449  fAtomicWeight  = A;
    526450  fAtomicNumber  = Z;
    527   G4double z             = particle->GetPDGCharge();
    528   if(z)
     451  fNuclearRadius = CalculateNuclearRad(A);
     452  fAddCoulomb    = false;
     453
     454  G4double z     = particle->GetPDGCharge();
     455
     456  G4double kRt   = fWaveVector*fNuclearRadius*theta;
     457  G4double kRtC  = 1.9;
     458
     459  if( z && (kRt > kRtC) )
    529460  {
    530461    fAddCoulomb = true;
    531     fBeta          = CalculateParticleBeta( particle, momentum);
    532     fZommerfeld    = CalculateZommerfeld( fBeta, z, fAtomicNumber);
    533     fAm            = CalculateAm( momentum, fZommerfeld, fAtomicNumber);
    534   }
    535   fNuclearRadius = CalculateNuclearRad(A);
    536 
     462    fBeta       = CalculateParticleBeta( particle, momentum);
     463    fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber);
     464    fAm         = CalculateAm( momentum, fZommerfeld, fAtomicNumber);
     465  }
    537466  G4double sigma = fNuclearRadius*fNuclearRadius*GetDiffElasticSumProb(theta);
    538467
     
    552481{
    553482  G4double m1 = particle->GetPDGMass();
     483
    554484  G4LorentzVector lv1(0.,0.,plab,std::sqrt(plab*plab+m1*m1));
    555485
    556486  G4int iZ = static_cast<G4int>(Z+0.5);
    557487  G4int iA = static_cast<G4int>(A+0.5);
    558   G4ParticleDefinition * theDef = 0;
     488
     489  G4ParticleDefinition* theDef = 0;
    559490
    560491  if      (iZ == 1 && iA == 1) theDef = theProton;
     
    575506  G4ThreeVector p1 = lv1.vect();
    576507  G4double ptot    = p1.mag();
    577   G4double ptot2 = ptot*ptot;
    578   G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
     508  G4double ptot2   = ptot*ptot;
     509  G4double cost    = 1 - 0.5*std::fabs(tMand)/ptot2;
    579510
    580511  if( cost >= 1.0 )      cost = 1.0; 
     
    658589  // G4double r0    = 1.08*fermi;
    659590  // G4double rad   = r0*std::pow(A, 1./3.);
     591
    660592  G4double kr    = fWaveVector*fNuclearRadius; // wavek*rad;
    661593  G4double kr2   = kr*kr;
     
    686618  }
    687619  G4double lambda = 15.; // 15 ok
     620
    688621  //  G4double kg    = fWaveVector*gamma;   // wavek*delta;
     622
    689623  G4double kg    = lambda*(1.-std::exp(-fWaveVector*gamma/lambda));   // wavek*delta;
    690624  G4double kg2   = kg*kg;
     625
    691626  // G4double dk2t  = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta;
    692627  // G4double dk2t2 = dk2t*dk2t;
    693628  // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta;
     629
    694630  G4double pikdt    = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda));   // wavek*delta;
    695631
     
    730666  // G4double r0    = 1.08*fermi;
    731667  // G4double rad   = r0*std::pow(A, 1./3.);
     668
    732669  G4double kr    = fWaveVector*fNuclearRadius; // wavek*rad;
    733670  G4double kr2   = kr*kr;
     
    774711
    775712  G4double kg2   = kg*kg;
     713
    776714  // G4double dk2t  = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta;
    777 
    778715  //   G4cout<<"dk2t = "<<dk2t<<G4endl;
    779 
    780716  // G4double dk2t2 = dk2t*dk2t;
    781 
    782717  // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta;
     718
    783719  G4double pikdt    = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda));   // wavek*delta;
    784720
     
    808744////////////////////////////////////////////////////////////////////////////
    809745//
     746// return differential elastic probability d(probability)/d(t) with
     747// Coulomb correction
     748
     749G4double
     750G4DiffuseElastic::GetDiffElasticSumProbA( G4double alpha )
     751{
     752  G4double theta;
     753
     754  theta = std::sqrt(alpha);
     755
     756  // theta = std::acos( 1 - alpha/2. );
     757
     758  G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
     759  G4double delta, diffuse, gamma;
     760  G4double e1, e2, bone, bone2;
     761
     762  // G4double wavek = momentum/hbarc;  // wave vector
     763  // G4double r0    = 1.08*fermi;
     764  // G4double rad   = r0*std::pow(A, 1./3.);
     765
     766  G4double kr    = fWaveVector*fNuclearRadius; // wavek*rad;
     767  G4double kr2   = kr*kr;
     768  G4double krt   = kr*theta;
     769
     770  bzero      = BesselJzero(krt);
     771  bzero2     = bzero*bzero;   
     772  bone       = BesselJone(krt);
     773  bone2      = bone*bone;
     774  bonebyarg  = BesselOneByArg(krt);
     775  bonebyarg2 = bonebyarg*bonebyarg; 
     776
     777  if (fParticle == theProton)
     778  {
     779    diffuse = 0.63*fermi;
     780    // diffuse = 0.6*fermi;
     781    gamma   = 0.3*fermi;
     782    delta   = 0.1*fermi*fermi;
     783    e1      = 0.3*fermi;
     784    e2      = 0.35*fermi;
     785  }
     786  else // as proton, if were not defined
     787  {
     788    diffuse = 0.63*fermi;
     789    gamma   = 0.3*fermi;
     790    delta   = 0.1*fermi*fermi;
     791    e1      = 0.3*fermi;
     792    e2      = 0.35*fermi;
     793  }
     794  G4double lambda = 15.; // 15 ok
     795  // G4double kg    = fWaveVector*gamma;   // wavek*delta;
     796  G4double kg    = lambda*(1.-std::exp(-fWaveVector*gamma/lambda));   // wavek*delta;
     797
     798  // G4cout<<"kg = "<<kg<<G4endl;
     799
     800  if(fAddCoulomb)  // add Coulomb correction
     801  {
     802    G4double sinHalfTheta  = theta*0.5; // std::sin(0.5*theta);
     803    G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
     804
     805    kg += 0.5*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0()
     806  // kg += 0.65*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0()
     807  }
     808
     809  G4double kg2   = kg*kg;
     810
     811  // G4double dk2t  = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta;
     812  //   G4cout<<"dk2t = "<<dk2t<<G4endl;
     813  // G4double dk2t2 = dk2t*dk2t;
     814  // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta;
     815
     816  G4double pikdt    = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda));   // wavek*delta;
     817
     818  // G4cout<<"pikdt = "<<pikdt<<G4endl;
     819
     820  damp           = DampFactor(pikdt);
     821  damp2          = damp*damp;
     822
     823  G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector*fWaveVector; 
     824  G4double e2dk3t  = -2.*e2*delta*fWaveVector*fWaveVector*fWaveVector*theta;
     825
     826  sigma  = kg2;
     827  // sigma += dk2t2;
     828  sigma *= bzero2;
     829  sigma += mode2k2*bone2;
     830  sigma += e2dk3t*bzero*bone;
     831
     832  // sigma += kr2*(1 + 8.*fZommerfeld*fZommerfeld/kr2)*bonebyarg2;  // correction at J1()/()
     833  sigma += kr2*bonebyarg2;  // correction at J1()/()
     834
     835  sigma *= damp2;          // *rad*rad;
     836
     837  return sigma;
     838}
     839
     840
     841////////////////////////////////////////////////////////////////////////////
     842//
    810843// return differential elastic probability 2*pi*sin(theta)*d(probability)/d(omega)
    811844
    812845G4double
    813 G4DiffuseElastic::GetIntegrandFunction( G4double theta )
     846G4DiffuseElastic::GetIntegrandFunction( G4double alpha )
    814847{
    815848  G4double result;
    816849
    817   result  = 2*pi*std::sin(theta);
    818   result *= GetDiffElasticSumProb(theta);
     850  result  = GetDiffElasticSumProbA(alpha);
     851
     852  // result *= 2*pi*std::sin(theta);
     853
    819854  return result;
    820855}
     
    859894////////////////////////////////////////////////////////////////////////////
    860895//
    861 // Return inv momentum transfer -t > 0 from initialisation table
    862 
    863 G4double G4DiffuseElastic::SampleTableT( const G4ParticleDefinition* aParticle, G4double p,
    864                                                G4double Z, G4double A)
    865 {
    866   G4double theta = SampleTableThetaCMS( aParticle,  p, Z, A); // sample theta in cms
    867   G4double t     = 2*p*p*( 1 - std::cos(theta) ); // -t !!!
    868   return t;
    869 }
    870 
    871 ////////////////////////////////////////////////////////////////////////////
    872 //
    873896// Return scattering angle sampled in cms
    874897
     
    922945}
    923946
    924 ////////////////////////////////////////////////////////////////////////////
    925 //
    926 // Return scattering angle sampled in cms according to precalculated table.
     947/////////////////////////////////////////////////////////////////////////////
     948/////////////////////  Table preparation and reading ////////////////////////
     949////////////////////////////////////////////////////////////////////////////
     950//
     951// Return inv momentum transfer -t > 0 from initialisation table
     952
     953G4double G4DiffuseElastic::SampleTableT( const G4ParticleDefinition* aParticle, G4double p,
     954                                               G4double Z, G4double A)
     955{
     956  G4double alpha = SampleTableThetaCMS( aParticle,  p, Z, A); // sample theta2 in cms
     957  // G4double t     = 2*p*p*( 1 - std::cos(std::sqrt(alpha)) );             // -t !!!
     958  G4double t     = p*p*alpha;             // -t !!!
     959  return t;
     960}
     961
     962////////////////////////////////////////////////////////////////////////////
     963//
     964// Return scattering angle2 sampled in cms according to precalculated table.
    927965
    928966
     
    942980  if ( iElement == fElementNumberVector.size() )
    943981  {
    944     InitialiseOnFly(Z,A);
     982    InitialiseOnFly(Z,A); // table preparation, if needed
     983
    945984    // iElement--;
    946985
     
    955994  G4double kinE = std::sqrt(momentum*momentum + m1*m1) - m1;
    956995
    957   for(iMomentum = 0; iMomentum < fEnergyBin; iMomentum++)
     996  for( iMomentum = 0; iMomentum < fEnergyBin; iMomentum++)
    958997  {
    959998    if( kinE < fEnergyVector->GetLowEdgeEnergy(iMomentum) ) break;
    960999  }
    961   if ( iMomentum == fEnergyBin ) iMomentum--;   // kinE is more then theMaxEnergy
     1000  if ( iMomentum >= fEnergyBin ) iMomentum = fEnergyBin-1;   // kinE is more then theMaxEnergy
    9621001  if ( iMomentum < 0 )           iMomentum = 0; // against negative index, kinE < theMinEnergy
     1002
    9631003  // G4cout<<"iMomentum = "<<iMomentum<<G4endl;
    9641004
    965   if (iMomentum == fEnergyBin -1 || iMomentum == 0 ) // the table edges
     1005  if (iMomentum == fEnergyBin -1 || iMomentum == 0 )   // the table edges
    9661006  {
    9671007    position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand();
     1008
    9681009    // G4cout<<"position = "<<position<<G4endl;
    9691010
    970     for(iAngle = 0; iAngle < fAngleBin; iAngle++)
     1011    for(iAngle = 0; iAngle < fAngleBin-1; iAngle++)
    9711012    {
    9721013      if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break;
    9731014    }
    974     if (iAngle == fAngleBin) iAngle--;
     1015    if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
     1016
    9751017    // G4cout<<"iAngle = "<<iAngle<<G4endl;
    9761018
    9771019    randAngle = GetScatteringAngle(iMomentum, iAngle, position);
     1020
    9781021    // G4cout<<"randAngle = "<<randAngle<<G4endl;
    9791022  }
    980   else
    981   {
    982     position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand();
     1023  else  // kinE inside between energy table edges
     1024  {
     1025    // position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand();
     1026    position = (*(*fAngleTable)(iMomentum))(0)*G4UniformRand();
     1027
    9831028    // G4cout<<"position = "<<position<<G4endl;
    9841029
    985     for(iAngle = 0; iAngle < fAngleBin; iAngle++)
     1030    for(iAngle = 0; iAngle < fAngleBin-1; iAngle++)
    9861031    {
    987       if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break;
     1032      // if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break;
     1033      if( position > (*(*fAngleTable)(iMomentum))(iAngle) ) break;
    9881034    }
    989     if (iAngle == fAngleBin) iAngle--;
     1035    if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
     1036
    9901037    // G4cout<<"iAngle = "<<iAngle<<G4endl;
    9911038
    9921039    theta2  = GetScatteringAngle(iMomentum, iAngle, position);
     1040
    9931041    // G4cout<<"theta2 = "<<theta2<<G4endl;
    9941042    E2 = fEnergyVector->GetLowEdgeEnergy(iMomentum);
     1043
    9951044    // G4cout<<"E2 = "<<E2<<G4endl;
    996 
     1045   
    9971046    iMomentum--;
    998 
    999     position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand();
     1047   
     1048    // position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand();
     1049
    10001050    // G4cout<<"position = "<<position<<G4endl;
    10011051
    1002     for(iAngle = 0; iAngle < fAngleBin; iAngle++)
     1052    for(iAngle = 0; iAngle < fAngleBin-1; iAngle++)
    10031053    {
    1004       if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break;
     1054      // if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break;
     1055      if( position > (*(*fAngleTable)(iMomentum))(iAngle) ) break;
    10051056    }
    1006     if (iAngle == fAngleBin) iAngle--;
    1007 
     1057    if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
     1058   
    10081059    theta1  = GetScatteringAngle(iMomentum, iAngle, position);
     1060
    10091061    // G4cout<<"theta1 = "<<theta1<<G4endl;
     1062
    10101063    E1 = fEnergyVector->GetLowEdgeEnergy(iMomentum);
     1064
    10111065    // G4cout<<"E1 = "<<E1<<G4endl;
    10121066
     
    10161070
    10171071    randAngle = W1*theta1 + W2*theta2;
     1072   
     1073    // randAngle = theta2;
    10181074    // G4cout<<"randAngle = "<<randAngle<<G4endl;
    10191075  }
     1076  // G4double angle = randAngle;
     1077  // if (randAngle > 0.) randAngle /= 2*pi*std::sin(angle);
     1078
    10201079  return randAngle;
    10211080}
    10221081
     1082//////////////////////////////////////////////////////////////////////////////
     1083//
     1084// Initialisation for given particle on fly using new element number
     1085
     1086void G4DiffuseElastic::InitialiseOnFly(G4double Z, G4double A)
     1087{
     1088  fAtomicNumber  = Z;     // atomic number
     1089  fAtomicWeight  = A;     // number of nucleons
     1090
     1091  fNuclearRadius = CalculateNuclearRad(fAtomicWeight);
     1092 
     1093  if( verboseLevel > 0 )   
     1094  {
     1095    G4cout<<"G4DiffuseElastic::Initialise() the element with Z = "
     1096          <<Z<<"; and A = "<<A<<G4endl;
     1097  }
     1098  fElementNumberVector.push_back(fAtomicNumber);
     1099
     1100  BuildAngleTable();
     1101
     1102  fAngleBank.push_back(fAngleTable);
     1103
     1104  return;
     1105}
     1106
     1107///////////////////////////////////////////////////////////////////////////////
     1108//
     1109// Build for given particle and element table of momentum, angle probability.
     1110// For the moment in lab system.
     1111
     1112void G4DiffuseElastic::BuildAngleTable()
     1113{
     1114  G4int i, j;
     1115  G4double partMom, kinE, a = 0., z = fParticle->GetPDGCharge(), m1 = fParticle->GetPDGMass();
     1116  G4double alpha1, alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.;
     1117
     1118  G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral;
     1119 
     1120  fAngleTable = new G4PhysicsTable(fEnergyBin);
     1121
     1122  for( i = 0; i < fEnergyBin; i++)
     1123  {
     1124    kinE        = fEnergyVector->GetLowEdgeEnergy(i);
     1125    partMom     = std::sqrt( kinE*(kinE + 2*m1) );
     1126
     1127    fWaveVector = partMom/hbarc;
     1128
     1129    G4double kR     = fWaveVector*fNuclearRadius;
     1130    G4double kR2    = kR*kR;
     1131    G4double kRmax  = 18.6; // 10.6; 10.6, 18, 10.174; ~ 3 maxima of J1 or 15., 25.
     1132    G4double kRcoul = 1.9; // 1.2; 1.4, 2.5; // on the first slope of J1
     1133    // G4double kRlim  = 1.2;
     1134    // G4double kRlim2 = kRlim*kRlim/kR2;
     1135
     1136    alphaMax = kRmax*kRmax/kR2;
     1137
     1138    if (alphaMax > 4.) alphaMax = 4.;  // vmg05-02-09: was pi2
     1139
     1140    alphaCoulomb = kRcoul*kRcoul/kR2;
     1141
     1142    if( z )
     1143    {
     1144      a           = partMom/m1;         // beta*gamma for m1
     1145      fBeta       = a/std::sqrt(1+a*a);
     1146      fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber);
     1147      fAm         = CalculateAm( partMom, fZommerfeld, fAtomicNumber);
     1148    }
     1149    G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fAngleBin-1);
     1150
     1151    // G4PhysicsLogVector*  angleBins = new G4PhysicsLogVector( 0.001*alphaMax, alphaMax, fAngleBin );
     1152
     1153    G4double delth = alphaMax/fAngleBin;
     1154       
     1155    sum = 0.;
     1156
     1157    // fAddCoulomb = false;
     1158    fAddCoulomb = true;
     1159
     1160    // for(j = 1; j < fAngleBin; j++)
     1161    for(j = fAngleBin-1; j >= 1; j--)
     1162    {
     1163      // alpha1 = angleBins->GetLowEdgeEnergy(j-1);
     1164      // alpha2 = angleBins->GetLowEdgeEnergy(j);
     1165
     1166      // alpha1 = alphaMax*(j-1)/fAngleBin;
     1167      // alpha2 = alphaMax*( j )/fAngleBin;
     1168
     1169      alpha1 = delth*(j-1);
     1170      // if(alpha1 < kRlim2) alpha1 = kRlim2;
     1171      alpha2 = alpha1 + delth;
     1172
     1173      // if( ( alpha2 > alphaCoulomb ) && z ) fAddCoulomb = true;
     1174      if( ( alpha1 < alphaCoulomb ) && z ) fAddCoulomb = false;
     1175
     1176      delta = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2);
     1177      // delta = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2);
     1178
     1179      sum += delta;
     1180     
     1181      angleVector->PutValue( j-1 , alpha1, sum ); // alpha2
     1182      // G4cout<<"j-1 = "<<j-1<<"; alpha2 = "<<alpha2<<"; sum = "<<sum<<G4endl;
     1183    }
     1184    fAngleTable->insertAt(i,angleVector);
     1185
     1186    // delete[] angleVector;
     1187    // delete[] angleBins;
     1188  }
     1189  return;
     1190}
     1191
    10231192/////////////////////////////////////////////////////////////////////////////////
    10241193//
     
    10261195
    10271196G4double
    1028 G4DiffuseElastic:: GetScatteringAngle(G4int iMomentum, G4int iAngle, G4double position)
     1197G4DiffuseElastic:: GetScatteringAngle( G4int iMomentum, G4int iAngle, G4double position )
    10291198{
    10301199 G4double x1, x2, y1, y2, randAngle;
     
    10331202  {
    10341203    randAngle = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
     1204    // iAngle++;
    10351205  }
    10361206  else
     
    10461216    x2 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
    10471217
    1048     if ( x1 == x2 )    randAngle = x2;
     1218    if ( x1 == x2 )   randAngle = x2;
    10491219    else
    10501220    {
    1051       if ( y1 == y2  ) randAngle = x1 + (x2 - x1)*G4UniformRand();
     1221      if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*G4UniformRand();
    10521222      else
    10531223      {
    1054         randAngle = x1 + (position - y1)*(x2 - x1)/(y2 - y1);
     1224        randAngle = x1 + ( position - y1 )*( x2 - x1 )/( y2 - y1 );
    10551225      }
    10561226    }
     
    12701440}
    12711441
     1442///////////////////////////////////////////////////////////////////////////////
     1443//
     1444// Test for given particle and element table of momentum, angle probability.
     1445// For the moment in lab system.
     1446
     1447void G4DiffuseElastic::TestAngleTable(const G4ParticleDefinition* theParticle, G4double partMom,
     1448                                            G4double Z, G4double A)
     1449{
     1450  fAtomicNumber  = Z;     // atomic number
     1451  fAtomicWeight  = A;     // number of nucleons
     1452  fNuclearRadius = CalculateNuclearRad(fAtomicWeight);
     1453 
     1454     
     1455 
     1456  G4cout<<"G4DiffuseElastic::TestAngleTable() init the element with Z = "
     1457          <<Z<<"; and A = "<<A<<G4endl;
     1458 
     1459  fElementNumberVector.push_back(fAtomicNumber);
     1460
     1461 
     1462
     1463
     1464  G4int i=0, j;
     1465  G4double a = 0., z = theParticle->GetPDGCharge(),  m1 = fParticle->GetPDGMass();
     1466  G4double alpha1=0., alpha2=0., alphaMax=0., alphaCoulomb=0.;
     1467  G4double deltaL10 = 0., deltaL96 = 0., deltaAG = 0.;
     1468  G4double sumL10 = 0.,sumL96 = 0.,sumAG = 0.;
     1469  G4double epsilon = 0.001;
     1470
     1471  G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral;
     1472 
     1473  fAngleTable = new G4PhysicsTable(fEnergyBin);
     1474
     1475  fWaveVector = partMom/hbarc;
     1476
     1477  G4double kR     = fWaveVector*fNuclearRadius;
     1478  G4double kR2    = kR*kR;
     1479  G4double kRmax  = 10.6; // 10.6, 18, 10.174; ~ 3 maxima of J1 or 15., 25.
     1480  G4double kRcoul = 1.2; // 1.4, 2.5; // on the first slope of J1
     1481
     1482  alphaMax = kRmax*kRmax/kR2;
     1483
     1484  if (alphaMax > 4.) alphaMax = 4.;  // vmg05-02-09: was pi2
     1485
     1486  alphaCoulomb = kRcoul*kRcoul/kR2;
     1487
     1488  if( z )
     1489  {
     1490      a           = partMom/m1; // beta*gamma for m1
     1491      fBeta       = a/std::sqrt(1+a*a);
     1492      fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber);
     1493      fAm         = CalculateAm( partMom, fZommerfeld, fAtomicNumber);
     1494  }
     1495  G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fAngleBin-1);
     1496
     1497  // G4PhysicsLogVector*  angleBins = new G4PhysicsLogVector( 0.001*alphaMax, alphaMax, fAngleBin );
     1498   
     1499 
     1500  fAddCoulomb = false;
     1501
     1502  for(j = 1; j < fAngleBin; j++)
     1503  {
     1504      // alpha1 = angleBins->GetLowEdgeEnergy(j-1);
     1505      // alpha2 = angleBins->GetLowEdgeEnergy(j);
     1506
     1507    alpha1 = alphaMax*(j-1)/fAngleBin;
     1508    alpha2 = alphaMax*( j )/fAngleBin;
     1509
     1510    if( ( alpha2 > alphaCoulomb ) && z ) fAddCoulomb = true;
     1511
     1512    deltaL10 = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2);
     1513    deltaL96 = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2);
     1514    deltaAG  = integral.AdaptiveGauss(this, &G4DiffuseElastic::GetIntegrandFunction,
     1515                                       alpha1, alpha2,epsilon);
     1516
     1517      // G4cout<<alpha1<<"\t"<<std::sqrt(alpha1)/degree<<"\t"
     1518      //     <<deltaL10<<"\t"<<deltaL96<<"\t"<<deltaAG<<G4endl;
     1519
     1520    sumL10 += deltaL10;
     1521    sumL96 += deltaL96;
     1522    sumAG  += deltaAG;
     1523
     1524    G4cout<<alpha1<<"\t"<<std::sqrt(alpha1)/degree<<"\t"
     1525            <<sumL10<<"\t"<<sumL96<<"\t"<<sumAG<<G4endl;
     1526     
     1527    angleVector->PutValue( j-1 , alpha1, sumL10 ); // alpha2
     1528  }
     1529  fAngleTable->insertAt(i,angleVector);
     1530  fAngleBank.push_back(fAngleTable);
     1531
     1532  /*
     1533  // Integral over all angle range - Bad accuracy !!!
     1534
     1535  sumL10 = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, 0., alpha2);
     1536  sumL96 = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, 0., alpha2);
     1537  sumAG  = integral.AdaptiveGauss(this, &G4DiffuseElastic::GetIntegrandFunction,
     1538                                       0., alpha2,epsilon);
     1539  G4cout<<G4endl;
     1540  G4cout<<alpha2<<"\t"<<std::sqrt(alpha2)/degree<<"\t"
     1541            <<sumL10<<"\t"<<sumL96<<"\t"<<sumAG<<G4endl;
     1542  */
     1543  return;
     1544}
     1545
    12721546//
    12731547//
  • trunk/source/processes/hadronic/models/de_excitation/History

    r1007 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1713 March 2009 Vladimir Ivanchenko (hadr-deex-V09-02-09)
     18---------------------------------------------------------
     19- G4CompetitiveFission - fixed 4-momentum balance by using direct Lorentz
     20                         computations (JMQ);
     21                       - use G4 units (VI).
     22
     2312 March 2009 Alexander Howard (hadr-deex-V09-02-08)
     24----------------------------------------------------
     25- Added Tatsumi's fixes ( G4GEMProbability.cc and G4GEMChannel.cc ) to GEM
     26  on top of patch9-02 ("hadr-deex-V09-02-07" and "hadr-deex-util-V09-02-00")
     27
     2804 March 2009 Gabriele Cosmo
     29----------------------------
     30- Fixed leaks in singleton classes in the 'util' module. Corrected wherever
     31  needed inlining of constructors/destructors for base classes and usage of
     32  virtual specification. Corresponds to tag "hadr-deex-util-V09-02-00".
     33
     3415 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-07)
     35---------------------------------------------------------
     36- G4EvaporationProbability - hbar_Plank substituted by hbarc (JMQ fix)
     37- G4FissionProbability - fixed forgotten parenthesis (JMQ fix)
     38
     3913 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-06)
     40---------------------------------------------------------
     41- Jose Manuel Quesada change the shape of probabilities (back to 9.2)
     42  for d, t, He3, alpha near the Coulomb barrier
     43
     4412 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-05)
     45---------------------------------------------------------
     46- Jose Manuel Quesada change the shape of probabilities
     47  for d, t, He3, alpha near the Coulomb barrier
     48
     4911 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-04)
     50---------------------------------------------------------
     51- Jose Manuel Quesada set default OPT=3 back for all particles
     52  and add smearing of Coloumb barriers of d, t, he3, alpha
     53
     5410 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-03)
     55---------------------------------------------------------
     56- Exclude updated G4VGammaDeexcitation
     57
     5810 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-02)
     59---------------------------------------------------------
     60- Jose Manuel Quesada set default OPT=3 for evaporation of protons
     61  and neutrons and OPT=1 for deuterons, tritons, alpha and He3
     62
     6310 February 2009 Vladimir Ivanchenko (hadr-deex-V09-02-01)
     64---------------------------------------------------------
     65- Miguel Cortes added extra protection to G4VGammaDeexcitation
     66
     6727 January 2009 Vladimir Ivanchenko (hadr-deex-V09-02-00)
     68--------------------------------------------------------
     69- Miguel Cortes fix of Lorentz transformation in G4VGammaDeexcitation,
     70  which provides Doppler broading of gamma lines
    1671
    177209 December 2008 Alexander Howard (hadr-deex-V09-01-25)
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4AlphaEvaporationProbability.cc

    r1007 r1055  
    104104//OPT=3,4 Kalbach's parameterization
    105105//
    106  G4double G4AlphaEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     106G4double G4AlphaEvaporationProbability::CrossSection(const  G4Fragment & fragment,
     107                                                     const  G4double K)
    107108{
    108109  theA=GetA();
     
    117118 
    118119  if (OPTxs==0) {std::ostringstream errOs;
    119     errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (Alpha's)!!"  <<G4endl;
     120    errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (Alpha's)!!" 
     121          <<G4endl;
    120122    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    121123    return 0.;}
     
    203205  G4double      ra=1.20;
    204206 
    205   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     207  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     208  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     209  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    206210  ecsq = ec * ec;
    207211  p = p0 + p1/ec + p2/ecsq;
     
    226230 
    227231  if (elab <= ec) { //start for E<Ec
    228     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     232    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    229233  }           //end for E<Ec
    230234  else {           //start for E>Ec
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4DeuteronEvaporationProbability.cc

    r1007 r1055  
    106106//OPT=3,4 Kalbach's parameterization
    107107//
    108  G4double G4DeuteronEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     108G4double G4DeuteronEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    109109{
    110110       theA=GetA();
     
    205205  G4double      ra=0.80;
    206206       
    207   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     207  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     208  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     209  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    208210  ecsq = ec * ec;
    209211  p = p0 + p1/ec + p2/ecsq;
     
    226228  elab = K * FragmentA / ResidualA;
    227229  sig = 0.;
    228  
     230
    229231  if (elab <= ec) { //start for E<Ec
    230     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     232    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    231233  }           //end for E<Ec
    232234  else {           //start for E>Ec
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4EvaporationProbability.cc

    r1007 r1055  
    3333// JMQ (06 September 2008) Also external choices have been added for
    3434// superimposed Coulomb barrier (if useSICB is set true, by default is false)
    35 
     35//
     36// JMQ (14 february 2009) bug fixed in emission width: hbarc instead of hbar_Planck in the denominator
     37//
    3638#include <iostream>
    3739using namespace std;
     
    138140
    139141
    140 // if Coulomb barrier cutoff is superimposed for all cross sections the limit is the Coulomb Barrier
    141         G4double LowerLimit= limit;
    142 
    143 //  MaximalKineticEnergy: asimptotic value (already accounted for in G4EvaporationChannel)     
    144 
    145   G4double UpperLimit = MaximalKineticEnergy;
    146 
    147 
    148   G4double Width = IntegrateEmissionProbability(fragment,LowerLimit,UpperLimit);
    149 
    150   return Width;
     142   // if Coulomb barrier cutoff is superimposed for all cross sections the limit is the Coulomb Barrier
     143   G4double LowerLimit= limit;
     144
     145   //  MaximalKineticEnergy: asimptotic value (already accounted for in G4EvaporationChannel)     
     146
     147   G4double UpperLimit = MaximalKineticEnergy;
     148
     149
     150   G4double Width = IntegrateEmissionProbability(fragment,LowerLimit,UpperLimit);
     151
     152   return Width;
    151153 } else{
    152154   std::ostringstream errOs;
     
    244246  if (E1<0.) return 0.;
    245247
    246 
    247 //Without 1/hbar_Panck remains as a width
    248 
    249   G4double  Prob=Gamma*ParticleMass/((pi*hbar_Planck)*(pi*hbar_Planck)*std::exp(2*std::sqrt(a0*E0)))*K*CrossSection(fragment,K)*std::exp(2*std::sqrt(a1*E1))*millibarn;
    250 
    251 return Prob;
    252 
    253 }
    254 
    255 
     248  //JMQ 14/02/09 BUG fixed: hbarc should be in the denominator instead of hbar_Planck
     249  //Without 1/hbar_Panck remains as a width
     250  //  G4double  Prob=Gamma*ParticleMass/((pi*hbar_Planck)*(pi*hbar_Planck)*
     251  //std::exp(2*std::sqrt(a0*E0)))*K*CrossSection(fragment,K)*std::exp(2*std::sqrt(a1*E1))*millibarn;
     252
     253  G4double Prob=Gamma*ParticleMass/((pi*hbarc)*(pi*hbarc)*std::exp(2*std::sqrt(a0*E0)))
     254    *K*CrossSection(fragment,K)*std::exp(2*std::sqrt(a1*E1))*millibarn;
     255
     256  return Prob;
     257}
     258
     259
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4He3EvaporationProbability.cc

    r1007 r1055  
    104104//OPT=3,4 Kalbach's parameterization
    105105//
    106  G4double G4He3EvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     106G4double G4He3EvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    107107{
    108108       theA=GetA();
     
    117117
    118118       if (OPTxs==0) {std::ostringstream errOs;
    119          errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (He3's)!!"  <<G4endl;
     119         errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (He3's)!!" 
     120               <<G4endl;
    120121         throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    121122         return 0.;}
     
    200201  G4double      ra=0.80;
    201202 
    202   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     203  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     204  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     205  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    203206  ecsq = ec * ec;
    204207  p = p0 + p1/ec + p2/ecsq;
     
    221224  elab = K * FragmentA / ResidualA;
    222225  sig = 0.;
    223  
     226
    224227  if (elab <= ec) { //start for E<Ec
    225     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     228    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    226229  }           //end for E<Ec
    227230  else {           //start for E>Ec
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4TritonEvaporationProbability.cc

    r1007 r1055  
    100100//OPT=3,4 Kalbach's parameterization
    101101//
    102  G4double G4TritonEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     102G4double G4TritonEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    103103{
    104104  theA=GetA();
     
    113113 
    114114  if (OPTxs==0) {std::ostringstream errOs;
    115     errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (tritons)!!"  <<G4endl;
     115    errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (tritons)!!" 
     116          <<G4endl;
    116117    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    117118    return 0.;}
     
    198199  G4double      ra=0.80;
    199200       
    200   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     201  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     202  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     203  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    201204  ecsq = ec * ec;
    202205  p = p0 + p1/ec + p2/ecsq;
     
    219222  elab = K * FragmentA / ResidualA;
    220223  sig = 0.;
    221  
     224
    222225  if (elab <= ec) { //start for E<Ec
    223     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     226    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    224227  }           //end for E<Ec
    225   else {           //start for E>Ec
     228  else {           //start for E>Ec 
    226229    sig = (landa*elab+mu+nu/elab) * signor;
    227230    geom = 0.;
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4CompetitiveFission.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CompetitiveFission.cc,v 1.9 2008/11/20 13:46:27 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CompetitiveFission.cc,v 1.11 2009/03/13 18:57:17 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Oct 1998)
     32//
     33// J. M. Quesada (March 2009). Bugs fixed:
     34//          - Full relativistic calculation (Lorentz boosts)
     35//          - Fission pairing energy is included in fragment excitation energies
     36// Now Energy and momentum are conserved in fission
    3237
    3338#include "G4CompetitiveFission.hh"
     
    127132    }
    128133
     134
    129135    // Atomic Mass of Nucleus (in MeV)
    130     G4double M = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A)/MeV;
     136    G4double M = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
     137
    131138    // Nucleus Momentum
    132139    G4LorentzVector theNucleusMomentum = theNucleus.GetMomentum();
     
    147154    G4double FragmentsExcitationEnergy = 0.0;
    148155    G4double FragmentsKineticEnergy = 0.0;
     156
     157    //JMQ 04/03/09 It will be used latter to fix the bug in energy conservation
     158    G4double FissionPairingEnergy=G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
    149159
    150160    G4int Trials = 0;
     
    162172        if (A2 < 1 || Z2 < 0)
    163173            throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakUp: Can't define second fragment! ");
    164         M2 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z2,A2)/MeV;
     174
     175        M2 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z2,A2);
    165176
    166177        // Check that fragment masses are less or equal than total energy
    167         //  if (M1 + M2 > theNucleusMomentum.mag()/MeV)
    168         if (M1 + M2 > theNucleusMomentum.e()/MeV)
     178        if (M1 + M2 > theNucleusMomentum.e())
    169179            throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakUp: Fragments Mass > Total Energy");
    170180
    171181        // Maximal Kinetic Energy (available energy for fragments)
    172         //  G4double Tmax = theNucleusMomentum.mag()/MeV - M1 - M2;
    173182        G4double Tmax = M + U - M1 - M2;
    174183
     
    180189   
    181190        // Excitation Energy
    182         FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy;
     191        //      FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy;
     192        // JMQ 04/03/09 BUG FIXED: in order to fulfill energy conservation the
     193        // fragments carry the fission pairing energy in form of
     194        //excitation energy
     195
     196        FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy+FissionPairingEnergy;
     197
     198    } while (FragmentsExcitationEnergy < 0.0 && Trials++ < 100);
    183199   
    184     } while (FragmentsExcitationEnergy < 0.0 && Trials++ < 100);
    185  
    186200 
    187201
     
    190204 
    191205
    192   // while (FragmentsExcitationEnergy < 0 && Trials < 100);
    193  
    194   // Fragment 1
     206    // while (FragmentsExcitationEnergy < 0 && Trials < 100);
     207 
     208    // Fragment 1
    195209    G4double U1 = FragmentsExcitationEnergy * (static_cast<G4double>(A1)/static_cast<G4double>(A));
    196210    // Fragment 2
     
    198212
    199213
    200     G4double Pmax = std::sqrt( 2 * ( ( (M1+U1)*(M2+U2) ) /
    201                                 ( (M1+U1)+(M2+U2) ) ) * FragmentsKineticEnergy);
    202 
    203     G4ParticleMomentum momentum1 = IsotropicVector( Pmax );
    204     G4ParticleMomentum momentum2( -momentum1 );
     214    //JMQ  04/03/09 Full relativistic calculation is performed
     215    //
     216    G4double Fragment1KineticEnergy=(FragmentsKineticEnergy*(FragmentsKineticEnergy+2*(M2+U2)))/(2*(M1+U1+M2+U2+FragmentsKineticEnergy));
     217    G4ParticleMomentum Momentum1(IsotropicVector(std::sqrt(Fragment1KineticEnergy*(Fragment1KineticEnergy+2*(M1+U1)))));
     218    G4ParticleMomentum Momentum2(-Momentum1);
     219    G4LorentzVector FourMomentum1(Momentum1,std::sqrt(Momentum1.mag2()+(M1+U1)*(M1+U1)));
     220    G4LorentzVector FourMomentum2(Momentum2,std::sqrt(Momentum2.mag2()+(M2+U2)*(M2+U2)));
     221
     222    //JMQ 04/03/09 now we do Lorentz boosts (instead of Galileo boosts)
     223    FourMomentum1.boost(theNucleusMomentum.boostVector());
     224    FourMomentum2.boost(theNucleusMomentum.boostVector());
     225   
     226    //////////JMQ 04/03: Old version calculation is commented
     227    // There was vioation of energy momentum conservation
     228
     229    //    G4double Pmax = std::sqrt( 2 * ( ( (M1+U1)*(M2+U2) ) /
     230    //                          ( (M1+U1)+(M2+U2) ) ) * FragmentsKineticEnergy);
     231
     232    //G4ParticleMomentum momentum1 = IsotropicVector( Pmax );
     233    //  G4ParticleMomentum momentum2( -momentum1 );
    205234
    206235    // Perform a Galileo boost for fragments
    207     momentum1 += (theNucleusMomentum.boostVector() * (M1+U1));
    208     momentum2 += (theNucleusMomentum.boostVector() * (M2+U2));
     236    //    momentum1 += (theNucleusMomentum.boostVector() * (M1+U1));
     237    //    momentum2 += (theNucleusMomentum.boostVector() * (M2+U2));
    209238
    210239
    211240    // Create 4-momentum for first fragment
    212241    // Warning!! Energy conservation is broken
    213     G4LorentzVector FourMomentum1( momentum1 , std::sqrt(momentum1.mag2() + (M1+U1)*(M1+U1)));
     242    //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
     243    //    G4LorentzVector FourMomentum1( momentum1 , std::sqrt(momentum1.mag2() + (M1+U1)*(M1+U1)));
    214244
    215245    // Create 4-momentum for second fragment
    216246    // Warning!! Energy conservation is broken
    217     G4LorentzVector FourMomentum2( momentum2 , std::sqrt(momentum2.mag2() + (M2+U2)*(M2+U2)));
     247    //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
     248    //    G4LorentzVector FourMomentum2( momentum2 , std::sqrt(momentum2.mag2() + (M2+U2)*(M2+U2)));
     249
     250    //////////
    218251
    219252    // Create Fragments
     
    227260    Fragment2->SetCreatorModel(G4String("G4CompetitiveFission"));
    228261#endif
    229   // Create Fragment Vector
     262    // Create Fragment Vector
    230263    G4FragmentVector * theResult = new G4FragmentVector;
    231264
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4FissionProbability.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4FissionProbability.cc,v 1.8 2007/02/12 09:39:58 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4FissionProbability.cc,v 1.9 2009/02/15 17:03:25 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Oct 1998)
    3232//
     33//
     34// J.M.Quesada (14 february 2009) bug fixed in fission width: missing parenthesis in the denominator
    3335
    3436
     
    9597    G4double Exp1 = 0.0;
    9698    if (SystemEntropy <= 160.0) Exp1 = std::exp(-SystemEntropy);
    97     // @@@@@@@@@@@@@@@@@ hpw changed max to min - cannot notify vicente now since cern mail gave up on me...
     99    // @@@@@@@@@@@@@@@@@ hpw changed max to min - cannot notify vicente now
    98100    G4double Exp2 = std::exp( std::min(700.0,Cf-SystemEntropy) );
    99101
     102    // JMQ 14/02/09 BUG fixed in fission probability (missing parenthesis at denominator)
    100103    //AH fix from Vincente:    G4double probability = (Exp1 + (1.0-Cf)*Exp2) / 4.0*pi*afission;
    101     G4double probability = (Exp1 + (Cf-1.0)*Exp2) / 4.0*pi*afission;
     104    //    G4double probability = (Exp1 + (Cf-1.0)*Exp2) / 4.0*pi*afission;
     105    G4double probability = (Exp1 + (Cf-1.0)*Exp2) / (4.0*pi*afission);
     106
     107
    102108   
    103109    return probability;
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/src/G4GEMChannel.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4GEMChannel.cc,v 1.6 2008/11/18 18:26:30 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4GEMChannel.cc,v 1.7 2009/03/12 11:25:28 ahoward Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    125125    //    G4double ExEnergy = fragment.GetExcitationEnergy() -
    126126    //      G4PairingCorrection::GetInstance()->GetPairingCorrection(anA,aZ);
    127     G4double ExEnergy = fragment.GetExcitationEnergy() -
    128       G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
     127//090120
     128    //G4double ExEnergy = fragment.GetExcitationEnergy() -
     129      //G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
     130    G4double ExEnergy = fragment.GetExcitationEnergy();
     131    if ( AResidual > 0 ) ExEnergy -= G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
     132//090120
    129133   
    130134    // We only take into account channels which are physically allowed
     
    260264    G4double a = theLevelDensityPtr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),
    261265                                                           static_cast<G4int>(fragment.GetZ()),U);
    262     G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
    263                                                                                static_cast<G4int>(fragment.GetZ()));
     266//090115
     267//G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
     268//                                                                     static_cast<G4int>(fragment.GetZ()));
     269    G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
     270//090115
    264271   
    265272    G4double Alpha = theEvaporationProbabilityPtr->CalcAlphaParam(fragment);
     
    307314//      std::cout << "\t\tEjectile (" << A << ',' << Z << ") V = " << CoulombBarrier
    308315//            << " Beta = " << Beta << " V+Beta = " << CoulombBarrier+Beta << '\n';
     316
     317//G4cout << AResidual << " " << ZResidual << " " << ConstantFactor << " " << Beta << " " << CoulombBarrier << " " << MaximalKineticEnergy << " " << CoulombBarrier + MaximalKineticEnergy + Beta << G4endl;
     318//090128
     319if ( CoulombBarrier + MaximalKineticEnergy + Beta <= 0 ) return 0;
    309320
    310321    do
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/src/G4GEMProbability.cc

    r819 r1055  
    108108    G4double a = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),
    109109                                                      static_cast<G4int>(fragment.GetZ()),U);
    110     G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
    111                                                                                static_cast<G4int>(fragment.GetZ()));
     110//090115
     111//G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
     112//                                                                     static_cast<G4int>(fragment.GetZ()));
     113    G4double ResidualZ = static_cast<G4double>(fragment.GetZ() - theZ);
     114    G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection( static_cast<G4int>( ResidualA ) , static_cast<G4int>( ResidualZ ) );
     115//090115
    112116   
    113117    G4double Alpha = CalcAlphaParam(fragment);
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CameronGilbertPairingCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronGilbertPairingCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronGilbertPairingCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5252  static G4CameronGilbertPairingCorrections* GetInstance();
    5353
    54   ~G4CameronGilbertPairingCorrections() {};
     54  ~G4CameronGilbertPairingCorrections();
    5555
    5656  G4double GetPairingCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CameronGilbertShellCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronGilbertShellCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronGilbertShellCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5151  static G4CameronGilbertShellCorrections* GetInstance();
    5252
    53   ~G4CameronGilbertShellCorrections() {};
     53  ~G4CameronGilbertShellCorrections();
    5454 
    5555  G4double GetShellCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CameronShellPlusPairingCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronShellPlusPairingCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronShellPlusPairingCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5151  static G4CameronShellPlusPairingCorrections* GetInstance();
    5252
    53   ~G4CameronShellPlusPairingCorrections() {};
     53  ~G4CameronShellPlusPairingCorrections();
    5454 
    5555  G4double GetShellPlusPairingZ(const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CameronTruranHilfPairingCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfPairingCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronTruranHilfPairingCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5050  static G4CameronTruranHilfPairingCorrections* GetInstance();
    5151
    52   ~G4CameronTruranHilfPairingCorrections() {};
     52  ~G4CameronTruranHilfPairingCorrections();
    5353
    5454  G4double GetParingCorrection(const G4int A, const  G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CameronTruranHilfShellCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfShellCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronTruranHilfShellCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5050  static G4CameronTruranHilfShellCorrections* GetInstance();
    5151 
    52   ~G4CameronTruranHilfShellCorrections() {};
     52  ~G4CameronTruranHilfShellCorrections();
    5353
    5454  G4double GetShellCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4ConstantLevelDensityParameter.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ConstantLevelDensityParameter.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ConstantLevelDensityParameter.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations (photon evaporation)
     
    4141public:
    4242  G4ConstantLevelDensityParameter() :  EvapLevelDensityParameter(0.125*(1./MeV)) {};
    43   virtual ~G4ConstantLevelDensityParameter() {};
     43  virtual ~G4ConstantLevelDensityParameter();
    4444
    4545private: 
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CookPairingCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CookPairingCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CookPairingCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5050  static G4CookPairingCorrections* GetInstance();
    5151
    52   ~G4CookPairingCorrections() {};
     52  ~G4CookPairingCorrections();
    5353
    5454  G4double GetParingCorrection(const G4int A, const G4int Z) const {
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CookShellCorrections.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CookShellCorrections.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CookShellCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5252  static G4CookShellCorrections* GetInstance();
    5353
    54   ~G4CookShellCorrections() {};
     54  ~G4CookShellCorrections();
    5555
    5656  G4double GetShellCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CoulombBarrier.hh,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CoulombBarrier.hh,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4242{
    4343public:
    44   G4CoulombBarrier() : G4VCoulombBarrier(1,0) {};
    45   G4CoulombBarrier(const G4int anA,const G4int aZ) :
    46     G4VCoulombBarrier(anA,aZ) {};
    47   ~G4CoulombBarrier() {};
     44  G4CoulombBarrier();
     45  G4CoulombBarrier(const G4int anA,const G4int aZ);
     46  virtual ~G4CoulombBarrier();
    4847
    4948private:
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4DeuteronCoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4DeuteronCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4DeuteronCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4DeuteronCoulombBarrier() : G4CoulombBarrier(2,1) {};
    43         ~G4DeuteronCoulombBarrier() {};
     42        G4DeuteronCoulombBarrier() : G4CoulombBarrier(2,1) {}
     43        ~G4DeuteronCoulombBarrier() {}
    4444
    4545private:
     
    5252private:
    5353
    54         virtual G4double BarrierPenetrationFactor(const G4double aZ) const;
    55 
     54        G4double BarrierPenetrationFactor(const G4double aZ) const;
    5655
    5756};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4EvaporationLevelDensityParameter.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4EvaporationLevelDensityParameter.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4EvaporationLevelDensityParameter.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4545public:
    4646
    47   G4EvaporationLevelDensityParameter()  {};
     47  G4EvaporationLevelDensityParameter();
    4848
    49   virtual ~G4EvaporationLevelDensityParameter() {};
     49  virtual ~G4EvaporationLevelDensityParameter();
    5050
    5151private: 
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4He3CoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4He3CoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4He3CoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4He3CoulombBarrier() : G4CoulombBarrier(3,2) {};
    43         ~G4He3CoulombBarrier() {};
     42        G4He3CoulombBarrier() : G4CoulombBarrier(3,2) {}
     43        ~G4He3CoulombBarrier() {}
    4444
    4545private:
     
    5252private:
    5353
    54         virtual G4double BarrierPenetrationFactor(const G4double aZ) const;
    55 
     54        G4double BarrierPenetrationFactor(const G4double aZ) const;
    5655
    5756};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4NeutronCoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4NeutronCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4NeutronCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4NeutronCoulombBarrier() : G4CoulombBarrier(1,0) {};
    43         ~G4NeutronCoulombBarrier() {};
     42        G4NeutronCoulombBarrier() : G4CoulombBarrier(1,0) {}
     43        ~G4NeutronCoulombBarrier() {}
    4444
    4545private:
     
    5252private:
    5353
    54         virtual G4double BarrierPenetrationFactor(const G4double ) const
     54        G4double BarrierPenetrationFactor(const G4double ) const
    5555        { return 1.0;}
    56 
    5756
    5857};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4PairingCorrection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4PairingCorrection.hh,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4PairingCorrection.hh,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5353  static G4PairingCorrection* GetInstance();
    5454 
    55   ~G4PairingCorrection() {};
     55  ~G4PairingCorrection();
    5656
    5757  G4double GetPairingCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4ProtonCoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ProtonCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ProtonCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4ProtonCoulombBarrier() : G4CoulombBarrier(1,1) {};
    43         ~G4ProtonCoulombBarrier() {};
     42        G4ProtonCoulombBarrier() : G4CoulombBarrier(1,1) {}
     43        ~G4ProtonCoulombBarrier() {}
    4444
    4545private:
     
    5252private:
    5353
    54         virtual G4double BarrierPenetrationFactor(const G4double aZ) const;
    55 
     54        G4double BarrierPenetrationFactor(const G4double aZ) const;
    5655
    5756};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4ShellCorrection.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ShellCorrection.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ShellCorrection.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5151public:
    5252  static G4ShellCorrection* GetInstance();
    53   ~G4ShellCorrection() {};
     53  ~G4ShellCorrection();
    5454
    5555  G4double GetShellCorrection(const G4int A, const G4int Z) const
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4TritonCoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4TritonCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4TritonCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42     G4TritonCoulombBarrier() : G4CoulombBarrier(3,1) {};
    43     ~G4TritonCoulombBarrier() {};
     42    G4TritonCoulombBarrier() : G4CoulombBarrier(3,1) {}
     43    ~G4TritonCoulombBarrier() {}
    4444
    4545private:
     
    5252private:
    5353
    54     virtual G4double BarrierPenetrationFactor(const G4double aZ) const;
    55 
     54    G4double BarrierPenetrationFactor(const G4double aZ) const;
    5655
    5756};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4VCoulombBarrier.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4141public:
    4242  G4VCoulombBarrier(const G4int anA, const G4int aZ);
    43   virtual ~G4VCoulombBarrier() {};
     43  virtual ~G4VCoulombBarrier();
    4444
    4545protected:
    46   G4VCoulombBarrier() : theA(1),theZ(0) {};
     46  G4VCoulombBarrier();
    4747
    4848private:
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4VEmissionProbability.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VEmissionProbability.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VEmissionProbability.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4747{
    4848public:
    49   G4VEmissionProbability() {};
    50   virtual ~G4VEmissionProbability() {};
     49  G4VEmissionProbability();
     50  virtual ~G4VEmissionProbability();
    5151
    5252private: 
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4VLevelDensityParameter.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VLevelDensityParameter.hh,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VLevelDensityParameter.hh,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4444{
    4545public:
    46   G4VLevelDensityParameter() {};
    47   virtual ~G4VLevelDensityParameter() {};
     46  G4VLevelDensityParameter();
     47  virtual ~G4VLevelDensityParameter();
    4848
    4949private: 
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronGilbertPairingCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronGilbertPairingCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronGilbertPairingCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7474{;}
    7575
     76G4CameronGilbertPairingCorrections::~G4CameronGilbertPairingCorrections()
     77{ delete theInstance; }
    7678
    7779G4CameronGilbertPairingCorrections* G4CameronGilbertPairingCorrections::GetInstance()
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronGilbertShellCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronGilbertShellCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronGilbertShellCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7474{;}
    7575
     76G4CameronGilbertShellCorrections::~G4CameronGilbertShellCorrections()
     77{ delete theInstance; }
     78
    7679G4CameronGilbertShellCorrections* G4CameronGilbertShellCorrections::GetInstance()
    7780{
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronShellPlusPairingCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronShellPlusPairingCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronShellPlusPairingCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    9292{;}
    9393
     94G4CameronShellPlusPairingCorrections::~G4CameronShellPlusPairingCorrections()
     95{ delete theInstance; }
     96
    9497G4CameronShellPlusPairingCorrections* G4CameronShellPlusPairingCorrections::GetInstance() {
    9598  if (!theInstance) theInstance = new G4CameronShellPlusPairingCorrections();
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronTruranHilfPairingCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfPairingCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronTruranHilfPairingCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7979{;}
    8080
     81G4CameronTruranHilfPairingCorrections::~G4CameronTruranHilfPairingCorrections()
     82{ delete theInstance; }
     83
    8184G4CameronTruranHilfPairingCorrections* G4CameronTruranHilfPairingCorrections::GetInstance() {
    8285  if (!theInstance) theInstance = new G4CameronTruranHilfPairingCorrections();
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronTruranHilfShellCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfShellCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CameronTruranHilfShellCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    8181{;}
    8282
     83G4CameronTruranHilfShellCorrections::~G4CameronTruranHilfShellCorrections()
     84{ delete theInstance; }
     85
    8386G4CameronTruranHilfShellCorrections* G4CameronTruranHilfShellCorrections::GetInstance() {
    8487  if (!theInstance) theInstance = new G4CameronTruranHilfShellCorrections();
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4ConstantLevelDensityParameter.cc

    r819 r1055  
    4242}
    4343
     44G4ConstantLevelDensityParameter::~G4ConstantLevelDensityParameter()
     45{
     46}
    4447
    4548const G4ConstantLevelDensityParameter & G4ConstantLevelDensityParameter::
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CookPairingCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CookPairingCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CookPairingCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7373{;}
    7474
     75G4CookPairingCorrections::~G4CookPairingCorrections()
     76{ delete theInstance; }
     77
    7578G4CookPairingCorrections* G4CookPairingCorrections::GetInstance() {
    7679  if (!theInstance) theInstance = new  G4CookPairingCorrections();
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CookShellCorrections.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CookShellCorrections.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CookShellCorrections.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7373{;}
    7474
     75G4CookShellCorrections::~G4CookShellCorrections()
     76{ delete theInstance; }
    7577
    7678G4CookShellCorrections* G4CookShellCorrections::GetInstance() {
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CoulombBarrier.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4CoulombBarrier.cc,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4CoulombBarrier.cc,v 1.9 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3535#include "G4HadronicException.hh"
    3636#include <sstream>
     37
     38G4CoulombBarrier::G4CoulombBarrier()
     39  : G4VCoulombBarrier(1,0) {}
     40
     41G4CoulombBarrier::G4CoulombBarrier(const G4int anA,const G4int aZ)
     42  : G4VCoulombBarrier(anA,aZ) {}
     43
     44G4CoulombBarrier::~G4CoulombBarrier() {}
    3745
    3846G4CoulombBarrier::G4CoulombBarrier(const G4CoulombBarrier & ) : G4VCoulombBarrier()
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4EvaporationLevelDensityParameter.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4EvaporationLevelDensityParameter.cc,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4EvaporationLevelDensityParameter.cc,v 1.9 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4949const G4double G4EvaporationLevelDensityParameter::Bs = 1.0;
    5050
     51G4EvaporationLevelDensityParameter::G4EvaporationLevelDensityParameter() {}
     52G4EvaporationLevelDensityParameter::~G4EvaporationLevelDensityParameter() {}
    5153
    5254G4EvaporationLevelDensityParameter::
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4PairingCorrection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4PairingCorrection.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4PairingCorrection.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4444}
    4545
     46G4PairingCorrection::~G4PairingCorrection()
     47{ delete theInstance; }
     48
    4649G4PairingCorrection* G4PairingCorrection::GetInstance()
    4750{
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4ShellCorrection.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ShellCorrection.cc,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ShellCorrection.cc,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4444}
    4545
     46G4ShellCorrection::~G4ShellCorrection()
     47{
     48  delete theInstance;
     49}
    4650
    4751G4ShellCorrection* G4ShellCorrection::GetInstance()
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4VCoulombBarrier.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VCoulombBarrier.cc,v 1.6 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VCoulombBarrier.cc,v 1.7 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3535#include "G4HadronicException.hh"
    3636#include <sstream>
     37
     38G4VCoulombBarrier::G4VCoulombBarrier()
     39  : theA(1),theZ(0)
     40{
     41}
     42
    3743
    3844G4VCoulombBarrier::G4VCoulombBarrier(const G4int anA, const G4int aZ)
     
    4955        throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    5056    }
     57}
     58
     59
     60G4VCoulombBarrier::~G4VCoulombBarrier()
     61{
    5162}
    5263
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4VEmissionProbability.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VEmissionProbability.cc,v 1.6 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VEmissionProbability.cc,v 1.7 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3636#include "G4HadronicException.hh"
    3737
     38
     39G4VEmissionProbability::G4VEmissionProbability() {}
     40G4VEmissionProbability::~G4VEmissionProbability() {}
     41
     42
    3843G4VEmissionProbability::G4VEmissionProbability(const G4VEmissionProbability &)
    3944{
    4045    throw G4HadronicException(__FILE__, __LINE__, "G4VEmissionProbability::copy_constructor meant to not be accessable");
    4146}
    42 
    43 
    4447
    4548
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4VLevelDensityParameter.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VLevelDensityParameter.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VLevelDensityParameter.cc,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3636
    3737
     38G4VLevelDensityParameter::G4VLevelDensityParameter() {}
     39G4VLevelDensityParameter::~G4VLevelDensityParameter() {}
     40
     41
    3842G4VLevelDensityParameter::
    3943G4VLevelDensityParameter(const G4VLevelDensityParameter &)
     
    4145    throw G4HadronicException(__FILE__, __LINE__, "G4VLevelDensityParameter::copy_constructor meant to not be accessable");
    4246}
    43 
    44 
    4547
    4648
  • trunk/source/processes/hadronic/models/management/History

    r1007 r1055  
    1515     ---------------------------------------------------------------
    1616
     1725 February 2009 - V.Ivanchenko (hadr-modman-V09-02-03)
     18------------------------------------------------------
     19-  G4HadronicInteractionRegistry - added protection to the Clean method
     20
     2114 February 2009 - V.Ivanchenko (hadr-modman-V09-02-02)
     22------------------------------------------------------
     23-  G4HadronicInteractionRegistry - added Clean method
     24
     2506 February 2009 - V.Ivanchenko (hadr-modman-V09-02-01)
     26------------------------------------------------------
     27
     2823 January 2009 - V.Ivanchenko (hadr-modman-V09-02-00)
     29------------------------------------------------------
     30-  G4HadronicInteractionRegistry - make it as real singleton
     31-  G4HadronicInteraction, G4InelasticInteraction - move constructor,
     32       destructor and some header files from header to source
     33
    173419 June 2008 - G.Cosmo  (hadr-modman-V09-01-03)
    1835-----------------------------------------------
    1936-  included change introduced in hadr-modman-V09-01-01 and
    20    discarded by imstake in the last tag ...
     37   discarded by mistake in the last tag ...
    2138
    223919 June 2008 - V.Ivanchenko (hadr-modman-V09-01-02)
  • trunk/source/processes/hadronic/models/management/include/G4HadronicInteraction.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4HadronicInteraction.hh,v 1.8 2007/01/11 05:30:01 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4HadronicInteraction.hh,v 1.9 2009/01/24 11:56:27 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    30  // Hadronic Interaction  abstract base class
    31  // This class is the base class for the model classes.
    32  // It sorts out the energy-range for the models and provides
    33  // class utilities.
    34  // original by H.P. Wellisch
    35  // Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
    36  // Last modified: 3-Apr-1997
    37  // Added units to energy initialization: J.L. Chuma  04-Apr-97
    38  // Modified by J.L.Chuma, 05-May-97  to Initialize theBlockedCounter
    39  // Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
    40  // Adding a registry for memory management of hadronic models, HPW 22-Mar-99
     30// Hadronic Interaction  abstract base class
     31// This class is the base class for the model classes.
     32// It sorts out the energy-range for the models and provides
     33// class utilities.
     34// original by H.P. Wellisch
     35// Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
     36// Last modified: 3-Apr-1997
     37// Added units to energy initialization: J.L. Chuma  04-Apr-97
     38// Modified by J.L.Chuma, 05-May-97  to Initialize theBlockedCounter
     39// Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
     40// Adding a registry for memory management of hadronic models, HPW 22-Mar-99
     41// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
     42//                          and reorder methods in the header
    4143
    4244// Class Description
    4345// This is the base class for all hadronic interaction models in geant4.
    44 // If you want to implement a new way of producing a final state, please inherit
    45 // from here.
     46// If you want to implement a new way of producing a final state, please,
     47//  inherit from here.
    4648// Class Description - End
    4749 
     
    5052 
    5153#include "G4HadFinalState.hh"
    52 #include "G4DynamicParticle.hh"
    5354#include "G4ReactionDynamics.hh"
    5455#include "G4Material.hh"
     
    5657#include "G4Track.hh"
    5758#include "G4HadProjectile.hh"
    58 #include "G4HadronicInteractionRegistry.hh"
    59 #include "G4HadronicException.hh"
    6059
    61  class G4HadronicInteraction
    62  {
    63  public:
     60class G4HadronicInteraction
     61{
     62public: // With description
     63
    6464   
    65     G4HadronicInteraction(const G4String& modelName = "HadronicModel") :
    66       verboseLevel(0), theMinEnergy(0.0*GeV), theMaxEnergy(25.0*GeV),
    67       isBlocked(false), theModelName(modelName)
    68     {
    69       G4HadronicInteractionRegistry::RegisterMe(this);
    70     }
     65  G4HadronicInteraction(const G4String& modelName = "HadronicModel");
    7166   
    72     virtual ~G4HadronicInteraction()
    73     {
    74       G4HadronicInteractionRegistry::RemoveMe(this);
    75     }
     67  virtual ~G4HadronicInteraction();
    7668   
    77  private:
     69  virtual G4HadFinalState *ApplyYourself(const G4HadProjectile &aTrack,
     70                                         G4Nucleus & targetNucleus ) = 0;
     71  // This is the interface to implement for final state production code.
     72   
     73  virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
     74                              G4Nucleus & /*targetNucleus*/)
     75  {  return true;}
     76 
     77  inline G4double GetMinEnergy() const
     78  { return theMinEnergy; }
    7879   
    79     inline G4HadronicInteraction(
    80      const G4HadronicInteraction &right )
    81     { *this = right; }
     80  virtual G4double GetMinEnergy( const G4Material *aMaterial,
     81                                 const G4Element *anElement ) const;
     82   
     83  inline void SetMinEnergy( const G4double anEnergy )
     84  { theMinEnergy = anEnergy; }
    8285   
    83     inline const G4HadronicInteraction & operator=(
    84      const G4HadronicInteraction &right )
    85     {
    86      G4String text = "unintended use of G4HadronicInteraction::operator=";
    87      throw G4HadronicException(__FILE__, __LINE__, text);
    88      return right;
    89     }
     86  virtual void SetMinEnergy( G4double anEnergy, G4Element *anElement );
    9087   
    91  public:
     88  virtual void SetMinEnergy( G4double anEnergy, G4Material *aMaterial );
    9289   
    93     inline G4bool operator==(
    94      const G4HadronicInteraction &right ) const
    95     { return ( this == (G4HadronicInteraction *) &right ); }
     90  inline G4double GetMaxEnergy() const
     91  { return theMaxEnergy; }
    9692   
    97     inline G4bool operator!=(
    98      const G4HadronicInteraction &right ) const
    99     { return ( this != (G4HadronicInteraction *) &right ); }
     93  virtual G4double GetMaxEnergy( const G4Material *aMaterial,
     94                                 const G4Element *anElement ) const;
    10095   
    101     inline G4double GetMinEnergy() const
    102     { return theMinEnergy; }
     96  inline void SetMaxEnergy( const G4double anEnergy )
     97  { theMaxEnergy = anEnergy; }
    10398   
    104     virtual G4double GetMinEnergy( const G4Material *aMaterial,
    105                                   const G4Element *anElement ) const;
     99  virtual void SetMaxEnergy( G4double anEnergy, G4Element *anElement );
    106100   
    107     inline void SetMinEnergy( const G4double anEnergy )
    108     { theMinEnergy = anEnergy; }
    109    
    110     virtual void SetMinEnergy( G4double anEnergy, G4Element *anElement );
    111    
    112     virtual void SetMinEnergy( G4double anEnergy, G4Material *aMaterial );
    113    
    114     inline G4double GetMaxEnergy() const
    115     { return theMaxEnergy; }
    116    
    117     virtual G4double GetMaxEnergy( const G4Material *aMaterial,
    118                                   const G4Element *anElement ) const;
    119    
    120     inline void SetMaxEnergy( const G4double anEnergy )
    121     { theMaxEnergy = anEnergy; }
    122    
    123     virtual void SetMaxEnergy( G4double anEnergy, G4Element *anElement );
    124    
    125     virtual void SetMaxEnergy( G4double anEnergy, G4Material *aMaterial );
     101  virtual void SetMaxEnergy( G4double anEnergy, G4Material *aMaterial );
    126102 
    127     inline const G4HadronicInteraction *GetMyPointer() const
    128     { return this; }
     103  inline const G4HadronicInteraction *GetMyPointer() const
     104  { return this; }
    129105
    130     inline G4int GetVerboseLevel() const
    131     { return verboseLevel; }
     106  inline G4int GetVerboseLevel() const
     107  { return verboseLevel; }
    132108
    133     inline void SetVerboseLevel( G4int value )
    134     { verboseLevel = value; }
     109  inline void SetVerboseLevel( G4int value )
     110  { verboseLevel = value; }
    135111
    136     inline const G4String& GetModelName() const
    137     { return theModelName; }
    138 
    139 public: // With description
    140     // This is the interface to implement for final state production code.
    141    
    142     virtual G4HadFinalState *ApplyYourself(
    143             const G4HadProjectile &aTrack, G4Nucleus & targetNucleus ) = 0;
     112  inline const G4String& GetModelName() const
     113  { return theModelName; }
    144114   
    145115public: // Without description
    146116
    147     virtual void DeActivateFor( G4Material *aMaterial );
     117  virtual void DeActivateFor( G4Material *aMaterial );
    148118   
    149     virtual void ActivateFor( G4Material *aMaterial )
    150     {
    151       Block();
    152       SetMaxEnergy(GetMaxEnergy(), aMaterial);
    153       SetMinEnergy(GetMinEnergy(), aMaterial);
    154     }
     119  virtual void ActivateFor( G4Material *aMaterial )
     120  {
     121    Block();
     122    SetMaxEnergy(GetMaxEnergy(), aMaterial);
     123    SetMinEnergy(GetMinEnergy(), aMaterial);
     124  }
    155125
    156     virtual void DeActivateFor( G4Element *anElement );
    157     virtual void ActivateFor( G4Element *anElement )
    158     {
    159       Block();
    160       SetMaxEnergy(GetMaxEnergy(), anElement);
    161       SetMinEnergy(GetMinEnergy(), anElement);
    162     }
     126  virtual void DeActivateFor( G4Element *anElement );
     127  virtual void ActivateFor( G4Element *anElement )
     128  {
     129    Block();
     130    SetMaxEnergy(GetMaxEnergy(), anElement);
     131    SetMinEnergy(GetMinEnergy(), anElement);
     132  }
    163133
    164     virtual G4bool IsBlocked( const G4Material *aMaterial ) const;
     134  virtual G4bool IsBlocked( const G4Material *aMaterial ) const;
    165135
    166     virtual G4bool IsBlocked( const G4Element *anElement) const;
     136  virtual G4bool IsBlocked( const G4Element *anElement) const;
     137
     138  inline G4bool operator==(const G4HadronicInteraction &right ) const
     139  { return ( this == (G4HadronicInteraction *) &right ); }
    167140   
    168     virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
    169                                G4Nucleus & /*targetNucleus*/){  return true;}
    170  protected:
     141  inline G4bool operator!=(const G4HadronicInteraction &right ) const
     142  { return ( this != (G4HadronicInteraction *) &right ); }
    171143   
    172     G4HadFinalState theParticleChange;
    173     // the G4HadFinalState object which is modified and returned
    174     // by address by the ApplyYourself method,
    175     // (instead of aParticleChange as found in G4VProcess)
     144private:
    176145   
    177     G4int verboseLevel;
    178     // control flag for output messages
    179     // 0: silent
    180     // 1: warning messages
    181     // 2: more
    182     // (instead of verboseLevel as found in G4VProcess)
     146  G4HadronicInteraction(const G4HadronicInteraction &right );
    183147   
    184     G4ReactionDynamics theReactionDynamics;
     148  const G4HadronicInteraction& operator=(const G4HadronicInteraction &right);
     149
     150protected:
     151
     152  inline G4bool IsBlocked() const { return isBlocked;}
     153  inline void Block() { isBlocked = true; }
    185154   
    186     // these two have global validity
    187     // units are assumed to be MeV
     155  G4HadFinalState theParticleChange;
     156  // the G4HadFinalState object which is modified and returned
     157  // by address by the ApplyYourself method,
     158  // (instead of aParticleChange as found in G4VProcess)
    188159   
    189     G4double theMinEnergy;
    190     G4double theMaxEnergy;
     160  G4int verboseLevel;
     161  // control flag for output messages
     162  // 0: silent
     163  // 1: warning messages
     164  // 2: more
     165  // (instead of verboseLevel as found in G4VProcess)
    191166   
    192     G4bool IsBlocked() const { return isBlocked;}
    193     void Block() { isBlocked = true; }
    194     G4bool isBlocked;
     167  G4ReactionDynamics theReactionDynamics;
     168   
     169  // these two have global validity
     170  // units are assumed to be MeV
     171   
     172  G4double theMinEnergy;
     173  G4double theMaxEnergy;
     174   
     175  G4bool isBlocked;
    195176
    196     G4String theModelName;
     177  G4String theModelName;
    197178   
    198  private:
     179private:
    199180       
    200     std::vector<std::pair<G4double, G4Material *> > theMinEnergyList;
    201     std::vector<std::pair<G4double, G4Material *> > theMaxEnergyList;
    202     std::vector<std::pair<G4double, G4Element *> > theMinEnergyListElements;
    203     std::vector<std::pair<G4double, G4Element *> > theMaxEnergyListElements;
    204     std::vector<G4Material *> theBlockedList;
    205     std::vector<G4Element *> theBlockedListElements;
    206  };
     181   std::vector<std::pair<G4double, G4Material *> > theMinEnergyList;
     182   std::vector<std::pair<G4double, G4Material *> > theMaxEnergyList;
     183   std::vector<std::pair<G4double, G4Element *> > theMinEnergyListElements;
     184   std::vector<std::pair<G4double, G4Element *> > theMaxEnergyListElements;
     185   std::vector<G4Material *> theBlockedList;
     186   std::vector<G4Element *> theBlockedListElements;
     187};
    207188 
    208189#endif
  • trunk/source/processes/hadronic/models/management/include/G4HadronicInteractionRegistry.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4HadronicInteractionRegistry.hh,v 1.4 2009/02/14 19:24:52 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
     30
     31// Class Description
     32// This is the a singleton class to store all hadronic interactions
     33// Class Description - End
     34
    2635#ifndef G4HadronicInteractionRegistry_h
    2736#define G4HadronicInteractionRegistry_h 1
     
    2938#include <vector>
    3039#include "globals.hh"
     40
    3141class G4HadronicInteraction;
    3242
    3343class G4HadronicInteractionRegistry
    3444{
    35   public:
     45public:
     46
     47  static G4HadronicInteractionRegistry* Instance();
     48  // access
    3649 
    3750  ~G4HadronicInteractionRegistry();
     51
     52  void Clean();
     53  //delete models
    3854 
    39   static void RegisterMe(G4HadronicInteraction * aModel);
    40   static void RemoveMe(G4HadronicInteraction * aModel);
     55  void RegisterMe(G4HadronicInteraction * aModel);
     56  //register new model
     57
     58  void RemoveMe(G4HadronicInteraction * aModel);
     59  //deregister model
    4160   
    42   protected:
     61private:
    4362
    44   G4HadronicInteractionRegistry(G4String );
    45   static G4HadronicInteractionRegistry & theRegistry();
     63  G4HadronicInteractionRegistry();
    4664
    47   private:
    48 
    49   //  !!!  can not use "copy constructor" nor "default constructor" !!!!
    50        G4HadronicInteractionRegistry(const G4HadronicInteractionRegistry &right)
    51        { nModels = right.nModels; }
    52        G4HadronicInteractionRegistry() {nModels = 0;}
    53 
    54   //  !!!  Assignment operation is forbidden !!!
    55       const G4HadronicInteractionRegistry & operator=(const G4HadronicInteractionRegistry &)
    56       { return *this;}
    57 
    58   void AddModel(G4HadronicInteraction * aModel);
     65  static G4HadronicInteractionRegistry* theInstance;
    5966 
    6067  G4int nModels;
  • trunk/source/processes/hadronic/models/management/include/G4InelasticInteraction.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4InelasticInteraction.hh,v 1.5 2007/01/11 05:30:12 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4InelasticInteraction.hh,v 1.6 2009/01/24 11:56:27 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    30  // Hadronic Process: Inelastic Interaction
    31  // This class is an abstract base class, since the pure virtual
    32  // function ApplyYourself has not been defined yet.
    33  // original by H.P. Wellisch
    34  // Modified by J.L. Chuma, TRIUMF, 22-Nov-1996
    35  // Modified by J.L. Chuma  27-Mar-1997
    36  // Modified by J.L. Chuma  30-Apr-1997
    37  // Modified by J.L. Chuma  05-Aug-1997  to pass the original incident particle to
    38  //                                      CalculateMomenta
    39  // Modified by J.L. Chuma  05-Jun-1998  to include quasiElastic flag to allow for
    40  //                                      TwoBody to be called directly, bypassing
    41  //                                      TwoCluster, and allowing TwoCluster to be
    42  //                                      called with no secondaries
     30// Hadronic Process: Inelastic Interaction
     31// This class is an abstract base class, since the pure virtual
     32// function ApplyYourself has not been defined yet.
     33// original by H.P. Wellisch
     34// Modified by J.L. Chuma, TRIUMF, 22-Nov-1996
     35// Modified by J.L. Chuma  27-Mar-1997
     36// Modified by J.L. Chuma  30-Apr-1997
     37// Modified by J.L. Chuma  05-Aug-1997  to pass the original incident particle to
     38//                                      CalculateMomenta
     39// Modified by J.L. Chuma  05-Jun-1998  to include quasiElastic flag to allow for
     40//                                      TwoBody to be called directly, bypassing
     41//                                      TwoCluster, and allowing TwoCluster to be
     42//                                      called with no secondaries
     43// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
    4344 
    4445#ifndef G4InelasticInteraction_h
     
    5354#include "G4ReactionDynamics.hh"
    5455
    55  class G4InelasticInteraction : public G4HadronicInteraction
    56  {
    57  public:
     56class G4InelasticInteraction : public G4HadronicInteraction
     57{
     58public:
    5859   
    59     G4InelasticInteraction(const G4String& modelName = "LEInelastic")
    60      : G4HadronicInteraction(modelName)
    61     { cache = 0.0;}
     60    G4InelasticInteraction(const G4String& modelName = "LEInelastic");
    6261   
    63     virtual ~G4InelasticInteraction()
    64     { }
     62    virtual ~G4InelasticInteraction();
    6563   
    66  protected:
     64protected:
    6765   
    6866    G4double Pmltpc( G4int np, G4int nm, G4int nz, G4int n,
     
    10098                      G4ReactionProduct &targetParticle,
    10199                      G4bool &incidentHasChanged );
    102    private:
     100private:
    103101   
    104102      G4double cache;
    105103      G4ThreeVector what;
    106104
    107  };
     105};
    108106 
    109107#endif
  • trunk/source/processes/hadronic/models/management/src/G4HadronicInteraction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4HadronicInteraction.cc,v 1.4 2009/01/24 11:56:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2628//
    27  // Hadronic Interaction  base class
    28  // original by H.P. Wellisch
    29  // modified by J.L. Chuma, TRIUMF, 21-Mar-1997
    30  // Last modified: 04-Apr-1997
    31  // reimplemented 1.11.2003 JPW.
    32  
     29// Hadronic Interaction  base class
     30// original by H.P. Wellisch
     31// modified by J.L. Chuma, TRIUMF, 21-Mar-1997
     32// Last modified: 04-Apr-1997
     33// reimplemented 1.11.2003 JPW.
     34// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
     35
    3336#include "G4HadronicInteraction.hh"
    34  
    35  G4double
    36   G4HadronicInteraction::GetMinEnergy(
     37#include "G4HadronicInteractionRegistry.hh"
     38#include "G4HadronicException.hh"
     39
     40G4HadronicInteraction::G4HadronicInteraction(const G4String& modelName) :
     41  verboseLevel(0), theMinEnergy(0.0*GeV), theMaxEnergy(25.0*GeV),
     42  isBlocked(false), theModelName(modelName)
     43{
     44  G4HadronicInteractionRegistry::Instance()->RegisterMe(this);
     45}
     46   
     47G4HadronicInteraction::~G4HadronicInteraction()
     48{
     49  G4HadronicInteractionRegistry::Instance()->RemoveMe(this);
     50}
     51 
     52G4double G4HadronicInteraction::GetMinEnergy(
    3753   const G4Material *aMaterial, const G4Element *anElement ) const
    38   {
    39     size_t i;
    40     if( IsBlocked(aMaterial) )return 0.*GeV;
    41     if( IsBlocked(anElement) )return 0.*GeV;
    42     for( i=0; i<theMinEnergyListElements.size(); ++i )
    43     {
    44       if( anElement == theMinEnergyListElements[i].second )return theMinEnergyListElements[i].first;
     54{
     55  size_t i;
     56  if( IsBlocked(aMaterial) )return 0.*GeV;
     57  if( IsBlocked(anElement) )return 0.*GeV;
     58  for( i=0; i<theMinEnergyListElements.size(); ++i )
     59    {
     60      if( anElement == theMinEnergyListElements[i].second )
     61        return theMinEnergyListElements[i].first;
    4562    }
    4663    for( i=0; i<theMinEnergyList.size(); ++i )
    4764    {
    48       if( aMaterial == theMinEnergyList[i].second )return theMinEnergyList[i].first;
     65      if( aMaterial == theMinEnergyList[i].second )
     66        return theMinEnergyList[i].first;
    4967    }
    5068    if(IsBlocked()) return 0.*GeV;
     
    5472           << " not found in min energy List" << G4endl;
    5573    return theMinEnergy;
    56   }
    57  
    58  void
    59   G4HadronicInteraction::SetMinEnergy(
    60    G4double anEnergy,
    61    G4Element *anElement )
    62   {
    63     if( IsBlocked(anElement) )
    64       G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << G4endl
     74}
     75 
     76void G4HadronicInteraction::SetMinEnergy(G4double anEnergy,
     77                                         G4Element *anElement )
     78{
     79  if( IsBlocked(anElement) )
     80    G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << G4endl
    6581           << "    The model is not active for the Element  "
    6682           << anElement->GetName() << "." << G4endl;
    6783   
    68     for( size_t i=0; i<theMinEnergyListElements.size(); ++i )
     84  for( size_t i=0; i<theMinEnergyListElements.size(); ++i )
    6985    {
    7086      if( anElement == theMinEnergyListElements[i].second )
     
    7490      }
    7591    }
    76     theMinEnergyListElements.push_back(std::pair<G4double, G4Element *>(anEnergy, anElement));
    77   }
    78  
    79  void
    80   G4HadronicInteraction::SetMinEnergy(
    81    G4double anEnergy,
    82    G4Material *aMaterial )
    83   {
    84     if( IsBlocked(aMaterial) )
    85       G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << G4endl
     92  theMinEnergyListElements.push_back(std::pair<G4double, G4Element *>(anEnergy, anElement));
     93}
     94 
     95void G4HadronicInteraction::SetMinEnergy(G4double anEnergy,
     96                                         G4Material *aMaterial )
     97{
     98  if( IsBlocked(aMaterial) )
     99    G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << G4endl
    86100           << "    The model is not active for the Material "
    87101           << aMaterial->GetName() << "." << G4endl;
    88102   
    89     for( size_t i=0; i<theMinEnergyList.size(); ++i )
     103  for( size_t i=0; i<theMinEnergyList.size(); ++i )
    90104    {
    91105      if( aMaterial == theMinEnergyList[i].second )
    92       {
    93         theMinEnergyList[i].first = anEnergy;
    94         return;
    95       }
    96     }
    97     theMinEnergyList.push_back(std::pair<G4double, G4Material *>(anEnergy, aMaterial));
    98   }
    99  
    100  G4double
    101   G4HadronicInteraction::GetMaxEnergy(
    102    const G4Material *aMaterial, const G4Element *anElement ) const
    103   {
    104     size_t i;
    105     if( IsBlocked(aMaterial) )return 0.0*GeV;
    106     if( IsBlocked(anElement) )return 0.0*GeV;
    107     for( i=0; i<theMaxEnergyListElements.size(); ++i )
    108     {
    109       if( anElement == theMaxEnergyListElements[i].second )return theMaxEnergyListElements[i].first;
     106        {
     107          theMinEnergyList[i].first = anEnergy;
     108          return;
     109        }
     110    }
     111  theMinEnergyList.push_back(std::pair<G4double, G4Material *>(anEnergy, aMaterial));
     112}
     113 
     114G4double G4HadronicInteraction::GetMaxEnergy(const G4Material *aMaterial,
     115                                             const G4Element *anElement ) const
     116{
     117  size_t i;
     118  if( IsBlocked(aMaterial) )return 0.0*GeV;
     119  if( IsBlocked(anElement) )return 0.0*GeV;
     120  for( i=0; i<theMaxEnergyListElements.size(); ++i )
     121    {
     122      if( anElement == theMaxEnergyListElements[i].second )
     123        return theMaxEnergyListElements[i].first;
    110124    }
    111125    for( i=0; i<theMaxEnergyList.size(); ++i )
    112126    {
    113       if( aMaterial == theMaxEnergyList[i].second )return theMaxEnergyList[i].first;
     127      if( aMaterial == theMaxEnergyList[i].second )
     128        return theMaxEnergyList[i].first;
    114129    }
    115130    if(IsBlocked()) return 0.*GeV;
    116131    if( verboseLevel > 0 )
    117132      G4cout << "*** Warning from HadronicInteraction::GetMaxEnergy" << G4endl
    118            << "    material " << aMaterial->GetName()
    119            << " not found in min energy List" << G4endl;
     133             << "    material " << aMaterial->GetName()
     134             << " not found in min energy List" << G4endl;
    120135   
    121136    return theMaxEnergy;
    122   }
    123  
    124  void
    125   G4HadronicInteraction::SetMaxEnergy(
    126    G4double anEnergy,
    127    G4Element *anElement )
    128   {
    129     if( IsBlocked(anElement) )
    130       G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << G4endl
     137}
     138 
     139void G4HadronicInteraction::SetMaxEnergy(G4double anEnergy,
     140                                         G4Element *anElement )
     141{
     142  if( IsBlocked(anElement) )
     143    G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << G4endl
    131144           << "Warning: The model is not active for the Element  "
    132145           << anElement->GetName() << "." << G4endl;
    133146   
    134     for( size_t i=0; i<theMaxEnergyListElements.size(); ++i )
     147  for( size_t i=0; i<theMaxEnergyListElements.size(); ++i )
    135148    {
    136149      if( anElement == theMaxEnergyListElements[i].second )
     
    140153      }
    141154    }
    142     theMaxEnergyListElements.push_back(std::pair<G4double, G4Element *>(anEnergy, anElement));
    143   }
    144 
    145  void
    146   G4HadronicInteraction::SetMaxEnergy(
    147    G4double anEnergy,
    148    G4Material *aMaterial )
    149   {
    150     if( IsBlocked(aMaterial) )
    151       G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << G4endl
     155  theMaxEnergyListElements.push_back(std::pair<G4double, G4Element *>(anEnergy, anElement));
     156}
     157
     158void G4HadronicInteraction::SetMaxEnergy(G4double anEnergy,
     159                                         G4Material *aMaterial )
     160{
     161  if( IsBlocked(aMaterial) )
     162    G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << G4endl
    152163           << "Warning: The model is not active for the Material "
    153164           << aMaterial->GetName() << "." << G4endl;
    154165   
    155     for( size_t i=0; i<theMaxEnergyList.size(); ++i )
     166  for( size_t i=0; i<theMaxEnergyList.size(); ++i )
    156167    {
    157168      if( aMaterial == theMaxEnergyList[i].second )
    158       {
     169        {
    159170        theMaxEnergyList[i].first = anEnergy;
    160171        return;
    161       }
    162     }
    163     theMaxEnergyList.push_back(std::pair<G4double, G4Material *>(anEnergy, aMaterial));
    164   }
    165 
    166  void
    167   G4HadronicInteraction::DeActivateFor( G4Material *aMaterial )
    168   {
    169     theBlockedList.push_back(aMaterial);
    170   }
    171 
    172  void
    173   G4HadronicInteraction::DeActivateFor( G4Element *anElement )
    174   {
    175     theBlockedListElements.push_back(anElement);
    176   }
    177 
    178  G4bool
    179   G4HadronicInteraction::IsBlocked( const G4Material *aMaterial ) const
    180   {
    181     for( size_t i=0; i<theBlockedList.size(); ++i )
     172        }
     173    }
     174  theMaxEnergyList.push_back(std::pair<G4double, G4Material *>(anEnergy, aMaterial));
     175}
     176
     177void G4HadronicInteraction::DeActivateFor( G4Material *aMaterial )
     178{
     179  theBlockedList.push_back(aMaterial);
     180}
     181
     182void G4HadronicInteraction::DeActivateFor( G4Element *anElement )
     183{
     184  theBlockedListElements.push_back(anElement);
     185}
     186
     187G4bool G4HadronicInteraction::IsBlocked( const G4Material *aMaterial ) const
     188{
     189  for( size_t i=0; i<theBlockedList.size(); ++i )
    182190    {
    183191      if( aMaterial == theBlockedList[i] )
    184       {
    185         return true;
    186       }
    187     }
    188     return false;
    189   }
    190  
    191  G4bool
    192   G4HadronicInteraction::IsBlocked( const G4Element *anElement ) const
    193   {
    194     for( size_t i=0; i<theBlockedListElements.size(); ++i )
     192        {
     193          return true;
     194        }
     195    }
     196  return false;
     197}
     198 
     199G4bool G4HadronicInteraction::IsBlocked( const G4Element *anElement ) const
     200{
     201  for( size_t i=0; i<theBlockedListElements.size(); ++i )
    195202    {
    196203      if( anElement == theBlockedListElements[i] )
    197       {
    198         return true;
    199       }
    200     }
    201     return false;
    202   }
    203  
    204  /* end of file */
    205  
     204        {
     205          return true;
     206        }
     207    }
     208  return false;
     209}
     210
     211G4HadronicInteraction::G4HadronicInteraction(const G4HadronicInteraction &right )
     212{
     213  *this = right;
     214}
     215   
     216const G4HadronicInteraction&
     217G4HadronicInteraction::operator=(const G4HadronicInteraction &right )
     218{
     219  G4String text = "unintended use of G4HadronicInteraction::operator=";
     220  throw G4HadronicException(__FILE__, __LINE__, text);
     221  return right;
     222}
     223 
     224/* end of file */
     225 
  • trunk/source/processes/hadronic/models/management/src/G4HadronicInteractionRegistry.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4HadronicInteractionRegistry.cc,v 1.7 2009/02/25 16:30:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
     30
    2631#include "G4HadronicInteractionRegistry.hh"
    2732#include "G4HadronicInteraction.hh"
    2833
    29 G4HadronicInteractionRegistry & G4HadronicInteractionRegistry::theRegistry()
     34G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::theInstance = 0;
     35
     36G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::Instance()
    3037{
    31   static G4HadronicInteractionRegistry theRegistryInstance;
    32   return theRegistryInstance;
     38  if(0 == theInstance) {
     39    static G4HadronicInteractionRegistry manager;
     40    theInstance = &manager;
     41  }
     42  return theInstance;
     43}
     44
     45G4HadronicInteractionRegistry::G4HadronicInteractionRegistry()
     46{
     47  nModels = 0;
     48}
     49
     50G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
     51{
     52  Clean();
     53}
     54
     55void G4HadronicInteractionRegistry::Clean()
     56{
     57  //G4cout << "G4HadronicInteractionRegistry::Clean() start " << nModels << G4endl;
     58  if(0 < nModels) {
     59    for (G4int i=0; i<nModels; i++) {
     60      if( allModels[i] ) {
     61        //G4cout << "delete " << i << G4endl;
     62        //G4cout << allModels[i]->GetModelName() << G4endl;
     63        delete allModels[i];
     64        allModels[i] = 0;
     65      }
     66    }
     67  }
     68  //G4cout << "G4HadronicInteractionRegistry::Clean() is done " << G4endl;
     69  nModels = 0;
    3370}
    3471
     
    3673RegisterMe(G4HadronicInteraction * aModel)
    3774{
    38   theRegistry().AddModel(aModel);
     75  if(nModels > 0) {
     76    for (G4int i=0; i<nModels; i++) {
     77      if( aModel == allModels[i] ) return;
     78    }
     79  }
     80  //G4cout << "Register model <" << aModel->GetModelName()
     81  //<< ">  " << nModels << G4endl;
     82  allModels.push_back(aModel);
     83  nModels++;
    3984}
    4085
     
    4287RemoveMe(G4HadronicInteraction * aModel)
    4388{
    44   theRegistry().allModels.erase(std::find(theRegistry().allModels.begin(),
    45                                           theRegistry().allModels.end(), aModel));
    46   theRegistry().nModels = theRegistry().allModels.size();
    47 }
    48 
    49 G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
    50 {
    51   /*
    52   while(allModels.size()!=0)
    53   {
    54     delete allModels.front();
    55   }
    56   */
    57 }
    58 
    59 void G4HadronicInteractionRegistry::
    60 AddModel(G4HadronicInteraction * aModel)
    61 {
    62   G4bool alreadyThere = false;
    63   for(G4int i=0; i<nModels; i++)
    64   {
    65     if(allModels[i]==aModel)
    66     {
    67       alreadyThere = true;
    68       break;
     89  if(nModels > 0) {
     90    for (G4int i=0; i<nModels; i++) {
     91      if( aModel == allModels[i] ) {
     92        //G4cout << "DeRegister model <" << aModel->GetModelName()
     93        //<< ">  " << i << G4endl;
     94        allModels[i] = 0;
     95        return;
     96      }
    6997    }
    7098  }
    71   if(!alreadyThere)
    72   {
    73     nModels++;
    74     allModels.push_back(aModel);
    75   }
    7699}
  • trunk/source/processes/hadronic/models/management/src/G4InelasticInteraction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4InelasticInteraction.cc,v 1.12 2009/01/24 11:56:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2628//
    27 //
    28  // Hadronic Process: Inelastic Interaction
    29  // original by H.P. Wellisch
    30  // modified by J.L. Chuma, TRIUMF, 22-Nov-1996
    31  // Last modified: 27-Mar-1997
    32  // J.P. Wellisch: 23-Apr-97: throw G4HadronicException(__FILE__, __LINE__,  removed
    33  // J.P. Wellisch: 24-Apr-97: correction for SetUpPions
    34  // Modified by J.L. Chuma, 30-Apr-97: added originalTarget to CalculateMomenta
    35  //                                    since TwoBody needed to reset the target particle
    36  // J.L. Chuma, 20-Jun-97: Modified CalculateMomenta to correct the decision process
    37  //                        for whether to use GenerateXandPt or TwoCluster
    38  // J.L. Chuma, 06-Aug-97: added original incident particle, before Fermi motion and
    39  //                        evaporation effects are included, needed for calculating
    40  //                        self absorption and corrections for single particle spectra
    41  // HPW removed misunderstanding of LocalEnergyDeposit, 11.04.98.
     29// Hadronic Process: Inelastic Interaction
     30// original by H.P. Wellisch
     31// modified by J.L. Chuma, TRIUMF, 22-Nov-1996
     32// Last modified: 27-Mar-1997
     33// J.P. Wellisch: 23-Apr-97: throw G4HadronicException(__FILE__, __LINE__,  removed
     34// J.P. Wellisch: 24-Apr-97: correction for SetUpPions
     35// Modified by J.L. Chuma, 30-Apr-97: added originalTarget to CalculateMomenta
     36//                                    since TwoBody needed to reset the target particle
     37// J.L. Chuma, 20-Jun-97: Modified CalculateMomenta to correct the decision process
     38//                        for whether to use GenerateXandPt or TwoCluster
     39// J.L. Chuma, 06-Aug-97: added original incident particle, before Fermi motion and
     40//                        evaporation effects are included, needed for calculating
     41//                        self absorption and corrections for single particle spectra
     42// HPW removed misunderstanding of LocalEnergyDeposit, 11.04.98.
     43// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
    4244 
    4345#include "G4InelasticInteraction.hh"
    4446#include "Randomize.hh"
    4547#include "G4HadReentrentException.hh"
    46  
    47  G4double
     48
     49G4InelasticInteraction::G4InelasticInteraction(const G4String& modelName)
     50  : G4HadronicInteraction(modelName)
     51{ cache = 0.0;}
     52   
     53G4InelasticInteraction::~G4InelasticInteraction()
     54{}
     55 
     56G4double
    4857  G4InelasticInteraction::Pmltpc(      // used in Cascade functions
    4958   G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c )
     
    6372  }
    6473
    65  G4bool
     74G4bool
    6675  G4InelasticInteraction::MarkLeadingStrangeParticle(
    6776   const G4ReactionProduct &currentParticle,
     
    92101  }
    93102 
    94  void
     103void
    95104  G4InelasticInteraction::SetUpPions(
    96105   const G4int np,
     
    126135  }
    127136 
    128  void
     137void
    129138  G4InelasticInteraction::GetNormalizationConstant(
    130139   const G4double energy,  // MeV,  <0 means annihilation channels
     
    170179  }
    171180 
    172  void
     181void
    173182  G4InelasticInteraction::CalculateMomenta(
    174183   G4FastVector<G4ReactionProduct,GHADLISTSIZE> &vec,
     
    344353
    345354 
    346  void G4InelasticInteraction::
     355void G4InelasticInteraction::
    347356 Rotate(G4FastVector<G4ReactionProduct,GHADLISTSIZE> &vec, G4int &vecLen)
    348357 {
     
    358367 }     
    359368
    360  void
     369void
    361370  G4InelasticInteraction::SetUpChange(
    362371   G4FastVector<G4ReactionProduct,GHADLISTSIZE> &vec,
  • trunk/source/processes/hadronic/models/neutron_hp/History

    r962 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1714 May 2009  Tatsumi Koi  (hadr-hpn-V09-02-00)
     18- Fix bug in IC electron emissions: Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu)
     19        G4NeutronHPPhotonDist.cc
     20        G4NeutronHPInelasticCompFS.cc
    1621
    17223 December 2008  Tatsumi Koi  (hadr-hpn-V09-01-28)
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc

    r962 r1055  
    3636//        introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi
    3737// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
     38// 090514 Fix bug in IC electron emission case
     39//        Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu)
    3840//
    3941#include "G4NeutronHPInelasticCompFS.hh"
     
    6971void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirName, G4String & aFSType)
    7072{
     73
    7174  gammaPath = "/Inelastic/Gammas/";
    7275    if(!getenv("G4NEUTRONHPDATA"))
     
    460463
    461464      aHadron.SetMomentum( Vector*p );
    462                                      
     465
    463466    }
    464467
     
    577580      {
    578581        theSec = new G4DynamicParticle;   
    579         theSec->SetDefinition(G4Gamma::Gamma());
     582        //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     583        //theSec->SetDefinition(G4Gamma::Gamma());
     584        theSec->SetDefinition( thePhotons->operator[](i)->GetDefinition() );
     585        //But never cause real effect at least with G4NDL3.13 TK
    580586        theSec->SetMomentum(thePhotons->operator[](i)->GetMomentum());
    581587        theResult.AddSecondary(theSec);
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPPhotonDist.cc

    r962 r1055  
    3636// 080801 Correcting data disorder which happened when both InitPartial
    3737//        and InitAnglurar methods was called in a same instance by T. Koi
     38// 090514 Fix bug in IC electron emission case
     39//        Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu)
     40//        But it looks like never cause real effect in G4NDL3.13 (at least Natural elements) TK
    3841//
    3942// there is a lot of unused (and undebugged) code in this file. Kept for the moment just in case. @@
     
    4851G4bool G4NeutronHPPhotonDist::InitMean(std::ifstream & aDataFile)
    4952{
     53
    5054  G4bool result = true;
    5155  if(aDataFile >> repFlag)
    5256  {
     57
    5358    aDataFile >> targetMass;
    5459    if(repFlag==1)
     
    7378       theBaseEnergy*=eV;
    7479       aDataFile >> theInternalConversionFlag;
     80       // theInternalConversionFlag == 1 No IC, theInternalConversionFlag == 2 with IC
    7581       aDataFile >> nGammaEnergies;
    7682       theLevelEnergies = new G4double[nGammaEnergies];
     
    118124  if (isoFlag != 1)
    119125  {
     126if ( repFlag == 2 ) G4cout << "TKDB repFlag == 2 && isoFlag !=1  " << G4endl;
    120127    aDataFile >> tabulationType >> nDiscrete2 >> nIso;
    121128//080731
     
    547554    {
    548555      theOne->SetDefinition(G4Electron::Electron());
     556      //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     557      //But never enter at least with G4NDL3.13
     558      totalEnergy += G4Electron::Electron()->GetPDGMass(); //proposed correction: add this line for electron
    549559    }
    550560    theOne->SetTotalEnergy(totalEnergy);
    551     if( isoFlag == 1)
     561    if( isoFlag == 1 )
    552562    {
    553563      G4double costheta = 2.*G4UniformRand()-1;
     
    555565      G4double phi = twopi*G4UniformRand();
    556566      G4double sinth = std::sin(theta);
    557       G4double en = theOne->GetTotalEnergy();
     567      //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     568      //G4double en = theOne->GetTotalEnergy();
     569      G4double en = theOne->GetTotalMomentum();
     570      //But never cause real effect at least with G4NDL3.13 TK
    558571      G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
    559572      theOne->SetMomentum( temp ) ;
     
    569582      if(ii<nIso)
    570583      {
     584        //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
    571585        // isotropic distribution
    572         G4double theta = pi*G4UniformRand();
     586        //G4double theta = pi*G4UniformRand();
     587        G4double theta = std::acos(2.*G4UniformRand()-1.);
     588        //But this is alos never cause real effect at least with G4NDL3.13 TK  not repFlag == 2 AND isoFlag != 1
    573589        G4double phi = twopi*G4UniformRand();
    574590        G4double sinth = std::sin(theta);
    575         G4double en = theOne->GetTotalEnergy();
     591        //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     592        //G4double en = theOne->GetTotalEnergy();
     593        G4double en = theOne->GetTotalMomentum();
     594        //But never cause real effect at least with G4NDL3.13 TK
    576595        G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
    577596        theOne->SetMomentum( tempVector ) ;
     
    594613        G4double phi = twopi*G4UniformRand();
    595614        G4double sinth = std::sin(theta);
    596         G4double en = theOne->GetTotalEnergy();
     615        //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     616        //G4double en = theOne->GetTotalEnergy();
     617        G4double en = theOne->GetTotalMomentum();
     618        //But never cause real effect at least with G4NDL3.13 TK
    597619        G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
    598620        theOne->SetMomentum( tempVector ) ;
     
    612634        G4double phi = twopi*G4UniformRand();
    613635        G4double sinth = std::sin(theta);
    614         G4double en = theOne->GetTotalEnergy();
     636        //Bug reported Chao Zhang (Chao.Zhang@usd.edu), Dongming Mei(Dongming.Mei@usd.edu) Feb. 25, 2009
     637        //G4double en = theOne->GetTotalEnergy();
     638        G4double en = theOne->GetTotalMomentum();
     639        //But never cause real effect at least with G4NDL3.13 TK
    615640        G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
    616641        theOne->SetMomentum( tmpVector ) ;
  • trunk/source/processes/hadronic/models/parton_string/hadronization/History

    r819 r1055  
    1 $Id: History,v 1.5 2007/05/03 22:10:54 gunter Exp $
     1$Id: History,v 1.7 2009/05/22 16:36:52 gunter Exp $
    22-------------------------------------------------------------------
    33
     
    1616     ---------------------------------------------------------------
    1717
     1822-May-2009   Gunter Folger             (had-hadronization-V09-02-01)
     19- remove temporary workaround - fix is now in QGS
     20- change pt sampling in G4LundStringFragmentation to avoid near endless
     21  loop; this should improve overall performance slightly.
     22  Affected G4VLongitudinalStringDecay, where SampleQuarkPt() is
     23  implemented; affected .hh and .cc for new optional argument of max Pt
     24  to SampleQuarkPt()
     25
     2618-May-2009   Gunter Folger             (had-hadronization-V09-02-00)
     27---------------------------------------------------------------------
     28- reset formatting changes by MK with tags hadr-prtn-hadr-V09-02-xx
     29- temporary workaround for wrong PDG codes created on wrong input from QGS
     30   when used for e.g. antiproton.
     31   
    18322-May 2007    Gunter Folger             (had-hadronization-V08-02-03)
    1933---------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/parton_string/hadronization/include/G4HadronBuilder.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4HadronBuilder.hh,v 1.3 2006/06/29 20:54:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4HadronBuilder.hh,v 1.5 2009/05/18 09:43:40 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/parton_string/hadronization/include/G4VLongitudinalStringDecay.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VLongitudinalStringDecay.hh,v 1.6 2008/06/23 08:35:54 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VLongitudinalStringDecay.hh,v 1.7 2009/05/22 16:35:47 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929// Maxim Komogorov
    3030//
     
    116116//   used by G4VKinkyStringDecy..
    117117   G4int SampleQuarkFlavor(void);
    118    G4ThreeVector SampleQuarkPt();
     118   G4ThreeVector SampleQuarkPt(G4double ptMax=-1.); // -1. no limit on maxpt.
    119119
    120120protected:
  • trunk/source/processes/hadronic/models/parton_string/hadronization/src/G4ExcitedStringDecay.cc

    r819 r1055  
    134134      }
    135135    }
    136    
     136#ifdef debug_G4ExcitedStringDecay    
    137137    if(!success)
    138138    {
     
    144144//       throw G4HadronicException(__FILE__, __LINE__, "G4ExcitedStringDecay failed to correct...");
    145145    }
    146 
     146#endif     
    147147    // Compute c.m.s. interaction velocity and KTV back boost   
    148148    Beta = TotalCollisionMom.boostVector();
  • trunk/source/processes/hadronic/models/parton_string/hadronization/src/G4HadronBuilder.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4HadronBuilder.cc,v 1.7 2008/04/25 14:20:14 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4HadronBuilder.cc,v 1.10 2009/05/22 16:34:31 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    147147           if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
    148148              PDGEncoding = - PDGEncoding;
    149         }
     149        }
    150150           
    151151           
  • trunk/source/processes/hadronic/models/parton_string/hadronization/src/G4LundStringFragmentation.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4LundStringFragmentation.cc,v 1.13 2008/06/23 09:17:10 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $ 1.8
     27// $Id: G4LundStringFragmentation.cc,v 1.14 2009/05/22 16:36:46 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 1.8
    2929//
    3030// -----------------------------------------------------------------------------
     
    508508   {
    509509      do                                                                     
    510       {                                                                     
    511          Pt=SampleQuarkPt(); Pt.setZ(0); G4double Pt2=Pt.mag2();             
     510      { 
     511         // GF 22-May-09, limit sampled pt to allowed range
     512         
     513         G4double termD = InitialMass*InitialMass -Mass*Mass - AntiMass*AntiMass;
     514         G4double termab = 4*sqr(Mass*AntiMass);
     515         G4double termN = 2*termD + 4*Mass*Mass + 4*AntiMass*AntiMass;
     516         G4double pt2max=(termD*termD - termab )/ termN ;
     517         
     518//       G4cout << " termD, ab, N " << termD << "  " << termab << "  " << termN
     519//              <<  "   pt2max= " << pt2max ;
     520                                                                                         
     521         Pt=SampleQuarkPt(sqrt(pt2max)); Pt.setZ(0); G4double Pt2=Pt.mag2();
     522
     523         
     524//       G4cout << " sampled Pt2 = " << Pt2 << "  " << pt2max-Pt2 << G4endl;             
     525         // end.. GF
    512526
    513527//G4cout<<"Sample4Momentum Pt x y "<<Pt.getX()<<" "<<Pt.getY()<<G4endl;
     
    521535                         4.*MassMt2*AntiMassMt2;                               
    522536      }                                                                     
    523       while(AvailablePz2 < 0.);                                              
     537      while(AvailablePz2 < 0.);     // GF will occur only for numerical precision problem with limit in sampled pt                                              
    524538                                                                           
    525539      AvailablePz2 /=(4.*InitialMass*InitialMass);                           
  • trunk/source/processes/hadronic/models/parton_string/hadronization/src/G4VLongitudinalStringDecay.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4VLongitudinalStringDecay.cc,v 1.13 2008/06/23 08:35:55 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4VLongitudinalStringDecay.cc,v 1.14 2009/05/22 16:35:47 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------------------------
     
    485485//    }
    486486
    487 G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
     487G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt(G4double ptMax)
    488488   {
    489    G4double Pt = -std::log(G4UniformRand());
     489   G4double Pt;
     490   if ( ptMax < 0 ) {
     491      // sample full gaussian
     492      Pt = -std::log(G4UniformRand());
     493   } else {
     494      // sample in limited range
     495      Pt = -std::log(CLHEP::RandFlat::shoot(exp(-sqr(ptMax)/sqr(SigmaQT)), 1.));
     496   }
    490497   Pt = SigmaQT * std::sqrt(Pt);
    491498   G4double phi = 2.*pi*G4UniformRand();
  • trunk/source/processes/hadronic/models/parton_string/qgsm/History

    r962 r1055  
    1 $Id: History,v 1.6 2008/09/19 09:54:23 gunter Exp $
     1$Id: History,v 1.8 2009/05/19 12:48:42 gunter Exp $
    22-------------------------------------------------------------------
    33
     
    1616     ---------------------------------------------------------------
    1717
     1819 May 2009, G.Folger           (hadr-qgsm-V09-02-02)
     19-----------------------------------------------------
     20- fix in G4SPBaryon: for antibaryon, a  diquark & quark was given instead of
     21      anti-diquark & antiquark; note the reverse order, too.
     22    Fixes problems with incident anti baryons, e.g. antiproton, manifesting
     23    in problems with forming hadrons.
     24
     2529 Apr 2009 m. Kosov       (hadr-qgsm-V09-02-01)
     26------------------------------------------------
     27Very important bug fix in G4QGSParticipants.cc to let QGSC working from E=0
     28Added by GF (19-May-09):
     29- this very important "bug" fix modifies G4G4QGSParticipants.cc and
     30   G4GammaParticipants.cc:
     31     changing the value of Threshold from 0.45 GeV to 0.GeV,
     32     and disables an Exception if s < sqr(total mass + Threshold)
    1833
    193415 Sep 2008 G.Folger       (hadr-qgsm-V09-01-01)
  • trunk/source/processes/hadronic/models/parton_string/qgsm/include/G4QGSParticipants.hh

    r819 r1055  
    8383    enum  { SOFT, DIFFRACTIVE };
    8484    const G4int nCutMax;
    85     const G4double ThersholdParameter;
    86     const G4double QGSMThershold;
     85    const G4double ThresholdParameter;
     86    const G4double QGSMThreshold;
    8787    const G4double theNucleonRadius;
    8888   
  • trunk/source/processes/hadronic/models/parton_string/qgsm/src/G4GammaParticipants.cc

    r819 r1055  
    5050  G4double ThresholdMass = thePrimary.GetMass() + theTargetNuc[0]->GetDefinition()->GetPDGMass();
    5151  ModelMode = SOFT;
    52   if (sqr(ThresholdMass + ThersholdParameter) > s)
     52  if (sqr(ThresholdMass + ThresholdParameter) > s)
    5353  {
    54     throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
     54    ModelMode = DIFFRACTIVE;
     55    //throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
    5556  }
    56   if (sqr(ThresholdMass + QGSMThershold) > s) // thus only diffractive in cascade!
     57  if (sqr(ThresholdMass + QGSMThreshold) > s) // thus only diffractive in cascade!
    5758  {
    5859    ModelMode = DIFFRACTIVE;
  • trunk/source/processes/hadronic/models/parton_string/qgsm/src/G4QGSParticipants.cc

    r962 r1055  
    3636
    3737G4QGSParticipants::G4QGSParticipants() : theDiffExcitaton(), //0.7*GeV, 250*MeV, 250*MeV),
    38                                          nCutMax(7),ThersholdParameter(0.45*GeV),
    39                                          QGSMThershold(3*GeV),theNucleonRadius(1.5*fermi)
     38                                         //nCutMax(7),ThresholdParameter(0.45*GeV),
     39                                         nCutMax(7),ThresholdParameter(0.000*GeV),
     40                                         QGSMThreshold(3*GeV),theNucleonRadius(1.5*fermi)
    4041                                         
    4142{
     
    4344
    4445G4QGSParticipants::G4QGSParticipants(const G4QGSParticipants &right)
    45 : G4VParticipants(), nCutMax(right.nCutMax),ThersholdParameter(right.ThersholdParameter),
    46   QGSMThershold(right.QGSMThershold),theNucleonRadius(right.theNucleonRadius)
     46: G4VParticipants(), nCutMax(right.nCutMax),ThresholdParameter(right.ThresholdParameter),
     47  QGSMThreshold(right.QGSMThreshold),theNucleonRadius(right.theNucleonRadius)
    4748{
    4849}
     
    9192  G4double ThresholdMass = thePrimary.GetMass() + pNucleon->GetDefinition()->GetPDGMass();
    9293  ModelMode = SOFT;
    93   if (sqr(ThresholdMass + ThersholdParameter) > s)
    94   {
    95     throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
    96   }
    97   if (sqr(ThresholdMass + QGSMThershold) > s) // thus only diffractive in cascade!
     94  if (sqr(ThresholdMass + ThresholdParameter) > s)
     95  {
     96    ModelMode = DIFFRACTIVE;
     97    //throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
     98  }
     99  if (sqr(ThresholdMass + QGSMThreshold) > s) // thus only diffractive in cascade!
    98100  {
    99101    ModelMode = DIFFRACTIVE;
  • trunk/source/processes/hadronic/models/parton_string/qgsm/src/G4SPBaryon.cc

    r819 r1055  
    104104      if (theDefinition->GetPDGEncoding() < 0)
    105105      {
    106         quark = -(*i)->GetDiQuark();
    107         diQuark = -(*i)->GetQuark();                   
     106        quark = (*i)->GetDiQuark();
     107        diQuark = (*i)->GetQuark();                   
    108108      }
    109109      else
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/History

    r1007 r1055  
    1 $Id: History,v 1.6 2008/10/02 21:05:09 dennis Exp $
     1$Id: History,v 1.8 2009/02/06 08:58:20 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1616     ---------------------------------------------------------------
    1717
     1806 Feb 2009 V.Ivantchenko (hadr-munuclear-V09-02-01)
     19----------------------------------------------------
     20
     2124 Jan 2009 V.Ivantchenko (hadr-munuclear-V09-02-00)
     22----------------------------------------------------
     23- G4MuNuclearInteraction added deregistration of the process
     24
    1825 4 Oct 2008 Dennis Wright (hadr-munuclear-V09-01-01)
    1926----------------------------------------------------
     
    2128  12 to fHadronInelastic
    2229
    23  2 Sep 2008 V.Ivantchenko (hadr-munuclear-V09-01-00)
    24 -----------------------------------------------------------------------
     30 2 Sep 2008 V.Ivanchenko (hadr-munuclear-V09-01-00)
     31---------------------------------------------------
    2532- G4MuNuclearInteraction added SubType and registration in the
    2633                         G4HadronicProcessStore; added PreparePhysicsTable
    2734                         method and cleanup for readability
    2835
    29  4 Nov 2006 Dennis Wright for V. Ivantchenko (hadr-munuclear-V08-01-00)
     36 4 Nov 2006 Dennis Wright for V.Ivanchenko (hadr-munuclear-V08-01-00)
    3037-----------------------------------------------------------------------
    3138- G4MuNuclearInteraction::ComputeMicroscopicCrossSection: prevent NaN
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.icc

    r962 r1055  
    2626//
    2727// $Id: G4MuNuclearInteraction.icc,v 1.3 2006/06/29 20:57:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// $Id:
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuNuclearInteraction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4MuNuclearInteraction.cc,v 1.11 2008/10/02 21:04:54 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuNuclearInteraction.cc,v 1.12 2009/01/24 11:59:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2928//
    3029// $Id:
     
    3837//      added simple model for hadronic vertex, J.P. Wellisch, November 1998
    3938// --------------------------------------------------------------
    40 // 26/10/98: new corr.s from R.Kokoulin + cleanup , L.Urban
     39// 26/10/1998: new corr.s from R.Kokoulin + cleanup , L.Urban
     40// 23/01/2009  V.Ivanchenko Add deregistration
    4141//
     42
    4243#include "G4MuNuclearInteraction.hh"
    4344#include "G4UnitsTable.hh"
     
    7475G4MuNuclearInteraction::~G4MuNuclearInteraction()
    7576{
     77  G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this);
     78
    7679  if (theMeanFreePathTable) {
    7780    theMeanFreePathTable->clearAndDestroy();
  • trunk/source/processes/hadronic/models/pre_equilibrium/History

    r1007 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1713-February 2009 V.Ivanchenko   hadr-pre-V09-02-03
     18---------------------------------------------------
     19G4PreCompoundXXX - changed the shape of probabilities (return back to 9.2) 
     20                   for d, t, He3, alpha (JMQ)
     21
     2212-February 2009 V.Ivanchenko   hadr-pre-V09-02-02
     23---------------------------------------------------
     24G4PreCompoundXXX - changed the shape of probabilities
     25                   for d, t, He3, alpha near the Coulomb barrier (JMQ)
     26
     2711-February 2009 V.Ivanchenko   hadr-pre-V09-02-01
     28---------------------------------------------------
     29G4PreCompoundXXX - set default Opt3 back, add decrease Coulomb barrier
     30                   for d, t, a, he3 (JMQ)
     31
     3210-February 2009 V.Ivanchenko   hadr-pre-V09-02-00
     33---------------------------------------------------
     34Some clean up of comments
     35G4PreCompoundIon - fixed probability of light ion emmision (JMQ)
     36G4PreCompoundXXX - by default Opt1 is used for d, t, a, he3,
     37                   Opt3 for n, p (JMQ)
    1638
    173909-December 2008 A.Howard   hadr-pre-V09-01-15
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundEmission.icc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4PreCompoundEmission.icc,v 1.5 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29//
     30// Author:         V.Lara
     31//
     32// Modified: 
    2633// Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    2734// cross section option
     
    3441  return;
    3542}
    36 
    3743
    3844inline G4double G4PreCompoundEmission::GetTotalProbability(const G4Fragment & aFragment)
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundFragmentVector.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4PreCompoundFragmentVector.hh,v 1.4 2008/09/22 10:18:36 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4PreCompoundFragmentVector.hh,v 1.6 2009/02/10 16:01:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear Preequilibrium
     
    3939#define G4PreCompoundFragmentVector_h 1
    4040
    41 
    4241#include "G4VPreCompoundFragment.hh"
    43 
    44 
    4542
    4643class G4PreCompoundFragmentVector
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundFragmentVector.icc

    r962 r1055  
    2626//
    2727// $Id: G4PreCompoundFragmentVector.icc,v 1.4 2008/09/22 10:18:36 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Hadronic Process: Nuclear Preequilibrium
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4VPreCompoundFragment.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J. M. Quesada (August 2008). 
    27 //Based  on previous work by V. Lara
     26//
     27// $Id: G4VPreCompoundFragment.hh,v 1.10 2009/02/10 16:01:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// J. M. Quesada (August 2008). 
     31// Based  on previous work by V. Lara
    2832//
    2933// Modif (03 September 2008) by J. M. Quesada for external choice of inverse
     
    3135// JMQ (06 September 2008) Also external choice has been added for:
    3236//                      - superimposed Coulomb barrier (if useSICB=true)
    33 
    3437
    3538#ifndef G4VPreCompoundFragment_h
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4VPreCompoundFragment.icc

    r962 r1055  
    2626//
    2727// $Id: G4VPreCompoundFragment.icc,v 1.7 2008/09/22 10:18:36 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// by V. Lara
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundAlpha.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J.M.Quesada (August 08). New source file
    27 //
    28 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    29 // cross section option
     26//
     27// $Id: G4PreCompoundAlpha.cc,v 1.5 2009/02/13 18:57:32 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundAlpha
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 21.08.2008 J. M. Quesada add choice of options 
     41// 10.02.2009 J. M. Quesada set default opt1 
     42//
    3043
    3144#include "G4PreCompoundAlpha.hh"
    3245
    33   G4ReactionProduct * G4PreCompoundAlpha::GetReactionProduct() const
    34   {
    35     G4ReactionProduct * theReactionProduct =
    36       new G4ReactionProduct(G4Alpha::AlphaDefinition());
    37     theReactionProduct->SetMomentum(GetMomentum().vect());
    38     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     46G4ReactionProduct * G4PreCompoundAlpha::GetReactionProduct() const
     47{
     48  G4ReactionProduct * theReactionProduct =
     49    new G4ReactionProduct(G4Alpha::AlphaDefinition());
     50  theReactionProduct->SetMomentum(GetMomentum().vect());
     51  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    3952#ifdef PRECOMPOUND_TEST
    40     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     53  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4154#endif
    42     return theReactionProduct;
    43   }   
    44 
    45 
    46    G4double G4PreCompoundAlpha::FactorialFactor(const G4double N, const G4double P)
    47   {
    48      return
     55  return theReactionProduct;
     56}   
     57
     58G4double G4PreCompoundAlpha::FactorialFactor(const G4double N, const G4double P)
     59{
     60  return
    4961      (N-4.0)*(P-3.0)*(
    5062                       (((N-3.0)*(P-2.0))/2.0) *(
     
    5466                                                 )
    5567                       );
     68}
     69 
     70G4double G4PreCompoundAlpha::CoalescenceFactor(const G4double A)
     71{
     72  return 4096.0/(A*A*A); 
     73}   
     74
     75G4double G4PreCompoundAlpha::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     76{
     77  G4double rj = 0.0;
     78  G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2)*(NumberParticles-3);
     79  if(NumberCharged >=2 && (NumberParticles-NumberCharged) >=2 ) {
     80    rj = 6.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged)*
     81                                   (NumberParticles-NumberCharged-1))/static_cast<G4double>(denominator); 
    5682  }
    57  
    58    G4double G4PreCompoundAlpha::CoalescenceFactor(const G4double A)
    59   {
    60      return 4096.0/(A*A*A); 
    61   }   
    62 
    63 
    64 
    65    G4double G4PreCompoundAlpha::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    66   {
    67     G4double rj = 0.0;
    68     G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2)*(NumberParticles-3);
    69     if(NumberCharged >=2 && (NumberParticles-NumberCharged) >=2 ) rj = 6.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged)*(NumberParticles-NumberCharged-1))/static_cast<G4double>(denominator); 
    70  return rj;
    71   }
    72 
    73 
    74 
     83  return rj;
     84}
    7585
    7686////////////////////////////////////////////////////////////////////////////////////
     
    8090//OPT=3,4 Kalbach's parameterization
    8191//
    82  G4double G4PreCompoundAlpha::CrossSection(const  G4double K)
     92G4double G4PreCompoundAlpha::CrossSection(const  G4double K)
    8393{
    8494
     
    115125//----------------
    116126//
    117  G4double G4PreCompoundAlpha::GetAlpha()
    118   {
    119  G4double C = 0.0;
    120     G4double aZ = GetZ() + GetRestZ();
    121     if (aZ <= 30)
    122       {
    123         C = 0.10;
    124       }
    125     else if (aZ <= 50)
    126       {
    127         C = 0.1 + -((aZ-50.)/20.)*0.02;
    128       }
    129     else if (aZ < 70)
    130       {
    131         C = 0.08 + -((aZ-70.)/20.)*0.02;
    132       }
    133     else
    134       {
    135         C = 0.06;
    136       }
    137     return 1.0+C;
    138   }
     127G4double G4PreCompoundAlpha::GetAlpha()
     128{
     129  G4double C = 0.0;
     130  G4double aZ = GetZ() + GetRestZ();
     131  if (aZ <= 30)
     132    {
     133      C = 0.10;
     134    }
     135  else if (aZ <= 50)
     136    {
     137      C = 0.1 + -((aZ-50.)/20.)*0.02;
     138    }
     139  else if (aZ < 70)
     140    {
     141      C = 0.08 + -((aZ-70.)/20.)*0.02;
     142    }
     143  else
     144    {
     145      C = 0.06;
     146    }
     147  return 1.0+C;
     148}
    139149//
    140150//--------------------
    141151//
    142   G4double G4PreCompoundAlpha::GetBeta()
    143   {
    144       return -GetCoulombBarrier();
    145   }
     152G4double G4PreCompoundAlpha::GetBeta()
     153{
     154  return -GetCoulombBarrier();
     155}
    146156//
    147157//********************* OPT=1,2 : Chatterjee's cross section ************************
     
    153163  G4double Kc=K;
    154164
    155   // JMQ xsec is set constat above limit of validity
     165  // JMQ xsec is set constant above limit of validity
    156166  if (K>50) Kc=50;
    157167
     
    213223  G4double      ra=1.20;
    214224       
    215   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     225  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     226  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     227  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    216228  ecsq = ec * ec;
    217229  p = p0 + p1/ec + p2/ecsq;
     
    236248 
    237249  if (elab <= ec) { //start for E<Ec
    238     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     250    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    239251  }           //end for E<Ec
    240252  else {           //start for E>Ec
     
    252264
    253265//   ************************** end of cross sections *******************************
    254 
    255 
    256 
    257 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundDeuteron.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J.M.Quesada (August 08). New source file
    27 //
    28 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    29 // cross section option
     26// $Id: G4PreCompoundDeuteron.cc,v 1.5 2009/02/13 18:57:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class file
     32//
     33//
     34// File name:     G4PreCompoundDeuteron
     35//
     36// Author:         V.Lara
     37//
     38// Modified: 
     39// 21.08.2008 J. M. Quesada add choice of options 
     40// 10.02.2009 J. M. Quesada set default opt1 
     41//
    3042
    3143#include "G4PreCompoundDeuteron.hh"
    3244
    33 
    34 
    35   G4ReactionProduct * G4PreCompoundDeuteron::GetReactionProduct() const
    36   {
    37     G4ReactionProduct * theReactionProduct =
    38       new G4ReactionProduct(G4Deuteron::DeuteronDefinition());
    39     theReactionProduct->SetMomentum(GetMomentum().vect());
    40     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     45G4ReactionProduct * G4PreCompoundDeuteron::GetReactionProduct() const
     46{
     47  G4ReactionProduct * theReactionProduct =
     48    new G4ReactionProduct(G4Deuteron::DeuteronDefinition());
     49  theReactionProduct->SetMomentum(GetMomentum().vect());
     50  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    4151#ifdef PRECOMPOUND_TEST
    42     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     52  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4353#endif
    44     return theReactionProduct;
    45   }   
    46 
    47  
    48    G4double G4PreCompoundDeuteron::FactorialFactor(const G4double N, const G4double P)
    49   {
    50       return (N-1.0)*(N-2.0)*(P-1.0)*P/2.0;
     54  return theReactionProduct;
     55}   
     56
     57 
     58G4double G4PreCompoundDeuteron::FactorialFactor(const G4double N, const G4double P)
     59{
     60  return (N-1.0)*(N-2.0)*(P-1.0)*P/2.0;
     61}
     62 
     63G4double G4PreCompoundDeuteron::CoalescenceFactor(const G4double A)
     64{
     65  return 16.0/A;
     66}   
     67
     68G4double G4PreCompoundDeuteron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     69{
     70  G4double rj = 0.0;
     71  G4double denominator = NumberParticles*(NumberParticles-1);
     72  if(NumberCharged >=1 && (NumberParticles-NumberCharged) >=1) {
     73    rj = 2.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged))
     74      / static_cast<G4double>(denominator);
    5175  }
    52  
    53    G4double G4PreCompoundDeuteron::CoalescenceFactor(const G4double A)
    54   {
    55     return 16.0/A;
    56   }   
    57 
    58   G4double G4PreCompoundDeuteron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    59   {
    60     G4double rj = 0.0;
    61     G4double denominator = NumberParticles*(NumberParticles-1);
    62    if(NumberCharged >=1 && (NumberParticles-NumberCharged) >=1) rj = 2.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged))/static_cast<G4double>(denominator);
    63 
    64     return rj;
    65   }
     76  return rj;
     77}
    6678
    6779////////////////////////////////////////////////////////////////////////////////////
     
    7183//OPT=3,4 Kalbach's parameterization
    7284//
    73  G4double G4PreCompoundDeuteron::CrossSection(const  G4double K)
     85G4double G4PreCompoundDeuteron::CrossSection(const  G4double K)
    7486{
    7587
     
    106118//---------
    107119//
    108  G4double G4PreCompoundDeuteron::GetAlpha()
    109   {
    110 G4double C = 0.0;
    111     G4double aZ = GetZ() + GetRestZ();
    112     if (aZ >= 70)
    113       {
    114         C = 0.10;
    115       }
    116     else
    117       {
    118         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    119       }
    120     return 1.0 + C/2.0;
    121   }
     120G4double G4PreCompoundDeuteron::GetAlpha()
     121{
     122  G4double C = 0.0;
     123  G4double aZ = GetZ() + GetRestZ();
     124  if (aZ >= 70)
     125    {
     126      C = 0.10;
     127    }
     128  else
     129    {
     130      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     131    }
     132  return 1.0 + C/2.0;
     133}
    122134//
    123135//---------
    124136//
    125   G4double G4PreCompoundDeuteron::GetBeta()
    126   {
    127       return -GetCoulombBarrier();
    128   }
     137G4double G4PreCompoundDeuteron::GetBeta()
     138{
     139  return -GetCoulombBarrier();
     140}
    129141//
    130142//********************* OPT=1,2 : Chatterjee's cross section ************************
     
    140152
    141153  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    142 //G4double Eo(0),epsilon1(0),epsilon2(0),discri(0);
     154  //G4double Eo(0),epsilon1(0),epsilon2(0),discri(0);
    143155
    144156 
     
    174186}
    175187
    176 
    177 
    178 
    179188// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    180189G4double G4PreCompoundDeuteron::GetOpt34(const  G4double K)
     
    205214  G4double     ra=0.80;
    206215       
    207   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     216  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     217  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     218  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    208219  ecsq = ec * ec;
    209220  p = p0 + p1/ec + p2/ecsq;
     
    226237  elab = K * FragmentA / ResidualA;
    227238  sig = 0.;
    228  
     239
    229240  if (elab <= ec) { //start for E<Ec
    230     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     241    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    231242  }           //end for E<Ec
    232243  else {           //start for E>Ec
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundEmission.cc

    r1007 r1055  
    2525//
    2626//
    27 // Hadronic Process: Nuclear Preequilibrium
    28 // by V. Lara
    29 
     27// $Id: G4PreCompoundEmission.cc,v 1.19 2009/02/10 16:01:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundEmission
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40//
    3041
    3142#include "G4PreCompoundEmission.hh"
     
    4253
    4354
    44   G4bool G4PreCompoundEmission::operator==(const G4PreCompoundEmission &) const
     55G4bool G4PreCompoundEmission::operator==(const G4PreCompoundEmission &) const
    4556{
    4657  return false;
    4758}
    4859
    49     G4bool G4PreCompoundEmission::operator!=(const G4PreCompoundEmission &) const
     60G4bool G4PreCompoundEmission::operator!=(const G4PreCompoundEmission &) const
    5061{
    5162  return true;
     
    95106  return;
    96107}
    97 
    98 
    99108
    100109G4ReactionProduct * G4PreCompoundEmission::PerformEmission(G4Fragment & aFragment)
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragment.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J. M. Quesada (August 2008). 
    27 //Based  on previous work by V. Lara
     26// $Id: G4PreCompoundFragment.cc,v 1.8 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// J. M. Quesada (August 2008). 
     30// Based  on previous work by V. Lara
    2831// JMQ (06 September 2008) Also external choice has been added for:
    2932//                      - superimposed Coulomb barrier (if useSICB=true)
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragmentVector.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundFragmentVector.cc,v 1.7 2008/05/08 10:36:03 quesada Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PreCompoundFragmentVector.cc,v 1.11 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2928//
    3029// Hadronic Process: Nuclear Preequilibrium
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundHe3.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J.M.Quesada (August 08). New source file
    27 //
    28 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    29 // cross section option
     26//
     27// $Id: G4PreCompoundHe3.cc,v 1.5 2009/02/13 18:57:32 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundHe3
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 21.08.2008 J. M. Quesada add choice of options 
     41// 10.02.2009 J. M. Quesada set default opt1 
     42//
    3043 
    3144#include "G4PreCompoundHe3.hh"
    3245
    33 
    34   G4ReactionProduct * G4PreCompoundHe3::GetReactionProduct() const
    35   {
    36     G4ReactionProduct * theReactionProduct =
    37       new G4ReactionProduct(G4He3::He3Definition());
    38     theReactionProduct->SetMomentum(GetMomentum().vect());
    39     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     46G4ReactionProduct * G4PreCompoundHe3::GetReactionProduct() const
     47{
     48  G4ReactionProduct * theReactionProduct =
     49    new G4ReactionProduct(G4He3::He3Definition());
     50  theReactionProduct->SetMomentum(GetMomentum().vect());
     51  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    4052#ifdef PRECOMPOUND_TEST
    41     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     53  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4254#endif
    43     return theReactionProduct;
    44   }   
    45 
    46 
    47    G4double G4PreCompoundHe3::FactorialFactor(const G4double N, const G4double P)
    48   {
    49      return
     55  return theReactionProduct;
     56}   
     57
     58G4double G4PreCompoundHe3::FactorialFactor(const G4double N, const G4double P)
     59{
     60  return
    5061      (N-3.0)*(P-2.0)*(
    5162                       (((N-2.0)*(P-1.0))/2.0) *(
     
    5364                                                 )
    5465                       );
     66}
     67 
     68G4double G4PreCompoundHe3::CoalescenceFactor(const G4double A)
     69{
     70  return 243.0/(A*A);
     71}   
     72
     73G4double G4PreCompoundHe3::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     74{
     75  G4double rj = 0.0;
     76  G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
     77  if(NumberCharged >=2 && (NumberParticles-NumberCharged) >= 1) {
     78    rj = 3.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged))
     79      / static_cast<G4double>(denominator); 
    5580  }
    56  
    57   G4double G4PreCompoundHe3::CoalescenceFactor(const G4double A)
    58   {
    59          return 243.0/(A*A);
    60   }   
    61 
    62 
    63 
    64   G4double G4PreCompoundHe3::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    65   {
    66     G4double rj = 0.0;
    67     G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
    68     if(NumberCharged >=2 && (NumberParticles-NumberCharged) >= 1) rj = 3.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged))/static_cast<G4double>(denominator); 
    69    
    70     return rj;
    71   }
    72 
    73 
    74 
     81  return rj;
     82}
    7583
    7684////////////////////////////////////////////////////////////////////////////////////
     
    8088//OPT=3,4 Kalbach's parameterization
    8189//
    82  G4double G4PreCompoundHe3::CrossSection(const  G4double K)
     90G4double G4PreCompoundHe3::CrossSection(const  G4double K)
    8391{
    8492  ResidualA=GetRestA();
     
    114122//----------------
    115123//
    116   G4double G4PreCompoundHe3::GetAlpha()
    117   {
    118     G4double C = 0.0;
    119     G4double aZ = GetZ() + GetRestZ();
    120     if (aZ <= 30)
    121       {
    122         C = 0.10;
    123       }
    124     else if (aZ <= 50)
    125       {
    126         C = 0.1 + -((aZ-50.)/20.)*0.02;
    127       }
    128     else if (aZ < 70)
    129       {
    130         C = 0.08 + -((aZ-70.)/20.)*0.02;
    131       }
    132     else
    133       {
    134         C = 0.06;
    135       }
    136     return 1.0 + C*(4.0/3.0);
    137   }
     124G4double G4PreCompoundHe3::GetAlpha()
     125{
     126  G4double C = 0.0;
     127  G4double aZ = GetZ() + GetRestZ();
     128  if (aZ <= 30)
     129    {
     130      C = 0.10;
     131    }
     132  else if (aZ <= 50)
     133    {
     134      C = 0.1 + -((aZ-50.)/20.)*0.02;
     135    }
     136  else if (aZ < 70)
     137    {
     138      C = 0.08 + -((aZ-70.)/20.)*0.02;
     139    }
     140  else
     141    {
     142      C = 0.06;
     143    }
     144  return 1.0 + C*(4.0/3.0);
     145}
    138146//
    139147//--------------------
    140148//
    141    G4double G4PreCompoundHe3::GetBeta()
    142   {
    143       return -GetCoulombBarrier();
    144   }
     149G4double G4PreCompoundHe3::GetBeta()
     150{
     151  return -GetCoulombBarrier();
     152}
    145153//
    146154//********************* OPT=1,2 : Chatterjee's cross section ************************
     
    214222  G4double      ra=0.80;
    215223       
    216   ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     224  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     225  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     226  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    217227  ecsq = ec * ec;
    218228  p = p0 + p1/ec + p2/ecsq;
     
    237247 
    238248  if (elab <= ec) { //start for E<Ec
    239     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     249    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
    240250  }           //end for E<Ec
    241251  else {           //start for E>Ec
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundIon.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J. M. Quesada (August 2008). 
    27 //Based  on previous work by V. Lara
     26// $Id: G4PreCompoundIon.cc,v 1.16 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class file
     32//
     33//
     34// File name:     G4PreCompoundIon
     35//
     36// Author:         V.Lara
     37//
     38// Modified: 
     39// 10.02.2009 J. M. Quesada fixed bug in density level of light fragments 
    2840//
    2941
     
    3143#include "G4PreCompoundParameters.hh"
    3244
    33  G4bool G4PreCompoundIon::IsItPossible(const G4Fragment& aFragment)
    34   {
    35     G4int pplus = aFragment.GetNumberOfCharged();   
    36     G4int pneut = aFragment.GetNumberOfParticles()-pplus;
    37     return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
    38   }
     45G4bool G4PreCompoundIon::IsItPossible(const G4Fragment& aFragment)
     46{
     47  G4int pplus = aFragment.GetNumberOfCharged();   
     48  G4int pneut = aFragment.GetNumberOfParticles()-pplus;
     49  return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
     50}
    3951
    4052G4double G4PreCompoundIon::
     
    5769    G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    5870
    59   G4double gj = (6.0/pi2)*GetA() *
    60     G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     71  //JMQ 06/02/209  This is  THE BUG that was killing cluster emission
     72  // G4double gj = (6.0/pi2)*GetA() *
     73  //   G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     74
     75  G4double gj = g1;
    6176
    6277  G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
     
    7489  G4double Ej = std::max(0.0,eKin + GetBindingEnergy() -Aj);
    7590
    76 
    77  G4double pA = 1.e-25*(3.0/4.0) * std::sqrt(std::max(0.0, 2.0/(GetReducedMass()*
    78 (eKin+GetBindingEnergy()))))/(pi * r0 * r0 * std::pow(GetRestA(),2.0/3.0) )* eKin*CrossSection(eKin) /(r0*std::pow(GetRestA(),1.0/3.0)) * CoalescenceFactor(aFragment.GetA()) * FactorialFactor(N,P)* GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())  ;
     91  // JMQ 10/02/09 reshaping of the formula (unnecessary std::pow elimitated)
     92  G4double pA = (3.0/4.0) * std::sqrt(std::max(0.0, 2.0/(GetReducedMass()*
     93                (eKin+GetBindingEnergy()))))/(pi * r0 * r0 *r0* GetRestA())*
     94                eKin*CrossSection(eKin)*millibarn*
     95                CoalescenceFactor(aFragment.GetA()) * FactorialFactor(N,P)*
     96                GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged());
    7997
    8098  G4double pB = std::pow((g1*E1)/(g0*E0),N-GetA()-1.0)*(g1/g0);
     
    82100  G4double pC = std::pow((gj*Ej)/(g0*E0),GetA()-1.0)*(gj/g0)/E0;
    83101
    84 
    85102  G4double Probability = pA * pB * pC;
    86103
    87104  return Probability;
    88105}
    89 
    90 
    91 
    92 
    93 
    94 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundNeutron.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J. M. Quesada (August 2008). New source file
    27 //
    28 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    29 // cross section option
     26//
     27// $Id: G4PreCompoundNeutron.cc,v 1.4 2009/02/11 18:06:00 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundNeutron
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 21.08.2008 J. M. Quesada add choice of options 
     41// 10.02.2009 J. M. Quesada set default opt3
    3042//
     43
    3144#include "G4PreCompoundNeutron.hh"
    3245
    33 
    34   G4ReactionProduct * G4PreCompoundNeutron::GetReactionProduct() const
    35   {
    36     G4ReactionProduct * theReactionProduct =
    37       new G4ReactionProduct(G4Neutron::NeutronDefinition());
    38     theReactionProduct->SetMomentum(GetMomentum().vect());
    39     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     46G4ReactionProduct * G4PreCompoundNeutron::GetReactionProduct() const
     47{
     48  G4ReactionProduct * theReactionProduct =
     49    new G4ReactionProduct(G4Neutron::NeutronDefinition());
     50  theReactionProduct->SetMomentum(GetMomentum().vect());
     51  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    4052#ifdef PRECOMPOUND_TEST
    41     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     53  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4254#endif
    43     return theReactionProduct;
    44   }
    45 
    46 
    47    G4double G4PreCompoundNeutron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    48   {
    49     G4double rj = 0.0;
    50     if(NumberParticles > 0) rj = static_cast<G4double>(NumberParticles - NumberCharged)/static_cast<G4double>(NumberParticles);
    51     return rj;
    52   }
     55  return theReactionProduct;
     56}
     57
     58G4double G4PreCompoundNeutron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     59{
     60  G4double rj = 0.0;
     61  if(NumberParticles > 0) rj = static_cast<G4double>(NumberParticles - NumberCharged)/
     62                            static_cast<G4double>(NumberParticles);
     63  return rj;
     64}
    5365
    5466////////////////////////////////////////////////////////////////////////////////////
     
    5870//OPT=3,4 Kalbach's parameterization
    5971//
    60  G4double G4PreCompoundNeutron::CrossSection(const  G4double K)
     72G4double G4PreCompoundNeutron::CrossSection(const  G4double K)
    6173{
    6274  ResidualA=GetRestA();
     
    92104//-------
    93105//
    94   G4double G4PreCompoundNeutron::GetAlpha()
    95   {
    96  //   return 0.76+2.2/std::pow(GetRestA(),1.0/3.0);
     106G4double G4PreCompoundNeutron::GetAlpha()
     107{
     108  //   return 0.76+2.2/std::pow(GetRestA(),1.0/3.0);
    97109  return 0.76+2.2/ResidualAthrd;
    98   }
     110}
    99111//
    100112//------------
    101113//
    102   G4double G4PreCompoundNeutron::GetBeta()
    103   {
    104  //   return (2.12/std::pow(GetRestA(),2.0/3.0)-0.05)*MeV/GetAlpha();
    105  return (2.12/(ResidualAthrd*ResidualAthrd)-0.05)*MeV/GetAlpha();
    106   }
    107 //
    108 
    109  
    110 
     114G4double G4PreCompoundNeutron::GetBeta()
     115{
     116  //   return (2.12/std::pow(GetRestA(),2.0/3.0)-0.05)*MeV/GetAlpha();
     117  return (2.12/(ResidualAthrd*ResidualAthrd)-0.05)*MeV/GetAlpha();
     118}
     119//
    111120
    112121//********************* OPT=1,2 : Chatterjee's cross section ************************
     
    156165  G4double b,ecut,cut,ecut2,geom,elab;
    157166
    158 //safety initialization
     167  //safety initialization
    159168  landa0=0;
    160169  landa1=0;
     
    172181  spill= 1.0e+18;
    173182
    174 
    175 
    176 // PRECO xs for neutrons is choosen
     183  // PRECO xs for neutrons is choosen
    177184
    178185  p0 = -312.;
     
    201208  xnulam = 1.;
    202209  etest = 32.;
    203 //          ** etest is the energy above which the rxn cross section is
    204 //          ** compared with the geometrical limit and the max taken.
    205 //          ** xnulam here is a dummy value to be used later.
    206 
    207 
     210  //          ** etest is the energy above which the rxn cross section is
     211  //          ** compared with the geometrical limit and the max taken.
     212  //          ** xnulam here is a dummy value to be used later.
    208213
    209214  a = -2.*p*ec + landa - nu/ecsq;
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundNucleon.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J. M. Quesada (August 2008). 
    27 //Based  on previous work by V. Lara
     26//
     27// $Id: G4PreCompoundNucleon.cc,v 1.13 2009/02/11 18:06:00 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundNucleon
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 10.02.2009 J. M. Quesada cleanup
    2841//
    2942
     
    3245
    3346G4bool G4PreCompoundNucleon::IsItPossible(const G4Fragment& aFragment)
    34   {
    35     G4int pplus = aFragment.GetNumberOfCharged();   
    36     G4int pneut = aFragment.GetNumberOfParticles()-pplus;
    37     return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
    38   }
    39 
     47{
     48  G4int pplus = aFragment.GetNumberOfCharged();   
     49  G4int pneut = aFragment.GetNumberOfParticles()-pplus;
     50  return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
     51}
    4052
    4153G4double G4PreCompoundNucleon::
     
    4557  if ( !IsItPossible(aFragment) ) return 0.0;
    4658
    47 
    4859  G4double U = aFragment.GetExcitationEnergy();
    4960  G4double P = aFragment.GetNumberOfParticles();
     
    5162  G4double N = P + H;
    5263 
    53 
    54 
    5564  G4double g0 = (6.0/pi2)*aFragment.GetA() *
    5665    G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     
    5867  G4double g1 = (6.0/pi2)*GetRestA() *
    5968    G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    60 
    61 
    6269
    6370  G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
     
    7178
    7279
    73  G4double Probability =1.e-25* 1.0/pi2*2.0/(hbarc*hbarc*hbarc) * GetReducedMass()
    74 * GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())  * eKin*CrossSection(eKin) * P*(N-1.0) * std::pow(g1*E1/(g0*E0),N-2.0)/E0 * g1/(g0*g0);
     80  G4double Probability = 1.0/pi2*2.0/(hbarc*hbarc*hbarc) * GetReducedMass()
     81    * GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged()) 
     82    * eKin*CrossSection(eKin)*millibarn * P*(N-1.0) * std::pow(g1*E1/(g0*E0),N-2.0)/E0 * g1/(g0*g0);
    7583
    76 
    77 if (GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())<0.0 || CrossSection(eKin) <0)
    78 {  std::ostringstream errOs;
    79    G4cout<<"WARNING:  NEGATIVE VALUES "<<G4endl;     
    80         errOs << "Rj=" << GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())<<G4endl;
    81         errOs <<"  xsec("<<eKin<<" MeV) ="<<CrossSection(eKin)<<G4endl;
    82         errOs <<"  A="<<GetA()<<"  Z="<<GetZ()<<G4endl;
    83         throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    84               }
     84  if (GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())<0.0
     85      || CrossSection(eKin) <0) { 
     86    std::ostringstream errOs;
     87    G4cout<<"WARNING:  NEGATIVE VALUES "<<G4endl;     
     88    errOs << "Rj=" << GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())
     89          <<G4endl;
     90    errOs <<"  xsec("<<eKin<<" MeV) ="<<CrossSection(eKin)<<G4endl;
     91    errOs <<"  A="<<GetA()<<"  Z="<<GetZ()<<G4endl;
     92    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     93  }
    8594
    8695  return Probability;
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundProton.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //J.M.Quesada (August 08). New source file
    27 //
    28 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    29 // cross section option
    30 //
    31 // JMQ (06 September 2008) Also external choice has been added for:
    32 //                      - superimposed Coulomb barrier (if useSICB=true)
     26//
     27// $Id: G4PreCompoundProton.cc,v 1.4 2009/02/11 18:06:00 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundProton
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 21.08.2008 J. M. Quesada added external choice of inverse cross section option
     41// 21.08.2008 J. M. Quesada added external choice for superimposed Coulomb barrier
     42//                          (if useSICB=true)
     43//
    3344
    3445#include "G4PreCompoundProton.hh"
    3546
    36   G4ReactionProduct * G4PreCompoundProton::GetReactionProduct() const
    37   {
    38     G4ReactionProduct * theReactionProduct =
    39       new G4ReactionProduct(G4Proton::ProtonDefinition());
    40     theReactionProduct->SetMomentum(GetMomentum().vect());
    41     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     47G4ReactionProduct * G4PreCompoundProton::GetReactionProduct() const
     48{
     49  G4ReactionProduct * theReactionProduct =
     50    new G4ReactionProduct(G4Proton::ProtonDefinition());
     51  theReactionProduct->SetMomentum(GetMomentum().vect());
     52  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    4253#ifdef PRECOMPOUND_TEST
    43     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     54  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4455#endif
    45     return theReactionProduct;
    46   }
    47 
    48 
    49    G4double G4PreCompoundProton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    50   {
    51     G4double rj = 0.0;
    52     if(NumberParticles > 0) rj = static_cast<G4double>(NumberCharged)/static_cast<G4double>(NumberParticles);
    53     return rj;
    54   }
    55 
    56 
     56  return theReactionProduct;
     57}
     58
     59G4double G4PreCompoundProton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     60{
     61  G4double rj = 0.0;
     62  if(NumberParticles > 0) rj = static_cast<G4double>(NumberCharged)/static_cast<G4double>(NumberParticles);
     63  return rj;
     64}
    5765
    5866////////////////////////////////////////////////////////////////////////////////////
     
    6371//OPT=3 Kalbach's parameterization
    6472//
    65  G4double G4PreCompoundProton::CrossSection(const  G4double K)
     73G4double G4PreCompoundProton::CrossSection(const  G4double K)
    6674{
    6775  //G4cout<<" In G4PreCompoundProton OPTxs="<<OPTxs<<G4endl;
     
    7583  FragmentA=GetA()+GetRestA();
    7684  FragmentAthrd=std::pow(FragmentA,0.33333);
    77 
    78 
    7985
    8086  if (OPTxs==0) return GetOpt0(K);
     
    94100G4double G4PreCompoundProton::GetOpt0(const  G4double K)
    95101{
    96 const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
     102  const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    97103  // cross section is now given in mb (r0 is in mm) for the sake of consistency
    98104  //with the rest of the options
    99  return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
     105  return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    100106}
    101107//
    102108//------------
    103109//
    104   G4double G4PreCompoundProton::GetAlpha()
    105   {
    106  G4double aZ = static_cast<G4double>(GetRestZ());
    107     G4double C = 0.0;
    108     if (aZ >= 70)
    109       {
    110         C = 0.10;
    111       }
    112     else
    113       {
    114         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    115       }
    116     return 1.0 + C;
    117   }
     110G4double G4PreCompoundProton::GetAlpha()
     111{
     112  G4double aZ = static_cast<G4double>(GetRestZ());
     113  G4double C = 0.0;
     114  if (aZ >= 70)
     115    {
     116      C = 0.10;
     117    }
     118  else
     119    {
     120      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     121    }
     122  return 1.0 + C;
     123}
    118124//
    119125//-------------------
    120126// 
    121   G4double G4PreCompoundProton::GetBeta()
    122   {
     127G4double G4PreCompoundProton::GetBeta()
     128{
    123129  return -GetCoulombBarrier();
    124   }
    125 //
    126  
    127 
    128 
     130}
     131//
     132 
    129133//********************* OPT=1 : Chatterjee's cross section ************************
    130134//(fitting to cross section from Bechetti & Greenles OM potential)
     
    132136G4double G4PreCompoundProton::GetOpt1(const  G4double K)
    133137{
    134  G4double Kc=K;
    135 
    136 // JMQ  xsec is set constat above limit of validity
    137  if (K>50)  Kc=50;
    138 
    139  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
    140  G4double p, p0, p1, p2,Ec,delta,q,r,ji;
    141  
    142  p0 = 15.72;
    143  p1 = 9.65;
    144  p2 = -449.0;
    145  landa0 = 0.00437;
    146  landa1 = -16.58;
    147  mu0 = 244.7;
    148  mu1 = 0.503;
    149  nu0 = 273.1;
    150  nu1 = -182.4;
    151  nu2 = -1.872; 
    152  delta=0.; 
    153 
    154  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    155  p = p0 + p1/Ec + p2/(Ec*Ec);
    156  landa = landa0*ResidualA + landa1;
    157  mu = mu0*std::pow(ResidualA,mu1);
    158  nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    159  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    160  r = mu + 2*nu/Ec + p*(Ec*Ec);
    161 
    162  ji=std::max(Kc,Ec);
    163  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    164  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    165  if (xs <0.0) {xs=0.0;}
    166 
    167  return xs;
    168 
    169 }
    170 
    171 
     138  G4double Kc=K;
     139
     140  // JMQ  xsec is set constat above limit of validity
     141  if (K>50)  Kc=50;
     142
     143  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
     144  G4double p, p0, p1, p2,Ec,delta,q,r,ji;
     145 
     146  p0 = 15.72;
     147  p1 = 9.65;
     148  p2 = -449.0;
     149  landa0 = 0.00437;
     150  landa1 = -16.58;
     151  mu0 = 244.7;
     152  mu1 = 0.503;
     153  nu0 = 273.1;
     154  nu1 = -182.4;
     155  nu2 = -1.872; 
     156  delta=0.; 
     157
     158  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
     159  p = p0 + p1/Ec + p2/(Ec*Ec);
     160  landa = landa0*ResidualA + landa1;
     161  mu = mu0*std::pow(ResidualA,mu1);
     162  nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     163  q = landa - nu/(Ec*Ec) - 2*p*Ec;
     164  r = mu + 2*nu/Ec + p*(Ec*Ec);
     165
     166  ji=std::max(Kc,Ec);
     167  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
     168  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
     169  if (xs <0.0) {xs=0.0;}
     170
     171  return xs;
     172
     173}
    172174
    173175//************* OPT=2 : Welisch's proton reaction cross section ************************
     
    178180  G4double rnpro,rnneu,eekin,ekin,ff1,ff2,ff3,r0,fac,fac1,fac2,b0,xine_th(0);
    179181 
    180 //This is redundant when the Coulomb  barrier is overimposed to all cross sections
    181 //It should be kept when Coulomb barrier only imposed at OPTxs=2
     182  //This is redundant when the Coulomb  barrier is overimposed to all cross sections
     183  //It should be kept when Coulomb barrier only imposed at OPTxs=2
    182184
    183185  if(!useSICB && K<=theCoulombBarrier) return xine_th=0.0;
     
    316318  }   //end for E>Ec
    317319
    318   return sig;}
    319 
    320 
     320  return sig;
     321}
    321322
    322323//   ************************** end of cross sections *******************************
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundTransitions.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 //
    27 //J. M. Quesada (Feb. 08). Base on previous work by V. Lara.
    28 // New transition probabilities. Several bugs fixed.
    29 // JMQ (06 September 2008) Also external choices have been added for:
     26// $Id: G4PreCompoundTransitions.cc,v 1.20 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class file
     32//
     33//
     34// File name:     G4PreCompoundIon
     35//
     36// Author:         V.Lara
     37//
     38// Modified: 
     39// 16.02.2008 J. M. Quesada fixed bugs
     40// 06.09.2008 J. M. Quesada added external choices for:
    3041//                      - "never go back"  hipothesis (useNGB=true)
    3142//                      -  CEM transition probabilities (useCEMtr=true)
     43
    3244#include "G4PreCompoundTransitions.hh"
    3345#include "G4HadronicException.hh"
     
    184196    //  G4cout<<"N="<<N<<"  P="<<P<<"  H="<<H<<G4endl;
    185197    //  G4cout<<"l+ ="<<TransitionProb1<<"  l- ="<< TransitionProb2<<"  l0 ="<< TransitionProb3<<G4endl;
    186     return TransitionProb1 + TransitionProb2 + TransitionProb3;}
     198    return TransitionProb1 + TransitionProb2 + TransitionProb3;
     199  }
    187200 
    188201  else  {
     
    215228    return TransitionProb1 + TransitionProb2 + TransitionProb3;
    216229  }
    217 
    218 
    219230}
    220231
     
    237248    }
    238249
    239   // AH/JMQ: Randomly decrease the number of charges if deltaN is -2 and in proportion to the number charges w.r.t. number of particles,  PROVIDED that there are charged particles
    240   if(deltaN < 0 && G4UniformRand() <= static_cast<G4double>(result.GetNumberOfCharged())/static_cast<G4double>(result.GetNumberOfParticles()) && (result.GetNumberOfCharged() >= 1))
     250  // AH/JMQ: Randomly decrease the number of charges if deltaN is -2 and in proportion
     251  // to the number charges w.r.t. number of particles,  PROVIDED that there are charged particles
     252  if(deltaN < 0 && G4UniformRand() <=
     253     static_cast<G4double>(result.GetNumberOfCharged())/static_cast<G4double>(result.GetNumberOfParticles())
     254     && (result.GetNumberOfCharged() >= 1)) {
    241255    result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2); // deltaN is negative!
    242 
    243 
    244  //JMQ the following lines have to be before SetNumberOfCharged, otherwise the check on number of charged vs. number of particles fails
     256  }
     257
     258  // JMQ the following lines have to be before SetNumberOfCharged, otherwise the check on
     259  // number of charged vs. number of particles fails
    245260  result.SetNumberOfParticles(result.GetNumberOfParticles()+deltaN/2);
    246261  result.SetNumberOfHoles(result.GetNumberOfHoles()+deltaN/2);
    247262
    248  // With weight Z/A, number of charged particles is increased with +1
     263  // With weight Z/A, number of charged particles is increased with +1
    249264  if ( ( deltaN > 0 ) &&
    250265      (G4UniformRand() <= static_cast<G4double>(result.GetZ()-result.GetNumberOfCharged())/
    251                   std::max(static_cast<G4double>(result.GetA()-Nexcitons),1.)))
     266       std::max(static_cast<G4double>(result.GetA()-Nexcitons),1.)))
    252267    {
    253268      result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2);
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundTriton.cc

    r1007 r1055  
    2525//
    2626//
    27 //J.M.Quesada (August 08). New source file
    28 //
    29 // Modif (21 August 2008) by J. M. Quesada for external choice of inverse
    30 // cross section option
     27// $Id: G4PreCompoundTriton.cc,v 1.5 2009/02/13 18:57:32 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     29//
     30// -------------------------------------------------------------------
     31//
     32// GEANT4 Class file
     33//
     34//
     35// File name:     G4PreCompoundTriton
     36//
     37// Author:         V.Lara
     38//
     39// Modified: 
     40// 21.08.2008 J. M. Quesada add choice of options 
     41// 10.02.2009 J. M. Quesada set default opt1 
     42//
    3143 
    3244#include "G4PreCompoundTriton.hh"
    3345
    3446
    35   G4ReactionProduct * G4PreCompoundTriton::GetReactionProduct() const
    36   {
    37     G4ReactionProduct * theReactionProduct =
    38       new G4ReactionProduct(G4Triton::TritonDefinition());
    39     theReactionProduct->SetMomentum(GetMomentum().vect());
    40     theReactionProduct->SetTotalEnergy(GetMomentum().e());
     47G4ReactionProduct * G4PreCompoundTriton::GetReactionProduct() const
     48{
     49  G4ReactionProduct * theReactionProduct =
     50    new G4ReactionProduct(G4Triton::TritonDefinition());
     51  theReactionProduct->SetMomentum(GetMomentum().vect());
     52  theReactionProduct->SetTotalEnergy(GetMomentum().e());
    4153#ifdef PRECOMPOUND_TEST
    42     theReactionProduct->SetCreatorModel("G4PrecompoundModel");
     54  theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    4355#endif
    44     return theReactionProduct;
    45   }   
    46 
    47    G4double G4PreCompoundTriton::FactorialFactor(const G4double N, const G4double P)
    48   {
    49       return
     56  return theReactionProduct;
     57}   
     58
     59G4double G4PreCompoundTriton::FactorialFactor(const G4double N, const G4double P)
     60{
     61  return
    5062      (N-3.0)*(P-2.0)*(
    5163                       (((N-2.0)*(P-1.0))/2.0) *(
     
    5365                                                 )
    5466                       );
     67}
     68 
     69G4double G4PreCompoundTriton::CoalescenceFactor(const G4double A)
     70{
     71  return 243.0/(A*A);
     72}   
     73
     74G4double G4PreCompoundTriton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     75{
     76  G4double rj = 0.0;
     77  G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
     78  if(NumberCharged >= 1 && (NumberParticles-NumberCharged) >= 2) {
     79    rj = 3.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged)*(NumberParticles-NumberCharged-1))
     80      /static_cast<G4double>(denominator);
    5581  }
    56  
    57    G4double G4PreCompoundTriton::CoalescenceFactor(const G4double A)
    58   {
    59      return 243.0/(A*A);
    60   }   
    61 
    62 
    63    G4double G4PreCompoundTriton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
    64   {
    65     G4double rj = 0.0;
    66     G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
    67     if(NumberCharged >= 1 && (NumberParticles-NumberCharged) >= 2) rj = 3.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged)*(NumberParticles-NumberCharged-1))/static_cast<G4double>(denominator);
    68     return rj;
    69   }
    70 
    71 
    72 
     82  return rj;
     83}
    7384
    7485////////////////////////////////////////////////////////////////////////////////////
     
    7889//OPT=3,4 Kalbach's parameterization
    7990//
    80  G4double G4PreCompoundTriton::CrossSection(const  G4double K)
     91G4double G4PreCompoundTriton::CrossSection(const  G4double K)
    8192{
    8293  ResidualA=GetRestA();
     
    111122//---------
    112123//
    113   G4double G4PreCompoundTriton::GetAlpha()
    114   {
    115     G4double C = 0.0;
    116     G4double aZ = GetZ() + GetRestZ();
    117     if (aZ >= 70)
    118       {
    119         C = 0.10;
    120       }
    121     else
    122       {
    123         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    124       }
    125  
    126     return 1.0 + C/3.0;
    127   }
     124G4double G4PreCompoundTriton::GetAlpha()
     125{
     126  G4double C = 0.0;
     127  G4double aZ = GetZ() + GetRestZ();
     128  if (aZ >= 70)
     129    {
     130      C = 0.10;
     131    }
     132  else
     133    {
     134      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     135    }
     136 
     137  return 1.0 + C/3.0;
     138}
    128139//
    129140//-------------
    130141//
    131    G4double G4PreCompoundTriton::GetBeta()
    132   {
    133       return -GetCoulombBarrier();
    134   }
     142G4double G4PreCompoundTriton::GetBeta()
     143{
     144  return -GetCoulombBarrier();
     145}
    135146//
    136147//********************* OPT=1,2 : Chatterjee's cross section ************************
     
    183194
    184195  G4double landa, mu, nu, p , signor(1.),sig;
    185 G4double ec,ecsq,xnulam,etest(0.),a;
    186 G4double b,ecut,cut,ecut2,geom,elab;
    187 
    188 
    189  G4double     flow = 1.e-18;
    190  G4double     spill= 1.e+18;
    191 
    192 
    193  G4double     p0 = -21.45;
    194  G4double     p1 = 484.7;
    195  G4double     p2 = -1608.;
    196  G4double     landa0 = 0.0186;
    197  G4double     landa1 = -8.90;
    198  G4double     mu0 = 686.3;
    199  G4double     mu1 = 0.325;
    200  G4double     nu0 = 368.9;
    201  G4double     nu1 = -522.2;
    202  G4double     nu2 = -4.998; 
     196  G4double ec,ecsq,xnulam,etest(0.),a;
     197  G4double b,ecut,cut,ecut2,geom,elab;
     198
     199
     200  G4double     flow = 1.e-18;
     201  G4double     spill= 1.e+18;
     202
     203
     204  G4double     p0 = -21.45;
     205  G4double     p1 = 484.7;
     206  G4double     p2 = -1608.;
     207  G4double     landa0 = 0.0186;
     208  G4double     landa1 = -8.90;
     209  G4double     mu0 = 686.3;
     210  G4double     mu1 = 0.325;
     211  G4double     nu0 = 368.9;
     212  G4double     nu1 = -522.2;
     213  G4double     nu2 = -4.998; 
    203214 
    204  G4double      ra=0.80;
     215  G4double      ra=0.80;
    205216       
    206  ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
    207  ecsq = ec * ec;
    208  p = p0 + p1/ec + p2/ecsq;
    209  landa = landa0*ResidualA + landa1;
    210  a = std::pow(ResidualA,mu1);
    211  mu = mu0 * a;
    212  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    213  xnulam = nu / landa;
    214  if (xnulam > spill) xnulam=0.;
    215  if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
    216  
    217  a = -2.*p*ec + landa - nu/ecsq;
    218  b = p*ecsq + mu + 2.*nu/ec;
    219  ecut = 0.;
    220  cut = a*a - 4.*p*b;
    221  if (cut > 0.) ecut = std::sqrt(cut);
    222  ecut = (ecut-a) / (p+p);
    223  ecut2 = ecut;
    224  if (cut < 0.) ecut2 = ecut - 2.;
    225  elab = K * FragmentA / ResidualA;
    226  sig = 0.;
    227  
    228  if (elab <= ec) { //start for E<Ec
    229    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
    230  }           //end for E<Ec
    231  else {           //start for E>Ec
    232    sig = (landa*elab+mu+nu/elab) * signor;
    233    geom = 0.;
    234    if (xnulam < flow || elab < etest) return sig;
    235    geom = std::sqrt(theA*K);
    236    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
    237    geom = 31.416 * geom * geom;
    238    sig = std::max(geom,sig);
    239  }           //end for E>Ec
    240  return sig;
     217  //JMQ 13/02/09 increase of reduced radius to lower the barrier
     218  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     219  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
     220  ecsq = ec * ec;
     221  p = p0 + p1/ec + p2/ecsq;
     222  landa = landa0*ResidualA + landa1;
     223  a = std::pow(ResidualA,mu1);
     224  mu = mu0 * a;
     225  nu = a* (nu0+nu1*ec+nu2*ecsq); 
     226  xnulam = nu / landa;
     227  if (xnulam > spill) xnulam=0.;
     228  if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     229 
     230  a = -2.*p*ec + landa - nu/ecsq;
     231  b = p*ecsq + mu + 2.*nu/ec;
     232  ecut = 0.;
     233  cut = a*a - 4.*p*b;
     234  if (cut > 0.) ecut = std::sqrt(cut);
     235  ecut = (ecut-a) / (p+p);
     236  ecut2 = ecut;
     237  if (cut < 0.) ecut2 = ecut - 2.;
     238  elab = K * FragmentA / ResidualA;
     239  sig = 0.;
     240 
     241  if (elab <= ec) { //start for E<Ec
     242    if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     243  }           //end for E<Ec
     244  else {           //start for E>Ec
     245    sig = (landa*elab+mu+nu/elab) * signor;
     246    geom = 0.;
     247    if (xnulam < flow || elab < etest) return sig;
     248    geom = std::sqrt(theA*K);
     249    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     250    geom = 31.416 * geom * geom;
     251    sig = std::max(geom,sig);
     252  }           //end for E>Ec
     253  return sig;
    241254
    242255}
    243256
    244257//   ************************** end of cross sections *******************************
    245 
    246 
    247 
    248 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4VPreCompoundFragment.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4VPreCompoundFragment.cc,v 1.12 2009/02/10 16:01:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2628//
    27 //J. M. Quesada (August 2008). 
    28 //Based  on previous work by V. Lara
     29// J. M. Quesada (August 2008). 
     30// Based  on previous work by V. Lara
    2931//
    3032 
  • trunk/source/processes/hadronic/models/qmd/GNUmakefile

    r819 r1055  
    1 # $Id: GNUmakefile,v 1.1 2007/11/17 16:27:35 dennis Exp $
     1# $Id: GNUmakefile,v 1.2 2008/11/22 06:30:46 tkoi Exp $
    22# -----------------------------------------------------------
    33# GNUmakefile for hadronic library.  Gabriele Cosmo, 18/9/96.
     
    2727            -I$(G4BASE)/processes/hadronic/models/management/include \
    2828            -I$(G4BASE)/processes/hadronic/models/util/include \
     29            -I$(G4BASE)/processes/hadronic/models/theo_high_energy/include \
     30            -I$(G4BASE)/processes/hadronic/models/binary_cascade/include \
    2931            -I$(G4BASE)/processes/hadronic/models/im_r_matrix/include \
     32            -I$(G4BASE)/processes/hadronic/models/chiral_inv_phase_space/interface/include \
     33            -I$(G4BASE)/processes/hadronic/models/chiral_inv_phase_space/body/include \
     34            -I$(G4BASE)/processes/hadronic/models/parton_string/qgsm/include \
     35            -I$(G4BASE)/processes/hadronic/models/parton_string/diffraction/include \
     36            -I$(G4BASE)/processes/hadronic/models/parton_string/hadronization/include \
     37            -I$(G4BASE)/processes/hadronic/models/parton_string/management/include \
    3038            -I$(G4BASE)/processes/hadronic/models/de_excitation/util/include \
    3139            -I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include \
  • trunk/source/processes/hadronic/models/qmd/History

    r962 r1055  
    1313     * Please list in reverse chronological order (last date on top)
    1414     ---------------------------------------------------------------
     15
     1631-March-2009 Tatsumi Koi (hadr-qmd-V09-02-01)
     17- Fix bug in gamma(mass zero) partiticpants
     18        src/G4QMDCollision.cc 
     19- Chnage meber object to pointer
     20        include/G4QMDReaction.hh 
     21        src/G4QMDReaction.cc 
     22
     2328-February-2009 Tatsumi Koi (hadr-qmd-V09-02-00)
     24- Fix bug in Absorption
     25        src/G4QMDCollision.cc 
     26- Add Be8 -> Alpha Alpha including opening angle by Q value 
     27        src/G4QMDReaction.cc 
    1528
    162920-November-2008 Tatsumi Koi (hadr-qmd-V09-01-08)
  • trunk/source/processes/hadronic/models/qmd/include/G4QMDReaction.hh

    r962 r1055  
    2828//
    2929//
    30 //      File name:    G4QMDReaction.hh
     30//      File name: G4QMDReaction.hh
    3131//
    3232//      Author: Koi, Tatsumi (tkoi@slac.stanford.edu)       
     
    3737// 081107 Add UnUseGEM (then use the default channel of G4Evaporation)
    3838//            UseFrag (chage criterion of a inelastic reaction)
     39// 090331 Change member shenXS and genspaXS object to pointer
    3940//
    4041
     
    7071      void UseFRAG(){ frag = true; };
    7172
     73      void EnableFermiG(){ heg = true; setHighEnergyModel(); };
     74
    7275   private:
    7376
    7477      void setEvaporationCh();
     78      void setHighEnergyModel();
    7579
    7680      G4QMDMeanField* meanField;
     
    107111      G4double coulomb_collision_pz_targ;
    108112
    109       G4IonsShenCrossSection shenXS;
    110       G4IonsShenCrossSection genspaXS;
     113//090331
     114      G4IonsShenCrossSection* shenXS;
     115      G4GeneralSpaceNNCrossSection* genspaXS;
    111116
    112117      G4bool gem;
    113118      G4bool frag;
     119      G4bool heg;
    114120
    115121};
  • trunk/source/processes/hadronic/models/qmd/src/G4QMDCollision.cc

    r962 r1055  
    2828//        Add several required updating of Mean Filed
    2929//        Modified handling of absorption case by T. Koi
     30// 090126 Fix in absorption case by T. Koi 
     31// 090331 Fix for gamma participant by T. Koi
    3032//
    3133#include "G4QMDCollision.hh"
    32 #include "G4ParticleDefinition.hh"
    3334#include "G4Scatterer.hh"
    3435#include "Randomize.hh"
     
    260261      G4double rmi =  theSystem->GetParticipant( i )->GetMass();
    261262      G4ParticleDefinition* pdi =  theSystem->GetParticipant( i )->GetDefinition();
     263//090331 gamma
     264      if ( pdi->GetPDGMass() == 0.0 ) continue;
    262265
    263266      //std::cout << " p4i00 " << p4i << std::endl;
     
    295298         G4double rmj =  theSystem->GetParticipant( j )->GetMass();
    296299         G4ParticleDefinition* pdj =  theSystem->GetParticipant( j )->GetDefinition();
     300//090331 gamma
     301         if ( pdj->GetPDGMass() == 0.0 ) continue;
    297302
    298303         G4double rr2 = theMeanField->GetRR2( i , j );
     
    332337         G4double pidr = p4i.vect()*dr;
    333338         G4double pjdr = p4j.vect()*dr;
    334  
     339
    335340         G4double aij = 1.0 - ( rmi*rmj /pij ) * ( rmi*rmj /pij );
    336341         G4double bij = pidr / rmi - pjdr*rmi/pij;
     
    660665      else
    661666      {
    662          if ( theMeanField->IsPauliBlocked ( i ) == false )
     667         //if ( theMeanField->IsPauliBlocked ( i ) == false )
     668         //090126                            i-1 cause jth is erased
     669         if ( theMeanField->IsPauliBlocked ( i-1 ) == false )
    663670         {
    664671            //G4cout << "Absorption Happen " << theSystem->GetTotalNumberOfParticipant() << G4endl;
  • trunk/source/processes/hadronic/models/qmd/src/G4QMDReaction.cc

    r962 r1055  
    3131//            UseFrag (chage criterion of a inelastic reaction)
    3232//        Fix bug in nucleon projectiles  by T. Koi   
     33// 090122 Be8 -> Alpha + Alpha
     34// 090331 Change member shenXS and genspaXS object to pointer
    3335//
    3436#include "G4QMDReaction.hh"
     
    4547, frag ( false )
    4648{
     49
     50   //090331
     51   shenXS = new G4IonsShenCrossSection();
     52   //genspaXS = new G4GeneralSpaceNNCrossSection();
    4753   meanField = new G4QMDMeanField();
    4854   collision = new G4QMDCollision();
     
    99105     G4double aTemp = projectile.GetMaterial()->GetTemperature();
    100106
    101      //G4double xs_0 = shenXS.GetCrossSection ( proj_dp , targ_ele , aTemp );
    102      G4double xs_0 = genspaXS.GetCrossSection ( proj_dp , targ_ele , aTemp );
     107     //090331
     108     G4double xs_0 = shenXS->GetCrossSection ( proj_dp , targ_ele , aTemp );
     109     //G4double xs_0 = genspaXS->GetCrossSection ( proj_dp , targ_ele , aTemp );
    103110     G4double bmax_0 = std::sqrt( xs_0 / pi );
    104111     //std::cout << "bmax_0 in fm (fermi) " <<  bmax_0/fermi << std::endl;
     
    470477          // Secondary from this nucleus (*it)
    471478          G4ParticleDefinition* pd = (*itt)->GetDefinition();
     479
    472480          G4LorentzVector p4 ( (*itt)->GetMomentum()/GeV , (*itt)->GetTotalEnergy()/GeV );  //in nucleus(*it) rest system
    473481          G4LorentzVector p4_CM = CLHEP::boostOf( p4 , -nucleus_p4CM.findBoostToCM() );  // Back to CM
    474482          G4LorentzVector p4_LAB = CLHEP::boostOf( p4_CM , boostBackToLAB ); // Back to LAB 
    475483
    476           G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV ); 
    477           theParticleChange.AddSecondary( dp );
     484
     485//090122
     486          //theParticleChange.AddSecondary( dp );
     487          if ( !( pd->GetAtomicNumber() == 4 && pd->GetAtomicMass() == 8 ) )
     488          {
     489             G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV ); 
     490             theParticleChange.AddSecondary( dp );
     491          }
     492          else
     493          {
     494             //Be8 -> Alpha + Alpha + Q
     495             G4ThreeVector randomized_direction( G4UniformRand() , G4UniformRand() , G4UniformRand() );
     496             randomized_direction = randomized_direction.unit();
     497             G4double q_decay = (*itt)->GetMass() - 2*G4Alpha::Alpha()->GetPDGMass();
     498             G4double p_decay = std::sqrt ( std::pow(G4Alpha::Alpha()->GetPDGMass()+q_decay/2,2) - std::pow(G4Alpha::Alpha()->GetPDGMass() , 2 ) );
     499             G4LorentzVector p4_a1 ( p_decay*randomized_direction , G4Alpha::Alpha()->GetPDGMass()+q_decay/2 );  //in Be8 rest system
     500             
     501             G4LorentzVector p4_a1_Be8 = CLHEP::boostOf ( p4_a1/GeV , -p4.findBoostToCM() );
     502             G4LorentzVector p4_a1_CM = CLHEP::boostOf ( p4_a1_Be8 , -nucleus_p4CM.findBoostToCM() );
     503             G4LorentzVector p4_a1_LAB = CLHEP::boostOf ( p4_a1_CM , boostBackToLAB );
     504
     505             G4LorentzVector p4_a2 ( -p_decay*randomized_direction , G4Alpha::Alpha()->GetPDGMass()+q_decay/2 );  //in Be8 rest system
     506             
     507             G4LorentzVector p4_a2_Be8 = CLHEP::boostOf ( p4_a2/GeV , -p4.findBoostToCM() );
     508             G4LorentzVector p4_a2_CM = CLHEP::boostOf ( p4_a2_Be8 , -nucleus_p4CM.findBoostToCM() );
     509             G4LorentzVector p4_a2_LAB = CLHEP::boostOf ( p4_a2_CM , boostBackToLAB );
     510             
     511             G4DynamicParticle* dp1 = new G4DynamicParticle( G4Alpha::Alpha() , p4_a1_LAB*GeV ); 
     512             G4DynamicParticle* dp2 = new G4DynamicParticle( G4Alpha::Alpha() , p4_a2_LAB*GeV ); 
     513             theParticleChange.AddSecondary( dp1 );
     514             theParticleChange.AddSecondary( dp2 );
     515          }
     516//090122
    478517
    479518/*
     
    698737
    699738}
    700 
  • trunk/source/processes/hadronic/models/rpg/History

    r962 r1055  
    1515   ---------------------------------------------------------------
    1616
     1725 May 2009 - Dennis Wright (hadr-rpg-V09-02-00)
     18------------------------------------------------
     19G4RPGInelastic:  fix MAC complaint about initialization order:
     20   remove static array of G4ParticleDefinition pointers and
     21   replace with local array
     22 
    1723 9 June 2008 - Dennis Wright (hadr-rpg-V09-01-03)
    1824-------------------------------------------------
  • trunk/source/processes/hadronic/models/rpg/include/G4RPGInelastic.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGInelastic.hh,v 1.3 2008/02/22 22:17:25 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGInelastic.hh,v 1.4 2009/05/25 19:06:59 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: D. H. Wright
     
    5555 public:  // with description
    5656   
    57    G4RPGInelastic(const G4String& modelName = "RPGInelastic")
    58     : G4HadronicInteraction(modelName)
    59    { cache = 0.0;}
     57   G4RPGInelastic(const G4String& modelName = "RPGInelastic");
    6058   
    6159   virtual ~G4RPGInelastic()
     
    124122         lam, sp, s0, sm, xi0, xim, om, ap, an};
    125123
    126    static G4ParticleDefinition* particleDef[18];
     124 protected:
     125
     126   G4ParticleDefinition* particleDef[18];
    127127
    128128 private:
  • trunk/source/processes/hadronic/models/rpg/include/G4RPGNucleonInelastic.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGNucleonInelastic.hh,v 1.1 2008/01/04 23:27:45 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGNucleonInelastic.hh,v 1.2 2009/05/25 19:05:19 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: D. H. Wright
     
    4848   
    4949   ~G4RPGNucleonInelastic() { }
     50
     51   //   void printCrossSections() const;
    5052   
    5153 protected:
  • trunk/source/processes/hadronic/models/rpg/include/G4RPGPionInelastic.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGPionInelastic.hh,v 1.1 2008/01/05 00:14:03 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGPionInelastic.hh,v 1.2 2009/05/25 19:05:34 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: D. H. Wright
     
    4848   
    4949   ~G4RPGPionInelastic() { }
     50
     51   //   void printCrossSections() const;
    5052   
    5153 protected:
  • trunk/source/processes/hadronic/models/rpg/src/G4RPGInelastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGInelastic.cc,v 1.6 2008/03/22 00:03:24 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGInelastic.cc,v 1.7 2009/05/25 19:07:15 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929
     
    3434#include "G4RPGTwoBody.hh"
    3535
    36  
     36
     37G4RPGInelastic::G4RPGInelastic(const G4String& modelName)
     38  : G4HadronicInteraction(modelName)
     39{
     40  cache = 0.0;
     41  particleDef[0] = G4PionZero::PionZero();
     42  particleDef[1] = G4PionPlus::PionPlus();
     43  particleDef[2] = G4PionMinus::PionMinus();
     44  particleDef[3] = G4KaonPlus::KaonPlus();
     45  particleDef[4] = G4KaonMinus::KaonMinus();
     46  particleDef[5] = G4KaonZero::KaonZero();
     47  particleDef[6] = G4AntiKaonZero::AntiKaonZero();
     48  particleDef[7] = G4Proton::Proton();
     49  particleDef[8] = G4Neutron::Neutron();
     50  particleDef[9] = G4Lambda::Lambda();
     51  particleDef[10] = G4SigmaPlus::SigmaPlus();
     52  particleDef[11] = G4SigmaZero::SigmaZero();
     53  particleDef[12] = G4SigmaMinus::SigmaMinus();
     54  particleDef[13] = G4XiZero::XiZero();
     55  particleDef[14] = G4XiMinus::XiMinus();
     56  particleDef[15] = G4OmegaMinus::OmegaMinus();
     57  particleDef[16] = G4AntiProton::AntiProton();
     58  particleDef[17] = G4AntiNeutron::AntiNeutron();
     59}
     60
     61
    3762G4double G4RPGInelastic::Pmltpc(G4int np, G4int nm, G4int nz,
    3863                                G4int n, G4double b, G4double c)
     
    568593  2.4,  3.2,  4.2,   5.6,   7.5,   10.0,  13.0,  18.0,  24.0, 32.0 };
    569594
    570 G4ParticleDefinition* p0 = G4PionZero::PionZero();
    571 G4ParticleDefinition* p1 = G4PionPlus::PionPlus();
    572 G4ParticleDefinition* p2 = G4PionMinus::PionMinus();
    573 G4ParticleDefinition* p3 = G4KaonPlus::KaonPlus();
    574 G4ParticleDefinition* p4 = G4KaonMinus::KaonMinus();
    575 G4ParticleDefinition* p5 = G4KaonZero::KaonZero();
    576 G4ParticleDefinition* p6 = G4AntiKaonZero::AntiKaonZero();
    577 G4ParticleDefinition* p7 = G4Proton::Proton();
    578 G4ParticleDefinition* p8 = G4Neutron::Neutron();
    579 G4ParticleDefinition* p9 = G4Lambda::Lambda();
    580 G4ParticleDefinition* p10 = G4SigmaPlus::SigmaPlus();
    581 G4ParticleDefinition* p11 = G4SigmaZero::SigmaZero();
    582 G4ParticleDefinition* p12 = G4SigmaMinus::SigmaMinus();
    583 G4ParticleDefinition* p13 = G4XiZero::XiZero();
    584 G4ParticleDefinition* p14 = G4XiMinus::XiMinus();
    585 G4ParticleDefinition* p15 = G4OmegaMinus::OmegaMinus();
    586 G4ParticleDefinition* p16 = G4AntiProton::AntiProton();
    587 G4ParticleDefinition* p17 = G4AntiNeutron::AntiNeutron();
    588 
    589 G4ParticleDefinition* G4RPGInelastic::particleDef[18] = {
    590   p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14,
    591   p15, p16, p17 };
    592595
    593596/* end of file */
  • trunk/source/processes/hadronic/models/rpg/src/G4RPGNucleonInelastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGNucleonInelastic.cc,v 1.1 2008/01/04 23:28:10 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGNucleonInelastic.cc,v 1.2 2009/05/25 19:06:03 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929 
     
    7070    }
    7171  }
     72 
     73  //  printCrossSections();
    7274
    7375}
     76
     77/*
     78void G4RPGNucleonInelastic::printCrossSections() const
     79{
     80  G4cout << " pp total cross sections (mb) " << G4endl;
     81  for (G4int i = 0; i < 5; i++) {
     82    G4int istart = i*6;
     83    G4int istop = istart + 6;
     84    for (G4int t = istart; t < istop; t++) G4cout << pPtot[t] << "  " ;
     85    G4cout << G4endl;
     86  }
     87  G4cout << G4endl;
     88
     89  G4cout << " pn total cross sections (mb) " << G4endl;
     90  for (G4int i = 0; i < 5; i++) {
     91    G4int istart = i*6;
     92    G4int istop = istart + 6;
     93    for (G4int t = istart; t < istop; t++) G4cout << pNtot[t] << "  " ;
     94    G4cout << G4endl;
     95  }
     96}
     97*/
    7498
    7599
  • trunk/source/processes/hadronic/models/rpg/src/G4RPGPionInelastic.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4RPGPionInelastic.cc,v 1.1 2008/01/05 00:15:12 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4RPGPionInelastic.cc,v 1.2 2009/05/25 19:05:47 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929 
     
    7171  }
    7272
     73  //  printCrossSections();
     74
    7375}
     76
     77
     78/*
     79void G4RPGPionInelastic::printCrossSections() const
     80{
     81  G4cout << " pi+ p total cross sections (mb) " << G4endl;
     82  for (G4int i = 0; i < 5; i++) {
     83    G4int istart = i*6;
     84    G4int istop = istart + 6;
     85    for (G4int t = istart; t < istop; t++) G4cout << pipPtot[t] << "  " ;
     86    G4cout << G4endl;
     87  }
     88  G4cout << G4endl;
     89
     90  G4cout << " pi- p total cross sections (mb) " << G4endl;
     91  for (G4int i = 0; i < 5; i++) {
     92    G4int istart = i*6;
     93    G4int istop = istart + 6;
     94    for (G4int t = istart; t < istop; t++) G4cout << pimPtot[t] << "  " ;
     95    G4cout << G4endl;
     96  }
     97}
     98*/
    7499
    75100
  • trunk/source/processes/hadronic/models/theo_high_energy/History

    r962 r1055  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1729-Apr-2009 M.Kosov         had-theo-HE-V09-02-02
     18- Quasi Elastic part is made more used in QGSC at low energies to improve
     19  the performance of QGSC at low energies
    1620
    17218-Apr-2008  G.Folger        had-theo-HE-V09-01-01
  • trunk/source/processes/hadronic/models/theo_high_energy/src/G4QuasiElasticChannel.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4QuasiElasticChannel.cc,v 1.4 2008/04/24 13:26:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4QuasiElasticChannel.cc,v 1.7 2009/04/09 08:28:42 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030
    3131// Author : Gunter Folger March 2007
     32// Modified by Mikhail Kossov. Apr2009, E/M conservation: ResidualNucleus is added (ResNuc)
    3233// Class Description
    3334// Final state production model for theoretical models of hadron inelastic
     
    4243
    4344
    44 #include "G4HadTmpUtil.hh"              //lrint
     45#include "G4HadTmpUtil.hh"  //lrint
    4546
    4647//#define debug_scatter
     
    4849G4QuasiElasticChannel::G4QuasiElasticChannel()
    4950{
    50         theQuasiElastic=G4QuasiFreeRatios::GetPointer();
     51 theQuasiElastic=G4QuasiFreeRatios::GetPointer();
    5152}
    5253
     
    5556
    5657G4double G4QuasiElasticChannel::GetFraction(G4Nucleus &theNucleus,
    57                                 const G4DynamicParticle & thePrimary)
     58    const G4DynamicParticle & thePrimary)
    5859{
    59         std::pair<G4double,G4double> ratios;
    60         ratios=theQuasiElastic->GetRatios(thePrimary.GetTotalMomentum(),
    61                         thePrimary.GetDefinition()->GetPDGEncoding(),
    62                         G4lrint(theNucleus.GetZ()),
    63                         G4lrint(theNucleus.GetN()-theNucleus.GetZ()));
    64 #ifdef debug_getFraction                       
    65         G4cout << "G4QuasiElasticChannel::ratios " << ratios.first << " x " <<ratios.second
    66                << "  = " << ratios.first*ratios.second << G4endl;
     60  std::pair<G4double,G4double> ratios;
     61#ifdef debug_scatter   
     62  G4cout << "G4QuasiElasticChannel:: P=" << thePrimary.GetTotalMomentum()
     63         << ", pPDG=" << thePrimary.GetDefinition()->GetPDGEncoding()
     64         << ", Z = "  << G4lrint(theNucleus.GetZ())
     65         << ", N = "  << G4lrint(theNucleus.GetN()-theNucleus.GetZ()) << G4endl;
    6766#endif
    68                
    69         return ratios.first*ratios.second;                     
     67  ratios=theQuasiElastic->GetRatios(thePrimary.GetTotalMomentum(),
     68                                    thePrimary.GetDefinition()->GetPDGEncoding(),
     69                                    G4lrint(theNucleus.GetZ()),
     70                                    G4lrint(theNucleus.GetN()-theNucleus.GetZ()));
     71#ifdef debug_scatter   
     72  G4cout << "G4QuasiElasticChannel::ratios " << ratios.first << " x " <<ratios.second
     73         << "  = " << ratios.first*ratios.second << G4endl;
     74#endif
     75       
     76  return ratios.first*ratios.second;
     77  //return 0.; // Switch off quasielastic (temporary) M.K.
     78  //return 1.; // Only quasielastic (temporary) M.K. (DANGEROSE! Crashes at A=1!)
    7079}
    7180
    7281G4KineticTrackVector * G4QuasiElasticChannel::Scatter(G4Nucleus &theNucleus,
    73                                         const G4DynamicParticle & thePrimary)
     82                                                      const G4DynamicParticle & thePrimary)
    7483{
    75        
    76        
    77         G4int A=G4lrint(theNucleus.GetN());
    78 //      G4int Z=G4lrint(theNucleus.GetZ());
    79 //   build Nucleus and choose random nucleon to scatter with
    80         the3DNucleus.Init(theNucleus.GetN(),theNucleus.GetZ());
    81         const std::vector<G4Nucleon *> nucleons=the3DNucleus.GetNucleons();
    82        
    83         G4int index;
    84         do {
    85            index=G4lrint((A-1)*G4UniformRand());
    86            
    87         } while (index < 0 || index >= static_cast<G4int>(nucleons.size()));
    88            
    89 //      G4double an=G4UniformRand()*A;
    90         G4ParticleDefinition * pDef= nucleons[index]->GetDefinition();
    91        
     84  G4int A=G4lrint(theNucleus.GetN());
     85  G4int Z=G4lrint(theNucleus.GetZ());                                 // M.K. ResNuc
     86  //   build Nucleus and choose random nucleon to scatter with
     87  the3DNucleus.Init(theNucleus.GetN(),theNucleus.GetZ());
    9288#ifdef debug_scatter
    93         G4cout << " neutron - proton? A, Z, an, pdg" <<" "
    94                << A <<" "<<G4lrint(theNucleus.GetZ())
    95                << " "<<an <<" " << pDef->GetParticleName()<< G4endl;
     89  G4cout<<"G4QElC::Scat: Before GetNucleons " << G4endl;
    9690#endif
    97 //      G4LorentzVector pNucleon(G4ThreeVector(0,0,0),pDef->GetPDGMass());
    98         G4LorentzVector pNucleon=nucleons[index]->Get4Momentum();
    99        
    100         std::pair<G4LorentzVector,G4LorentzVector> result;
    101        
    102         result=theQuasiElastic->Scatter(pDef->GetPDGEncoding(),pNucleon,
    103                                thePrimary.GetDefinition()->GetPDGEncoding(),
    104                                 thePrimary.Get4Momentum());
    105                                
    106         if (result.first.e() == 0.)
    107         {
    108            G4cout << "Warning - G4QuasiElasticChannel::Scatter no scattering" << G4endl;
    109            return 0;       //no scatter
    110         }
     91  const std::vector<G4Nucleon *> nucleons=the3DNucleus.GetNucleons();
     92  G4double targetNucleusMass=the3DNucleus.GetMass();                  // M.K. ResNuc
     93#ifdef debug_scatter
     94  G4cout<<"G4QElC::Scat: targetMass = " << targetNucleusMass << G4endl;
     95#endif
     96  G4LorentzVector targetNucleus4Mom(0.,0.,0.,targetNucleusMass);      // M.K. ResNuc
     97  G4int index;
     98  do
     99  {
     100    index=G4lrint((A-1)*G4UniformRand());
     101  } while (index < 0 || index >= static_cast<G4int>(nucleons.size()));
     102#ifdef debug_scatter
     103  G4cout<<"G4QElC::Scat: index = " << index << G4endl;
     104#endif
     105  G4ParticleDefinition * pDef= nucleons[index]->GetDefinition();
     106  G4int resA=A-1;                                                     // M.K. ResNuc
     107  G4int resZ=Z-static_cast<int>(pDef->GetPDGCharge());                // M.K. ResNuc
     108  G4ParticleDefinition* resDef=G4Neutron::Neutron(); // Resolve t-p=nn problem M.K. ResNuc
     109  G4double residualNucleusMass=resDef->GetPDGMass();                  // M.K. ResNuc
     110  if(resZ)
     111  {
     112    resDef=G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);// M.K. ResNuc
     113    residualNucleusMass=resDef->GetPDGMass();                         // M.K. ResNuc
     114  }
     115  else residualNucleusMass*=resA;                           // resA=resN M.K. ResNuc
     116#ifdef debug_scatter
     117  G4cout<<"G4QElChan::Scatter: neutron - proton? A ="<<A<<", Z="<<Z<<", projName="
     118        <<pDef->GetParticleName()<<G4endl;
     119#endif
     120  // G4LorentzVector pNucleon(G4ThreeVector(0,0,0),pDef->GetPDGMass());
     121  G4LorentzVector pNucleon=nucleons[index]->Get4Momentum();
     122  G4double residualNucleusEnergy=std::sqrt(residualNucleusMass*residualNucleusMass+
     123                                           pNucleon.vect().mag2());   // M.K. ResNuc
     124  pNucleon.setE(targetNucleusMass-residualNucleusEnergy);             // M.K. ResNuc
     125  G4LorentzVector residualNucleus4Mom=targetNucleus4Mom-pNucleon;     // M.K. ResNuc
     126 
     127  std::pair<G4LorentzVector,G4LorentzVector> result;
     128 
     129  result=theQuasiElastic->Scatter(pDef->GetPDGEncoding(),pNucleon,
     130                                  thePrimary.GetDefinition()->GetPDGEncoding(),
     131  thePrimary.Get4Momentum());
     132  G4LorentzVector scatteredHadron4Mom=result.second;                  // M.K. ResNuc
     133  if (result.first.e() <= 0.)
     134  {
     135    //G4cout << "Warning - G4QuasiElasticChannel::Scatter no scattering" << G4endl;
     136    //return 0;       //no scatter
     137    G4LorentzVector scatteredHadron4Mom=thePrimary.Get4Momentum();   // M.K. ResNuc
     138    residualNucleus4Mom=G4LorentzVector(0.,0.,0.,targetNucleusMass); // M.K. ResNuc
     139    resDef=G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z);    // M.K. ResNuc
     140  }
    111141
    112142#ifdef debug_scatter
    113         G4LorentzVector EpConservation=pNucleon+thePrimary.Get4Momentum()
    114                                         - result.first - result.second;
    115         if (   (EpConservation.vect().mag2() > 0.01*MeV*MeV )
    116             ||  (std::abs(EpConservation.e()) > 0.1 * MeV ) )
    117         {
    118             G4cout << "Warning - G4QuasiElasticChannel::Scatter E-p non conservation : "
    119                     << EpConservation << G4endl;
    120         }   
     143  G4LorentzVector EpConservation=pNucleon+thePrimary.Get4Momentum()
     144                                 - result.first - result.second;
     145  if (   (EpConservation.vect().mag2() > .01*MeV*MeV )
     146      || (std::abs(EpConservation.e()) > 0.1 * MeV ) )
     147  {
     148    G4cout << "Warning - G4QuasiElasticChannel::Scatter E-p non conservation : "
     149           << EpConservation << G4endl;
     150  }   
    121151#endif
    122152
    123         G4KineticTrackVector * ktv;
    124         ktv=new G4KineticTrackVector();
    125         G4KineticTrack * sPrim=new G4KineticTrack(thePrimary.GetDefinition(),
    126                         0.,G4ThreeVector(0), result.second);
    127         ktv->push_back(sPrim);
    128         G4KineticTrack * sNuc=new G4KineticTrack(pDef,
    129                         0.,G4ThreeVector(0), result.first);
    130         ktv->push_back(sNuc);
    131        
     153  G4KineticTrackVector * ktv;
     154  ktv=new G4KineticTrackVector();
     155  G4KineticTrack * sPrim=new G4KineticTrack(thePrimary.GetDefinition(),
     156                                            0.,G4ThreeVector(0), scatteredHadron4Mom);
     157  ktv->push_back(sPrim);
     158  if (result.first.e() > 0.)
     159  {
     160    G4KineticTrack * sNuc=new G4KineticTrack(pDef, 0.,G4ThreeVector(0), result.first);
     161    ktv->push_back(sNuc);
     162  }
     163  if(resZ || resA==1) // For the only neutron or for tnuclei with Z>0    M.K. ResNuc
     164  {
     165    G4KineticTrack * rNuc=new G4KineticTrack(resDef,
     166                           0.,G4ThreeVector(0), residualNucleus4Mom); // M.K. ResNuc
     167    ktv->push_back(rNuc);                                             // M.K. ResNuc
     168  }
     169  else // The residual nucleus consists of only neutrons                 M.K. ResNuc
     170  {
     171    residualNucleus4Mom/=resA;     // Split 4-mom of A*n system equally  M.K. ResNuc
     172    for(G4int in=0; in<resA; in++) // Loop over neutrons in A*n system.  M.K. ResNuc
     173    {
     174      G4KineticTrack* rNuc=new G4KineticTrack(resDef,
     175                           0.,G4ThreeVector(0), residualNucleus4Mom); // M.K. ResNuc
     176      ktv->push_back(rNuc);                                           // M.K. ResNuc
     177    }
     178  }
    132179#ifdef debug_scatter
    133         G4cout << " scattered Nucleon : " << result.first << " mass " <<result.first.mag() << G4endl;
    134         G4cout << " scattered Project : " << result.second << " mass " <<result.second.mag() << G4endl;
     180  G4cout<<"G4QElC::Scat: Nucleon: "<<result.first <<" mass "<<result.first.mag() << G4endl;
     181  G4cout<<"G4QElC::Scat: Project: "<<result.second<<" mass "<<result.second.mag()<< G4endl;
    135182#endif
    136         return ktv;                           
     183  return ktv;
    137184}
  • trunk/source/processes/hadronic/models/theo_high_energy/src/G4TheoFSGenerator.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4TheoFSGenerator.cc,v 1.9 2007/11/13 16:01:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4TheoFSGenerator.cc,v 1.11 2009/04/09 08:28:42 mkossov Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// G4TheoFSGenerator
     
    9191     if ( theQuasielastic->GetFraction(theNucleus, *aPart) > G4UniformRand() )
    9292     {
    93         G4KineticTrackVector *result= theQuasielastic->Scatter(theNucleus, *aPart);
     93       //G4cout<<"___G4TheoFSGenerator: before Scatter (1) QE=" << theQuasielastic<<G4endl;
     94       G4KineticTrackVector *result= theQuasielastic->Scatter(theNucleus, *aPart);
     95       //G4cout << "^^G4TheoFSGenerator: after Scatter (1) " << G4endl;
     96       if (result)
     97       {
     98            for(unsigned int  i=0; i<result->size(); i++)
     99            {
     100              G4DynamicParticle * aNew =
     101                 new G4DynamicParticle(result->operator[](i)->GetDefinition(),
     102                                       result->operator[](i)->Get4Momentum().e(),
     103                                       result->operator[](i)->Get4Momentum().vect());
     104              theParticleChange->AddSecondary(aNew);
     105              delete result->operator[](i);
     106            }
     107            delete result;
     108           
     109       } else
     110       {
     111            theParticleChange->SetStatusChange(isAlive);
     112            theParticleChange->SetEnergyChange(thePrimary.GetKineticEnergy());
     113            theParticleChange->SetMomentumChange(thePrimary.Get4Momentum().vect().unit());
     114 
     115       }
     116        return theParticleChange;
     117     }
     118  }
     119  if ( theProjectileDiffraction) {
     120 
     121     if ( theProjectileDiffraction->GetFraction(theNucleus, *aPart) > G4UniformRand() )
     122      // strictly, this returns fraction on inelastic, so quasielastic should
     123        //    already be substracted, ie. quasielastic should always be used
     124        //     before diffractive
     125     {
     126       //G4cout << "____G4TheoFSGenerator: before Scatter (2) " << G4endl;
     127       G4KineticTrackVector *result= theProjectileDiffraction->Scatter(theNucleus, *aPart);
     128       //G4cout << "^^^^G4TheoFSGenerator: after Scatter (2) " << G4endl;
    94129        if (result)
    95130        {
     
    115150     }
    116151  }
    117   if ( theProjectileDiffraction) {
    118  
    119      if ( theProjectileDiffraction->GetFraction(theNucleus, *aPart) > G4UniformRand() )
    120         // strictly, this returns fraction on inelastic, so quasielastic should
    121         //    already be substracted, ie. quasielastic should always be used
    122         //     before diffractive
    123      {
    124         G4KineticTrackVector *result= theProjectileDiffraction->Scatter(theNucleus, *aPart);
    125         if (result)
    126         {
    127             for(unsigned int  i=0; i<result->size(); i++)
    128             {
    129               G4DynamicParticle * aNew =
    130                  new G4DynamicParticle(result->operator[](i)->GetDefinition(),
    131                                        result->operator[](i)->Get4Momentum().e(),
    132                                        result->operator[](i)->Get4Momentum().vect());
    133               theParticleChange->AddSecondary(aNew);
    134               delete result->operator[](i);
    135             }
    136             delete result;
    137            
    138         } else
    139         {
    140             theParticleChange->SetStatusChange(isAlive);
    141             theParticleChange->SetEnergyChange(thePrimary.GetKineticEnergy());
    142             theParticleChange->SetMomentumChange(thePrimary.Get4Momentum().vect().unit());
    143  
    144         }
    145         return theParticleChange;
    146      }
    147   }
    148 
     152  //G4cout << "____G4TheoFSGenerator: before Scatter (3) " << G4endl;
    149153  G4KineticTrackVector * theInitialResult =
    150154               theHighEnergyGenerator->Scatter(theNucleus, *aPart);
    151  
     155  //G4cout << "^^^^G4TheoFSGenerator: after Scatter (3) " << G4endl;
    152156 
    153157  G4ReactionProductVector * theTransportResult = NULL;
Note: See TracChangeset for help on using the changeset viewer.