PandaRoot
PndHoughMerge.h
Go to the documentation of this file.
1 // PndHoughMerge
3 // Class for merging single tracklets
5 
16 #ifndef PndHoughMerge_H_
17 #define PndHoughMerge_H_
18 
19 #include "PndSttGeometryMap.h"
20 
21 #include "PndHoughUtilities.h"
22 #include "PndHoughTransformation.h"
24 
25 #include <vector>
26 
28  public:
29  PndHoughMerge(PndHoughData *data) : fCutMergeByHoughSpace(5.), fWithGhostReduction(kTRUE)
30 
31  {
32 
33  // fPndHoughUtilities = new PndHoughUtilities(data);
34  // fPndHoughTransformation = new PndHoughTransformation(data);
35 
36  ioman = FairRootManager::Instance();
37  fMapFairLinktoFairHit = data->GetMapFairLinktoFairHit();
38  fMergedTracks.clear();
39  // fMergedTrackCands.clear();
40  fData = data;
41  };
42 
43  virtual ~PndHoughMerge() { fMergedTracks.clear(); };
45  virtual void SetCutMergeByHoughSpace(float cut) { fCutMergeByHoughSpace = cut; };
47  virtual void SetWithGhostReduction(bool ghostred) { fWithGhostReduction = ghostred; }
48 
49  virtual void SetUtilities(PndHoughUtilities *utilities) { fPndHoughUtilities = utilities; }
50  // virtual void SetHoughTransformation(PndHoughTransformation *trafo) { fPndHoughTransformation = trafo; };
51  virtual void SetTrackCorrection(PndHoughTrackCorrection *correction) { fPndHoughTrackCorrection = correction; };
52  // virtual void SetHoughTransformation(PndHoughTransformation *trafo) { fPndHoughTransformation = trafo; };
53 
55  void mergeByHoughSpace(std::vector<TVector3> &PreselectedCircles, std::vector<PndTrackCand> &TrackCands, double fBz);
57  void mergeSingle(std::vector<std::vector<int>> &mergeTracks, std::vector<PndTrack> &Tracks, std::vector<PndTrackCand> &TrackCands, double fBz);
58  double findMedian(std::vector<double> a);
60  bool IsGhost(std::vector<double> &trackcirc);
62  void CalculateGhostReductionParameters(std::vector<double> &trackcirc);
64  void CountHits();
66  PndTrack GetMergedTrack(int i) { return fMergedTracks[i]; };
68  // PndTrackCand GetMergedTrackCand(int i) { return fMergedTrackCands[i]; };
70  int GetNumMergedTracks() { return fMergedTracks.size(); };
72  // int GetNumMergedTrackCands() { return fMergedTrackCands.size(); };
73  void UpdateMergedTrack(int i, PndTrack &track) { fMergedTracks[i] = track; };
74 
75  private:
76  FairRootManager *ioman = nullptr;
77 
78  PndHoughUtilities *fPndHoughUtilities = nullptr;
79  // PndHoughTransformation *fPndHoughTransformation = nullptr;
80  PndHoughTrackCorrection *fPndHoughTrackCorrection = nullptr;
81  PndHoughData *fData = nullptr;
82 
83  std::map<FairLink, FairHit *> fMapFairLinktoFairHit;
84  std::vector<PndTrack> fMergedTracks;
85  // std::vector<PndTrackCand> fMergedTrackCands;
86 
87  std::vector<std::vector<double>> fMaxima_x;
88  std::vector<std::vector<double>> fMaxima_y;
89  std::vector<std::vector<double>> fMaxima_r;
90 
91  PndTrackCand fApolloniusTrackCand;
92 
93  float fCutMergeByHoughSpace;
94 
95  Int_t fMVDHits;
96  Int_t fGEMHits;
97  double fSTTHits;
98  double fCounterHittedNeighborsRel;
99  double fmeanD;
100 
101  bool fGEMNeighborCut;
102  bool fSTTNeighborCut;
103  bool fWithGhostReduction;
104 
105  ClassDef(PndHoughMerge, 1);
106 };
107 
108 #endif /*PndHoughMerge_H_*/
virtual void SetCutMergeByHoughSpace(float cut)
Sets the value of the distance in the Hough space within two tracklets have to be merged...
Definition: PndHoughMerge.h:45
bool IsGhost(std::vector< double > &trackcirc)
Determines whether the specified track is a ghost.
void mergeSingle(std::vector< std::vector< int >> &mergeTracks, std::vector< PndTrack > &Tracks, std::vector< PndTrackCand > &TrackCands, double fBz)
Here all tracklets are merged.
virtual void SetTrackCorrection(PndHoughTrackCorrection *correction)
Definition: PndHoughMerge.h:51
int GetNumMergedTracks()
Returns a specific merged track candidate.
Definition: PndHoughMerge.h:70
std::map< FairLink, FairHit * > GetMapFairLinktoFairHit() const
Returns the map linking FairLinks to FairHits.
Definition: PndHoughData.h:90
void mergeByHoughSpace(std::vector< TVector3 > &PreselectedCircles, std::vector< PndTrackCand > &TrackCands, double fBz)
All tracklets are determined that have to be merged.
virtual void SetUtilities(PndHoughUtilities *utilities)
Definition: PndHoughMerge.h:49
unsigned int i
Definition: P4_F32vec4.h:21
void CountHits()
Counts the number of hits of different detector parts for a specific track candidate.
PndHoughMerge(PndHoughData *data)
Definition: PndHoughMerge.h:29
void CalculateGhostReductionParameters(std::vector< double > &trackcirc)
Calculates the ghost reduction parameters.
virtual void SetWithGhostReduction(bool ghostred)
Sets a bool for deciding to use a ghost reduction.
Definition: PndHoughMerge.h:47
virtual ~PndHoughMerge()
Definition: PndHoughMerge.h:43
PndTrack GetMergedTrack(int i)
Returns a specific merged track.
Definition: PndHoughMerge.h:66
double findMedian(std::vector< double > a)
void UpdateMergedTrack(int i, PndTrack &track)
Returns the number of merged track candidates.
Definition: PndHoughMerge.h:73