ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1PRDSystems
src
PRDCollHandle_MM.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
VP1PRDSystems/PRDCollHandle_MM.h
"
6
#include "
VP1PRDSystems/PRDHandle_MM.h
"
7
#include "
VP1PRDSystems/PRDSystemController.h
"
8
#include "
VP1PRDSystems/TouchedMuonChamberHelper.h
"
9
10
#include "
VP1Base/IVP13DSystem.h
"
11
#include <QColor>
12
13
#include "
VP1Utils/VP1JobConfigInfo.h
"
14
#include "
VP1Utils/VP1SGContentsHelper.h
"
15
#include "
MuonPrepRawData/MMPrepDataContainer.h
"
16
#include "
MuonPrepRawData/MMPrepData.h
"
17
18
//____________________________________________________________________
19
QStringList
PRDCollHandle_MM::availableCollections
(
IVP1System
*sys)
20
{
21
return
VP1JobConfigInfo::hasMuonGeometry
() ?
VP1SGContentsHelper
(sys).
getKeys
<
Muon::MMPrepDataContainer
>() : QStringList();
22
}
23
24
//____________________________________________________________________
25
class
PRDCollHandle_MM::Imp
{
26
public
:
27
PRDCollHandle_MM
*
theclass
=
nullptr
;
28
std::map<const MuonGM::MuonStation*,unsigned>
mm2stationcounter
;
29
unsigned
minHitsPerStation
= 0U;
30
VP1Interval
allowedADCValues
;
31
bool
excludeMaskedHits
=
false
;
32
bool
onlyShowActive
=
false
;
33
QString
status
;
34
bool
projectionsEnabled
=
false
;
35
int
appropriateprojection
= 0;
36
void
updateProjectionFlag
();
37
};
38
39
//____________________________________________________________________
40
PRDCollHandle_MM::PRDCollHandle_MM
(
PRDSysCommonData
* cd,
const
QString& key)
41
:
PRDCollHandleBase
(
PRDDetType
::
MM
,cd,key),
m_d
(new
Imp
)
//,
42
// m_highLightMasked(false), m_highLightADCBelow(-1), m_projection(PRDCollHandle_MM::NONE)
43
{
44
m_d
->theclass =
this
;
45
m_d
->minHitsPerStation = 0;
//If the intention is no cut, then put to 0 instead of 1.
46
m_d
->allowedADCValues =
VP1Interval
();
47
m_d
->excludeMaskedHits =
true
;
48
m_d
->onlyShowActive =
true
;
49
m_d
->projectionsEnabled =
false
;
50
m_d
->appropriateprojection = 0;
//none
51
}
52
53
//____________________________________________________________________
54
PRDCollHandle_MM::~PRDCollHandle_MM
()
55
{
56
delete
m_d
;
57
}
58
59
//____________________________________________________________________
60
QColor
PRDCollHandle_MM::defaultColor
()
const
61
{
62
return
QColor::fromRgbF( 1.0, 0.666667, 0.0);
//orange
63
}
64
65
//____________________________________________________________________
66
PRDHandleBase
*
PRDCollHandle_MM::addPRD
(
const
Trk::PrepRawData
* prd )
67
{
68
assert(
dynamic_cast<
const
Muon::MMPrepData
*
>
(prd));
69
return
new
PRDHandle_MM
(
this
,
static_cast<
const
Muon::MMPrepData
*
>
(prd));
70
}
71
72
//____________________________________________________________________
73
void
PRDCollHandle_MM::postLoadInitialisation
()
74
{
75
std::vector<PRDHandleBase*>::iterator it(
getPrdHandles
().begin()),itE(
getPrdHandles
().end());
76
std::map<const MuonGM::MuonStation*,unsigned>::iterator itStation;
77
for
(;it!=itE;++it) {
78
itStation =
m_d
->mm2stationcounter.find(
static_cast<
PRDHandle_MM
*
>
(*it)->
mm
()->
detectorElement
()->
parentMuonStation
());
79
if
(itStation!=
m_d
->mm2stationcounter.end())
80
++(itStation->second);
81
else
82
m_d
->mm2stationcounter[
static_cast<
PRDHandle_MM
*
>
(*it)->
mm
()->
detectorElement
()->
parentMuonStation
()]=1;
83
}
84
}
85
86
//____________________________________________________________________
87
void
PRDCollHandle_MM::eraseEventDataSpecific
()
88
{
89
m_d
->mm2stationcounter.clear();
90
}
91
92
//____________________________________________________________________
93
bool
PRDCollHandle_MM::cut
(
PRDHandleBase
*handlebase)
94
{
95
96
PRDHandle_MM
* handle =
static_cast<
PRDHandle_MM
*
>
(handlebase);
97
assert(handle);
98
99
// if (m_d->excludeMaskedHits) {
100
// // messageVerbose(QString("Handle status = ")+handle->driftCircleStatus()+QString(", GUI: ")+common()->controller()->mdt_cutMdtDriftCircleStatus() );
101
// if(!(handle->driftCircleStatus()==common()->controller()->mdt_cutMdtDriftCircleStatus()))
102
// return false;
103
// }
104
105
// if (!m_d->allowedADCValues.isAllR()) {
106
// if (!m_d->allowedADCValues.contains(handle->ADC()))
107
// return false;
108
// }
109
110
if
(
m_d
->minHitsPerStation) {
111
assert(
m_d
->mm2stationcounter.find(handle->mm()->detectorElement()->parentMuonStation())!=
m_d
->mm2stationcounter.end());
112
if
(
m_d
->mm2stationcounter[handle->mm()->detectorElement()->parentMuonStation()]<
m_d
->minHitsPerStation)
113
return
false
;
114
}
115
116
// messageVerbose("PRDCollHandle_MM::cut: ");
117
if
(
m_d
->onlyShowActive) {
118
if
(!
common
()->touchedMuonChamberHelper()->isTouchedByTrack(handle->parentMuonChamberPV()))
119
return
false
;
120
}
121
122
return
true
;
123
}
124
125
//____________________________________________________________________
126
void
PRDCollHandle_MM::setupSettingsFromControllerSpecific
(
PRDSystemController
*controller)
127
{
128
connect(controller,SIGNAL(mdtMinNHitsPerStationChanged(
unsigned
)),
this
,SLOT(
setMinNHitsPerStation
(
unsigned
)));
129
setMinNHitsPerStation
(controller->
mdtMinNHitsPerStation
());
130
131
// connect(controller,SIGNAL(highLightMDTHitsByMaskChanged(bool)),this,SLOT(setHighLightByMask(bool)));
132
// setHighLightByMask(controller->highLightMDTHitsByMask());
133
134
// connect(controller,SIGNAL(highLightMDTHitsByUpperADCBoundChanged(int)),this,SLOT(setHighLightByUpperADCBound(int)));
135
// setHighLightByUpperADCBound(controller->highLightMDTHitsByUpperADCBound());
136
//
137
// connect(controller,SIGNAL(mdtAllowedADCValuesChanged(VP1Interval)),this,SLOT(setAllowedADCValues(VP1Interval)));
138
// setAllowedADCValues(controller->mdtAllowedADCValues());
139
140
// connect(controller,SIGNAL(mdtExcludeMaskedHitsChanged(bool)),this,SLOT(setExcludeMaskedHits(bool)));
141
// setExcludeMaskedHits(controller->mdtExcludeMaskedHits());
142
143
// connect(controller,SIGNAL(mdt_cutMdtDriftCircleStatusChanged(QString)),this,SLOT(setStatus(QString)));
144
// setStatus(controller->mdt_cutMdtDriftCircleStatus());
145
146
// connect(controller,SIGNAL(projectMDTHitsChanged(bool)),this,SLOT(setEnableProjections(bool)));
147
// setEnableProjections(controller->projectMDTHits());
148
149
connect(controller,SIGNAL(limitToActiveChambersChanged(
bool
)),
this
,SLOT(
setLimitToActiveChambers
(
bool
)));
150
setLimitToActiveChambers
(controller->
limitToActiveChambers
());
151
152
connect(
common
()->touchedMuonChamberHelper(),SIGNAL(
muonChambersTouchedByTracksChanged
(
void
)),
this
,SLOT(
muonChambersTouchedByTracksChanged
(
void
)));
153
}
154
155
//____________________________________________________________________
156
void
PRDCollHandle_MM::setMinNHitsPerStation
(
unsigned
minnhits)
157
{
158
if
(minnhits==1)
159
minnhits = 0;
//Since 0 and 1 gives same result, we map all 1's to 0's to avoid unnecessary cut rechecks.
160
if
(
m_d
->minHitsPerStation==minnhits)
161
return
;
162
bool
cut_relaxed = minnhits <
m_d
->minHitsPerStation;
163
m_d
->minHitsPerStation=minnhits;
164
if
(cut_relaxed)
165
recheckCutStatusOfAllNotVisibleHandles
();
166
else
167
recheckCutStatusOfAllVisibleHandles
();
168
}
169
170
// //____________________________________________________________________
171
// void PRDCollHandle_MM::setAllowedADCValues(VP1Interval newinterval)
172
// {
173
// if (m_d->allowedADCValues==newinterval)
174
// return;
175
// VP1Interval old(m_d->allowedADCValues);
176
// m_d->allowedADCValues = newinterval;
177
// if (newinterval.contains(old)) {
178
// recheckCutStatusOfAllNotVisibleHandles();//cut relaxed
179
// } else {
180
// if (old.contains(newinterval))
181
// recheckCutStatusOfAllVisibleHandles();//cut tightened
182
// else
183
// recheckCutStatusOfAllHandles();
184
// }
185
// }
186
187
// //____________________________________________________________________
188
// void PRDCollHandle_MM::setExcludeMaskedHits(bool b)
189
// {
190
// if (m_d->excludeMaskedHits==b)
191
// return;
192
// bool cut_relaxed = !b;
193
// m_d->excludeMaskedHits=b;
194
// if (cut_relaxed)
195
// recheckCutStatusOfAllNotVisibleHandles();
196
// else
197
// recheckCutStatusOfAllVisibleHandles();
198
// }
199
200
// //____________________________________________________________________
201
// void PRDCollHandle_MM::setStatus(QString b)
202
// {
203
// // messageVerbose(QString("SetStatus: ")+b);
204
// if (m_d->status==b)
205
// return;
206
// m_d->status=b;
207
// recheckCutStatusOfAllHandles();
208
// }
209
210
// //____________________________________________________________________
211
// void PRDCollHandle_MM::setHighLightByMask(bool b)
212
// {
213
// if (m_highLightMasked==b)
214
// return;
215
// m_highLightMasked=b;
216
//
217
// //Fixme: check PRDCollHandle::hasCustomHighlighting() before proceeding to loop here?.
218
//
219
// //call updateMaterial on all handles which are masked.
220
// std::vector<PRDHandleBase*>::iterator it(getPrdHandles().begin()),itE(getPrdHandles().end());
221
// for (;it!=itE;++it) {
222
// if (static_cast<PRDHandle_MM*>(*it)-> masked())
223
// (*it)->updateMaterial();
224
// }
225
// }
226
227
// //____________________________________________________________________
228
// void PRDCollHandle_MM::setHighLightByUpperADCBound(int bound)
229
// {
230
// if (bound<-1)
231
// bound = -1;//Since all negative gives same result, we map all those to -1 to avoid unnecessary rechecks.
232
// if (m_highLightADCBelow==bound)
233
// return;
234
//
235
// int low=std::min(m_highLightADCBelow,bound);
236
// int high=std::max(m_highLightADCBelow,bound);
237
// m_highLightADCBelow=bound;
238
//
239
// //Fixme: check PRDCollHandle::hasCustomHighlighting() before proceeding to loop here?.
240
//
241
// //call updateMaterial on all handles which are between the former and present values of the bound.
242
// std::vector<PRDHandleBase*>::iterator it(getPrdHandles().begin()),itE(getPrdHandles().end());
243
// int adc;
244
// for (;it!=itE;++it) {
245
// adc = static_cast<PRDHandle_MM*>(*it)->ADC();
246
// if (adc>=low&&adc<=high)
247
// (*it)->updateMaterial();
248
// }
249
// }
250
251
// //____________________________________________________________________
252
// void PRDCollHandle_MM::setEnableProjections( bool b )
253
// {
254
// if (m_d->projectionsEnabled==b)
255
// return;
256
// m_d->projectionsEnabled=b;
257
// m_d->updateProjectionFlag();
258
// }
259
//
260
// //____________________________________________________________________
261
// void PRDCollHandle_MM::setAppropriateProjection( int i ) {
262
// if (m_d->appropriateprojection==i)
263
// return;
264
// m_d->appropriateprojection=i;
265
// m_d->updateProjectionFlag();
266
// }
267
268
//____________________________________________________________________
269
void
PRDCollHandle_MM::setLimitToActiveChambers
(
bool
l)
270
{
271
messageVerbose
(
"PRDCollHandle_MM::setLimitToActiveChambers => "
+
str
(l)+
" current="
+
str
(
m_d
->onlyShowActive));
272
273
if
(
m_d
->onlyShowActive==l)
274
return
;
275
bool
cut_relaxed=(
m_d
->onlyShowActive);
276
m_d
->onlyShowActive=l;
277
if
(cut_relaxed)
278
recheckCutStatusOfAllNotVisibleHandles
();
279
else
280
recheckCutStatusOfAllVisibleHandles
();
281
}
282
283
void
PRDCollHandle_MM::muonChambersTouchedByTracksChanged
(
void
)
284
{
285
messageVerbose
(
"PRDCollHandle_MM::muonChambersTouchedByTracksChanged"
);
286
recheckCutStatusOfAllHandles
();
287
}
288
289
290
// //____________________________________________________________________
291
// void PRDCollHandle_MM::Imp::updateProjectionFlag() {
292
// PROJECTION projflag(PRDCollHandle_MM::NONE);
293
// if (projectionsEnabled) {
294
// if (appropriateprojection==1)
295
// projflag = PRDCollHandle_MM::TOTUBES;
296
// else if (appropriateprojection==2)
297
// projflag = PRDCollHandle_MM::TOCHAMBERS;
298
// }
299
//
300
// if (theclass->m_projection!=projflag) {
301
// theclass->m_projection = projflag;
302
// theclass->common()->system()->deselectAll();
303
// theclass->largeChangesBegin();
304
// std::vector<PRDHandleBase*>::iterator it(theclass->getPrdHandles().begin()),itE(theclass->getPrdHandles().end());
305
// for (;it!=itE;++it)
306
// (*it)->update3DObjects();
307
// theclass->largeChangesEnd();
308
// }
309
// }
IVP13DSystem.h
MMPrepDataContainer.h
MMPrepData.h
PRDCollHandle_MM.h
PRDHandle_MM.h
PRDSystemController.h
MM
@ MM
Definition
RegSelEnums.h:38
TouchedMuonChamberHelper.h
VP1JobConfigInfo.h
VP1SGContentsHelper.h
IVP1System
Definition
IVP1System.h:36
MuonGM::MuonReadoutElement::parentMuonStation
const MuonStation * parentMuonStation() const
Definition
MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:80
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::recheckCutStatusOfAllNotVisibleHandles
void recheckCutStatusOfAllNotVisibleHandles()
Definition
PRDCollHandleBase.cxx:603
PRDCollHandleBase::PRDCollHandleBase
PRDCollHandleBase(PRDDetType::Type, PRDSysCommonData *, const QString &key)
Definition
PRDCollHandleBase.cxx:80
PRDCollHandleBase::getPrdHandles
std::vector< PRDHandleBase * > & getPrdHandles()
Definition
PRDCollHandleBase.cxx:507
PRDCollHandleBase::recheckCutStatusOfAllHandles
void recheckCutStatusOfAllHandles()
Definition
PRDCollHandleBase.cxx:566
PRDCollHandleBase::common
PRDSysCommonData * common() const
Definition
PRDCollHandleBase.h:49
PRDCollHandleBase::recheckCutStatusOfAllVisibleHandles
void recheckCutStatusOfAllVisibleHandles()
Definition
PRDCollHandleBase.cxx:585
PRDCollHandle_MM::Imp
Definition
PRDCollHandle_MM.cxx:25
PRDCollHandle_MM::Imp::minHitsPerStation
unsigned minHitsPerStation
Definition
PRDCollHandle_MM.cxx:29
PRDCollHandle_MM::Imp::onlyShowActive
bool onlyShowActive
Definition
PRDCollHandle_MM.cxx:32
PRDCollHandle_MM::Imp::status
QString status
Definition
PRDCollHandle_MM.cxx:33
PRDCollHandle_MM::Imp::excludeMaskedHits
bool excludeMaskedHits
Definition
PRDCollHandle_MM.cxx:31
PRDCollHandle_MM::Imp::updateProjectionFlag
void updateProjectionFlag()
PRDCollHandle_MM::Imp::appropriateprojection
int appropriateprojection
Definition
PRDCollHandle_MM.cxx:35
PRDCollHandle_MM::Imp::mm2stationcounter
std::map< const MuonGM::MuonStation *, unsigned > mm2stationcounter
Definition
PRDCollHandle_MM.cxx:28
PRDCollHandle_MM::Imp::projectionsEnabled
bool projectionsEnabled
Definition
PRDCollHandle_MM.cxx:34
PRDCollHandle_MM::Imp::allowedADCValues
VP1Interval allowedADCValues
Definition
PRDCollHandle_MM.cxx:30
PRDCollHandle_MM::Imp::theclass
PRDCollHandle_MM * theclass
Definition
PRDCollHandle_MM.cxx:27
PRDCollHandle_MM::postLoadInitialisation
virtual void postLoadInitialisation() override
Definition
PRDCollHandle_MM.cxx:73
PRDCollHandle_MM::availableCollections
static QStringList availableCollections(IVP1System *)
Definition
PRDCollHandle_MM.cxx:19
PRDCollHandle_MM::addPRD
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *) override
Definition
PRDCollHandle_MM.cxx:66
PRDCollHandle_MM::cut
virtual bool cut(PRDHandleBase *) override
Definition
PRDCollHandle_MM.cxx:93
PRDCollHandle_MM::defaultColor
virtual QColor defaultColor() const override
Definition
PRDCollHandle_MM.cxx:60
PRDCollHandle_MM::setupSettingsFromControllerSpecific
virtual void setupSettingsFromControllerSpecific(PRDSystemController *) override
Definition
PRDCollHandle_MM.cxx:126
PRDCollHandle_MM::muonChambersTouchedByTracksChanged
void muonChambersTouchedByTracksChanged(void)
Inform this handle that it might need to recheck cuts.
Definition
PRDCollHandle_MM.cxx:283
PRDCollHandle_MM::m_d
Imp * m_d
Definition
PRDCollHandle_MM.h:57
PRDCollHandle_MM::setLimitToActiveChambers
void setLimitToActiveChambers(bool)
Definition
PRDCollHandle_MM.cxx:269
PRDCollHandle_MM::PRDCollHandle_MM
PRDCollHandle_MM(PRDSysCommonData *, const QString &key)
Definition
PRDCollHandle_MM.cxx:40
PRDCollHandle_MM::eraseEventDataSpecific
virtual void eraseEventDataSpecific() override
Definition
PRDCollHandle_MM.cxx:87
PRDCollHandle_MM::setMinNHitsPerStation
void setMinNHitsPerStation(unsigned)
Definition
PRDCollHandle_MM.cxx:156
PRDCollHandle_MM::~PRDCollHandle_MM
virtual ~PRDCollHandle_MM()
Definition
PRDCollHandle_MM.cxx:54
PRDDetType
Definition
PRDDetTypes.h:10
PRDHandleBase
Definition
PRDHandleBase.h:35
PRDHandle_MM
Definition
PRDHandle_MM.h:12
PRDHandle_MM::mm
const Muon::MMPrepData * mm() const
Definition
PRDHandle_MM.h:24
PRDSysCommonData
Definition
PRDSysCommonData.h:35
PRDSystemController
Definition
PRDSystemController.h:34
PRDSystemController::mdtMinNHitsPerStation
unsigned mdtMinNHitsPerStation() const
Definition
PRDSystemController.cxx:434
PRDSystemController::limitToActiveChambers
bool limitToActiveChambers() const
Definition
PRDSystemController.cxx:463
Trk::PrepRawData
Definition
PrepRawData.h:62
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition
VP1HelperClassBase.cxx:78
VP1Interval
Definition
VP1Interval.h:23
VP1JobConfigInfo::hasMuonGeometry
static bool hasMuonGeometry()
Definition
VP1JobConfigInfo.cxx:138
VP1SGContentsHelper
Definition
VP1SGContentsHelper.h:26
VP1SGContentsHelper::getKeys
QStringList getKeys() const
Definition
VP1SGContentsHelper.h:55
Muon::MMPrepDataContainer
MuonPrepDataContainerT< MMPrepData > MMPrepDataContainer
Definition
MuonPrepDataContainer.h:99
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0