FairRoot/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 {
26  public:
27 
29  PndSttGeometryMap(TClonesArray *tubearray, Int_t geoType);
31  PndSttGeometryMap(const PndSttGeometryMap& ) = delete;
33  // ----------------------------
34  void SetGeneralParameters();
35  void GenerateStrawMap(Int_t map);
37  // ----------------------------
38 
39  // *** GEO TYPE 1 ***
41  void GenerateStrawMapGeoType1(Int_t map);
43 
46 
47  int GetRow(int strawindex) const {return fLayerOfStraw.at(strawindex);}
48  int GetSector(int strawindex) const {return fSectorOfStraw.at(strawindex);}
49  const vector<int>& GetStrawRow(int sector, int row) const {return (fStrawIndex.find(sector))->second.at(row);}
50  const vector<vector<int> >& GetStrawSector(int sector) const {return (fStrawIndex.find(sector))->second;}
51 
52  bool IsEdgeStraw(int strawindex) const;
53  int IsSectorBorderStraw(int strawindex) const;
54 
55  bool IsAxialStraw(int strawindex) const {return fAxialStraw.at(strawindex);}
56  bool IsSkewedStraw(int strawindex) const {return !(fAxialStraw.at(strawindex));}
57 
58  bool IsAxialRow(int rowindex) const;
59  bool IsSkewedRow(int rowindex) const;
60 
61  TArrayI FindNeighborings(PndSttTube *tube);
62  TArrayI FindNeighborings(int tubeId);
63 
64  TArrayI GetNeighboringsByMap(int tubeId);
65 
66  void FillStrawNeighborsMap();
67 
68  Double_t CalculateStrawPoca(PndSttHit* hit1, PndSttHit* hit2, TVector3& poca); //returns smallest distance between two Stt Straws. poca is set to the point between the two straws.
69 
70  double GetAngleBetweenTubes(int tubeID1, int tubeID2) const;
71 
72  bool InStraightLine(int tube1, int tube2, int tube3) const;
73 
74  // *********************
75 
76  void SetVerbose(int ver) { fVerbose = ver; }
77 
78 
79  private:
81 
82 
83  void GenerateAngles();
84  map<int, vector< vector<int> > > fStrawIndex;
85  map<int, TArrayI> fStrawNeighbors;
86  vector<int> fSectorOfStraw;
87  vector<int> fLayerOfStraw;
88  vector<bool> fAxialStraw;
89  vector<double> fSectorStart;
90  vector<double> fSectorEnd;
92 
93 
94  // ------------------ SECTORS/LAYERS
97 
98 
99  TClonesArray *fTubeArray;
100 
101  protected:
102 
103 
104  ClassDef(PndSttGeometryMap,2)
105 
106  };
107 
108 #endif
PndSttGeometryMap & operator=(const PndSttGeometryMap &)=delete
void SetVerbose(int ver)
int row
Definition: anaLmdDigi.C:67
const vector< int > & GetStrawRow(int sector, int row) const
map< int, vector< vector< int > > > fStrawIndex
vector< int > fLayerOfStraw
PndTransMap * map
Definition: sim_emc_apd.C:99
bool IsAxialStraw(int strawindex) const
map< int, TArrayI > fStrawNeighbors
TClonesArray * fTubeArray
bool IsEdgeStraw(int strawindex) const
bool InStraightLine(int tube1, int tube2, int tube3) const
void GenerateStrawMap(Int_t map)
vector< int > fSectorOfStraw
int IsSectorBorderStraw(int strawindex) const
const vector< vector< int > > & GetStrawSector(int sector) const
Double_t CalculateStrawPoca(PndSttHit *hit1, PndSttHit *hit2, TVector3 &poca)
Double_t
vector< double > fSectorStart
bool IsSkewedStraw(int strawindex) const
bool IsAxialRow(int rowindex) const
int GetRow(int strawindex) const
int GetSector(int strawindex) const
double GetAngleBetweenTubes(int tubeID1, int tubeID2) const
void GenerateStrawMapGeoType1(Int_t map)
vector< double > fSectorEnd
Bool_t FillGeometryParametersGeoType1()
TArrayI FindNeighborings(PndSttTube *tube)
bool IsSkewedRow(int rowindex) const
TArrayI GetNeighboringsByMap(int tubeId)
vector< bool > fAxialStraw