PandaRoot
PndApolloniusTripletTrackFinder.h
Go to the documentation of this file.
1 /*
2  * PndApolloniusTripletTrackFinder.h
3  *
4  * Created on: 06.07.2021
5  * Author: tstockmanns
6  */
7 
8 #pragma once
9 
10 #include "TClonesArray.h"
11 #include "TVector3.h"
12 #include <vector>
13 #include <iostream>
14 #include <array>
15 
16 #include "PndSttStrawMap.h"
17 #include "PndSttGeometryMap.h"
18 #include "PndSttHit.h"
19 
20 #include "PndPreselectSttHits.h"
21 #include "PndSttCA.h"
22 #include "PndApolloniusTriplet.h"
23 
24 using namespace PndApollonius;
25 
27  public:
28  PndApolloniusTripletTrackFinder(TClonesArray *tubeArray);
29  // PndApolloniusTripletTrackFinder(){ }
31 
32  void Reset();
33  void FindTracks();
34  std::vector<TripletSolution> GetSolutions() const { return fSolutions; }
35  std::vector<TripletSolution> GetPreselectedTracks() const { return fPreselectedTracks; }
36  std::vector<TripletSolution> GetTripletsFirst() const { return fTripletsFirst; }
37  std::vector<TripletSolution> GetTripletsMid() const { return fTripletsMid; }
38  std::vector<TripletSolution> GetTripletsLast() const { return fTripletsLast; }
39  std::vector<TripletSolution> GetTripletsCombi() const { return fTripletsCombi; }
40  std::vector<TripletSolution> GetTripletTracks() const { return fTripletTracks; }
41  std::vector<TripletSolution> GetContinuousTripletTracks() const { return fContinuousTripletTracks; }
42  std::vector<TripletSolution> GetTripletTracksAfterAdding() const { return fTripletTracksAfterAdding; }
43 
44  virtual void SetPreselector(PndPreselectSttHits *val) { fPreselector = val; }
45  virtual void SetWithTubeReduction(bool reduction) { fWithTubeReduction = reduction; };
46  virtual void SetCATrackFinder(PndSttCA *CAFinder) { fCATrackFinder = CAFinder; };
47  virtual void SetBranchMap(std::map<TString, TClonesArray *> &map) { fBranchMap = map; };
48  virtual void SetWithCombiReduction(bool red) { fWithCombiReduction = red; };
49 
50  protected:
51  std::vector<std::vector<PndSttHit *>> PreselectSttHits();
52  TripletValues GenerateTriplets(std::vector<PndSttHit *> hits);
53 
54  std::vector<int> CheckForCurlingTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
55 
56  TripletValues GetTripletsStraightTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
57  TripletValues GetTripletsCurledTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
58  std::map<int, std::vector<std::vector<PndSttHit *>>> GenerateCurlingGroups();
59 
60  int GetMidIndex(int firstRow, int lastRow);
61 
62  TripletValues FindTubesForStraightInCurled(std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
63  TripletValues FindTubesForTracksInFirstRow(std::map<int, std::vector<std::vector<PndSttHit *>>> &TubeStructure);
64  void DeleteFromCurlingPool(std::vector<TripletSolution> &combinedSolutions, std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
65 
66  private:
67  std::vector<TripletSolution> fSolutions;
68  std::vector<TripletSolution> fPreselectedTracks;
69  std::vector<TripletSolution> fTripletsFirst;
70  std::vector<TripletSolution> fTripletsMid;
71  std::vector<TripletSolution> fTripletsLast;
72  std::vector<TripletSolution> fTripletsCombi;
73  std::vector<TripletSolution> fTripletTracks;
74  std::vector<TripletSolution> fContinuousTripletTracks;
75  std::vector<TripletSolution> fTripletTracksAfterAdding;
76 
77  std::vector<std::map<int, std::vector<std::vector<PndSttHit *>>>> fCurlingGroups;
78  std::vector<PndSttHit *> fCurlingGroup;
80  PndPreselectSttHits *fPreselector = nullptr;
81  PndSttGeometryMap *fGeometryMap = nullptr;
82  PndSttStrawMap *fStrawMap = nullptr;
83  PndSttCA *fCATrackFinder = nullptr;
84  int fNExpectedTracks = -1;
85  bool fWithTubeReduction = true;
86  bool fWithCombiReduction = true;
87  bool fWithCurlingTracks = true;
88 
89  bool fIsCurling = false;
90  bool fIsStrongCurling = false;
91  std::map<TString, TClonesArray *> fBranchMap;
92 
93  std::map<FairLink, int> fMapHitstoCATracklet;
94 
95  double fMinDistance = 0.;
96  int fAllHitsCounter = 0;
97  int fFirstRowNumber = 0;
98  int fLastRowNumber = 19;
99  int fBeforeSkewedRowNumber = 7;
100  int fAfterSkewedRowNumber = 16;
101 
102 };
std::vector< TripletSolution > GetPreselectedTracks() const
std::vector< TripletSolution > GetTripletsLast() const
virtual void SetPreselector(PndPreselectSttHits *val)
std::vector< TripletSolution > GetTripletTracksAfterAdding() const
virtual void SetWithTubeReduction(bool reduction)
std::vector< TripletSolution > GetTripletsMid() const
virtual void SetBranchMap(std::map< TString, TClonesArray *> &map)
std::vector< TripletSolution > GetTripletTracks() const
std::vector< TripletSolution > GetTripletsCombi() const
std::vector< TripletSolution > GetContinuousTripletTracks() const
virtual void SetCATrackFinder(PndSttCA *CAFinder)
std::vector< TripletSolution > GetSolutions() const
std::vector< TripletSolution > GetTripletsFirst() const