PandaRoot
PndSttGeometryMap.h
Go to the documentation of this file.
1 #ifndef PNDSTTGEOMETRYMAP_H
2 #define PNDSTTGEOMETRYMAP_H
3 
4 #include <iostream>
5 #include <map>
6 #include <vector>
7 #include "TVector3.h"
8 #include "TObject.h"
9 #include "TArrayI.h"
10 
12 class PndSttTube;
13 class PndGeoSttPar;
14 class PndSttHit;
15 class FairGeoNode;
16 
17 class FairHit;
18 
19 class TClonesArray;
20 
21 using std::map;
22 using std::vector;
23 
24 class PndSttGeometryMap : public TObject {
25  public:
27  PndSttGeometryMap(TClonesArray *tubearray, Int_t geoType);
29  PndSttGeometryMap(const PndSttGeometryMap &) = delete;
31  // ----------------------------
32  void SetGeneralParameters();
33  void GenerateStrawMap(Int_t map);
34  Bool_t FillGeometryParameters();
35  // ----------------------------
36 
37  // *** GEO TYPE 1 ***
39  void GenerateStrawMapGeoType1(Int_t map);
41 
44 
45  int GetRow(int strawindex) const { return fLayerOfStraw.at(strawindex); }
46  int GetSector(int strawindex) const { return fSectorOfStraw.at(strawindex); }
47  const vector<int> &GetStrawRow(int sector, int row) const { return (fStrawIndex.find(sector))->second.at(row); }
48  const vector<vector<int>> &GetStrawSector(int sector) const { return (fStrawIndex.find(sector))->second; }
49 
50  bool IsEdgeStraw(int strawindex) const;
51  int IsSectorBorderStraw(int strawindex) const;
52 
53  bool IsAxialStraw(int strawindex) const { return fAxialStraw.at(strawindex); }
54  bool IsSkewedStraw(int strawindex) const { return !(fAxialStraw.at(strawindex)); }
55 
56  bool IsAxialRow(int rowindex) const;
57  bool IsSkewedRow(int rowindex) const;
58 
59  TArrayI FindNeighborings(PndSttTube *tube);
60  TArrayI FindNeighborings(int tubeId);
61 
62  TArrayI GetNeighboringsByMap(int tubeId);
63 
64  void FillStrawNeighborsMap();
65 
66  Double_t
67  CalculateStrawPoca(PndSttHit *hit1, PndSttHit *hit2, TVector3 &poca); // returns smallest distance between two Stt Straws. poca is set to the point between the two straws.
68 
69  double GetAngleBetweenTubes(int tubeID1, int tubeID2) const;
70 
71  bool InStraightLine(int tube1, int tube2, int tube3) const;
72 
73  // *********************
74 
75  void SetVerbose(int ver) { fVerbose = ver; }
76 
77  private:
78  Int_t fGeoType, fVerbose;
79 
80  void GenerateAngles();
81  map<int, vector<vector<int>>> fStrawIndex;
82  map<int, TArrayI> fStrawNeighbors;
83  vector<int> fSectorOfStraw;
84  vector<int> fLayerOfStraw;
85  vector<bool> fAxialStraw;
86  vector<double> fSectorStart;
87  vector<double> fSectorEnd;
88  bool fStrawMapInitialized;
89 
90  // ------------------ SECTORS/LAYERS
91  Int_t fNLayers, fNSectors, fNTubes, fNTubes_inner_parallel, fNTubes_outer_parallel, fNTubes_fillup_parallel, fNTubes_skewed, fNLayers_inner_parallel, fNLayers_skew,
92  fNLayers_outer_parallel, fNLayers_fillup_parallel;
93  Int_t **fStartTube, **fEndTube, **fShift, **fShiftSkew;
94 
95  TClonesArray *fTubeArray;
96 
97  protected:
98  ClassDef(PndSttGeometryMap, 2)
99 };
100 
101 #endif
PndSttGeometryMap & operator=(const PndSttGeometryMap &)=delete
void SetVerbose(int ver)
const vector< vector< int > > & GetStrawSector(int sector) const
int IsSectorBorderStraw(int strawindex) const
bool IsSkewedRow(int rowindex) const
void GenerateStrawMapTubeIDGeoType1()
void SetGeneralParametersGeoType1()
void SetGeneralParameters()
int GetRow(int strawindex) const
void FillStrawNeighborsMap()
int GetSector(int strawindex) const
void GenerateStrawMap(Int_t map)
bool IsAxialRow(int rowindex) const
void GenerateStrawMapAngleGeoType1()
Double_t CalculateStrawPoca(PndSttHit *hit1, PndSttHit *hit2, TVector3 &poca)
Bool_t FillGeometryParameters()
bool IsSkewedStraw(int strawindex) const
bool IsAxialStraw(int strawindex) const
bool InStraightLine(int tube1, int tube2, int tube3) const
void GenerateStrawMapGeoType1(Int_t map)
double GetAngleBetweenTubes(int tubeID1, int tubeID2) const
bool IsEdgeStraw(int strawindex) const
const vector< int > & GetStrawRow(int sector, int row) const
Bool_t FillGeometryParametersGeoType1()
TArrayI FindNeighborings(PndSttTube *tube)
TArrayI GetNeighboringsByMap(int tubeId)