Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ProtonPath.h
- *
- * Created on: 15 Jun 2017
- * Author: billy
- */
- #ifndef PROTONPATH_H_
- #define PROTONPATH_H_
- #include "Path.h"
- class ProtonPath : protected Path {
- public:
- void Test();
- ProtonPath();
- //virtual ~ProtonPath();
- };
- #endif /* PROTONPATH_H_ */
- /*
- * ProtonPath.cpp
- *
- * Created on: 15 Jun 2017
- * Author: billy
- */
- #include "ProtonPath.h"
- /*
- ProtonPath::ProtonPath() {
- // TODO Auto-generated constructor stub
- }*/
- /*
- ProtonPath::~ProtonPath() {
- // TODO Auto-generated destructor stub
- }
- */
- void ProtonPath::Test() {
- }
- ProtonPath::ProtonPath() {
- }
- #ifndef PATH_H
- #define PATH_H
- #include "PositionVector.h"
- #include "DetectorData.h"
- #include <vector>
- #include <string>
- #include <Eigen/LU>
- class Path
- {
- public:
- enum class PathType { STRAIGHT, CUBIC, MLP };
- Path();
- Path(std::vector<PositionVector<double>> & positions);
- Path(DetectorData detectorData);
- Path(DetectorData detectorData, double rotationAngle);
- Path(DetectorData detectorData, PathType pathType, double rotationAngle);
- virtual ~Path();
- Path& operator=(const Path& other);
- std::vector<PositionVector<double>> & getPositions();
- int getSize();
- PositionVector<double> & getPosition(int index);
- void addPositionVector(PositionVector<double> positionVector);
- void addPositionVectors(std::vector<PositionVector<double> > positionVectors);
- std::string getPathAsString();
- std::string getPathForMatlab();
- protected:
- private:
- std::vector<PositionVector<double> > getEllipseIntersect(PositionVector<double> & A, double entryAngle, PositionVector<double> & B, double exitAngle, double phi);
- std::vector<PositionVector<double>> positions;
- Eigen::Vector4d CubicSpline(double & x0, double & x1, double & y0, double & y1, double & dy0, double & dy1);
- std::vector<PositionVector<double> > CubicSplinePath(std::vector<double> & x, Eigen::Vector4d & coeff, double & phi);
- static constexpr double DETECTOR_DISTANCE = 230;
- //static constexpr double SEMIMINOR_AXIS = 100;
- //static constexpr double SEMIMAJOR_AXIS = 100;
- static constexpr double SEMIMINOR_AXIS = 119.7;
- static constexpr double SEMIMAJOR_AXIS = 89.7;
- void rotatePath(double angle);
- };
- #endif // PATH_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement