FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
chg_stripper.h
1 #ifndef CHG_STRIPPER_H
2 #define CHG_STRIPPER_H
3 
4 #include <boost/numeric/ublas/matrix.hpp>
5 
6 #include "moment.h"
7 
8 typedef MomentState state_t;
9 
10 
11 // Phase space dimension; including vector for orbit/1st moment.
12 # define PS_Dim MomentState::maxsize // Set to 7; to include orbit.
13 
14 
15 // Charge stripper parameters.
16 
17 /* SRIM Fitting Model:
18 
19  f(t, E)=(AN*t^(u-1))*exp(-l*t)*exp(-0.5*((E-Eo)/E1)^2)),
20 
21  t->xdata(:,1) E->xdata(:,2)
22 
23  AN->x(1),l->x(2), u->x(3), E_0->x(4), E_1->x(5)
24 
25  where t is scattering angle, and E is particle energy.
26 
27  Stripper Thin Lens Model:
28 
29  RMS standard deviation of <> after stripper can be calculated as:
30 
31  std_e = sqrt(std_i^2+std_s^2+std_f^2)
32 
33  std_i is the initial sqrt(<>), std_s is the variance introduced by interacting with perfect stripper,
34  std_f is the variance introduced by stripper foil thickness variation.
35  std_s is E1Para, std_f is sqrt(1/3)*20/100*3.0*abs(-0.10681), sqrt(1/3) is introduced by assuming uniform
36  distribution of stripper thickness variation, 20 is thickness variation in %, 3.0 is foil thickness in um,
37  -0.10681 is thickness dependence of E0 after stripper. */
38 static
39 const double Stripper_IonZ = 78.0/238.0,
40  Stripper_IonMass = 238.0,
41  Stripper_IonProton = 92.0,
42  // Thickness [microns], thickness variation [%], reference energy [eV/u].
43  Stripper_Para[] = {3.0, 20.0, 16.623e6},
44  // E0 after stripper [eV/u], energy dependance, gap dependance. Unit for last parameter ???
45  Stripper_E0Para[] = {16.348e6, 1.00547, -0.10681},
46  // E1 after stripper; Gaussian distribution.
47  Stripper_E1Para = 2.8874e-3,
48  // Theta after stripper.
49  Stripper_lambda = 5.5740,
50  // U after stripper.
51  Stripper_upara = 2.6903;
52 
53 
54 struct ElementStripper : public MomentElementBase
55 {
56  // Transport (identity) matrix for a Charge Stripper.
57  typedef ElementStripper self_t;
58  typedef MomentElementBase base_t;
59  typedef typename base_t::state_t state_t;
60  ElementStripper(const Config& c)
61  :base_t(c)
62  {
63  // Identity matrix.
64  length = 0e0;
65 
66  const std::vector<double>& ChgState = c.get<std::vector<double> >("IonChargeStates");
67  const std::vector<double>& NChg = c.get<std::vector<double> >("NCharge");
68  if(ChgState.size()!=NChg.size())
69  throw std::runtime_error("charge stripper requires that IonChargeStates[] and NCharge[] have the same length");
70  }
71  virtual ~ElementStripper() {}
72 
73  virtual void assign(const ElementVoid *other) { base_t::assign(other); }
74 
75  virtual void advance(StateBase &s);
76 
77  virtual const char* type_name() const {return "stripper";}
78 };
79 
80 
81 void Stripper_GetMat(const Config &conf,
82  MomentState &ST);
83 
84 
85 #endif // CHG_STRIPPER_H
Base class for all simulated elements.
Definition: base.h:166
double length
Longitudual length of this element (added to StateBase::pos)
Definition: base.h:196
virtual const char * type_name() const =0
The abstract base class for all simulation state objects.
Definition: base.h:28
virtual void advance(StateBase &s)
Propogate the given State through this Element.
Definition: moment.cpp:580
Associative configuration container.
Definition: config.h:66
virtual void assign(const ElementVoid *other)=0
Definition: moment.cpp:511
detail::RT< T >::type get(const std::string &name) const
Definition: config.h:123
An Element which propagates the statistical moments of a bunch.
Definition: moment.h:131