PandaRoot
PndApolloniusTripletTrackFinder.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndApolloniusTripletTrackFinder.h
15  *
16  * Created on: 06.07.2021
17  * Author: tstockmanns
18  */
19 
20 #pragma once
21 
22 #include "TClonesArray.h"
23 #include "TVector3.h"
24 #include <vector>
25 #include <iostream>
26 #include <array>
27 
28 #include "PndSttStrawMap.h"
29 #include "PndSttGeometryMap.h"
30 #include "PndSttHit.h"
31 
32 #include "PndPreselectSttHits.h"
33 #include "PndSttCA.h"
34 #include "PndApolloniusTriplet.h"
35 
36 using namespace PndApollonius;
37 
39  public:
40  PndApolloniusTripletTrackFinder(TClonesArray *tubeArray);
41  // PndApolloniusTripletTrackFinder(){ }
43 
44  void Reset();
45  void FindTracks();
46  std::vector<TripletSolution> GetSolutions() const { return fFinalSolutions; }
47  std::vector<TripletSolution> GetPreselectedTracks() const { return fPreselectedTracks; }
48  std::vector<TripletSolution> GetTripletsFirst() const { return fTripletsFirst; }
49  std::vector<TripletSolution> GetTripletsMid() const { return fTripletsMid; }
50  std::vector<TripletSolution> GetTripletsLast() const { return fTripletsLast; }
51  std::vector<TripletSolution> GetTripletsCombi() const { return fTripletsCombi; }
52  std::vector<TripletSolution> GetTripletTracks() const { return fTripletTracks; }
53  std::vector<TripletSolution> GetContinuousTripletTracks() const { return fContinuousTripletTracks; }
54  std::vector<TripletSolution> GetTripletTracksAfterAdding() const { return fTripletTracksAfterAdding; }
55  std::vector<TripletSolution> GetCombinedSolutions() const { return fSolutions; }
56 
57  virtual void SetPreselector(PndPreselectSttHits *val) { fPreselector = val; }
58  virtual void SetWithTubeReduction(bool reduction) { fWithTubeReduction = reduction; };
59  virtual void SetCATrackFinder(PndSttCA *CAFinder) { fCATrackFinder = CAFinder; };
60  virtual void SetBranchMap(std::map<TString, TClonesArray *> &map) { fBranchMap = map; };
61  virtual void SetWithCombiReduction(bool red) { fWithCombiReduction = red; };
62  virtual void SetSTTName(TString name) { fSTT = name; };
63  virtual void SetSTTBranchOriginal(TClonesArray *array) { fSttBranchOriginal = array; };
64 
65  protected:
66  std::vector<std::vector<PndSttHit *>> PreselectSttHits();
67  TripletValues GenerateTriplets(std::vector<PndSttHit *> hits);
68 
69  std::vector<int> CheckForCurlingTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
70 
71  TripletValues GetTripletsStraightTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
72  TripletValues GetTripletsCurledTracks(std::map<int, std::vector<std::vector<PndSttHit *>>> &tubeStructure);
73  std::map<int, std::vector<std::vector<PndSttHit *>>> GenerateCurlingGroups();
74 
75  int GetMidIndex(int firstRow, int lastRow);
76 
77  TripletValues FindTubesForStraightInCurled(std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
78  TripletValues FindTubesForTracksInFirstRow(std::map<int, std::vector<std::vector<PndSttHit *>>> &TubeStructure);
79  void DeleteFromCurlingPool(std::vector<TripletSolution> &combinedSolutions, std::map<int, std::vector<std::vector<PndSttHit *>>> &CombinedTubeStructure);
80 
81  private:
82  std::vector<TripletSolution> fSolutions;
83  std::vector<TripletSolution> fFinalSolutions;
84  std::vector<TripletSolution> fPreselectedTracks;
85  std::vector<TripletSolution> fTripletsFirst;
86  std::vector<TripletSolution> fTripletsMid;
87  std::vector<TripletSolution> fTripletsLast;
88  std::vector<TripletSolution> fTripletsCombi;
89  std::vector<TripletSolution> fTripletTracks;
90  std::vector<TripletSolution> fContinuousTripletTracks;
91  std::vector<TripletSolution> fTripletTracksAfterAdding;
92 
93  std::vector<std::map<int, std::vector<std::vector<PndSttHit *>>>> fCurlingGroups;
94  std::vector<PndSttHit *> fCurlingGroup;
96  PndPreselectSttHits *fPreselector = nullptr;
97  PndSttGeometryMap *fGeometryMap = nullptr;
98  PndSttStrawMap *fStrawMap = nullptr;
99  PndSttCA *fCATrackFinder = nullptr;
100  int fNExpectedTracks = -1;
101  bool fWithTubeReduction = true;
102  bool fWithCombiReduction = true;
103  bool fWithCurlingTracks = true;
104 
105  bool fIsCurling = false;
106  bool fIsStrongCurling = false;
107  std::map<TString, TClonesArray *> fBranchMap;
108 
109  std::map<FairLink, int> fMapHitstoCATracklet;
110 
111  double fMinDistance = 0.;
112  int fAllHitsCounter = 0;
113  int fFirstRowNumber = 0;
114  int fLastRowNumber = 19;
115  int fBeforeSkewedRowNumber = 7;
116  int fAfterSkewedRowNumber = 16;
117  TString fSTT;
118  TClonesArray *fSttBranchOriginal = nullptr;
119 };
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...