CbmRoot
CbmMuchLayer.cxx
Go to the documentation of this file.
1 
9 #include "CbmMuchLayer.h"
10 
11 #include "CbmMuchAddress.h" // for CbmMuchAddress
12 #include "CbmMuchLayerSide.h" // for CbmMuchLayerSide
13 #include "CbmMuchModule.h" // for CbmMuchModule
14 
15 #include <TMathBase.h> // for Abs
16 #include <TObject.h> // for TObject
17 #include <TVector3.h> // for TVector3
18 
19 // ----- Default constructor -------------------------------------------
21  : TObject()
22  , fDetectorId(0)
23  , fZ(0.)
24  , fSideF()
25  , fSideB()
26  , fSupportDx(0.)
27  , fSupportDy(0.)
28  , fSupportDz(0.)
29  , fZtoStationCenter() {}
30 // -------------------------------------------------------------------------
31 
32 // ----- Standard constructor ------------------------------------------
33 CbmMuchLayer::CbmMuchLayer(Int_t detId, Double_t z, Double_t zRel)
34  : TObject()
35  , fDetectorId(detId)
36  , fZ(z)
37  , fSideF()
38  , fSideB()
39  , fSupportDx(0.)
40  , fSupportDy(0.)
41  , fSupportDz(0.)
42  , fZtoStationCenter(zRel) {
43  Int_t iStation = CbmMuchAddress::GetStationIndex(detId);
44  Int_t iLayer = CbmMuchAddress::GetLayerIndex(detId);
45  fSideF = CbmMuchLayerSide(iStation, iLayer, 0, z);
46  fSideB = CbmMuchLayerSide(iStation, iLayer, 1, z);
47 }
48 // -------------------------------------------------------------------------
49 
50 // ----- Standard constructor ------------------------------------------
52  Int_t iLayer,
53  Double_t z,
54  Double_t zRel)
55  : TObject()
56  , fDetectorId(CbmMuchAddress::GetAddress(iStation, iLayer))
57  , fZ(z)
58  , fSideF()
59  , fSideB()
60  , fSupportDx(0.)
61  , fSupportDy(0.)
62  , fSupportDz(0.)
63  , fZtoStationCenter(zRel)
64 
65 {
66  fSideF = CbmMuchLayerSide(iStation, iLayer, 0, z);
67  fSideB = CbmMuchLayerSide(iStation, iLayer, 1, z);
68 }
69 // -------------------------------------------------------------------------
70 
71 // ----- Destructor ----------------------------------------------------
73 // -------------------------------------------------------------------------
74 
75 
76 // -------------------------------------------------------------------------
77 Double_t CbmMuchLayer::GetDz() {
78  Double_t dzmax = fSupportDz;
79 
80  for (Int_t s = 0; s < 2; s++) {
81  CbmMuchLayerSide* side = GetSide(s);
82  for (Int_t i = 0; i < side->GetNModules(); i++) {
83  CbmMuchModule* module = side->GetModule(i);
84  Double_t lz = module->GetSize().Z();
85  Double_t z = module->GetPosition().Z();
86  Double_t dz = TMath::Abs(z - fZ) + lz / 2.;
87  if (dz > dzmax) dzmax = dz;
88  }
89  }
90  return dzmax;
91 }
92 // -------------------------------------------------------------------------
93 
CbmMuchAddress
Interface class to unique address for the MUCH.
Definition: CbmMuchAddress.h:49
CbmMuchLayerSide.h
CbmMuchModule.h
CbmMuchLayer::fZ
Double32_t fZ
Definition: CbmMuchLayer.h:67
CbmStsAddress::GetAddress
Int_t GetAddress(UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion)
Construct address.
Definition: CbmStsAddress.cxx:90
CbmMuchLayer::fSideF
CbmMuchLayerSide fSideF
Definition: CbmMuchLayer.h:68
CbmMuchLayer::fSideB
CbmMuchLayerSide fSideB
Definition: CbmMuchLayer.h:69
CbmMuchLayer::CbmMuchLayer
CbmMuchLayer()
Definition: CbmMuchLayer.cxx:20
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMuchLayer::GetSide
CbmMuchLayerSide * GetSide(Bool_t side)
Definition: CbmMuchLayer.h:49
CbmMuchModule::GetPosition
TVector3 GetPosition() const
Definition: CbmMuchModule.h:51
CbmMuchModule::GetSize
TVector3 GetSize() const
Definition: CbmMuchModule.h:50
CbmMuchLayer::~CbmMuchLayer
virtual ~CbmMuchLayer()
Definition: CbmMuchLayer.cxx:72
CbmMuchLayerSide::GetModule
CbmMuchModule * GetModule(Int_t iModule) const
Definition: CbmMuchLayerSide.h:52
CbmMuchLayer::GetDz
Double_t GetDz()
Definition: CbmMuchLayer.cxx:77
CbmMuchLayerSide
Definition: CbmMuchLayerSide.h:22
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMuchModule
Definition: CbmMuchModule.h:24
CbmMuchLayer.h
CbmMuchAddress::GetLayerIndex
static Int_t GetLayerIndex(Int_t address)
Definition: CbmMuchAddress.h:106
CbmMuchAddress::GetStationIndex
static Int_t GetStationIndex(Int_t address)
Definition: CbmMuchAddress.h:103
CbmMuchAddress.h
CbmMuchLayer
Definition: CbmMuchLayer.h:21
CbmMuchLayer::fSupportDz
Double_t fSupportDz
Definition: CbmMuchLayer.h:72
CbmMuchLayerSide::GetNModules
Int_t GetNModules() const
Definition: CbmMuchLayerSide.h:47