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 = transform.linear() * Amg::Vector3D::UnitZ();
41
if
(
common
()->muonChamberProjectionHelper()
42
->getDistancesToMDTChamberWallsAlongLine(
parentMuonChamberPV
(),
43
transform.translation(), tubedir,
44
distanceToFirstEndPlane, distanceToSecondEndPlane, radius )) {
45
if
(fabs(distanceToFirstEndPlane-distanceToSecondEndPlane)>0.1*epsilon)
46
std::cout <<
"PRDHandle_MDT: Warning tube is not centered in chamber! We should translate the prd object appropriately (todo)."
<<std::endl;
47
halflength = std::max(distanceToFirstEndPlane,distanceToSecondEndPlane)+epsilon;
48
}
else
{
49
std::cout <<
"PRDHandle_MDT: Couldn't retrieve data for projections to chamber end planes."
<<std::endl;
50
halflength += 500.0;
51
}
52
}
else
{
53
assert(projection==
PRDCollHandle_MDT::TOTUBES
);
54
//To end of tubes.
55
halflength += 56.0 + epsilon;
56
}
57
}
58
59
shape_simple =
common
()->
nodeManager
()->
getShapeNode_DriftTube
( halflength, 0.0 );
60
//Detailed shape uses tube (unless negligible radius):
61
if
(radius==0.0)
62
shape_detailed = shape_simple;
63
else
64
shape_detailed =
common
()->
nodeManager
()->
getShapeNode_DriftTube
( halflength, radius );
65
66
if
(
m_driftcircle
->rdoList().size() > 1)
67
VP1Msg::message
(
"Warning: MDT has additional elements in rdoList: NOT IMPLEMENTED"
);
68
}
69
70
//____________________________________________________________________
71
int
PRDHandle_MDT::regionIndex
()
72
{
73
//Unique for each station.
74
const
MuonGM::MuonStation
* station =
m_driftcircle
->detectorElement()->parentMuonStation();
75
return
station->
getPhiIndex
()-99999*station->
getEtaIndex
();
//hopefully unique.
76
}
77
78
//____________________________________________________________________
79
QStringList
PRDHandle_MDT::clicked
()
const
80
{
81
82
if
(!
m_driftcircle
)
83
return
QStringList(
"Null PRD"
);
84
const
MdtIdHelper
* idhelper =
VP1DetInfo::mdtIDHelper
();
85
if
(!idhelper)
86
return
QStringList(
"Null PRD"
);
87
88
std::ostringstream os;
89
Identifier
id
=
m_driftcircle
->identify();
90
91
os <<
"MdtPrepData with Identifier ["
<<
id
.get_compact() ;
92
os <<
"] = ["
<< (idhelper->
print_to_string
(
id
)) ;
93
os <<
"]\n at global position = ["
<<
m_driftcircle
->globalPosition()<<
"], local position = ["
<<
m_driftcircle
->localPosition()<<
"]."
;
94
os <<
"\nDrift radius = "
<<
m_driftcircle
->localPosition()[0]<<
" CLHEP::mm. "
;
95
os <<
"ADC: "
<<
m_driftcircle
->adc();
96
os <<
", TDC: "
<<
m_driftcircle
->tdc();
97
std::string status(
"Status: "
);
98
os<<status;
99
100
QStringList l(QString(os.str().c_str())+
driftCircleStatus
());
101
102
return
l;
103
}
104
105
//____________________________________________________________________
106
QString
PRDHandle_MDT::driftCircleStatus
()
const
107
{
108
QString status;
109
switch
(
m_driftcircle
->status()){
110
case
Muon::MdtStatusMasked
:
111
status+=
"Masked"
;
112
break
;
113
case
Muon::MdtStatusDriftTime
:
114
status+=
"Drift Time"
;
115
break
;
116
case
Muon::MdtStatusBeforeSpectrum
:
117
status+=
"Before Spectrum"
;
118
break
;
119
case
Muon::MdtStatusAfterSpectrum
:
120
status+=
"After Spectrum"
;
121
break
;
122
default
:
123
status+=QString((
" Unknown with value = "
+std::to_string(
m_driftcircle
->status())).c_str());
124
}
125
return
status;
126
}
127
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
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:71
PRDHandle_MDT::driftCircleStatus
QString driftCircleStatus() const
Definition
PRDHandle_MDT.cxx:106
PRDHandle_MDT::clicked
QStringList clicked() const
Definition
PRDHandle_MDT.cxx:79
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:48
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