PandaRoot
PndLineApproximation.h
Go to the documentation of this file.
1 /*
2  * PndLineApproximation.h
3  *
4  * Created on: Jun 6, 2016
5  * Author: kibellus
6  */
7 
8 #ifndef PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_
9 #define PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_
10 
11 #include "PndLine.h"
12 #include "PndFtsHit.h"
13 #include "PndTrack.h"
14 #include "PndTrackCand.h"
15 #include "FairTrackParP.h"
16 #include "TVector2.h"
17 #include "TVector3.h"
18 #include "TClonesArray.h"
19 #include <vector>
20 
21 using namespace std;
22 
24  public:
25  PndLineApproximation(vector<PndFtsHit *> hits) : fLineApprox(linearRegression(hits)), fCorrectedHits(hits), hasYInfo(kTRUE) {}
27  PndLineApproximation(PndLine lineApprox, vector<PndFtsHit *> correctedHits) : fLineApprox(lineApprox), fCorrectedHits(correctedHits) {}
28  PndLineApproximation(PndLine lineApprox, vector<PndFtsHit *> ch1, vector<PndFtsHit *> ch2);
29  virtual ~PndLineApproximation();
30  PndLine &getLine() { return fLineApprox; }
31  void setLine(PndLine l) { fLineApprox = l; }
32  vector<PndFtsHit *> getHits() { return fCorrectedHits; }
33  void setHits(vector<PndFtsHit *> h) { fCorrectedHits = h; }
34  PndLineApproximation newApproximation(PndLineApproximation &approx2);
35  PndLine linearRegression(vector<PndFtsHit *> hits);
36  PndLine linearRegressionXZ(vector<PndFtsHit *> hits);
37  PndLine linearRegressionZX(vector<PndFtsHit *> hits);
38  PndLine linearRegressionYZ(vector<PndFtsHit *> hits);
39  PndLine linearRegressionZY(vector<PndFtsHit *> hits);
40  PndTrack plot(Double_t zVal1, Double_t zVal2, TClonesArray *hitArr);
41  void correctHits3DAndAdd(vector<PndFtsHit *> correctedHits);
42  void setYInfo(Bool_t i) { hasYInfo = i; }
43  Bool_t HasYInfo() { return hasYInfo; }
44 
45  private:
46  TVector2 linearRegression(Double_t matrix[2][3]);
47  PndLine fLineApprox;
48  vector<PndFtsHit *> fCorrectedHits;
49  PndFtsHit *copyHitWithNewPosition(PndFtsHit *h, TVector3 pos);
50  Bool_t hasYInfo;
51 };
52 
53 #endif /* PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_ */
STL namespace.
unsigned int i
Definition: P4_F32vec4.h:21
PndLineApproximation(PndLine lineApprox, vector< PndFtsHit *> correctedHits)
void setHits(vector< PndFtsHit *> h)
PndLineApproximation(vector< PndFtsHit *> hits)
vector< PndFtsHit * > getHits()