forked from RTKConsortium/PCT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpctEnergyStragglingFunctor.h
More file actions
42 lines (34 loc) · 1.07 KB
/
Copy pathpctEnergyStragglingFunctor.h
File metadata and controls
42 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __pctEnergyStragglingFunctor_h
#define __pctEnergyStragglingFunctor_h
#ifdef pascal
# undef pascal
#endif
#include "CLHEP/Units/PhysicalConstants.h"
namespace pct
{
/** \class EnergyStragglingFunctor
* \brief Function to compute energy straggling
* This is based on a fit of a pencil beam of 200 MeV protons in water
*/
namespace Functor
{
template< class TInput, class TOutput >
class EnergyStragglingFunctor
{
public:
EnergyStragglingFunctor() {}
~EnergyStragglingFunctor() {}
static TOutput GetValue(const TInput l)
{
static const double a0 = 4.901560e-02 * CLHEP::MeV;
static const double a1 = 3.105142e-02 * CLHEP::MeV / CLHEP::mm;
static const double a2 = -6.097551e-04 * CLHEP::MeV / CLHEP::mm2;
static const double a3 = 6.781029e-06 * CLHEP::MeV / CLHEP::mm3;
static const double a4 = -3.355508e-08 * CLHEP::MeV /(CLHEP::mm *CLHEP::mm3);
static const double a5 = 6.119699e-11 * CLHEP::MeV /(CLHEP::mm2*CLHEP::mm3);
return a0+l*(a1+l*(a2+l*(a3+l*(a4+l*a5))));
}
};
} // end namespace Functor
} // end namespace pct
#endif