ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataHandle_TRT_RDO.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Implementation of class VP1RawDataHandle_TRT_RDO //
8// //
9// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10// Initial version: April 2008 (rewritten January 2009) //
11// //
13
19#include "VP1Utils/VP1DetInfo.h"
21
22#include <Inventor/nodes/SoTransform.h>
23#include <Inventor/nodes/SoGroup.h>
24#include <Inventor/nodes/SoMaterial.h>
25
30
31#include "GaudiKernel/SystemOfUnits.h"
32
33//____________________________________________________________________
38
39//____________________________________________________________________
43
44//____________________________________________________________________
46{
47 static const TRT_ID * idhelper = VP1DetInfo::trtIDHelper();
48 QStringList l;
49 l << " ===> TRT_LoLumRawData";
50 l << " Data word: "+unsignedToHex(m_data->getWord());
51 if (verbose) {
52 if (idhelper) {
53 //Fixme: We should have common identify -> QStringList method in VP1DetInfo!!
54 Identifier id(m_data->identify());
55 int barrel_ec = idhelper->barrel_ec(id);
56 bool barrel(barrel_ec==1||barrel_ec==-1);
57 l << QString(barrel?"Barrel":"End Cap")+" "+QString(barrel_ec>0?"A":"C");
58 l << " Phi module: "+QString::number(idhelper->phi_module(id));
59 l << " "+QString(barrel?"Layer":"Wheel")+": "+QString::number(idhelper->layer_or_wheel(id));
60 l << " Straw Layer: "+QString::number(idhelper->straw_layer(id));
61 l << " Straw: "+QString::number(idhelper->straw(id));
62 }
63 l << " High Level: "+QString(m_data->highLevel()?"Yes":"No");
64 l << " Time over Threshold (Gaudi::Units::ns): "+QString::number(m_data->timeOverThreshold());
65 // //Fixme:
66 // virtual bool highLevel(int /* BX */) const;
67 // virtual int driftTimeBin() const; // Position of first leading edge
68 // virtual int trailingEdge() const; // Position of last trailing edge
69 // virtual bool firstBinHigh() const; // True if first time bin is high
70 // virtual bool lastBinHigh() const; // True if last time bin is high
71 }
72 return l;
73}
74
75//____________________________________________________________________
77{
78 const InDetDD::TRT_BaseElement * elem = element();
79 double strawlength = elem ? elem->strawLength() : 200.0;
80
81 SoNode * node = common()->nodeManager()->getShapeNode_DriftTube(0.5*strawlength,0.0/*0 radius for line*/);
82 if (highThreshold() && static_cast<VP1RawDataColl_TRT_RDO*>(coll())->useSpecialHTMat()) {
83 SoGroup * gr = new SoGroup;
84 gr->addChild(coll()->common()->controller()->trtHTMaterial());
85 gr->addChild(node);
86 return gr;
87 } else {
88 return node;
89 }
90}
91
92//____________________________________________________________________
94{
95 const InDetDD::TRT_BaseElement * elem = element();
96 const int istraw = strawID();
97 if (istraw<0||!elem)
98 return new SoTransform;//fixme
99 return VP1LinAlgUtils::toSoTransform(elem->getAbsoluteTransform(istraw));
100}
101
102//____________________________________________________________________
104{
105 const TRT_ID * idhelper = VP1DetInfo::trtIDHelper();
106 if (!idhelper)
107 return -1;
108 const int s = idhelper->straw(m_data->identify());
109 return (s <= 28 && s >= 0) ? s : -1;
110}
111
112//____________________________________________________________________
114{
116 if (!detmgr)
117 return 0;
118 return detmgr->getElement(m_data->identify());
119}
120
121//____________________________________________________________________
122VP1RawDataFlags::InDetPartsFlags VP1RawDataHandle_TRT_RDO::inInDetParts() const
123{
124 const TRT_ID * idhelper = VP1DetInfo::trtIDHelper();
125 if (!idhelper)
127 switch (idhelper->barrel_ec(m_data->identify())) {
128 case -2:
130 case 2:
132 case -1:
134 case 1:
136 default:
138 }
139}
140
141//____________________________________________________________________
143{
144 return m_data->highLevel();
145}
146
147//____________________________________________________________________
149{
150 return m_data->timeOverThreshold()*Gaudi::Units::nanosecond;//According to the comments, returned value is in Gaudi::Units::ns.
151}
#define gr
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
This is an Identifier helper class for the TRT subdetector.
SoNode * getShapeNode_DriftTube(double halfLength, double radius)
Virtual base class of TRT readout elements.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
int phi_module(const Identifier &id) const
Definition TRT_ID.h:806
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition TRT_ID.h:797
int layer_or_wheel(const Identifier &id) const
Definition TRT_ID.h:815
int straw(const Identifier &id) const
Definition TRT_ID.h:833
int straw_layer(const Identifier &id) const
Definition TRT_ID.h:824
static const TRT_ID * trtIDHelper()
static const InDetDD::TRT_DetectorManager * trtDetMgr()
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
VP1RawDataHandleBase(VP1RawDataCollBase *)
static QString unsignedToHex(unsigned)
VP1RawDataCollBase * coll() const
VP1RawDataHandle_TRT_RDO(VP1RawDataCollBase *, const TRT_LoLumRawData *)
const InDetDD::TRT_BaseElement * element() const
const TRT_LoLumRawData * m_data
QStringList clicked(bool verbose) const
VP1RawDataFlags::InDetPartsFlags inInDetParts() const
Definition node.h:24
bool verbose
Definition hcg.cxx:73