Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/models/qmd/src/G4QMDReaction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/qmd/src/G4QMDReaction.cc (Version 11.3.0) and /processes/hadronic/models/qmd/src/G4QMDReaction.cc (Version 10.2.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // 080505 Fixed and changed sampling method of     26 // 080505 Fixed and changed sampling method of impact parameter by T. Koi 
 27 // 080602 Fix memory leaks by T. Koi               27 // 080602 Fix memory leaks by T. Koi 
 28 // 080612 Delete unnecessary dependency and un     28 // 080612 Delete unnecessary dependency and unused functions
 29 //        Change criterion of reaction by T. K     29 //        Change criterion of reaction by T. Koi
 30 // 081107 Add UnUseGEM (then use the default c     30 // 081107 Add UnUseGEM (then use the default channel of G4Evaporation)
 31 //            UseFrag (chage criterion of a in     31 //            UseFrag (chage criterion of a inelastic reaction)
 32 //        Fix bug in nucleon projectiles  by T     32 //        Fix bug in nucleon projectiles  by T. Koi    
 33 // 090122 Be8 -> Alpha + Alpha                     33 // 090122 Be8 -> Alpha + Alpha 
 34 // 090331 Change member shenXS and genspaXS ob     34 // 090331 Change member shenXS and genspaXS object to pointer 
 35 // 091119 Fix for incidence of neutral particl     35 // 091119 Fix for incidence of neutral particles 
 36 //                                                 36 //
 37 #include "G4QMDReaction.hh"                        37 #include "G4QMDReaction.hh"
 38 #include "G4QMDNucleus.hh"                         38 #include "G4QMDNucleus.hh"
 39 #include "G4QMDGroundStateNucleus.hh"              39 #include "G4QMDGroundStateNucleus.hh"
 40 #include "G4Pow.hh"                                40 #include "G4Pow.hh"
 41 #include "G4PhysicalConstants.hh"                  41 #include "G4PhysicalConstants.hh"
 42 #include "G4SystemOfUnits.hh"                      42 #include "G4SystemOfUnits.hh"
 43 #include "G4NistManager.hh"                        43 #include "G4NistManager.hh"
 44                                                    44 
 45 #include "G4CrossSectionDataSetRegistry.hh"        45 #include "G4CrossSectionDataSetRegistry.hh"
 46 #include "G4BGGPionElasticXS.hh"               << 
 47 #include "G4BGGPionInelasticXS.hh"             << 
 48 #include "G4VCrossSectionDataSet.hh"           << 
 49 #include "G4CrossSectionInelastic.hh"          << 
 50 #include "G4ComponentGGNuclNuclXsc.hh"         << 
 51 #include "G4PhysicsModelCatalog.hh"            << 
 52                                                << 
 53                                                    46 
 54 G4QMDReaction::G4QMDReaction()                     47 G4QMDReaction::G4QMDReaction()
 55 : G4HadronicInteraction("QMDModel")                48 : G4HadronicInteraction("QMDModel")
 56 , system ( NULL )                                  49 , system ( NULL )
 57 , deltaT ( 1 ) // in fsec (c=1)                    50 , deltaT ( 1 ) // in fsec (c=1)
 58 , maxTime ( 100 ) // will have maxTime-th time     51 , maxTime ( 100 ) // will have maxTime-th time step
 59 , envelopF ( 1.05 ) // 10% for Peripheral reac     52 , envelopF ( 1.05 ) // 10% for Peripheral reactions
 60 , gem ( true )                                     53 , gem ( true )
 61 , frag ( false )                                   54 , frag ( false )
 62 , secID( -1 )                                  << 
 63 {                                                  55 {
 64    theXS = new G4CrossSectionInelastic( new G4 << 
 65    pipElNucXS = new G4BGGPionElasticXS(G4PionP << 
 66    pipElNucXS->BuildPhysicsTable(*(G4PionPlus: << 
 67                                                << 
 68    pimElNucXS = new G4BGGPionElasticXS(G4PionM << 
 69    pimElNucXS->BuildPhysicsTable(*(G4PionMinus << 
 70                                                << 
 71    pipInelNucXS = new G4BGGPionInelasticXS(G4P << 
 72    pipInelNucXS->BuildPhysicsTable(*(G4PionPlu << 
 73                                                << 
 74    pimInelNucXS = new G4BGGPionInelasticXS(G4P << 
 75    pimInelNucXS->BuildPhysicsTable(*(G4PionMin << 
 76                                                    56 
                                                   >>  57    //090331
                                                   >>  58    shenXS = new G4IonsShenCrossSection();
                                                   >>  59    //genspaXS = new G4GeneralSpaceNNCrossSection();
                                                   >>  60    piNucXS = (G4PiNuclearCrossSection*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4PiNuclearCrossSection::Default_Name());
 77    meanField = new G4QMDMeanField();               61    meanField = new G4QMDMeanField();
 78    collision = new G4QMDCollision();               62    collision = new G4QMDCollision();
 79                                                    63 
 80    excitationHandler = new G4ExcitationHandler <<  64    excitationHandler = new G4ExcitationHandler;
                                                   >>  65    evaporation = new G4Evaporation;
                                                   >>  66    excitationHandler->SetEvaporation( evaporation );
 81    setEvaporationCh();                             67    setEvaporationCh();
 82                                                    68 
 83    coulomb_collision_gamma_proj = 0.0;             69    coulomb_collision_gamma_proj = 0.0;
 84    coulomb_collision_rx_proj = 0.0;                70    coulomb_collision_rx_proj = 0.0;
 85    coulomb_collision_rz_proj = 0.0;                71    coulomb_collision_rz_proj = 0.0;
 86    coulomb_collision_px_proj = 0.0;                72    coulomb_collision_px_proj = 0.0;
 87    coulomb_collision_pz_proj = 0.0;                73    coulomb_collision_pz_proj = 0.0;
 88                                                    74 
 89    coulomb_collision_gamma_targ = 0.0;             75    coulomb_collision_gamma_targ = 0.0;
 90    coulomb_collision_rx_targ = 0.0;                76    coulomb_collision_rx_targ = 0.0;
 91    coulomb_collision_rz_targ = 0.0;                77    coulomb_collision_rz_targ = 0.0;
 92    coulomb_collision_px_targ = 0.0;                78    coulomb_collision_px_targ = 0.0;
 93    coulomb_collision_pz_targ = 0.0;                79    coulomb_collision_pz_targ = 0.0;
 94                                                    80 
 95    secID = G4PhysicsModelCatalog::GetModelID(  << 
 96 }                                                  81 }
 97                                                    82 
 98                                                    83 
                                                   >>  84 
 99 G4QMDReaction::~G4QMDReaction()                    85 G4QMDReaction::~G4QMDReaction()
100 {                                                  86 {
                                                   >>  87    delete evaporation; 
101    delete excitationHandler;                       88    delete excitationHandler;
102    delete collision;                               89    delete collision;
103    delete meanField;                               90    delete meanField;
104 }                                                  91 }
105                                                    92 
106                                                    93 
                                                   >>  94 
107 G4HadFinalState* G4QMDReaction::ApplyYourself(     95 G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectile , G4Nucleus & target )
108 {                                                  96 {
109    //G4cout << "G4QMDReaction::ApplyYourself"      97    //G4cout << "G4QMDReaction::ApplyYourself" << G4endl;
110                                                    98 
111    theParticleChange.Clear();                      99    theParticleChange.Clear();
112                                                   100 
113    system = new G4QMDSystem;                      101    system = new G4QMDSystem;
114                                                   102 
115    G4int proj_Z = 0;                              103    G4int proj_Z = 0;
116    G4int proj_A = 0;                              104    G4int proj_A = 0;
117    const G4ParticleDefinition* proj_pd = ( con    105    const G4ParticleDefinition* proj_pd = ( const G4ParticleDefinition* ) projectile.GetDefinition();
118    if ( proj_pd->GetParticleType() == "nucleus    106    if ( proj_pd->GetParticleType() == "nucleus" )
119    {                                              107    {
120       proj_Z = proj_pd->GetAtomicNumber();        108       proj_Z = proj_pd->GetAtomicNumber();
121       proj_A = proj_pd->GetAtomicMass();          109       proj_A = proj_pd->GetAtomicMass();
122    }                                              110    }
123    else                                           111    else
124    {                                              112    {
125       proj_Z = (int)( proj_pd->GetPDGCharge()/    113       proj_Z = (int)( proj_pd->GetPDGCharge()/eplus );
126       proj_A = 1;                                 114       proj_A = 1;
127    }                                              115    }
128    //G4int targ_Z = int ( target.GetZ() + 0.5     116    //G4int targ_Z = int ( target.GetZ() + 0.5 );
129    //G4int targ_A = int ( target.GetN() + 0.5     117    //G4int targ_A = int ( target.GetN() + 0.5 );
130    //migrate to integer A and Z (GetN_asInt re    118    //migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this) 
131    G4int targ_Z = target.GetZ_asInt();            119    G4int targ_Z = target.GetZ_asInt();
132    G4int targ_A = target.GetA_asInt();            120    G4int targ_A = target.GetA_asInt();
133    const G4ParticleDefinition* targ_pd = G4Ion    121    const G4ParticleDefinition* targ_pd = G4IonTable::GetIonTable()->GetIon( targ_Z , targ_A , 0.0 );
134                                                   122 
135                                                   123 
136    //G4NistManager* nistMan = G4NistManager::I    124    //G4NistManager* nistMan = G4NistManager::Instance();
137 //   G4Element* G4NistManager::FindOrBuildElem    125 //   G4Element* G4NistManager::FindOrBuildElement( targ_Z );
138                                                   126 
139    const G4DynamicParticle* proj_dp = new G4Dy    127    const G4DynamicParticle* proj_dp = new G4DynamicParticle ( proj_pd , projectile.Get4Momentum() );
140    //const G4Element* targ_ele =  nistMan->Fin    128    //const G4Element* targ_ele =  nistMan->FindOrBuildElement( targ_Z ); 
141    //G4double aTemp = projectile.GetMaterial()    129    //G4double aTemp = projectile.GetMaterial()->GetTemperature();
142                                                   130 
143    // Glauber-Gribov nucleus-nucleus cross sec << 131      //090331
144    // therefore call GetElementCrossSection in << 132   
145    //G4double xs_0 = theXS->GetIsoCrossSection << 133    G4VCrossSectionDataSet* theXS = shenXS;
146    G4double xs_0 = theXS->GetElementCrossSecti << 134 
147                                                << 135    if ( proj_pd->GetParticleType() == "meson" ) theXS = piNucXS;
148    // When the projectile is a pion            << 
149    if (proj_pd == G4PionPlus::PionPlus() ) {   << 
150      xs_0 = pipElNucXS->GetElementCrossSection << 
151             pipInelNucXS->GetElementCrossSecti << 
152    } else if (proj_pd == G4PionMinus::PionMinu << 
153      xs_0 = pimElNucXS->GetElementCrossSection << 
154             pimInelNucXS->GetElementCrossSecti << 
155    }                                           << 
156                                                   136 
157    //G4double xs_0 = genspaXS->GetCrossSection    137    //G4double xs_0 = genspaXS->GetCrossSection ( proj_dp , targ_ele , aTemp );
158    //G4double xs_0 = theXS->GetCrossSection (     138    //G4double xs_0 = theXS->GetCrossSection ( proj_dp , targ_ele , aTemp );
159    //110822                                       139    //110822 
                                                   >> 140    G4double xs_0 = theXS->GetIsoCrossSection ( proj_dp , targ_Z , targ_A );
160                                                   141 
161      G4double bmax_0 = std::sqrt( xs_0 / pi );    142      G4double bmax_0 = std::sqrt( xs_0 / pi );
162      //std::cout << "bmax_0 in fm (fermi) " <<    143      //std::cout << "bmax_0 in fm (fermi) " <<  bmax_0/fermi << std::endl;
163                                                   144 
164      //delete proj_dp;                            145      //delete proj_dp; 
165                                                   146 
166    G4bool elastic = true;                         147    G4bool elastic = true;
167                                                   148    
168    std::vector< G4QMDNucleus* > nucleuses; //     149    std::vector< G4QMDNucleus* > nucleuses; // Secondary nuceluses 
169    G4ThreeVector boostToReac; // ReactionSyste    150    G4ThreeVector boostToReac; // ReactionSystem (CM or NN); 
170    G4ThreeVector boostBackToLAB; // Reaction S    151    G4ThreeVector boostBackToLAB; // Reaction System to LAB; 
171                                                   152 
172    G4LorentzVector targ4p( G4ThreeVector( 0.0     153    G4LorentzVector targ4p( G4ThreeVector( 0.0 ) , targ_pd->GetPDGMass()/GeV );
173    G4ThreeVector boostLABtoCM = targ4p.findBoo    154    G4ThreeVector boostLABtoCM = targ4p.findBoostToCM( proj_dp->Get4Momentum()/GeV ); // CM of target and proj; 
174                                                   155 
175    G4double p1 = proj_dp->GetMomentum().mag()/    156    G4double p1 = proj_dp->GetMomentum().mag()/GeV/proj_A; 
176    G4double m1 = proj_dp->GetDefinition()->Get    157    G4double m1 = proj_dp->GetDefinition()->GetPDGMass()/GeV/proj_A;
177    G4double e1 = std::sqrt( p1*p1 + m1*m1 );      158    G4double e1 = std::sqrt( p1*p1 + m1*m1 ); 
178    G4double e2 = targ_pd->GetPDGMass()/GeV/tar    159    G4double e2 = targ_pd->GetPDGMass()/GeV/targ_A;
179    G4double beta_nn = -p1 / ( e1+e2 );            160    G4double beta_nn = -p1 / ( e1+e2 );
180                                                   161 
181    G4ThreeVector boostLABtoNN ( 0. , 0. , beta    162    G4ThreeVector boostLABtoNN ( 0. , 0. , beta_nn ); // CM of NN; 
182                                                   163 
183    G4double beta_nncm = ( - boostLABtoCM.beta(    164    G4double beta_nncm = ( - boostLABtoCM.beta() + boostLABtoNN.beta() ) / ( 1 - boostLABtoCM.beta() * boostLABtoNN.beta() ) ;  
184                                                   165 
185    //std::cout << targ4p << std::endl;            166    //std::cout << targ4p << std::endl; 
186    //std::cout << proj_dp->Get4Momentum()<< st    167    //std::cout << proj_dp->Get4Momentum()<< std::endl; 
187    //std::cout << beta_nncm << std::endl;         168    //std::cout << beta_nncm << std::endl; 
188    G4ThreeVector boostNNtoCM( 0. , 0. , beta_n    169    G4ThreeVector boostNNtoCM( 0. , 0. , beta_nncm ); // 
189    G4ThreeVector boostCMtoNN( 0. , 0. , -beta_    170    G4ThreeVector boostCMtoNN( 0. , 0. , -beta_nncm ); // 
190                                                   171 
191    boostToReac = boostLABtoNN;                    172    boostToReac = boostLABtoNN; 
192    boostBackToLAB = -boostLABtoNN;                173    boostBackToLAB = -boostLABtoNN; 
193                                                   174 
194    delete proj_dp;                                175    delete proj_dp; 
195                                                   176 
196    G4int icounter = 0;                            177    G4int icounter = 0;
197    G4int icounter_max = 1024;                     178    G4int icounter_max = 1024;
198    while ( elastic ) // Loop checking, 11.03.2    179    while ( elastic ) // Loop checking, 11.03.2015, T. Koi
199    {                                              180    {
200       icounter++;                                 181       icounter++;
201       if ( icounter > icounter_max ) {            182       if ( icounter > icounter_max ) { 
202    G4cout << "Loop-counter exceeded the thresh    183    G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
203          break;                                   184          break;
204       }                                           185       }
205                                                   186 
206 // impact parameter                               187 // impact parameter 
207       //G4double bmax = 1.05*(bmax_0/fermi);      188       //G4double bmax = 1.05*(bmax_0/fermi);  // 10% for Peripheral reactions
208       G4double bmax = envelopF*(bmax_0/fermi);    189       G4double bmax = envelopF*(bmax_0/fermi);
209       G4double b = bmax * std::sqrt ( G4Unifor    190       G4double b = bmax * std::sqrt ( G4UniformRand() );
210 //071112                                          191 //071112
211       //G4double b = 0;                           192       //G4double b = 0;
212       //G4double b = bmax;                        193       //G4double b = bmax;
213       //G4double b = bmax/1.05 * 0.7 * G4Unifo    194       //G4double b = bmax/1.05 * 0.7 * G4UniformRand();
214                                                   195 
215       //G4cout << "G4QMDRESULT bmax_0 = " << b    196       //G4cout << "G4QMDRESULT bmax_0 = " << bmax_0/fermi << " fm, bmax = " << bmax << " fm , b = " << b  << " fm " << G4endl; 
216                                                   197 
217       G4double plab = projectile.GetTotalMomen    198       G4double plab = projectile.GetTotalMomentum()/GeV;
218       G4double elab = ( projectile.GetKineticE    199       G4double elab = ( projectile.GetKineticEnergy() + proj_pd->GetPDGMass() + targ_pd->GetPDGMass() )/GeV;
219                                                   200 
220       calcOffSetOfCollision( b , proj_pd , tar    201       calcOffSetOfCollision( b , proj_pd , targ_pd , plab , elab , bmax , boostCMtoNN );
221                                                   202 
222 // Projectile                                     203 // Projectile
223       G4LorentzVector proj4pLAB = projectile.G    204       G4LorentzVector proj4pLAB = projectile.Get4Momentum()/GeV;
224                                                   205 
225       G4QMDGroundStateNucleus* proj(NULL);        206       G4QMDGroundStateNucleus* proj(NULL); 
226       if ( projectile.GetDefinition()->GetPart    207       if ( projectile.GetDefinition()->GetParticleType() == "nucleus" 
227         || projectile.GetDefinition()->GetPart    208         || projectile.GetDefinition()->GetParticleName() == "proton"
228         || projectile.GetDefinition()->GetPart    209         || projectile.GetDefinition()->GetParticleName() == "neutron" )
229       {                                           210       {
230                                                   211 
231          proj_Z = proj_pd->GetAtomicNumber();     212          proj_Z = proj_pd->GetAtomicNumber();
232          proj_A = proj_pd->GetAtomicMass();       213          proj_A = proj_pd->GetAtomicMass();
233                                                   214 
234          proj = new G4QMDGroundStateNucleus( p    215          proj = new G4QMDGroundStateNucleus( proj_Z , proj_A );
235          //proj->ShowParticipants();              216          //proj->ShowParticipants();
236                                                   217 
237                                                   218 
238          meanField->SetSystem ( proj );           219          meanField->SetSystem ( proj );
239          proj->SetTotalPotential( meanField->G    220          proj->SetTotalPotential( meanField->GetTotalPotential() );
240          proj->CalEnergyAndAngularMomentumInCM    221          proj->CalEnergyAndAngularMomentumInCM();
241                                                   222 
242       }                                           223       }
243                                                   224 
244 // Target                                         225 // Target
245       //G4int iz = int ( target.GetZ() );         226       //G4int iz = int ( target.GetZ() );
246       //G4int ia = int ( target.GetN() );         227       //G4int ia = int ( target.GetN() );
247       //migrate to integer A and Z (GetN_asInt    228       //migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this) 
248       G4int iz = int ( target.GetZ_asInt() );     229       G4int iz = int ( target.GetZ_asInt() );
249       G4int ia = int ( target.GetA_asInt() );     230       G4int ia = int ( target.GetA_asInt() );
250                                                   231 
251       G4QMDGroundStateNucleus* targ = new G4QM    232       G4QMDGroundStateNucleus* targ = new G4QMDGroundStateNucleus( iz , ia );
252                                                   233 
253       meanField->SetSystem (targ );               234       meanField->SetSystem (targ );
254       targ->SetTotalPotential( meanField->GetT    235       targ->SetTotalPotential( meanField->GetTotalPotential() );
255       targ->CalEnergyAndAngularMomentumInCM();    236       targ->CalEnergyAndAngularMomentumInCM();
256                                                   237    
257       //G4LorentzVector targ4p( G4ThreeVector(    238       //G4LorentzVector targ4p( G4ThreeVector( 0.0 ) , targ->GetNuclearMass()/GeV );
258 // Boost Vector to CM                             239 // Boost Vector to CM
259       //boostToCM = targ4p.findBoostToCM( proj    240       //boostToCM = targ4p.findBoostToCM( proj4pLAB );
260                                                   241 
261 //    Target                                      242 //    Target 
262       for ( G4int i = 0 ; i < targ->GetTotalNu    243       for ( G4int i = 0 ; i < targ->GetTotalNumberOfParticipant() ; i++ )
263       {                                           244       {
264                                                   245 
265          G4ThreeVector p0 = targ->GetParticipa    246          G4ThreeVector p0 = targ->GetParticipant( i )->GetMomentum();
266          G4ThreeVector r0 = targ->GetParticipa    247          G4ThreeVector r0 = targ->GetParticipant( i )->GetPosition();
267                                                   248 
268          G4ThreeVector p ( p0.x() + coulomb_co    249          G4ThreeVector p ( p0.x() + coulomb_collision_px_targ 
269                          , p0.y()                 250                          , p0.y() 
270                          , p0.z() * coulomb_co    251                          , p0.z() * coulomb_collision_gamma_targ + coulomb_collision_pz_targ ); 
271                                                   252 
272          G4ThreeVector r ( r0.x() + coulomb_co    253          G4ThreeVector r ( r0.x() + coulomb_collision_rx_targ 
273                          , r0.y()                 254                          , r0.y() 
274                          , r0.z() / coulomb_co    255                          , r0.z() / coulomb_collision_gamma_targ + coulomb_collision_rz_targ ); 
275                                                   256      
276          system->SetParticipant( new G4QMDPart    257          system->SetParticipant( new G4QMDParticipant( targ->GetParticipant( i )->GetDefinition() , p , r ) );
277          system->GetParticipant( i )->SetTarge    258          system->GetParticipant( i )->SetTarget();
278                                                   259 
279       }                                           260       }
280                                                   261 
281       G4LorentzVector proj4pCM = CLHEP::boostO    262       G4LorentzVector proj4pCM = CLHEP::boostOf ( proj4pLAB , boostToReac );
282       G4LorentzVector targ4pCM = CLHEP::boostO    263       G4LorentzVector targ4pCM = CLHEP::boostOf ( targ4p , boostToReac );
283                                                   264 
284 //    Projectile                                  265 //    Projectile
285       //G4cout << "proj : " << proj << G4endl; << 266       if ( proj != NULL )
286       //if ( proj != NULL )                    << 
287       if ( proj_A != 1 )                       << 
288       {                                           267       {
289                                                   268 
290 //    projectile is nucleus                       269 //    projectile is nucleus
291                                                   270 
292          for ( G4int i = 0 ; i < proj->GetTota    271          for ( G4int i = 0 ; i < proj->GetTotalNumberOfParticipant() ; i++ )
293          {                                        272          {
294                                                   273 
295             G4ThreeVector p0 = proj->GetPartic    274             G4ThreeVector p0 = proj->GetParticipant( i )->GetMomentum();
296             G4ThreeVector r0 = proj->GetPartic    275             G4ThreeVector r0 = proj->GetParticipant( i )->GetPosition();
297                                                   276 
298             G4ThreeVector p ( p0.x() + coulomb    277             G4ThreeVector p ( p0.x() + coulomb_collision_px_proj 
299                             , p0.y()              278                             , p0.y() 
300                             , p0.z() * coulomb    279                             , p0.z() * coulomb_collision_gamma_proj + coulomb_collision_pz_proj ); 
301                                                   280 
302             G4ThreeVector r ( r0.x() + coulomb    281             G4ThreeVector r ( r0.x() + coulomb_collision_rx_proj 
303                             , r0.y()              282                             , r0.y() 
304                             , r0.z() / coulomb    283                             , r0.z() / coulomb_collision_gamma_proj + coulomb_collision_rz_proj ); 
305                                                   284      
306             system->SetParticipant( new G4QMDP    285             system->SetParticipant( new G4QMDParticipant( proj->GetParticipant( i )->GetDefinition() , p  , r ) );
307             system->GetParticipant ( i + targ-    286             system->GetParticipant ( i + targ->GetTotalNumberOfParticipant() )->SetProjectile();
308          }                                        287          }
309                                                   288 
310       }                                           289       }
311       else                                        290       else
312       {                                           291       {
313                                                   292 
314 //       projectile is particle                   293 //       projectile is particle
315                                                   294 
316          // avoid multiple set in "elastic" lo    295          // avoid multiple set in "elastic" loop
317          //G4cout << "system Total Participant << 
318          if ( system->GetTotalNumberOfParticip    296          if ( system->GetTotalNumberOfParticipant() == targ->GetTotalNumberOfParticipant() )
319          {                                        297          {
320                                                   298 
321             G4int i = targ->GetTotalNumberOfPa    299             G4int i = targ->GetTotalNumberOfParticipant(); 
322                                                   300       
323             G4ThreeVector p0( 0 );                301             G4ThreeVector p0( 0 ); 
324             G4ThreeVector r0( 0 );                302             G4ThreeVector r0( 0 );
325                                                   303 
326             G4ThreeVector p ( p0.x() + coulomb    304             G4ThreeVector p ( p0.x() + coulomb_collision_px_proj 
327                             , p0.y()              305                             , p0.y() 
328                             , p0.z() * coulomb    306                             , p0.z() * coulomb_collision_gamma_proj + coulomb_collision_pz_proj ); 
329                                                   307 
330             G4ThreeVector r ( r0.x() + coulomb    308             G4ThreeVector r ( r0.x() + coulomb_collision_rx_proj 
331                             , r0.y()              309                             , r0.y() 
332                             , r0.z() / coulomb    310                             , r0.z() / coulomb_collision_gamma_proj + coulomb_collision_rz_proj ); 
333                                                   311 
334             system->SetParticipant( new G4QMDP    312             system->SetParticipant( new G4QMDParticipant( (G4ParticleDefinition*)projectile.GetDefinition() , p , r ) );
335             // This is not important becase on    313             // This is not important becase only 1 projectile particle.
336             system->GetParticipant ( i )->SetP    314             system->GetParticipant ( i )->SetProjectile();
337          }                                        315          }
338                                                   316 
339       }                                           317       }
340       //system->ShowParticipants();               318       //system->ShowParticipants();
341                                                   319 
342       delete targ;                                320       delete targ;
343       delete proj;                                321       delete proj;
344                                                   322 
345    meanField->SetSystem ( system );               323    meanField->SetSystem ( system );
346    collision->SetMeanField ( meanField );         324    collision->SetMeanField ( meanField );
347                                                   325 
348 // Time Evolution                                 326 // Time Evolution 
349    //std::cout << "Start time evolution " << s    327    //std::cout << "Start time evolution " << std::endl;
350    //system->ShowParticipants();                  328    //system->ShowParticipants();
351    for ( G4int i = 0 ; i < maxTime ; i++ )        329    for ( G4int i = 0 ; i < maxTime ; i++ )
352    {                                              330    {
353       //G4cout << " do Paropagate " << i << "     331       //G4cout << " do Paropagate " << i << " th time step. " << G4endl;
354       meanField->DoPropagation( deltaT );         332       meanField->DoPropagation( deltaT );
355       //system->ShowParticipants();               333       //system->ShowParticipants();
356       collision->CalKinematicsOfBinaryCollisio    334       collision->CalKinematicsOfBinaryCollisions( deltaT );
357                                                   335 
358       if ( i / 10 * 10 == i )                     336       if ( i / 10 * 10 == i ) 
359       {                                           337       {
360          //G4cout << i << " th time step. " <<    338          //G4cout << i << " th time step. " << G4endl;
361          //system->ShowParticipants();            339          //system->ShowParticipants();
362       }                                           340       } 
363       //system->ShowParticipants();               341       //system->ShowParticipants();
364    }                                              342    }
365    //system->ShowParticipants();                  343    //system->ShowParticipants();
366                                                   344 
367                                                   345 
368    //std::cout << "Doing Cluster Judgment " <<    346    //std::cout << "Doing Cluster Judgment " << std::endl;
369                                                   347 
370    nucleuses = meanField->DoClusterJudgment();    348    nucleuses = meanField->DoClusterJudgment();
371                                                   349 
372 // Elastic Judgment                               350 // Elastic Judgment  
373                                                   351 
374    G4int numberOfSecondary = int ( nucleuses.s    352    G4int numberOfSecondary = int ( nucleuses.size() ) + system->GetTotalNumberOfParticipant(); 
375                                                   353 
376    G4int sec_a_Z = 0;                             354    G4int sec_a_Z = 0;
377    G4int sec_a_A = 0;                             355    G4int sec_a_A = 0;
378    const G4ParticleDefinition* sec_a_pd = NULL    356    const G4ParticleDefinition* sec_a_pd = NULL;
379    G4int sec_b_Z = 0;                             357    G4int sec_b_Z = 0;
380    G4int sec_b_A = 0;                             358    G4int sec_b_A = 0;
381    const G4ParticleDefinition* sec_b_pd = NULL    359    const G4ParticleDefinition* sec_b_pd = NULL;
382                                                   360 
383    if ( numberOfSecondary == 2 )                  361    if ( numberOfSecondary == 2 )
384    {                                              362    {
385                                                   363 
386       G4bool elasticLike_system = false;          364       G4bool elasticLike_system = false;
387       if ( nucleuses.size() == 2 )                365       if ( nucleuses.size() == 2 ) 
388       {                                           366       {
389                                                   367 
390          sec_a_Z = nucleuses[0]->GetAtomicNumb    368          sec_a_Z = nucleuses[0]->GetAtomicNumber();
391          sec_a_A = nucleuses[0]->GetMassNumber    369          sec_a_A = nucleuses[0]->GetMassNumber();
392          sec_b_Z = nucleuses[1]->GetAtomicNumb    370          sec_b_Z = nucleuses[1]->GetAtomicNumber();
393          sec_b_A = nucleuses[1]->GetMassNumber    371          sec_b_A = nucleuses[1]->GetMassNumber();
394                                                   372 
395          if ( ( sec_a_Z == proj_Z && sec_a_A =    373          if ( ( sec_a_Z == proj_Z && sec_a_A == proj_A && sec_b_Z == targ_Z && sec_b_A == targ_A )
396            || ( sec_a_Z == targ_Z && sec_a_A =    374            || ( sec_a_Z == targ_Z && sec_a_A == targ_A && sec_b_Z == proj_Z && sec_b_A == proj_A ) )
397          {                                        375          {
398             elasticLike_system = true;            376             elasticLike_system = true;
399          }                                        377          } 
400                                                   378 
401       }                                           379       }
402       else if ( nucleuses.size() == 1 )           380       else if ( nucleuses.size() == 1 ) 
403       {                                           381       {
404                                                   382 
405          sec_a_Z = nucleuses[0]->GetAtomicNumb    383          sec_a_Z = nucleuses[0]->GetAtomicNumber();
406          sec_a_A = nucleuses[0]->GetMassNumber    384          sec_a_A = nucleuses[0]->GetMassNumber();
407          sec_b_pd = system->GetParticipant( 0     385          sec_b_pd = system->GetParticipant( 0 )->GetDefinition();
408                                                   386 
409          if ( ( sec_a_Z == proj_Z && sec_a_A =    387          if ( ( sec_a_Z == proj_Z && sec_a_A == proj_A && sec_b_pd == targ_pd )
410            || ( sec_a_Z == targ_Z && sec_a_A =    388            || ( sec_a_Z == targ_Z && sec_a_A == targ_A && sec_b_pd == proj_pd ) )
411          {                                        389          {
412             elasticLike_system = true;            390             elasticLike_system = true;
413          }                                        391          } 
414                                                   392 
415       }                                           393       }  
416       else                                        394       else
417       {                                           395       {
418                                                   396 
419          sec_a_pd = system->GetParticipant( 0     397          sec_a_pd = system->GetParticipant( 0 )->GetDefinition();
420          sec_b_pd = system->GetParticipant( 1     398          sec_b_pd = system->GetParticipant( 1 )->GetDefinition();
421                                                   399  
422          if ( ( sec_a_pd == proj_pd && sec_b_p    400          if ( ( sec_a_pd == proj_pd && sec_b_pd == targ_pd ) 
423            || ( sec_a_pd == targ_pd && sec_b_p    401            || ( sec_a_pd == targ_pd && sec_b_pd == proj_pd ) ) 
424          {                                        402          {
425             elasticLike_system = true;            403             elasticLike_system = true;
426          }                                        404          } 
427                                                   405 
428       }                                           406       } 
429                                                   407 
430       if ( elasticLike_system == true )           408       if ( elasticLike_system == true )
431       {                                           409       {
432                                                   410 
433          G4bool elasticLike_energy = true;        411          G4bool elasticLike_energy = true;
434 //    Cal ExcitationEnergy                        412 //    Cal ExcitationEnergy 
435          for ( G4int i = 0 ; i < int ( nucleus    413          for ( G4int i = 0 ; i < int ( nucleuses.size() ) ; i++ )
436          {                                        414          { 
437                                                   415 
438             //meanField->SetSystem( nucleuses[    416             //meanField->SetSystem( nucleuses[i] );
439             meanField->SetNucleus( nucleuses[i    417             meanField->SetNucleus( nucleuses[i] );
440             //nucleuses[i]->SetTotalPotential(    418             //nucleuses[i]->SetTotalPotential( meanField->GetTotalPotential() );
441             //nucleuses[i]->CalEnergyAndAngula    419             //nucleuses[i]->CalEnergyAndAngularMomentumInCM();
442                                                   420 
443             if ( nucleuses[i]->GetExcitationEn    421             if ( nucleuses[i]->GetExcitationEnergy()*GeV > 1.0*MeV ) elasticLike_energy = false;  
444                                                   422 
445          }                                        423          } 
446                                                   424 
447 //    Check Collision                             425 //    Check Collision 
448          G4bool withCollision = true;             426          G4bool withCollision = true;
449          if ( system->GetNOCollision() == 0 )     427          if ( system->GetNOCollision() == 0 ) withCollision = false;
450                                                   428 
451 //    Final judegement for Inelasitc or Elasti    429 //    Final judegement for Inelasitc or Elastic;
452 //                                                430 //
453 //       ElasticLike without Collision            431 //       ElasticLike without Collision 
454          //if ( elasticLike_energy == true &&     432          //if ( elasticLike_energy == true && withCollision == false ) elastic = true;  // ielst = 0
455 //       ElasticLike with Collision               433 //       ElasticLike with Collision 
456          //if ( elasticLike_energy == true &&     434          //if ( elasticLike_energy == true && withCollision == true ) elastic = true;   // ielst = 1 
457 //       InelasticLike without Collision          435 //       InelasticLike without Collision 
458          //if ( elasticLike_energy == false )     436          //if ( elasticLike_energy == false ) elastic = false;                          // ielst = 2                
459          if ( frag == true )                      437          if ( frag == true )
460             if ( elasticLike_energy == false )    438             if ( elasticLike_energy == false ) elastic = false;
461 //       InelasticLike with Collision             439 //       InelasticLike with Collision 
462          if ( elasticLike_energy == false && w    440          if ( elasticLike_energy == false && withCollision == true ) elastic = false; // ielst = 3
463                                                   441 
464       }                                           442       }
465                                                   443 
466       }                                           444       }
467       else                                        445       else
468       {                                           446       {
469                                                   447 
470 //       numberOfSecondary != 2                   448 //       numberOfSecondary != 2 
471          elastic = false;                         449          elastic = false;
472                                                   450 
473       }                                           451       }
474                                                   452 
475 //071115                                          453 //071115
476       //G4cout << elastic << G4endl;              454       //G4cout << elastic << G4endl;
477       // if elastic is true try again from sam    455       // if elastic is true try again from sampling of impact parameter 
478                                                   456 
479       if ( elastic == true )                      457       if ( elastic == true )
480       {                                           458       {
481          // delete this nucleues                  459          // delete this nucleues
482          for ( std::vector< G4QMDNucleus* >::i    460          for ( std::vector< G4QMDNucleus* >::iterator
483                it = nucleuses.begin() ; it !=     461                it = nucleuses.begin() ; it != nucleuses.end() ; it++ )
484          {                                        462          {
485             delete *it;                           463             delete *it;
486          }                                        464          }
487          nucleuses.clear();                       465          nucleuses.clear();
488       }                                           466       }
489                                                   467 
490    }                                              468    } 
491                                                   469 
492                                                   470 
493 // Statical Decay Phase                           471 // Statical Decay Phase
494                                                   472 
495    for ( std::vector< G4QMDNucleus* >::iterato    473    for ( std::vector< G4QMDNucleus* >::iterator it
496        = nucleuses.begin() ; it != nucleuses.e    474        = nucleuses.begin() ; it != nucleuses.end() ; it++ )
497    {                                              475    {
498                                                   476 
499 /*                                                477 /*
500       G4cout << "G4QMDRESULT "                    478       G4cout << "G4QMDRESULT "
501              << (*it)->GetAtomicNumber()          479              << (*it)->GetAtomicNumber() 
502              << " "                               480              << " " 
503              << (*it)->GetMassNumber()            481              << (*it)->GetMassNumber() 
504              << " "                               482              << " " 
505              << (*it)->Get4Momentum()             483              << (*it)->Get4Momentum() 
506              << " "                               484              << " " 
507              << (*it)->Get4Momentum().vect()      485              << (*it)->Get4Momentum().vect() 
508              << " "                               486              << " " 
509              << (*it)->Get4Momentum().restMass    487              << (*it)->Get4Momentum().restMass() 
510              << " "                               488              << " " 
511              << (*it)->GetNuclearMass()/GeV       489              << (*it)->GetNuclearMass()/GeV 
512              << G4endl;                           490              << G4endl;
513 */                                                491 */
514                                                   492 
515       meanField->SetNucleus ( *it );              493       meanField->SetNucleus ( *it );
516                                                   494 
517       if ( (*it)->GetAtomicNumber() == 0  // n    495       if ( (*it)->GetAtomicNumber() == 0  // neutron cluster
518         || (*it)->GetAtomicNumber() == (*it)->    496         || (*it)->GetAtomicNumber() == (*it)->GetMassNumber() ) // proton cluster
519       {                                           497       {
520          // push back system                      498          // push back system 
521          for ( G4int i = 0 ; i < (*it)->GetTot    499          for ( G4int i = 0 ; i < (*it)->GetTotalNumberOfParticipant() ; i++ )
522          {                                        500          {
523             G4QMDParticipant* aP = new G4QMDPa    501             G4QMDParticipant* aP = new G4QMDParticipant( ( (*it)->GetParticipant( i ) )->GetDefinition() , ( (*it)->GetParticipant( i ) )->GetMomentum() , ( (*it)->GetParticipant( i ) )->GetPosition() );  
524             system->SetParticipant ( aP );        502             system->SetParticipant ( aP );  
525          }                                        503          } 
526          continue;                                504          continue;  
527       }                                           505       }
528                                                   506 
529       G4double nucleus_e = std::sqrt ( G4Pow::    507       G4double nucleus_e = std::sqrt ( G4Pow::GetInstance()->powN ( (*it)->GetNuclearMass()/GeV , 2 ) + G4Pow::GetInstance()->powN ( (*it)->Get4Momentum().vect().mag() , 2 ) );
530       G4LorentzVector nucleus_p4CM ( (*it)->Ge    508       G4LorentzVector nucleus_p4CM ( (*it)->Get4Momentum().vect() , nucleus_e ); 
531                                                   509 
532 //      std::cout << "G4QMDRESULT nucleus delt    510 //      std::cout << "G4QMDRESULT nucleus deltaQ " << deltaQ << std::endl;
533                                                   511 
534       G4int ia = (*it)->GetMassNumber();          512       G4int ia = (*it)->GetMassNumber();
535       G4int iz = (*it)->GetAtomicNumber();        513       G4int iz = (*it)->GetAtomicNumber();
536                                                   514 
537       G4LorentzVector lv ( G4ThreeVector( 0.0     515       G4LorentzVector lv ( G4ThreeVector( 0.0 ) , (*it)->GetExcitationEnergy()*GeV + G4IonTable::GetIonTable()->GetIonMass( iz , ia ) );
538                                                   516 
539       G4Fragment* aFragment = new G4Fragment(     517       G4Fragment* aFragment = new G4Fragment( ia , iz , lv );
540                                                   518 
541       G4ReactionProductVector* rv;                519       G4ReactionProductVector* rv;
542       rv = excitationHandler->BreakItUp( *aFra    520       rv = excitationHandler->BreakItUp( *aFragment );
543       G4bool notBreak = true;                     521       G4bool notBreak = true;
544       for ( G4ReactionProductVector::iterator     522       for ( G4ReactionProductVector::iterator itt
545           = rv->begin() ; itt != rv->end() ; i    523           = rv->begin() ; itt != rv->end() ; itt++ )
546       {                                           524       {
547                                                   525 
548           notBreak = false;                       526           notBreak = false;
549           // Secondary from this nucleus (*it)    527           // Secondary from this nucleus (*it) 
550           const G4ParticleDefinition* pd = (*i    528           const G4ParticleDefinition* pd = (*itt)->GetDefinition();
551                                                   529 
552           G4LorentzVector p4 ( (*itt)->GetMome    530           G4LorentzVector p4 ( (*itt)->GetMomentum()/GeV , (*itt)->GetTotalEnergy()/GeV );  //in nucleus(*it) rest system
553           G4LorentzVector p4_CM = CLHEP::boost    531           G4LorentzVector p4_CM = CLHEP::boostOf( p4 , -nucleus_p4CM.findBoostToCM() );  // Back to CM
554           G4LorentzVector p4_LAB = CLHEP::boos    532           G4LorentzVector p4_LAB = CLHEP::boostOf( p4_CM , boostBackToLAB ); // Back to LAB  
555                                                   533 
556                                                   534 
557 //090122                                          535 //090122
558           //theParticleChange.AddSecondary( dp    536           //theParticleChange.AddSecondary( dp ); 
559           if ( !( pd->GetAtomicNumber() == 4 &    537           if ( !( pd->GetAtomicNumber() == 4 && pd->GetAtomicMass() == 8 ) )
560           {                                       538           {
561              //G4cout << "pd out of notBreak l << 
562              G4DynamicParticle* dp = new G4Dyn    539              G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV );  
563              theParticleChange.AddSecondary( d    540              theParticleChange.AddSecondary( dp ); 
564           }                                       541           }
565           else                                    542           else
566           {                                       543           {
567              //Be8 -> Alpha + Alpha + Q           544              //Be8 -> Alpha + Alpha + Q
568              G4ThreeVector randomized_directio    545              G4ThreeVector randomized_direction( G4UniformRand() , G4UniformRand() , G4UniformRand() );
569              randomized_direction = randomized    546              randomized_direction = randomized_direction.unit();
570              G4double q_decay = (*itt)->GetMas    547              G4double q_decay = (*itt)->GetMass() - 2*G4Alpha::Alpha()->GetPDGMass();
571              G4double p_decay = std::sqrt ( G4    548              G4double p_decay = std::sqrt ( G4Pow::GetInstance()->powN(G4Alpha::Alpha()->GetPDGMass()+q_decay/2,2) - G4Pow::GetInstance()->powN(G4Alpha::Alpha()->GetPDGMass() , 2 ) ); 
572              G4LorentzVector p4_a1 ( p_decay*r    549              G4LorentzVector p4_a1 ( p_decay*randomized_direction , G4Alpha::Alpha()->GetPDGMass()+q_decay/2 );  //in Be8 rest system
573                                                   550              
574              G4LorentzVector p4_a1_Be8 = CLHEP    551              G4LorentzVector p4_a1_Be8 = CLHEP::boostOf ( p4_a1/GeV , -p4.findBoostToCM() );
575              G4LorentzVector p4_a1_CM = CLHEP:    552              G4LorentzVector p4_a1_CM = CLHEP::boostOf ( p4_a1_Be8 , -nucleus_p4CM.findBoostToCM() );
576              G4LorentzVector p4_a1_LAB = CLHEP    553              G4LorentzVector p4_a1_LAB = CLHEP::boostOf ( p4_a1_CM , boostBackToLAB );
577                                                   554 
578              G4LorentzVector p4_a2 ( -p_decay*    555              G4LorentzVector p4_a2 ( -p_decay*randomized_direction , G4Alpha::Alpha()->GetPDGMass()+q_decay/2 );  //in Be8 rest system
579                                                   556              
580              G4LorentzVector p4_a2_Be8 = CLHEP    557              G4LorentzVector p4_a2_Be8 = CLHEP::boostOf ( p4_a2/GeV , -p4.findBoostToCM() );
581              G4LorentzVector p4_a2_CM = CLHEP:    558              G4LorentzVector p4_a2_CM = CLHEP::boostOf ( p4_a2_Be8 , -nucleus_p4CM.findBoostToCM() );
582              G4LorentzVector p4_a2_LAB = CLHEP    559              G4LorentzVector p4_a2_LAB = CLHEP::boostOf ( p4_a2_CM , boostBackToLAB );
583                                                   560              
584              G4DynamicParticle* dp1 = new G4Dy    561              G4DynamicParticle* dp1 = new G4DynamicParticle( G4Alpha::Alpha() , p4_a1_LAB*GeV );  
585              G4DynamicParticle* dp2 = new G4Dy    562              G4DynamicParticle* dp2 = new G4DynamicParticle( G4Alpha::Alpha() , p4_a2_LAB*GeV );  
586              theParticleChange.AddSecondary( d    563              theParticleChange.AddSecondary( dp1 ); 
587              theParticleChange.AddSecondary( d    564              theParticleChange.AddSecondary( dp2 ); 
588           }                                       565           }
589 //090122                                          566 //090122
590                                                   567 
591 /*                                                568 /*
592           G4cout                                  569           G4cout
593                 << "Regist Secondary "            570                 << "Regist Secondary "
594                 << (*itt)->GetDefinition()->Ge    571                 << (*itt)->GetDefinition()->GetParticleName()
595                 << " "                            572                 << " "
596                 << (*itt)->GetMomentum()/GeV      573                 << (*itt)->GetMomentum()/GeV
597                 << " "                            574                 << " "
598                 << (*itt)->GetKineticEnergy()/    575                 << (*itt)->GetKineticEnergy()/GeV
599                 << " "                            576                 << " "
600                 << (*itt)->GetMass()/GeV          577                 << (*itt)->GetMass()/GeV
601                 << " "                            578                 << " "
602                 << (*itt)->GetTotalEnergy()/Ge    579                 << (*itt)->GetTotalEnergy()/GeV
603                 << " "                            580                 << " "
604                 << (*itt)->GetTotalEnergy()/Ge    581                 << (*itt)->GetTotalEnergy()/GeV * (*itt)->GetTotalEnergy()/GeV
605                  - (*itt)->GetMomentum()/GeV *    582                  - (*itt)->GetMomentum()/GeV * (*itt)->GetMomentum()/GeV
606                 << " "                            583                 << " "
607                 << nucleus_p4CM.findBoostToCM(    584                 << nucleus_p4CM.findBoostToCM() 
608                 << " "                            585                 << " "
609                 << p4                             586                 << p4
610                 << " "                            587                 << " "
611                 << p4_CM                          588                 << p4_CM
612                 << " "                            589                 << " "
613                 << p4_LAB                         590                 << p4_LAB
614                 << G4endl;                        591                 << G4endl;
615 */                                                592 */
616                                                   593 
617       }                                           594       }
618       if ( notBreak == true )                     595       if ( notBreak == true )
619       {                                           596       {
620                                                   597 
621          const G4ParticleDefinition* pd = G4Io    598          const G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( (*it)->GetAtomicNumber() , (*it)->GetMassNumber(), (*it)->GetExcitationEnergy()*GeV );
622              //G4cout << "pd in notBreak loop  << 
623          G4LorentzVector p4_CM = nucleus_p4CM;    599          G4LorentzVector p4_CM = nucleus_p4CM;
624          G4LorentzVector p4_LAB = CLHEP::boost    600          G4LorentzVector p4_LAB = CLHEP::boostOf( p4_CM , boostBackToLAB ); // Back to LAB  
625          G4DynamicParticle* dp = new G4Dynamic    601          G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV );  
626          theParticleChange.AddSecondary( dp );    602          theParticleChange.AddSecondary( dp ); 
627                                                   603 
628       }                                           604       }
629                                                   605 
630       for ( G4ReactionProductVector::iterator     606       for ( G4ReactionProductVector::iterator itt
631           = rv->begin() ; itt != rv->end() ; i    607           = rv->begin() ; itt != rv->end() ; itt++ )
632       {                                           608       {
633           delete *itt;                            609           delete *itt;
634       }                                           610       }
635       delete rv;                                  611       delete rv;
636                                                   612 
637       delete aFragment;                           613       delete aFragment;
638                                                   614 
639    }                                              615    }
640                                                   616 
641                                                   617 
642                                                   618 
643    for ( G4int i = 0 ; i < system->GetTotalNum    619    for ( G4int i = 0 ; i < system->GetTotalNumberOfParticipant() ; i++ )
644    {                                              620    {
                                                   >> 621 
645       // Secondary particles                      622       // Secondary particles 
646                                                   623 
647       const G4ParticleDefinition* pd = system-    624       const G4ParticleDefinition* pd = system->GetParticipant( i )->GetDefinition();
648       G4LorentzVector p4_CM = system->GetParti    625       G4LorentzVector p4_CM = system->GetParticipant( i )->Get4Momentum();
649       G4LorentzVector p4_LAB = CLHEP::boostOf(    626       G4LorentzVector p4_LAB = CLHEP::boostOf( p4_CM , boostBackToLAB );
650       G4DynamicParticle* dp = new G4DynamicPar    627       G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV );  
651       theParticleChange.AddSecondary( dp );       628       theParticleChange.AddSecondary( dp ); 
652       //G4cout << "In the last theParticleChan << 
653                                                   629 
654 /*                                                630 /*
655       G4cout << "G4QMDRESULT "                    631       G4cout << "G4QMDRESULT "
656       << "r" << i << " " << system->GetPartici    632       << "r" << i << " " << system->GetParticipant ( i ) -> GetPosition() << " "
657       << "p" << i << " " << system->GetPartici    633       << "p" << i << " " << system->GetParticipant ( i ) -> Get4Momentum()
658       << G4endl;                                  634       << G4endl;
659 */                                                635 */
660                                                   636 
661    }                                              637    }
662                                                   638 
663    for ( std::vector< G4QMDNucleus* >::iterato    639    for ( std::vector< G4QMDNucleus* >::iterator it
664        = nucleuses.begin() ; it != nucleuses.e    640        = nucleuses.begin() ; it != nucleuses.end() ; it++ )
665    {                                              641    {
666       delete *it;  // delete nulceuse             642       delete *it;  // delete nulceuse 
667    }                                              643    }
668    nucleuses.clear();                             644    nucleuses.clear();
669                                                   645 
670    system->Clear();                               646    system->Clear();
671    delete system;                                 647    delete system; 
672                                                   648 
673    theParticleChange.SetStatusChange( stopAndK    649    theParticleChange.SetStatusChange( stopAndKill );
674                                                   650 
675    for (G4int i = 0; i < G4int(theParticleChan << 
676    {                                           << 
677      //G4cout << "Particle : " << theParticleC << 
678      //G4cout << "KEnergy : " << theParticleCh << 
679      //G4cout << "modelID : " << theParticleCh << 
680      theParticleChange.GetSecondary(i)->SetCre << 
681    }                                           << 
682                                                << 
683    return &theParticleChange;                     651    return &theParticleChange;
684                                                   652 
685 }                                                 653 }
686                                                   654 
687                                                   655 
688                                                   656 
689 void G4QMDReaction::calcOffSetOfCollision( G4d    657 void G4QMDReaction::calcOffSetOfCollision( G4double b , 
690 const G4ParticleDefinition* pd_proj ,             658 const G4ParticleDefinition* pd_proj ,
691 const G4ParticleDefinition* pd_targ ,             659 const G4ParticleDefinition* pd_targ ,
692 G4double ptot , G4double etot , G4double bmax     660 G4double ptot , G4double etot , G4double bmax , G4ThreeVector boostToCM )
693 {                                                 661 {
694                                                   662 
695    G4double mass_proj = pd_proj->GetPDGMass()/    663    G4double mass_proj = pd_proj->GetPDGMass()/GeV;
696    G4double mass_targ = pd_targ->GetPDGMass()/    664    G4double mass_targ = pd_targ->GetPDGMass()/GeV;
697                                                   665   
698    G4double stot = std::sqrt ( etot*etot - pto    666    G4double stot = std::sqrt ( etot*etot - ptot*ptot );
699                                                   667 
700    G4double pstt = std::sqrt ( ( stot*stot - (    668    G4double pstt = std::sqrt ( ( stot*stot - ( mass_proj + mass_targ ) * ( mass_proj + mass_targ ) 
701                   ) * ( stot*stot - ( mass_pro    669                   ) * ( stot*stot - ( mass_proj - mass_targ ) * ( mass_proj - mass_targ ) ) ) 
702                  / ( 2.0 * stot );                670                  / ( 2.0 * stot );
703                                                   671 
704    G4double pzcc = pstt;                          672    G4double pzcc = pstt;
705    G4double eccm = stot - ( mass_proj + mass_t    673    G4double eccm = stot - ( mass_proj + mass_targ );
706                                                   674    
707    G4int zp = 1;                                  675    G4int zp = 1;
708    G4int ap = 1;                                  676    G4int ap = 1;
709    if ( pd_proj->GetParticleType() == "nucleus    677    if ( pd_proj->GetParticleType() == "nucleus" )
710    {                                              678    {
711       zp = pd_proj->GetAtomicNumber();            679       zp = pd_proj->GetAtomicNumber();
712       ap = pd_proj->GetAtomicMass();              680       ap = pd_proj->GetAtomicMass();
713    }                                              681    }
714    else                                           682    else 
715    {                                              683    {
716       // proton, neutron, mesons                  684       // proton, neutron, mesons
717       zp = int ( pd_proj->GetPDGCharge()/eplus    685       zp = int ( pd_proj->GetPDGCharge()/eplus + 0.5 );  
718       // ap = 1;                                  686       // ap = 1;
719    }                                              687    }
720                                                   688    
721                                                   689 
722    G4int zt = pd_targ->GetAtomicNumber();         690    G4int zt = pd_targ->GetAtomicNumber();
723    G4int at = pd_targ->GetAtomicMass();           691    G4int at = pd_targ->GetAtomicMass();
724                                                   692 
725                                                   693 
726    // Check the ramx0 value                    << 
727    //G4double rmax0 = 8.0;  // T.K dicide para    694    //G4double rmax0 = 8.0;  // T.K dicide parameter value  // for low energy
728    G4double rmax0 = bmax + 4.0;                   695    G4double rmax0 = bmax + 4.0;
729    G4double rmax = std::sqrt( rmax0*rmax0 + b*    696    G4double rmax = std::sqrt( rmax0*rmax0 + b*b );
730                                                   697 
731    G4double ccoul = 0.001439767;                  698    G4double ccoul = 0.001439767;
732    G4double pcca = 1.0 - double ( zp * zt ) *     699    G4double pcca = 1.0 - double ( zp * zt ) * ccoul / eccm / rmax - ( b / rmax )*( b / rmax );
733                                                   700 
734    G4double pccf = std::sqrt( pcca );             701    G4double pccf = std::sqrt( pcca );
735                                                   702 
736    //Fix for neutral particles                    703    //Fix for neutral particles
737    G4double aas1 = 0.0;                           704    G4double aas1 = 0.0;
738    G4double bbs = 0.0;                            705    G4double bbs = 0.0;
739                                                   706 
740    if ( zp != 0 )                                 707    if ( zp != 0 )
741    {                                              708    {
742       G4double aas = 2.0 * eccm * b / double (    709       G4double aas = 2.0 * eccm * b / double ( zp * zt ) / ccoul;
743       bbs = 1.0 / std::sqrt ( 1.0 + aas*aas );    710       bbs = 1.0 / std::sqrt ( 1.0 + aas*aas );
744       aas1 = ( 1.0 + aas * b / rmax ) * bbs;      711       aas1 = ( 1.0 + aas * b / rmax ) * bbs;
745    }                                              712    }
746                                                   713 
747    G4double cost = 0.0;                           714    G4double cost = 0.0;
748    G4double sint = 0.0;                           715    G4double sint = 0.0;
749    G4double thet1 = 0.0;                          716    G4double thet1 = 0.0;
750    G4double thet2 = 0.0;                          717    G4double thet2 = 0.0;
751    if ( 1.0 - aas1*aas1 <= 0 || 1.0 - bbs*bbs     718    if ( 1.0 - aas1*aas1 <= 0 || 1.0 - bbs*bbs <= 0.0 )   
752    {                                              719    {
753       cost = 1.0;                                 720       cost = 1.0;
754       sint = 0.0;                                 721       sint = 0.0;
755    }                                              722    } 
756    else                                           723    else 
757    {                                              724    {
758       G4double aat1 = aas1 / std::sqrt ( 1.0 -    725       G4double aat1 = aas1 / std::sqrt ( 1.0 - aas1*aas1 );
759       G4double aat2 = bbs / std::sqrt ( 1.0 -     726       G4double aat2 = bbs / std::sqrt ( 1.0 - bbs*bbs );
760                                                   727 
761       thet1 = std::atan ( aat1 );                 728       thet1 = std::atan ( aat1 );
762       thet2 = std::atan ( aat2 );                 729       thet2 = std::atan ( aat2 );
763                                                   730 
764 //    TK enter to else block                      731 //    TK enter to else block  
765       G4double theta = thet1 - thet2;             732       G4double theta = thet1 - thet2;
766       cost = std::cos( theta );                   733       cost = std::cos( theta );
767       sint = std::sin( theta );                   734       sint = std::sin( theta );
768    }                                              735    }
769                                                   736 
770    G4double rzpr = -rmax * cost * ( mass_targ     737    G4double rzpr = -rmax * cost * ( mass_targ ) / ( mass_proj + mass_targ );
771    G4double rzta =  rmax * cost * ( mass_proj     738    G4double rzta =  rmax * cost * ( mass_proj ) / ( mass_proj + mass_targ );
772                                                   739 
773    G4double rxpr = rmax / 2.0 * sint;             740    G4double rxpr = rmax / 2.0 * sint;
774                                                   741 
775    G4double rxta = -rxpr;                         742    G4double rxta = -rxpr;
776                                                   743 
777                                                   744 
778    G4double pzpc = pzcc * (  cost * pccf + sin    745    G4double pzpc = pzcc * (  cost * pccf + sint * b / rmax ); 
779    G4double pxpr = pzcc * ( -sint * pccf + cos    746    G4double pxpr = pzcc * ( -sint * pccf + cost * b / rmax ); 
780                                                   747 
781    G4double pztc = - pzpc;                        748    G4double pztc = - pzpc;
782    G4double pxta = - pxpr;                        749    G4double pxta = - pxpr;
783                                                   750 
784    G4double epc = std::sqrt ( pzpc*pzpc + pxpr    751    G4double epc = std::sqrt ( pzpc*pzpc + pxpr*pxpr + mass_proj*mass_proj );
785    G4double etc = std::sqrt ( pztc*pztc + pxta    752    G4double etc = std::sqrt ( pztc*pztc + pxta*pxta + mass_targ*mass_targ );
786                                                   753 
787    G4double pzpr = pzpc;                          754    G4double pzpr = pzpc;
788    G4double pzta = pztc;                          755    G4double pzta = pztc;
789    G4double epr = epc;                            756    G4double epr = epc;
790    G4double eta = etc;                            757    G4double eta = etc;
791                                                   758 
792 // CM -> NN                                       759 // CM -> NN
793    G4double gammacm = boostToCM.gamma();          760    G4double gammacm = boostToCM.gamma();
794    //G4double betacm = -boostToCM.beta();         761    //G4double betacm = -boostToCM.beta();
795    G4double betacm = boostToCM.z();               762    G4double betacm = boostToCM.z();
796    pzpr = pzpc + betacm * gammacm * ( gammacm     763    pzpr = pzpc + betacm * gammacm * ( gammacm / ( 1. + gammacm ) * pzpc * betacm + epc );
797    pzta = pztc + betacm * gammacm * ( gammacm     764    pzta = pztc + betacm * gammacm * ( gammacm / ( 1. + gammacm ) * pztc * betacm + etc );
798    epr = gammacm * ( epc + betacm * pzpc );       765    epr = gammacm * ( epc + betacm * pzpc );
799    eta = gammacm * ( etc + betacm * pztc );       766    eta = gammacm * ( etc + betacm * pztc );
800                                                   767 
801    //G4double betpr = pzpr / epr;                 768    //G4double betpr = pzpr / epr;
802    //G4double betta = pzta / eta;                 769    //G4double betta = pzta / eta;
803                                                   770 
804    G4double gammpr = epr / ( mass_proj );         771    G4double gammpr = epr / ( mass_proj );
805    G4double gammta = eta / ( mass_targ );         772    G4double gammta = eta / ( mass_targ );
806                                                   773       
807    pzta = pzta / double ( at );                   774    pzta = pzta / double ( at );
808    pxta = pxta / double ( at );                   775    pxta = pxta / double ( at );
809                                                   776       
810    pzpr = pzpr / double ( ap );                   777    pzpr = pzpr / double ( ap );
811    pxpr = pxpr / double ( ap );                   778    pxpr = pxpr / double ( ap );
812                                                   779 
813    G4double zeroz = 0.0;                          780    G4double zeroz = 0.0; 
814                                                   781 
815    rzpr = rzpr -zeroz;                            782    rzpr = rzpr -zeroz;
816    rzta = rzta -zeroz;                            783    rzta = rzta -zeroz;
817                                                   784 
818    // Set results                                 785    // Set results 
819    coulomb_collision_gamma_proj = gammpr;         786    coulomb_collision_gamma_proj = gammpr;
820    coulomb_collision_rx_proj = rxpr;              787    coulomb_collision_rx_proj = rxpr;
821    coulomb_collision_rz_proj = rzpr;              788    coulomb_collision_rz_proj = rzpr;
822    coulomb_collision_px_proj = pxpr;              789    coulomb_collision_px_proj = pxpr;
823    coulomb_collision_pz_proj = pzpr;              790    coulomb_collision_pz_proj = pzpr;
824                                                   791 
825    coulomb_collision_gamma_targ = gammta;         792    coulomb_collision_gamma_targ = gammta;
826    coulomb_collision_rx_targ = rxta;              793    coulomb_collision_rx_targ = rxta;
827    coulomb_collision_rz_targ = rzta;              794    coulomb_collision_rz_targ = rzta;
828    coulomb_collision_px_targ = pxta;              795    coulomb_collision_px_targ = pxta;
829    coulomb_collision_pz_targ = pzta;              796    coulomb_collision_pz_targ = pzta;
830                                                   797 
831 }                                                 798 }
832                                                   799 
                                                   >> 800 
                                                   >> 801 
833 void G4QMDReaction::setEvaporationCh()            802 void G4QMDReaction::setEvaporationCh()
834 {                                                 803 {
835   //fEvaporation - 8 default channels          << 804 
836   //fCombined    - 8 default + 60 GEM          << 805    if ( gem == true ) 
837   //fGEM         - 2 default + 66 GEM          << 806       evaporation->SetGEMChannel();
838   G4DeexChannelType ctype = gem ? fGEM : fComb << 807    else
839   excitationHandler->SetDeexChannelsType(ctype << 808       evaporation->SetDefaultChannel();
                                                   >> 809 
840 }                                                 810 }
841                                                   811 
842 void G4QMDReaction::ModelDescription(std::ostr    812 void G4QMDReaction::ModelDescription(std::ostream& outFile) const
843 {                                                 813 {
844    outFile << "Lorentz covarianted Quantum Mol    814    outFile << "Lorentz covarianted Quantum Molecular Dynamics model for nucleus (particle) vs nucleus reactions\n";
845 }                                                 815 }
846                                                   816