Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. /*
  2. * ProtonPath.h
  3. *
  4. * Created on: 15 Jun 2017
  5. * Author: billy
  6. */
  7.  
  8. #ifndef PROTONPATH_H_
  9. #define PROTONPATH_H_
  10.  
  11. #include "Path.h"
  12.  
  13. class ProtonPath : protected Path {
  14. public:
  15. void Test();
  16. ProtonPath();
  17. //virtual ~ProtonPath();
  18. };
  19.  
  20. #endif /* PROTONPATH_H_ */
  21.  
  22.  
  23. /*
  24. * ProtonPath.cpp
  25. *
  26. * Created on: 15 Jun 2017
  27. * Author: billy
  28. */
  29.  
  30. #include "ProtonPath.h"
  31.  
  32.  
  33. /*
  34. ProtonPath::ProtonPath() {
  35. // TODO Auto-generated constructor stub
  36.  
  37. }*/
  38.  
  39. /*
  40. ProtonPath::~ProtonPath() {
  41. // TODO Auto-generated destructor stub
  42. }
  43. */
  44.  
  45. void ProtonPath::Test() {
  46.  
  47. }
  48.  
  49.  
  50. ProtonPath::ProtonPath() {
  51.  
  52. }
  53.  
  54.  
  55. #ifndef PATH_H
  56. #define PATH_H
  57.  
  58. #include "PositionVector.h"
  59. #include "DetectorData.h"
  60. #include <vector>
  61. #include <string>
  62. #include <Eigen/LU>
  63.  
  64. class Path
  65. {
  66. public:
  67. enum class PathType { STRAIGHT, CUBIC, MLP };
  68.  
  69. Path();
  70. Path(std::vector<PositionVector<double>> & positions);
  71. Path(DetectorData detectorData);
  72. Path(DetectorData detectorData, double rotationAngle);
  73. Path(DetectorData detectorData, PathType pathType, double rotationAngle);
  74.  
  75. virtual ~Path();
  76. Path& operator=(const Path& other);
  77.  
  78. std::vector<PositionVector<double>> & getPositions();
  79. int getSize();
  80. PositionVector<double> & getPosition(int index);
  81.  
  82. void addPositionVector(PositionVector<double> positionVector);
  83. void addPositionVectors(std::vector<PositionVector<double> > positionVectors);
  84.  
  85. std::string getPathAsString();
  86. std::string getPathForMatlab();
  87.  
  88. protected:
  89.  
  90. private:
  91. std::vector<PositionVector<double> > getEllipseIntersect(PositionVector<double> & A, double entryAngle, PositionVector<double> & B, double exitAngle, double phi);
  92. std::vector<PositionVector<double>> positions;
  93.  
  94. Eigen::Vector4d CubicSpline(double & x0, double & x1, double & y0, double & y1, double & dy0, double & dy1);
  95. std::vector<PositionVector<double> > CubicSplinePath(std::vector<double> & x, Eigen::Vector4d & coeff, double & phi);
  96.  
  97.  
  98. static constexpr double DETECTOR_DISTANCE = 230;
  99. //static constexpr double SEMIMINOR_AXIS = 100;
  100. //static constexpr double SEMIMAJOR_AXIS = 100;
  101. static constexpr double SEMIMINOR_AXIS = 119.7;
  102. static constexpr double SEMIMAJOR_AXIS = 89.7;
  103. void rotatePath(double angle);
  104. };
  105.  
  106. #endif // PATH_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement