/* * PndLineApproximation.h * * Created on: Jun 6, 2016 * Author: kibellus */ #ifndef PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_ #define PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_ #include "PndLine.h" #include "PndFtsHit.h" #include "PndTrack.h" #include "PndTrackCand.h" #include "FairTrackParP.h" #include "TVector2.h" #include "TVector3.h" #include "TClonesArray.h" #include using namespace std; class PndLineApproximation { public: PndLineApproximation(vector hits) : fLineApprox(linearRegression(hits)), fCorrectedHits(hits), hasYInfo(kTRUE){} PndLineApproximation(){} PndLineApproximation(PndLine lineApprox, vector correctedHits) :fLineApprox(lineApprox),fCorrectedHits(correctedHits) {} PndLineApproximation(PndLine lineApprox, vector ch1, vector ch2); virtual ~PndLineApproximation(); PndLine &getLine(){return fLineApprox;} void setLine(PndLine l){fLineApprox = l;} vector getHits(){return fCorrectedHits;} void setHits(vector h){fCorrectedHits = h;} PndLineApproximation newApproximation(PndLineApproximation &approx2); PndLine linearRegression(vector hits); PndLine linearRegressionXZ(vector hits); PndLine linearRegressionZX(vector hits); PndLine linearRegressionYZ(vector hits); PndLine linearRegressionZY(vector hits); PndTrack plot(Double_t zVal1, Double_t zVal2, TClonesArray *hitArr); void correctHits3DAndAdd(vector correctedHits); void setYInfo(Bool_t i){hasYInfo=i;} Bool_t HasYInfo(){return hasYInfo;} private: TVector2 linearRegression(Double_t matrix[2][3]); PndLine fLineApprox; vector fCorrectedHits; PndFtsHit* copyHitWithNewPosition(PndFtsHit *h, TVector3 pos); Bool_t hasYInfo; }; #endif /* PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_ */