CbmRoot
Loading...
Searching...
No Matches
CbmMuchSector.cxx
Go to the documentation of this file.
1/* Copyright (C) 2007-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Evgeny Kryshen, Florian Uhlig, Volker Friese [committer] */
4
5#include "CbmMuchSector.h"
6
7#include <Logger.h> // for Logger, LOG
8
9#include <vector> // for vector
10
11using std::vector;
12
13// ----- Default constructor -------------------------------------------
14CbmMuchSector::CbmMuchSector() : fAddress(0), fNChannels(0), fPads() {}
15// -------------------------------------------------------------------------
16
17// ----- Standard constructor --------------------------------------------
18CbmMuchSector::CbmMuchSector(UInt_t modAddress, UInt_t index, Int_t nChannels)
19 : fAddress(CbmMuchAddress::SetElementId(modAddress, kMuchSector, index))
20 , fNChannels(nChannels)
21 , fPads()
22{
23 fPads.resize(nChannels);
24}
25// -------------------------------------------------------------------------
26
28{
29 // LOG(debug) << "iChannel=" << iChannel << " fPads.size()=" << fPads.size()
30 // << " fNChannels=" << fNChannels;
31 if (iChannel >= static_cast<Int_t>(fPads.size()) || iChannel < 0) {
32 LOG(error) << "iChannel=" << iChannel << " fPads.size()=" << fPads.size();
33 LOG(error) << " station index=" << CbmMuchAddress::GetStationIndex(fAddress);
34 LOG(error) << " layer index=" << CbmMuchAddress::GetLayerIndex(fAddress);
35 LOG(error) << " module index=" << CbmMuchAddress::GetModuleIndex(fAddress);
36 LOG(error) << " sector index=" << CbmMuchAddress::GetSectorIndex(fAddress);
37 return nullptr;
38 }
39 return fPads[iChannel];
40}
41
42
44//void CbmMuchSector::DrawPads(){
45// for(Int_t iChannel = 0; iChannel < fNChannels; iChannel++){
46// CbmMuchPad* pad = fPads[iChannel];
49// }
50//}
ClassImp(CbmConverterManager)
@ kMuchSector
Sector.
Interface class to unique address for the MUCH.
static int32_t GetModuleIndex(int32_t address)
static int32_t GetSectorIndex(int32_t address)
static int32_t GetLayerIndex(int32_t address)
static int32_t GetStationIndex(int32_t address)
CbmMuchPad * GetPadByChannelIndex(Int_t iChannel) const
std::vector< CbmMuchPad * > fPads