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