CbmRoot
CbmMuchSector.cxx
Go to the documentation of this file.
1 #include "CbmMuchSector.h"
2 
3 #include <FairLogger.h> // for Logger, LOG
4 
5 #include <vector> // for vector
6 
7 using std::vector;
8 
9 // ----- Default constructor -------------------------------------------
10 CbmMuchSector::CbmMuchSector() : fAddress(0), fNChannels(0), fPads() {}
11 // -------------------------------------------------------------------------
12 
13 // ----- Standard constructor --------------------------------------------
14 CbmMuchSector::CbmMuchSector(UInt_t modAddress, UInt_t index, Int_t nChannels)
15  : fAddress(CbmMuchAddress::SetElementId(modAddress, kMuchSector, index))
16  , fNChannels(nChannels)
17  , fPads() {
18  fPads.resize(nChannels);
19 }
20 // -------------------------------------------------------------------------
21 
23  // LOG(debug) << "iChannel=" << iChannel << " fPads.size()=" << fPads.size()
24  // << " fNChannels=" << fNChannels;
25  if (iChannel >= static_cast<Int_t>(fPads.size()) || iChannel < 0) {
26  LOG(error) << "iChannel=" << iChannel << " fPads.size()=" << fPads.size();
27  LOG(error) << " station index="
29  LOG(error) << " layer index=" << CbmMuchAddress::GetLayerIndex(fAddress);
30  LOG(error) << " module index="
32  LOG(error) << " sector index="
34  return nullptr;
35  }
36  return fPads[iChannel];
37 }
38 
39 
41 //void CbmMuchSector::DrawPads(){
42 // for(Int_t iChannel = 0; iChannel < fNChannels; iChannel++){
43 // CbmMuchPad* pad = fPads[iChannel];
46 // }
47 //}
CbmMuchAddress
Interface class to unique address for the MUCH.
Definition: CbmMuchAddress.h:49
kMuchSector
@ kMuchSector
Sector.
Definition: CbmMuchAddress.h:21
CbmMuchSector
Definition: CbmMuchSector.h:22
CbmMuchAddress::GetModuleIndex
static Int_t GetModuleIndex(Int_t address)
Definition: CbmMuchAddress.h:112
CbmMuchSector::CbmMuchSector
CbmMuchSector()
Definition: CbmMuchSector.cxx:10
CbmStsAddress::SetElementId
Int_t SetElementId(Int_t address, Int_t level, UInt_t newId)
Set the index of an element, leaving the other element levels untouched.
Definition: CbmStsAddress.cxx:205
CbmMuchSector::fAddress
UInt_t fAddress
Definition: CbmMuchSector.h:38
CbmMuchSector::GetPadByChannelIndex
CbmMuchPad * GetPadByChannelIndex(Int_t iChannel) const
Definition: CbmMuchSector.cxx:22
CbmMuchSector.h
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
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
CbmMuchSector::fPads
std::vector< CbmMuchPad * > fPads
Definition: CbmMuchSector.h:40
CbmMuchPad
Definition: CbmMuchPad.h:21
CbmMuchAddress::GetSectorIndex
static Int_t GetSectorIndex(Int_t address)
Definition: CbmMuchAddress.h:115