ATLAS Offline Software
Loading...
Searching...
No Matches
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
9#include <QColor>
10
14
15//____________________________________________________________________
17{
18 return VP1JobConfigInfo::hasSCTGeometry() ? VP1SGContentsHelper(sys).getKeys<InDet::SCT_ClusterContainer>() : QStringList();
19}
20
21//____________________________________________________________________
23public:
24 std::set<const InDetDD::SiDetectorElement*> touchedelements;
25
26 PRDCommonFlags::InDetPartsFlags indetpartsflags;
28};
29
30//____________________________________________________________________
37
38//____________________________________________________________________
43
44//____________________________________________________________________
46{
47 return QColor::fromRgbF(1.0, 1.0, 0.5 );//light yellow
48}
49
50//____________________________________________________________________
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//____________________________________________________________________
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//____________________________________________________________________
68{
69 m_d->touchedelements.clear();
70}
71
72//____________________________________________________________________
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//____________________________________________________________________
97void 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
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 }
126
127}
128
129//____________________________________________________________________
131{
132 if (m_d->excludeisolatedclusters==excludeisolated)
133 return;
134 m_d->excludeisolatedclusters=excludeisolated;
135 if (excludeisolated)
137 else
139}
140
141//____________________________________________________________________
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)));
149}
const SiDetectorElement * otherSide() const
Useful for SCT only.
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...
void recheckCutStatusOfAllNotVisibleHandles()
PRDCollHandleBase(PRDDetType::Type, PRDSysCommonData *, const QString &key)
std::vector< PRDHandleBase * > & getPrdHandles()
void recheckCutStatus(PRDHandleBase *)
void recheckCutStatusOfAllVisibleHandles()
PRDCommonFlags::InDetPartsFlags indetpartsflags
std::set< const InDetDD::SiDetectorElement * > touchedelements
void setPartsFlags(PRDCommonFlags::InDetPartsFlags)
virtual void eraseEventDataSpecific() override
virtual void setupSettingsFromControllerSpecific(PRDSystemController *) override
virtual QColor defaultColor() const override
virtual bool cut(PRDHandleBase *) override
static QStringList availableCollections(IVP1System *)
void setExcludeIsolatedClusters(bool)
virtual void postLoadInitialisation() override
PRDCollHandle_SCT(PRDSysCommonData *, const QString &key)
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *) override
bool isPositiveZ() const
const InDet::SCT_Cluster * cluster() const
bool isBarrel() const
PRDCommonFlags::InDetPartsFlags inDetPartsFlags() const
bool sctExcludeIsolatedClusters() const
static bool hasSCTGeometry()
QStringList getKeys() const
virtual void largeChangesEnd()
virtual void largeChangesBegin()