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