FairRoot/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 {
24 public:
25 
27  PndSttStrawMap(TClonesArray* const stt_tube_array);
28  PndSttStrawMap(const PndSttStrawMap& ) = delete;
29  PndSttStrawMap& operator=(const PndSttStrawMap& ) = delete;
30 
31  const vector<int>& GetStrawRow(int sector, int row) const {return (fStrawIndex.find(sector))->second.at(row);}
32  const vector<vector<int> >& GetStrawSector(int sector) const {return (fStrawIndex.find(sector))->second;}
33  int GetSector(int strawindex) const {return fSectorOfStraw.at(strawindex);}
34  int FindPhiSector(double phi) const;
35  int GetRow(int strawindex) const {return fRowOfStraw.at(strawindex);}
36  int GetLeftSector(int sector) const {return ((sector +1) % 6);}
37  int GetRightSector(int sector) const {return ((sector +5) % 6);}
38 
39  bool IsEdgeStraw(int strawindex) const;
40  int IsSectorBorderStraw(int strawindex) const;
41 
42  bool IsAxialStraw(int strawindex) const {return fAxialStraw.at(strawindex);}
43  bool IsSkewedStraw(int strawindex) const {return !(fAxialStraw.at(strawindex));}
44 
45  bool IsAxialRow(int rowindex) const;
46  bool IsSkewedRow(int rowindex) const;
47 
48  PndSttTube* GetTube(int strawindex) const {return (PndSttTube*)fTubeArray->At(strawindex);}
49 
50  void GenerateStrawMap(TClonesArray* const stt_tube_array);
51 
52 private:
53 
54  void GenerateAngles();
55 
56  map<int, vector< vector<int> > > fStrawIndex;
57  vector<int> fSectorOfStraw;
58  vector<int> fRowOfStraw;
59  vector<bool> fAxialStraw;
61 
62  TClonesArray* fTubeArray;
63 
64  vector<double> fSectorStart;
65  vector<double> fSectorEnd;
66 
67  ClassDef(PndSttStrawMap,1)
68 
69 };
70 
71 
72 #endif /* PNDSTTSTRAWMAP_H_ */
int row
Definition: anaLmdDigi.C:67
vector< double > fSectorStart
PndTransMap * map
Definition: sim_emc_apd.C:99
int IsSectorBorderStraw(int strawindex) const
int GetSector(int strawindex) const
vector< int > fSectorOfStraw
vector< bool > fAxialStraw
PndSttTube * GetTube(int strawindex) const
const vector< int > & GetStrawRow(int sector, int row) const
PndSttStrawMap & operator=(const PndSttStrawMap &)=delete
bool IsSkewedRow(int rowindex) const
const vector< vector< int > > & GetStrawSector(int sector) const
int GetRightSector(int sector) const
bool IsAxialStraw(int strawindex) const
map< int, vector< vector< int > > > fStrawIndex
bool IsSkewedStraw(int strawindex) const
void GenerateStrawMap(TClonesArray *const stt_tube_array)
bool IsEdgeStraw(int strawindex) const
int GetLeftSector(int sector) const
int FindPhiSector(double phi) const
bool fStrawMapInitialized
bool IsAxialRow(int rowindex) const
vector< int > fRowOfStraw
int GetRow(int strawindex) const
vector< double > fSectorEnd
TClonesArray * fTubeArray