Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNARuddIonisationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNARuddIonisationModel.cc,v 1.10 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNARuddIonisationModel.cc,v 1.17 2010/04/07 20:08:31 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    271271  // InitialiseElementSelectors(particle,cuts);
    272272
    273   // Test if water material
    274 
    275   flagMaterialIsWater= false;
    276   densityWater = 0;
    277 
    278   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    279 
    280   if(theCoupleTable)
    281   {
    282     G4int numOfCouples = theCoupleTable->GetTableSize();
    283  
    284     if(numOfCouples>0)
    285     {
    286           for (G4int i=0; i<numOfCouples; i++)
    287           {
    288             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    289             const G4Material* material = couple->GetMaterial();
    290 
    291             if (material->GetName() == "G4_WATER")
    292             {
    293               G4double density = material->GetAtomicNumDensityVector()[1];
    294               flagMaterialIsWater = true;
    295               densityWater = density;
    296              
    297               if (verboseLevel > 3)
    298               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    299             }
    300  
    301           }
    302 
    303     } // if(numOfCouples>0)
    304 
    305   } // if (theCoupleTable)
    306 
    307273}
    308274
    309275//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    310276
    311 G4double G4DNARuddIonisationModel::CrossSectionPerVolume(const G4Material*,
     277G4double G4DNARuddIonisationModel::CrossSectionPerVolume(const G4Material* material,
    312278                                           const G4ParticleDefinition* particleDefinition,
    313279                                           G4double k,
     
    355321  G4double sigma=0;
    356322
    357   if (flagMaterialIsWater)
     323  if (material->GetName() == "G4_WATER")
    358324  {
    359325    const G4String& particleName = particleDefinition->GetParticleName();
     
    421387                        G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    422388                        G4cout << " - Cross section per water molecule (cm^2)=" << tmp1/cm/cm << G4endl;
    423                         G4cout << " - Cross section per water molecule (cm^-1)=" << tmp1*densityWater/(1./cm) << G4endl;
     389                        G4cout << " - Cross section per water molecule (cm^-1)=" <<
     390                        tmp1*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    424391                      }
    425                       return tmp1*densityWater;
     392                      return tmp1*material->GetAtomicNumDensityVector()[1];
    426393                  }
    427394
     
    434401                        G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    435402                        G4cout << " - Cross section per water molecule (cm^2)=" << tmp2/cm/cm << G4endl;
    436                         G4cout << " - Cross section per water molecule (cm^-1)=" << tmp2*densityWater/(1./cm) << G4endl;
     403                        G4cout << " - Cross section per water molecule (cm^-1)=" << tmp2*
     404                        material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    437405                      }
    438                       return tmp2*densityWater;
     406                      return tmp2*material->GetAtomicNumDensityVector()[1];
    439407                  }
    440408              }     
     
    454422      G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    455423      G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    456       G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     424      G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*
     425      material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    457426    }
    458427 
    459428  } // if (waterMaterial)
    460429 
    461  return sigma*densityWater;               
     430 return sigma*material->GetAtomicNumDensityVector()[1];           
    462431
    463432}
     
    562531      fvect->push_back(dp);
    563532
    564       /*
    565     // creating neutral water molechule...
    566 
    567     G4DNAGenericMoleculeManager *instance;
    568     instance = G4DNAGenericMoleculeManager::Instance();
    569     G4ParticleDefinition* waterDef = NULL;
    570     G4Molecule* water = instance->GetMolecule("H2O");
    571     waterDef = (G4ParticleDefinition*)water;
    572 
    573     direction.set(0.,0.,0.);
    574 
    575     //G4DynamicParticle* dynamicWater = new G4DynamicParticle(waterDef, direction, bindingEnergy);
    576     G4DynamicMolecule* dynamicWater = new G4DynamicMolecule(water, direction, bindingEnergy);
    577     //dynamicWater->RemoveElectron(ionizationShell, 1);
    578 
    579     G4DynamicMolecule* dynamicWater2 = new G4DynamicMolecule(water, direction, bindingEnergy);
    580     G4DynamicMolecule* dynamicWater3 = new G4DynamicMolecule(water, direction, bindingEnergy);
    581     // insertion inside secondaries
    582 
    583     fvect->push_back(dynamicWater);
    584     fvect->push_back(dynamicWater2);
    585     fvect->push_back(dynamicWater3);
    586       */
    587533  }
    588534
     
    623569  G4double crossSectionMaximum = 0.;
    624570 
    625   for(G4double value=waterStructure.IonisationEnergy(shell); value<=4.*waterStructure.IonisationEnergy(shell) ; value+=0.1*eV)
     571  for(G4double value=waterStructure.IonisationEnergy(shell); value<=5.*waterStructure.IonisationEnergy(shell) && k>=value ; value+=0.1*eV)
    626572  {
    627573      G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k, value, shell);
     
    710656  G4double alphaConst ;
    711657
     658  const G4double Bj[5] = {12.61*eV, 14.73*eV, 18.55*eV, 32.20*eV, 539.7*eV};
     659
    712660  if (j == 4)
    713661  {
     
    746694
    747695  G4double wBig = (energyTransfer - waterStructure.IonisationEnergy(ionizationLevelIndex));
    748   G4double w = wBig / waterStructure.IonisationEnergy(ionizationLevelIndex);
     696  if (wBig<0) return 0.;
     697
     698  G4double w = wBig / Bj[ionizationLevelIndex];
    749699  G4double Ry = 13.6*eV;
    750700
     
    764714  }
    765715 
    766   G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/waterStructure.IonisationEnergy(ionizationLevelIndex)),2);
    767   G4double v2 = tau / waterStructure.IonisationEnergy(ionizationLevelIndex);
     716  G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/Bj[ionizationLevelIndex]),2);
     717  G4double v2 = tau / Bj[ionizationLevelIndex];
    768718  G4double v = std::sqrt(v2);
    769   G4double wc = 4.*v2 - 2.*v - (Ry/(4.*waterStructure.IonisationEnergy(ionizationLevelIndex)));
     719  G4double wc = 4.*v2 - 2.*v - (Ry/(4.*Bj[ionizationLevelIndex]));
    770720
    771721  G4double L1 = (C1* std::pow(v,(D1))) / (1.+ E1*std::pow(v, (D1+4.)));
     
    777727  G4double F2 = (L2*H2)/(L2+H2);
    778728
    779   G4double sigma = CorrectionFactor(particleDefinition, k/eV)
    780     * Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex))
     729  G4double sigma = CorrectionFactor(particleDefinition, k)
     730    * Gj[j] * (S/Bj[ionizationLevelIndex])
     731    * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
     732
     733  if ( (particleDefinition == instance->GetIon("hydrogen")) && (ionizationLevelIndex==4))
     734
     735    sigma = Gj[j] * (S/Bj[ionizationLevelIndex])
    781736    * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
    782737
     
    823778          )
    824779  {
    825       sigma = Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex)) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
     780      sigma = Gj[j] * (S/Bj[ionizationLevelIndex]) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
    826781   
    827782      G4double zEff = particleDefinition->GetPDGCharge() / eplus + particleDefinition->GetLeptonNumber();
     
    916871    if (particleDefinition == instance->GetIon("hydrogen"))
    917872    {
    918         G4double value = (std::log(k/eV)-4.2)/0.5;
     873        G4double value = (std::log10(k/eV)-4.2)/0.5;
    919874        return((0.8/(1+std::exp(value))) + 0.9);
    920875    }
     
    932887  // BEGIN PART 1/2 OF ELECTRON CORRECTION
    933888
    934   // add ONE or TWO electron-water excitation for alpha+ and helium
     889  // add ONE or TWO electron-water ionisation for alpha+ and helium
    935890   
    936891  G4DNAGenericIonsManager *instance;
    937892  instance = G4DNAGenericIonsManager::Instance();
    938893  G4double kElectron(0);
    939   G4double electronComponent(0);
     894
    940895  G4DNACrossSectionDataSet * electronDataset = new G4DNACrossSectionDataSet (new G4LogLogInterpolation, eV, (1./3.343e22)*m*m);
    941896 
     
    949904      kElectron = k * 0.511/3728;
    950905       
    951       electronComponent = electronDataset->FindValue(kElectron);
    952        
    953906  }     
    954  
    955   delete electronDataset;
    956907 
    957908  // END PART 1/2 OF ELECTRON CORRECTION
     
    982933
    983934              // BEGIN PART 2/2 OF ELECTRON CORRECTION
    984 
     935              // Use only electron partial cross sections
     936             
    985937              if (particle == instance->GetIon("alpha+")->GetParticleName())
    986                 {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + electronComponent; }
    987      
     938                {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + electronDataset->GetComponent(i)->FindValue(kElectron); }
     939
    988940              if (particle == instance->GetIon("helium")->GetParticleName())
    989                 {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + 2*electronComponent; }
    990      
     941                {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + 2*electronDataset->GetComponent(i)->FindValue(kElectron); }
     942
    991943              // BEGIN PART 2/2 OF ELECTRON CORRECTION
    992944
     
    1001953          {
    1002954              i--;
     955             
    1003956               
    1004957              if (valuesBuffer[i] > value)
    1005958              {
    1006959                  delete[] valuesBuffer;
     960                 
     961                  if (electronDataset) delete electronDataset;
     962                 
    1007963                  return i;
    1008964              }
     
    1018974    G4Exception("G4DNARuddIonisationModel::RandomSelect: attempting to calculate cross section for wrong particle");
    1019975  }
     976
     977  delete electronDataset;
    1020978     
    1021979  return level;
Note: See TracChangeset for help on using the changeset viewer.