PandaRoot
PndSttStrawMap.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  * PndSTTStrawMap.h
15  *
16  * Created on: Apr 16, 2013
17  * Author: mertens
18  */
19 
20 #ifndef PNDSTTSTRAWMAP_H_
21 #define PNDSTTSTRAWMAP_H_
22 
23 #include <map>
24 #include <vector>
25 
26 #include "TObject.h"
27 #include "TClonesArray.h"
28 
29 class PndSttTube;
30 
31 using std::map;
32 using std::vector;
33 
34 class PndSttStrawMap : public TObject {
35  public:
37  PndSttStrawMap(TClonesArray *const stt_tube_array);
38  PndSttStrawMap(const PndSttStrawMap &) = delete;
39  PndSttStrawMap &operator=(const PndSttStrawMap &) = delete;
40 
41  const vector<int> &GetStrawRow(int sector, int row) const { return (fStrawIndex.find(sector))->second.at(row); }
42  const vector<vector<int>> &GetStrawSector(int sector) const { return (fStrawIndex.find(sector))->second; }
43  int GetSector(int strawindex) const { return fSectorOfStraw.at(strawindex); }
44  int FindPhiSector(double phi) const;
45  int GetRow(int strawindex) const { return fRowOfStraw.at(strawindex); }
46  int GetLeftSector(int sector) const { return ((sector + 1) % 6); }
47  int GetRightSector(int sector) const { return ((sector + 5) % 6); }
48 
49  bool IsEdgeStraw(int strawindex) const;
50  int IsSectorBorderStraw(int strawindex) const;
51 
52  bool IsAxialStraw(int strawindex) const { return fAxialStraw.at(strawindex); }
53  bool IsSkewedStraw(int strawindex) const { return !(fAxialStraw.at(strawindex)); }
54 
55  bool IsAxialRow(int rowindex) const;
56  bool IsSkewedRow(int rowindex) const;
57 
58  PndSttTube *GetTube(int strawindex) const { return (PndSttTube *)fTubeArray->At(strawindex); }
59 
60  void GenerateStrawMap(TClonesArray *const stt_tube_array);
61 
62  private:
63  void GenerateAngles();
64 
65  map<int, vector<vector<int>>> fStrawIndex;
66  vector<int> fSectorOfStraw;
67  vector<int> fRowOfStraw;
68  vector<bool> fAxialStraw;
69  bool fStrawMapInitialized;
70 
71  TClonesArray *fTubeArray;
72 
73  vector<double> fSectorStart;
74  vector<double> fSectorEnd;
75 
76  ClassDef(PndSttStrawMap, 1)
77 };
78 
79 #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