ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1PRDSystems
src
PRDCollHandle_SCT.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_SCT.h
"
6
#include "
VP1PRDSystems/PRDHandle_SCT.h
"
7
#include "
VP1PRDSystems/PRDSystemController.h
"
8
#include "
InDetPrepRawData/SCT_Cluster.h
"
9
#include <QColor>
10
11
#include "
VP1Utils/VP1JobConfigInfo.h
"
12
#include "
VP1Utils/VP1SGContentsHelper.h
"
13
#include "
InDetPrepRawData/SCT_ClusterContainer.h
"
14
15
//____________________________________________________________________
16
QStringList
PRDCollHandle_SCT::availableCollections
(
IVP1System
*sys)
17
{
18
return
VP1JobConfigInfo::hasSCTGeometry
() ?
VP1SGContentsHelper
(sys).
getKeys
<InDet::SCT_ClusterContainer>() : QStringList();
19
}
20
21
//____________________________________________________________________
22
class
PRDCollHandle_SCT::Imp
{
23
public
:
24
std::set<const InDetDD::SiDetectorElement*>
touchedelements
;
25
26
PRDCommonFlags::InDetPartsFlags
indetpartsflags
;
27
bool
excludeisolatedclusters
=
false
;
28
};
29
30
//____________________________________________________________________
31
PRDCollHandle_SCT::PRDCollHandle_SCT
(
PRDSysCommonData
* cd,
const
QString& key)
32
:
PRDCollHandleBase
(
PRDDetType
::
SCT
,cd,key),
m_d
(new
Imp
)
33
{
34
m_d
->indetpartsflags = (
PRDCommonFlags::BarrelPositive
|
PRDCommonFlags::BarrelNegative
|
PRDCommonFlags::EndCapPositive
|
PRDCommonFlags::EndCapNegative
);
35
m_d
->excludeisolatedclusters =
true
;
36
}
37
38
//____________________________________________________________________
39
PRDCollHandle_SCT::~PRDCollHandle_SCT
()
40
{
41
delete
m_d
;
42
}
43
44
//____________________________________________________________________
45
QColor
PRDCollHandle_SCT::defaultColor
()
const
46
{
47
return
QColor::fromRgbF(1.0, 1.0, 0.5 );
//light yellow
48
}
49
50
//____________________________________________________________________
51
PRDHandleBase
*
PRDCollHandle_SCT::addPRD
(
const
Trk::PrepRawData
* prd )
52
{
53
assert(
dynamic_cast<
const
InDet::SCT_Cluster
*
>
(prd));
54
return
new
PRDHandle_SCT
(
this
,
static_cast<
const
InDet::SCT_Cluster
*
>
(prd));
55
}
56
57
//____________________________________________________________________
58
void
PRDCollHandle_SCT::postLoadInitialisation
()
59
{
60
std::vector<PRDHandleBase*>::iterator it(
getPrdHandles
().begin()),itE(
getPrdHandles
().end());
61
for
(;it!=itE;++it)
62
m_d
->touchedelements.insert(
static_cast<
PRDHandle_SCT
*
>
(*it)->
cluster
()->
detectorElement
());
63
m_d
->touchedelements.insert(0);
//To always show clusters whose elements have no otherSide() pointer.
64
}
65
66
//____________________________________________________________________
67
void
PRDCollHandle_SCT::eraseEventDataSpecific
()
68
{
69
m_d
->touchedelements.clear();
70
}
71
72
//____________________________________________________________________
73
bool
PRDCollHandle_SCT::cut
(
PRDHandleBase
*handlebase)
74
{
75
PRDHandle_SCT
* handle =
static_cast<
PRDHandle_SCT
*
>
(handlebase);
76
assert(handle);
77
78
if
(
m_d
->indetpartsflags!=
PRDCommonFlags::All
) {
79
if
(handle->isBarrel()) {
80
if
(!(handle->isPositiveZ()?(
m_d
->indetpartsflags&
PRDCommonFlags::BarrelPositive
):(
m_d
->indetpartsflags&
PRDCommonFlags::BarrelNegative
)))
81
return
false
;
82
}
else
{
83
if
(!(handle->isPositiveZ()?(
m_d
->indetpartsflags&
PRDCommonFlags::EndCapPositive
):(
m_d
->indetpartsflags&
PRDCommonFlags::EndCapNegative
)))
84
return
false
;
85
}
86
}
87
88
if
(
m_d
->excludeisolatedclusters) {
89
if
(!
m_d
->touchedelements.count(handle->cluster()->detectorElement()->otherSide()))
90
return
false
;
91
}
92
93
return
true
;
94
}
95
96
//____________________________________________________________________
97
void
PRDCollHandle_SCT::setPartsFlags
(PRDCommonFlags::InDetPartsFlags flags ) {
98
//NB: The code is this method is very similar in PRDCollHandle_Pixel::setPartsFlags, PRDCollHandle_SCT::setPartsFlags,
99
//PRDCollHandle_TRT::setPartsFlags and and PRDCollHandle_SpacePoints::setPartsFlags
100
//Fixme: base decision to recheck on visibility also!
101
102
if
(
m_d
->indetpartsflags==flags)
103
return
;
104
105
bool
barrelPosChanged = (
m_d
->indetpartsflags&
PRDCommonFlags::BarrelPositive
)!=(flags&
PRDCommonFlags::BarrelPositive
);
106
bool
barrelNegChanged = (
m_d
->indetpartsflags&
PRDCommonFlags::BarrelNegative
)!=(flags&
PRDCommonFlags::BarrelNegative
);
107
bool
endcapPosChanged = (
m_d
->indetpartsflags&
PRDCommonFlags::EndCapPositive
)!=(flags&
PRDCommonFlags::EndCapPositive
);
108
bool
endcapNegChanged = (
m_d
->indetpartsflags&
PRDCommonFlags::EndCapNegative
)!=(flags&
PRDCommonFlags::EndCapNegative
);
109
bool
barrelChanged = (barrelPosChanged || barrelNegChanged);
110
bool
endcapChanged = (endcapPosChanged || endcapNegChanged);
111
m_d
->indetpartsflags=flags;
112
113
largeChangesBegin
();
114
std::vector<PRDHandleBase*>::iterator it(
getPrdHandles
().begin()),itE(
getPrdHandles
().end());
115
for
(;it!=itE;++it) {
116
PRDHandle_SCT
* handle =
static_cast<
PRDHandle_SCT
*
>
(*it);
117
if
(handle->isBarrel()) {
118
if
(barrelChanged&&(handle->isPositiveZ()?barrelPosChanged:barrelNegChanged))
119
recheckCutStatus
(handle);
120
}
else
{
121
if
(endcapChanged&&(handle->isPositiveZ()?endcapPosChanged:endcapNegChanged))
122
recheckCutStatus
(handle);
123
}
124
}
125
largeChangesEnd
();
126
127
}
128
129
//____________________________________________________________________
130
void
PRDCollHandle_SCT::setExcludeIsolatedClusters
(
bool
excludeisolated)
131
{
132
if
(
m_d
->excludeisolatedclusters==excludeisolated)
133
return
;
134
m_d
->excludeisolatedclusters=excludeisolated;
135
if
(excludeisolated)
136
recheckCutStatusOfAllVisibleHandles
();
137
else
138
recheckCutStatusOfAllNotVisibleHandles
();
139
}
140
141
//____________________________________________________________________
142
void
PRDCollHandle_SCT::setupSettingsFromControllerSpecific
(
PRDSystemController
*controller)
143
{
144
connect(controller,SIGNAL(inDetPartsFlagsChanged(PRDCommonFlags::InDetPartsFlags)),
this
,SLOT(
setPartsFlags
(PRDCommonFlags::InDetPartsFlags)));
145
setPartsFlags
(controller->
inDetPartsFlags
());
146
147
connect(controller,SIGNAL(sctExcludeIsolatedClustersChanged(
bool
)),
this
,SLOT(
setExcludeIsolatedClusters
(
bool
)));
148
setExcludeIsolatedClusters
(controller->
sctExcludeIsolatedClusters
());
149
}
PRDCollHandle_SCT.h
PRDHandle_SCT.h
PRDSystemController.h
SCT_ClusterContainer.h
SCT_Cluster.h
VP1JobConfigInfo.h
VP1SGContentsHelper.h
IVP1System
Definition
IVP1System.h:36
InDet::SCT_Cluster
Definition
SCT_Cluster.h:34
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
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::recheckCutStatus
void recheckCutStatus(PRDHandleBase *)
Definition
PRDCollHandleBase.cxx:519
PRDCollHandleBase::recheckCutStatusOfAllVisibleHandles
void recheckCutStatusOfAllVisibleHandles()
Definition
PRDCollHandleBase.cxx:585
PRDCollHandle_SCT::Imp
Definition
PRDCollHandle_SCT.cxx:22
PRDCollHandle_SCT::Imp::indetpartsflags
PRDCommonFlags::InDetPartsFlags indetpartsflags
Definition
PRDCollHandle_SCT.cxx:26
PRDCollHandle_SCT::Imp::excludeisolatedclusters
bool excludeisolatedclusters
Definition
PRDCollHandle_SCT.cxx:27
PRDCollHandle_SCT::Imp::touchedelements
std::set< const InDetDD::SiDetectorElement * > touchedelements
Definition
PRDCollHandle_SCT.cxx:24
PRDCollHandle_SCT::setPartsFlags
void setPartsFlags(PRDCommonFlags::InDetPartsFlags)
Definition
PRDCollHandle_SCT.cxx:97
PRDCollHandle_SCT::eraseEventDataSpecific
virtual void eraseEventDataSpecific() override
Definition
PRDCollHandle_SCT.cxx:67
PRDCollHandle_SCT::setupSettingsFromControllerSpecific
virtual void setupSettingsFromControllerSpecific(PRDSystemController *) override
Definition
PRDCollHandle_SCT.cxx:142
PRDCollHandle_SCT::defaultColor
virtual QColor defaultColor() const override
Definition
PRDCollHandle_SCT.cxx:45
PRDCollHandle_SCT::~PRDCollHandle_SCT
virtual ~PRDCollHandle_SCT()
Definition
PRDCollHandle_SCT.cxx:39
PRDCollHandle_SCT::cut
virtual bool cut(PRDHandleBase *) override
Definition
PRDCollHandle_SCT.cxx:73
PRDCollHandle_SCT::m_d
Imp * m_d
Definition
PRDCollHandle_SCT.h:39
PRDCollHandle_SCT::availableCollections
static QStringList availableCollections(IVP1System *)
Definition
PRDCollHandle_SCT.cxx:16
PRDCollHandle_SCT::setExcludeIsolatedClusters
void setExcludeIsolatedClusters(bool)
Definition
PRDCollHandle_SCT.cxx:130
PRDCollHandle_SCT::postLoadInitialisation
virtual void postLoadInitialisation() override
Definition
PRDCollHandle_SCT.cxx:58
PRDCollHandle_SCT::PRDCollHandle_SCT
PRDCollHandle_SCT(PRDSysCommonData *, const QString &key)
Definition
PRDCollHandle_SCT.cxx:31
PRDCollHandle_SCT::addPRD
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *) override
Definition
PRDCollHandle_SCT.cxx:51
PRDCommonFlags::BarrelPositive
@ BarrelPositive
Definition
PRDCommonFlags.h:24
PRDCommonFlags::All
@ All
Definition
PRDCommonFlags.h:30
PRDCommonFlags::BarrelNegative
@ BarrelNegative
Definition
PRDCommonFlags.h:25
PRDCommonFlags::EndCapPositive
@ EndCapPositive
Definition
PRDCommonFlags.h:26
PRDCommonFlags::EndCapNegative
@ EndCapNegative
Definition
PRDCommonFlags.h:27
PRDDetType
Definition
PRDDetTypes.h:10
PRDHandleBase
Definition
PRDHandleBase.h:35
PRDHandle_SCT
Definition
PRDHandle_SCT.h:13
PRDHandle_SCT::cluster
const InDet::SCT_Cluster * cluster() const
Definition
PRDHandle_SCT.h:22
PRDSysCommonData
Definition
PRDSysCommonData.h:35
PRDSystemController
Definition
PRDSystemController.h:34
PRDSystemController::inDetPartsFlags
PRDCommonFlags::InDetPartsFlags inDetPartsFlags() const
Definition
PRDSystemController.cxx:378
PRDSystemController::sctExcludeIsolatedClusters
bool sctExcludeIsolatedClusters() const
Definition
PRDSystemController.cxx:428
Trk::PrepRawData
Definition
PrepRawData.h:62
VP1JobConfigInfo::hasSCTGeometry
static bool hasSCTGeometry()
Definition
VP1JobConfigInfo.cxx:132
VP1SGContentsHelper
Definition
VP1SGContentsHelper.h:26
VP1SGContentsHelper::getKeys
QStringList getKeys() const
Definition
VP1SGContentsHelper.h:55
VP1StdCollection::largeChangesEnd
virtual void largeChangesEnd()
Definition
VP1StdCollection.cxx:239
VP1StdCollection::largeChangesBegin
virtual void largeChangesBegin()
Definition
VP1StdCollection.cxx:228
SCT
Definition
SCT_ChipUtils.h:14
Generated on
for ATLAS Offline Software by
1.17.0