Garfield++ 4.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 857 of file PhotoAbsCS.cpp.

857: 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 859 of file PhotoAbsCS.cpp.

861 : file_name(ffile_name) {
862 mfunnamep("SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS(...)");
863 check_econd11(fZ, < 1, mcerr);
864 std::ifstream file(file_name.c_str());
865 if (!file) {
866 funnw.ehdr(mcerr);
867 mcerr << "cannot open file " << file_name << std::endl;
868 spexit(mcerr);
869 }
870 while (findmark(file, "#") == 1) {
871 file >> Z;
872 if (Z != fZ) continue;
873 file >> qshell;
874 check_econd21(qshell, < 1 ||, > 10000, mcerr);
875 s_ignore_shell.resize(qshell, false);
876 file >> name;
877 m_acs.resize(qshell);
878 asp.resize(qshell);
879 std::vector<double> fl(qshell);
880 int sZshell = 0;
881 for (int nshell = 0; nshell < qshell; ++nshell) {
882 double thr = 0.0;
883 int Zshell = 0;
884 std::string shell_name;
885 file >> thr;
886 check_econd11(thr, <= 0.0, mcerr);
887 file >> Zshell;
888 check_econd11(Zshell, <= 0, mcerr);
889 sZshell += Zshell;
890 file >> fl[nshell];
891 findmark(file, "!");
892 file >> shell_name;
893 m_acs[nshell].reset(new PhenoPhotoAbsCS(shell_name, Zshell, thr * 1.0e-6));
894 }
895 check_econd12(sZshell, !=, Z, mcerr);
896
897 int n_min = 0;
898 double st = DBL_MAX;
899 for (int nshell = 0; nshell < qshell; ++nshell) {
900 // currently the minimal shell is the last,
901 // but to avoid this assumption we check all
902 if (get_threshold(nshell) < st) n_min = nshell;
903 }
904 for (int nshell = 0; nshell < qshell; ++nshell) {
905 if (fl[nshell] <= 0) continue;
906 check_econd12(nshell, ==, n_min, mcerr);
907 std::vector<double> felectron_energy;
908 std::vector<double> fphoton_energy;
909 fphoton_energy.push_back(get_threshold(nshell) - get_threshold(n_min));
910 asp[nshell].add_channel(fl[nshell], felectron_energy, fphoton_energy);
911 }
912 return;
913 }
914 funnw.ehdr(mcerr);
915 mcerr << "there is no element Z=" << fZ << " in file " << file_name << '\n';
916 spexit(mcerr);
917}
#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:932
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 919 of file PhotoAbsCS.cpp.

919 {
920 mfunname("SimpleAtomPhotoAbsCS::SimpleAtomPhotoAbsCS(...)");
921 check_econd11(facs, == nullptr, mcerr);
922 check_econd11(fZ, <= 0, mcerr);
923 check_econd12(fZ, !=, facs->get_Z(), mcerr);
924 Z = fZ;
925 qshell = 1;
926 s_ignore_shell.resize(qshell, false);
927 name = facs->get_name();
928 m_acs.resize(1);
929 m_acs[0] = std::move(facs);
930}
#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:857

◆ 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 938 of file PhotoAbsCS.cpp.

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

◆ 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 965 of file PhotoAbsCS.cpp.

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

◆ 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 978 of file PhotoAbsCS.cpp.

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

◆ 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 997 of file PhotoAbsCS.cpp.

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

◆ 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 946 of file PhotoAbsCS.cpp.

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

◆ 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 971 of file PhotoAbsCS.cpp.

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

◆ 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 987 of file PhotoAbsCS.cpp.

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

◆ 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 1003 of file PhotoAbsCS.cpp.

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

◆ 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 932 of file PhotoAbsCS.cpp.

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

Referenced by SimpleAtomPhotoAbsCS().

◆ print()

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

Reimplemented from Heed::AtomPhotoAbsCS.

Definition at line 1010 of file PhotoAbsCS.cpp.

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

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: