FairRoot/PandaRoot
PndFtsHoughTracklet.cxx
Go to the documentation of this file.
1 #include "PndFtsHoughTracklet.h"
2 
4 
5 #include <iostream>
6 #include "math.h"
7 
8 #include "TClonesArray.h"
9 #include "FairRootManager.h"
10 #include "PndFtsHit.h"
11 #include "PndTrack.h"
12 
13 
14 
15 
17 
19  fTrackerTask(trackerTask),
20  fVerbose(0),
21  fIsSet(kFALSE),
22  fPeakHeightFromPeakFinder(0.),
23  fThetaRadVal(0.),
24  fThetaRadHw(0.),
25  fSecondVal(0.),
26  fSecondHw(0.),
27  fZRefLabSys(zRefLabSys)
28 {
29  if (0==fTrackerTask){
30  std::cout << "PndFtsHoughTracklet FATAL ERROR Tracker task pointer not set in constructor.\n";
31  } else {
33  if(3<fVerbose) std::cout << "PndFtsHoughTracklet called with tracker ptr " << fTrackerTask << '\n';
34  }
35 }
36 
38 {
39 
40 }
41 
42 
43 
44 
46  const Double_t thetaRadVal,
47  const Double_t secondVal,
48 
49  const Double_t peakHeight,
50 
51  const Double_t thetaRadHw,
52  const Double_t secondHw
53 ){
54  fPeakHeightFromPeakFinder = peakHeight;
55 
56  // set values from Hough space peak
57  fThetaRadVal = thetaRadVal;
58  fSecondVal = secondVal;
59  fThetaRadHw = thetaRadHw;
60  fSecondHw = secondHw;
61 
62  // addPeakHits();
63 
64  fIsSet = kTRUE;
65 }
66 
67 
68 
69 
71  UInt_t nSharedHits = 0;
72  // go through all hits in *this and check if they are also in rhs, if yes, increase numberOfSharedHits by 1 (per shared hit)
73  for (UInt_t iHit = 0; iHit < GetNHits(); ++iHit){
74  PndTrackCandHit thisHit = GetSortedHit(iHit);
75  Int_t thisHitId = thisHit.GetHitId();
76  Int_t thisDetId = thisHit.GetDetId();
77  // if hit is NOT in track -1 is returned by HitInTrack, otherwise the index (>=0) in the HitId vector is returned
78  if (-1<rhs.HitInTrack(thisDetId,thisHitId)){
79  // hit is in track
80  ++nSharedHits;
81  }
82  }
83  return nSharedHits;
84 }
85 
86 
88  std::cout << "=========== PndFtsHoughTracklet::Print() ==========" << std::endl;
89  if (kTRUE==fIsSet){
90  std::cout << "theta = " << fThetaRadVal << " second = " << fSecondVal << std::endl << std::endl;
91  std::cout << "theta = " << fThetaRadHw << " second = " << fSecondHw << std::endl << std::endl;
92  }
93 }
94 
int fVerbose
Definition: poormantracks.C:24
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
PndTrackCandHit GetSortedHit(UInt_t i)
Definition: PndTrackCand.h:54
PndFtsHoughTrackerTask * fTrackerTask
Class for saving the result of one Hough transform for FTS PR.
void SetHoughTransformResults(const Double_t thetaVal, const Double_t secondVal, const Double_t peakHeight, const Double_t thetaHw, const Double_t secondHw)
Double_t
PndFtsHoughTracklet(Double_t zRefLabSys=0., PndFtsHoughTrackerTask *trackerTask=0)
Set pointer to tracker task (super important as it provides an I/O interface to PandaRoot) ...
UInt_t getNSharedHits(const PndFtsHoughTracklet &rhs)
UInt_t GetNHits() const
Definition: PndTrackCand.h:59
ClassImp(PndAnaContFact)
Int_t GetHitId() const
Int_t GetDetId() const
Int_t HitInTrack(UInt_t detId, UInt_t hitId) const