ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataColl_sTGC_RDO.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
7// //
8// Implementation of class VP1RawDataColl_sTGC_RDO //
9// //
10// Author: Riccardo Maria BIANCHI <riccardo.maria.bianchi>
11// Initial version: December 2024 //
12// //
14
19
24
26
28
29//____________________________________________________________________
34
35//____________________________________________________________________
48
49
50//____________________________________________________________________
52 : VP1RawDataCollBase(common,key), m_d(new Imp)
53{
54 connect(common->controller(), SIGNAL(stgcAllowedChargeChanged(const VP1Interval&)),
55 this, SLOT(setStgcAllowedCharge(const VP1Interval&)));
56 setStgcAllowedCharge(common->controller()->stgcAllowedCharge());
57 connect(common->controller(), SIGNAL(stgcAllowedTimeChanged(const VP1Interval&)),
58 this, SLOT(setStgcAllowedTime(const VP1Interval&)));
59 setStgcAllowedTime(common->controller()->stgcAllowedTime());
60 connect(common->controller(), SIGNAL(stgcShowPadsChanged(bool)),
61 this, SLOT(setStgcShowPads(bool)));
62 setStgcShowPads(common->controller()->stgcShowPads());
63 connect(common->controller(), SIGNAL(stgcShowStripsChanged(bool)),
64 this, SLOT(setStgcShowStrips(bool)));
65 setStgcShowStrips(common->controller()->stgcShowStrips());
66 connect(common->controller(), SIGNAL(stgcShowWiresChanged(bool)),
67 this, SLOT(setStgcShowWires(bool)));
68 setStgcShowWires(common->controller()->stgcShowWires());
69 connect(common->controller(), SIGNAL(stgcExcludeDeadChanged(bool)),
70 this, SLOT(setStgcExcludeDead(bool)));
71 setStgcExcludeDead(common->controller()->stgcExcludeDead());
72 connect(common->controller(), SIGNAL(stgcExcludePileupChanged(bool)),
73 this, SLOT(setStgcExcludePileup(bool)));
74 setStgcExcludePileup(common->controller()->stgcExcludePileup());
75
76}
77
78//____________________________________________________________________
83
84//____________________________________________________________________
86{
87 VP1MaterialButton::setMaterialParameters( m, 0.42, 0.96, 0.16, 0.1 );
88}
89
90//____________________________________________________________________
93 message("Muon geometry not configured in job");
94 return false;
95 }
96
97 // get the detMgr
98 // TODO: we should probably simplify by moving to:
99 // const MuonGM::MuonDetectorManager * detmgr = VP1DetInfo::muonDetMgr();
101 "MuonDetectorManager"};
102 detMgrKey.initialize().ignore();
104
105 SG::ReadHandleKey<sTgcDigitContainer> digitContainerKey{"sTGC_DIGITS"};
106 digitContainerKey.initialize().ignore();
107
108 const EventContext& ctx = Gaudi::Hive::currentContext();
109
110 SG::ReadHandle<sTgcDigitContainer> container(digitContainerKey, ctx);
111 if (!container.isValid()) {
112 std::cout << "Could not find sTgcDigitContainer called " << container.name()
113 << " in store " << container.store() << std::endl;
114 }
115
116 // Iterate on the collections
117 for (const sTgcDigitCollection* coll : *container) {
119 for (const sTgcDigit* digit : *coll) {
120 const Identifier digitId{digit->identify()};
121
122 // example from Johannes
123 /*
124 mdtReadoutElement = detMgr->getMdtReadoutElement(digitId);
125 const Amg::Vector3D tubePos = mdtReadoutElement->tubePos(digitId);
126 */
127
128 if (digit)
129 addHandle(new VP1RawDataHandle_sTGC_RDO(this, digit));
130 }
131 }
132
133 // recheckCutStatusOfAllHandles();
134 return true;
135}
136
137//____________________________________________________________________
139{
140 const auto* digit = static_cast<const VP1RawDataHandle_sTGC_RDO*>(handle);
141 if ((m_d->stgcExcludeDead && digit->isDead()) ||
142 (m_d->stgcExcludePileup && digit->isPileup()))
143 return false;
144 if (!m_d->stgcShowPads && !m_d->stgcShowStrips && !m_d->stgcShowWires)
145 return false;
146 if (!(m_d->stgcShowPads && m_d->stgcShowStrips && m_d->stgcShowWires)) {
147 const int type = digit->channelType();
148 if (!((type == sTgcIdHelper::Pad && m_d->stgcShowPads) ||
149 (type == sTgcIdHelper::Strip && m_d->stgcShowStrips) ||
150 (type == sTgcIdHelper::Wire && m_d->stgcShowWires)))
151 return false;
152 }
153 return m_d->stgcAllowedCharge.contains(digit->amplitude()) &&
154 m_d->stgcAllowedTime.contains(digit->time());
155}
156
158{
159 if (m_d->stgcAllowedCharge == range)
160 return;
161 m_d->stgcAllowedCharge = range;
163}
164
166{
167 if (m_d->stgcAllowedTime == range)
168 return;
169 m_d->stgcAllowedTime = range;
171}
172
174{
175 if (m_d->stgcShowPads == enabled)
176 return;
177 m_d->stgcShowPads = enabled;
179}
180
182{
183 if (m_d->stgcShowStrips == enabled)
184 return;
185 m_d->stgcShowStrips = enabled;
187}
188
190{
191 if (m_d->stgcShowWires == enabled)
192 return;
193 m_d->stgcShowWires = enabled;
195}
196
198{
199 if (m_d->stgcExcludeDead == enabled)
200 return;
201 m_d->stgcExcludeDead = enabled;
203}
204
206{
207 if (m_d->stgcExcludePileup == enabled)
208 return;
209 m_d->stgcExcludePileup = enabled;
211}
StatusCode initialize(bool used=true)
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void message(const QString &) const
static bool hasMuonGeometry()
static void setMaterialParameters(SoMaterial *m, const QColor &, const double &brightness=0.0, const double &transp=0.0)
VP1RawDataCollBase(VP1RawDataCommonData *, const QString &key)
void addHandle(VP1RawDataHandleBase *)
static QStringList availableCollections(IVP1System *)
VP1RawDataColl_sTGC_RDO(VP1RawDataCommonData *, const QString &key)
void setStgcAllowedTime(const VP1Interval &)
bool cut(VP1RawDataHandleBase *)
void setStgcAllowedCharge(const VP1Interval &)
void assignDefaultMaterial(SoMaterial *) const
QStringList getKeys() const
Use IdentifiableContainer with sTgcDigitCollection.