Garfield++ v2r0
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.
 
virtual double get_CS (double energy) const
 Retrieve cross-section [Mb] at a given energy [MeV].
 
virtual double get_integral_CS (double energy1, double energy2) const
 Retrieve integral cross-section [Mb * MeV] in a given interval [MeV].
 
virtual void scale (double fact)
 Multiply by some factor. Can be useful for debugging and other purposes.
 
virtual void print (std::ostream &file, int l) const
 
virtual AveragePhotoAbsCScopy () const
 
- 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
 
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.

101 : real_pacs(apacs, do_clone),
102 width(fwidth),
103 max_q_step(fmax_q_step),
104 step(fstep) {
105 mfunname("AveragePhotoAbsCS::AveragePhotoAbsCS(...)");
106 check_econd11(apacs, == NULL, mcerr);
107 // Check the parameters (step = 0.5 * width is bad but OK).
108 if (fwidth > 0.0) check_econd11(fstep, >= 0.6 * fwidth, mcerr);
109 // Copy the parameters of the "real" cross-section.
110 name = real_pacs->get_name();
111 number = real_pacs->get_number();
112 Z = real_pacs->get_Z();
113 threshold = real_pacs->get_threshold();
114}
#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
@ do_clone
Definition: AbsPtr.h:191
#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()

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

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
virtual

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

Implements Heed::PhotoAbsCS.

Definition at line 116 of file PhotoAbsCS.cpp.

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

Referenced by get_integral_CS().

◆ get_integral_CS()

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

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

Implements Heed::PhotoAbsCS.

Definition at line 125 of file PhotoAbsCS.cpp.

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

◆ print()

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

Reimplemented from Heed::PhotoAbsCS.

Definition at line 149 of file PhotoAbsCS.cpp.

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

◆ scale()

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

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

Implements Heed::PhotoAbsCS.

Definition at line 144 of file PhotoAbsCS.cpp.

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

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