FairRoot/PandaRoot
PndSttHelixTrackFitter.h
Go to the documentation of this file.
1 
10 #ifndef PNDSTTHELIXTRACKFITTER
11 #define PNDSTTHELIXTRACKFITTER 1
12 
13 #include "PndSttTrack.h"
14 //#include "PndTrackCand.h"
15 //#include "PndSttPoint.h"
16 //#include "FairTrackParam.h"
17 #include "PndSttTrackFitter.h"
18 
19 //#include "TH2F.h"
20 //#include "TCanvas.h"
21 #include "TList.h"
22 
23 #include <map>
24 
25 class FairTrackParam;
26 class PndSttHit;
27 //class PndSttTrackFitter;
28 class TCanvas;
29 class TH2F;
30 class TH1F;
31 
32 void fcnHelix(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
33 void fcnHelix2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
34 
36 {
37  private:
39 
43 
44  TClonesArray* fHitArray;
45  TClonesArray* fPointArray;
46  TObjArray *ZPointsArray;
47 
48  TH2F *h1, *h2, *h3, *h4, *houg;
49  TH1F *hougcon;
52  Int_t fVerbose;
53 
54  public:
58  void Init();
59 
60  // xy plane ----------------------
61  // intersection finder
63  // fit
64  Int_t XYFit(PndTrackCand* pTrackCand, Int_t whatToFit);
65  Int_t XYFitThroughOrigin(PndTrackCand* pTrackCand, Int_t whatToFit);
66  Int_t MinuitFit(PndTrackCand* pTrackCand, Int_t whatToFit);
67  Int_t SetUpFitVector(PndTrackCand* pTrackCand, TMatrixT<Double32_t> &fitvect);
68 
69  // z track length plane ----------
70  // zfinder
71  Bool_t ZFinder(PndTrackCand* pTrackCand, Int_t whatToFit);
72  Bool_t ZFinderThroughOrigin(PndTrackCand* pTrackCand, Int_t whatToFit);
73 
74  // hough
75  void Hough(TVector3* choice, Double_t Phi0, Double_t x0, Double_t y0, Double_t R);
76  TVector3 GetHoughResponse();
79 
80  // zfit
81  Int_t ZFit(PndTrackCand* pTrackCand, Int_t whatToFit);
82  Int_t ZFitThroughOrigin(PndTrackCand* pTrackCand, Int_t whatToFit);
83  TVector3 FindCorrectZ(TObjArray* choices, Double_t x_0, Double_t y_0, Double_t x0, Double_t y0, Double_t R);
84  Int_t DoFit(PndTrackCand* pTrackCand, PndSttTrack* pTrack, Int_t pidHypo = 211);
85  // plain = with no constraint
86  Int_t DoFitPlain(PndTrackCand* pTrackCand, PndSttTrack* pTrack, Int_t pidHypo = 211);
87  // through origin = force the track to pass in 0, 0, 0.
88  // Int_t DoFitThroughOrigin(PndTrackCand* pTrackCand, PndSttTrack* pTrack, Int_t pidHypo = 211);
89 
90  // charge reconstruction from xy fit
91  Int_t GetCharge(Double_t dCenter, Double_t phiCenter, Double_t radius);
92  void OrderHitsByR(std::map <Double_t, Int_t> &hitMap);
93  Double_t GetHitAngle(Int_t hitNo, Double_t dCenter, Double_t phiCenter, Double_t radius);
94 
95  PndSttHit* GetHitFromCollections(Int_t hitCounter) const;
97  virtual void AddHitCollection(TClonesArray* mHitArray) {fHitCollectionList.Add(mHitArray); }
98 
99 
100  virtual void Extrapolate( PndSttTrack* track, Double_t r,
101  FairTrackParam *param );
102 
103  // all: kTRUE = also z param; kFALSE = only xy param
104  // void SetParameters(PndSttTrack* pTrack, Bool_t all); /* commented out by JGM, 16/01/2010 */
105 
106  // marray reset
107  void ResetMArray();
108 
109  PndSttTrack* GetTrack() const { return fTrack; };
110  PndTrackCand* GetTrackCand() const { return fTrackCand; };
111  TClonesArray* GetHitArray() const { return fHitArray; };
112 
113  void SetConstraint(Int_t con) {fConstraint = con;};
114  Int_t GetConstraint() { return fConstraint; };
115 
117 
118  // 0 = no contraint, 1 = the track passes through (0, 0, 0)
119  Int_t fConstraint;
120 
121  TClonesArray *fTubeArray;
122  void SetTubeArray(TClonesArray *tubeArray) { fTubeArray = tubeArray; };
123 
124 
125  Int_t fDisplayLevel;
126  void SetDisplayLevel(Int_t display = 2) {fDisplayLevel = display; };
127  void InitEventDisplay();
128  Bool_t RunEventDisplay(PndTrackCand *trackCand);
130 
131 
133 };
134 
135 #endif
Int_t XYFit(PndTrackCand *pTrackCand, Int_t whatToFit)
Double_t x0
Definition: checkhelixhit.C:70
Double_t GetHitAngle(Int_t hitNo, Double_t dCenter, Double_t phiCenter, Double_t radius)
void Hough(TVector3 *choice, Double_t Phi0, Double_t x0, Double_t y0, Double_t R)
void fcnHelix2(Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t)
double r
Definition: RiemannTest.C:14
#define choice(c1, c2, c3)
Definition: PndCAMath.h:75
virtual void Extrapolate(PndSttTrack *track, Double_t r, FairTrackParam *param)
#define verbose
void HoughThroughOrigin(TVector3 *choice, Double_t Phi0, Double_t x0, Double_t y0, Double_t R)
Int_t ZFit(PndTrackCand *pTrackCand, Int_t whatToFit)
Double_t par[3]
Bool_t RunEventDisplay(PndTrackCand *trackCand)
Int_t ZFitThroughOrigin(PndTrackCand *pTrackCand, Int_t whatToFit)
TVector3 FindCorrectZ(TObjArray *choices, Double_t x_0, Double_t y_0, Double_t x0, Double_t y0, Double_t R)
Bool_t IntersectionFinder(PndTrackCand *pTrackCand)
void FinishEventDisplay(PndSttTrack *track)
virtual void AddHitCollection(TClonesArray *mHitArray)
PndSttTrack * GetTrack() const
ClassDef(PndSttHelixTrackFitter, 1)
void SetTubeArray(TClonesArray *tubeArray)
Double_t
Double_t y0
Definition: checkhelixhit.C:71
PndMCTrack * track
Definition: anaLmdCluster.C:89
TFile * f
Definition: bump_analys.C:12
Int_t DoFit(PndTrackCand *pTrackCand, PndSttTrack *pTrack, Int_t pidHypo=211)
void SetDisplayLevel(Int_t display=2)
void OrderHitsByR(std::map< Double_t, Int_t > &hitMap)
PndSttHit * GetHitFromCollections(Int_t hitCounter) const
PndTrackCand * GetTrackCand() const
Int_t DoFitPlain(PndTrackCand *pTrackCand, PndSttTrack *pTrack, Int_t pidHypo=211)
Bool_t ZFinderThroughOrigin(PndTrackCand *pTrackCand, Int_t whatToFit)
Int_t XYFitThroughOrigin(PndTrackCand *pTrackCand, Int_t whatToFit)
TClonesArray * GetHitArray() const
Bool_t ZFinder(PndTrackCand *pTrackCand, Int_t whatToFit)
Int_t MinuitFit(PndTrackCand *pTrackCand, Int_t whatToFit)
Double_t R
Definition: checkhelixhit.C:61
Int_t GetCharge(Double_t dCenter, Double_t phiCenter, Double_t radius)
Int_t SetUpFitVector(PndTrackCand *pTrackCand, TMatrixT< Double32_t > &fitvect)
void fcnHelix(Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t)