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

maj sur la beta de geant 4.9.3

Location:
trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface
Files:
71 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.