Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::SimpleAtomPhotoAbsCS Class Reference

#include <PhotoAbsCS.h>

+ Inheritance diagram for Heed::SimpleAtomPhotoAbsCS:

Public Member Functions

 SimpleAtomPhotoAbsCS ()
 Default constructor.
 
 SimpleAtomPhotoAbsCS (int fZ, const std::string &ffile_name)
 
 SimpleAtomPhotoAbsCS (int fZ, std::shared_ptr< PhotoAbsCS > fasc)
 
virtual ~SimpleAtomPhotoAbsCS ()
 Destructor.
 
virtual double get_threshold (int nshell) const
 Get the ionization threshold for a given shell.
 
virtual double get_ACS (double energy) const
 
virtual double get_integral_ACS (double energy1, double energy2) const
 Integrated photo-absorption cross-section overa given interval.
 
virtual double get_ACS (int nshell, double energy) const
 Sub-shell photo-absorption cross-section [Mbarn] at a given energy [MeV].
 
virtual double get_integral_ACS (int nshell, double energy1, double energy2y) const
 Integrated sub-shell photo-absorption cross-section.
 
virtual double get_ICS (double energy) const
 
virtual double get_integral_ICS (double energy1, double energy2) const
 Integrated photo-ionization cross-section over a given interval.
 
virtual double get_ICS (int nshell, double energy) const
 Sub-shell photo-ionization cross-section at a given energy.
 
virtual double get_integral_ICS (int nshell, double energy1, double energy2) const
 Integrated sub-shell photo-ionization cross-section.
 
virtual int get_main_shell_number (int nshell) const
 
virtual void print (std::ostream &file, int l) const
 
virtual SimpleAtomPhotoAbsCScopy () const
 
- Public Member Functions inherited from Heed::AtomPhotoAbsCS
 AtomPhotoAbsCS ()
 Default constructor.
 
int get_Z () const
 Get the atomic number.
 
unsigned int get_qshell () const
 Get the number of shells.
 
virtual double get_threshold (int nshell) const =0
 Get the ionization threshold for a given shell.
 
virtual double get_I_min () const
 Get the lowest ionization threshold among all shells.
 
virtual double get_ACS (double energy) const =0
 
virtual double get_integral_ACS (double energy1, double energy2) const =0
 Integrated photo-absorption cross-section overa given interval.
 
virtual double get_ACS (int nshell, double energy) const =0
 Sub-shell photo-absorption cross-section [Mbarn] at a given energy [MeV].
 
virtual double get_integral_ACS (int nshell, double energy1, double energy2) const =0
 Integrated sub-shell photo-absorption cross-section.
 
virtual double get_ICS (double energy) const =0
 
virtual double get_TICS (double energy, double factual_minimal_threshold) const
 
virtual double get_integral_ICS (double energy1, double energy2) const =0
 Integrated photo-ionization cross-section over a given interval.
 
virtual double get_integral_TICS (double energy1, double energy2, double factual_minimal_threshold) const
 Integral photo-ionization cross-section with redefined threshold.
 
virtual double get_ICS (int nshell, double energy) const =0
 Sub-shell photo-ionization cross-section at a given energy.
 
virtual double get_TICS (int nshell, double energy, double factual_minimal_threshold) const
 Sub-shell photo-ionization cross-section with redefined threshold.
 
virtual double get_integral_ICS (int nshell, double energy1, double energy2) const =0
 Integrated sub-shell photo-ionization cross-section.
 
virtual double get_integral_TICS (int nshell, double energy1, double energy2, double factual_minimal_threshold) const
 Integrated sub-shell photo-ionization cross-section (redefined threshold).
 
virtual void get_escape_particles (const int nshell, double energy, std::vector< double > &el_energy, std::vector< double > &ph_energy) const
 
virtual int get_main_shell_number (int nshell) const =0
 
virtual void remove_shell (int nshell)
 Deactivate a sub-shell. Set s_ignore_shell flag to true.
 
virtual void restore_shell (int nshell)
 Activate a sub-shell. Set s_ignore_shell flag to false.
 
virtual void print (std::ostream &file, int l) const
 
virtual AtomPhotoAbsCScopy () const =0
 
AtomicSecondaryProductsget_asp (int nshell)
 

Protected Attributes

std::string file_name
 Filename (saved for printing).
 
std::vector< std::shared_ptr< PhotoAbsCS > > m_acs
 
- Protected Attributes inherited from Heed::AtomPhotoAbsCS
std::string name
 Name of the atom.
 
int Z
 Atomic number.
 
int qshell
 Number of shells.
 
std::vector< bool > s_ignore_shell
 
std::vector< AtomicSecondaryProductsasp
 Sampling of relaxation products for each shell.
 

Detailed Description

Simple atomic photoabsorption cross-section (no difference between absorption and ionization).

Definition at line 388 of file PhotoAbsCS.h.

Constructor & Destructor Documentation

◆ SimpleAtomPhotoAbsCS() [1/3]

Heed::SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS ( )

Default constructor.

Definition at line 859 of file PhotoAbsCS.cpp.

859: AtomPhotoAbsCS() {}
AtomPhotoAbsCS()
Default constructor.
Definition: PhotoAbsCS.cpp:580

Referenced by copy().

◆ SimpleAtomPhotoAbsCS() [2/3]

Heed::SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS ( int  fZ,
const std::string &  ffile_name 
)

Constructor for reading name and shell energies from file. Generates the CS by PhenoPhotoAbsCS.

Definition at line 861 of file PhotoAbsCS.cpp.

863 : file_name(ffile_name) {
864 mfunnamep("SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS(...)");
865 check_econd11(fZ, < 1, mcerr);
866 std::ifstream file(file_name.c_str());
867 if (!file) {
868 funnw.ehdr(mcerr);
869 mcerr << "cannot open file " << file_name << std::endl;
870 spexit(mcerr);
871 }
872 while (findmark(file, "#") == 1) {
873 file >> Z;
874 if (Z != fZ) continue;
875 file >> qshell;
876 check_econd21(qshell, < 1 ||, > 10000, mcerr);
877 s_ignore_shell.resize(qshell, false);
878 file >> name;
879 m_acs.resize(qshell);
880 asp.resize(qshell);
881 std::vector<double> fl(qshell);
882 int sZshell = 0;
883 for (int nshell = 0; nshell < qshell; ++nshell) {
884 double thr = 0.0;
885 int Zshell = 0;
886 std::string shell_name;
887 file >> thr;
888 check_econd11(thr, <= 0.0, mcerr);
889 file >> Zshell;
890 check_econd11(Zshell, <= 0, mcerr);
891 sZshell += Zshell;
892 file >> fl[nshell];
893 findmark(file, "!");
894 file >> shell_name;
895 m_acs[nshell].reset(new PhenoPhotoAbsCS(shell_name, Zshell, thr * 1.0e-6));
896 }
897 check_econd12(sZshell, !=, Z, mcerr);
898
899 int n_min = 0;
900 double st = DBL_MAX;
901 for (int nshell = 0; nshell < qshell; ++nshell) {
902 // currently the minimal shell is the last,
903 // but to avoid this assumption we check all
904 if (get_threshold(nshell) < st) n_min = nshell;
905 }
906 for (int nshell = 0; nshell < qshell; ++nshell) {
907 if (fl[nshell] <= 0) continue;
908 check_econd12(nshell, ==, n_min, mcerr);
909 std::vector<double> felectron_energy;
910 std::vector<double> fphoton_energy;
911 fphoton_energy.push_back(get_threshold(nshell) - get_threshold(n_min));
912 asp[nshell].add_channel(fl[nshell], felectron_energy, fphoton_energy);
913 }
914 return;
915 }
916 funnw.ehdr(mcerr);
917 mcerr << "there is no element Z=" << fZ << " in file " << file_name << '\n';
918 spexit(mcerr);
919}
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
Definition: FunNameStack.h:191
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:163
std::vector< bool > s_ignore_shell
Definition: PhotoAbsCS.h:379
int Z
Atomic number.
Definition: PhotoAbsCS.h:371
std::string name
Name of the atom.
Definition: PhotoAbsCS.h:369
int qshell
Number of shells.
Definition: PhotoAbsCS.h:373
std::vector< AtomicSecondaryProducts > asp
Sampling of relaxation products for each shell.
Definition: PhotoAbsCS.h:381
std::vector< std::shared_ptr< PhotoAbsCS > > m_acs
Definition: PhotoAbsCS.h:424
std::string file_name
Filename (saved for printing).
Definition: PhotoAbsCS.h:423
virtual double get_threshold(int nshell) const
Get the ionization threshold for a given shell.
Definition: PhotoAbsCS.cpp:934
int findmark(std::istream &file, const char *s)
Definition: findmark.cpp:19
#define mcerr
Definition: prstream.h:128

◆ SimpleAtomPhotoAbsCS() [3/3]

Heed::SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS ( int  fZ,
std::shared_ptr< PhotoAbsCS fasc 
)

Constructor with one prepared preliminary shell with Z electrons. Convenient for hydrogen.

Definition at line 921 of file PhotoAbsCS.cpp.

921 {
922 mfunname("SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS(...)");
923 check_econd11(facs, == nullptr, mcerr);
924 check_econd11(fZ, <= 0, mcerr);
925 check_econd12(fZ, !=, facs->get_Z(), mcerr);
926 Z = fZ;
927 qshell = 1;
928 s_ignore_shell.resize(qshell, false);
929 name = facs->get_name();
930 m_acs.resize(1);
931 m_acs[0] = std::move(facs);
932}
#define mfunname(string)
Definition: FunNameStack.h:45

◆ ~SimpleAtomPhotoAbsCS()

virtual Heed::SimpleAtomPhotoAbsCS::~SimpleAtomPhotoAbsCS ( )
inlinevirtual

Destructor.

Definition at line 399 of file PhotoAbsCS.h.

399{}

Member Function Documentation

◆ copy()

virtual SimpleAtomPhotoAbsCS * Heed::SimpleAtomPhotoAbsCS::copy ( ) const
inlinevirtual

Implements Heed::AtomPhotoAbsCS.

Definition at line 417 of file PhotoAbsCS.h.

417 {
418 return new SimpleAtomPhotoAbsCS(*this);
419 }
SimpleAtomPhotoAbsCS()
Default constructor.
Definition: PhotoAbsCS.cpp:859

◆ get_ACS() [1/2]

double Heed::SimpleAtomPhotoAbsCS::get_ACS ( double  energy) const
virtual

Photo-absorption cross-section [Mbarn] at a given energy [MeV]. The photo-absorption cross-section can include excitation.

Implements Heed::AtomPhotoAbsCS.

Definition at line 940 of file PhotoAbsCS.cpp.

940 {
941 mfunname("double SimpleAtomPhotoAbsCS::get_ACS(double energy) const");
942 double s = 0.0;
943 for (int n = 0; n < qshell; ++n) {
944 if (!s_ignore_shell[n]) s += m_acs[n]->get_CS(energy);
945 }
946 return s;
947}

◆ get_ACS() [2/2]

double Heed::SimpleAtomPhotoAbsCS::get_ACS ( int  nshell,
double  energy 
) const
virtual

Sub-shell photo-absorption cross-section [Mbarn] at a given energy [MeV].

Implements Heed::AtomPhotoAbsCS.

Definition at line 967 of file PhotoAbsCS.cpp.

967 {
968 mfunname("double SimpleAtomPhotoAbsCS::get_ACS(int nshell, double energy)");
969 check_econd21(nshell, < 0 ||, > qshell, mcerr);
970 return s_ignore_shell[nshell] ? 0. : m_acs[nshell]->get_CS(energy);
971}

◆ get_ICS() [1/2]

double Heed::SimpleAtomPhotoAbsCS::get_ICS ( double  energy) const
virtual

Photo-ionization cross-section [Mbarn] at a given energy [MeV]. The photo-ionization cross-section does not include excitation.

Implements Heed::AtomPhotoAbsCS.

Definition at line 980 of file PhotoAbsCS.cpp.

980 {
981 mfunname("double SimpleAtomPhotoAbsCS::get_ICS(double energy) const");
982 double s = 0.0;
983 for (int n = 0; n < qshell; ++n) {
984 if (!s_ignore_shell[n]) s += m_acs[n]->get_CS(energy);
985 }
986 return s;
987}

◆ get_ICS() [2/2]

double Heed::SimpleAtomPhotoAbsCS::get_ICS ( int  nshell,
double  energy 
) const
virtual

Sub-shell photo-ionization cross-section at a given energy.

Implements Heed::AtomPhotoAbsCS.

Definition at line 999 of file PhotoAbsCS.cpp.

999 {
1000 mfunname("double SimpleAtomPhotoAbsCS::get_ICS(int nshell, double energy)");
1001 check_econd21(nshell, < 0 ||, > qshell, mcerr);
1002 return s_ignore_shell[nshell] ? 0. : m_acs[nshell]->get_CS(energy);
1003}

◆ get_integral_ACS() [1/2]

double Heed::SimpleAtomPhotoAbsCS::get_integral_ACS ( double  energy1,
double  energy2 
) const
virtual

Integrated photo-absorption cross-section overa given interval.

Implements Heed::AtomPhotoAbsCS.

Definition at line 948 of file PhotoAbsCS.cpp.

949 {
950 mfunnamep("double SimpleAtomPhotoAbsCS::get_integral_ACS(...) const");
951 double s = 0.0;
952 for (int n = 0; n < qshell; ++n) {
953 if (s_ignore_shell[n]) continue;
954 const double t = m_acs[n]->get_integral_CS(energy1, energy2);
955 if (t < 0) {
956 funnw.ehdr(mcout);
957 mcout << "t < 0\n";
958 Iprintn(mcout, t);
959 print(mcout, 4);
960 spexit(mcout);
961 }
962 s += t;
963 }
964 return s;
965}
virtual void print(std::ostream &file, int l) const
#define mcout
Definition: prstream.h:126
#define Iprintn(file, name)
Definition: prstream.h:205

◆ get_integral_ACS() [2/2]

double Heed::SimpleAtomPhotoAbsCS::get_integral_ACS ( int  nshell,
double  energy1,
double  energy2 
) const
virtual

Integrated sub-shell photo-absorption cross-section.

Implements Heed::AtomPhotoAbsCS.

Definition at line 973 of file PhotoAbsCS.cpp.

974 {
975 mfunname("double SimpleAtomPhotoAbsCS::get_integral_ACS(...) const");
976 check_econd21(nshell, < 0 ||, > qshell, mcerr);
977 return s_ignore_shell[nshell] ? 0. : m_acs[nshell]->get_integral_CS(en1, en2);
978}

◆ get_integral_ICS() [1/2]

double Heed::SimpleAtomPhotoAbsCS::get_integral_ICS ( double  energy1,
double  energy2 
) const
virtual

Integrated photo-ionization cross-section over a given interval.

Implements Heed::AtomPhotoAbsCS.

Definition at line 989 of file PhotoAbsCS.cpp.

990 {
991 mfunname("double SimpleAtomPhotoAbsCS::get_integral_ICS(...) const");
992 double s = 0.0;
993 for (int n = 0; n < qshell; ++n) {
994 if (!s_ignore_shell[n]) s += m_acs[n]->get_integral_CS(energy1, energy2);
995 }
996 return s;
997}

◆ get_integral_ICS() [2/2]

double Heed::SimpleAtomPhotoAbsCS::get_integral_ICS ( int  nshell,
double  energy1,
double  energy2 
) const
virtual

Integrated sub-shell photo-ionization cross-section.

Implements Heed::AtomPhotoAbsCS.

Definition at line 1005 of file PhotoAbsCS.cpp.

1006 {
1007 mfunname("double SimpleAtomPhotoAbsCS::get_integral_ICS(...) const");
1008 check_econd21(nshell, < 0 ||, > qshell, mcerr);
1009 return s_ignore_shell[nshell] ? 0. : m_acs[nshell]->get_integral_CS(en1, en2);
1010}

◆ get_main_shell_number()

virtual int Heed::SimpleAtomPhotoAbsCS::get_main_shell_number ( int  nshell) const
inlinevirtual

Return the shell number (1, 2, ...) for a given index. The number is taken from the shell name. If the shell number cannot be determined, the function returns -1.

Implements Heed::AtomPhotoAbsCS.

Definition at line 413 of file PhotoAbsCS.h.

413 {
414 return m_acs[nshell]->get_number();
415 }

◆ get_threshold()

double Heed::SimpleAtomPhotoAbsCS::get_threshold ( int  nshell) const
virtual

Get the ionization threshold for a given shell.

Implements Heed::AtomPhotoAbsCS.

Definition at line 934 of file PhotoAbsCS.cpp.

934 {
935 mfunname("double SimpleAtomPhotoAbsCS::get_threshold(int nshell) const");
936 check_econd21(nshell, < 0 ||, > qshell, mcerr);
937 return m_acs[nshell]->get_threshold();
938}

Referenced by SimpleAtomPhotoAbsCS().

◆ print()

void Heed::SimpleAtomPhotoAbsCS::print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented from Heed::AtomPhotoAbsCS.

Definition at line 1012 of file PhotoAbsCS.cpp.

1012 {
1013 if (l <= 0) return;
1014 Ifile << "SimpleAtomPhotoAbsCS(l=" << l << "): name=" << name << " Z = " << Z
1015 << " qshell = " << qshell << " file_name=" << file_name << std::endl;
1016 l--;
1017 if (l <= 0) return;
1018 indn.n += 2;
1019 for (int n = 0; n < qshell; ++n) {
1020 Ifile << "nshell=" << n << std::endl;
1021 m_acs[n]->print(file, l);
1022 }
1023 AtomPhotoAbsCS::print(file, l);
1024 indn.n -= 2;
1025}
virtual void print(std::ostream &file, int l) const
Definition: PhotoAbsCS.cpp:635
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:196

Referenced by get_integral_ACS().

Member Data Documentation

◆ file_name

std::string Heed::SimpleAtomPhotoAbsCS::file_name
protected

Filename (saved for printing).

Definition at line 423 of file PhotoAbsCS.h.

Referenced by print(), and SimpleAtomPhotoAbsCS().

◆ m_acs

std::vector<std::shared_ptr<PhotoAbsCS> > Heed::SimpleAtomPhotoAbsCS::m_acs
protected

The documentation for this class was generated from the following files: