CbmRoot
CbmMuchModuleGem.cxx
Go to the documentation of this file.
1 
9 #include "CbmMuchModuleGem.h"
10 
11 #include "CbmMuchAddress.h" // for CbmMuchAddress
12 #include "CbmMuchModule.h" // for CbmMuchModule
13 #include "CbmMuchPad.h" // for CbmMuchPad
14 #include "CbmMuchSector.h" // for CbmMuchSector
15 
16 #include <TVector3.h> // for TVector3
17 
18 #include <vector> // for vector
19 
20 using std::vector;
21 
22 // -------------------------------------------------------------------------
24 // -------------------------------------------------------------------------
25 
26 
27 // -------------------------------------------------------------------------
29  Int_t iLayer,
30  Bool_t iSide,
31  Int_t iModule,
32  TVector3 position,
33  TVector3 size,
34  Double_t cutRadius)
35  : CbmMuchModule(iStation, iLayer, iSide, iModule, position, size, cutRadius)
36  , fSectors() {}
37 // -------------------------------------------------------------------------
38 
39 
40 // ----- Public method GetPads -------------------------------------------
41 vector<CbmMuchPad*> CbmMuchModuleGem::GetPads() {
42  vector<CbmMuchPad*> pads;
43  for (Int_t iSector = 0; iSector < GetNSectors(); ++iSector) {
44  CbmMuchSector* sector = GetSectorByIndex(iSector);
45  if (!sector) continue;
46  for (Int_t iPad = 0; iPad < sector->GetNChannels(); ++iPad) {
47  CbmMuchPad* pad = sector->GetPadByChannelIndex(iPad);
48  if (!pad) continue;
49  pads.push_back(pad);
50  }
51  }
52  return pads;
53 }
54 // -------------------------------------------------------------------------
55 
56 
57 // ----- Public method GetNPads ------------------------------------------
59  Int_t nChannels = 0;
60  for (Int_t iSector = 0; iSector < GetNSectors(); ++iSector) {
61  CbmMuchSector* sector = GetSectorByIndex(iSector);
62  if (!sector) continue;
63  nChannels += sector->GetNChannels();
64  }
65  return nChannels;
66 }
67 // -------------------------------------------------------------------------
68 
69 
70 // ----- Public method GetSector ---------------------------------------
72  Int_t iSector = CbmMuchAddress::GetSectorIndex(address);
73  return (CbmMuchSector*) fSectors[iSector];
74 }
75 // -------------------------------------------------------------------------
76 
77 
78 // ----- Public method GetPad -------------------------------------------
80  CbmMuchSector* sector = GetSector(address);
81  Int_t iChannel = CbmMuchAddress::GetChannelIndex(address);
82  return sector ? sector->GetPadByChannelIndex(iChannel) : nullptr;
83 }
84 // -------------------------------------------------------------------------
85 
86 
87 // -------------------------------------------------------------------------
89  for (UInt_t s = 0; s < fSectors.size(); s++) {
90  // CbmMuchSector* sector = (CbmMuchSector*) fSectors[s];
91  // TODO
92  // sector->SetFillColor(color);
93  // sector->Draw("f");
94  // sector->Draw();
95  }
96 }
97 // -------------------------------------------------------------------------
98 
99 
100 // -------------------------------------------------------------------------
102  for (UInt_t s = 0; s < fSectors.size(); s++) {
103  CbmMuchSector* sector = (CbmMuchSector*) fSectors[s];
104  sector->DrawPads();
105  }
106 }
107 // -------------------------------------------------------------------------
108 
109 
110 void CbmMuchModuleGem::SetPadFired(Int_t address,
111  Int_t digiIndex,
112  Int_t adcCharge) {
113  CbmMuchPad* pad = GetPad(address);
114  if (pad) pad->SetFired(digiIndex, adcCharge);
115 }
CbmMuchModule.h
CbmMuchModuleGem::GetPads
std::vector< CbmMuchPad * > GetPads()
Definition: CbmMuchModuleGem.cxx:41
CbmMuchSector
Definition: CbmMuchSector.h:22
CbmMuchModuleGem::SetPadFired
void SetPadFired(Int_t address, Int_t digiIndex, Int_t adcCharge)
Definition: CbmMuchModuleGem.cxx:110
CbmMuchModuleGem::GetSector
CbmMuchSector * GetSector(Int_t address)
Definition: CbmMuchModuleGem.cxx:71
CbmMuchSector::GetNChannels
Int_t GetNChannels() const
Definition: CbmMuchSector.h:31
CbmMuchModuleGem::DrawModule
void DrawModule(Color_t color)
Definition: CbmMuchModuleGem.cxx:88
CbmMuchPad::SetFired
virtual void SetFired(Int_t, Int_t, Int_t=256)
Definition: CbmMuchPad.h:44
CbmMuchModuleGem::GetNPads
Int_t GetNPads()
Definition: CbmMuchModuleGem.cxx:58
CbmMuchModuleGem
Definition: CbmMuchModuleGem.h:24
CbmMuchSector::GetPadByChannelIndex
CbmMuchPad * GetPadByChannelIndex(Int_t iChannel) const
Definition: CbmMuchSector.cxx:22
CbmMuchSector.h
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMuchModuleGem::fSectors
std::vector< CbmMuchSector * > fSectors
Definition: CbmMuchModuleGem.h:79
CbmMuchModule
Definition: CbmMuchModule.h:24
CbmMuchPad.h
CbmMuchPad
Definition: CbmMuchPad.h:21
CbmMuchAddress.h
CbmMuchModuleGem::GetPad
CbmMuchPad * GetPad(Int_t address)
Definition: CbmMuchModuleGem.cxx:79
CbmMuchModuleGem::GetSectorByIndex
CbmMuchSector * GetSectorByIndex(Int_t iSector)
Definition: CbmMuchModuleGem.h:54
CbmMuchSector::DrawPads
virtual void DrawPads()
Definition: CbmMuchSector.h:35
CbmMuchModuleGem::GetNSectors
Int_t GetNSectors() const
Definition: CbmMuchModuleGem.h:57
CbmMuchModuleGem.h
CbmMuchModuleGem::DrawPads
void DrawPads()
Definition: CbmMuchModuleGem.cxx:101
CbmMuchAddress::GetChannelIndex
static Int_t GetChannelIndex(Int_t address)
Definition: CbmMuchAddress.h:118
CbmMuchModuleGem::CbmMuchModuleGem
CbmMuchModuleGem()
Definition: CbmMuchModuleGem.cxx:23
CbmMuchAddress::GetSectorIndex
static Int_t GetSectorIndex(Int_t address)
Definition: CbmMuchAddress.h:115