Exemple #1
0
float CS_FluorLine(int Z, int line, float E)
{
  float JumpK;
  float cs_line, Factor = 1.;

  if (Z<1 || Z>ZMAX) {
    ErrorExit("Z out of range in function CS_FluorLine");
    return 0;
  }

  if (E <= 0.) {
    ErrorExit("Energy <=0 in function CS_FluorLine");
    return 0;
  }

  if (line>=KN5_LINE && line<=KB_LINE) {
    if (E > EdgeEnergy(Z, K_SHELL)) {
      JumpK = JumpFactor(Z, K_SHELL);
      if (JumpK <= 0.)
	return 0.;
      Factor = ((JumpK-1)/JumpK) * FluorYield(Z, K_SHELL);
    }
    else
      return 0.;                               
    cs_line = CS_Photo(Z, E) * Factor * RadRate(Z, line) ;
  }

  else if (line>=L1P5_LINE && line<=L1L2_LINE) {
	Factor=Jump_from_L1(Z,E);
	cs_line = CS_Photo(Z, E) * Factor * RadRate(Z, line) ;
  }
  
  else if (line>=L2Q1_LINE && line<=L2L3_LINE)  {
	Factor=Jump_from_L2(Z,E);
	cs_line = CS_Photo(Z, E) * Factor * RadRate(Z, line) ;
  }
  /*
   * it's safe to use LA_LINE since it's only composed of 2 L3-lines
   */
  else if ((line>=L3Q1_LINE && line<=L3M1_LINE) || line==LA_LINE) {
	Factor=Jump_from_L3(Z,E);
	cs_line = CS_Photo(Z, E) * Factor * RadRate(Z, line) ;
  }
  else if (line==LB_LINE) {
   	/*
	 * b1->b17
	 */
   	cs_line=Jump_from_L2(Z,E)*(RadRate(Z,L2M4_LINE)+RadRate(Z,L2M3_LINE))+
		   Jump_from_L3(Z,E)*(RadRate(Z,L3N5_LINE)+RadRate(Z,L3O4_LINE)+RadRate(Z,L3O5_LINE)+RadRate(Z,L3O45_LINE)+RadRate(Z,L3N1_LINE)+RadRate(Z,L3O1_LINE)+RadRate(Z,L3N6_LINE)+RadRate(Z,L3N7_LINE)+RadRate(Z,L3N4_LINE)) +
		   Jump_from_L1(Z,E)*(RadRate(Z,L1M3_LINE)+RadRate(Z,L1M2_LINE)+RadRate(Z,L1M5_LINE)+RadRate(Z,L1M4_LINE));
   	cs_line*=CS_Photo(Z, E);
  }

  else {
    ErrorExit("Line not allowed in function CS_FluorLine");
    return 0;
  }
  
  
  return (cs_line);
}            
Exemple #2
0
int getAtomicXRayCS_Kissel (int shellID)
{
  int   i, Z;
  float energy_keV;
  
  Z = SymbolToAtomicNumber ( targetFormula );
  edgeEnergy = 0.0;
  fluorYield = 1.0;
  jumpFactor = 1.0;
  levelWidth = 0.0;
  electronConfig  = Z;

  if (verbose > 3) { 
    fprintf(stdout, "getAtomicXRayCS: Z = %d\n", Z);
    fprintf(stdout, "getAtomicXRayCS_Kissel: shellID = %d\n", shellID);
    if (verbose>2) { fprintf(stdout, "Index  PhotonEnergy   TotalCS      PhotoCS     coherentCS   incohrentCS \n"); }
  }

  if (shellID <= 30 && shellID >= 0) {
    edgeEnergy = 1000.0 * EdgeEnergy(Z, shellID);
    fluorYield = FluorYield(Z, shellID);
    jumpFactor = JumpFactor(Z, shellID);
    electronConfig  = ElectronConfig(Z, shellID);
    levelWidth = AtomicLevelWidth(Z, shellID);
    for ( i = 0; i < npts; i++ ) {
      energy_keV  = 0.001 * energy[i];
      if ( energy[i] > edgeEnergy ) {
        photo[i]  = CS_Photo_Partial (Z, shellID, energy_keV);
      } else {
        photo[i]  = 0.0;
      }
      total[i]    = 0.0;
      rayleigh[i] = 0.0;
      compton[i]  = 0.0;
      if (verbose>2) { fprintf(stdout, "%4d %12.1f %12.4g %12.4g %12.4g %12.4g \n", i, energy[i], total[i], photo[i], rayleigh[i], compton[i]); }
    }
  } else if (shellID > 99) {
    for ( i = 0; i < npts; i++ ) {
      energy_keV  = 0.001 * energy[i];
      total[i]    = CS_Total_Kissel ( Z, energy_keV );
      photo[i]    = CS_Photo_Total  ( Z, energy_keV );
      rayleigh[i] = CS_Rayl  ( Z, energy_keV );
      compton[i]  = CS_Compt ( Z, energy_keV );
      if (verbose>2) { fprintf(stdout, "%4d %12.1f %12.4g %12.4g %12.4g %12.4g \n", i, energy[i], total[i], photo[i], rayleigh[i], compton[i]); }
    }
  } else {
    for ( i = 0; i < npts; i++ ) {
      energy_keV  = 0.001 * energy[i];
      photo[i]    = CS_Photo ( Z, energy_keV );
      total[i]    = CS_Total ( Z, energy_keV );
      rayleigh[i] = CS_Rayl  ( Z, energy_keV );
      compton[i]  = CS_Compt ( Z, energy_keV );
      if (verbose>2) { fprintf(stdout, "%4d %12.1f %12.4g %12.4g %12.4g %12.4g \n", i, energy[i], total[i], photo[i], rayleigh[i], compton[i]); }
    }
  }

  if (verbose > 1) { 
    fprintf(stdout, "edgeEnergy = %f, fluorYield = %f,  jumpFactor = %f,", edgeEnergy, fluorYield, jumpFactor);
    fprintf(stdout, " electronConfig = %f, levelWidth = %f \n", electronConfig, levelWidth);
  }
  return 0;
}