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

#include <PhotoAbsCS.h>

+ Inheritance diagram for Heed::OveragePhotoAbsCS:

Public Member Functions

 OveragePhotoAbsCS ()
 
 OveragePhotoAbsCS (PhotoAbsCS *apacs, double fwidth, double fstep, long fmax_q_step)
 
virtual ~OveragePhotoAbsCS ()
 
virtual double get_CS (double energy) const
 
virtual double get_integral_CS (double energy1, double energy2) const
 
virtual void scale (double fact)
 
virtual void print (std::ostream &file, int l) const
 
 macro_copy_total (OveragePhotoAbsCS)
 

Detailed Description

Definition at line 114 of file PhotoAbsCS.h.

Constructor & Destructor Documentation

◆ OveragePhotoAbsCS() [1/2]

Heed::OveragePhotoAbsCS::OveragePhotoAbsCS ( )
inline

Definition at line 125 of file PhotoAbsCS.h.

125{ ; }

◆ OveragePhotoAbsCS() [2/2]

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

Definition at line 283 of file PhotoAbsCS.cpp.

286 : real_pacs(apacs, do_clone),
287 width(fwidth),
288 max_q_step(fmax_q_step),
289 step(fstep) {
290 mfunname("OveragePhotoAbsCS::OveragePhotoAbsCS(...)");
291 check_econd11(apacs, == NULL, mcerr);
292 if (fwidth > 0.0) {
293 check_econd11(fstep, >= 0.6 * fwidth, mcerr); // 0.5 is bad but OK
294 }
295 /* I do not understand why the access is not allowed below.
296 So I call functions
297 name =
298 apacs->name;
299 //real_pacs->name;
300 Z = real_pacs->Z;
301 threshold = real_pacs->threshold;
302 */
303 name = real_pacs->get_name();
304 Z = real_pacs->get_Z();
305 threshold = real_pacs->get_threshold();
306}
@ do_clone
Definition: AbsPtr.h:516
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:366
#define mfunname(string)
Definition: FunNameStack.h:67
#define mcerr
Definition: prstream.h:135

◆ ~OveragePhotoAbsCS()

virtual Heed::OveragePhotoAbsCS::~OveragePhotoAbsCS ( )
inlinevirtual

Definition at line 129 of file PhotoAbsCS.h.

129{}

Member Function Documentation

◆ get_CS()

double Heed::OveragePhotoAbsCS::get_CS ( double  energy) const
virtual

Definition at line 308 of file PhotoAbsCS.cpp.

308 {
309 mfunname("double OveragePhotoAbsCS::get_CS(double energy) const");
310 //mcout<<"OveragePhotoAbsCS::get_CS is started\n";
311 //mcout<<"OveragePhotoAbsCS::get_CS:\n";
312 if (width == 0.0) {
313 // for no modification:
314 return real_pacs->get_CS(energy);
315 } else {
316 double w2 = width * 0.5;
317 double e1 = energy - w2;
318 if (e1 < 0.0) e1 = 0.0;
319 double res = real_pacs->get_integral_CS(e1, energy + w2) / width;
320 //Iprint4n(mcout, e1, energy + w2, width, res);
321 //return real_pacs->get_integral_CS(e1, energy + w2)/width;
322 return res;
323 }
324}

Referenced by get_integral_CS().

◆ get_integral_CS()

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

Definition at line 326 of file PhotoAbsCS.cpp.

327 {
328 mfunname("double OveragePhotoAbsCS::get_integral_CS(double energy1, double "
329 "energy2) const");
330 //mcout<<"OveragePhotoAbsCS::get_integral_CS is started\n";
331 if (width == 0.0 || energy1 >= energy2) {
332 // for no modification:
333 return real_pacs->get_integral_CS(energy1, energy2);
334 } else {
335 long q = long((energy2 - energy1) / step);
336 if (q > max_q_step) {
337 return real_pacs->get_integral_CS(energy1, energy2);
338 } else {
339 //if(q == 0)q = 1;
340 q++;
341 double rstep = (energy2 - energy1) / q;
342 double x0 = energy1 + 0.5 * rstep;
343 double s = 0.0;
344 for (long n = 0; n < q; n++) {
345 s += get_CS(x0 + rstep * n);
346 }
347 s *= rstep;
348 return s;
349 }
350 }
351
352}
virtual double get_CS(double energy) const
Definition: PhotoAbsCS.cpp:308

◆ macro_copy_total()

Heed::OveragePhotoAbsCS::macro_copy_total ( OveragePhotoAbsCS  )

◆ print()

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

Definition at line 359 of file PhotoAbsCS.cpp.

359 {
360 mfunname("void PhotoAbsCS::print(std::ostream& file, int l) const");
361 Ifile << "OveragePhotoAbsCS: width = " << width << " step=" << step
362 << " max_q_step=" << max_q_step << '\n';
363 indn.n += 2;
364 real_pacs->print(file, l);
365 indn.n -= 2;
366}
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207

◆ scale()

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

Definition at line 354 of file PhotoAbsCS.cpp.

354 {
355 mfunname("void OveragePhotoAbsCS::scale(double fact)");
356 real_pacs->scale(fact);
357}

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