ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1RawDataSystems
src
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
14
#include "
VP1RawDataSystems/VP1RawDataHandle_TRT_RDO.h
"
15
#include "
VP1RawDataSystems/VP1RawDataColl_TRT_RDO.h
"
16
#include "
VP1RawDataSystems/VP1RawDataCommonData.h
"
17
#include "
VP1RawDataSystems/VP1RawDataSysController.h
"
18
#include "
VP1Utils/HitsSoNodeManager.h
"
19
#include "
VP1Utils/VP1DetInfo.h
"
20
#include "
VP1Utils/VP1LinAlgUtils.h
"
21
22
#include <Inventor/nodes/SoTransform.h>
23
#include <Inventor/nodes/SoGroup.h>
24
#include <Inventor/nodes/SoMaterial.h>
25
26
#include "
TRT_ReadoutGeometry/TRT_DetectorManager.h
"
27
#include "
TRT_ReadoutGeometry/TRT_BaseElement.h
"
28
#include "
InDetIdentifier/TRT_ID.h
"
29
#include "
InDetRawData/TRT_LoLumRawData.h
"
30
31
#include "GaudiKernel/SystemOfUnits.h"
32
33
//____________________________________________________________________
34
VP1RawDataHandle_TRT_RDO::VP1RawDataHandle_TRT_RDO
(
VP1RawDataCollBase
*
coll
,
const
TRT_LoLumRawData
*data)
35
:
VP1RawDataHandleBase
(
coll
),
m_data
(data)
36
{
37
}
38
39
//____________________________________________________________________
40
VP1RawDataHandle_TRT_RDO::~VP1RawDataHandle_TRT_RDO
()
41
{
42
}
43
44
//____________________________________________________________________
45
QStringList
VP1RawDataHandle_TRT_RDO::clicked
(
bool
verbose
)
const
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
//____________________________________________________________________
76
SoNode *
VP1RawDataHandle_TRT_RDO::buildShape
()
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
//____________________________________________________________________
93
SoTransform *
VP1RawDataHandle_TRT_RDO::buildTransform
()
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
//____________________________________________________________________
103
int
VP1RawDataHandle_TRT_RDO::strawID
()
const
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
//____________________________________________________________________
113
const
InDetDD::TRT_BaseElement
*
VP1RawDataHandle_TRT_RDO::element
()
const
114
{
115
const
InDetDD::TRT_DetectorManager
* detmgr =
VP1DetInfo::trtDetMgr
();
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:
129
return
VP1RawDataFlags::EndCapNegative
;
130
case
2:
131
return
VP1RawDataFlags::EndCapPositive
;
132
case
-1:
133
return
VP1RawDataFlags::BarrelNegative
;
134
case
1:
135
return
VP1RawDataFlags::BarrelPositive
;
136
default
:
137
return
VP1RawDataFlags::All
;
138
}
139
}
140
141
//____________________________________________________________________
142
bool
VP1RawDataHandle_TRT_RDO::highThreshold
()
const
143
{
144
return
m_data
->highLevel();
145
}
146
147
//____________________________________________________________________
148
double
VP1RawDataHandle_TRT_RDO::timeOverThreshold
()
const
149
{
150
return
m_data
->timeOverThreshold()*Gaudi::Units::nanosecond;
//According to the comments, returned value is in Gaudi::Units::ns.
151
}
gr
#define gr
DetectorZone::barrel
@ barrel
Definition
FPGATrackSimTypes.h:28
HitsSoNodeManager.h
TRT_BaseElement.h
TRT_DetectorManager.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector.
TRT_LoLumRawData.h
VP1DetInfo.h
VP1LinAlgUtils.h
VP1RawDataColl_TRT_RDO.h
VP1RawDataCommonData.h
VP1RawDataHandle_TRT_RDO.h
VP1RawDataSysController.h
HitsSoNodeManager::getShapeNode_DriftTube
SoNode * getShapeNode_DriftTube(double halfLength, double radius)
Definition
HitsSoNodeManager.cxx:138
InDetDD::TRT_BaseElement
Virtual base class of TRT readout elements.
Definition
TRT_BaseElement.h:56
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition
TRT_DetectorManager.h:63
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition
TRT_DetectorManager.cxx:145
TRT_ID
This is an Identifier helper class for the TRT subdetector.
Definition
TRT_ID.h:84
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition
TRT_ID.h:801
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
Definition
TRT_ID.h:792
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition
TRT_ID.h:810
TRT_ID::straw
int straw(const Identifier &id) const
Definition
TRT_ID.h:828
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition
TRT_ID.h:819
TRT_LoLumRawData
Definition
TRT_LoLumRawData.h:25
VP1DetInfo::trtIDHelper
static const TRT_ID * trtIDHelper()
Definition
VP1DetInfo.cxx:166
VP1DetInfo::trtDetMgr
static const InDetDD::TRT_DetectorManager * trtDetMgr()
Definition
VP1DetInfo.cxx:147
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition
VP1LinAlgUtils.cxx:40
VP1RawDataCollBase
Definition
VP1RawDataCollBase.h:29
VP1RawDataColl_TRT_RDO
Definition
VP1RawDataColl_TRT_RDO.h:23
VP1RawDataCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition
VP1RawDataCommonData.h:42
VP1RawDataFlags::EndCapPositive
@ EndCapPositive
Definition
VP1RawDataFlags.h:27
VP1RawDataFlags::EndCapNegative
@ EndCapNegative
Definition
VP1RawDataFlags.h:28
VP1RawDataFlags::All
@ All
Definition
VP1RawDataFlags.h:31
VP1RawDataFlags::BarrelPositive
@ BarrelPositive
Definition
VP1RawDataFlags.h:25
VP1RawDataFlags::BarrelNegative
@ BarrelNegative
Definition
VP1RawDataFlags.h:26
VP1RawDataHandleBase::common
VP1RawDataCommonData * common() const
Definition
VP1RawDataHandleBase.h:41
VP1RawDataHandleBase::VP1RawDataHandleBase
VP1RawDataHandleBase(VP1RawDataCollBase *)
Definition
VP1RawDataHandleBase.cxx:50
VP1RawDataHandleBase::unsignedToHex
static QString unsignedToHex(unsigned)
Definition
VP1RawDataHandleBase.cxx:158
VP1RawDataHandleBase::coll
VP1RawDataCollBase * coll() const
Definition
VP1RawDataHandleBase.h:40
VP1RawDataHandle_TRT_RDO::buildShape
SoNode * buildShape()
Definition
VP1RawDataHandle_TRT_RDO.cxx:76
VP1RawDataHandle_TRT_RDO::highThreshold
bool highThreshold() const
Definition
VP1RawDataHandle_TRT_RDO.cxx:142
VP1RawDataHandle_TRT_RDO::VP1RawDataHandle_TRT_RDO
VP1RawDataHandle_TRT_RDO(VP1RawDataCollBase *, const TRT_LoLumRawData *)
Definition
VP1RawDataHandle_TRT_RDO.cxx:34
VP1RawDataHandle_TRT_RDO::timeOverThreshold
double timeOverThreshold() const
Definition
VP1RawDataHandle_TRT_RDO.cxx:148
VP1RawDataHandle_TRT_RDO::strawID
int strawID() const
Definition
VP1RawDataHandle_TRT_RDO.cxx:103
VP1RawDataHandle_TRT_RDO::~VP1RawDataHandle_TRT_RDO
virtual ~VP1RawDataHandle_TRT_RDO()
Definition
VP1RawDataHandle_TRT_RDO.cxx:40
VP1RawDataHandle_TRT_RDO::element
const InDetDD::TRT_BaseElement * element() const
Definition
VP1RawDataHandle_TRT_RDO.cxx:113
VP1RawDataHandle_TRT_RDO::m_data
const TRT_LoLumRawData * m_data
Definition
VP1RawDataHandle_TRT_RDO.h:40
VP1RawDataHandle_TRT_RDO::buildTransform
SoTransform * buildTransform()
Definition
VP1RawDataHandle_TRT_RDO.cxx:93
VP1RawDataHandle_TRT_RDO::clicked
QStringList clicked(bool verbose) const
Definition
VP1RawDataHandle_TRT_RDO.cxx:45
VP1RawDataHandle_TRT_RDO::inInDetParts
VP1RawDataFlags::InDetPartsFlags inInDetParts() const
Definition
VP1RawDataHandle_TRT_RDO.cxx:122
node
Definition
node.h:24
verbose
bool verbose
Definition
hcg.cxx:75
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0