Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFModel.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4FTFModel.cc,v 1.34 2009/12/15 19:14:31 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4FTFModel.cc,v 1.36 2010/09/20 15:50:46 vuzhinsk Exp $
     28// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2929//
    3030
     
    9999{
    100100        theProjectile = aProjectile; 
    101         theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ());
     101
     102        theParticipants.Init(aNucleus.GetA_asInt(),aNucleus.GetZ_asInt());
     103
    102104// ----------- N-mass number Z-charge -------------------------
    103105
     
    113115
    114116//theParameters->SetProbabilityOfElasticScatt(0.);
     117//G4cout<<theParameters->GetProbabilityOfElasticScatt()<<G4endl;
     118//G4int Uzhi; G4cin>>Uzhi;
    115119// To turn on/off (1/0) elastic scattering
    116120
     
    125129{
    126130        G4ExcitedStringVector * theStrings(0);
    127 
     131//G4cout<<"GetString"<<G4endl;
    128132        theParticipants.GetList(theProjectile,theParameters);
    129 
     133//G4cout<<"Reggeon"<<G4endl;
    130134        ReggeonCascade();
    131135
     
    133137        if( PutOnMassShell() )
    134138        {
     139//G4cout<<"PutOn mass Shell OK"<<G4endl;
    135140         if( ExciteParticipants() )
    136141         {
     142//G4cout<<"Excite partic OK"<<G4endl;
    137143          theStrings = BuildStrings();
    138 
     144//G4cout<<"Build String OK"<<G4endl;
    139145          GetResidualNucleus();
    140146
     
    194200           TheInvolvedNucleon[NumberOfInvolvedNucleon]=TargetNucleon;
    195201           NumberOfInvolvedNucleon++;
    196 
     202//G4cout<<"Prim NumberOfInvolvedNucleon "<<NumberOfInvolvedNucleon<<G4endl;
    197203           G4double XofWoundedNucleon = TargetNucleon->GetPosition().x();
    198204           G4double YofWoundedNucleon = TargetNucleon->GetPosition().y();
     
    214220              TheInvolvedNucleon[NumberOfInvolvedNucleon]=Neighbour;
    215221              NumberOfInvolvedNucleon++;
     222//G4cout<<"Seco NumberOfInvolvedNucleon "<<NumberOfInvolvedNucleon<<G4endl;
    216223
    217224              G4VSplitableHadron *targetSplitable;
     
    274281        G4LorentzVector Pprojectile=primary->Get4Momentum();
    275282
     283//G4cout<<"Pprojectile "<<Pprojectile<<G4endl;
    276284// To get original projectile particle
    277285
     
    284292        G4double        SumMasses = Mprojectile + 20.*MeV; // 13.12.09
    285293                                               // Separation energy for projectile
    286 
     294//G4cout<<"SumMasses Pr "<<SumMasses<<G4endl;
    287295//--------------- Target nucleus ------------------------------
    288296        G4V3DNucleus *theNucleus = GetWoundedNucleus();
     
    305313          SumMasses += aNucleon->GetDefinition()->GetPDGMass();
    306314          SumMasses += 20.*MeV;   // 13.12.09 Separation energy for a nucleon
     315//G4cout<<"SumMasses Tr "<<SumMasses<<G4endl;
    307316          ResidualMassNumber--;
    308317          ResidualCharge-=(G4int) aNucleon->GetDefinition()->GetPDGCharge();
     
    316325
    317326        Psum += PnuclearResidual;
    318 
     327//G4cout<<"ResidualCharge ,ResidualMassNumber "<<ResidualCharge<<" "<<ResidualMassNumber<<G4endl;
    319328        G4double ResidualMass(0.);
    320329        if(ResidualMassNumber == 0)
     
    331340 
    332341//      ResidualMass +=ResidualExcitationEnergy; // Will be given after checks
     342//G4cout<<"SumMasses End ResidualMass "<<SumMasses<<" "<<ResidualMass<<G4endl;
    333343        SumMasses += ResidualMass;
    334 
     344//G4cout<<"SumMasses + ResM "<<SumMasses<<G4endl;
     345//G4cout<<"Psum "<<Psum<<G4endl;
    335346//-------------------------------------------------------------
    336347
     
    338349        G4double     S=Psum.mag2();
    339350
     351//G4cout<<"SqrtS < SumMasses "<<SqrtS<<" "<<SumMasses<<G4endl;
    340352        if(SqrtS < SumMasses)      {return false;} // It is impossible to simulate
    341353                                                   // after putting nuclear nucleons
     
    346358        ResidualMass +=ResidualExcitationEnergy;
    347359        SumMasses    +=ResidualExcitationEnergy;
    348 
     360//G4cout<<"ResidualMass "<<ResidualMass<<" "<<SumMasses<<G4endl;
    349361//-------------------------------------------------------------
    350362// Sampling of nucleons what are transfered to delta-isobars --
     
    373385        }   // end of if(theNucleus.GetMassNumber() != 1)
    374386//-------------------------------------------------------------
     387
    375388        G4LorentzRotation toCms(-1*Psum.boostVector());
    376389        G4LorentzVector Ptmp=toCms*Pprojectile;
     
    393406        G4double AveragePt2  = theParameters->GetPt2ofNuclearDestruction();
    394407        G4double maxPtSquare = theParameters->GetMaxPt2ofNuclearDestruction();
    395 
     408//G4cout<<"Dcor "<<Dcor<<" AveragePt2 "<<AveragePt2<<G4endl;
    396409        G4double M2target(0.);
    397410        G4double WminusTarget(0.);
     
    409422
    410423            NumberOfTries++;
     424//G4cout<<"NumberOfTries "<<NumberOfTries<<G4endl;
    411425            if(NumberOfTries == 100*(NumberOfTries/100))   // 100
    412426            { // At large number of tries it would be better to reduce the values
     
    439453
    440454               G4LorentzVector tmp(tmpPt.x(),tmpPt.y(),Xminus,0.);
     455//G4cout<<"Inv i mom "<<i<<" "<<tmp<<G4endl;
    441456               aNucleon->SetMomentum(tmp);
    442457             }   // end of for(G4int i=0; i < NumberOfInvolvedNucleon; i++ )
     
    447462             G4double DeltaXminus(0.);
    448463
     464//G4cout<<"ResidualMassNumber "<<ResidualMassNumber<<" "<<PtSum<<G4endl;
    449465             if(ResidualMassNumber == 0)
    450466             {
     
    457473              DeltaXminus = -1./theNucleus->GetMassNumber();
    458474             }
    459 
     475//G4cout<<"Dx y xmin "<<DeltaX<<" "<<DeltaY<<" "<<DeltaXminus<<G4endl;
    460476             XminusSum=1.;
    461477             M2target =0.;
     
    467483               Xminus = aNucleon->Get4Momentum().pz() - DeltaXminus;
    468484               XminusSum-=Xminus;               
    469 
    470                if((Xminus <= 0.)   || (Xminus > 1.) ||
    471                   (XminusSum <=0.) || (XminusSum > 1.)) {InerSuccess=false; break;}
    472  
     485//G4cout<<" i X-sum "<<i<<" "<<Xminus<<" "<<XminusSum<<G4endl;
     486               if(ResidualMassNumber == 0)                // Uzhi 5.07.10
     487               {
     488                if((Xminus <= 0.)   || (Xminus > 1.))    {InerSuccess=false; break;}
     489               } else
     490               {
     491                if((Xminus <= 0.)   || (Xminus > 1.) ||
     492                   (XminusSum <=0.) || (XminusSum > 1.)) {InerSuccess=false; break;}
     493               }                                          // Uzhi 5.07.10
     494
    473495               G4double Px=aNucleon->Get4Momentum().px() - DeltaX;
    474496               G4double Py=aNucleon->Get4Momentum().py() - DeltaY;
     
    482504             }   // end of for(G4int i=0; i < NumberOfInvolvedNucleon; i++ )
    483505
     506//G4cout<<"Rescale O.K."<<G4endl;
     507
    484508             if(InerSuccess && (ResidualMassNumber != 0))
    485509             {
    486510              M2target +=(ResidualMass*ResidualMass + PtSum.mag2())/XminusSum;
    487511             }
     512//G4cout<<"InerSuccess "<<InerSuccess<<G4endl;
     513//G4int Uzhi;G4cin>>Uzhi;
    488514            } while(!InerSuccess);
    489515          } while (SqrtS < Mprojectile + std::sqrt(M2target));
     
    495521          WminusTarget=(S-M2projectile+M2target+std::sqrt(DecayMomentum2))/2./SqrtS;
    496522          WplusProjectile=SqrtS - M2target/WminusTarget;
     523//G4cout<<"DecayMomentum2 "<<DecayMomentum2<<G4endl;
    497524//-------------------------------------------------------------
    498525          for(G4int i=0; i < NumberOfInvolvedNucleon; i++ )
     
    511538           if( E+Pz > WplusProjectile ){OuterSuccess=false; break;}
    512539          }   // end of for(G4int i=0; i < NumberOfInvolvedNucleon; i++ )
     540//G4int Uzhi;G4cin>>Uzhi;
    513541        } while(!OuterSuccess);
    514542
     
    575603        Successfull=false;
    576604        theParticipants.StartLoop();
     605
     606G4int MaxNumOfInelCollisions=G4int(theParameters->GetMaxNumberOfCollisions());
     607G4double NumberOfInel(0.);
     608//
     609if(MaxNumOfInelCollisions > 0) 
     610{   //  Plab > Pbound, Normal application of FTF is possible
     611 G4double ProbMaxNumber=theParameters->GetMaxNumberOfCollisions()-MaxNumOfInelCollisions;
     612 if(G4UniformRand() < ProbMaxNumber) {MaxNumOfInelCollisions++;}
     613 NumberOfInel=MaxNumOfInelCollisions;
     614} else
     615{   //  Plab < Pbound, Normal application of FTF is impossible, low energy corrections
     616 if(theParticipants.theNucleus->GetMassNumber() > 1)
     617 {
     618  NumberOfInel = theParameters->GetProbOfInteraction();
     619  MaxNumOfInelCollisions = 1;
     620 } else
     621 { // Special case for hadron-nucleon interactions
     622  NumberOfInel = 1.;
     623  MaxNumOfInelCollisions = 1;
     624 }
     625}  // end of if(MaxNumOfInelCollisions > 0)
     626//
    577627        while (theParticipants.Next())
    578628        {         
     
    581631           G4VSplitableHadron * projectile=collision.GetProjectile();
    582632           G4VSplitableHadron * target=collision.GetTarget();
    583 
     633//G4cout<<"ProbabilityOfElasticScatt "<<theParameters->GetProbabilityOfElasticScatt()<<G4endl;
    584634           if(G4UniformRand()< theParameters->GetProbabilityOfElasticScatt())
    585635           { //   Elastic scattering -------------------------
     636//G4cout<<"Elastic FTF"<<G4endl;
    586637            if(theElastic->ElasticScattering(projectile, target, theParameters))
    587638            {
     
    595646           else
    596647           { //   Inelastic scattering ----------------------
     648/*
    597649            if(theExcitation->ExciteParticipants(projectile, target,
    598650                                                 theParameters, theElastic))
     
    604656             target->SetStatus(2);
    605657            }
     658*/
     659//G4cout<<"InElastic FTF"<<G4endl;
     660            if(G4UniformRand()< NumberOfInel/MaxNumOfInelCollisions)
     661            {
     662             if(theExcitation->ExciteParticipants(projectile, target,
     663                                                 theParameters, theElastic))
     664             {
     665              Successfull = Successfull || true;
     666NumberOfInel--;
     667             } else
     668             {
     669              Successfull = Successfull || false;
     670              target->SetStatus(2);
     671             }
     672            } else // If NumOfInel
     673            {
     674             if(theElastic->ElasticScattering(projectile, target, theParameters))
     675             {
     676              Successfull = Successfull || true;
     677             } else
     678             {
     679              Successfull = Successfull || false;
     680              target->SetStatus(2);
     681             }
     682            }   // end if NumOfInel
    606683           }
    607684        }       // end of while (theParticipants.Next())
     
    624701
    625702        theParticipants.StartLoop();    // restart a loop
    626 
     703//
    627704        while ( theParticipants.Next() )
    628705        {
     
    634711                primaries.push_back(interaction.GetProjectile());     
    635712        }
    636            
     713
    637714        unsigned int ahadron;
    638715        for ( ahadron=0; ahadron < primaries.size() ; ahadron++)
     
    650727            if(SecondString != 0) strings->push_back(SecondString);
    651728        }
    652 
     729//
    653730        for (G4int ahadron=0; ahadron < NumberOfInvolvedNucleon ; ahadron++)
    654731        {
     
    669746        std::for_each(primaries.begin(), primaries.end(), DeleteVSplitableHadron());
    670747        primaries.clear();
    671 
    672748        return strings;
    673749}
Note: See TracChangeset for help on using the changeset viewer.