CbmRoot
Loading...
Searching...
No Matches
CbmMuchModuleGemRadial.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2011-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
12
#include "
CbmMuchModuleGemRadial.h
"
13
14
#include "
CbmMuchPad.h
"
// for CbmMuchPad
15
#include "
CbmMuchPadRadial.h
"
// for CbmMuchPadRadial
16
#include "
CbmMuchSectorRadial.h
"
// for CbmMuchSectorRadial
17
18
#include <Logger.h>
// for LOG
19
20
#include <TVector3.h>
// for TVector3
21
22
#include <algorithm>
// for upper_bound
23
#include <vector>
// for vector<>::iterator, vector
24
25
using
std::vector;
26
27
// -------------------------------------------------------------------------
28
CbmMuchModuleGemRadial::CbmMuchModuleGemRadial
()
29
:
CbmMuchModuleGem
()
30
, fSectorRadii()
31
, fDx1(0.)
32
, fDx2(0.)
33
, fDy(0.)
34
, fDz(0.)
35
{
36
}
37
// -------------------------------------------------------------------------
38
39
40
// -------------------------------------------------------------------------
41
CbmMuchModuleGemRadial::CbmMuchModuleGemRadial
(
Int_t
DetType,
Int_t
iStation,
Int_t
iLayer,
Bool_t
iSide,
Int_t
iModule,
42
TVector3
pos
, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz,
43
Double_t cutRadius)
44
:
CbmMuchModuleGem
(iStation, iLayer, iSide, iModule,
pos
, TVector3(dx1 + dx2, 2 * dy, 2 * dz), cutRadius)
45
, fSectorRadii()
46
, fDx1(dx1)
47
, fDx2(dx2)
48
, fDy(dy)
49
, fDz(dz)
50
, fDetType(DetType)
51
{
52
fDetectorType
=
fDetType
;
53
}
54
// -------------------------------------------------------------------------
55
56
57
// -------------------------------------------------------------------------
58
CbmMuchSectorRadial
*
CbmMuchModuleGemRadial::GetSectorByRadius
(Double_t r)
59
{
60
vector<Double_t>::iterator i0, ie, i;
61
i0 =
fSectorRadii
.begin();
62
ie =
fSectorRadii
.end();
63
i = upper_bound(i0, ie, r);
64
return
i - i0 - 1 >= 0 ? (
CbmMuchSectorRadial
*)
fSectors
[i - i0 - 1] :
nullptr
;
65
}
66
// -------------------------------------------------------------------------
67
68
69
// -------------------------------------------------------------------------
70
CbmMuchPadRadial
*
CbmMuchModuleGemRadial::GetPad
(Double_t
x
, Double_t
y
)
71
{
72
TVector3
v
= TVector3(
x
,
y
, 0);
73
CbmMuchSectorRadial
* sector =
GetSectorByRadius
(
v
.Mag());
74
return
sector->
GetPadByPhi
(
v
.Phi());
75
}
76
// -------------------------------------------------------------------------
77
78
79
// -------------------------------------------------------------------------
80
Bool_t
CbmMuchModuleGemRadial::InitModule
()
81
{
82
for
(
Int_t
s = 0; s <
GetNSectors
(); s++) {
83
CbmMuchSectorRadial
* sector = (
CbmMuchSectorRadial
*)
GetSectorByIndex
(s);
84
if
(!sector)
continue
;
85
fSectorRadii
.push_back(sector->
GetR1
());
86
sector->
AddPads
();
87
}
88
vector<CbmMuchPad*> neighbours;
89
for
(
Int_t
s = 0; s <
GetNSectors
(); s++) {
90
CbmMuchSectorRadial
* sector = (
CbmMuchSectorRadial
*)
GetSectorByIndex
(s);
91
if
(!sector)
continue
;
92
for
(
Int_t
p = 0; p < sector->
GetNChannels
(); p++) {
93
CbmMuchPadRadial
* pad = (
CbmMuchPadRadial
*) sector->
GetPadByChannelIndex
(p);
94
if
(!pad)
continue
;
95
if
(p > 0) neighbours.push_back(sector->
GetPadByChannelIndex
(p - 1));
96
if
(p < sector->GetNChannels() - 1) neighbours.push_back(sector->
GetPadByChannelIndex
(p + 1));
97
CbmMuchSectorRadial
* sec1 = s > 0 ? (
CbmMuchSectorRadial
*)
GetSectorByIndex
(s - 1) : 0;
98
CbmMuchSectorRadial
* sec2 = s <
GetNSectors
() - 1 ? (
CbmMuchSectorRadial
*)
GetSectorByIndex
(s + 1) : 0;
99
Double_t phi1 = pad->
GetPhi1
() - 0.001;
100
Double_t phi2 = pad->
GetPhi2
() + 0.001;
101
if
(sec1) {
102
CbmMuchPad
* pad11 = sec1->
GetPadByPhi
(phi1);
103
CbmMuchPad
* pad12 = sec1->
GetPadByPhi
(phi2);
104
Int_t
iMin = (pad11) ? pad11->
GetChannelIndex
() : 0;
105
Int_t
iMax = (pad12) ? pad12->
GetChannelIndex
() : sec1->
GetNChannels
() - 1;
106
for
(
Int_t
i = iMin; i <= iMax; i++)
107
neighbours.push_back(sec1->
GetPadByChannelIndex
(i));
108
}
109
if
(sec2) {
110
CbmMuchPad
* pad21 = sec2->
GetPadByPhi
(phi1);
111
CbmMuchPad
* pad22 = sec2->
GetPadByPhi
(phi2);
112
Int_t
iMin = (pad21) ? pad21->
GetChannelIndex
() : 0;
113
Int_t
iMax = (pad22) ? pad22->
GetChannelIndex
() : sec2->
GetNChannels
() - 1;
114
for
(
Int_t
i = iMin; i <= iMax; i++)
115
neighbours.push_back(sec2->
GetPadByChannelIndex
(i));
116
}
117
pad->
SetNeighbours
(neighbours);
118
neighbours.clear();
119
}
120
}
121
LOG(debug4) <<
"Init module successful"
;
122
return
kTRUE;
123
}
124
// -------------------------------------------------------------------------
125
126
ClassImp
(
CbmMuchModuleGemRadial
)
ClassImp
ClassImp(CbmConverterManager)
CbmMuchModuleGemRadial.h
CbmMuchPadRadial.h
CbmMuchPad.h
CbmMuchSectorRadial.h
y
Double_t y
Definition
CbmMvdSensorDigiToHitTask.cxx:64
x
Double_t x
Definition
CbmMvdSensorDigiToHitTask.cxx:64
pos
TVector3 pos
Definition
CbmMvdSensorDigiToHitTask.cxx:56
v
fscal v[fmask::Size]
Definition
KfSimdPseudo.h:4
Int_t
int Int_t
Definition
RootTypesDef.h:16
Bool_t
bool Bool_t
Definition
RootTypesDef.h:15
CbmMuchModuleGemRadial
Definition
CbmMuchModuleGemRadial.h:25
CbmMuchModuleGemRadial::CbmMuchModuleGemRadial
CbmMuchModuleGemRadial()
Definition
CbmMuchModuleGemRadial.cxx:28
CbmMuchModuleGemRadial::InitModule
Bool_t InitModule()
Definition
CbmMuchModuleGemRadial.cxx:80
CbmMuchModuleGemRadial::fSectorRadii
std::vector< Double_t > fSectorRadii
Definition
CbmMuchModuleGemRadial.h:41
CbmMuchModuleGemRadial::GetPad
CbmMuchPadRadial * GetPad(Double_t x, Double_t y)
Definition
CbmMuchModuleGemRadial.cxx:70
CbmMuchModuleGemRadial::GetSectorByRadius
CbmMuchSectorRadial * GetSectorByRadius(Double_t r)
Definition
CbmMuchModuleGemRadial.cxx:58
CbmMuchModuleGemRadial::fDetType
Int_t fDetType
Definition
CbmMuchModuleGemRadial.h:47
CbmMuchModuleGem
Definition
CbmMuchModuleGem.h:28
CbmMuchModuleGem::fSectors
std::vector< CbmMuchSector * > fSectors
Definition
CbmMuchModuleGem.h:78
CbmMuchModuleGem::GetSectorByIndex
CbmMuchSector * GetSectorByIndex(Int_t iSector)
Definition
CbmMuchModuleGem.h:53
CbmMuchModuleGem::GetNSectors
Int_t GetNSectors() const
Definition
CbmMuchModuleGem.h:56
CbmMuchModule::fDetectorType
Int_t fDetectorType
Definition
CbmMuchModule.h:71
CbmMuchPadRadial
Definition
CbmMuchPadRadial.h:21
CbmMuchPadRadial::GetPhi2
Double_t GetPhi2() const
Definition
CbmMuchPadRadial.h:36
CbmMuchPadRadial::GetPhi1
Double_t GetPhi1() const
Definition
CbmMuchPadRadial.h:35
CbmMuchPad
Definition
CbmMuchPad.h:25
CbmMuchPad::SetNeighbours
void SetNeighbours(std::vector< CbmMuchPad * > neighbours)
Definition
CbmMuchPad.h:43
CbmMuchPad::GetChannelIndex
Int_t GetChannelIndex()
Definition
CbmMuchPad.h:49
CbmMuchSectorRadial
Definition
CbmMuchSectorRadial.h:23
CbmMuchSectorRadial::GetR1
Double_t GetR1() const
Definition
CbmMuchSectorRadial.h:30
CbmMuchSectorRadial::AddPads
void AddPads()
Definition
CbmMuchSectorRadial.cxx:71
CbmMuchSectorRadial::GetPadByPhi
CbmMuchPadRadial * GetPadByPhi(Double_t phi)
Definition
CbmMuchSectorRadial.cxx:59
CbmMuchSector::GetNChannels
Int_t GetNChannels() const
Definition
CbmMuchSector.h:33
CbmMuchSector::GetPadByChannelIndex
CbmMuchPad * GetPadByChannelIndex(Int_t iChannel) const
Definition
CbmMuchSector.cxx:27
core
detectors
much
CbmMuchModuleGemRadial.cxx
Generated on Fri Mar 7 2025 23:04:07 for CbmRoot by
1.12.0