CbmRoot
Loading...
Searching...
No Matches
CbmMustStation.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
14#include "CbmMustStation.h"
15
16#include "CbmMustLayer.h" // for CbmMustLayer
17
18#include <Logger.h> // for LOG
19
20// ----- Default constructor -------------------------------------------
22// -------------------------------------------------------------------------
23
24// ----- Standard constructor ------------------------------------------
25CbmMustStation::CbmMustStation(int iStation, double z)
26 : TObject()
28 , fZ(z)
29 , fLayers()
30{
31}
32// -------------------------------------------------------------------------
33
34// ----- Destructor ----------------------------------------------------
36// -------------------------------------------------------------------------
37
38CbmMustTube* CbmMustStation::GetTube(uint32_t address) const
39{
40 CbmMustLayer* tempLay = GetLayer(address);
41 return tempLay ? tempLay->GetTube(address) : nullptr;
42}
43
44CbmMustLayer* CbmMustStation::GetLayer(uint32_t address) const
45{
46 return fLayers.at(CbmMustAddress::GetLayerIndex(address));
47}
48
49// ----- Public method AddSector ---------------------------------------
51{
52 for (const auto tempLayer : fLayers) {
53 if (tempLayer->GetAddress() == address) return tempLayer;
54 }
55 return nullptr;
56}
57// -------------------------------------------------------------------------
58
59// ----- Public method AddSector ---------------------------------------
61{
62 for (const auto tempLayer : fLayers) {
63 if (tempLayer->GetAddress() == layer->GetAddress()) return false;
64 }
65
66 fLayers.push_back(layer);
67 return true;
68}
69// -------------------------------------------------------------------------
70
72{
73 LOG(info) << " Station " << fAddress << " (@ z = " << fZ << "):";
74 for (const auto tempLayer : fLayers) {
75 tempLayer->Show();
76 }
77}
Interface class to unique address for the MuST.
static int32_t GetLayerIndex(int32_t address)
uint32_t GetAddress() const
CbmMustTube * GetTube(uint32_t address) const
CbmMustLayer * GetLayer(uint32_t address) const
CbmMustTube * GetTube(uint32_t address) const
bool AddLayer(CbmMustLayer *layer)
CbmMustLayer * FindLayer(uint32_t address)
std::vector< CbmMustLayer * > fLayers
virtual ~CbmMustStation()
uint32_t GetAddress() const