Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

Location:
trunk/source/processes/hadronic/models/binary_cascade/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4Absorber.cc

    r819 r1196  
    5656  if (kt.Get4Momentum().e() - kt.GetActualMass() < theCutOnP)
    5757  {
    58       if(kt.GetDefinition() == G4PionPlus::PionPlus() ||
    59          kt.GetDefinition() == G4PionZero::PionZero() ||
     58      if(kt.GetDefinition() == G4PionPlus::PionPlus()  ||
     59         kt.GetDefinition() == G4PionZero::PionZero()  ||
    6060         kt.GetDefinition() == G4PionMinus::PionMinus())
    6161      {
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryCascade.cc

    r962 r1196  
    9797  theLateParticle= new G4BCLateParticle;
    9898  theImR.push_back(theDecay);
     99  G4MesonAbsorption * aAb=new G4MesonAbsorption;
     100  theImR.push_back(aAb);
    99101  G4Scatterer * aSc=new G4Scatterer;
    100102  theH1Scatterer = new G4Scatterer;
    101103  theImR.push_back(aSc);
    102   G4MesonAbsorption * aAb=new G4MesonAbsorption;
    103   theImR.push_back(aAb);
    104104
    105105  thePropagator = new G4RKPropagation;
     
    107107  theBCminP = 45*MeV;
    108108  theCutOnP = 90*MeV;
    109   theCutOnPAbsorb= 0*MeV;
     109  theCutOnPAbsorb= 0*MeV;   // No Absorption of slow Mesons, other than above G4MesonAbsorption
    110110
    111111  theExcitationHandler = new G4ExcitationHandler;
     
    155155  eventcounter++;
    156156  if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction number starts ######### "<<eventcounter<<G4endl;
     157
    157158  G4LorentzVector initial4Momentum = aTrack.Get4Momentum();
    158159  G4ParticleDefinition * definition = const_cast<G4ParticleDefinition *>(aTrack.GetDefinition());
     
    238239  theParticleChange.SetStatusChange(stopAndKill);
    239240  G4ReactionProductVector::iterator iter;
    240   G4double Efinal=0;
    241         if (std::abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 )
    242         {
    243            G4cout <<" BIC-weight change " << theParticleChange.GetWeightChange()<< G4endl;
    244         }
    245241
    246242  for(iter = products->begin(); iter != products->end(); ++iter)
     
    253249    theParticleChange.AddSecondary(aNew);
    254250
    255 //   G4cout << " Secondary E - Ekin / p " <<
    256 //      (*iter)->GetDefinition()->GetParticleName() << " " <<
    257 //      (*iter)->GetTotalEnergy() << " - " <<
    258 //      (*iter)->GetKineticEnergy()<< " / " <<
    259 //      (*iter)->GetMomentum().x() << " " <<
    260 //      (*iter)->GetMomentum().y() << " " <<
    261 //      (*iter)->GetMomentum().z() << G4endl;
    262       Efinal += (*iter)->GetTotalEnergy();
    263   }
    264 
    265 //  G4cout << "e outgoing/ total : " << Efinal << " " << Efinal+GetFinal4Momentum().e()<< G4endl;
    266 
     251  }
     252
     253  // DebugEpConservation(track, products);
     254             
    267255  ClearAndDestroy(products);
    268256  delete products;
     
    325313  if(nucleus->GetMass()>120) theCutOnP = 45*MeV;
    326314
     315  G4double StartingTime=DBL_MAX;        // Search for minimal formation time Uzhi
     316  for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)    // Uzhi
     317  {                                                                       // Uzhi
     318    if((*iter)->GetFormationTime() < StartingTime)                        // Uzhi
     319        StartingTime = (*iter)->GetFormationTime();                       // Uzhi
     320  }                                                                       // Uzhi
     321
    327322  for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
    328323  {
    329324//  G4cout << " Formation time : " << (*iter)->GetDefinition()->GetParticleName() << " "
    330325//       << (*iter)->GetFormationTime() << G4endl;
     326    G4double FormTime = (*iter)->GetFormationTime() - StartingTime;       // Uzhi
     327    (*iter)->SetFormationTime(FormTime);                                  // Uzhi
    331328    if( (*iter)->GetState() == G4KineticTrack::undefined )
    332329    {
     
    363360  G4bool haveProducts = false;
    364361  G4int collisionCount=0;
    365   theMomentumTransfer=0;
     362  theMomentumTransfer=G4ThreeVector(0,0,0);
    366363  while(theCollisionMgr->Entries() > 0)
    367364  {
     
    394391       if (!DoTimeStep(nextCollision->GetCollisionTime()-theCurrentTime) )
    395392       {
    396            // Check if nextCollision is still valid, ie. partcile did not leave nucleus
     393           // Check if nextCollision is still valid, ie. particle did not leave nucleus
    397394           if (theCollisionMgr->GetNextCollision() != nextCollision )
    398395           {
     
    539536  }
    540537
    541 
    542538// find a fragment and call the precompound model.
    543539  G4Fragment * fragment = 0;
    544540  G4ReactionProductVector * precompoundProducts = 0;
    545  
    546    if ( ExcitationEnergy >= 0 )
    547    {
    548        fragment = FindFragments();
    549 
    550     //  theDeExcitation =0;
    551        if(fragment && fragment->GetA() >1.5) // hpw @@@@ still to add the nucleon, if one exists.
     541
     542  G4LorentzVector pFragment(0);
     543        // G4cout << " final4mon " << GetFinal4Momentum() /MeV << G4endl;
     544
     545//   if ( ExcitationEnergy >= 0 )                                         // closed by Uzhi
     546//   {                                                                    // closed by Uzhi
     547  fragment = FindFragments();
     548  if(fragment)                                                            // Uzhi
     549  {                                                                       // Uzhi
     550       if(fragment->GetA() >1.5)                                          // Uzhi
    552551       {
    553          if (theDeExcitation)
     552         if (theDeExcitation)                // pre-compound
    554553         {
     554              // G4cout << " going to preco with fragment 4 mom " << fragment->GetMomentum() << G4endl;
     555             pFragment=fragment->GetMomentum();
    555556             precompoundProducts= theDeExcitation->DeExcite(*fragment);
    556557             delete fragment;
    557558             fragment=0;
    558          } else if (theExcitationHandler)
     559         } else if (theExcitationHandler)    // de-excitation
    559560         {
     561              // G4cout << " going to de-excit with fragment 4 mom " << fragment->GetMomentum() << G4endl;
     562             pFragment=fragment->GetMomentum();
    560563             precompoundProducts=theExcitationHandler->BreakItUp(*fragment);
    561564             delete fragment;
    562565             fragment=0;
    563566         }
    564        } else {
     567       } else
     568       {                                   // fragment->GetA() < 1.5
     569         precompoundProducts = new G4ReactionProductVector();
     570         std::vector<G4KineticTrack *>::iterator i;
    565571         if ( theTargetList.size() == 1 )
    566572         {
    567              precompoundProducts = new G4ReactionProductVector();
    568              std::vector<G4KineticTrack *>::iterator i=theTargetList.begin();
     573             i=theTargetList.begin();
    569574             G4ReactionProduct * aNew = new G4ReactionProduct((*i)->GetDefinition());
    570575             aNew->SetTotalEnergy((*i)->GetDefinition()->GetPDGMass());       
    571              aNew->SetMomentum(G4ThreeVector(0));               // see boost fro preCompoundProducts below..
     576             aNew->SetMomentum(G4ThreeVector(0));// see boost for preCompoundProducts below..
    572577             precompoundProducts->push_back(aNew);
    573           } else if ( theTargetList.size() > 1)
     578         }
     579
     580         if ( theCapturedList.size() == 1 )                               // Uzhi
     581         {                                                                // Uzhi
     582             i=theCapturedList.begin();                                   // Uzhi
     583             G4ReactionProduct * aNew = new G4ReactionProduct((*i)->GetDefinition()); // Uzhi
     584             aNew->SetTotalEnergy((*i)->GetDefinition()->GetPDGMass());   // Uzhi
     585             aNew->SetMomentum(G4ThreeVector(0));// see boost below..     // Uzhi
     586             precompoundProducts->push_back(aNew);                        // Uzhi
     587         }                                                                // Uzhi
     588       }                            // End of fragment->GetA() < 1.5
     589  } else                            // End of if(fragment)
     590  {                                 // No fragment, can be neutrons only  // Uzhi
     591     precompoundProducts = new G4ReactionProductVector();                     
     592     
     593     if ( (theTargetList.size()+theCapturedList.size()) > 0 )
     594     {                                                                     
     595        std::vector<G4KineticTrack *>::iterator aNuc;                             
     596        G4LorentzVector aVec;                                                     
     597        std::vector<G4double> masses;                                             
     598        G4double sumMass(0);
     599
     600        if ( theTargetList.size() != 0)                                      // Uzhi
     601        {
     602           for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++)
     603           {
     604              G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
     605              masses.push_back(mass);
     606              sumMass += mass;
     607           }
     608        }                                                                    // Uzhi
     609
     610        if ( theCapturedList.size() != 0)                                    // Uzhi
     611        {                                                                    // Uzhi
     612           for(aNuc = theCapturedList.begin();                               // Uzhi
     613               aNuc != theCapturedList.end(); aNuc++)                        // Uzhi
     614           {                                                                 // Uzhi
     615              G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();          // Uzhi
     616              masses.push_back(mass);                                        // Uzhi
     617              sumMass += mass;                                               // Uzhi
     618           }                 
     619        }
     620
     621        G4LorentzVector finalP=GetFinal4Momentum();
     622        G4FermiPhaseSpaceDecay decay;
     623        // G4cout << " some neutrons? " << masses.size() <<" " ;
     624        // G4cout<< theTargetList.size()<<" "<<finalP <<" " << finalP.mag()<<G4endl;
     625
     626        G4double eCMS=finalP.mag();
     627        if ( eCMS < sumMass )                    // @@GF --- Cheat!!
     628        {
     629           eCMS=sumMass + (2*MeV*masses.size());     
     630           finalP.setE(std::sqrt(finalP.vect().mag2() + sqr(eCMS)));
     631        }
     632
     633        precompoundLorentzboost.set(finalP.boostVector());
     634        std::vector<G4LorentzVector*> * momenta=decay.Decay(eCMS,masses);
     635        std::vector<G4LorentzVector*>::iterator aMom=momenta->begin();
     636
     637        if ( theTargetList.size() != 0)
     638        {
     639          for ( aNuc=theTargetList.begin();
     640               (aNuc != theTargetList.end()) && (aMom!=momenta->end());
     641                aNuc++, aMom++ )
    574642          {
    575              precompoundProducts = new G4ReactionProductVector();
    576              std::vector<G4KineticTrack *>::iterator aNuc;
    577              G4LorentzVector aVec;
    578              std::vector<G4double> masses;
    579              G4double sumMass(0);
    580              for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++)
    581              {
    582                 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
    583                 masses.push_back(mass);
    584                 sumMass += mass;
    585              }
    586              G4LorentzVector finalP=GetFinal4Momentum();
    587              G4FermiPhaseSpaceDecay decay;
    588 //           G4cout << " some neutrons? " << masses.size() <<" " << theTargetList.size()<<" "<<finalP <<" " << finalP.mag()<<G4endl;
    589              G4double eCMS=finalP.mag();
    590              if ( eCMS < sumMass )                    // @@GF --- Cheat!!
    591              {
    592                 eCMS=sumMass + (2*MeV*masses.size());     
    593                 finalP.setE(std::sqrt(finalP.vect().mag2() + sqr(eCMS)));
    594              }
    595              precompoundLorentzboost.set(finalP.boostVector());
    596              std::vector<G4LorentzVector*> * momenta=decay.Decay(eCMS,masses);
    597              std::vector<G4LorentzVector*>::iterator aMom=momenta->begin();
    598              for ( aNuc=theTargetList.begin();
    599                   (aNuc != theTargetList.end()) && (aMom!=momenta->end());
    600                   aNuc++, aMom++ )
    601              {
    602                 G4ReactionProduct * aNew = new G4ReactionProduct((*aNuc)->GetDefinition());
    603                 aNew->SetTotalEnergy((*aMom)->e());
    604                 aNew->SetMomentum((*aMom)->vect());
    605                 precompoundProducts->push_back(aNew);
    606 //              G4cout << " only neutrons? " <<  (*aNuc)->GetDefinition()->GetParticleName() << G4endl;
    607                 delete *aMom;
    608              }
    609              delete momenta;
     643             G4ReactionProduct * aNew = new G4ReactionProduct((*aNuc)->GetDefinition());
     644             aNew->SetTotalEnergy((*aMom)->e());
     645             aNew->SetMomentum((*aMom)->vect());
     646             precompoundProducts->push_back(aNew);
     647
     648             delete *aMom;
    610649          }
    611        }
    612 
    613    }
     650        }
     651
     652        if ( theCapturedList.size() != 0)                                    // Uzhi
     653        {                                                                    // Uzhi
     654          for ( aNuc=theCapturedList.begin();                                // Uzhi
     655               (aNuc != theCapturedList.end()) && (aMom!=momenta->end());    // Uzhi
     656                aNuc++, aMom++ )                                             // Uzhi
     657          {                                                                  // Uzhi
     658             G4ReactionProduct * aNew = new G4ReactionProduct(               // Uzhi
     659                                       (*aNuc)->GetDefinition());            // Uzhi
     660             aNew->SetTotalEnergy((*aMom)->e());                             // Uzhi
     661             aNew->SetMomentum((*aMom)->vect());                             // Uzhi
     662             precompoundProducts->push_back(aNew);                           // Uzhi
     663             delete *aMom;                                                   // Uzhi
     664          }                                                                  // Uzhi
     665        }                                                                    // Uzhi
     666
     667        if(momenta) delete momenta;
     668     } 
     669  }                   // End if(!fragment)
     670
    614671
    615672  {
    616673// fill in products the outgoing particles
    617674     G4double Ekinout=0;
     675     G4LorentzVector pSumBic(0);
    618676     size_t i(0);
    619677     for(i = 0; i< theFinalState.size(); i++)
     
    636694         aNew->SetTotalEnergy(kt->Get4Momentum().e());
    637695         Ekinout += aNew->GetKineticEnergy();
     696         pSumBic += kt->Get4Momentum();
    638697         if(kt->IsParticipant())
    639698         {
     
    655714             } else
    656715             {
    657                 G4cout << "final un stable : ";
     716                G4cout << "final non stable : ";
    658717             }
    659718             G4cout <<kt->GetDefinition()->GetParticleName()<< G4endl;
     
    666725  }
    667726// add precompound products to products
     727  G4LorentzVector pSumPreco(0), pPreco(0);
    668728  if ( precompoundProducts )
    669729  {
     
    673733// boost back to system of moving nucleus
    674734         G4LorentzVector pProduct((*j)->GetMomentum(),(*j)->GetTotalEnergy());
     735         pPreco+= pProduct;
    675736#ifdef debug_BIC_Propagate_finals
    676737         G4cout << " pProduct be4 boost " <<pProduct << G4endl;
     
    680741         G4cout << " pProduct aft boost " <<pProduct << G4endl;
    681742#endif
     743         pSumPreco += pProduct;
    682744         (*j)->SetTotalEnergy(pProduct.e());
    683745         (*j)->SetMomentum(pProduct.vect());
     
    685747         products->push_back(*j);
    686748       }
    687 
     749         // G4cout << " unboosted preco result mom " << pPreco / MeV << "  ..- fragmentMom " << (pPreco - pFragment)/MeV<< G4endl;
     750         // G4cout << " preco result mom " << pSumPreco / MeV << "  ..-file4Mom " << (pSumPreco - GetFinal4Momentum())/MeV<< G4endl;
    688751       precompoundProducts->clear();
    689752       delete precompoundProducts;
     
    740803     nucleusMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA);
    741804  }
    742   else if (currentZ==0 && currentA==1 )
    743   {
    744      nucleusMass = G4Neutron::Neutron()->GetPDGMass();
    745   }
     805  else if (currentZ==0 )     // Uzhi && currentA==1 )                     // Uzhi
     806  {                                                                       // Uzhi
     807     if(currentA == 1) {nucleusMass = G4Neutron::Neutron()->GetPDGMass();}// Uzhi
     808     else              {nucleusMass = GetFinalNucleusMomentum().mag()     // Uzhi
     809                                      - 3.*MeV*currentA;}                 // Uzhi
     810  }                                                                       // Uzhi
    746811  else
    747812  {
     
    929994//----------------------------------------------------------------------------
    930995{
     996    G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;
    931997    if ( secondary->GetTrackingMomentum().mag2() < -1.*eV )
    932998    {
     
    9521018    }
    9531019
     1020    //  for barions, correct for fermi energy
     1021    G4int PDGcode=std::abs(secondary->GetDefinition()->GetPDGEncoding());
     1022    if ( PDGcode > 1000 )
     1023    {
     1024       G4double initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(),
     1025                                          secondary->GetPosition());
     1026       secondary->Update4Momentum(secondary->Get4Momentum().e() - initial_Efermi);
     1027    }
     1028
    9541029#ifdef debug_BIC_FindCollision
    9551030    G4cout << "FindLateP Particle, 4-mom, times newState "
     
    10191094  mom4Primary=primary->Get4Momentum();
    10201095  initial_Efermi=RKprop->GetField(primary->GetDefinition()->GetPDGEncoding(),primary->GetPosition());
     1096
    10211097  if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 )
    10221098  {
    1023      initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(),primary->GetPosition());
     1099     initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(),
     1100                                                primary->GetPosition());
    10241101     primary->Update4Momentum(mom4Primary.e() - initial_Efermi);
    10251102  }
     1103
    10261104  std::vector<G4KineticTrack *>::iterator titer;
    10271105  for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer)
     
    10391117
    10401118  #ifdef debug_BIC_ApplyCollision
    1041       if ( !products )
     1119        G4bool havePion=false;
     1120        for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
     1121        {
     1122                G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding());
     1123                if (std::abs(PDGcode)==211 || PDGcode==111 ) havePion=true;
     1124        }       
     1125     if ( !products  || havePion)
    10421126      {
    1043             G4cout << " Collision type: "<< typeid(*collision->GetGenerator()).name()
     1127            G4cout << " Collision " << collision << ", type: "<< typeid(*collision->GetGenerator()).name()
    10441128                << ", with NO products! " <<G4endl;
    10451129           G4cout << G4endl<<"Initial condition are these:"<<G4endl;
     
    11231207   }
    11241208
    1125 #ifdef debug_BIC_ApplyCollisionXX
    1126   DebugApplyCollsion(collision, products);
     1209#ifdef debug_BIC_ApplyCollision
     1210  DebugApplyCollision(collision, products);
    11271211#endif
    11281212
     
    12311315}
    12321316
    1233 //----------------------------------------------------------------------------
    1234 void G4BinaryCascade::DebugApplyCollision(G4CollisionInitialState * collision,
    1235                                           G4KineticTrackVector * products)
    1236 {
    1237 //**-------------------------begin debug Block---------------------------
    1238 
    1239   G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;
    1240 
    1241   G4KineticTrackVector debug1;
    1242   debug1.push_back(collision->GetPrimary());
    1243   PrintKTVector(&debug1,std::string(" Primary particle"));
    1244   PrintKTVector(&collision->GetTargetCollection(),std::string(" Target particles"));
    1245   PrintKTVector(products,std::string(" Scatterer products"));
    1246  
    1247   G4double thisExcitation(0);
    1248 //  excitation energy from this collision
    1249 //  initial state:
    1250   G4double initial(0);
    1251   G4KineticTrack * kt=collision->GetPrimary();
    1252   initial +=  kt->Get4Momentum().e();
    1253  
    1254   initial +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
    1255   initial -=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
    1256   G4cout << "prim. E/field/Barr/Sum " << kt->Get4Momentum().e()
    1257           << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
    1258           << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
    1259           << " " << initial << G4endl;;
    1260  
    1261   G4KineticTrackVector ktv=collision->GetTargetCollection();
    1262   for ( unsigned int it=0; it < ktv.size(); it++)
    1263   {
    1264      kt=ktv[it];
    1265      initial +=  kt->Get4Momentum().e();
    1266      thisExcitation += kt->GetDefinition()->GetPDGMass()
    1267                      - kt->Get4Momentum().e()
    1268                      - RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
    1269 //     initial +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
    1270 //     initial -=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
    1271   G4cout << "Targ. def/E/field/Barr/Sum " <<  kt->GetDefinition()->GetPDGEncoding()
    1272           << " " << kt->Get4Momentum().e()
    1273           << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
    1274           << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
    1275           << " " << initial <<" Excit " << thisExcitation << G4endl;;
    1276   }
    1277  
    1278   G4double final(0);
    1279   G4double mass_out(0);
    1280   G4int product_barions(0);
    1281   if ( products )
    1282   {
    1283      for ( unsigned int it=0; it < products->size(); it++)
    1284      {
    1285         kt=(*products)[it];
    1286         final +=  kt->Get4Momentum().e();
    1287         final +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
    1288         final +=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
    1289         if ( kt->GetDefinition()->GetBaryonNumber()==1 ) product_barions++;
    1290         mass_out += kt->GetDefinition()->GetPDGMass();
    1291      G4cout << "sec. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding()
    1292              << " " << kt->Get4Momentum().e()
    1293              << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
    1294              << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
    1295              << " " << final << G4endl;;
    1296      }
    1297   }
    1298 
    1299 
    1300   G4int finalA = currentA;
    1301   G4int finalZ = currentZ;
    1302   if ( products )
    1303   {
    1304      finalA -= product_barions;
    1305      finalZ -= GetTotalCharge(*products);
    1306   }
    1307   G4double delta = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA)
    1308                    - (G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA)
    1309                        + mass_out);
    1310   G4cout << " current/final a,z " << currentA << " " << currentZ << " "<< finalA<< " "<< finalZ
    1311         <<  " delta-mass " << delta<<G4endl;
    1312   final+=delta;
    1313     mass_out  = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA);
    1314   G4cout << " initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy
    1315          << " " <<   final << " "
    1316          <<  mass_out<<" "
    1317          <<  currentInitialEnergy - final - mass_out
    1318          << G4endl;
    1319    currentInitialEnergy-=final; 
    1320 
    1321 //**-------------------------end debug Block---------------------------
    1322 
    1323 }
    1324 //----------------------------------------------------------------------------
    13251317
    13261318//----------------------------------------------------------------------------
     
    27062698}
    27072699
    2708 
    2709 
    2710 
    2711 
    2712 
    2713 
    2714 
     2700//----------------------------------------------------------------------------
     2701void G4BinaryCascade::DebugApplyCollision(G4CollisionInitialState * collision,
     2702                                          G4KineticTrackVector * products)
     2703{
     2704  G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;
     2705
     2706  G4KineticTrackVector debug1;
     2707  debug1.push_back(collision->GetPrimary());
     2708  PrintKTVector(&debug1,std::string(" Primary particle"));
     2709  PrintKTVector(&collision->GetTargetCollection(),std::string(" Target particles"));
     2710  PrintKTVector(products,std::string(" Scatterer products"));
     2711 
     2712  G4double thisExcitation(0);
     2713//  excitation energy from this collision
     2714//  initial state:
     2715  G4double initial(0);
     2716  G4KineticTrack * kt=collision->GetPrimary();
     2717  initial +=  kt->Get4Momentum().e();
     2718 
     2719  initial +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
     2720  initial -=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
     2721  G4cout << "prim. E/field/Barr/Sum " << kt->Get4Momentum().e()
     2722          << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
     2723          << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
     2724          << " " << initial << G4endl;;
     2725 
     2726  G4KineticTrackVector ktv=collision->GetTargetCollection();
     2727  for ( unsigned int it=0; it < ktv.size(); it++)
     2728  {
     2729     kt=ktv[it];
     2730     initial +=  kt->Get4Momentum().e();
     2731     thisExcitation += kt->GetDefinition()->GetPDGMass()
     2732                     - kt->Get4Momentum().e()
     2733                     - RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
     2734//     initial +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
     2735//     initial -=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
     2736  G4cout << "Targ. def/E/field/Barr/Sum " <<  kt->GetDefinition()->GetPDGEncoding()
     2737          << " " << kt->Get4Momentum().e()
     2738          << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
     2739          << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
     2740          << " " << initial <<" Excit " << thisExcitation << G4endl;;
     2741  }
     2742 
     2743  G4double final(0);
     2744  G4double mass_out(0);
     2745  G4int product_barions(0);
     2746  if ( products )
     2747  {
     2748     for ( unsigned int it=0; it < products->size(); it++)
     2749     {
     2750        kt=(*products)[it];
     2751        final +=  kt->Get4Momentum().e();
     2752        final +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
     2753        final +=  RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());
     2754        if ( kt->GetDefinition()->GetBaryonNumber()==1 ) product_barions++;
     2755        mass_out += kt->GetDefinition()->GetPDGMass();
     2756     G4cout << "sec. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding()
     2757             << " " << kt->Get4Momentum().e()
     2758             << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())
     2759             << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())
     2760             << " " << final << G4endl;;
     2761     }
     2762  }
     2763
     2764
     2765  G4int finalA = currentA;
     2766  G4int finalZ = currentZ;
     2767  if ( products )
     2768  {
     2769     finalA -= product_barions;
     2770     finalZ -= GetTotalCharge(*products);
     2771  }
     2772  G4double delta = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA)
     2773                   - (G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA)
     2774                       + mass_out);
     2775  G4cout << " current/final a,z " << currentA << " " << currentZ << " "<< finalA<< " "<< finalZ
     2776        <<  " delta-mass " << delta<<G4endl;
     2777  final+=delta;
     2778    mass_out  = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA);
     2779  G4cout << " initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy
     2780         << " " <<   final << " "
     2781         <<  mass_out<<" "
     2782         <<  currentInitialEnergy - final - mass_out
     2783         << G4endl;
     2784   currentInitialEnergy-=final; 
     2785
     2786}
     2787
     2788//----------------------------------------------------------------------------
     2789void G4BinaryCascade::DebugEpConservation(const G4HadProjectile & aTrack,
     2790                                          G4ReactionProductVector* products)                       
     2791
     2792  G4ReactionProductVector::iterator iter;
     2793  G4double Efinal(0);
     2794  G4ThreeVector pFinal(0);
     2795        if (std::abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 )
     2796        {
     2797           G4cout <<" BIC-weight change " << theParticleChange.GetWeightChange()<< G4endl;
     2798        }
     2799
     2800  for(iter = products->begin(); iter != products->end(); ++iter)
     2801  {
     2802
     2803//   G4cout << " Secondary E - Ekin / p " <<
     2804//      (*iter)->GetDefinition()->GetParticleName() << " " <<
     2805//      (*iter)->GetTotalEnergy() << " - " <<
     2806//      (*iter)->GetKineticEnergy()<< " / " <<
     2807//      (*iter)->GetMomentum().x() << " " <<
     2808//      (*iter)->GetMomentum().y() << " " <<
     2809//      (*iter)->GetMomentum().z() << G4endl;
     2810      Efinal += (*iter)->GetTotalEnergy();
     2811      pFinal += (*iter)->GetMomentum();
     2812  }
     2813
     2814//  G4cout << "e outgoing/ total : " << Efinal << " " << Efinal+GetFinal4Momentum().e()<< G4endl;
     2815    G4cout << "BIC E/p delta " <<
     2816    (aTrack.Get4Momentum().e()+ the3DNucleus->GetMass() - Efinal)/MeV <<
     2817    " MeV / mom " << (aTrack.Get4Momentum()  - pFinal ) /MeV << G4endl;
     2818
     2819}
     2820
     2821//----------------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryLightIonReaction.cc

    r962 r1196  
    3838#include <cmath>
    3939 
    40   G4BinaryLightIonReaction::G4BinaryLightIonReaction()
    41     : G4HadronicInteraction("Binary Cascade"), theModel(), theHandler(),
    42       theProjectileFragmentation(&theHandler) {}
     40G4BinaryLightIonReaction::G4BinaryLightIonReaction()
     41    : G4HadronicInteraction("Binary Cascade"), theModel() ,
     42      theHandler(0) , theProjectileFragmentation(0)
     43{
     44    theHandler= new G4ExcitationHandler;
     45    SetPrecompound(new G4PreCompoundModel(theHandler));
     46}
    4347 
    44   G4HadFinalState *G4BinaryLightIonReaction::
     48G4HadFinalState *G4BinaryLightIonReaction::
    4549  ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus & targetNucleus )
    46   {
     50{
    4751  static G4int eventcounter=0;
    4852  eventcounter++;
     
    118122//      G4cout << "Fragment INFO "<< a1+a2 <<" "<<z1+z2<<" "
    119123//             << aL <<" "<<preFragDef->GetParticleName()<<G4endl;
    120       cascaders = theProjectileFragmentation.DeExcite(aPreFrag);
     124      cascaders = theProjectileFragmentation->DeExcite(aPreFrag);
    121125      G4double tSum = 0;
    122126      for(size_t count = 0; count<cascaders->size(); count++)
     
    402406        resDef = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ); 
    403407        aProRes.SetParticleDefinition(resDef);
    404         proFrag = theHandler.BreakItUp(aProRes);
     408        proFrag = theHandler->BreakItUp(aProRes);
    405409      if ( momentum.vect().mag() > momentum.e() )
    406410      {
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4GeneratorPrecompoundInterface.cc

    r819 r1196  
    3131// HPW, 10DEC 98, the decay part originally written by Gunter Folger in his FTF-test-program.
    3232//
     33   
     34    G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface()
     35    : CaptureThreshold(80*MeV)
     36    {}
    3337     
    3438   G4HadFinalState* G4GeneratorPrecompoundInterface::
     
    5155     result1=theSecondaries;
    5256     result=new G4KineticTrackVector();
    53      
     57
    5458     for (unsigned int aResult=0; aResult < result1->size(); aResult++)
    5559     {
     
    101105         theTotalResult->push_back(theNew);           
    102106       }
    103        else if(aTrack->Get4Momentum().t() - aTrack->Get4Momentum().mag()>80*MeV)
     107       else if(aTrack->Get4Momentum().t() - aTrack->Get4Momentum().mag()>CaptureThreshold)
    104108       {
    105109         G4ReactionProduct * theNew = new G4ReactionProduct(aTrack->GetDefinition());
     
    143147       theCurrentNucleon = theNucleus->GetNextNucleon();
    144148     }   
    145     
     149 
    146150     if(!theDeExcitation)
    147151     {
     
    152156       G4double residualMass = 
    153157                G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(aZ ,anA);
    154        residualMass += exEnergy;
     158         residualMass += exEnergy;
     159
    155160       G4LorentzVector exciton4Momentum(exciton3Momentum,
    156161                                        std::sqrt(exciton3Momentum.mag2()+residualMass*residualMass));
    157      
     162   
    158163       anInitialState.SetA(anA);
    159164       anInitialState.SetZ(aZ);
     
    167172       const G4Fragment aFragment(anInitialState);
    168173       G4ReactionProductVector * aPreResult = theDeExcitation->DeExcite(aFragment);
    169 //       G4ReactionProductVector * aPreResult = new G4ReactionProductVector;
     174
    170175       // fill pre-compound part into the result, and return
    171176       for(unsigned int ll=0; ll<aPreResult->size(); ll++)
     
    186191   }
    187192 
     193G4double G4GeneratorPrecompoundInterface::SetCaptureThreshold(G4double value)
     194{
     195    G4double old=CaptureThreshold;
     196    CaptureThreshold=value;
     197    return old;
     198
     199}
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4KM_NucleonEqRhs.cc

    r819 r1196  
    3838
    3939#include "G4KM_NucleonEqRhs.hh"
    40 #include "G4NucleiPropertiesTable.hh"
    4140#include "G4VNuclearDensity.hh"
    4241
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4NeutronField.cc

    r819 r1196  
    3737// -------------------------------------------------------------------
    3838#include "G4NeutronField.hh"
    39 #include "G4NucleiPropertiesTable.hh"
    4039#include "G4VNuclearDensity.hh"
    4140#include "G4FermiMomentum.hh"
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4ProtonField.cc

    r819 r1196  
    3737// -------------------------------------------------------------------
    3838#include "G4ProtonField.hh"
    39 #include "G4NucleiPropertiesTable.hh"
    4039#include "G4VNuclearDensity.hh"
    4140#include "G4FermiMomentum.hh"
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4RKPropagation.cc

    r819 r1196  
    252252{
    253253//  reset momentum transfer to field
    254     theMomentumTranfer=0;
     254    theMomentumTranfer=G4ThreeVector(0,0,0);
    255255
    256256// Loop over tracks
     
    262262    G4KineticTrack * kt = *i;
    263263    G4int encoding = kt->GetDefinition()->GetPDGEncoding();
     264
    264265    std::map <G4int, G4VNuclearField*, std::less<G4int> >::iterator fieldIter= theFieldMap->find(encoding);
    265266
     
    327328//     GetField = Barrier + FermiPotential
    328329        G4double newE = kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition());
    329 //      G4cout << " enter nucleus, E out/in: " << kt->GetTrackingMomentum().e() << " / " << newE <<G4endl;
    330 //      G4cout << " the Field "<< currentField->GetField(kt->GetPosition()) << " "<< kt->GetPosition()<<G4endl;
    331 //      G4cout << " the particle "<<kt->GetDefinition()->GetParticleName()<<G4endl;
     330
    332331        if(newE <= kt->GetActualMass())  // the particle cannot enter the nucleus
    333332        {
     
    350349        kt->SetTrackingMomentum(new4Mom);
    351350        kt->SetState(G4KineticTrack::inside);
    352 //     G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->GetTrackingMomentum().e() << " / "
    353 //         << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / "
    354 //         << kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition())
    355 //         << G4endl
    356 //         << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())"
    357 //         << (*theFieldMap)[encoding]->GetBarrier() << " / "
    358 //         << (*theFieldMap)[encoding]->GetField(0.9999*kt->GetPosition())
    359 //         << G4endl;
     351
     352/*
     353     G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->GetTrackingMomentum().e() << " / "
     354           << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / "
     355           << kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition())
     356           << G4endl
     357           << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())"
     358           << (*theFieldMap)[encoding]->GetBarrier() << " / "
     359           << (*theFieldMap)[encoding]->GetField(0.9999*kt->GetPosition())
     360           << G4endl;
     361*/
    360362       }
    361363    }
     
    396398        << G4endl << currentField->GetField(kt->GetPosition())<< G4endl
    397399        << kt->GetTrackingMomentum()
    398  //     << G4endl;
     400        << G4endl
    399401        << "delta p " << momold-kt->GetTrackingMomentum() << G4endl
    400402        << "del pos " << posold-kt->GetPosition()
     
    483485      }
    484486
    485 
    486 
    487487  }
    488488
     
    502502//----------------------------------------------------------------------------
    503503{
    504     theMomentumTranfer=0;
     504    theMomentumTranfer=G4ThreeVector(0,0,0);
    505505//    G4cout <<"Stepper input"<<kt->GetTrackingMomentum()<<G4endl;
    506506// create the integrator stepper
     
    538538    }
    539539/*
    540  *      G4cout <<" E/Field/Sum be4 : " <<mom.e() << " / "
    541  *         << (*theFieldMap)[encoding]->GetField(pos) << " / "
    542  *         << mom.e()+(*theFieldMap)[encoding]->GetField(pos)
    543  *         << G4endl;
    544  */
     540       G4cout <<" E/Field/Sum be4 : " <<mom.e() << " / "
     541           << (*theFieldMap)[encoding]->GetField(pos) << " / "
     542           << mom.e()+(*theFieldMap)[encoding]->GetField(pos)
     543           << G4endl;
     544*/
    545545
    546546// Correct for momentum ( thus energy) transfered to nucleus, boost particle into moving nuclues frame.
Note: See TracChangeset for help on using the changeset viewer.