OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
profile.h
Go to the documentation of this file.
1 /* profile.h
2  profile class definition
3  - calculates a functional profile from a mapping
4 
5  Project: Beam Envelope Tracker (BET)
6 
7  Revision history
8  Date Description Programmer
9  ------------ -------------------------------------------- --------------
10  07-03-06 Created Rene Bakker
11 
12  Last Revision:
13  $Id: profile.h 103 2007-05-08 16:21:44Z bakker $
14 */
15 
16 
17 #ifndef _PROFILE_DEF
18 #define _PROFILE_DEF
19 
20 #include <stdio.h>
21 
22 #include <vector>
23 
25  itype_spline, // spline interpolation
26  itype_lin, // linearl interpolation
27 };
28 
29 class Profile {
30  int
31  n;
32  double
33  yMax, // maximum of array
34  yMin, // minimum of array
35  sf; // scaling factor (1.0 by default)
36  std::vector<double> x, y, y2;
37 
38 private:
39  void create(); // general creator routine
40 
41 public:
42  Profile(double); // dummy creator (returns given value on all requests)
43  Profile( // creator from array
44  double *, // x
45  double *, // y
46  int); // number of points
47  Profile( // creator from file
48  char *, // filename
49  double = 0.0); // cutoff value
50 
51  void normalize(); // set max of profile to 1.0
52  void scale(double); // scale the amplitude
53  double set(double); /* set the amplitude
54  returns the new scaling factor sf */
55  void setSF(double); // set sf
56  double getSF(); // get sf
57 
58  double get( // get a value
59  double, // x
61 
62  int getN(); // get number of points
63 
64  double max(); // get maximum y-value
65  double min(); // get minimum y-value
66  double xMax(); // get maximum x-value
67  double xMin(); // get minimum x-value
68 
69  double Leff(); // get effective length
70  double Leff2(); // get effective length of y^2
71  double Labs(); // get effective length from absolute value of field
72 
73  void dump(FILE * = stdout, double = 0.0);
74  void dump( // dump the profile in a SDDS file (ascii)
75  char *, // filename
76  double = 0.0); // offset
77 
78 };
79 
80 #endif
std::vector< double > y
Definition: profile.h:36
double getSF()
Definition: profile.cpp:202
void create()
Definition: profile.cpp:106
double max()
Definition: profile.cpp:252
int n
Definition: profile.h:31
int getN()
Definition: profile.cpp:244
std::vector< double > x
Definition: profile.h:36
double yMin
Definition: profile.h:33
double yMax
Definition: profile.h:33
void scale(double)
Definition: profile.cpp:185
double Labs()
Definition: profile.cpp:282
double min()
Definition: profile.cpp:248
Profile(double)
Definition: profile.cpp:43
void normalize()
Definition: profile.cpp:179
double set(double)
Definition: profile.cpp:189
double sf
Definition: profile.h:33
void setSF(double)
Definition: profile.cpp:198
void dump(FILE *=stdout, double=0.0)
Definition: profile.cpp:218
double xMin()
Definition: profile.cpp:260
double Leff2()
Definition: profile.cpp:273
Interpol_type
Definition: profile.h:24
double Leff()
Definition: profile.cpp:264
double xMax()
Definition: profile.cpp:256
std::vector< double > y2
Definition: profile.h:36