Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MvtxPrototype2Geom.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MvtxPrototype2Geom.cc
1
#include "
MvtxPrototype2Geom.h
"
2
3
#include <iostream>
4
5
6
std::unique_ptr<MvtxPrototype2Geom>
MvtxPrototype2Geom::s_instance
;
7
8
void
MvtxPrototype2Geom::Build
()
9
{
10
if
(
isBuilt
()) {
11
std::cout <<
"Already built"
<< std::endl;
12
return
;
// already initialized
13
}
14
15
m_lastChipIndex
.resize(
m_numOfLayers
);
16
int
num_of_chips = 0;
17
for
(
int
iLay = 0; iLay <
m_numOfLayers
; ++iLay){
18
num_of_chips +=
m_numOfStaves
*
m_numOfChips
;
19
m_lastChipIndex
[iLay] = num_of_chips - 1;
20
}
21
setSize
(num_of_chips);
22
fillMatrixCache
();
23
}
24
25
26
void
MvtxPrototype2Geom::fillMatrixCache
()
27
{
28
if
(
m_size
< 1) {
29
std::cout <<
"Build was not called yet. Calling now..."
<< std::endl;
30
Build
();
31
}
32
m_l2G
.
setSize
(
m_size
);
33
for
(
int
i
= 0;
i
<
m_size
;
i
++) {
34
TGeoHMatrix* hm =
extractMatrixSensor
(
i
);
35
m_l2G
.
setMatrix
(*hm,
i
);
36
}
37
38
return
;
39
}
40
41
42
TGeoHMatrix*
MvtxPrototype2Geom::extractMatrixSensor
(
int
index
)
43
{
44
int
lay = index /
getNumberOfChipsInLay
();
45
int
indexInLay = index %
getNumberOfChipsInLay
();
46
int
stv
= indexInLay /
m_numOfChips
;
47
int
indexInStv = indexInLay %
m_numOfChips
;
48
49
float
shift_dz = (2 *
SegmentationAlpide::PassiveEdgeSide
) + \
50
SegmentationAlpide::ActiveMatrixSizeCols
+
s_pitchChip_IB
;
51
52
float
dx = 0.f;
53
float
dy
= (lay -
m_numOfLayers
+ 1) *
s_gapLayers_TB
;
54
float
dz
= (indexInStv - 4) * shift_dz;
55
56
if
(
Verbose
()>0) {
57
std::cout <<
"Filling matrix for sensor in chip "
<< indexInStv <<
" in stave "
<<
stv
;
58
std::cout <<
" of layer "
<< lay <<
"\n"
;
59
std::cout <<
"shift in z "
<< dz <<
" and in dx "
<< dx << std::endl;
60
}
61
62
static
TGeoHMatrix matTmp;
63
matTmp = TGeoTranslation(dx, dy, dz);
64
static
TGeoTranslation tra(0., -.5 *
Segmentation::SensorLayerThicknessEff
, 0.);
65
matTmp *= tra;
66
67
return
&matTmp;
68
}
prototype
blob
master
offline
packages
MvtxPrototype2
MvtxPrototype2Geom.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:29
using
1.8.2 with
sPHENIX GitHub integration