ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
19
21#include "VP1Utils/VP1DetInfo.h"
23
24#include "VP1Base/VP1Msg.h"
25
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//____________________________________________________________________
39
40//____________________________________________________________________
44
45//____________________________________________________________________
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//____________________________________________________________________
92{
93 const MuonGM::MMReadoutElement* elem = element();
94 Identifier id(m_data->identify());
95
96 static const MmIdHelper* idhelper = VP1DetInfo::mmIDHelper();
97 if (!idhelper) {
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
118 striplength, std::min(10.0, stripWidth), 0.01);
119
120 return node;
121}
122
123//____________________________________________________________________
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
135}
136
137//____________________________________________________________________
139{
140
142
143 if (!detmgr)
144 return 0;
145 return detmgr->getMMReadoutElement(m_data->identify());
146}
147
149{
150 return m_data->stripResponseCharge();
151}
152
154{
155 return m_data->stripResponseTime();
156}
double length(const pvec &v)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
bool valid(const Identifier &id) const
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
int multilayer(const Identifier &id) const
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
int stationEta(const Identifier &id) const
const std::string & stationNameString(const Identifier &id) const
int stationPhi(const Identifier &id) const
static const MuonGM::MuonDetectorManager * muonDetMgr()
static const MmIdHelper * mmIDHelper()
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
VP1RawDataHandleBase(VP1RawDataCollBase *)
VP1RawDataCollBase * coll() const
QStringList clicked(bool verbose) const
VP1RawDataHandle_MM_RDO(VP1RawDataCollBase *, const MmDigit *)
const MuonGM::MMReadoutElement * element() const
Definition node.h:24
bool verbose
Definition hcg.cxx:75
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double stereoAngle() const
returns the stereo angle
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.