// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4QAtomicElectronScattering.cc,v 1.4 2008/10/02 21:10:07 dennis Exp $ // GEANT4 tag $Name: geant4-09-02-ref-02 $ // // ---------------- G4QAtomicElectronScattering class ----------------- // by Mikhail Kossov, December 2003. // G4QAtomicElectronScattering class of the CHIPS Simulation Branch in GEANT4 // --------------------------------------------------------------- // **************************************************************************************** // ********** This CLASS is temporary moved from the photolepton_hadron directory ********* // **************************************************************************************** //#define debug //#define pdebug #include "G4QAtomicElectronScattering.hh" G4QAtomicElectronScattering::G4QAtomicElectronScattering(const G4String& processName): G4VDiscreteProcess(processName, fElectromagnetic) { #ifdef debug G4cout<<"G4QAtomicElectronScattering::Constructor is called"<0) G4cout << GetProcessName() << " process is created "<< G4endl; G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture //@@ Initialize here the G4QuasmonString parameters } G4bool G4QAtomicElectronScattering::manualFlag=false; // If false:use standard parameters G4double G4QAtomicElectronScattering::Temperature=180.; // Critical Temperature (High Ener) G4double G4QAtomicElectronScattering::SSin2Gluons=0.3; // Supression of s-quarks (to u&d) G4double G4QAtomicElectronScattering::EtaEtaprime=0.3; // Supression of eta(gg->qq/3g->qq) G4double G4QAtomicElectronScattering::freeNuc=0.5; // % of free nucleons on a surface G4double G4QAtomicElectronScattering::freeDib=0.05; // % of free diBaryons on a surface G4double G4QAtomicElectronScattering::clustProb=5.; // Nuclear clusterization parameter G4double G4QAtomicElectronScattering::mediRatio=10.; // medium/vacuum hadronizationRatio G4int G4QAtomicElectronScattering::nPartCWorld=152; // #of particles in the CHIPS World G4double G4QAtomicElectronScattering::SolidAngle=0.5; // A part of Solid Angle to capture G4bool G4QAtomicElectronScattering::EnergyFlux=false; // Flag to use EnergyFlux or MultyQ G4double G4QAtomicElectronScattering::PiPrThresh=141.4; // PiProductionThreshold for gammas G4double G4QAtomicElectronScattering::M2ShiftVir=20000.;// M2=-Q2=m_pi^2 shift of virtGamma G4double G4QAtomicElectronScattering::DiNuclMass=1880.; // Double Nucleon Mass for VirtNorm void G4QAtomicElectronScattering::SetManual() {manualFlag=true;} void G4QAtomicElectronScattering::SetStandard() {manualFlag=false;} // Fill the private parameters void G4QAtomicElectronScattering::SetParameters(G4double temper, G4double ssin2g, G4double etaetap, G4double fN, G4double fD, G4double cP, G4double mR, G4int nParCW, G4double solAn, G4bool efFlag, G4double piThresh, G4double mpisq, G4double dinum) {// ============================================================================= Temperature=temper; SSin2Gluons=ssin2g; EtaEtaprime=etaetap; freeNuc=fN; freeDib=fD; clustProb=cP; mediRatio=mR; nPartCWorld = nParCW; EnergyFlux=efFlag; SolidAngle=solAn; PiPrThresh=piThresh; M2ShiftVir=mpisq; DiNuclMass=dinum; G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture } // Destructor G4QAtomicElectronScattering::~G4QAtomicElectronScattering() {} G4LorentzVector G4QAtomicElectronScattering::GetEnegryMomentumConservation() { return EnMomConservation; } G4int G4QAtomicElectronScattering::GetNumberOfNeutronsInTarget() { return nOfNeutrons; } G4double G4QAtomicElectronScattering::GetMeanFreePath(const G4Track& aTrack, G4double,G4ForceCondition* Fc) { *Fc = NotForced; const G4DynamicParticle* incidentParticle = aTrack.GetDynamicParticle(); G4ParticleDefinition* incidentParticleDefinition=incidentParticle->GetDefinition(); if( !IsApplicable(*incidentParticleDefinition)) G4cout<<"-Wa-G4QAtElScat::GetMeanFreePath called for not implemented particle"<GetTotalMomentum(); // 3-momentum of the Particle const G4Material* material = aTrack.GetMaterial(); // Get the current material const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume(); const G4ElementVector* theElementVector = material->GetElementVector(); G4int nE=material->GetNumberOfElements(); #ifdef debug G4cout<<"G4QAtomElectScattering::GetMeanFreePath:"<((*theElementVector)[i]->GetZ()); // Z of the Element std::vector*>* cs= Isotopes->GetCSVector(Z); // Pointer to CS G4int nIs=cs->size(); // A#Of Isotopes in the Element if(nIs) for(G4int j=0; j* curIs=(*cs)[j]; // A pointer, which is used twice G4int N=curIs->first; // #ofNeuterons in the isotope curIs->second = CSmanager->GetCrossSection(true,Momentum,Z,N,13); // CS calculation } // End of temporary initialization of the cross sections in the G4QIsotope singeltone sigma+=Isotopes->GetMeanCrossSection(Z)*NOfNucPerVolume[i]; // SUM(MeanCS*NOFNperV) } // End of LOOP over Elements // Check that cross section is not zero and return the mean free path if(sigma > 0.) return 1./sigma; // Mean path [distance] return DBL_MAX; } G4bool G4QAtomicElectronScattering::IsApplicable(const G4ParticleDefinition& particle) { if (particle == *( G4MuonPlus::MuonPlus() )) return true; else if (particle == *( G4MuonMinus::MuonMinus() )) return true; else if (particle == *( G4TauPlus::TauPlus() )) return true; else if (particle == *( G4TauMinus::TauMinus() )) return true; else if (particle == *( G4Electron::Electron() )) return true; else if (particle == *( G4Positron::Positron() )) return true; else if (particle == *( G4Gamma::Gamma() )) return true; else if (particle == *( G4Proton::Proton() )) return true; //else if (particle == *( G4Neutron::Neutron() )) return true; //else if (particle == *( G4PionMinus::PionMinus() )) return true; //else if (particle == *( G4PionPlus::PionPlus() )) return true; //else if (particle == *( G4KaonPlus::KaonPlus() )) return true; //else if (particle == *( G4KaonMinus::KaonMinus() )) return true; //else if (particle == *( G4KaonZeroLong::KaonZeroLong() )) return true; //else if (particle == *(G4KaonZeroShort::KaonZeroShort())) return true; //else if (particle == *( G4Lambda::Lambda() )) return true; //else if (particle == *( G4SigmaPlus::SigmaPlus() )) return true; //else if (particle == *( G4SigmaMinus::SigmaMinus() )) return true; //else if (particle == *( G4SigmaZero::SigmaZero() )) return true; //else if (particle == *( G4XiMinus::XiMinus() )) return true; //else if (particle == *( G4XiZero::XiZero() )) return true; //else if (particle == *( G4OmegaMinus::OmegaMinus() )) return true; //else if (particle == *( G4AntiNeutron::AntiNeutron() )) return true; //else if (particle == *( G4AntiProton::AntiProton() )) return true; #ifdef debug G4cout<<"***G4QAtomElScattering::IsApplicable: PDG="<GetPDGMass(); // muon mass static const G4double mu2=mu*mu; // squared muon mass //static const G4double dpi=M_PI+M_PI; // 2*pi (for Phi distr.) ***changed to twopi*** static const G4double mNeut= G4QPDGCode(2112).GetMass(); static const G4double mProt= G4QPDGCode(2212).GetMass(); static const G4double dM=mProt+mNeut; // doubled nucleon mass //static const G4double mPi0 = G4QPDGCode(111).GetMass(); //static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0); //static const G4double mPi = G4QPDGCode(211).GetMass(); //static const G4double mMu = G4QPDGCode(13).GetMass(); //static const G4double mTau = G4QPDGCode(15).GetMass(); //static const G4double mEl = G4QPDGCode(11).GetMass(); // const G4DynamicParticle* projHadron = track.GetDynamicParticle(); const G4ParticleDefinition* particle=projHadron->GetDefinition(); G4LorentzVector proj4M=projHadron->Get4Momentum(); G4double momentum = projHadron->GetTotalMomentum(); // 3-momentum of the Particle G4double Momentum=proj4M.rho(); if(std::fabs(Momentum-momentum)>.001) G4cerr<<"G4QAtElScat::PSDI P="<GetElementVector(); G4int i=0; G4double sum=0.; G4int nE=material->GetNumberOfElements(); #ifdef debug G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<GetPDGEncoding(); G4cout<<"G4QAtomElScat::PostStepRestDoIt: projPDG="< sumfra; for(i=0; iGetFractionVector()[i]; sum+=frac; sumfra.push_back(sum); // remember the summation steps } G4double rnd = sum*G4UniformRand(); for(i=0; i(pElement->GetZ()); if(Z<=0) { G4cerr<<"-Warning-G4QAtomicElectronScattering::PostStepDoIt: Element's Z="<GetIsotopeVector(); if(isoVector) isoSize=isoVector->size(); // Get real size of the isotopeVector if exists #ifdef debug G4cout<<"G4QAtomicElectronScattering::PostStepDoIt: isovectorLength="<GetLastIndex(Z); if(!curInd) // The new artificial element must be defined { std::vector*>* newAbund = new std::vector*>; G4double* abuVector=pElement->GetRelativeAbundanceVector(); for(G4int j=0; jGetIsotope(j)->GetN()-Z; if(pElement->GetIsotope(j)->GetZ()!=Z) G4cerr<<"*G4QCaptureAtRest::AtRestDoIt: Z=" <GetIsotope(j)->GetZ()<<"#"<* pr= new std::pair(N,abund); #ifdef debug G4cout<<"G4QAtomElScat::PostStepDoIt:pair#="<leptE="<GetExchangeQ2(photonEnergy);// Q2(t) of EqivExchangePart G4double W=photonEnergy-photonQ2/dM;// HadronicEnergyFlow (W-energy) for virtual photon if(W<0.) { //Do Nothing Action insead of the reaction G4cout<<"G4QAtomElScat::PostStepDoIt:(lN) negative equivalent energy W="<GetCrossSection(true,photonEnergy, Z, N);// Integrated CS G4double sigK =thePhotonData->GetCrossSection(true, W, Z, N); // Real CrosSect G4double rndFraction = CSmanager->GetVirtualFactor(photonEnergy, photonQ2); if(sigNu*G4UniformRand()>sigK*rndFraction) { //Do NothingToDo Action insead of the reaction G4cout<<"G4QAtomElectScat::PostStepDoIt: probability correction - DoNothing"<0) aParticleChange.ProposeEnergy(finE) ; else { aParticleChange.ProposeEnergy(0.) ; aParticleChange.ProposeTrackStatus(fStopAndKill); } // Scatter the muon G4double EEm=iniE*finE-mu2; // Just an intermediate value to avoid "2*" G4double iniP=std::sqrt(iniE*iniE-mu2); // Initial momentum of the electron G4double finP=std::sqrt(finE*finE-mu2); // Final momentum of the electron G4double cost=(EEm+EEm-photonQ2)/iniP/finP; // cos(theta) for the electron scattering if(cost>1.) cost=1.; // To avoid the accuracy of calculation problem //else if(cost>1.001) // @@ error report can be done, but not necessary if(cost<-1.) cost=-1.; // To avoid the accuracy of calculation problem //else if(cost<-1.001) // @@ error report can be done, but not necessary // --- Example from electromagnetic physics -- //G4ThreeVector newMuonDirection(dirx,diry,dirz); //newMuonDirection.rotateUz(dir); //aParticleChange.ProposeMomentumDirection(newMuonDirection1) ; // The scattering in respect to the derection of the incident muon is made impicitly: G4ThreeVector ort=dir.orthogonal(); // Not normed orthogonal vector (!) (to dir) G4ThreeVector ortx = ort.unit(); // First unit vector orthogonal to the direction G4ThreeVector orty = dir.cross(ortx);// Second unit vector orthoganal to the direction G4double sint=std::sqrt(1.-cost*cost); // Perpendicular component G4double phi=twopi*G4UniformRand(); // phi of scattered electron G4double sinx=sint*std::sin(phi); // x-component G4double siny=sint*std::cos(phi); // y-component G4ThreeVector findir=cost*dir+sinx*ortx+siny*orty; aParticleChange.ProposeMomentumDirection(findir); // new direction for the muon const G4ThreeVector photon3M=iniP*dir-finP*findir; projPDG=22; proj4M=G4LorentzVector(photon3M,photon3M.mag()); } G4int targPDG=90000000+Z*1000+N; // PDG Code of the target nucleus G4QPDGCode targQPDG(targPDG); G4double tM=targQPDG.GetMass(); EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM); // Total 4-mom of the reaction G4QHadronVector* output=new G4QHadronVector; // Prototype of the output G4QHadronVector // @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin //G4bool elF=false; // Flag of the ellastic scattering is "false" by default //G4double eWei=1.; // @@@@@@@@@@@@@@ Temporary for the testing purposes --- End #ifdef debug G4cout<<"G4QAtomElScat::PostStepDoIt: projPDG="< DELETED --+ | delete pH; // --------<-------+---+ #ifdef debug G4double mp=G4QPDGCode(projPDG).GetMass(); // Mass of the projectile particle | G4cout<<"G4QAtomElectScat::PostStepDoIt: pPDG="<>G4QAtomElScat::PostStepDoIt:elF="<size(); // A#of hadrons in the output aParticleChange.SetNumberOfSecondaries(tNH); // Now add nuclear fragments #ifdef debug G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<size(); // Real length of the output @@ Temporary if(tNH==1) tNH=0; // @@ Temporary if(tNH==2&&2!=nOut) G4cout<<"--Warning--G4QAtomElScat::PostStepDoIt: 2 # "< work for Hisaya @@ // The decau process for hypernuclei must be developed in GEANT4 (change CHIPS body) G4QHadron* hadr=output->operator[](i); // Pointer to the output hadron G4int PDGCode = hadr->GetPDGCode(); G4int nFrag = hadr->GetNFragments(); #ifdef pdebug G4cout<<"G4QAtomElectScat::AtRestDoIt: H#"<