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::AveragePhotoAbsCS Class Reference

Smoothed/smeared photoabsorption cross-section. More...

#include <PhotoAbsCS.h>

+ Inheritance diagram for Heed::AveragePhotoAbsCS:

Public Member Functions

 AveragePhotoAbsCS ()
 Default constructor.
 
 AveragePhotoAbsCS (PhotoAbsCS *apacs, double fwidth, double fstep, long fmax_q_step)
 
virtual ~AveragePhotoAbsCS ()
 Destructor.
 
double get_CS (double energy) const override
 Retrieve cross-section [Mb] at a given energy [MeV].
 
double get_integral_CS (double energy1, double energy2) const override
 Retrieve integral cross-section [Mb * MeV] in a given interval [MeV].
 
void scale (double fact) override
 Multiply by some factor. Can be useful for debugging and other purposes.
 
void print (std::ostream &file, int l) const override
 
AveragePhotoAbsCScopy () const override
 
- Public Member Functions inherited from Heed::PhotoAbsCS
 PhotoAbsCS ()
 Default constructor.
 
 PhotoAbsCS (const std::string &fname, int fZ, double fthreshold)
 Constructor.
 
virtual ~PhotoAbsCS ()
 Destructor.
 
const std::string & get_name () const
 Name of this shell or atom.
 
int get_number () const
 Number of this shell.
 
int get_Z () const
 
double get_threshold () const
 Return the threshold energy.
 
virtual double get_CS (double energy) const =0
 Retrieve cross-section [Mb] at a given energy [MeV].
 
virtual double get_integral_CS (double energy1, double energy2) const =0
 Retrieve integral cross-section [Mb * MeV] in a given interval [MeV].
 
virtual void scale (double fact)=0
 Multiply by some factor. Can be useful for debugging and other purposes.
 
virtual void print (std::ostream &file, int l) const
 
virtual PhotoAbsCScopy () const =0
 

Additional Inherited Members

- Protected Attributes inherited from Heed::PhotoAbsCS
std::string name
 
int number = 0
 
int Z
 
double threshold
 

Detailed Description

Smoothed/smeared photoabsorption cross-section.

Definition at line 83 of file PhotoAbsCS.h.

Constructor & Destructor Documentation

◆ AveragePhotoAbsCS() [1/2]

Heed::AveragePhotoAbsCS::AveragePhotoAbsCS ( )
inline

Default constructor.

Definition at line 94 of file PhotoAbsCS.h.

94: PhotoAbsCS() {}
PhotoAbsCS()
Default constructor.
Definition: PhotoAbsCS.cpp:79

Referenced by copy().

◆ AveragePhotoAbsCS() [2/2]

Heed::AveragePhotoAbsCS::AveragePhotoAbsCS ( PhotoAbsCS apacs,
double  fwidth,
double  fstep,
long  fmax_q_step 
)

Constructor.

Parameters
apacsphotoabsorption cross-section
fwidthwidth [MeV] for smoothing
fstepstep size [MeV] for numerical integration
fmax_q_stepmax number of integration steps

Definition at line 99 of file PhotoAbsCS.cpp.

102 : width(fwidth),
103 max_q_step(fmax_q_step),
104 step(fstep) {
105 mfunname("AveragePhotoAbsCS::AveragePhotoAbsCS(...)");
106 check_econd11(apacs, == nullptr, mcerr);
107 real_pacs.reset(apacs);
108 // Check the parameters (step = 0.5 * width is bad but OK).
109 if (fwidth > 0.0) check_econd11(fstep, >= 0.6 * fwidth, mcerr);
110 // Copy the parameters of the "real" cross-section.
111 name = real_pacs->get_name();
112 number = real_pacs->get_number();
113 Z = real_pacs->get_Z();
114 threshold = real_pacs->get_threshold();
115}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define mfunname(string)
Definition: FunNameStack.h:45
double threshold
Definition: PhotoAbsCS.h:79
std::string name
Definition: PhotoAbsCS.h:76
#define mcerr
Definition: prstream.h:128

◆ ~AveragePhotoAbsCS()

virtual Heed::AveragePhotoAbsCS::~AveragePhotoAbsCS ( )
inlinevirtual

Destructor.

Definition at line 108 of file PhotoAbsCS.h.

108{}

Member Function Documentation

◆ copy()

AveragePhotoAbsCS * Heed::AveragePhotoAbsCS::copy ( ) const
inlineoverridevirtual

Implements Heed::PhotoAbsCS.

Definition at line 115 of file PhotoAbsCS.h.

115 {
116 return new AveragePhotoAbsCS(*this);
117 }
AveragePhotoAbsCS()
Default constructor.
Definition: PhotoAbsCS.h:94

◆ get_CS()

double Heed::AveragePhotoAbsCS::get_CS ( double  energy) const
overridevirtual

Retrieve cross-section [Mb] at a given energy [MeV].

Implements Heed::PhotoAbsCS.

Definition at line 117 of file PhotoAbsCS.cpp.

117 {
118 mfunname("double AveragePhotoAbsCS::get_CS(double energy) const");
119 // In case of zero width, return the unmodified "real" cross-section.
120 if (width == 0.0) return real_pacs->get_CS(energy);
121 const double w2 = width * 0.5;
122 const double e1 = std::max(energy - w2, 0.);
123 return real_pacs->get_integral_CS(e1, energy + w2) / width;
124}

Referenced by get_integral_CS().

◆ get_integral_CS()

double Heed::AveragePhotoAbsCS::get_integral_CS ( double  energy1,
double  energy2 
) const
overridevirtual

Retrieve integral cross-section [Mb * MeV] in a given interval [MeV].

Implements Heed::PhotoAbsCS.

Definition at line 126 of file PhotoAbsCS.cpp.

127 {
128 mfunname("double AveragePhotoAbsCS::get_integral_CS(...) const");
129 if (width == 0.0 || energy1 >= energy2) {
130 // Return the integral of the unmodified "real" cross-section.
131 return real_pacs->get_integral_CS(energy1, energy2);
132 }
133 long q = long((energy2 - energy1) / step);
134 if (q > max_q_step) {
135 return real_pacs->get_integral_CS(energy1, energy2);
136 }
137 q++;
138 const double rstep = (energy2 - energy1) / q;
139 double x0 = energy1 + 0.5 * rstep;
140 double s = 0.0;
141 for (long n = 0; n < q; n++) s += get_CS(x0 + rstep * n);
142 return s * rstep;
143}
double get_CS(double energy) const override
Retrieve cross-section [Mb] at a given energy [MeV].
Definition: PhotoAbsCS.cpp:117

◆ print()

void Heed::AveragePhotoAbsCS::print ( std::ostream &  file,
int  l 
) const
overridevirtual

Reimplemented from Heed::PhotoAbsCS.

Definition at line 150 of file PhotoAbsCS.cpp.

150 {
151 mfunname("void PhotoAbsCS::print(std::ostream& file, int l) const");
152 Ifile << "AveragePhotoAbsCS: width = " << width << " step=" << step
153 << " max_q_step=" << max_q_step << '\n';
154 indn.n += 2;
155 real_pacs->print(file, l);
156 indn.n -= 2;
157}
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:195

◆ scale()

void Heed::AveragePhotoAbsCS::scale ( double  fact)
overridevirtual

Multiply by some factor. Can be useful for debugging and other purposes.

Implements Heed::PhotoAbsCS.

Definition at line 145 of file PhotoAbsCS.cpp.

145 {
146 mfunname("void AveragePhotoAbsCS::scale(double fact)");
147 real_pacs->scale(fact);
148}

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