/* * PndFtsLineComparator.h * * Created on: Jun 2, 2016 * Author: kibellus */ #include "PndLine.h" #include "TVector3.h" #include "TMath.h" #include #ifndef PNDTOOLS_PNDFORWARDTRACKFINDER_PNDFTSLINECOMPARATOR_H_ #define PNDTOOLS_PNDFORWARDTRACKFINDER_PNDFTSLINECOMPARATOR_H_ using namespace std; /* * This class is used to decide whether two lines are similar. * Therefore it calculate the angle between the lines and the pearcing points * of the lines through the plane z=zValue. It is possiple to use different methods. * areEqual and areEqual2D decide whether the lines are similar. As limit will * be used the parameter of the constructor. There are mixed quality creteria. * These are used in the methods getQuality3D and getQuality. A single call * to calculate only distance or only angle is possible with the methods * getAngle, getDist, getAngle2D and getDist2D. * The 2D methods calculate distance and angle for the XZ projection. */ class PndFtsLineComparator { public: PndFtsLineComparator(Double_t maxDistance, Double_t maxAngle, Double_t z=0) : fMaxDistance(maxDistance), fMaxAngle(maxAngle), zValue(z){} virtual ~PndFtsLineComparator(); Bool_t areEqual(PndLine l1, PndLine l2); Bool_t areEqual2D(PndLine l1, PndLine l2); Double_t getQuality3D(PndLine l1, PndLine l2); Double_t getQuality(PndLine l1, PndLine l2); void setZValue(Double_t z){zValue = z;} Double_t getAngle(TVector3 d1,TVector3 d2); Double_t getDist(TVector3 b1,TVector3 b2,TVector3 d1,TVector3 d2); Double_t getAngle2D(TVector3 d1,TVector3 d2); Double_t getDist2D(TVector3 b1,TVector3 b2,TVector3 d1,TVector3 d2); //setter for the limits void setMaxDistance(Double_t d){fMaxDistance=d;} void setMaxAngle(Double_t a){fMaxAngle=a;} //getter for the limits Double_t getMaxDist(){return fMaxDistance;} Double_t getMaxAngle(){return fMaxAngle;} private: Double_t fMaxDistance; //the limit for the distance Double_t fMaxAngle; //the limit for the angle //The z-value for the plane which is used for the pearcing points (z=zValue) Double_t zValue; }; #endif /* PNDTOOLS_PNDFORWARDTRACKFINDER_PNDFTSLINECOMPARATOR_H_ */