ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1PRDSystems
src
PRDHandle_MM.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
/*
6
* update:
7
*
8
* - added MM and sTGC strip lenght from readout geometry
9
* 06.05.2013 - Riccardo BIANCHI <rbianchi@cern.ch>
10
*
11
*/
12
13
14
#include "
VP1PRDSystems/PRDHandle_MM.h
"
15
#include "
VP1Utils/HitsSoNodeManager.h
"
16
#include "
VP1PRDSystems/MuonChamberProjectionHelper.h
"
17
#include "
VP1Base/VP1Msg.h
"
18
#include "
VP1Utils/VP1DetInfo.h
"
19
20
#include <Inventor/nodes/SoSeparator.h>
21
22
#include "
TrkSurfaces/CylinderBounds.h
"
23
#include "
TrkSurfaces/Surface.h
"
24
#include "
MuonReadoutGeometry/MuonStation.h
"
25
#include "
MuonReadoutGeometry/MuonChannelDesign.h
"
26
#include "
MuonReadoutGeometry/MMReadoutElement.h
"
27
#include "
MuonReadoutGeometry/sTgcReadoutElement.h
"
28
29
#include "
GeoPrimitives/GeoPrimitives.h
"
30
31
32
//____________________________________________________________________
33
PRDHandle_MM::PRDHandle_MM
(
PRDCollHandle_MM
*collhandle,
const
Muon::MMPrepData
*dc)
34
:
PRDHandleBase
(static_cast<
PRDCollHandleBase
*>(collhandle)),
m_prd
(dc)
35
{
36
}
37
38
//____________________________________________________________________
39
void
PRDHandle_MM::buildShapes
(SoNode*&shape_simple, SoNode*&shape_detailed)
40
{
41
// std::cout<<"m_prd->detectorElement()->surface(m_prd->identify())"<<m_prd->detectorElement()->surface(m_prd->identify())<<std::endl;
42
//const Trk::CylinderBounds* ccbo = dynamic_cast<const Trk::CylinderBounds*>(&(m_prd->detectorElement()->surface(m_prd->identify()).bounds()));
43
//assert(ccbo!=0);
44
45
// const Trk::LocalPosition& localpos = m_prd->localPosition();
46
47
48
const
MmIdHelper
* idhelper =
VP1DetInfo::mmIDHelper
();
49
50
if
(!idhelper) {
51
VP1Msg::messageDebug
(
"idhelper is null. Returning without building the shape..."
);
52
return
;
53
}
54
55
const
Muon::MMPrepData
* prd =
mm
();
56
57
if
(!prd) {
58
VP1Msg::messageDebug
(
"prd is null. Returning without building the shape..."
);
59
return
;
60
}
61
62
Identifier
id
= prd->
identify
();
63
64
const
MuonGM::MMReadoutElement
* detEl = prd->
detectorElement
();
65
66
VP1Msg::messageDebug
(
"Building MM strip..."
);
67
const
MuonGM::MuonChannelDesign
* design = detEl->
getDesign
(
id
);
68
69
// using point shape for simple view
70
shape_simple =
common
()->
nodeManager
()->
getShapeNode_Strip
(0.);
71
72
// local position of the strip
73
Amg::Vector2D
locPos;
74
if
(!detEl->
stripPosition
(
id
,locPos) )
return
;
75
if
(!design)
return
;
76
77
double
striplength=design->
channelLength
(idhelper->
channel
(
id
));
78
double
stripWidth=design->
inputWidth
;
79
80
// use rectangular shape for detailed view
81
SoSeparator * errDetailed =
new
SoSeparator;
82
errDetailed->addChild(
common
()->nodeManager()->getShapeNode_Strip(striplength,std::min(10.0,stripWidth),0.01));
83
84
shape_detailed = errDetailed;
85
86
}
87
88
89
//____________________________________________________________________
90
int
PRDHandle_MM::regionIndex
()
91
{
92
//Unique for each station.
93
const
MuonGM::MuonStation
* station =
m_prd
->detectorElement()->parentMuonStation();
94
if
(!station) {
VP1Msg::message
(
"Warning - MM station gives null parent. Something is wrong with the geometry!"
);
return
0;}
95
return
station->
getPhiIndex
()-99999*station->
getEtaIndex
();
//hopefully unique.
96
}
97
98
//____________________________________________________________________
99
QStringList
PRDHandle_MM::clicked
()
const
100
{
101
102
if
(!
m_prd
)
103
return
QStringList(
"Null PRD"
);
104
const
MdtIdHelper
* idhelper =
VP1DetInfo::mdtIDHelper
();
105
if
(!idhelper)
106
return
QStringList(
"Null PRD"
);
107
108
std::ostringstream os;
109
Identifier
id
=
m_prd
->identify();
110
111
os <<
"MMPrepData with Identifier ["
<<
id
.get_compact() ;
112
os <<
"] = ["
<< (idhelper->
print_to_string
(
id
)) ;
113
os <<
"]\n at global position = ["
<<
m_prd
->globalPosition()<<
"], local position = ["
<<
m_prd
->localPosition()<<
"]."
;
114
// os <<"ADC: "<<m_prd->adc();
115
// os <<", TDC: "<<m_prd->tdc();
116
// std::string status("Status: ");
117
// os<<status;
118
119
//QStringList l(QString(os.str().c_str())+driftCircleStatus());
120
QStringList l(QString(os.str().c_str()));
121
122
return
l;
123
}
CylinderBounds.h
GeoPrimitives.h
HitsSoNodeManager.h
MMReadoutElement.h
MuonChamberProjectionHelper.h
MuonChannelDesign.h
sTgcReadoutElement.h
MuonStation.h
PRDHandle_MM.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_Strip
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
Definition
HitsSoNodeManager.cxx:269
MdtIdHelper
Definition
MdtIdHelper.h:61
MmIdHelper
Definition
MmIdHelper.h:54
MmIdHelper::channel
int channel(const Identifier &id) const override
Definition
MmIdHelper.cxx:832
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition
MMReadoutElement.h:25
MuonGM::MMReadoutElement::stripPosition
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position – local or global If the strip number is outside the range of valid strips,...
Definition
MMReadoutElement.h:206
MuonGM::MMReadoutElement::getDesign
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
Definition
MMReadoutElement.h:190
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::MMPrepData
Class to represent MM measurements.
Definition
MMPrepData.h:22
Muon::MMPrepData::detectorElement
virtual const MuonGM::MMReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
Definition
MMPrepData.h:206
PRDCollHandleBase
Definition
PRDCollHandleBase.h:25
PRDCollHandle_MM
Definition
PRDCollHandle_MM.h:11
PRDHandleBase::PRDHandleBase
PRDHandleBase(PRDCollHandleBase *)
Definition
PRDHandleBase.cxx:66
PRDHandleBase::common
PRDSysCommonData * common() const
Definition
PRDHandleBase.h:53
PRDHandle_MM::buildShapes
void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
Definition
PRDHandle_MM.cxx:39
PRDHandle_MM::PRDHandle_MM
PRDHandle_MM(PRDCollHandle_MM *, const Muon::MMPrepData *)
Definition
PRDHandle_MM.cxx:33
PRDHandle_MM::clicked
QStringList clicked() const
Definition
PRDHandle_MM.cxx:99
PRDHandle_MM::mm
const Muon::MMPrepData * mm() const
Definition
PRDHandle_MM.h:24
PRDHandle_MM::m_prd
const Muon::MMPrepData * m_prd
Definition
PRDHandle_MM.h:39
PRDHandle_MM::regionIndex
int regionIndex()
Definition
PRDHandle_MM.cxx:90
PRDSysCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition
PRDSysCommonData.h:79
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
VP1DetInfo::mdtIDHelper
static const MdtIdHelper * mdtIDHelper()
Definition
VP1DetInfo.cxx:163
VP1DetInfo::mmIDHelper
static const MmIdHelper * mmIDHelper()
Definition
VP1DetInfo.cxx:162
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition
VP1Msg.cxx:39
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition
VP1Msg.cxx:30
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonGM::MuonChannelDesign
Definition
MuonChannelDesign.h:21
MuonGM::MuonChannelDesign::inputWidth
double inputWidth
Definition
MuonChannelDesign.h:30
MuonGM::MuonChannelDesign::channelLength
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.
Definition
MuonChannelDesign.h:383
Generated on
for ATLAS Offline Software by
1.17.0