PandaRoot
PndSttStrawMap.h
Go to the documentation of this file.
1 /*
2  * PndSTTStrawMap.h
3  *
4  * Created on: Apr 16, 2013
5  * Author: mertens
6  */
7 
8 #ifndef PNDSTTSTRAWMAP_H_
9 #define PNDSTTSTRAWMAP_H_
10 
11 #include <map>
12 #include <vector>
13 
14 #include "TObject.h"
15 #include "TClonesArray.h"
16 
17 class PndSttTube;
18 
19 using std::map;
20 using std::vector;
21 
22 class PndSttStrawMap : public TObject {
23  public:
25  PndSttStrawMap(TClonesArray *const stt_tube_array);
26  PndSttStrawMap(const PndSttStrawMap &) = delete;
27  PndSttStrawMap &operator=(const PndSttStrawMap &) = delete;
28 
29  const vector<int> &GetStrawRow(int sector, int row) const { return (fStrawIndex.find(sector))->second.at(row); }
30  const vector<vector<int>> &GetStrawSector(int sector) const { return (fStrawIndex.find(sector))->second; }
31  int GetSector(int strawindex) const { return fSectorOfStraw.at(strawindex); }
32  int FindPhiSector(double phi) const;
33  int GetRow(int strawindex) const { return fRowOfStraw.at(strawindex); }
34  int GetLeftSector(int sector) const { return ((sector + 1) % 6); }
35  int GetRightSector(int sector) const { return ((sector + 5) % 6); }
36 
37  bool IsEdgeStraw(int strawindex) const;
38  int IsSectorBorderStraw(int strawindex) const;
39 
40  bool IsAxialStraw(int strawindex) const { return fAxialStraw.at(strawindex); }
41  bool IsSkewedStraw(int strawindex) const { return !(fAxialStraw.at(strawindex)); }
42 
43  bool IsAxialRow(int rowindex) const;
44  bool IsSkewedRow(int rowindex) const;
45 
46  PndSttTube *GetTube(int strawindex) const { return (PndSttTube *)fTubeArray->At(strawindex); }
47 
48  void GenerateStrawMap(TClonesArray *const stt_tube_array);
49 
50  private:
51  void GenerateAngles();
52 
53  map<int, vector<vector<int>>> fStrawIndex;
54  vector<int> fSectorOfStraw;
55  vector<int> fRowOfStraw;
56  vector<bool> fAxialStraw;
57  bool fStrawMapInitialized;
58 
59  TClonesArray *fTubeArray;
60 
61  vector<double> fSectorStart;
62  vector<double> fSectorEnd;
63 
64  ClassDef(PndSttStrawMap, 1)
65 };
66 
67 #endif /* PNDSTTSTRAWMAP_H_ */
bool IsAxialStraw(int strawindex) const
int FindPhiSector(double phi) const
bool IsAxialRow(int rowindex) const
const vector< vector< int > > & GetStrawSector(int sector) const
bool IsSkewedStraw(int strawindex) const
bool IsSkewedRow(int rowindex) const
int IsSectorBorderStraw(int strawindex) const
PndSttStrawMap & operator=(const PndSttStrawMap &)=delete
int GetSector(int strawindex) const
int GetRightSector(int sector) const
const vector< int > & GetStrawRow(int sector, int row) const
int GetLeftSector(int sector) const
void GenerateStrawMap(TClonesArray *const stt_tube_array)
PndSttTube * GetTube(int strawindex) const
int GetRow(int strawindex) const
bool IsEdgeStraw(int strawindex) const