ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1RawDataSystems
src
VP1RawDataHandle_MM_RDO.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// //
7
// Implementation of class VP1RawDataHandle_MM_RDO //
8
// //
9
// Author: Riccardo Maria BIANCHI <riccardo.maria.bianchi@cern.ch>
10
// Initial version: January 2024
11
// //
13
14
#include "
VP1RawDataSystems/VP1RawDataHandle_MM_RDO.h
"
15
#include "
VP1RawDataSystems/VP1RawDataColl_MM_RDO.h
"
16
17
#include "
VP1RawDataSystems/VP1RawDataCommonData.h
"
18
#include "
VP1RawDataSystems/VP1RawDataSysController.h
"
19
20
#include "
VP1Utils/HitsSoNodeManager.h
"
21
#include "
VP1Utils/VP1DetInfo.h
"
22
#include "
VP1Utils/VP1LinAlgUtils.h
"
23
24
#include "
VP1Base/VP1Msg.h
"
25
26
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
27
28
#include <Inventor/nodes/SoTransform.h>
29
#include <Inventor/nodes/SoGroup.h>
30
#include <Inventor/nodes/SoMaterial.h>
31
32
#include "GaudiKernel/SystemOfUnits.h"
33
34
//____________________________________________________________________
35
VP1RawDataHandle_MM_RDO::VP1RawDataHandle_MM_RDO
(
VP1RawDataCollBase
*
coll
,
const
MmDigit
*data)
36
:
VP1RawDataHandleBase
(
coll
),
m_data
(data)
37
{
38
}
39
40
//____________________________________________________________________
41
VP1RawDataHandle_MM_RDO::~VP1RawDataHandle_MM_RDO
()
42
{
43
}
44
45
//____________________________________________________________________
46
QStringList
VP1RawDataHandle_MM_RDO::clicked
(
bool
verbose
)
const
47
{
48
const
Identifier
id
=
m_data
->identify();
49
QStringList ll;
50
ll <<
" ===> MM Digit data"
;
51
ll <<
" Identifier: "
+ QString::fromStdString(
id
.getString());
52
ll <<
" stripResponseTime: "
+ QString::number(
m_data
->stripResponseTime());
53
ll <<
" stripResponseCharge: "
+ QString::number(
m_data
->stripResponseCharge());
54
if
(
verbose
) {
55
const
MmIdHelper
* idhelper =
VP1DetInfo::mmIDHelper
();
56
const
bool
valid = idhelper && idhelper->
valid
(
id
);
57
if
(valid) {
58
ll <<
" Station name: "
+ QString::fromStdString(idhelper->
stationNameString
(
id
));
59
ll <<
" Station eta index: "
+ QString::number(idhelper->
stationEta
(
id
));
60
ll <<
" Station phi index: "
+ QString::number(idhelper->
stationPhi
(
id
));
61
ll <<
" Multilayer: "
+ QString::number(idhelper->
multilayer
(
id
));
62
ll <<
" Gas gap: "
+ QString::number(idhelper->
gasGap
(
id
));
63
ll <<
" Channel: "
+ QString::number(idhelper->
channel
(
id
));
64
}
else
{
65
ll <<
" Decoded identifier unavailable"
;
66
}
67
const
MuonGM::MMReadoutElement
* elem = valid ?
element
() :
nullptr
;
68
const
MuonGM::MuonChannelDesign
* design = elem ? elem->getDesign(
id
) :
nullptr
;
69
if
(design) {
70
const
double
length
= design->
channelLength
(idhelper->
channel
(
id
));
71
const
double
angle
= design->
stereoAngle
();
72
ll <<
" Strip length [mm]: "
+ QString::number(
length
/ Gaudi::Units::mm);
73
ll <<
" Stereo angle [deg]: "
+ QString::number(
angle
/ Gaudi::Units::degree);
74
}
else
{
75
ll <<
" Strip geometry unavailable"
;
76
}
77
Amg::Vector3D
position = Amg::Vector3D::Zero();
78
if
(elem && elem->stripGlobalPosition(
id
, position)) {
79
ll << QString(
" Global position [mm] (x, y, z): (%1, %2, %3)"
)
80
.arg(position.x() / Gaudi::Units::mm, 0,
'g'
, 10)
81
.arg(position.y() / Gaudi::Units::mm, 0,
'g'
, 10)
82
.arg(position.z() / Gaudi::Units::mm, 0,
'g'
, 10);
83
}
else
{
84
ll <<
" Global position unavailable"
;
85
}
86
}
87
return
ll;
88
}
89
90
//____________________________________________________________________
91
SoNode *
VP1RawDataHandle_MM_RDO::buildShape
()
92
{
93
const
MuonGM::MMReadoutElement
* elem =
element
();
94
Identifier
id(
m_data
->identify());
95
96
static
const
MmIdHelper
* idhelper =
VP1DetInfo::mmIDHelper
();
97
if
(!idhelper) {
98
VP1Msg::messageDebug
(
99
"MM idhelper is null. Returning without building the shape for MM "
100
"digits..."
);
101
SoNode*
node
=
common
()->
nodeManager
()->
getShapeNode_Point
();
102
return
node
;
103
}
104
105
VP1Msg::messageDebug
(
"Building MM digit strip..."
);
106
const
MuonGM::MuonChannelDesign
* design = elem->getDesign(
id
);
107
108
double
striplength{0.}, stripWidth{0.};
109
int
channel = idhelper->
channel
(
id
);
110
111
Amg::Vector2D
locPos;
112
elem->stripPosition(
id
, locPos);
113
114
striplength = design->
channelLength
(channel);
115
stripWidth = design->
inputWidth
;
116
117
SoNode*
node
=
common
()->
nodeManager
()->
getShapeNode_Strip
(
118
striplength, std::min(10.0, stripWidth), 0.01);
119
120
return
node
;
121
}
122
123
//____________________________________________________________________
124
SoTransform *
VP1RawDataHandle_MM_RDO::buildTransform
()
125
{
126
const
MuonGM::MMReadoutElement
* elem =
element
();
127
if
(!elem)
128
return
new
SoTransform;
//fixme
129
Identifier
id(
m_data
->identify());
130
131
Amg::Vector3D
globalPos;
132
elem->stripGlobalPosition(
id
, globalPos);
133
134
return
VP1LinAlgUtils::toSoTransform
(
Amg::Transform3D
(globalPos));
135
}
136
137
//____________________________________________________________________
138
const
MuonGM::MMReadoutElement
*
VP1RawDataHandle_MM_RDO::element
()
const
139
{
140
141
const
MuonGM::MuonDetectorManager
* detmgr =
VP1DetInfo::muonDetMgr
();
142
143
if
(!detmgr)
144
return
0;
145
return
detmgr->
getMMReadoutElement
(
m_data
->identify());
146
}
147
148
double
VP1RawDataHandle_MM_RDO::amplitude
()
const
149
{
150
return
m_data
->stripResponseCharge();
151
}
152
153
double
VP1RawDataHandle_MM_RDO::time
()
const
154
{
155
return
m_data
->stripResponseTime();
156
}
length
double length(const pvec &v)
Definition
FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
HitsSoNodeManager.h
MuonDetectorManager.h
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition
TRTDetectorFactory_Full.cxx:71
VP1DetInfo.h
VP1LinAlgUtils.h
VP1Msg.h
VP1RawDataColl_MM_RDO.h
VP1RawDataCommonData.h
VP1RawDataHandle_MM_RDO.h
VP1RawDataSysController.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
MmDigit
Definition
MmDigit.h:20
MmIdHelper
Definition
MmIdHelper.h:54
MmIdHelper::valid
bool valid(const Identifier &id) const
Definition
MmIdHelper.cxx:664
MmIdHelper::channel
int channel(const Identifier &id) const override
Definition
MmIdHelper.cxx:832
MmIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition
MmIdHelper.cxx:830
MmIdHelper::multilayer
int multilayer(const Identifier &id) const
Definition
MmIdHelper.cxx:828
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition
MMReadoutElement.h:25
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition
MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:268
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition
MuonIdHelper.cxx:790
MuonIdHelper::stationNameString
const std::string & stationNameString(const Identifier &id) const
Definition
MuonIdHelper.cxx:839
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition
MuonIdHelper.cxx:795
VP1DetInfo::muonDetMgr
static const MuonGM::MuonDetectorManager * muonDetMgr()
Definition
VP1DetInfo.cxx:148
VP1DetInfo::mmIDHelper
static const MmIdHelper * mmIDHelper()
Definition
VP1DetInfo.cxx:162
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition
VP1LinAlgUtils.cxx:40
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition
VP1Msg.cxx:39
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
VP1RawDataHandleBase::coll
VP1RawDataCollBase * coll() const
Definition
VP1RawDataHandleBase.h:40
VP1RawDataHandle_MM_RDO::clicked
QStringList clicked(bool verbose) const
Definition
VP1RawDataHandle_MM_RDO.cxx:46
VP1RawDataHandle_MM_RDO::amplitude
double amplitude() const
Definition
VP1RawDataHandle_MM_RDO.cxx:148
VP1RawDataHandle_MM_RDO::~VP1RawDataHandle_MM_RDO
virtual ~VP1RawDataHandle_MM_RDO()
Definition
VP1RawDataHandle_MM_RDO.cxx:41
VP1RawDataHandle_MM_RDO::m_data
const MmDigit * m_data
Definition
VP1RawDataHandle_MM_RDO.h:40
VP1RawDataHandle_MM_RDO::VP1RawDataHandle_MM_RDO
VP1RawDataHandle_MM_RDO(VP1RawDataCollBase *, const MmDigit *)
Definition
VP1RawDataHandle_MM_RDO.cxx:35
VP1RawDataHandle_MM_RDO::time
double time() const
Definition
VP1RawDataHandle_MM_RDO.cxx:153
VP1RawDataHandle_MM_RDO::element
const MuonGM::MMReadoutElement * element() const
Definition
VP1RawDataHandle_MM_RDO.cxx:138
VP1RawDataHandle_MM_RDO::buildShape
SoNode * buildShape()
Definition
VP1RawDataHandle_MM_RDO.cxx:91
VP1RawDataHandle_MM_RDO::buildTransform
SoTransform * buildTransform()
Definition
VP1RawDataHandle_MM_RDO.cxx:124
node
Definition
node.h:24
verbose
bool verbose
Definition
hcg.cxx:75
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:49
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonGM::MuonChannelDesign
Definition
MuonChannelDesign.h:21
MuonGM::MuonChannelDesign::inputWidth
double inputWidth
Definition
MuonChannelDesign.h:30
MuonGM::MuonChannelDesign::stereoAngle
double stereoAngle() const
returns the stereo angle
Definition
MuonChannelDesign.h:67
MuonGM::MuonChannelDesign::channelLength
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.
Definition
MuonChannelDesign.h:383
Generated on
for ATLAS Offline Software by
1.17.0