ATLAS Offline Software
Loading...
Searching...
No Matches
VertexCollHandle.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class VertexCollHandle //
9// //
10// Description: class for Vertex collection handles //
11// //
12// //
14
15#ifndef VP1AODSYSTEMS_VERTEXCOLLHANDLEBASE_H
16#define VP1AODSYSTEMS_VERTEXCOLLHANDLEBASE_H
17
18//Local
20#include "AODCollHandleBase.h"
21
22//VP1
23#include "VP1Base/VP1Interval.h"
24#include "VP1Base/VP1QtUtils.h"
25
26
27
28// Qt
29#include <QtGui/QColor>
30#include <QList>
31
32
33
35class VertexHandle;
36class SoSeparator;
37class SoMaterial;
40
42{
43
44 Q_OBJECT
45
46public:
47
48 //Each derived class should implement a "static QStringList
49 //availableCollections();" method, which the collection widget will
50 //use to determine the available collections.
51
53 const QString& name,
55
56 virtual void init(VP1MaterialButtonBase* matBut=0);//reimplementations must start with a call to VP1StdCollection::init.
57 virtual ~VertexCollHandle();
58
59protected:
62
63
64public:
65
66 // The button is responsible for the settings of the vertex collection, e.g. colouring, vertex size etc.
68
70 // For loading the data and resetting after each event: //
72 static QStringList availableCollections(IVP1System*);//For the collection widget.
73
74 virtual QByteArray persistifiableState() const;
75 virtual void setState(const QByteArray&);
76
77protected:
78
80 virtual bool load();
81
82 //Must be called from derived classes when filling in new track handles.
83 void hintNumberOfHandlesInEvent(unsigned);
85
86 //For iterating over track handles:
88 AODHandleBase* getNextHandle(); //Returns 0 when done.
89 QList<AODHandleBase*> getHandlesList() const;
90
91 //Override if special cuts. Remember to call base class implementation also for common cuts.
92 virtual bool cut(AODHandleBase*);//Return true if should be shown (based on various cuts), false otherwise.
93
94 //Utility (fixme: put in utility class elsewhere).
95 template <class T> void cleanupPtrContainer(T&) const;//Delete pointers and calls .clear()
96 // template <class T> void cleanupNodeContainer(T&) const;//unref's pointers and calls .clear()
97
98 void recheckCutStatus(VertexHandle*);//Call in derived classes for handles that might be effected by a change in cuts.
99
100 //Convenience methods which can be called from derived classes or
101 //the trackcollwidget (but specialised procedures might be more
102 //optimal)
103
104 virtual bool mayHaveAssociatedObjects() const { return false; }
105
106protected:
107 virtual QColor defaultColor() const { return QColor::fromRgbF(1.0f, 0.5f, 0.5f); } // light red
108
109
110private Q_SLOTS:
112
113public Q_SLOTS:
114 // void rerandomiseRandomVertexColours();
115
116
117 // setters
118 void setCutAllowedY(const VP1Interval&);
119 void setCutAllowedZ(const VP1Interval&);
120 void setCutAllowedR(const VP1Interval&);
121 void setVertexSize(int);
122
123 //getters
130
131private:
132
133 class Imp;
135
136
140 bool m_cut_y_allowall = false;
145};
146
147//Fixme: Move elsewhere:
148template <class T> void VertexCollHandle::cleanupPtrContainer(T&t) const
149{
150 typename T::iterator it(t.begin()), itE(t.end());
151 for (;it!=itE;++it)
152 delete *it;
153 t.clear();
154}
155
156#endif
157
158
159
160
AODCollHandleBase(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
const QString & name() const
void cleanupPtrContainer(T &) const
const VP1Interval & getCutAllowedZ()
virtual QColor defaultColor() const
static QStringList availableCollections(IVP1System *)
const VP1Interval & getCutAllowedY()
VertexCollHandle(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
virtual void setState(const QByteArray &)
Provide specific implementation.
AODHandleBase * getNextHandle()
virtual QByteArray persistifiableState() const
Provide specific implementation.
virtual void setupSettingsFromControllerSpecific(const AODSystemController *)
For extensions specific to this collection.
virtual bool load()
Actually load the EDM objects.
void setCutAllowedZ(const VP1Interval &)
QList< AODHandleBase * > getHandlesList() const
const VP1Interval & getCutAllowedR()
void setCutAllowedY(const VP1Interval &)
void addHandle(AODHandleBase *)
void recheckCutStatus(VertexHandle *)
void hintNumberOfHandlesInEvent(unsigned)
virtual bool cut(AODHandleBase *)
VP1Interval m_cut_allowedZ
virtual void init(VP1MaterialButtonBase *matBut=0)
const VertexCollectionSettingsButton & collSettingsButton() const
virtual bool mayHaveAssociatedObjects() const
void setCutAllowedR(const VP1Interval &)
VP1Interval m_cut_allowedY
VP1Interval m_cut_allowedR
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32