PandaRoot
PndSttCAData.h
Go to the documentation of this file.
1 /*
2  * PndSttCAData.h
3  *
4  * Created on: May 8, 2014
5  * Author: schumann
6  */
7 
8 #ifndef PNDSttCADATA_H_
9 #define PNDSttCADATA_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 
22 class PndSttCAData {
23 
24  public:
25  PndSttCAData(TClonesArray *fTubeArray);
26 
27  virtual ~PndSttCAData()
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  void AddHits(TClonesArray *hits, TString branchName);
38 
40 
41  void clear()
42  {
43  fHits.clear();
44  fHitsOrig.clear();
45  fMapHitToFairLink.clear();
46  fMapTubeIdToHit.clear();
47  fHitNeighbors.clear();
48  fSeparations.clear();
49  fHitNeighborsWithoutEdges.clear();
50  fSeparationsWithoutEdges.clear();
51  fHitNeighborsWithoutSkewed.clear();
52  fSeparationsWithoutSkewed.clear();
53  }
54 
55  void PrintInfo();
56 
57  void SetAllowDoubleHits(Bool_t value) { fAllowDoubleHits = value; }
58 
59  Bool_t GetAllowDoubleHits() { return fAllowDoubleHits; }
60 
61  std::vector<FairHit *> GetHits() const { return fHits; }
62 
63  std::multimap<int, PndSttSkewedHit *> GetCombinedSkewedHits() const { return fCombinedSkewedHits; }
64 
65  PndSttStrawMap *GetStrawMap() const { return fStrawMap; }
66 
67  PndSttGeometryMap *GetGeometryMap() const { return fGeometryMap; }
68 
69  std::map<int, FairLink> GetMapHitToFairLink() const { return fMapHitToFairLink; }
70 
71  std::map<int, int> GetMapTubeIdToHit() const { return fMapTubeIdToHit; }
72 
73  std::map<int, TVector3> GetMapTubeIdToPos() const { return fMapTubeIdToPos; }
74 
75  std::map<int, std::vector<int>> GetHitNeighbors() const { return fHitNeighbors; }
76 
77  std::map<int, std::vector<int>> GetSeparations() const { return fSeparations; }
78 
79  std::map<int, std::vector<int>> GetHitNeighborsWithoutEdges() const { return fHitNeighborsWithoutEdges; }
80 
81  std::map<int, std::vector<int>> GetSeparationsWithoutEdges() const { return fSeparationsWithoutEdges; }
82 
83  std::map<int, std::vector<int>> GetHitNeighborsWithoutSkewed() const { return fHitNeighborsWithoutSkewed; }
84 
85  std::map<int, std::vector<int>> GetSeparationsWithoutSkewed() const { return fSeparationsWithoutSkewed; }
86 
87  int GetNumHits() { return fNumHits; }
88 
89  int GetNumHitsWithoutDouble() { return fNumHitsWithoutDouble; }
90 
91  private:
92  std::map<int, FairLink> fMapHitToFairLink; // map< index of hit in fHit, FairLink of SttHit>
93  std::map<int, FairLink> fMapHitToFairLinkOrig; // map< index of hit in fHitOrig, FairLink of SttHit>
94  std::vector<FairHit *> fHits; // vector with selected hits of an event
95  std::vector<FairHit *> fHitsOrig; // vector with all originally hits of an event
96  std::multimap<int, PndSttSkewedHit *> fCombinedSkewedHits; //<(inner) Tube-ID of combined stt hits of skewed layers, corresponding hit>
97 
98  Bool_t fAllowDoubleHits;
99  int fNumHits;
100  int fNumHitsWithoutDouble;
101 
102  PndSttStrawMap *fStrawMap; // for getting more information about the tubes
103  PndSttGeometryMap *fGeometryMap; // for initializing the neighbors of each tube
104  std::map<int, TVector3> fMapTubeIdToPos; // map<straw id, position of the center of the tube>
105  std::map<int, int> fMapTubeIdToHit; // map< id of straw tube, index of hit in fHit>
106 
107  std::map<int, std::vector<int>> fHitNeighbors; // map<straw id, vector<ids of hit-neighbors>>
108  std::map<int, std::vector<int>> fSeparations; // map<#active neighbors, vector<straw ids>>
109 
110  std::map<int, std::vector<int>> fHitNeighborsWithoutEdges; // map<straw id, vector<ids of hit-neighbors>>
111  std::map<int, std::vector<int>> fSeparationsWithoutEdges; // map<#active neighbors, vector<straw ids>>
112 
113  std::map<int, std::vector<int>> fHitNeighborsWithoutSkewed; // map<straw id, vector<ids of hit-neighbors>>
114  std::map<int, std::vector<int>> fSeparationsWithoutSkewed; // map<#active neighbors, vector<straw ids>>
115 
116  /* Method grades the active cells according to the number of hit-neighbors.*/
117  void SeparateNeighbors();
118 
119  /* Method searches for hit-neighbors of each cell.*/
120  void FindHitNeighbors();
121 
122  ClassDef(PndSttCAData, 1);
123 };
124 
125 #endif /* PNDSttCADATA_H_ */
PndSttGeometryMap * GetGeometryMap() const
Definition: PndSttCAData.h:67
void GenerateNeighborhoodData()
std::map< int, std::vector< int > > GetHitNeighborsWithoutSkewed() const
Definition: PndSttCAData.h:83
std::map< int, int > GetMapTubeIdToHit() const
Definition: PndSttCAData.h:71
PndSttStrawMap * GetStrawMap() const
Definition: PndSttCAData.h:65
std::map< int, FairLink > GetMapHitToFairLink() const
Definition: PndSttCAData.h:69
PndSttCAData(TClonesArray *fTubeArray)
virtual ~PndSttCAData()
Definition: PndSttCAData.h:27
unsigned int i
Definition: P4_F32vec4.h:21
void AddHits(TClonesArray *hits, TString branchName)
std::map< int, std::vector< int > > GetSeparationsWithoutEdges() const
Definition: PndSttCAData.h:81
std::map< int, TVector3 > GetMapTubeIdToPos() const
Definition: PndSttCAData.h:73
std::map< int, std::vector< int > > GetSeparationsWithoutSkewed() const
Definition: PndSttCAData.h:85
Bool_t GetAllowDoubleHits()
Definition: PndSttCAData.h:59
std::map< int, std::vector< int > > GetSeparations() const
Definition: PndSttCAData.h:77
int GetNumHits()
Definition: PndSttCAData.h:87
std::map< int, std::vector< int > > GetHitNeighbors() const
Definition: PndSttCAData.h:75
std::vector< FairHit * > GetHits() const
Definition: PndSttCAData.h:61
std::multimap< int, PndSttSkewedHit * > GetCombinedSkewedHits() const
Definition: PndSttCAData.h:63
void clear()
Definition: PndSttCAData.h:41
std::map< int, std::vector< int > > GetHitNeighborsWithoutEdges() const
Definition: PndSttCAData.h:79
int GetNumHitsWithoutDouble()
Definition: PndSttCAData.h:89
void PrintInfo()
void SetAllowDoubleHits(Bool_t value)
Definition: PndSttCAData.h:57