ATLAS Offline Software
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 
28 #include "InDetIdentifier/TRT_ID.h"
30 
31 #include "GaudiKernel/SystemOfUnits.h"
32 
33 //____________________________________________________________________
36 {
37 }
38 
39 //____________________________________________________________________
41 {
42 }
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!!
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
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 //____________________________________________________________________
122 VP1RawDataFlags::InDetPartsFlags VP1RawDataHandle_TRT_RDO::inInDetParts() const
123 {
124  const TRT_ID * idhelper = VP1DetInfo::trtIDHelper();
125  if (!idhelper)
126  return VP1RawDataFlags::All;
127  switch (idhelper->barrel_ec(m_data->identify())) {
128  case -2:
130  case 2:
132  case -1:
134  case 1:
136  default:
137  return VP1RawDataFlags::All;
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 }
HitsSoNodeManager.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
InDetDD::TRT_BaseElement::strawLength
virtual const double & strawLength() const =0
Active straw length.
VP1RawDataHandleBase::unsignedToHex
static QString unsignedToHex(unsigned)
Definition: VP1RawDataHandleBase.cxx:158
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1RawDataFlags::EndCapPositive
@ EndCapPositive
Definition: VP1RawDataFlags.h:27
VP1RawDataColl_TRT_RDO.h
VP1RawDataHandleBase
Definition: VP1RawDataHandleBase.h:34
VP1RawDataHandle_TRT_RDO::highThreshold
bool highThreshold() const
Definition: VP1RawDataHandle_TRT_RDO.cxx:142
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
VP1RawDataHandle_TRT_RDO::m_data
const TRT_LoLumRawData * m_data
Definition: VP1RawDataHandle_TRT_RDO.h:40
TRT_DetectorManager.h
TRT_LoLumRawData::highLevel
virtual bool highLevel() const override final
Definition: TRT_LoLumRawData.h:128
TRT_LoLumRawData
Definition: TRT_LoLumRawData.h:25
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
VP1RawDataHandle_TRT_RDO::buildShape
SoNode * buildShape()
Definition: VP1RawDataHandle_TRT_RDO.cxx:76
VP1RawDataCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition: VP1RawDataCommonData.h:42
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
VP1RawDataCollBase
Definition: VP1RawDataCollBase.h:29
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
gr
#define gr
VP1RawDataColl_TRT_RDO
Definition: VP1RawDataColl_TRT_RDO.h:23
VP1LinAlgUtils.h
VP1DetInfo.h
VP1RawDataHandle_TRT_RDO::strawID
int strawID() const
Definition: VP1RawDataHandle_TRT_RDO.cxx:103
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
VP1RawDataSysController.h
InDetDD::TRT_BaseElement::getAbsoluteTransform
const HepGeom::Transform3D getAbsoluteTransform(int straw) const
This is an alias to strawTransform(int straw)
Definition: TRT_BaseElement.cxx:42
VP1RawDataHandle_TRT_RDO::element
const InDetDD::TRT_BaseElement * element() const
Definition: VP1RawDataHandle_TRT_RDO.cxx:113
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:893
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
VP1RawDataHandle_TRT_RDO::~VP1RawDataHandle_TRT_RDO
virtual ~VP1RawDataHandle_TRT_RDO()
Definition: VP1RawDataHandle_TRT_RDO.cxx:40
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
VP1RawDataHandle_TRT_RDO::VP1RawDataHandle_TRT_RDO
VP1RawDataHandle_TRT_RDO(VP1RawDataCollBase *, const TRT_LoLumRawData *)
Definition: VP1RawDataHandle_TRT_RDO.cxx:34
TRT_BaseElement.h
VP1RawDataCommonData.h
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
python.selection.number
number
Definition: selection.py:20
TRT_LoLumRawData::timeOverThreshold
virtual double timeOverThreshold() const override final
Definition: TRT_LoLumRawData.h:47
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:148
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
VP1RawDataHandle_TRT_RDO::inInDetParts
VP1RawDataFlags::InDetPartsFlags inInDetParts() const
Definition: VP1RawDataHandle_TRT_RDO.cxx:122
TRT_ID
Definition: TRT_ID.h:84
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:69
VP1DetInfo::trtIDHelper
static const TRT_ID * trtIDHelper()
Definition: VP1DetInfo.cxx:166
InDetRawData::getWord
unsigned int getWord() const
Definition: InDetRawData.h:47
VP1RawDataHandle_TRT_RDO.h
VP1RawDataHandle_TRT_RDO::timeOverThreshold
double timeOverThreshold() const
Definition: VP1RawDataHandle_TRT_RDO.cxx:148
VP1RawDataFlags::BarrelNegative
@ BarrelNegative
Definition: VP1RawDataFlags.h:26
VP1RawDataHandle_TRT_RDO::buildTransform
SoTransform * buildTransform()
Definition: VP1RawDataHandle_TRT_RDO.cxx:93
VP1DetInfo::trtDetMgr
static const InDetDD::TRT_DetectorManager * trtDetMgr()
Definition: VP1DetInfo.cxx:147
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
DetectorZone::barrel
@ barrel
VP1RawDataHandleBase::coll
VP1RawDataCollBase * coll() const
Definition: VP1RawDataHandleBase.h:40
VP1RawDataFlags::All
@ All
Definition: VP1RawDataFlags.h:31
VP1RawDataFlags::BarrelPositive
@ BarrelPositive
Definition: VP1RawDataFlags.h:25
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
VP1RawDataFlags::EndCapNegative
@ EndCapNegative
Definition: VP1RawDataFlags.h:28
VP1RawDataHandle_TRT_RDO::clicked
QStringList clicked(bool verbose) const
Definition: VP1RawDataHandle_TRT_RDO.cxx:45
HitsSoNodeManager::getShapeNode_DriftTube
SoNode * getShapeNode_DriftTube(double halfLength, double radius)
Definition: HitsSoNodeManager.cxx:138
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition: VP1LinAlgUtils.cxx:40
VP1RawDataHandleBase::common
VP1RawDataCommonData * common() const
Definition: VP1RawDataHandleBase.h:41
node
Definition: memory_hooks-stdcmalloc.h:74
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
TRT_LoLumRawData.h
Identifier
Definition: IdentifierFieldParser.cxx:14