Changeset 3c40083 in git for external/Hector/H_AbstractBeamLine.h
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 64a4950
- Parents:
- f6b9fec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/Hector/H_AbstractBeamLine.h
rf6b9fec r3c40083 2 2 #define _H_AbstractBeamLine_ 3 3 4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 5 * * 6 * --<--<-- A fast simulator --<--<-- * 7 * / --<--<-- of particle --<--<-- * 8 * ----HECTOR----< * 9 * \ -->-->-- transport through -->-->-- * 10 * -->-->-- generic beamlines -->-->-- * 11 * * 12 * JINST 2:P09005 (2007) * 13 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 14 * http://www.fynu.ucl.ac.be/hector.html * 15 * * 16 * Center for Cosmology, Particle Physics and Phenomenology * 17 * Universite catholique de Louvain * 18 * Louvain-la-Neuve, Belgium * 19 * * 20 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 4 /* 5 ---- Hector the simulator ---- 6 A fast simulator of particles through generic beamlines. 7 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 21 8 9 http://www.fynu.ucl.ac.be/hector.html 10 11 Centre de Physique des Particules et de Phénoménologie (CP3) 12 Université Catholique de Louvain (UCL) 13 */ 22 14 23 15 /// \file H_AbstractBeamLine.h 24 16 /// \brief Class aiming at simulating the LHC beamline. 25 17 /// 26 /// Units : angles [ urad], distances [um], energies [GeV], c=[1].18 /// Units : angles [µrad], distances [µm], energies [GeV], c=[1]. 27 19 28 20 /// default length of the beam line … … 37 29 // ROOT #includes 38 30 #include "TMatrix.h" 39 #include "TGraph.h"31 ////#include "TGraph.h" 40 32 41 33 // local #includes … … 47 39 48 40 public: 41 void init(const float ); 49 42 /// Constructors, destructor and operator 50 43 //@{ … … 53 46 H_AbstractBeamLine(const H_AbstractBeamLine &); 54 47 H_AbstractBeamLine& operator=(const H_AbstractBeamLine&); 55 H_AbstractBeamLine* clone() const ;56 48 ~H_AbstractBeamLine(); 57 49 //@} 58 50 /// Adds an element to the beamline 51 //@{ 59 52 void add(H_OpticalElement *); 53 void add(H_OpticalElement &); 54 //@} 60 55 /// Returns the (float) length of the beamline 61 constfloat getLength() const { return beam_length;};56 inline float getLength() const { return beam_length;}; 62 57 /// Returns the (int) number of optics element of the beamline, including drifts 63 const unsigned int getNumberOfElements() const { returnelements.size();};58 inline int getNumberOfElements() const { return (int)elements.size();}; 64 59 /// Returns the transport matrix for the whole beam 65 const TMatrix getBeamMatrix() const;60 const TMatrix * getBeamMatrix() const; 66 61 /// Returns the transport matrix for the whole beam, for given energy loss/mass/charge 67 const TMatrix getBeamMatrix(const float , const float, const float ) ;62 const TMatrix * getBeamMatrix(const float , const float, const float ) ; 68 63 /// Returns the transport matrix for a part of the beam from the IP to a given element 69 const TMatrix getPartialMatrix(const H_OpticalElement *) const;64 const TMatrix * getPartialMatrix(const H_OpticalElement *) const; 70 65 /// Returns the transport matrix for a part of the beam from the IP to the ith element 71 const TMatrix getPartialMatrix(const unsigned int ) const;66 const TMatrix * getPartialMatrix(const unsigned int ) const; 72 67 /// Returns the transport matrix for a part of the beam from the IP to a given element, given energy loss/mass/charge 73 const TMatrix getPartialMatrix(const string&, const float, const float, const float);68 const TMatrix * getPartialMatrix(const string, const float, const float, const float); 74 69 /// Returns the ith element of the beamline 75 70 //@{ 76 71 H_OpticalElement * getElement(const unsigned int ); 77 72 const H_OpticalElement * getElement(const unsigned int ) const; 78 73 //@} 79 74 /// Returns a given element of the beamline, choosen by name 80 75 //@{ 81 H_OpticalElement * getElement(const string &);82 H_OpticalElement * getElement(const string&) const;76 H_OpticalElement * getElement(const string ); 77 const H_OpticalElement * getElement(const string ) const; 83 78 //@} 84 79 /// Print some info … … 96 91 /// Computes global transport matrix 97 92 void calcMatrix(); 98 /// Draws the legend of theelements of the beam99 void draw( const float xmin =0.85, const float ymin=0.5, const float xmax=1, const float ymax=1) const;93 /// Draws the elements of the beam 94 void draw() const; 100 95 /// Draws the elements of the beam in the (x,s) plane 101 void drawX(const float, const float , const float scale=1) const;96 void drawX(const float, const float) const; 102 97 /// Draws the elements of the beam in the (y,s) plane 103 98 void drawY(const float, const float) const; 104 99 /// Moves an element in the list, reorders the lists and recomputes the transport matrix 105 void moveElement(const string &, const float );100 void moveElement(const string, const float ); 106 101 /// Moves the given element tranversely by given amounts. 107 void alignElement(const string &, const float, const float);102 void alignElement(const string, const float, const float); 108 103 /// Tilts the given element tranversely by given angles. 109 void tiltElement(const string &, const float, const float);104 void tiltElement(const string, const float, const float); 110 105 /// Offsets all element in X pos from the start position 111 106 void offsetElements(const float start, const float offset); 112 107 /// Draws the beta functions, from MAD 113 108 //@{ 114 TGraph * getBetaX() const;115 TGraph * getBetaY() const;109 ////TGraph * getBetaX() const; 110 ////TGraph * getBetaY() const; 116 111 //@} 117 112 /// Draws the dispersion functions, from MAD 118 113 //@{ 119 TGraph * getDX() const;120 TGraph * getDY() const;114 ////TGraph * getDX() const; 115 ////TGraph * getDY() const; 121 116 //@} 122 117 /// Draws the relative position functions, from MAD 123 118 //@{ 124 TGraph * getRelX() const;125 TGraph * getRelY() const;119 ////TGraph * getRelX() const; 120 ////TGraph * getRelY() const; 126 121 //@} 127 122 128 123 129 124 private: 125 /// list of all optics elements, including drifts 126 vector<H_OpticalElement*> elements; 130 127 /// list of matrices, 1 matrix = the transport till the end of each element 131 128 vector<TMatrix> matrices; 132 129 /// transport matrix for the whole beam 133 TMatrix beam_mat; 134 /// list of all optics elements, including drifts 135 vector<H_OpticalElement*> elements; 130 TMatrix * beam_mat; 136 131 /// Orderting method for the vector of H_OpticalElement* 137 struct ordering{ bool operator()(const H_OpticalElement* el1, const H_OpticalElement* el2) const {return (*el1 < *el2);}}; 138 // private method for copying the contents of "elements" 139 void cloneElements(const H_AbstractBeamLine&); 132 struct ordering{ bool operator()(H_OpticalElement* el1, H_OpticalElement* el2) const { return (*el1 < *el2);}}; 140 133 141 134 protected: 142 void init(const float );143 135 /// total length of the beamline 144 136 float beam_length; 145 friend std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be);146 137 }; 147 138
Note:
See TracChangeset
for help on using the changeset viewer.