ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1RawDataSystems
src
VP1RawDataColl_TGC_Digit.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
VP1RawDataSystems/VP1RawDataColl_TGC_Digit.h
"
6
#include "
VP1RawDataSystems/VP1RawDataSysController.h
"
7
#include "
VP1RawDataSystems/VP1RawDataCommonData.h
"
8
#include "
TgcDigitCuts.h
"
9
#include "
VP1RawDataSystems/VP1RawDataHandle_TGC_Digit.h
"
10
#include "
VP1Utils/VP1SGContentsHelper.h
"
11
#include "
VP1Utils/VP1JobConfigInfo.h
"
12
#include "
VP1Utils/VP1DetInfo.h
"
13
#include "
VP1Base/VP1MaterialButton.h
"
14
#include "
MuonDigitContainer/TgcDigitContainer.h
"
15
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
16
#include "
StoreGate/ReadHandle.h
"
17
18
QStringList
VP1RawDataColl_TGC_Digit::availableCollections
(
IVP1System
* sys)
19
{
20
return
VP1SGContentsHelper
(sys).
getKeys
<
TgcDigitContainer
>();
21
}
22
23
VP1RawDataColl_TGC_Digit::VP1RawDataColl_TGC_Digit
(
24
VP1RawDataCommonData
*
common
,
const
QString& key)
25
:
VP1RawDataCollBase
(
common
, key),
m_cuts
(
std
::make_unique<
TgcDigitCuts
>())
26
{
27
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowStripsChanged
,
28
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowStrips
);
29
setTgcShowStrips
(
common
->controller()->tgcShowStrips());
30
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowWiresChanged
,
31
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowWires
);
32
setTgcShowWires
(
common
->controller()->tgcShowWires());
33
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowPreviousChanged
,
34
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowPrevious
);
35
setTgcShowPrevious
(
common
->controller()->tgcShowPrevious());
36
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowCurrentChanged
,
37
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowCurrent
);
38
setTgcShowCurrent
(
common
->controller()->tgcShowCurrent());
39
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowNextChanged
,
40
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowNext
);
41
setTgcShowNext
(
common
->controller()->tgcShowNext());
42
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowNextNextChanged
,
43
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowNextNext
);
44
setTgcShowNextNext
(
common
->controller()->tgcShowNextNext());
45
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowUndefinedChanged
,
46
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowUndefined
);
47
setTgcShowUndefined
(
common
->controller()->tgcShowUndefined());
48
connect(
common
->controller(), &
VP1RawDataSysController::tgcShowUnknownChanged
,
49
this
, &
VP1RawDataColl_TGC_Digit::setTgcShowUnknown
);
50
setTgcShowUnknown
(
common
->controller()->tgcShowUnknown());
51
}
52
53
VP1RawDataColl_TGC_Digit::~VP1RawDataColl_TGC_Digit
() =
default
;
54
55
void
VP1RawDataColl_TGC_Digit::assignDefaultMaterial
(SoMaterial*
material
)
const
56
{
57
VP1MaterialButton::setMaterialParametersFromRGB
(
material
, 80, 180, 255, 0.1);
58
}
59
60
bool
VP1RawDataColl_TGC_Digit::load
()
61
{
62
const
auto
* helper =
VP1DetInfo::tgcIDHelper
();
63
const
auto
* manager =
VP1DetInfo::muonDetMgr
();
64
if
(!
VP1JobConfigInfo::hasMuonGeometry
() || !helper || !manager) {
65
message
(
"TGC geometry or identifier helper unavailable"
);
66
return
false
;
67
}
68
SG::ReadHandleKey<TgcDigitContainer>
key{
text
().toStdString()};
69
if
(key.initialize().isFailure())
70
return
false
;
71
SG::ReadHandle<TgcDigitContainer>
container(key, Gaudi::Hive::currentContext());
72
if
(!container.isValid()) {
73
message
(
"Could not retrieve TGC digit container "
+
text
());
74
return
false
;
75
}
76
unsigned
skipped = 0;
77
for
(
const
auto
* collection : *container) {
78
if
(!collection)
79
continue
;
80
for
(
const
TgcDigit
* digit : *collection) {
81
if
(!digit || !helper->valid(digit->identify()) ||
82
!manager->getTgcReadoutElement(digit->identify())) {
83
++skipped;
84
continue
;
85
}
86
addHandle
(
new
VP1RawDataHandle_TGC_Digit
(
this
, digit));
87
}
88
}
89
if
(skipped)
90
message
(QString(
"Skipped %1 TGC digits with invalid identifiers or missing geometry"
).arg(skipped));
91
return
true
;
92
}
93
94
bool
VP1RawDataColl_TGC_Digit::cut
(
VP1RawDataHandleBase
* handle)
95
{
96
const
auto
* digit =
static_cast<
const
VP1RawDataHandle_TGC_Digit
*
>
(handle);
97
return
m_cuts
->accepts(digit->isStrip(), digit->bcTag());
98
}
99
100
void
VP1RawDataColl_TGC_Digit::setTgcShowStrips
(
bool
enabled)
101
{
102
if
(
m_cuts
->showStrips == enabled)
103
return
;
104
m_cuts
->showStrips = enabled;
105
if
(enabled)
106
recheckCutStatusOfAllNotVisibleHandles
();
107
else
108
recheckCutStatusOfAllVisibleHandles
();
109
}
110
111
void
VP1RawDataColl_TGC_Digit::setTgcShowWires
(
bool
enabled)
112
{
113
if
(
m_cuts
->showWires == enabled)
114
return
;
115
m_cuts
->showWires = enabled;
116
if
(enabled)
117
recheckCutStatusOfAllNotVisibleHandles
();
118
else
119
recheckCutStatusOfAllVisibleHandles
();
120
}
121
122
void
VP1RawDataColl_TGC_Digit::setTgcShowPrevious
(
bool
enabled)
123
{
124
if
(
m_cuts
->showPrevious == enabled)
125
return
;
126
m_cuts
->showPrevious = enabled;
127
if
(enabled)
128
recheckCutStatusOfAllNotVisibleHandles
();
129
else
130
recheckCutStatusOfAllVisibleHandles
();
131
}
132
133
void
VP1RawDataColl_TGC_Digit::setTgcShowCurrent
(
bool
enabled)
134
{
135
if
(
m_cuts
->showCurrent == enabled)
136
return
;
137
m_cuts
->showCurrent = enabled;
138
if
(enabled)
139
recheckCutStatusOfAllNotVisibleHandles
();
140
else
141
recheckCutStatusOfAllVisibleHandles
();
142
}
143
144
void
VP1RawDataColl_TGC_Digit::setTgcShowNext
(
bool
enabled)
145
{
146
if
(
m_cuts
->showNext == enabled)
147
return
;
148
m_cuts
->showNext = enabled;
149
if
(enabled)
150
recheckCutStatusOfAllNotVisibleHandles
();
151
else
152
recheckCutStatusOfAllVisibleHandles
();
153
}
154
155
void
VP1RawDataColl_TGC_Digit::setTgcShowNextNext
(
bool
enabled)
156
{
157
if
(
m_cuts
->showNextNext == enabled)
158
return
;
159
m_cuts
->showNextNext = enabled;
160
if
(enabled)
161
recheckCutStatusOfAllNotVisibleHandles
();
162
else
163
recheckCutStatusOfAllVisibleHandles
();
164
}
165
166
void
VP1RawDataColl_TGC_Digit::setTgcShowUndefined
(
bool
enabled)
167
{
168
if
(
m_cuts
->showUndefined == enabled)
169
return
;
170
m_cuts
->showUndefined = enabled;
171
if
(enabled)
172
recheckCutStatusOfAllNotVisibleHandles
();
173
else
174
recheckCutStatusOfAllVisibleHandles
();
175
}
176
177
void
VP1RawDataColl_TGC_Digit::setTgcShowUnknown
(
bool
enabled)
178
{
179
if
(
m_cuts
->showUnknown == enabled)
180
return
;
181
m_cuts
->showUnknown = enabled;
182
if
(enabled)
183
recheckCutStatusOfAllNotVisibleHandles
();
184
else
185
recheckCutStatusOfAllVisibleHandles
();
186
}
MuonDetectorManager.h
ReadHandle.h
Handle class for reading from StoreGate.
TgcDigitContainer.h
TgcDigitCuts.h
VP1DetInfo.h
VP1JobConfigInfo.h
VP1MaterialButton.h
VP1RawDataColl_TGC_Digit.h
VP1RawDataCommonData.h
VP1RawDataHandle_TGC_Digit.h
VP1RawDataSysController.h
VP1SGContentsHelper.h
IVP1System
Definition
IVP1System.h:36
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
TgcDigitContainer
Use IdentifiableContainer with TgcDigitCollection.
Definition
TgcDigitContainer.h:53
TgcDigit
Definition
TgcDigit.h:21
VP1DetInfo::tgcIDHelper
static const TgcIdHelper * tgcIDHelper()
Definition
VP1DetInfo.cxx:160
VP1DetInfo::muonDetMgr
static const MuonGM::MuonDetectorManager * muonDetMgr()
Definition
VP1DetInfo.cxx:148
VP1HelperClassBase::message
void message(const QString &) const
Definition
VP1HelperClassBase.cxx:49
VP1JobConfigInfo::hasMuonGeometry
static bool hasMuonGeometry()
Definition
VP1JobConfigInfo.cxx:138
VP1MaterialButton::setMaterialParametersFromRGB
static void setMaterialParametersFromRGB(SoMaterial *m, const int r, const int g, const int b, const double &brightness=0.0, const double &transp=0.0)
Definition
VP1MaterialButton.cxx:840
VP1RawDataCollBase::recheckCutStatusOfAllNotVisibleHandles
void recheckCutStatusOfAllNotVisibleHandles()
Definition
VP1RawDataCollBase.cxx:232
VP1RawDataCollBase::recheckCutStatusOfAllVisibleHandles
void recheckCutStatusOfAllVisibleHandles()
Definition
VP1RawDataCollBase.cxx:214
VP1RawDataCollBase::VP1RawDataCollBase
VP1RawDataCollBase(VP1RawDataCommonData *, const QString &key)
Definition
VP1RawDataCollBase.cxx:43
VP1RawDataCollBase::addHandle
void addHandle(VP1RawDataHandleBase *)
Definition
VP1RawDataCollBase.cxx:152
VP1RawDataColl_TGC_Digit::load
bool load() override
Definition
VP1RawDataColl_TGC_Digit.cxx:60
VP1RawDataColl_TGC_Digit::setTgcShowNextNext
void setTgcShowNextNext(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:155
VP1RawDataColl_TGC_Digit::setTgcShowUndefined
void setTgcShowUndefined(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:166
VP1RawDataColl_TGC_Digit::~VP1RawDataColl_TGC_Digit
~VP1RawDataColl_TGC_Digit() override
VP1RawDataColl_TGC_Digit::setTgcShowWires
void setTgcShowWires(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:111
VP1RawDataColl_TGC_Digit::assignDefaultMaterial
void assignDefaultMaterial(SoMaterial *) const override
Definition
VP1RawDataColl_TGC_Digit.cxx:55
VP1RawDataColl_TGC_Digit::VP1RawDataColl_TGC_Digit
VP1RawDataColl_TGC_Digit(VP1RawDataCommonData *common, const QString &key)
Definition
VP1RawDataColl_TGC_Digit.cxx:23
VP1RawDataColl_TGC_Digit::setTgcShowUnknown
void setTgcShowUnknown(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:177
VP1RawDataColl_TGC_Digit::m_cuts
std::unique_ptr< TgcDigitCuts > m_cuts
Definition
VP1RawDataColl_TGC_Digit.h:34
VP1RawDataColl_TGC_Digit::setTgcShowCurrent
void setTgcShowCurrent(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:133
VP1RawDataColl_TGC_Digit::cut
bool cut(VP1RawDataHandleBase *) override
Definition
VP1RawDataColl_TGC_Digit.cxx:94
VP1RawDataColl_TGC_Digit::setTgcShowNext
void setTgcShowNext(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:144
VP1RawDataColl_TGC_Digit::setTgcShowStrips
void setTgcShowStrips(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:100
VP1RawDataColl_TGC_Digit::availableCollections
static QStringList availableCollections(IVP1System *)
Definition
VP1RawDataColl_TGC_Digit.cxx:18
VP1RawDataColl_TGC_Digit::setTgcShowPrevious
void setTgcShowPrevious(bool)
Definition
VP1RawDataColl_TGC_Digit.cxx:122
VP1RawDataCommonData
Definition
VP1RawDataCommonData.h:31
VP1RawDataHandleBase
Definition
VP1RawDataHandleBase.h:34
VP1RawDataHandle_TGC_Digit
Definition
VP1RawDataHandle_TGC_Digit.h:13
VP1RawDataSysController::tgcShowPreviousChanged
void tgcShowPreviousChanged(bool)
VP1RawDataSysController::tgcShowStripsChanged
void tgcShowStripsChanged(bool)
VP1RawDataSysController::tgcShowWiresChanged
void tgcShowWiresChanged(bool)
VP1RawDataSysController::tgcShowCurrentChanged
void tgcShowCurrentChanged(bool)
VP1RawDataSysController::tgcShowUndefinedChanged
void tgcShowUndefinedChanged(bool)
VP1RawDataSysController::tgcShowNextChanged
void tgcShowNextChanged(bool)
VP1RawDataSysController::tgcShowUnknownChanged
void tgcShowUnknownChanged(bool)
VP1RawDataSysController::tgcShowNextNextChanged
void tgcShowNextNextChanged(bool)
VP1SGContentsHelper
Definition
VP1SGContentsHelper.h:26
VP1SGContentsHelper::getKeys
QStringList getKeys() const
Definition
VP1SGContentsHelper.h:55
VP1StdCollection::material
SoMaterial * material() const
Definition
VP1StdCollection.cxx:220
VP1StdCollection::text
QString text() const
Definition
VP1StdCollection.cxx:132
common
Definition
common.py:1
std
STL namespace.
TgcDigitCuts
Definition
TgcDigitCuts.h:11
Generated on
for ATLAS Offline Software by
1.17.0