CbmRoot
Loading...
Searching...
No Matches
CbmMuchLayer.cxx
Go to the documentation of this file.
1/* Copyright (C) 2008-2020 St. Petersburg Polytechnic University, St. Petersburg
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig, Mikhail Ryzhinskiy [committer], Evgeny Kryshen */
4
13#include "CbmMuchLayer.h"
14
15#include "CbmMuchAddress.h" // for CbmMuchAddress
16#include "CbmMuchLayerSide.h" // for CbmMuchLayerSide
17#include "CbmMuchModule.h" // for CbmMuchModule
18
19#include <TMathBase.h> // for Abs
20#include <TObject.h> // for TObject
21#include <TVector3.h> // for TVector3
22
23// ----- Default constructor -------------------------------------------
25 : TObject()
26 , fDetectorId(0)
27 , fZ(0.)
28 , fSideF()
29 , fSideB()
30 , fSupportDx(0.)
31 , fSupportDy(0.)
32 , fSupportDz(0.)
33 , fZtoStationCenter()
34{
35}
36// -------------------------------------------------------------------------
37
38// ----- Standard constructor ------------------------------------------
39CbmMuchLayer::CbmMuchLayer(Int_t detId, Double_t z, Double_t zRel)
40 : TObject()
41 , fDetectorId(detId)
42 , fZ(z)
43 , fSideF()
44 , fSideB()
45 , fSupportDx(0.)
46 , fSupportDy(0.)
47 , fSupportDz(0.)
48 , fZtoStationCenter(zRel)
49{
50 Int_t iStation = CbmMuchAddress::GetStationIndex(detId);
51 Int_t iLayer = CbmMuchAddress::GetLayerIndex(detId);
52 fSideF = CbmMuchLayerSide(iStation, iLayer, 0, z);
53 fSideB = CbmMuchLayerSide(iStation, iLayer, 1, z);
54}
55// -------------------------------------------------------------------------
56
57// ----- Standard constructor ------------------------------------------
58CbmMuchLayer::CbmMuchLayer(Int_t iStation, Int_t iLayer, Double_t z, Double_t zRel)
59 : TObject()
60 , fDetectorId(CbmMuchAddress::GetAddress(iStation, iLayer))
61 , fZ(z)
62 , fSideF()
63 , fSideB()
64 , fSupportDx(0.)
65 , fSupportDy(0.)
66 , fSupportDz(0.)
67 , fZtoStationCenter(zRel)
68
69{
70 fSideF = CbmMuchLayerSide(iStation, iLayer, 0, z);
71 fSideB = CbmMuchLayerSide(iStation, iLayer, 1, z);
72}
73// -------------------------------------------------------------------------
74
75// ----- Destructor ----------------------------------------------------
77// -------------------------------------------------------------------------
78
79
80// -------------------------------------------------------------------------
82{
83 Double_t dzmax = fSupportDz;
84
85 for (Int_t s = 0; s < 2; s++) {
86 CbmMuchLayerSide* side = GetSide(s);
87 for (Int_t i = 0; i < side->GetNModules(); i++) {
88 CbmMuchModule* module = side->GetModule(i);
89 Double_t lz = module->GetSize().Z();
90 Double_t z = module->GetPosition().Z();
91 Double_t dz = TMath::Abs(z - fZ) + lz / 2.;
92 if (dz > dzmax) dzmax = dz;
93 }
94 }
95 return dzmax;
96}
97// -------------------------------------------------------------------------
98
ClassImp(CbmConverterManager)
Interface class to unique address for the MUCH.
static int32_t GetLayerIndex(int32_t address)
static int32_t GetStationIndex(int32_t address)
Int_t GetNModules() const
CbmMuchModule * GetModule(Int_t iModule) const
virtual ~CbmMuchLayer()
Double32_t fZ
CbmMuchLayerSide * GetSide(Bool_t side)
CbmMuchLayerSide fSideB
CbmMuchLayerSide fSideF
Double_t fSupportDz
Double_t GetDz()