ATLAS Offline Software
Loading...
Searching...
No Matches
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
8#include "TgcDigitCuts.h"
12#include "VP1Utils/VP1DetInfo.h"
17
22
24 VP1RawDataCommonData* common, const QString& key)
25 : VP1RawDataCollBase(common, key), m_cuts(std::make_unique<TgcDigitCuts>())
26{
29 setTgcShowStrips(common->controller()->tgcShowStrips());
32 setTgcShowWires(common->controller()->tgcShowWires());
35 setTgcShowPrevious(common->controller()->tgcShowPrevious());
38 setTgcShowCurrent(common->controller()->tgcShowCurrent());
41 setTgcShowNext(common->controller()->tgcShowNext());
44 setTgcShowNextNext(common->controller()->tgcShowNextNext());
47 setTgcShowUndefined(common->controller()->tgcShowUndefined());
50 setTgcShowUnknown(common->controller()->tgcShowUnknown());
51}
52
54
59
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
95{
96 const auto* digit = static_cast<const VP1RawDataHandle_TGC_Digit*>(handle);
97 return m_cuts->accepts(digit->isStrip(), digit->bcTag());
98}
99
101{
102 if (m_cuts->showStrips == enabled)
103 return;
104 m_cuts->showStrips = enabled;
105 if (enabled)
107 else
109}
110
112{
113 if (m_cuts->showWires == enabled)
114 return;
115 m_cuts->showWires = enabled;
116 if (enabled)
118 else
120}
121
123{
124 if (m_cuts->showPrevious == enabled)
125 return;
126 m_cuts->showPrevious = enabled;
127 if (enabled)
129 else
131}
132
134{
135 if (m_cuts->showCurrent == enabled)
136 return;
137 m_cuts->showCurrent = enabled;
138 if (enabled)
140 else
142}
143
145{
146 if (m_cuts->showNext == enabled)
147 return;
148 m_cuts->showNext = enabled;
149 if (enabled)
151 else
153}
154
156{
157 if (m_cuts->showNextNext == enabled)
158 return;
159 m_cuts->showNextNext = enabled;
160 if (enabled)
162 else
164}
165
167{
168 if (m_cuts->showUndefined == enabled)
169 return;
170 m_cuts->showUndefined = enabled;
171 if (enabled)
173 else
175}
176
178{
179 if (m_cuts->showUnknown == enabled)
180 return;
181 m_cuts->showUnknown = enabled;
182 if (enabled)
184 else
186}
Handle class for reading from StoreGate.
Property holding a SG store/key/clid from which a ReadHandle is made.
Use IdentifiableContainer with TgcDigitCollection.
static const TgcIdHelper * tgcIDHelper()
static const MuonGM::MuonDetectorManager * muonDetMgr()
void message(const QString &) const
static bool hasMuonGeometry()
static void setMaterialParametersFromRGB(SoMaterial *m, const int r, const int g, const int b, const double &brightness=0.0, const double &transp=0.0)
void recheckCutStatusOfAllNotVisibleHandles()
VP1RawDataCollBase(VP1RawDataCommonData *, const QString &key)
void addHandle(VP1RawDataHandleBase *)
~VP1RawDataColl_TGC_Digit() override
void assignDefaultMaterial(SoMaterial *) const override
VP1RawDataColl_TGC_Digit(VP1RawDataCommonData *common, const QString &key)
std::unique_ptr< TgcDigitCuts > m_cuts
bool cut(VP1RawDataHandleBase *) override
static QStringList availableCollections(IVP1System *)
void tgcShowPreviousChanged(bool)
void tgcShowStripsChanged(bool)
void tgcShowWiresChanged(bool)
void tgcShowCurrentChanged(bool)
void tgcShowUndefinedChanged(bool)
void tgcShowNextChanged(bool)
void tgcShowUnknownChanged(bool)
void tgcShowNextNextChanged(bool)
QStringList getKeys() const
SoMaterial * material() const
QString text() const
STL namespace.