source: ZHANGProjects/ICOSIM/CPP/trunk/source/MagneticCollimator.h @ 2

Last change on this file since 2 was 2, checked in by zhangj, 10 years ago

Initial import

File size: 2.9 KB
Line 
1#ifndef MAGNETICCOLLIMATOR_H
2#define MAGNETICCOLLIMATOR_H
3#include <iostream>
4#include <vector>
5#include <string>
6#include <cmath>
7#include "Collimator.h"
8using namespace std;
9
10
11/*
12####################################################################################################################
13
14This class describes all magnetic collimators in the accelerator lattice.
15
16####################################################################################################################
17*/
18
19
20class MagneticCollimator : public Collimator
21{
22
23public:
24
25    //=================================================Constructors, destructor=======================================
26
27    MagneticCollimator(const double& ALFX, const double& ALFY, const double& APER_1, const double& APER_2, const double& APER_3, const double& APER_4, const string& APERTYPE, const double& BETX, const double& BETY, const double& DPX, const double& DPY, const double& DX, const double& DY, const string& KEYWORD, const double& L, const double& MUX, const double& MUY, const string& NAME, const double& PTC, const double& PXC, const double& PYC, const double& S, const double& TC, const double& XC, const double& YC, const double& K0L, const double& K0SL, const double& K1L, const double& K1SL, const double& K2L, const double& K2SL, const string& PARENT, const string& meth, const long double& hgap, const long double& hgap2, const double& collang, const long double& pdepth, const long double& pdepth2, const double& tcang, const double& nsig, const double& Bmax, const double& thicknessMagneticField, const double& energyPerIon, const double& mass);
28
29    MagneticCollimator(Element elt, const double& tcang, const double& nsig, const string& meth, const string& material);
30
31    MagneticCollimator(const MagneticCollimator& obj);
32
33    virtual ~MagneticCollimator() {};
34
35
36    //calculation of B
37
38    double Bcalc(const double& x, const double& y, const double& z, const double& w);
39
40
41    //describes the passage through a collimator, here magnetic
42
43    void collipass(Particle& p1, double& dpopeff, const double& scaleorbit, const double& R11X, const double& R12X, const double& R21X, const double& R22X, const double& R11Y, const double& R12Y, const double& R21Y, const double& R22Y, const double& dx1, const double& dpx1, const double& dy1, const double& dpy1, const double& delta_s, const double& Apr, const double& Zpr, const double& betgam);
44
45    //displays the parameters of the collimator
46
47    void affiche();
48
49
50private:
51
52    vector <int> first;//tells you whether each particle hits the collimator on the front end (2), hits the collimator along the first half of the jaw (1) or doesn't hit the first half of the collimator (0)
53    vector <int> second;//tells you whether the particle hits the collimator along the last half of the jaw (1), doesn't hit the second part of the collimator (0) or gets lost in the first half of the collimator or is inside the collimator in the second half of the collimator (-1)
54
55
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.