CbmRoot
Loading...
Searching...
No Matches
CbmMuchSectorRectangular.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2012-2020 Petersburg Nuclear Physics Institute named by B.P.Konstantinov of National Research Centre "Kurchatov Institute", Gatchina
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Evgeny Kryshen [committer], Florian Uhlig */
4
5
#include "
CbmMuchSectorRectangular.h
"
6
7
#include "
CbmMuchAddress.h
"
// for CbmMuchAddress, kMuchChannel
8
#include "
CbmMuchPadRectangular.h
"
// for CbmMuchPadRectangular
9
10
#include <TPave.h>
// for TPave
11
#include <TVector3.h>
// for TVector3
12
13
// ----- Default constructor -------------------------------------------
14
CbmMuchSectorRectangular::CbmMuchSectorRectangular
()
15
:
CbmMuchSector
()
16
, TPave()
17
, fPosition()
18
, fSize()
19
, fPadNx(0)
20
, fPadNy(0)
21
, fPadDx(0)
22
, fPadDy(0)
23
, fNeighbours()
24
{
25
}
26
// -------------------------------------------------------------------------
27
28
29
// ----- Standard constructor --------------------------------------------
30
CbmMuchSectorRectangular::CbmMuchSectorRectangular
(UInt_t modAddress, UInt_t index, TVector3
pos
, TVector3
size
,
31
Int_t padNx, Int_t padNy)
32
:
CbmMuchSector
(modAddress, index, padNx * padNy)
33
, TPave(
pos
[0] -
size
[0] / 2,
pos
[1] -
size
[1] / 2,
pos
[0] +
size
[0] / 2,
pos
[1] +
size
[1] / 2, 1)
34
, fPosition(
pos
)
35
, fSize(
size
)
36
, fPadNx(padNx)
37
, fPadNy(padNy)
38
, fPadDx(fSize[0] / padNx)
39
, fPadDy(fSize[1] / padNy)
40
, fNeighbours()
41
{
42
}
43
// -------------------------------------------------------------------------
44
45
CbmMuchPadRectangular
*
CbmMuchSectorRectangular::GetPad
(Double_t
x
, Double_t
y
)
46
{
47
Int_t ix = Int_t((
x
-
GetXmin
()) /
fPadDx
);
48
Int_t iy = Int_t((
y
-
GetYmin
()) /
fPadDy
);
49
if
(ix < 0 || ix >=
fPadNx
)
return
nullptr
;
50
if
(iy < 0 || iy >=
fPadNy
)
return
nullptr
;
51
Int_t channelIndex =
fPadNy
* ix + iy;
52
return
(
CbmMuchPadRectangular
*)
fPads
[channelIndex];
53
}
54
55
56
// -------------------------------------------------------------------------
57
void
CbmMuchSectorRectangular::AddPads
()
58
{
59
for
(Int_t ix = 0; ix <
fPadNx
; ix++) {
60
for
(Int_t iy = 0; iy <
fPadNy
; iy++) {
61
Int_t channelIndex =
fPadNy
* ix + iy;
62
UInt_t address =
CbmMuchAddress::SetElementId
(
fAddress
,
kMuchChannel
, channelIndex);
63
Double_t x0 =
GetXmin
() + (ix + 0.5) *
fPadDx
;
64
Double_t y0 =
GetYmin
() + (iy + 0.5) *
fPadDy
;
65
CbmMuchPadRectangular
* pad =
new
CbmMuchPadRectangular
(address, x0, y0,
fPadDx
,
fPadDy
);
66
fPads
.push_back(pad);
67
}
68
}
69
}
70
// -------------------------------------------------------------------------
71
72
// -------------------------------------------------------------------------
73
void
CbmMuchSectorRectangular::DrawPads
()
74
{
75
for
(Int_t iChannel = 0; iChannel <
fNChannels
; iChannel++) {
76
CbmMuchPadRectangular
* pad = (
CbmMuchPadRectangular
*)
fPads
[iChannel];
77
if
(!pad)
return
;
78
pad->
DrawPad
();
79
}
80
}
81
// -------------------------------------------------------------------------
82
83
84
ClassImp
(
CbmMuchSectorRectangular
)
ClassImp
ClassImp(CbmConverterManager)
CbmMuchAddress.h
kMuchChannel
@ kMuchChannel
Channel.
Definition
CbmMuchAddress.h:28
CbmMuchPadRectangular.h
CbmMuchSectorRectangular.h
y
Double_t y
Definition
CbmMvdSensorDigiToHitTask.cxx:64
x
Double_t x
Definition
CbmMvdSensorDigiToHitTask.cxx:64
pos
TVector3 pos
Definition
CbmMvdSensorDigiToHitTask.cxx:56
size
static constexpr size_t size()
Definition
KfSimdPseudo.h:2
CbmMuchAddress::SetElementId
static uint32_t SetElementId(uint32_t address, int32_t level, int32_t newId)
Definition
CbmMuchAddress.cxx:112
CbmMuchPadRectangular
Definition
CbmMuchPadRectangular.h:25
CbmMuchPadRectangular::DrawPad
void DrawPad()
Definition
CbmMuchPadRectangular.cxx:50
CbmMuchSectorRectangular
Definition
CbmMuchSectorRectangular.h:28
CbmMuchSectorRectangular::GetPad
CbmMuchPadRectangular * GetPad(Double_t x, Double_t y)
Definition
CbmMuchSectorRectangular.cxx:45
CbmMuchSectorRectangular::fPadNx
Int_t fPadNx
Definition
CbmMuchSectorRectangular.h:58
CbmMuchSectorRectangular::AddPads
void AddPads()
Definition
CbmMuchSectorRectangular.cxx:57
CbmMuchSectorRectangular::DrawPads
void DrawPads()
Definition
CbmMuchSectorRectangular.cxx:73
CbmMuchSectorRectangular::GetYmin
Double_t GetYmin() const
Definition
CbmMuchSectorRectangular.h:43
CbmMuchSectorRectangular::GetXmin
Double_t GetXmin() const
Definition
CbmMuchSectorRectangular.h:42
CbmMuchSectorRectangular::fPadNy
Int_t fPadNy
Definition
CbmMuchSectorRectangular.h:59
CbmMuchSectorRectangular::CbmMuchSectorRectangular
CbmMuchSectorRectangular()
Definition
CbmMuchSectorRectangular.cxx:14
CbmMuchSectorRectangular::fPadDy
Double_t fPadDy
Definition
CbmMuchSectorRectangular.h:61
CbmMuchSectorRectangular::fPadDx
Double_t fPadDx
Definition
CbmMuchSectorRectangular.h:60
CbmMuchSector
Definition
CbmMuchSector.h:26
CbmMuchSector::fAddress
UInt_t fAddress
Definition
CbmMuchSector.h:40
CbmMuchSector::fPads
std::vector< CbmMuchPad * > fPads
Definition
CbmMuchSector.h:42
CbmMuchSector::fNChannels
Int_t fNChannels
Definition
CbmMuchSector.h:41
core
detectors
much
CbmMuchSectorRectangular.cxx
Generated on Mon Feb 3 2025 23:03:50 for CbmRoot by
1.12.0