ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1PRDSystems
src
PRDHandle_MDT.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
VP1PRDSystems/PRDHandle_MDT.h
"
6
#include "
VP1Utils/HitsSoNodeManager.h
"
7
#include "
VP1PRDSystems/MuonChamberProjectionHelper.h
"
8
#include "
VP1Base/VP1Msg.h
"
9
#include "
VP1Utils/VP1DetInfo.h
"
10
11
#include "
MuonReadoutGeometry/MuonStation.h
"
12
#include "
TrkSurfaces/CylinderBounds.h
"
13
#include "
TrkSurfaces/Surface.h
"
14
15
#include "
GeoPrimitives/GeoPrimitives.h
"
16
17
18
//____________________________________________________________________
19
PRDHandle_MDT::PRDHandle_MDT
(
PRDCollHandle_MDT
*collhandle,
const
Muon::MdtPrepData
*dc)
20
:
PRDHandleBase
(static_cast<
PRDCollHandleBase
*>(collhandle)),
m_driftcircle
(dc)
21
{
22
}
23
24
//____________________________________________________________________
25
void
PRDHandle_MDT::buildShapes
(SoNode*&shape_simple, SoNode*&shape_detailed)
26
{
27
const
Trk::CylinderBounds
* ccbo =
dynamic_cast<
const
Trk::CylinderBounds
*
>
(&(
m_driftcircle
->detectorElement()->surface(
m_driftcircle
->identify()).bounds()));
28
if
(not ccbo)
return
;
29
30
double
radius =
m_driftcircle
->localPosition()[0];
31
if
(radius<0.15)
32
radius = 0.0;
//radius is so small it is better to collapse to line
33
double
halflength(ccbo->
halflengthZ
());
34
PRDCollHandle_MDT::PROJECTION
projection(
static_cast<
PRDCollHandle_MDT
*
>
(
collHandle
())->projection());
35
if
(projection!=
PRDCollHandle_MDT::NONE
) {
36
const
double
epsilon = 0.15;
37
if
(projection==
PRDCollHandle_MDT::TOCHAMBERS
) {
38
double
distanceToFirstEndPlane, distanceToSecondEndPlane;
39
Amg::Transform3D
transform(
getTransform_CLHEP
());
40
Amg::Vector3D
tubedir(0.0,0.0,1.0);
41
MuonChamberProjectionHelper::applyTransformToVector
( transform, tubedir);
42
if
(
common
()->muonChamberProjectionHelper()
43
->getDistancesToMDTChamberWallsAlongLine(
parentMuonChamberPV
(),
44
transform *
Amg::Vector3D
(0.0,0.0,0.0), tubedir,
45
distanceToFirstEndPlane, distanceToSecondEndPlane, radius )) {
46
if
(fabs(distanceToFirstEndPlane-distanceToSecondEndPlane)>0.1*epsilon)
47
std::cout <<
"PRDHandle_MDT: Warning tube is not centered in chamber! We should translate the prd object appropriately (todo)."
<<std::endl;
48
halflength = std::max(distanceToFirstEndPlane,distanceToSecondEndPlane)+epsilon;
49
}
else
{
50
std::cout <<
"PRDHandle_MDT: Couldn't retrieve data for projections to chamber end planes."
<<std::endl;
51
halflength += 500.0;
52
}
53
}
else
{
54
assert(projection==
PRDCollHandle_MDT::TOTUBES
);
55
//To end of tubes.
56
halflength += 56.0 + epsilon;
57
}
58
}
59
60
shape_simple =
common
()->
nodeManager
()->
getShapeNode_DriftTube
( halflength, 0.0 );
61
//Detailed shape uses tube (unless negligible radius):
62
if
(radius==0.0)
63
shape_detailed = shape_simple;
64
else
65
shape_detailed =
common
()->
nodeManager
()->
getShapeNode_DriftTube
( halflength, radius );
66
67
if
(
m_driftcircle
->rdoList().size() > 1)
68
VP1Msg::message
(
"Warning: MDT has additional elements in rdoList: NOT IMPLEMENTED"
);
69
}
70
71
//____________________________________________________________________
72
int
PRDHandle_MDT::regionIndex
()
73
{
74
//Unique for each station.
75
const
MuonGM::MuonStation
* station =
m_driftcircle
->detectorElement()->parentMuonStation();
76
return
station->
getPhiIndex
()-99999*station->
getEtaIndex
();
//hopefully unique.
77
}
78
79
//____________________________________________________________________
80
QStringList
PRDHandle_MDT::clicked
()
const
81
{
82
83
if
(!
m_driftcircle
)
84
return
QStringList(
"Null PRD"
);
85
const
MdtIdHelper
* idhelper =
VP1DetInfo::mdtIDHelper
();
86
if
(!idhelper)
87
return
QStringList(
"Null PRD"
);
88
89
std::ostringstream os;
90
Identifier
id
=
m_driftcircle
->identify();
91
92
os <<
"MdtPrepData with Identifier ["
<<
id
.get_compact() ;
93
os <<
"] = ["
<< (idhelper->
print_to_string
(
id
)) ;
94
os <<
"]\n at global position = ["
<<
m_driftcircle
->globalPosition()<<
"], local position = ["
<<
m_driftcircle
->localPosition()<<
"]."
;
95
os <<
"\nDrift radius = "
<<
m_driftcircle
->localPosition()[0]<<
" CLHEP::mm. "
;
96
os <<
"ADC: "
<<
m_driftcircle
->adc();
97
os <<
", TDC: "
<<
m_driftcircle
->tdc();
98
std::string status(
"Status: "
);
99
os<<status;
100
101
QStringList l(QString(os.str().c_str())+
driftCircleStatus
());
102
103
return
l;
104
}
105
106
//____________________________________________________________________
107
QString
PRDHandle_MDT::driftCircleStatus
()
const
108
{
109
QString status;
110
switch
(
m_driftcircle
->status()){
111
case
Muon::MdtStatusMasked
:
112
status+=
"Masked"
;
113
break
;
114
case
Muon::MdtStatusDriftTime
:
115
status+=
"Drift Time"
;
116
break
;
117
case
Muon::MdtStatusBeforeSpectrum
:
118
status+=
"Before Spectrum"
;
119
break
;
120
case
Muon::MdtStatusAfterSpectrum
:
121
status+=
"After Spectrum"
;
122
break
;
123
default
:
124
status+=QString((
" Unknown with value = "
+std::to_string(
m_driftcircle
->status())).c_str());
125
}
126
return
status;
127
}
128
CylinderBounds.h
GeoPrimitives.h
HitsSoNodeManager.h
MuonChamberProjectionHelper.h
MuonStation.h
PRDHandle_MDT.h
Surface.h
VP1DetInfo.h
VP1Msg.h
AtlasDetectorID::print_to_string
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
Definition
AtlasDetectorID.cxx:358
HitsSoNodeManager::getShapeNode_DriftTube
SoNode * getShapeNode_DriftTube(double halfLength, double radius)
Definition
HitsSoNodeManager.cxx:138
MdtIdHelper
Definition
MdtIdHelper.h:61
MuonChamberProjectionHelper::applyTransformToVector
static Amg::Vector3D & applyTransformToVector(const Amg::Transform3D &m, Amg::Vector3D &v)
Definition
MuonChamberProjectionHelper.cxx:142
MuonGM::MuonStation
Definition
MuonStation.h:51
MuonGM::MuonStation::getEtaIndex
int getEtaIndex() const
a la AMDB
Definition
MuonStation.h:174
MuonGM::MuonStation::getPhiIndex
int getPhiIndex() const
a la AMDB
Definition
MuonStation.h:173
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition
MdtPrepData.h:33
PRDCollHandleBase
Definition
PRDCollHandleBase.h:25
PRDCollHandle_MDT
Definition
PRDCollHandle_MDT.h:11
PRDCollHandle_MDT::PROJECTION
PROJECTION
Definition
PRDCollHandle_MDT.h:24
PRDCollHandle_MDT::TOCHAMBERS
@ TOCHAMBERS
Definition
PRDCollHandle_MDT.h:24
PRDCollHandle_MDT::TOTUBES
@ TOTUBES
Definition
PRDCollHandle_MDT.h:24
PRDCollHandle_MDT::NONE
@ NONE
Definition
PRDCollHandle_MDT.h:24
PRDHandleBase::getTransform_CLHEP
Amg::Transform3D getTransform_CLHEP() const
Definition
PRDHandleBase.cxx:322
PRDHandleBase::PRDHandleBase
PRDHandleBase(PRDCollHandleBase *)
Definition
PRDHandleBase.cxx:66
PRDHandleBase::common
PRDSysCommonData * common() const
Definition
PRDHandleBase.h:53
PRDHandleBase::collHandle
PRDCollHandleBase * collHandle() const
Definition
PRDHandleBase.cxx:228
PRDHandle_MDT::m_driftcircle
const Muon::MdtPrepData * m_driftcircle
Definition
PRDHandle_MDT.h:40
PRDHandle_MDT::buildShapes
void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
Definition
PRDHandle_MDT.cxx:25
PRDHandle_MDT::parentMuonChamberPV
GeoPVConstLink parentMuonChamberPV() const
Definition
PRDHandle_MDT.h:33
PRDHandle_MDT::PRDHandle_MDT
PRDHandle_MDT(PRDCollHandle_MDT *, const Muon::MdtPrepData *)
Definition
PRDHandle_MDT.cxx:19
PRDHandle_MDT::regionIndex
int regionIndex()
Definition
PRDHandle_MDT.cxx:72
PRDHandle_MDT::driftCircleStatus
QString driftCircleStatus() const
Definition
PRDHandle_MDT.cxx:107
PRDHandle_MDT::clicked
QStringList clicked() const
Definition
PRDHandle_MDT.cxx:80
PRDSysCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition
PRDSysCommonData.h:79
Trk::CylinderBounds
Bounds for a cylindrical Surface.
Definition
CylinderBounds.h:46
Trk::CylinderBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
VP1DetInfo::mdtIDHelper
static const MdtIdHelper * mdtIDHelper()
Definition
VP1DetInfo.cxx:163
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition
VP1Msg.cxx:30
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon::MdtStatusAfterSpectrum
@ MdtStatusAfterSpectrum
The tube produced a hit that is inconsistent with the drift time spectrum, the drift time is larger t...
Definition
MdtDriftCircleStatus.h:40
Muon::MdtStatusBeforeSpectrum
@ MdtStatusBeforeSpectrum
The tube produced a hit that is inconsistent with the drift time spectrum, the drift time is smaller ...
Definition
MdtDriftCircleStatus.h:37
Muon::MdtStatusMasked
@ MdtStatusMasked
A hit during a previous bunch crossing occured which rendered the tube dead for this bunch crossing.
Definition
MdtDriftCircleStatus.h:31
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition
MdtDriftCircleStatus.h:34
Generated on
for ATLAS Offline Software by
1.17.0