CbmRoot
CbmTrdGeoHandler.h
Go to the documentation of this file.
1 
14 #ifndef CBMTRDGEOHANDLER_H_
15 #define CBMTRDGEOHANDLER_H_ 1
16 
17 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
18 #include <RtypesCore.h> // for Int_t, Double_t, Bool_t, kFALSE, UInt_t
19 #include <TObject.h> // for TObject
20 #include <TString.h> // for TString
21 
22 #include <map> // for map
23 
24 class TGeoBBox;
25 class TGeoHMatrix;
26 class TGeoPhysicalNode;
27 class TGeoVolume;
28 
29 class CbmTrdGeoHandler : public TObject {
30 public:
35 
40 
41  void Init(Bool_t isSimulation = kFALSE);
42 
46  Int_t GetModuleAddress();
47 
51  Int_t GetModuleAddress(const TString& path);
52 
53  // /**
54  // * \brief Return pad orientation of the current node in the TGeoManager.
55  // */
56  // Int_t GetModuleOrientation();
57 
61  Int_t GetModuleOrientation(const TString& path);
62  // Path has to contain information down to module part,
63  // otherwise retrieved information can be wrong.
64  // Path examples:
65  // /cave_1/trd_v13x_0/layer01_1101/module1_10100101/gas_1
66  // /cave_1/trd_v13x_0/layer10_3210/module8_35411098/gas_1
67 
68 
72  std::map<Int_t, TGeoPhysicalNode*> FillModuleMap();
73 
74  Double_t GetSizeX(const TString& path);
75  Double_t GetSizeY(const TString& path);
76  Double_t GetSizeZ(const TString& path);
77  Double_t GetX(const TString& path);
78  Double_t GetY(const TString& path);
79  Double_t GetZ(const TString& path);
80  Int_t GetModuleType(const TString& path);
81 
82  // for backward compatibility
83  Int_t GetStation(const TString& path);
84  Int_t GetLayer(const TString& path);
85  Int_t GetModuleCopyNr(const TString& path);
86 
87 private:
88  void NavigateTo(const TString& path);
89 
90  Bool_t fIsSimulation;
91 
92  UInt_t fGeoPathHash;
93  TGeoVolume* fCurrentVolume;
94  TGeoBBox* fVolumeShape;
95  Double_t fGlobal[3];
96  TGeoHMatrix* fGlobalMatrix;
97  Int_t fLayerId;
98  Int_t fModuleId;
99  Int_t fModuleType;
100  Int_t fRotation;
101 
102  // for backward compatibility
103  Int_t fStation;
104  Int_t fLayer;
105  Int_t fModuleCopy;
106 
109 
110  ClassDef(CbmTrdGeoHandler, 4)
111 };
112 
113 #endif //CBMTRDGEOHANDLER_H
CbmTrdGeoHandler::fGeoPathHash
UInt_t fGeoPathHash
Definition: CbmTrdGeoHandler.h:92
CbmTrdGeoHandler::GetModuleAddress
Int_t GetModuleAddress()
Return module address calculated based on the current node in the TGeoManager.
Definition: CbmTrdGeoHandler.cxx:49
CbmTrdGeoHandler::GetSizeX
Double_t GetSizeX(const TString &path)
Definition: CbmTrdGeoHandler.cxx:112
CbmTrdGeoHandler::fModuleCopy
Int_t fModuleCopy
LayerID within station, 1..4.
Definition: CbmTrdGeoHandler.h:105
CbmTrdGeoHandler::CbmTrdGeoHandler
CbmTrdGeoHandler()
Constructor.
Definition: CbmTrdGeoHandler.cxx:27
CbmTrdGeoHandler::fModuleId
Int_t fModuleId
Definition: CbmTrdGeoHandler.h:98
CbmTrdGeoHandler::fModuleType
Int_t fModuleType
Definition: CbmTrdGeoHandler.h:99
CbmTrdGeoHandler::GetStation
Int_t GetStation(const TString &path)
Definition: CbmTrdGeoHandler.cxx:147
CbmTrdGeoHandler::GetModuleType
Int_t GetModuleType(const TString &path)
Definition: CbmTrdGeoHandler.cxx:142
CbmTrdGeoHandler::fLayer
Int_t fLayer
StationTypeID, 1..3.
Definition: CbmTrdGeoHandler.h:104
CbmTrdGeoHandler::fRotation
Int_t fRotation
Definition: CbmTrdGeoHandler.h:100
CbmTrdGeoHandler::fGlobal
Double_t fGlobal[3]
Definition: CbmTrdGeoHandler.h:95
CbmTrdGeoHandler::GetY
Double_t GetY(const TString &path)
Definition: CbmTrdGeoHandler.cxx:132
CbmTrdGeoHandler
Definition: CbmTrdGeoHandler.h:29
CbmTrdGeoHandler::GetModuleOrientation
Int_t GetModuleOrientation(const TString &path)
Navigate to node and return pad orientation.
Definition: CbmTrdGeoHandler.cxx:107
CbmTrdGeoHandler::GetModuleCopyNr
Int_t GetModuleCopyNr(const TString &path)
Definition: CbmTrdGeoHandler.cxx:160
CbmTrdGeoHandler::GetSizeZ
Double_t GetSizeZ(const TString &path)
Definition: CbmTrdGeoHandler.cxx:122
CbmTrdGeoHandler::Init
void Init(Bool_t isSimulation=kFALSE)
Definition: CbmTrdGeoHandler.cxx:45
CbmTrdGeoHandler::FillModuleMap
std::map< Int_t, TGeoPhysicalNode * > FillModuleMap()
Fill map with information of the gas volumes for each detector.
Definition: CbmTrdGeoHandler.cxx:214
CbmTrdGeoHandler::operator=
CbmTrdGeoHandler operator=(const CbmTrdGeoHandler &)
CbmTrdGeoHandler::fCurrentVolume
TGeoVolume * fCurrentVolume
Definition: CbmTrdGeoHandler.h:93
CbmTrdGeoHandler::CbmTrdGeoHandler
CbmTrdGeoHandler(const CbmTrdGeoHandler &)
ModuleCopyID with module type.
CbmTrdGeoHandler::GetLayer
Int_t GetLayer(const TString &path)
Definition: CbmTrdGeoHandler.cxx:152
CbmTrdGeoHandler::fStation
Int_t fStation
rotation angle 0,1,2,3
Definition: CbmTrdGeoHandler.h:103
CbmTrdGeoHandler::fGlobalMatrix
TGeoHMatrix * fGlobalMatrix
Global center of volume.
Definition: CbmTrdGeoHandler.h:96
CbmTrdGeoHandler::fIsSimulation
Bool_t fIsSimulation
Definition: CbmTrdGeoHandler.h:90
CbmTrdGeoHandler::GetSizeY
Double_t GetSizeY(const TString &path)
Definition: CbmTrdGeoHandler.cxx:117
CbmTrdGeoHandler::fVolumeShape
TGeoBBox * fVolumeShape
Definition: CbmTrdGeoHandler.h:94
CbmTrdGeoHandler::fLayerId
Int_t fLayerId
Definition: CbmTrdGeoHandler.h:97
CbmTrdGeoHandler::GetX
Double_t GetX(const TString &path)
Definition: CbmTrdGeoHandler.cxx:137
CbmTrdGeoHandler::NavigateTo
void NavigateTo(const TString &path)
Definition: CbmTrdGeoHandler.cxx:165
CbmTrdGeoHandler::~CbmTrdGeoHandler
~CbmTrdGeoHandler()
Destructor.
Definition: CbmTrdGeoHandler.cxx:43
CbmTrdGeoHandler::GetZ
Double_t GetZ(const TString &path)
Definition: CbmTrdGeoHandler.cxx:127