ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1RawDataSystems
src
VP1RawDataHandle_TGC_Digit.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
VP1RawDataSystems/VP1RawDataHandle_TGC_Digit.h
"
6
#include "
VP1RawDataSystems/VP1RawDataCommonData.h
"
7
#include "
VP1Utils/VP1DetInfo.h
"
8
#include "
VP1Utils/VP1LinAlgUtils.h
"
9
#include "
VP1Utils/HitsSoNodeManager.h
"
10
#include "
MuonDigitContainer/TgcDigit.h
"
11
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
12
#include "
MuonReadoutGeometry/TgcReadoutElement.h
"
13
#include <Inventor/nodes/SoTransform.h>
14
15
VP1RawDataHandle_TGC_Digit::VP1RawDataHandle_TGC_Digit
(
16
VP1RawDataCollBase
* collection,
const
TgcDigit
* data)
17
:
VP1RawDataHandleBase
(collection),
m_data
(data)
18
{}
19
20
const
MuonGM::TgcReadoutElement
*
VP1RawDataHandle_TGC_Digit::element
()
const
21
{
22
const
auto
* helper =
VP1DetInfo::tgcIDHelper
();
23
const
auto
* manager =
VP1DetInfo::muonDetMgr
();
24
return
manager && helper && helper->valid(
m_data
->identify())
25
? manager->getTgcReadoutElement(
m_data
->identify()) :
nullptr
;
26
}
27
28
QStringList
VP1RawDataHandle_TGC_Digit::clicked
(
bool
verbose
)
const
29
{
30
const
Identifier
id
=
m_data
->identify();
31
const
auto
* helper =
VP1DetInfo::tgcIDHelper
();
32
const
bool
valid = helper && helper->valid(
id
);
33
QStringList lines;
34
lines <<
" ===> TGC Digit data"
;
35
lines <<
" Identifier: "
+ QString::fromStdString(
id
.getString());
36
lines <<
" Channel type: "
+ (valid ? QString(helper->isStrip(
id
) ?
"Strip"
:
"Wire gang"
)
37
: QString(
"unavailable"
));
38
QString bc;
39
switch
(
m_data
->bcTag()) {
40
case
TgcDigit::BC_UNDEFINED
: bc =
"undefined"
;
break
;
41
case
TgcDigit::BC_PREVIOUS
: bc =
"previous"
;
break
;
42
case
TgcDigit::BC_CURRENT
: bc =
"current"
;
break
;
43
case
TgcDigit::BC_NEXT
: bc =
"next"
;
break
;
44
case
TgcDigit::BC_NEXTNEXT
: bc =
"next-next"
;
break
;
45
default
: bc =
"unknown"
;
break
;
46
}
47
lines << QString(
" BC tag: %1 (%2)"
).arg(
m_data
->bcTag()).arg(bc);
48
if
(
verbose
) {
49
if
(valid) {
50
lines <<
" Station name: "
+ QString::fromStdString(helper->stationNameString(
id
));
51
lines <<
" Station eta index: "
+ QString::number(helper->stationEta(
id
));
52
lines <<
" Station phi index: "
+ QString::number(helper->stationPhi(
id
));
53
lines <<
" Gas gap: "
+ QString::number(helper->gasGap(
id
));
54
lines <<
" Channel: "
+ QString::number(helper->channel(
id
));
55
}
else
{
56
lines <<
" Decoded identifier unavailable"
;
57
}
58
const
auto
* elem =
element
();
59
if
(elem) {
60
const
Amg::Vector3D
position = elem->channelPos(
id
);
61
lines << QString(
" Global position [mm] (x, y, z): (%1, %2, %3)"
)
62
.arg(position.x(), 0,
'g'
, 10).arg(position.y(), 0,
'g'
, 10)
63
.arg(position.z(), 0,
'g'
, 10);
64
}
else
{
65
lines <<
" Global position unavailable"
;
66
}
67
}
68
return
lines;
69
}
70
71
SoNode*
VP1RawDataHandle_TGC_Digit::buildShape
()
72
{
73
const
auto
* elem =
element
();
74
if
(!elem)
75
return
common
()->
nodeManager
()->
getShapeNode_Point
();
76
const
auto
* helper =
VP1DetInfo::tgcIDHelper
();
77
const
Identifier
id
=
m_data
->identify();
78
const
int
gap = helper->gasGap(
id
);
79
const
int
channel = helper->channel(
id
);
80
const
bool
strip
= helper->isStrip(
id
);
81
const
double
length
=
strip
? elem->stripLength() : elem->gangCentralWidth(gap, channel);
82
const
double
width
=
strip
? elem->stripWidth(gap, channel) : elem->gangRadialLength(gap, channel);
83
// The box represents the channel footprint; depth is a display thickness in mm.
84
return
common
()->
nodeManager
()->
getShapeNode_Strip
(
length
,
width
, 0.1);
85
}
86
87
SoTransform*
VP1RawDataHandle_TGC_Digit::buildTransform
()
88
{
89
const
auto
* elem =
element
();
90
if
(!elem)
91
return
new
SoTransform;
92
const
Identifier
id
=
m_data
->identify();
93
Amg::Transform3D
transform = elem->localToGlobalTransf(
id
);
94
// VP1 strip shapes follow local Y. Use the actual strip direction, including
95
// its stereo angle; wire gangs follow the wire-plane X axis.
96
const
bool
strip
=
VP1DetInfo::tgcIDHelper
()->
isStrip
(
id
);
97
const
Amg::Vector3D
along =
strip
? elem->stripDir(
id
).normalized()
98
:
Amg::Vector3D
(transform.linear().col(0));
99
const
Amg::Vector3D
normal = transform.linear().col(2);
100
transform.linear().col(0) = along.cross(normal).normalized();
101
transform.linear().col(1) = along;
102
transform.linear().col(2) = normal;
103
transform.translation() = elem->channelPos(
id
);
104
return
VP1LinAlgUtils::toSoTransform
(transform);
105
}
106
107
bool
VP1RawDataHandle_TGC_Digit::isStrip
()
const
108
{
109
const
auto
* helper =
VP1DetInfo::tgcIDHelper
();
110
return
helper && helper->valid(
m_data
->identify()) && helper->isStrip(
m_data
->identify());
111
}
112
113
unsigned
VP1RawDataHandle_TGC_Digit::bcTag
()
const
114
{
115
return
m_data
->bcTag();
116
}
length
double length(const pvec &v)
Definition
FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
SiliconTech::strip
@ strip
Definition
FPGATrackSimTypes.h:25
HitsSoNodeManager.h
MuonDetectorManager.h
TgcReadoutElement.h
width
const double width
Definition
TTileTripReader.cxx:24
TgcDigit.h
VP1DetInfo.h
VP1LinAlgUtils.h
VP1RawDataCommonData.h
VP1RawDataHandle_TGC_Digit.h
HitsSoNodeManager::getShapeNode_Point
SoNode * getShapeNode_Point()
Definition
HitsSoNodeManager.cxx:412
HitsSoNodeManager::getShapeNode_Strip
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
Definition
HitsSoNodeManager.cxx:269
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
TgcDigit
Definition
TgcDigit.h:21
TgcDigit::BC_UNDEFINED
@ BC_UNDEFINED
Definition
TgcDigit.h:37
TgcDigit::BC_NEXT
@ BC_NEXT
Definition
TgcDigit.h:37
TgcDigit::BC_CURRENT
@ BC_CURRENT
Definition
TgcDigit.h:37
TgcDigit::BC_PREVIOUS
@ BC_PREVIOUS
Definition
TgcDigit.h:37
TgcDigit::BC_NEXTNEXT
@ BC_NEXTNEXT
Definition
TgcDigit.h:37
TgcIdHelper::isStrip
int isStrip(const Identifier &id) const
isStrip corresponds to measuresPhi
Definition
TgcIdHelper.cxx:654
VP1DetInfo::tgcIDHelper
static const TgcIdHelper * tgcIDHelper()
Definition
VP1DetInfo.cxx:160
VP1DetInfo::muonDetMgr
static const MuonGM::MuonDetectorManager * muonDetMgr()
Definition
VP1DetInfo.cxx:148
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition
VP1LinAlgUtils.cxx:40
VP1RawDataCollBase
Definition
VP1RawDataCollBase.h:29
VP1RawDataCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition
VP1RawDataCommonData.h:42
VP1RawDataHandleBase::common
VP1RawDataCommonData * common() const
Definition
VP1RawDataHandleBase.h:41
VP1RawDataHandleBase::VP1RawDataHandleBase
VP1RawDataHandleBase(VP1RawDataCollBase *)
Definition
VP1RawDataHandleBase.cxx:50
VP1RawDataHandle_TGC_Digit::VP1RawDataHandle_TGC_Digit
VP1RawDataHandle_TGC_Digit(VP1RawDataCollBase *, const TgcDigit *)
Definition
VP1RawDataHandle_TGC_Digit.cxx:15
VP1RawDataHandle_TGC_Digit::buildTransform
SoTransform * buildTransform() override
Definition
VP1RawDataHandle_TGC_Digit.cxx:87
VP1RawDataHandle_TGC_Digit::buildShape
SoNode * buildShape() override
Definition
VP1RawDataHandle_TGC_Digit.cxx:71
VP1RawDataHandle_TGC_Digit::element
const MuonGM::TgcReadoutElement * element() const
Definition
VP1RawDataHandle_TGC_Digit.cxx:20
VP1RawDataHandle_TGC_Digit::clicked
QStringList clicked(bool verbose) const override
Definition
VP1RawDataHandle_TGC_Digit.cxx:28
VP1RawDataHandle_TGC_Digit::isStrip
bool isStrip() const
Definition
VP1RawDataHandle_TGC_Digit.cxx:107
VP1RawDataHandle_TGC_Digit::m_data
const TgcDigit * m_data
Definition
VP1RawDataHandle_TGC_Digit.h:24
VP1RawDataHandle_TGC_Digit::bcTag
unsigned bcTag() const
Definition
VP1RawDataHandle_TGC_Digit.cxx:113
verbose
bool verbose
Definition
hcg.cxx:75
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0