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 fFinalSolutions; }
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  std::vector<TripletSolution> GetCombinedSolutions() const { return fSolutions; }
44 
45  virtual void SetPreselector(PndPreselectSttHits *val) { fPreselector = val; }
46  virtual void SetWithTubeReduction(bool reduction) { fWithTubeReduction = reduction; };
47  virtual void SetCATrackFinder(PndSttCA *CAFinder) { fCATrackFinder = CAFinder; };
48  virtual void SetBranchMap(std::map<TString, TClonesArray *> &map) { fBranchMap = map; };
49  virtual void SetWithCombiReduction(bool red) { fWithCombiReduction = red; };
50  virtual void SetSTTName(TString name) { fSTT = name; };
51  virtual void SetSTTBranchOriginal(TClonesArray *array) { fSttBranchOriginal = array; };
52 
53  protected:
54  std::vector<std::vector<PndSttHit *>> PreselectSttHits();
55  TripletValues GenerateTriplets(std::vector<PndSttHit *> hits);
56 
57  std::vector<int> CheckForCurlingTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
58 
59  TripletValues GetTripletsStraightTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
60  TripletValues GetTripletsCurledTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
61  std::map<int, std::vector<std::vector<PndSttHit *>>> GenerateCurlingGroups();
62 
63  int GetMidIndex(int firstRow, int lastRow);
64 
65  TripletValues FindTubesForStraightInCurled(std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
66  TripletValues FindTubesForTracksInFirstRow(std::map<int, std::vector<std::vector<PndSttHit *>>> &TubeStructure);
67  void DeleteFromCurlingPool(std::vector<TripletSolution> &combinedSolutions, std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
68 
69  private:
70  std::vector<TripletSolution> fSolutions;
71  std::vector<TripletSolution> fFinalSolutions;
72  std::vector<TripletSolution> fPreselectedTracks;
73  std::vector<TripletSolution> fTripletsFirst;
74  std::vector<TripletSolution> fTripletsMid;
75  std::vector<TripletSolution> fTripletsLast;
76  std::vector<TripletSolution> fTripletsCombi;
77  std::vector<TripletSolution> fTripletTracks;
78  std::vector<TripletSolution> fContinuousTripletTracks;
79  std::vector<TripletSolution> fTripletTracksAfterAdding;
80 
81  std::vector<std::map<int, std::vector<std::vector<PndSttHit *>>>> fCurlingGroups;
82  std::vector<PndSttHit *> fCurlingGroup;
84  PndPreselectSttHits *fPreselector = nullptr;
85  PndSttGeometryMap *fGeometryMap = nullptr;
86  PndSttStrawMap *fStrawMap = nullptr;
87  PndSttCA *fCATrackFinder = nullptr;
88  int fNExpectedTracks = -1;
89  bool fWithTubeReduction = true;
90  bool fWithCombiReduction = true;
91  bool fWithCurlingTracks = true;
92 
93  bool fIsCurling = false;
94  bool fIsStrongCurling = false;
95  std::map<TString, TClonesArray *> fBranchMap;
96 
97  std::map<FairLink, int> fMapHitstoCATracklet;
98 
99  double fMinDistance = 0.;
100  int fAllHitsCounter = 0;
101  int fFirstRowNumber = 0;
102  int fLastRowNumber = 19;
103  int fBeforeSkewedRowNumber = 7;
104  int fAfterSkewedRowNumber = 16;
105  TString fSTT;
106  TClonesArray *fSttBranchOriginal = nullptr;
107 };
std::vector< TripletSolution > GetPreselectedTracks() const
std::vector< TripletSolution > GetCombinedSolutions() 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)
A structure that defines all functions used for the Apollonius Triplet track finder.
std::vector< TripletSolution > GetTripletTracks() const
std::vector< TripletSolution > GetTripletsCombi() const
virtual void SetSTTBranchOriginal(TClonesArray *array)
std::vector< TripletSolution > GetContinuousTripletTracks() const
virtual void SetCATrackFinder(PndSttCA *CAFinder)
std::vector< TripletSolution > GetSolutions() const
std::vector< TripletSolution > GetTripletsFirst() const
A structure that defines the three sets of STT hits (inner, mid, outer STT set), that are used to com...