ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataHandle_RPC_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
13#include "GaudiKernel/SystemOfUnits.h"
14#include <Inventor/nodes/SoTransform.h>
15
20
22{
23 const auto* helper = VP1DetInfo::rpcIDHelper();
24 const auto* manager = VP1DetInfo::muonDetMgr();
25 return manager && helper && helper->valid(m_data->identify())
26 ? manager->getRpcReadoutElement(m_data->identify()) : nullptr;
27}
28
30{
31 const Identifier id = m_data->identify();
32 const auto* helper = VP1DetInfo::rpcIDHelper();
33 const bool valid = helper && helper->valid(id);
34 QStringList lines;
35 lines << " ===> RPC Digit data";
36 lines << " Identifier: " + QString::fromStdString(id.getString());
37 lines << " Strip view: " + (valid ? QString(helper->measuresPhi(id) ? "Phi" : "Eta")
38 : QString("unavailable"));
39 lines << " Time [ns]: " + QString::number(m_data->time() / Gaudi::Units::ns);
40 lines << " Time over threshold [ns]: " + QString::number(m_data->ToT() / Gaudi::Units::ns)
41 + (m_data->ToT() < 0 ? " (not available)" : "");
42 lines << " stripSide: " + QString(m_data->stripSide() ? "true" : "false");
43 if (verbose) {
44 if (valid) {
45 lines << " Station name: " + QString::fromStdString(helper->stationNameString(id));
46 lines << " Station eta index: " + QString::number(helper->stationEta(id));
47 lines << " Station phi index: " + QString::number(helper->stationPhi(id));
48 lines << " Doublet R: " + QString::number(helper->doubletR(id));
49 lines << " Doublet Z: " + QString::number(helper->doubletZ(id));
50 lines << " Doublet phi: " + QString::number(helper->doubletPhi(id));
51 lines << " Gas gap: " + QString::number(helper->gasGap(id));
52 lines << " Strip: " + QString::number(helper->strip(id));
53 } else {
54 lines << " Decoded identifier unavailable";
55 }
56 const auto* elem = element();
57 if (elem) {
58 const Amg::Vector3D position = elem->stripPos(id);
59 lines << QString(" Global position [mm] (x, y, z): (%1, %2, %3)")
60 .arg(position.x() / Gaudi::Units::mm, 0, 'g', 10)
61 .arg(position.y() / Gaudi::Units::mm, 0, 'g', 10)
62 .arg(position.z() / Gaudi::Units::mm, 0, 'g', 10);
63 const bool phi = helper->measuresPhi(id);
64 lines << " Strip length [mm]: " + QString::number(elem->StripLength(phi) / Gaudi::Units::mm);
65 lines << " Strip width [mm]: " + QString::number(elem->StripWidth(phi) / Gaudi::Units::mm);
66 } else {
67 lines << " Global position unavailable";
68 }
69 }
70 return lines;
71}
72
74{
75 const auto* elem = element();
76 if (!elem)
78 const bool phi = VP1DetInfo::rpcIDHelper()->measuresPhi(m_data->identify());
79 // Strip footprint from geometry; depth is a display thickness in mm.
81 elem->StripLength(phi), elem->StripWidth(phi), 0.1 * Gaudi::Units::mm);
82}
83
85{
86 const auto* elem = element();
87 if (!elem)
88 return new SoTransform;
89 const Identifier id = m_data->identify();
90 // The tracking frame has X across the strip and Y along it, matching VP1.
91 // Do not use localToGlobalTransf(), which follows AMDB conventions instead.
92 Amg::Transform3D transform = elem->transform(id);
93 transform.translation() = elem->stripPos(id);
94 return VP1LinAlgUtils::toSoTransform(transform);
95}
96
98{
99 const auto* helper = VP1DetInfo::rpcIDHelper();
100 return helper && helper->valid(m_data->identify()) && helper->measuresPhi(m_data->identify());
101}
102
103bool VP1RawDataHandle_RPC_Digit::oppositeSide() const { return m_data->stripSide(); }
104double VP1RawDataHandle_RPC_Digit::time() const { return m_data->time() / Gaudi::Units::ns; }
105double VP1RawDataHandle_RPC_Digit::timeOverThreshold() const { return m_data->ToT() / Gaudi::Units::ns; }
Scalar phi() const
phi method
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
bool measuresPhi(const Identifier &id) const override
static const RpcIdHelper * rpcIDHelper()
static const MuonGM::MuonDetectorManager * muonDetMgr()
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
VP1RawDataHandleBase(VP1RawDataCollBase *)
VP1RawDataHandle_RPC_Digit(VP1RawDataCollBase *, const RpcDigit *)
QStringList clicked(bool verbose) const override
SoTransform * buildTransform() override
const MuonGM::RpcReadoutElement * element() const
bool verbose
Definition hcg.cxx:75
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D