ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataHandle_sTGC_RDO Class Reference

#include <VP1RawDataHandle_sTGC_RDO.h>

Inheritance diagram for VP1RawDataHandle_sTGC_RDO:
Collaboration diagram for VP1RawDataHandle_sTGC_RDO:

Public Member Functions

 VP1RawDataHandle_sTGC_RDO (VP1RawDataCollBase *, const sTgcDigit *)
virtual ~VP1RawDataHandle_sTGC_RDO ()
QStringList clicked (bool verbose) const
int channelType () const
bool isDead () const
bool isPileup () const
double amplitude () const
double time () const
VP1RawDataCollBase * coll () const
VP1RawDataCommonData * common () const
void setVisible (bool)
bool visible () const
void update3DObjects ()
virtual Amg::Vector3D center ()
virtual VP1RawDataFlags::InDetPartsFlags inInDetParts () const
void updateShownOutlines ()

Static Public Member Functions

static QString unsignedToHex (unsigned)

Protected Member Functions

SoNode * buildShape ()
SoTransform * buildTransform ()
const MuonGM::sTgcReadoutElement * element () const

Protected Attributes

const sTgcDigit * m_data
int m_channelType {-1}
std::string m_channelTypeStr {""}

Private Attributes

Imp * m_d
VP1RawDataCollBase * m_coll
bool m_visible

Detailed Description

Definition at line 25 of file VP1RawDataHandle_sTGC_RDO.h.

Constructor & Destructor Documentation

◆ VP1RawDataHandle_sTGC_RDO()

VP1RawDataHandle_sTGC_RDO::VP1RawDataHandle_sTGC_RDO ( VP1RawDataCollBase * coll,
const sTgcDigit * data )

Definition at line 35 of file VP1RawDataHandle_sTGC_RDO.cxx.

37{
38}
VP1RawDataHandleBase(VP1RawDataCollBase *)
VP1RawDataCollBase * coll() const

◆ ~VP1RawDataHandle_sTGC_RDO()

VP1RawDataHandle_sTGC_RDO::~VP1RawDataHandle_sTGC_RDO ( )
virtual

Definition at line 41 of file VP1RawDataHandle_sTGC_RDO.cxx.

42{
43}

Member Function Documentation

◆ amplitude()

double VP1RawDataHandle_sTGC_RDO::amplitude ( ) const

Definition at line 207 of file VP1RawDataHandle_sTGC_RDO.cxx.

208{
209 return m_data->charge();
210}

◆ buildShape()

SoNode * VP1RawDataHandle_sTGC_RDO::buildShape ( )
protectedvirtual

Implements VP1RawDataHandleBase.

Definition at line 101 of file VP1RawDataHandle_sTGC_RDO.cxx.

102{
103
104 SoNode * node{nullptr};
105
106
107 const MuonGM::sTgcReadoutElement * elem = element();
108 Identifier id(m_data->identify());
109
110 static const sTgcIdHelper * idhelper = VP1DetInfo::stgcIDHelper();
111 const int channel = idhelper->channel(id);
112 m_channelType = idhelper->channelType(id);
113
114 // element's local and global positions
115 Amg::Vector3D globalPos{Amg::Vector3D::Zero()};
116 Amg::Vector2D pos{Amg::Vector2D::Zero()};
117 elem->stripGlobalPosition(id, globalPos);
118 elem->stripPosition(id, pos);
119
120 // sTGC element's geometry
121 double shortWidth=0, longWidth=0, length=0;
122 const Trk::PlaneSurface surface = elem->surface(id);
123
124 // PAD geometry
125 if (m_channelType == 0) {
126 m_channelTypeStr = "PAD";
127 length = elem->channelPitch(id); // Height of a pad
128 std::array<Amg::Vector2D, 4> corners{
129 make_array<Amg::Vector2D, 4>(Amg::Vector2D::Zero())};
130 elem->padCorners(id, corners); // BotLeft, BotRight, TopLeft, TopRight
131 shortWidth = (corners.at(1) - corners.at(0)).norm();
132 longWidth = (corners.at(3) - corners.at(2)).norm();
133
134 node = common()->nodeManager()->getShapeNode_Pad(length,shortWidth,longWidth,10*Gaudi::Units::mm/*Dummy depth*/);
135 }
136 // STRIP geometry
137 else if (m_channelType == 1) {
138 m_channelTypeStr = "STRIP";
139 const MuonGM::MuonChannelDesign* design = elem->getDesign(id);
140 length = design->channelLength(channel);
141 shortWidth = elem->channelPitch(id); // Full pitch of strips
142 longWidth = shortWidth;
143
144 node = common()->nodeManager()->getShapeNode_Strip(length,longWidth,10*Gaudi::Units::mm/*Dummy depth*/);
145 }
146 // WIRE geometry
147 else {
148 m_channelTypeStr = "WIRE";
149 const MuonGM::MuonChannelDesign* design = elem->getDesign(id);
150 if (!design) {
151 // VP1Msg::messageVerbose("No wire design for hit " + id.getString());
152 std::cout << "No wire design for hit " << id << std::endl;;
153 return node;
154 }
155
156 // recalculate length and globalPos for wires, because
157 // design->channelLength(channel) doesn't look sensible
158 double fulllength = design->xSize();
159 double locY = design->firstPos() +
160 (channel - 1) * design->inputPitch * design->groupWidth;
161 if (std::abs(locY) > 0.5 * design->minYSize()) { // triangle region
162 double dY = 0.5 * (design->maxYSize() - design->minYSize());
163 length = (0.5 * design->maxYSize() - std::abs(locY)) / dY * fulllength;
164 if (std::abs(locY) > 873) { // trapezoid region in the outter most part
165 // of the large sector
166 length += 0.5 * fulllength;
167 }
168 elem->surface(id).localToGlobal(
169 Amg::Vector2D(pos.x(), pos.y() + 0.5 * (fulllength - length)),
170 Amg::Vector3D::Zero(), globalPos);
171 } else { // rectangular region
172 length = fulllength;
173 }
174
175 shortWidth = elem->channelPitch(id); // Width of a full wire group
176 longWidth = shortWidth;
177
178 node = common()->nodeManager()->getShapeNode_Wire(length,longWidth,10*Gaudi::Units::mm/*Dummy depth*/);
179 }
180 return node;
181}
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
double length(const pvec &v)
SoNode * getShapeNode_Wire(double length, double minWidth=0, double maxWidth=0, double depth=0)
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
SoNode * getShapeNode_Pad(double length, double minWidth=0, double maxWidth=0, double depth=0)
static const sTgcIdHelper * stgcIDHelper()
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
const MuonGM::sTgcReadoutElement * element() const
int channelType(const Identifier &id) const
int channel(const Identifier &id) const override
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
@ locY
local cartesian
Definition ParamDefs.h:38
double firstPos() const
Returns the position of the first strip along the x-axis.
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.

◆ buildTransform()

SoTransform * VP1RawDataHandle_sTGC_RDO::buildTransform ( )
protectedvirtual

Implements VP1RawDataHandleBase.

Definition at line 184 of file VP1RawDataHandle_sTGC_RDO.cxx.

185{
186 const MuonGM::sTgcReadoutElement * elem = element();
187 if (!elem)
188 return new SoTransform;//fixme
189 Identifier id(m_data->identify());
190 Amg::Vector3D globalPos;
191 elem->stripGlobalPosition(id, globalPos);
192
194}
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Eigen::Affine3d Transform3D

◆ center()

Amg::Vector3D VP1RawDataHandleBase::center ( )
virtualinherited

Definition at line 166 of file VP1RawDataHandleBase.cxx.

167{
168 m_d->ensureInitSepAndTransform(this);
169 assert(m_d->sep
170 && m_d->sep->getNumChildren()>0
171 && m_d->sep->getChild(0)->getTypeId().isDerivedFrom(SoTransform::getClassTypeId()));
172
173 float x,y,z;
174 static_cast<SoTransform*>(m_d->sep->getChild(0))->translation.getValue().getValue(x,y,z);
175 //NB: We assume that the center part of the transform is zero
176 return Amg::Vector3D(x,y,z);
177}
#define y
#define x
#define z

◆ channelType()

int VP1RawDataHandle_sTGC_RDO::channelType ( ) const

Definition at line 217 of file VP1RawDataHandle_sTGC_RDO.cxx.

218{
219 const sTgcIdHelper* helper = VP1DetInfo::stgcIDHelper();
220 return helper ? helper->channelType(m_data->identify()) : -1;
221}

◆ clicked()

QStringList VP1RawDataHandle_sTGC_RDO::clicked ( bool verbose) const
virtual

Implements VP1RawDataHandleBase.

Definition at line 46 of file VP1RawDataHandle_sTGC_RDO.cxx.

47{
48 const Identifier id = m_data->identify();
49 const sTgcIdHelper* idhelper = VP1DetInfo::stgcIDHelper();
50 const bool valid = idhelper && m_data->is_valid(idhelper);
51 QStringList ll;
52 ll << " ===> sTGC Digit data";
53 ll << " Identifier: " + QString::fromStdString(id.getString());
54 if (valid) {
55 const int type = idhelper->channelType(id);
56 const QString typeName = type == sTgcIdHelper::Pad ? "PAD" :
57 type == sTgcIdHelper::Strip ? "STRIP" : "WIRE";
58 ll << " type: " + typeName;
59 } else {
60 ll << " type: unavailable";
61 }
62 ll << " is_valid(idhelper): " + (idhelper ? QString::number(valid) : QString("unavailable"));
63 ll << " bcTag: " + QString::number(m_data->bcTag());
64 ll << " charge: " + QString::number(m_data->charge());
65 ll << " charge_6bit: " + QString::number(m_data->charge_6bit());
66 ll << " charge_10bit: " + QString::number(m_data->charge_10bit());
67 ll << " time: " + QString::number(m_data->time());
68 ll << " isDead: " + QString::number(m_data->isDead());
69 ll << " isPileup: " + QString::number(m_data->isPileup());
70 if (verbose) {
71 if (valid) {
72 ll << " Station name: " + QString::fromStdString(idhelper->stationNameString(id));
73 ll << " Station eta index: " + QString::number(idhelper->stationEta(id));
74 ll << " Station phi index: " + QString::number(idhelper->stationPhi(id));
75 ll << " Multilayer: " + QString::number(idhelper->multilayer(id));
76 ll << " Gas gap: " + QString::number(idhelper->gasGap(id));
77 ll << " Channel type index: " + QString::number(idhelper->channelType(id));
78 ll << " Channel: " + QString::number(idhelper->channel(id));
79 if (idhelper->channelType(id) == sTgcIdHelper::Pad) {
80 ll << " Pad eta index: " + QString::number(idhelper->padEta(id));
81 ll << " Pad phi index: " + QString::number(idhelper->padPhi(id));
82 }
83 } else {
84 ll << " Decoded identifier unavailable";
85 }
86 const MuonGM::sTgcReadoutElement* elem = valid ? element() : nullptr;
87 Amg::Vector3D position = Amg::Vector3D::Zero();
88 if (elem && elem->stripGlobalPosition(id, position)) {
89 ll << QString(" Global position [mm] (x, y, z): (%1, %2, %3)")
90 .arg(position.x() / Gaudi::Units::mm, 0, 'g', 10)
91 .arg(position.y() / Gaudi::Units::mm, 0, 'g', 10)
92 .arg(position.z() / Gaudi::Units::mm, 0, 'g', 10);
93 } else {
94 ll << " Global position unavailable";
95 }
96 }
97 return ll;
98}
int stationEta(const Identifier &id) const
const std::string & stationNameString(const Identifier &id) const
int stationPhi(const Identifier &id) const
int padPhi(const Identifier &id) const
int multilayer(const Identifier &id) const
int padEta(const Identifier &id) const
int gasGap(const Identifier &id) const override
get the hashes
bool verbose
Definition hcg.cxx:75
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
list valid
Definition calibdata.py:44
long long ll

◆ coll()

VP1RawDataCollBase * VP1RawDataHandleBase::coll ( ) const
inlineinherited

Definition at line 40 of file VP1RawDataHandleBase.h.

40{ return m_coll; }
VP1RawDataCollBase * m_coll

◆ common()

VP1RawDataCommonData * VP1RawDataHandleBase::common ( ) const
inlineinherited

Definition at line 41 of file VP1RawDataHandleBase.h.

41{ return m_coll->common(); }

◆ element()

const MuonGM::sTgcReadoutElement * VP1RawDataHandle_sTGC_RDO::element ( ) const
protected

Definition at line 197 of file VP1RawDataHandle_sTGC_RDO.cxx.

198{
199
200 const MuonGM::MuonDetectorManager * detmgr = VP1DetInfo::muonDetMgr();
201
202 if (!detmgr)
203 return 0;
204 return detmgr->getsTgcReadoutElement(m_data->identify());
205}
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
static const MuonGM::MuonDetectorManager * muonDetMgr()

◆ inInDetParts()

virtual VP1RawDataFlags::InDetPartsFlags VP1RawDataHandleBase::inInDetParts ( ) const
inlinevirtualinherited

Reimplemented in VP1RawDataHandle_PixelRDO, VP1RawDataHandle_SCT_RDO, and VP1RawDataHandle_TRT_RDO.

Definition at line 51 of file VP1RawDataHandleBase.h.

51{ return VP1RawDataFlags::None; }//Override if InDet

◆ isDead()

bool VP1RawDataHandle_sTGC_RDO::isDead ( ) const

Definition at line 223 of file VP1RawDataHandle_sTGC_RDO.cxx.

224{
225 return m_data->isDead();
226}

◆ isPileup()

bool VP1RawDataHandle_sTGC_RDO::isPileup ( ) const

Definition at line 228 of file VP1RawDataHandle_sTGC_RDO.cxx.

229{
230 return m_data->isPileup();
231}

◆ setVisible()

void VP1RawDataHandleBase::setVisible ( bool vis)
inherited

Definition at line 68 of file VP1RawDataHandleBase.cxx.

69{
70 if (vis==m_visible)
71 return;
72 m_visible=vis;
73 if (vis) {
74 if (!m_d->hasShape())
75 m_d->rebuild3DObjects(this);
76 m_d->ensureAttach3DObjects(this);
77 } else {
78 m_d->ensureDetach3DObjects(this);
79 }
80}

◆ time()

double VP1RawDataHandle_sTGC_RDO::time ( ) const

Definition at line 212 of file VP1RawDataHandle_sTGC_RDO.cxx.

213{
214 return m_data->time();
215}

◆ unsignedToHex()

QString VP1RawDataHandleBase::unsignedToHex ( unsigned i)
staticinherited

Definition at line 158 of file VP1RawDataHandleBase.cxx.

159{
160 std::ostringstream s;
161 s << "0x" << std::hex << i;
162 return QString(s.str().c_str()).toUpper();
163}

◆ update3DObjects()

void VP1RawDataHandleBase::update3DObjects ( )
inherited

Definition at line 83 of file VP1RawDataHandleBase.cxx.

84{
85 if (m_visible) {
86 m_d->rebuild3DObjects(this);
87 } else {
88 //Simply clear the present 3D objects. They will only be recreated if/when the handle becomes visible again.
89 m_d->clearShape();
90 }
91}

◆ updateShownOutlines()

void VP1RawDataHandleBase::updateShownOutlines ( )
inherited

Definition at line 180 of file VP1RawDataHandleBase.cxx.

181{
182 if (!m_d->sep)
183 return;
185}
void updateVolumeOutlines(SoGroup *)

◆ visible()

bool VP1RawDataHandleBase::visible ( ) const
inlineinherited

Definition at line 44 of file VP1RawDataHandleBase.h.

44{ return m_visible; }

Member Data Documentation

◆ m_channelType

int VP1RawDataHandle_sTGC_RDO::m_channelType {-1}
protected

Definition at line 46 of file VP1RawDataHandle_sTGC_RDO.h.

46{-1};

◆ m_channelTypeStr

std::string VP1RawDataHandle_sTGC_RDO::m_channelTypeStr {""}
protected

Definition at line 47 of file VP1RawDataHandle_sTGC_RDO.h.

47{""};

◆ m_coll

VP1RawDataCollBase* VP1RawDataHandleBase::m_coll
privateinherited

Definition at line 70 of file VP1RawDataHandleBase.h.

◆ m_d

Imp* VP1RawDataHandleBase::m_d
privateinherited

Definition at line 68 of file VP1RawDataHandleBase.h.

◆ m_data

const sTgcDigit* VP1RawDataHandle_sTGC_RDO::m_data
protected

Definition at line 43 of file VP1RawDataHandle_sTGC_RDO.h.

◆ m_visible

bool VP1RawDataHandleBase::m_visible
privateinherited

Definition at line 71 of file VP1RawDataHandleBase.h.


The documentation for this class was generated from the following files: