PandaRoot
PndSttCellTrackFinderData.h
Go to the documentation of this file.
1 /*
2  * PndSttCellTrackFinderData.h
3  *
4  * Created on: May 8, 2014
5  * Author: schumann
6  */
7 
8 #ifndef PNDSTTCELLTRACKFINDERDATA_H_
9 #define PNDSTTCELLTRACKFINDERDATA_H_
10 
11 #include <vector>
12 #include <map>
13 
14 #include "TVector3.h"
15 #include "PndSttGeometryMap.h"
16 #include "PndSttStrawMap.h"
17 #include "FairHit.h"
18 
19 class TClonesArray;
20 class PndSttSkewedHit;
21 
23 
24  public:
25  PndSttCellTrackFinderData(TClonesArray *fTubeArray);
26 
28  {
29  delete fStrawMap;
30  delete fGeometryMap;
31  for (size_t i = 0; i < fHits.size(); ++i)
32  delete fHits.at(i);
33  for (size_t i = 0; i < fHitsOrig.size(); ++i)
34  delete fHitsOrig.at(i);
35  }
36  // only support STTHits , uses brachNAme to distinguish between normal and skewed straws
37 
38  void AddHits(TClonesArray *hits, TString branchName);
39 
41 
42  void clear()
43  {
44  fHits.clear();
45  fHitsOrig.clear();
46  fMapHitToFairLink.clear();
47  fMapTubeIdToHit.clear();
48  fHitNeighbors.clear();
49  fSeparations.clear();
50  fCombinedSkewedHits.clear();
51  fHitNeighborsWithoutEdges.clear();
52  fSeparationsWithoutEdges.clear();
53  fHitNeighborsWithoutSkewed.clear();
54  fSeparationsWithoutSkewed.clear();
55  }
56 
57  void PrintInfo();
58 
59  void SetAllowDoubleHits(Bool_t value) { fAllowDoubleHits = value; }
60 
61  Bool_t GetAllowDoubleHits() { return fAllowDoubleHits; }
62 
63  std::vector<FairHit *> GetHits() const { return fHits; }
64 
65  std::multimap<int, PndSttSkewedHit *> GetCombinedSkewedHits() const { return fCombinedSkewedHits; }
66 
67  PndSttStrawMap *GetStrawMap() const { return fStrawMap; }
68 
69  PndSttGeometryMap *GetGeometryMap() const { return fGeometryMap; }
70 
71  std::map<int, FairLink> GetMapHitToFairLink() const { return fMapHitToFairLink; }
72 
73  std::map<int, int> GetMapTubeIdToHit() const { return fMapTubeIdToHit; }
74 
75  std::map<int, TVector3> GetMapTubeIdToPos() const { return fMapTubeIdToPos; }
76 
77  std::map<int, std::vector<int>> GetHitNeighbors() const { return fHitNeighbors; }
78 
79  std::map<int, std::vector<int>> GetSeparations() const { return fSeparations; }
80 
81  std::map<int, std::vector<int>> GetHitNeighborsWithoutEdges() const { return fHitNeighborsWithoutEdges; }
82 
83  std::map<int, std::vector<int>> GetSeparationsWithoutEdges() const { return fSeparationsWithoutEdges; }
84 
85  std::map<int, std::vector<int>> GetHitNeighborsWithoutSkewed() const { return fHitNeighborsWithoutSkewed; }
86 
87  std::map<int, std::vector<int>> GetSeparationsWithoutSkewed() const { return fSeparationsWithoutSkewed; }
88 
89  int GetNumHits() { return fNumHits; }
90 
91  int GetNumHitsWithoutDouble() { return fNumHitsWithoutDouble; }
92  void SetRunTimeBased(Bool_t val) { fRunTimeBased = val; };
93  void SetClusterTime(double val) { fClusterTime = val; };
94 
95  private:
96  std::map<int, FairLink> fMapHitToFairLink; // map< index of hit in fHit, FairLink of SttHit>
97  std::map<int, FairLink> fMapHitToFairLinkOrig; // map< index of hit in fHitOrig, FairLink of SttHit>
98  std::vector<FairHit *> fHits; // vector with selected hits of an event
99  std::vector<FairHit *> fHitsOrig; // vector with all originally hits of an event
100  std::multimap<int, PndSttSkewedHit *> fCombinedSkewedHits; //<(inner) Tube-ID of combined stt hits of skewed layers, corresponding hit>
101 
102  double fClusterTime; // J.R. 17/04-2018
103  Bool_t fAllowDoubleHits;
104  int fNumHits;
105  int fNumHitsWithoutDouble;
106  Bool_t fRunTimeBased;
107 
108  PndSttStrawMap *fStrawMap; // for getting more information about the tubes
109  PndSttGeometryMap *fGeometryMap; // for initializing the neighbors of each tube
110  std::map<int, TVector3> fMapTubeIdToPos; // map<straw id, position of the center of the tube>
111  std::map<int, int> fMapTubeIdToHit; // map< id of straw tube, index of hit in fHit>
112 
113  std::map<int, std::vector<int>> fHitNeighbors; // map<straw id, vector<ids of hit-neighbors>>
114  std::map<int, std::vector<int>> fSeparations; // map<#active neighbors, vector<straw ids>>
115 
116  std::map<int, std::vector<int>> fHitNeighborsWithoutEdges; // map<straw id, vector<ids of hit-neighbors>>
117  std::map<int, std::vector<int>> fSeparationsWithoutEdges; // map<#active neighbors, vector<straw ids>>
118 
119  std::map<int, std::vector<int>> fHitNeighborsWithoutSkewed; // map<straw id, vector<ids of hit-neighbors>>
120  std::map<int, std::vector<int>> fSeparationsWithoutSkewed; // map<#active neighbors, vector<straw ids>>
121 
122  /* Method grades the active cells according to the number of hit-neighbors.*/
123  void SeparateNeighbors();
124 
125  /* Method searches for hit-neighbors of each cell.*/
126 
127  void FindHitNeighborsEventBased();
128 
129  void FindHitNeighborsTimeBased();
130 
131  ClassDef(PndSttCellTrackFinderData, 1);
132 };
133 
134 #endif /* PNDSTTCELLTRACKFINDERDATA_H_ */
PndSttGeometryMap * GetGeometryMap() const
std::map< int, std::vector< int > > GetHitNeighbors() const
std::map< int, int > GetMapTubeIdToHit() const
unsigned int i
Definition: P4_F32vec4.h:21
std::map< int, TVector3 > GetMapTubeIdToPos() const
std::map< int, std::vector< int > > GetHitNeighborsWithoutSkewed() const
std::map< int, std::vector< int > > GetSeparations() const
std::vector< FairHit * > GetHits() const
void AddHits(TClonesArray *hits, TString branchName)
std::map< int, std::vector< int > > GetSeparationsWithoutSkewed() const
PndSttCellTrackFinderData(TClonesArray *fTubeArray)
std::multimap< int, PndSttSkewedHit * > GetCombinedSkewedHits() const
std::map< int, FairLink > GetMapHitToFairLink() const
std::map< int, std::vector< int > > GetSeparationsWithoutEdges() const
std::map< int, std::vector< int > > GetHitNeighborsWithoutEdges() const
PndSttStrawMap * GetStrawMap() const