CbmRoot
Loading...
Searching...
No Matches
CbmMustLayer.cxx
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Radoslaw Karabowicz [committer] */
4
15#include "CbmMustLayer.h"
16
17#include "CbmMustAddress.h"
18#include "CbmMustModule.h"
19
20#include <Logger.h> // for LOG
21
22// ----- Default constructor -------------------------------------------
24// -------------------------------------------------------------------------
25
26// ----- Standard constructor ------------------------------------------
27CbmMustLayer::CbmMustLayer(uint32_t address, double z, double zRel)
28 : TObject()
29 , fAddress(address)
30 , fZ(z)
31 , fZtoStationCenter(zRel)
32{
33}
34// -------------------------------------------------------------------------
35
36// ----- Standard constructor ------------------------------------------
37CbmMustLayer::CbmMustLayer(int iStation, int iLayer, double z, double zRel)
38 : TObject()
39 , fAddress(CbmMustAddress::GetAddress(iStation, iLayer))
40 , fZ(z)
41 , fZtoStationCenter(zRel)
42
43{
44}
45// -------------------------------------------------------------------------
46
47// ----- Destructor ----------------------------------------------------
49// -------------------------------------------------------------------------
50
51CbmMustTube* CbmMustLayer::GetTube(uint32_t address) const
52{
54
55 return tempModule ? tempModule->GetTubeByAddress(address) : nullptr;
56}
57
59{
60 for (const auto tempModule : fModules) {
61 if (tempModule->GetAddress() == address) return tempModule;
62 }
63 return nullptr;
64}
65
67{
68 for (const auto tempModule : fModules) {
69 if (tempModule->GetAddress() == module->GetAddress()) return false;
70 }
71
72 fModules.push_back(module);
73 return true;
74}
75
77{
78 LOG(info) << " Layer " << CbmMustAddress::GetLayerIndex(fAddress) << " (@ z = " << fZ << "):";
79 for (const auto tempModule : fModules) {
80 tempModule->Show();
81 }
82}
Interface class to unique address for the MuST.
static int32_t GetLayerIndex(int32_t address)
static int32_t GetModuleIndex(int32_t address)
uint32_t GetAddress() const
CbmMustTube * GetTube(uint32_t address) const
CbmMustModule * GetModule(int iModule) const
bool AddModule(CbmMustModule *module)
virtual ~CbmMustLayer()
double fZtoStationCenter
uint32_t fAddress
std::vector< CbmMustModule * > fModules
CbmMustModule * FindModule(uint32_t address)
uint32_t GetAddress() const
CbmMustTube * GetTubeByAddress(uint32_t address) const