PandaRoot
PndLineApproximation.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndLineApproximation.h
15  *
16  * Created on: Jun 6, 2016
17  * Author: kibellus
18  */
19 
20 #ifndef PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_
21 #define PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_
22 
23 #include "PndLine.h"
24 #include "PndFtsHit.h"
25 #include "PndTrack.h"
26 #include "PndTrackCand.h"
27 #include "FairTrackParP.h"
28 #include "TVector2.h"
29 #include "TVector3.h"
30 #include "TClonesArray.h"
31 #include <vector>
32 
33 using namespace std;
34 
36  public:
37  PndLineApproximation(vector<PndFtsHit *> hits) : fLineApprox(linearRegression(hits)), fCorrectedHits(hits), hasYInfo(kTRUE) {}
39  PndLineApproximation(PndLine lineApprox, vector<PndFtsHit *> correctedHits) : fLineApprox(lineApprox), fCorrectedHits(correctedHits) {}
40  PndLineApproximation(PndLine lineApprox, vector<PndFtsHit *> ch1, vector<PndFtsHit *> ch2);
41  virtual ~PndLineApproximation();
42  PndLine &getLine() { return fLineApprox; }
43  void setLine(PndLine l) { fLineApprox = l; }
44  vector<PndFtsHit *> getHits() { return fCorrectedHits; }
45  void setHits(vector<PndFtsHit *> h) { fCorrectedHits = h; }
46  PndLineApproximation newApproximation(PndLineApproximation &approx2);
47  PndLine linearRegression(vector<PndFtsHit *> hits);
48  PndLine linearRegressionXZ(vector<PndFtsHit *> hits);
49  PndLine linearRegressionZX(vector<PndFtsHit *> hits);
50  PndLine linearRegressionYZ(vector<PndFtsHit *> hits);
51  PndLine linearRegressionZY(vector<PndFtsHit *> hits);
52  PndTrack plot(Double_t zVal1, Double_t zVal2, TClonesArray *hitArr);
53  void correctHits3DAndAdd(vector<PndFtsHit *> correctedHits);
54  void setYInfo(Bool_t i) { hasYInfo = i; }
55  Bool_t HasYInfo() { return hasYInfo; }
56 
57  private:
58  TVector2 linearRegression(Double_t matrix[2][3]);
59  PndLine fLineApprox;
60  vector<PndFtsHit *> fCorrectedHits;
61  PndFtsHit *copyHitWithNewPosition(PndFtsHit *h, TVector3 pos);
62  Bool_t hasYInfo;
63 };
64 
65 #endif /* PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINEAPPROXIMATION_H_ */
STL namespace.
unsigned int i
Definition: P4_F32vec4.h:33
PndLineApproximation(PndLine lineApprox, vector< PndFtsHit *> correctedHits)
void setHits(vector< PndFtsHit *> h)
PndLineApproximation(vector< PndFtsHit *> hits)
vector< PndFtsHit * > getHits()