CbmRoot
CbmTrdParModGeo.cxx
Go to the documentation of this file.
1 #include "CbmTrdParModGeo.h"
2 
3 #include <TGeoBBox.h> // for TGeoBBox
4 #include <TGeoMatrix.h> // for TGeoHMatrix
5 #include <TGeoPhysicalNode.h> // for TGeoPhysicalNode
6 
7 #include <string.h> // for memcpy, memset
8 
9 //___________________________________________________________________
10 CbmTrdParModGeo::CbmTrdParModGeo(const char* name, const char* title)
11  : CbmTrdParMod(name, title), fNode(nullptr) {
12  fNode = new TGeoPhysicalNode(title);
13 }
14 
15 //___________________________________________________________________
17 
18 //___________________________________________________________________
19 Double_t CbmTrdParModGeo::GetDX() const {
20  return ((TGeoBBox*) fNode->GetShape())->GetDX();
21 }
22 
23 //___________________________________________________________________
24 Double_t CbmTrdParModGeo::GetDY() const {
25  return ((TGeoBBox*) fNode->GetShape())->GetDY();
26 }
27 
28 //___________________________________________________________________
29 Double_t CbmTrdParModGeo::GetDZ() const {
30  return ((TGeoBBox*) fNode->GetShape())->GetDZ();
31 }
32 
33 //_______________________________________________________________________________
34 void CbmTrdParModGeo::LocalToMaster(Double_t in[3], Double_t out[3]) const {
35  if (!fNode) return;
36  fNode->GetMatrix()->LocalToMaster(in, out);
37 }
38 
39 //___________________________________________________________________
40 void CbmTrdParModGeo::GetXYZ(Double_t xyz[3]) const {
41  memset(xyz, 0, 3 * sizeof(Double_t));
42  Double_t gxyz[3];
43  fNode->GetMatrix()->LocalToMaster(xyz, gxyz);
44  memcpy(xyz, gxyz, 3 * sizeof(Double_t));
45 }
46 
CbmTrdParModGeo::CbmTrdParModGeo
CbmTrdParModGeo(const char *name="CbmTrdParModGeo", const char *title="TRD module geometry")
Definition: CbmTrdParModGeo.cxx:10
memset
void memset(T *dest, T i, size_t num)
Definition: L1Grid.cxx:21
CbmTrdParModGeo::GetDX
virtual Double_t GetDX() const
Definition: CbmTrdParModGeo.cxx:19
CbmTrdParModGeo.h
CbmTrdParModGeo::fNode
TGeoPhysicalNode * fNode
geometrical data for the module
Definition: CbmTrdParModGeo.h:43
CbmTrdParModGeo::~CbmTrdParModGeo
virtual ~CbmTrdParModGeo()
Definition: CbmTrdParModGeo.cxx:16
CbmTrdParModGeo
Definition of geometry for one TRD module.
Definition: CbmTrdParModGeo.h:12
CbmTrdParModGeo::LocalToMaster
virtual void LocalToMaster(Double_t in[3], Double_t out[3]) const
Definition: CbmTrdParModGeo.cxx:34
CbmTrdParMod
Definition of generic parameters for one TRD module.
Definition: CbmTrdParMod.h:9
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmTrdParModGeo::GetDY
virtual Double_t GetDY() const
Definition: CbmTrdParModGeo.cxx:24
CbmTrdParModGeo::GetDZ
virtual Double_t GetDZ() const
Definition: CbmTrdParModGeo.cxx:29
CbmTrdParModGeo::GetXYZ
virtual void GetXYZ(Double_t xyz[3]) const
Definition: CbmTrdParModGeo.cxx:40