ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataHandle_MDT_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_MDT_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
25
26#include <Inventor/nodes/SoTransform.h>
27#include <Inventor/nodes/SoGroup.h>
28#include <Inventor/nodes/SoMaterial.h>
29
30#include "GaudiKernel/SystemOfUnits.h"
31
32//____________________________________________________________________
37
38//____________________________________________________________________
42
43//____________________________________________________________________
45{
46 const Identifier id = m_data->identify();
47 QStringList ll;
48 ll << " ===> MDT Digit data";
49 ll << " Identifier: " + QString::fromStdString(id.getString());
50 ll << " adc: " + QString::number(m_data->adc());
51 ll << " tdc: " + QString::number(m_data->tdc());
52 ll << " isMasked: " + QString(isMasked() ? "true" : "false");
53 if (verbose) {
54 const MdtIdHelper* idhelper = VP1DetInfo::mdtIDHelper();
55 const bool valid = idhelper && idhelper->valid(id);
56 if (valid) {
57 ll << " Station name: " + QString::fromStdString(idhelper->stationNameString(id));
58 ll << " Station eta index: " + QString::number(idhelper->stationEta(id));
59 ll << " Station phi index: " + QString::number(idhelper->stationPhi(id));
60 ll << " Multilayer: " + QString::number(idhelper->multilayer(id));
61 ll << " Tube layer: " + QString::number(idhelper->tubeLayer(id));
62 ll << " Tube: " + QString::number(idhelper->tube(id));
63 } else {
64 ll << " Decoded identifier unavailable";
65 }
66 const MuonGM::MdtReadoutElement* elem = valid ? element() : nullptr;
67 if (elem) {
68 ll << " Is Barrel: " + QString::number(elem->barrel());
69 ll << " Is Endcap: " + QString::number(elem->endcap());
70 const Amg::Vector3D position = elem->tubePos(id);
71 ll << QString(" Global position [mm] (x, y, z): (%1, %2, %3)")
72 .arg(position.x() / Gaudi::Units::mm, 0, 'g', 10)
73 .arg(position.y() / Gaudi::Units::mm, 0, 'g', 10)
74 .arg(position.z() / Gaudi::Units::mm, 0, 'g', 10);
75 } else {
76 ll << " Global position unavailable";
77 }
78 }
79 return ll;
80}
81
82//____________________________________________________________________
84{
85 const MuonGM::MdtReadoutElement * elem = element();
86 Identifier id(m_data->identify());
87 double tubeLength = elem->tubeLength(id);
88 // double strawlength = elem ? elem->strawLength() : 200.0;
89
90 SoNode * node = common()->nodeManager()->getShapeNode_DriftTube(tubeLength/2, elem->innerTubeRadius());
91 return node;
92}
93
94//____________________________________________________________________
96{
97 const MuonGM::MdtReadoutElement * elem = element();
98 if (!elem)
99 return new SoTransform;//fixme
100 Identifier id(m_data->identify());
101 return VP1LinAlgUtils::toSoTransform(elem->localToGlobalTransf(id));
102}
103
104//____________________________________________________________________
106{
107
109
110 if (!detmgr)
111 return 0;
112 return detmgr->getMdtReadoutElement(m_data->identify());
113}
114
116{
117 return m_data->adc();
118}
119
121{
122 return m_data->tdc();
123}
124
126{
127 return m_data->isMasked();
128}
double tubeLength
SoNode * getShapeNode_DriftTube(double halfLength, double radius)
int multilayer(const Identifier &id) const
Access to components of the ID.
bool valid(const Identifier &id) const
Public validation of levels.
int tube(const Identifier &id) const
int tubeLayer(const Identifier &id) const
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MdtReadoutElement * getMdtReadoutElement(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 MdtIdHelper * mdtIDHelper()
static const MuonGM::MuonDetectorManager * muonDetMgr()
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
VP1RawDataHandleBase(VP1RawDataCollBase *)
VP1RawDataCollBase * coll() const
VP1RawDataHandle_MDT_RDO(VP1RawDataCollBase *, const MdtDigit *)
QStringList clicked(bool verbose) const
const MuonGM::MdtReadoutElement * element() const
Definition node.h:24
bool verbose
Definition hcg.cxx:75
Eigen::Matrix< double, 3, 1 > Vector3D