[5] | 1 | #include <iostream> |
---|
| 2 | #include "stdlib.h" |
---|
| 3 | #include "partcrys.h" |
---|
| 4 | |
---|
| 5 | using namespace std; |
---|
| 6 | |
---|
| 7 | /*This class describes the particule in the crystal. It has as attribute the 8-dimensional coordinates |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | class SimCrys |
---|
| 13 | { |
---|
| 14 | |
---|
| 15 | public: |
---|
| 16 | |
---|
| 17 | //==================Constructeurs, destructeur========================================= |
---|
| 18 | |
---|
| 19 | SimCrys(Crystal crys, Partcrys part); |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | ~SimCrys() {}; |
---|
| 23 | |
---|
| 24 | Crystal crys; |
---|
| 25 | Partcrys part; |
---|
| 26 | |
---|
| 27 | //double moy; //POUR faire varier la moyenne de la gaussienne aussi !!!!! |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | //Basic function to update some data if needed |
---|
| 31 | void bases(SimCrys& sim); |
---|
| 32 | |
---|
| 33 | //First function that determins if the particule crosses the crystal. |
---|
| 34 | |
---|
| 35 | bool cross(SimCrys& sim); |
---|
| 36 | |
---|
| 37 | //IF the first function is true, this function will determin if the particule is in the amorphous layer. |
---|
| 38 | |
---|
| 39 | bool layer(SimCrys& sim); |
---|
| 40 | |
---|
| 41 | // IF the function layer is true, this function will determin the critical parameters and some other usefull parameters. |
---|
| 42 | |
---|
| 43 | void parameters(SimCrys& sim); |
---|
| 44 | |
---|
| 45 | //IF the theta particule is less than the theta critique then this function give the effect of the particule (in the part of channeling) |
---|
| 46 | |
---|
| 47 | void channel(SimCrys& sim); |
---|
| 48 | |
---|
| 49 | //IF the theta particule is not less than the theta critique then this function give the effect of the particule (in the part of volume reflexion) |
---|
| 50 | |
---|
| 51 | void reflection(SimCrys& sim); |
---|
| 52 | |
---|
| 53 | //THE GENERAL FUNCTION OF THE TEST THAT REGROUP ALL THE PREVIOUS FUNCTIONS!!!! |
---|
| 54 | |
---|
[17] | 55 | void general(SimCrys& sim, const int& pas, long int& nhit, string outputpath, double Mirror, double C_rotation, double C_aperture, double C_offset, double C_tilt, double Crystal_tilt); |
---|
[5] | 56 | |
---|
| 57 | |
---|
| 58 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 59 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 60 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 61 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 62 | |
---|
| 63 | //WE WRITE SOME FUNCTIONS IMPORTANT FUNCTION NOW |
---|
| 64 | |
---|
| 65 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 66 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 67 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 68 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | //The next function descris the movement of the particule in amorphous and returns the position.!!!! |
---|
| 72 | |
---|
| 73 | void move_am(int IS, int NAM, double DZ, double DEI, double DLY, double DLR, double& xp, double& yp, double& PC); |
---|
| 74 | |
---|
| 75 | // The next function generate un random number between 0 and 1!!!!!!!!!!!!!!! |
---|
| 76 | |
---|
| 77 | double random(); |
---|
| 78 | |
---|
| 79 | //The next function generate a random number uniformely between -500 and 1000 murad!!! |
---|
| 80 | |
---|
| 81 | double random_dist(); |
---|
| 82 | |
---|
| 83 | //// The next function generate un random number from a gaussian distribution with mean 0 and variance 1 !!!!!!!!!!!!!!! |
---|
| 84 | |
---|
| 85 | double random_gauss(); |
---|
| 86 | double random_gauss_cut(); |
---|
| 87 | //The next function generate a random number from a gaussian distribution with mean 0 and ecart-type of 500!!!!! |
---|
| 88 | |
---|
| 89 | double random_gauss_dist(/*SimCrys& sim //POUR faire varier la moyenne de la gaussienne aussi !!!!!*/); |
---|
| 90 | |
---|
| 91 | /////////////////////////////**********************************+++++++++++++++++++++++++ |
---|
| 92 | double random_gauss_dist_409(); |
---|
| 93 | //////////////////////////////********************************++++++++++++++++++++++++++++++ |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | //the next function show the crystal parameters. |
---|
| 97 | |
---|
| 98 | void affiche(); |
---|
| 99 | |
---|
| 100 | //write output in the file "crystal_output.out" |
---|
| 101 | |
---|
| 102 | void file_out(const int& pas, string outputpath); |
---|
| 103 | |
---|
| 104 | //open the output file from icosim!! |
---|
| 105 | |
---|
| 106 | void open_file(SimCrys& sim); |
---|
| 107 | |
---|
| 108 | //initate some para with the used of the previous function. |
---|
| 109 | |
---|
| 110 | void initiate(SimCrys& sim); |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | }; |
---|