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

#include <PhotoAbsCS.h>

+ Inheritance diagram for Heed::AtomPhotoAbsCS:

Public Member Functions

int get_Z () const
 
int get_qshell () const
 
virtual double get_threshold (int nshell) const =0
 
virtual double get_I_min (void) const
 
virtual double get_ACS (double energy) const =0
 
virtual double get_integral_ACS (double energy1, double energy2) const =0
 
virtual double get_ACS (int nshell, double energy) const =0
 
virtual double get_integral_ACS (int nshell, double energy1, double energy2) const =0
 
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
 
virtual double get_integral_TICS (double energy1, double energy2, double factual_minimal_threshold) const
 
virtual double get_ICS (int nshell, double energy) const =0
 
virtual double get_TICS (int nshell, double energy, double factual_minimal_threshold) const
 
virtual double get_integral_ICS (int nshell, double energy1, double energy2) const =0
 
virtual double get_integral_TICS (int nshell, double energy1, double energy2, double factual_minimal_threshold) const
 
virtual void get_escape_particles (int nshell, double energy, DynLinArr< double > &el_energy, DynLinArr< double > &ph_energy) const
 
virtual int get_main_shell_number (int nshell) const =0
 
virtual void remove_shell (int nshell)
 
virtual void restore_shell (int nshell)
 
virtual void print (std::ostream &file, int l) const
 
 macro_copy_total_zero (AtomPhotoAbsCS)
 
 AtomPhotoAbsCS (void)
 
AtomicSecondaryProductsget_asp (int nshell)
 

Protected Attributes

String name
 
int Z
 
int qshell
 
DynLinArr< int > s_ignore_shell
 
DynLinArr< AtomicSecondaryProductsasp
 

Detailed Description

Definition at line 322 of file PhotoAbsCS.h.

Constructor & Destructor Documentation

◆ AtomPhotoAbsCS()

Heed::AtomPhotoAbsCS::AtomPhotoAbsCS ( void  )

Definition at line 990 of file PhotoAbsCS.cpp.

990: name("none"), Z(0), qshell(0) {}

Member Function Documentation

◆ get_ACS() [1/2]

virtual double Heed::AtomPhotoAbsCS::get_ACS ( double  energy) const
pure virtual

Implemented in Heed::SimpleAtomPhotoAbsCS, and Heed::ExAtomPhotoAbsCS.

Referenced by get_TICS().

◆ get_ACS() [2/2]

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

◆ get_asp()

AtomicSecondaryProducts * Heed::AtomPhotoAbsCS::get_asp ( int  nshell)

Definition at line 1339 of file PhotoAbsCS.cpp.

1339 {
1340 mfunnamep("AtomicSecondaryProducts* AtomPhotoAbsCS::get_asp(int nshell)");
1341 check_econd21(nshell, < 0 ||, >= qshell, mcerr);
1342 return &(asp[nshell]);
1343}
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
Definition: FunNameStack.h:428
#define mfunnamep(string)
Definition: FunNameStack.h:77
DynLinArr< AtomicSecondaryProducts > asp
Definition: PhotoAbsCS.h:394
#define mcerr
Definition: prstream.h:135

Referenced by Heed::generate_Argon_PACS_mod_esc().

◆ get_escape_particles()

void Heed::AtomPhotoAbsCS::get_escape_particles ( int  nshell,
double  energy,
DynLinArr< double > &  el_energy,
DynLinArr< double > &  ph_energy 
) const
virtual

Definition at line 1106 of file PhotoAbsCS.cpp.

1108 {
1109 mfunname("void AtomPhotoAbsCS::get_escape_particles(...)");
1110#ifdef DEBUG_PRINT_get_escape_particles
1111 mcout << "AtomPhotoAbsCS::get_escape_particles is started\n";
1112 // to find minimal shell
1113 Iprintn(mcout, nshell);
1114 Iprintn(mcout, energy);
1115#endif
1116 check_econd12(energy, <, 0.5 * get_threshold(nshell), mcerr);
1117 // In principle, the energy is allowed to be slightly less than threshold
1118 // due to unprecision of definition of point-wise cross sections.
1119 // To keep correct norm it is better not to ignore such events.
1120 // They usually can be treated quite well.
1121 // The factor 0.5 is put there just as arbitrary check for full stupidity.
1122
1123 // program is complicated; to make sure that there is no remains
1124 // from previous runs are allowed to pass, I clear arrays:
1125 el_energy = DynLinArr<double>(0);
1126 ph_energy = DynLinArr<double>(0);
1127
1128 int n_min = 0;
1129 double st = DBL_MAX;
1130 for (int n = 0; n < qshell; ++n) {
1131 // currently the minimal shell is the last,
1132 // but to avoid this assumption we check all
1133 if (get_threshold(n) < st) {
1134 n_min = n;
1135 st = get_threshold(n);
1136 }
1137 }
1138#ifdef DEBUG_PRINT_get_escape_particles
1139 Iprintn(mcout, n_min);
1140#endif
1141 if (nshell == n_min) {
1142 // generate delta-electron, here it will be the only one, since the shell
1143 // is the outmost valent one.
1144 double en;
1145 if (energy - get_threshold(n_min) >= 0.0) {
1146 en = energy - get_threshold(n_min);
1147 } else {
1148 en = 0.0;
1149 }
1150 el_energy = DynLinArr<double>(1, en);
1151 ph_energy = DynLinArr<double>(0);
1152 } else {
1153 // Energy of photo-electron
1154 double en = energy - get_threshold(nshell);
1155 double hdist = 0.0; // used to preserve the balance of energy
1156 // virtual gamma are generated by energy mesh
1157 // and their energy could be little less than the shell energy.
1158 // To avoid generation of electrons with negative energy
1159 // their energy is corrected. The value of correction is hdist.
1160 // To preserve energy this hdist is then distributed over
1161 // the other secondary products if they exist.
1162 if (en < 0.0) {
1163 hdist = -en;
1164 en = 0.0;
1165 }
1166 int is = 0;
1167 DynLinArr<double> felectron_energy;
1168 DynLinArr<double> fphoton_energy;
1169#ifdef DEBUG_PRINT_get_escape_particles
1170 Iprint2n(mcout, asp.get_qel(), get_qshell());
1171#endif
1172#ifndef DEBUG_ignore_non_standard_channels
1173 if (asp.get_qel() == get_qshell()) {
1174 // works only in this case?
1175 is = asp[nshell].get_channel(felectron_energy, fphoton_energy);
1176 // Here zero can be if the shell is not included in database
1177 // or if not standard channel is not choosen by random way.
1178 // In both cases the standard way should be invoked.
1179 }
1180#endif
1181 int main_n = get_main_shell_number(nshell);
1182#ifdef DEBUG_PRINT_get_escape_particles
1183 Iprint2n(mcout, nshell, main_n);
1184 Iprintn(mcout, is);
1185 Iprint(mcout, felectron_energy);
1186 Iprint(mcout, fphoton_energy);
1187#endif
1188 //check_econd22( is , == 0 && , main_n , < 0 , mcerr); // since
1189 //// there will be neither default channel nor the explicit one
1190 //if(is == 0 && main_n > 0)
1191 if (is == 0) {
1192 // generate default channel
1193 if (main_n > 0) {
1194 // first find the principal quantum number of the deepest shell
1195 int main_n_largest = 0;
1196 for (int n = 0; n < qshell; ++n) {
1197 int t = get_main_shell_number(n);
1198 if (t > main_n_largest) main_n_largest = t;
1199 }
1200#ifdef DEBUG_PRINT_get_escape_particles
1201 Iprintn(mcout, main_n_largest);
1202#endif
1203 if (main_n_largest - main_n >= 2) {
1204 // At least K, l, M shells exists
1205 // In this case we use more advanced scheme
1206 // Look for shell with larger main number and with less energy
1207 int n_choosen = -1;
1208 double thr = DBL_MAX; // this will be the least threshold
1209 // among the shells with next principal number
1210 for (int n = 0; n < qshell; ++n) {
1211 // currently the minimal shell is the last,
1212 // but to avoid this assumption we check all
1213 int main_n_t = get_main_shell_number(n);
1214 if (main_n_t > 0 && main_n_t == main_n + 1) {
1215 if (thr > get_threshold(n)) {
1216 n_choosen = n;
1217 thr = get_threshold(n);
1218 }
1219 }
1220 }
1221#ifdef DEBUG_PRINT_get_escape_particles
1222 Iprint2n(mcout, n_choosen, thr);
1223#endif
1224 check_econd11(n_choosen, < 0, mcerr);
1225 double e_temp = 0.0;
1226 if ((e_temp = get_threshold(nshell) - hdist -
1227 2.0 * get_threshold(n_choosen))
1228 //if(get_threshold(nshell) - hdist - 2.0*get_threshold(n_choosen)
1229 > 0.0) {
1230 el_energy = DynLinArr<double>(4);
1231 el_energy[0] = en; // photo-electron
1232 el_energy[1] = e_temp;
1233 //el_energy[1] = get_threshold(nshell) - hdist -
1234 // 2.0*get_threshold(n_choosen);
1235 // first Auger from choosen shell
1236 // Then filling two vacancies at the next (choosen) shell
1237 // from the outermost one
1238 if ((e_temp = get_threshold(n_choosen) -
1239 2.0 * get_threshold(n_min)) > 0.0) {
1240 el_energy[2] = e_temp;
1241 //el_energy[2] =
1242 // get_threshold(n_choosen) - 2.0 * get_threshold(n_min);
1243 el_energy[3] = el_energy[2];
1244 check_econd11(el_energy[2], < 0.0, mcerr);
1245 } else { // ignore two last Auger electrons
1246 el_energy.put_qel(2);
1247 }
1248 } else if ((e_temp = get_threshold(nshell) - hdist -
1249 get_threshold(n_choosen) - get_threshold(n_min)) > 0.0) {
1250 el_energy = DynLinArr<double>(3);
1251 el_energy[0] = en; // photo-electron
1252 el_energy[1] = e_temp;
1253 //el_energy[1] = get_threshold(nshell) - hdist -
1254 // get_threshold(n_choosen) - get_threshold(n_min);
1255 // filling initially ionized level from choosen
1256 // and emmitance of Auger from outermost.
1257 check_econd11(el_energy[1], < 0.0, mcerr);
1258 if ((e_temp = get_threshold(n_choosen) -
1259 2.0 * get_threshold(n_min)) > 0.0) {
1260 el_energy[2] = e_temp;
1261 //el_energy[2] = get_threshold(n_choosen) - 2.0 *
1262 //get_threshold(n_min);
1263 } else { // ignore this last Auger electron
1264 el_energy.put_qel(2);
1265 }
1266 }
1267 ph_energy = DynLinArr<double>(0);
1268 } else // for if(main_n_largest - main_n >= 2)
1269 {
1270 //generate Auger from the outermost shell
1271 double en1 =
1272 get_threshold(nshell) - hdist - 2.0 * get_threshold(n_min);
1273 if (en1 >= 0.0) {
1274 el_energy = DynLinArr<double>(2);
1275 el_energy[0] = en;
1276 el_energy[1] = en1;
1277 } else {
1278 el_energy = DynLinArr<double>(1);
1279 el_energy[0] = en;
1280 }
1281 ph_energy = DynLinArr<double>(0);
1282 }
1283 } else // for if(main_n > 0)
1284 { // principal numbers are not available, then we generate Auger
1285 // to outmost shell
1286 double en1 = get_threshold(nshell) - hdist - 2.0 * get_threshold(n_min);
1287 if (en1 >= 0.0) {
1288 el_energy = DynLinArr<double>(2);
1289 el_energy[0] = en;
1290 el_energy[1] = en1;
1291 } else {
1292 el_energy = DynLinArr<double>(1);
1293 el_energy[0] = en;
1294 }
1295 ph_energy = DynLinArr<double>(0);
1296 }
1297 } else // for if(is == 0), generate explicit channel
1298 {
1299 // Generate photo-electron and
1300 // just copy all what is proposed by get_channel
1301 // with corrections by hdist.
1302
1303 el_energy = DynLinArr<double>(1 + felectron_energy.get_qel());
1304 el_energy[0] = en;
1305 long q = felectron_energy.get_qel();
1306 for (long n = 0; n < q; ++n) {
1307 check_econd21(felectron_energy[n], < 0 ||, > get_threshold(nshell),
1308 mcerr);
1309 el_energy[1 + n] = felectron_energy[n] - hdist;
1310 if (el_energy[1 + n] < 0) {
1311 hdist = -el_energy[1 + n];
1312 el_energy[1 + n] = 0.0;
1313 } else {
1314 hdist = 0.0;
1315 }
1316 }
1317 ph_energy = DynLinArr<double>(fphoton_energy.get_qel());
1318 q = fphoton_energy.get_qel();
1319 for (long n = 0; n < q; ++n) {
1320 check_econd21(fphoton_energy[n], < 0 ||, > get_threshold(nshell),
1321 mcerr);
1322 ph_energy[n] = fphoton_energy[n] - hdist;
1323 if (ph_energy[n] < 0) {
1324 hdist = -ph_energy[n];
1325 ph_energy[n] = 0.0;
1326 } else {
1327 hdist = 0.0;
1328 }
1329 }
1330 }
1331 }
1332#ifdef DEBUG_PRINT_get_escape_particles
1333 Iprintn(mcout, ph_energy);
1334 Iprintn(mcout, el_energy);
1335 mcout << "AtomPhotoAbsCS::get_escape_particles: exitting\n";
1336#endif
1337}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:366
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:380
#define mfunname(string)
Definition: FunNameStack.h:67
long get_qel(void) const
Definition: AbsArr.h:420
void put_qel(long fqel)
Definition: AbsArr.h:774
virtual int get_main_shell_number(int nshell) const =0
int get_qshell() const
Definition: PhotoAbsCS.h:325
virtual double get_threshold(int nshell) const =0
#define mcout
Definition: prstream.h:133
#define Iprint(file, name)
Definition: prstream.h:209
#define Iprintn(file, name)
Definition: prstream.h:216
#define Iprint2n(file, name1, name2)
Definition: prstream.h:236

◆ get_I_min()

double Heed::AtomPhotoAbsCS::get_I_min ( void  ) const
virtual

Definition at line 1095 of file PhotoAbsCS.cpp.

1095 {
1096 mfunname("double AtomPhotoAbsCS::get_I_min(void) const");
1097 double st = DBL_MAX;
1098 for (int n = 0; n < qshell; ++n) {
1099 // currently the minimal shell is the last,
1100 // but to avoid this assumption we check all
1101 if (get_threshold(n) < st) st = get_threshold(n);
1102 }
1103 return st;
1104}

◆ get_ICS() [1/2]

virtual double Heed::AtomPhotoAbsCS::get_ICS ( double  energy) const
pure virtual

◆ get_ICS() [2/2]

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

◆ get_integral_ACS() [1/2]

virtual double Heed::AtomPhotoAbsCS::get_integral_ACS ( double  energy1,
double  energy2 
) const
pure virtual

◆ get_integral_ACS() [2/2]

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

◆ get_integral_ICS() [1/2]

virtual double Heed::AtomPhotoAbsCS::get_integral_ICS ( double  energy1,
double  energy2 
) const
pure virtual

◆ get_integral_ICS() [2/2]

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

◆ get_integral_TICS() [1/2]

double Heed::AtomPhotoAbsCS::get_integral_TICS ( double  energy1,
double  energy2,
double  factual_minimal_threshold 
) const
virtual

Definition at line 1004 of file PhotoAbsCS.cpp.

1005 {
1006 mfunname("double AtomPhotoAbsCS::get_integral_TICS(double energy1, double "
1007 "energy2, double factual_minimal_threshold) const");
1008
1009 if (factual_minimal_threshold <= energy2) {
1010 // All what is absorbed, should ionize
1011 if (energy1 < factual_minimal_threshold) {
1012 energy1 = factual_minimal_threshold;
1013 }
1014 return get_integral_ACS(energy1, energy2);
1015 }
1016 return 0.0;
1017}
virtual double get_integral_ACS(double energy1, double energy2) const =0

◆ get_integral_TICS() [2/2]

double Heed::AtomPhotoAbsCS::get_integral_TICS ( int  nshell,
double  energy1,
double  energy2,
double  factual_minimal_threshold 
) const
virtual

Definition at line 1033 of file PhotoAbsCS.cpp.

1035 {
1036 mfunname("double AtomPhotoAbsCS::get_integral_TICS(int nshell, double "
1037 "energy1, double energy2, double factual_minimal_threshold) const");
1038
1039 if (s_ignore_shell[nshell] == 0) {
1040 if (factual_minimal_threshold <= energy1) {
1041 // All what is absorbed, should ionize
1042 return get_integral_ACS(nshell, energy1, energy2);
1043 }
1044 if (factual_minimal_threshold >= energy2) return 0.0;
1045 return get_integral_ACS(nshell, factual_minimal_threshold, energy2);
1046 }
1047 return 0.0;
1048}
DynLinArr< int > s_ignore_shell
Definition: PhotoAbsCS.h:388

◆ get_main_shell_number()

virtual int Heed::AtomPhotoAbsCS::get_main_shell_number ( int  nshell) const
pure virtual

◆ get_qshell()

int Heed::AtomPhotoAbsCS::get_qshell ( ) const
inline

Definition at line 325 of file PhotoAbsCS.h.

325{ return qshell; }

Referenced by get_escape_particles().

◆ get_threshold()

virtual double Heed::AtomPhotoAbsCS::get_threshold ( int  nshell) const
pure virtual

◆ get_TICS() [1/2]

double Heed::AtomPhotoAbsCS::get_TICS ( double  energy,
double  factual_minimal_threshold 
) const
virtual

Definition at line 992 of file PhotoAbsCS.cpp.

993 {
994 mfunname("double AtomPhotoAbsCS::get_TICS(double energy, double "
995 "factual_minimal_threshold) const");
996
997 if (factual_minimal_threshold <= energy) {
998 // All what is absorbed, should ionize
999 return get_ACS(energy);
1000 }
1001 return 0.0;
1002}
virtual double get_ACS(double energy) const =0

◆ get_TICS() [2/2]

double Heed::AtomPhotoAbsCS::get_TICS ( int  nshell,
double  energy,
double  factual_minimal_threshold 
) const
virtual

Definition at line 1019 of file PhotoAbsCS.cpp.

1020 {
1021 mfunname("double AtomPhotoAbsCS::get_TICS(int nshell, double energy, double "
1022 "factual_minimal_threshold) const");
1023
1024 if (s_ignore_shell[nshell] == 0) {
1025 if (factual_minimal_threshold <= energy) {
1026 // All what is absorbed, should ionize
1027 return get_integral_ACS(nshell, energy);
1028 }
1029 }
1030 return 0.0;
1031}

◆ get_Z()

int Heed::AtomPhotoAbsCS::get_Z ( ) const
inline

Definition at line 324 of file PhotoAbsCS.h.

324{ return Z; }

◆ macro_copy_total_zero()

Heed::AtomPhotoAbsCS::macro_copy_total_zero ( AtomPhotoAbsCS  )

◆ print()

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

Reimplemented in Heed::SimpleAtomPhotoAbsCS, and Heed::ExAtomPhotoAbsCS.

Definition at line 1062 of file PhotoAbsCS.cpp.

1062 {
1063 mfunnamep("void AtomPhotoAbsCS::print(std::ostream& file, int l) const");
1064 if (l > 0) {
1065 Ifile << "AtomPhotoAbsCS(l=" << l << "): name=" << name << " Z = " << Z
1066 << " qshell = " << qshell << std::endl;
1067 Iprintn(mcout, asp.get_qel());
1068 long q = asp.get_qel();
1069 if (q == 0) {
1070 q = s_ignore_shell.get_qel();
1071 indn.n += 2;
1072 for (long n = 0; n < q; ++n) {
1073 Ifile << "n=" << n << " s_ignore_shell[n] = " << s_ignore_shell[n]
1074 << '\n';
1075 }
1076 indn.n -= 2;
1077 } else {
1078 check_econd12(asp.get_qel(), !=, s_ignore_shell.get_qel(), mcerr);
1079 indn.n += 2;
1080 for (long n = 0; n < q; ++n) {
1081 Ifile << "n=" << n << " s_ignore_shell[n] = " << s_ignore_shell[n]
1082 << '\n';
1083 asp[n].print(mcout, l);
1084 }
1085 indn.n -= 2;
1086 }
1087 }
1088}
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207

Referenced by Heed::operator<<(), Heed::SimpleAtomPhotoAbsCS::print(), and Heed::ExAtomPhotoAbsCS::print().

◆ remove_shell()

void Heed::AtomPhotoAbsCS::remove_shell ( int  nshell)
virtual

Definition at line 1050 of file PhotoAbsCS.cpp.

1050 {
1051 mfunname("void AtomPhotoAbsCS::remove_shell(int nshell)");
1052 check_econd21(nshell, < 0 ||, >= qshell, mcerr);
1053 s_ignore_shell[nshell] = 1;
1054}

◆ restore_shell()

void Heed::AtomPhotoAbsCS::restore_shell ( int  nshell)
virtual

Definition at line 1056 of file PhotoAbsCS.cpp.

1056 {
1057 mfunname("void AtomPhotoAbsCS::restore_shell(int nshell)");
1058 check_econd21(nshell, < 0 ||, >= qshell, mcerr);
1059 s_ignore_shell[nshell] = 0;
1060}

Member Data Documentation

◆ asp

◆ name

◆ qshell

◆ s_ignore_shell

◆ Z


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