source: ZHANGProjects/ICOSIM/CPP/trunk/source/FlukaCollimator.h @ 5

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

Initial import.

File size: 3.1 KB
Line 
1#ifndef FLUKACOLLIMATOR_H
2#define FLUKACOLLIMATOR_H
3
4#include <stdlib.h>
5#include <stdio.h>
6#include <stdbool.h>
7
8#include <unistd.h>
9#include <signal.h>
10#include <assert.h>
11
12#include <iostream>
13#include <fstream>
14#include <vector>
15#include <string>
16#include <cmath>
17#if defined(FLUKA)
18#include "FlukaIO.h"
19#endif
20#include "Collimator.h"
21
22using namespace std;
23
24
25/*
26#############################################################################################################
27
28This class describes all Fluka collimators in the accelerator lattice.
29
30#############################################################################################################
31*/
32
33
34class FlukaCollimator : public Collimator
35{
36public:
37
38    //=================================================Constructors, destructor=======================================
39
40    FlukaCollimator(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);
41
42    FlukaCollimator(Element elt, const double& tcang, const double& nsig, const string& meth);
43
44    FlukaCollimator(const FlukaCollimator& obj);
45
46    virtual ~FlukaCollimator() {};
47
48
49    //method usually describing the passage through a collimator; here it is not used
50
51    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) {};
52
53    //displays the parameters of the collimator
54
55    void affiche();
56
57
58#if defined(FLUKA)
59    //specific methods describing the passage of a bunch of particles through a Fluka collimator
60
61    void collipassfluka(vector <Particle>& bunchstart, vector <Particle>& bunchend, flukaio_connection_t* connection, const int& turn, const double& momentum);
62
63
64    //change of referential for the use of Fluka
65
66    void convertToFluka(const int& turn, particle_info_t& part, const Particle& p1, const double& p0);
67
68
69    //change of referential after the passage through Fluka to return to ICOSIM++
70
71    void convertFromFluka(Particle& p1, const particle_info_t& particle, double& p0);
72
73
74    //ends a Fluka connection
75
76    void die(char* msg, flukaio_connection_t* conn);
77#endif
78
79};
80
81#endif
Note: See TracBrowser for help on using the repository browser.