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

#include <PhotoAbsCS.h>

+ Inheritance diagram for Heed::AtomicSecondaryProducts:

Public Member Functions

int get_channel (DynLinArr< double > &felectron_energy, DynLinArr< double > &fphoton_energy) const
 
 AtomicSecondaryProducts ()
 
virtual ~AtomicSecondaryProducts ()
 
void add_channel (double fchannel_prob_dens, const DynLinArr< double > &felectron_energy, const DynLinArr< double > &fphoton_energy, int s_all_rest=0)
 
virtual void print (std::ostream &file, int l) const
 

Protected Attributes

DynLinArr< double > channel_prob_dens
 
DynLinArr< DynLinArr< double > > electron_energy
 
DynLinArr< DynLinArr< double > > photon_energy
 

Detailed Description

Definition at line 290 of file PhotoAbsCS.h.

Constructor & Destructor Documentation

◆ AtomicSecondaryProducts()

Heed::AtomicSecondaryProducts::AtomicSecondaryProducts ( )
inline

Definition at line 296 of file PhotoAbsCS.h.

298 ;
299 }
DynLinArr< DynLinArr< double > > photon_energy
Definition: PhotoAbsCS.h:319
DynLinArr< double > channel_prob_dens
Definition: PhotoAbsCS.h:316
DynLinArr< DynLinArr< double > > electron_energy
Definition: PhotoAbsCS.h:318

◆ ~AtomicSecondaryProducts()

virtual Heed::AtomicSecondaryProducts::~AtomicSecondaryProducts ( )
inlinevirtual

Definition at line 300 of file PhotoAbsCS.h.

300{}

Member Function Documentation

◆ add_channel()

void Heed::AtomicSecondaryProducts::add_channel ( double  fchannel_prob_dens,
const DynLinArr< double > &  felectron_energy,
const DynLinArr< double > &  fphoton_energy,
int  s_all_rest = 0 
)

Definition at line 875 of file PhotoAbsCS.cpp.

877 {
878 mfunnamep("void AtomicSecondaryProducts::add_channel(...)");
879 check_econd21(fchannel_prob_dens, < 0.0 ||, > 1.0, mcerr);
880 long q_old = channel_prob_dens.get_qel();
881 long q_new = q_old + 1;
884 photon_energy.put_qel(q_new);
885 //Iprintn(mcout, s);
886 //check_econd11( s , > 1.0 , mcerr);
887 if (s_all_rest == 1) {
888 double s = 0.0;
889 for (long n = 0; n < q_old; ++n) {
890 s += channel_prob_dens[n];
891 }
892 check_econd21(s, < 0.0 ||, > 1.0, mcerr);
893 fchannel_prob_dens = 1.0 - s;
894 }
895 channel_prob_dens[q_old] = fchannel_prob_dens;
896 electron_energy[q_old] = felectron_energy;
897 photon_energy[q_old] = fphoton_energy;
898 double s = 0.0;
899 for (long n = 0; n < q_new; ++n) {
900 s += channel_prob_dens[n];
901 }
902 if (s > 1.0) {
903 funnw.ehdr(mcerr);
904 mcerr << "s > 1.0, s=" << s << '\n';
905 Iprintn(mcerr, q_new);
906 for (long n = 0; n < q_new; ++n) {
907 mcerr << "n=" << n << " channel_prob_dens[n]=" << channel_prob_dens[n]
908 << '\n';
909 }
910 spexit(mcerr);
911 }
912}
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
Definition: FunNameStack.h:428
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define spexit(stream)
Definition: FunNameStack.h:536
long get_qel(void) const
Definition: AbsArr.h:420
void put_qel(long fqel)
Definition: AbsArr.h:774
#define mcerr
Definition: prstream.h:135
#define Iprintn(file, name)
Definition: prstream.h:216

Referenced by Heed::generate_Argon_PACS_mod_esc().

◆ get_channel()

int Heed::AtomicSecondaryProducts::get_channel ( DynLinArr< double > &  felectron_energy,
DynLinArr< double > &  fphoton_energy 
) const

Definition at line 914 of file PhotoAbsCS.cpp.

916 {
917 mfunname("int AtomicSecondaryProducts::get_channel(...)");
918#ifdef DEBUG_PRINT_get_escape_particles
919 mcout << "AtomicSecondaryProducts::get_channel is started\n";
921#endif
922 int ir = 0;
923 if (channel_prob_dens.get_qel() > 0) {
924 double rn = SRANLUX();
925#ifdef DEBUG_PRINT_get_escape_particles
926 Iprintn(mcout, rn);
927#endif
928 if (channel_prob_dens.get_qel() == 1) {
929 if (rn < channel_prob_dens[0]) {
930 felectron_energy = electron_energy[0];
931 fphoton_energy = photon_energy[0];
932 ir = 1;
933 }
934 } else {
935 long q = channel_prob_dens.get_qel();
936 double s = 0.0;
937 for (long n = 0; n < q; ++n) {
938 s += channel_prob_dens[n];
939 if (rn <= s) {
940 felectron_energy = electron_energy[n];
941 fphoton_energy = photon_energy[n];
942 ir = 1;
943#ifdef DEBUG_PRINT_get_escape_particles
944 Iprint2n(mcout, n, s);
945#endif
946 break;
947 }
948 }
949 }
950 }
951#ifdef DEBUG_PRINT_get_escape_particles
952 mcout << "AtomicSecondaryProducts::get_channel is finishing\n";
953 Iprintn(mcout, ir);
954#endif
955 return ir;
956}
#define mfunname(string)
Definition: FunNameStack.h:67
#define mcout
Definition: prstream.h:133
#define Iprint2n(file, name1, name2)
Definition: prstream.h:236
ffloat SRANLUX(void)
Definition: ranluxint.h:262

◆ print()

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

Definition at line 958 of file PhotoAbsCS.cpp.

958 {
959 if (l > 0) {
960 Ifile << "AtomicSecondaryProducts(l=" << l << "):\n";
961 long q = channel_prob_dens.get_qel();
962 Ifile << "number of channels=" << q << '\n';
963 indn.n += 2;
964 for (long n = 0; n < q; ++n) {
965 Ifile << "n_channel=" << n << " probability=" << channel_prob_dens[n]
966 << '\n';
967 indn.n += 2;
968 long qel = electron_energy[n].get_qel();
969 Ifile << "number of electrons=" << qel << '\n';
970 indn.n += 2;
971 for (long nel = 0; nel < qel; ++nel) {
972 Ifile << "nel=" << nel << " electron_energy=" << electron_energy[n][nel]
973 << '\n';
974 }
975 indn.n -= 2;
976 long qph = photon_energy[n].get_qel();
977 Ifile << "number of photons=" << qph << '\n';
978 indn.n += 2;
979 for (long nph = 0; nph < qph; ++nph) {
980 Ifile << "nph=" << nph << " photon_energy=" << photon_energy[n][nph]
981 << '\n';
982 }
983 indn.n -= 2;
984 indn.n -= 2;
985 }
986 indn.n -= 2;
987 }
988}
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207

Member Data Documentation

◆ channel_prob_dens

DynLinArr<double> Heed::AtomicSecondaryProducts::channel_prob_dens
protected

Definition at line 316 of file PhotoAbsCS.h.

Referenced by add_channel(), get_channel(), and print().

◆ electron_energy

DynLinArr<DynLinArr<double> > Heed::AtomicSecondaryProducts::electron_energy
protected

Definition at line 318 of file PhotoAbsCS.h.

Referenced by add_channel(), get_channel(), and print().

◆ photon_energy

DynLinArr<DynLinArr<double> > Heed::AtomicSecondaryProducts::photon_energy
protected

Definition at line 319 of file PhotoAbsCS.h.

Referenced by add_channel(), get_channel(), and print().


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