ATLAS Offline Software
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 
34 class AODSysCommonData;
35 class VertexHandle;
36 class SoSeparator;
37 class SoMaterial;
40 
42 {
43 
44  Q_OBJECT
45 
46 public:
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 
59 protected:
62 
63 
64 public:
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 
77 protected:
78 
80  virtual bool load();
81 
82  //Must be called from derived classes when filling in new track handles.
83  void hintNumberOfHandlesInEvent(unsigned);
84  void addHandle(AODHandleBase*);
85 
86  //For iterating over track handles:
87  void handleIterationBegin();
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 
106 protected:
107  virtual QColor defaultColor() const { return QColor::fromRgbF(1.0f, 0.5f, 0.5f); } // light red
108 
109 
110 private Q_SLOTS:
111  void resetCachedValuesCuts();
112 
113 public 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
127  bool getYAllowall() {return m_cut_y_allowall; };
128  bool getZAllowall() {return m_cut_z_allowall; };
129  bool getRAllowall() {return m_cut_r_allowall; };
130 
131 private:
132 
133  class Imp;
134  Imp * m_d;
135 
136 
140  bool m_cut_y_allowall = false;
143  bool m_cut_ry_allwillfail = false;
145 };
146 
147 //Fixme: Move elsewhere:
148 template <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 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VertexCollHandle::Imp
Definition: VertexCollHandle.cxx:65
VertexCollectionSettingsButton
Definition: VertexCollectionSettingsButton.h:14
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
VertexCollHandle::getCutAllowedY
const VP1Interval & getCutAllowedY()
Definition: VertexCollHandle.h:124
VertexCollHandle::m_cut_ry_allwillfail
bool m_cut_ry_allwillfail
Definition: VertexCollHandle.h:143
VertexCollHandle::defaultColor
virtual QColor defaultColor() const
Definition: VertexCollHandle.h:107
VertexCollHandle::getYAllowall
bool getYAllowall()
Definition: VertexCollHandle.h:127
VertexCollHandle::getCutAllowedZ
const VP1Interval & getCutAllowedZ()
Definition: VertexCollHandle.h:125
AODHandleBase
Definition: AODHandleBase.h:43
AODCollHandleBase
Base class for all AOD object collections This class primarily handles setting up the interface,...
Definition: AODCollHandleBase.h:57
VertexCollHandle::persistifiableState
virtual QByteArray persistifiableState() const
Provide specific implementation.
Definition: VertexCollHandle.cxx:463
ObjectType
ObjectType
Definition: BaseObject.h:11
VertexCollHandle::collSettingsButton
const VertexCollectionSettingsButton & collSettingsButton() const
Definition: VertexCollHandle.cxx:190
AODSysCommonData
Definition: AODSysCommonData.h:42
AODSystemController.h
skel.it
it
Definition: skel.GENtoEVGEN.py:423
VP1QtUtils.h
VertexCollHandle::setVertexSize
void setVertexSize(int)
Definition: VertexCollHandle.cxx:435
VertexCollHandle::resetCachedValuesCuts
void resetCachedValuesCuts()
Definition: VertexCollHandle.cxx:177
VertexCollHandle::VertexCollHandle
VertexCollHandle(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
Definition: VertexCollHandle.cxx:93
VertexCollHandle::getZAllowall
bool getZAllowall()
Definition: VertexCollHandle.h:128
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VertexCollHandle::recheckCutStatus
void recheckCutStatus(VertexHandle *)
VertexCollHandle::m_cut_allowedZ
VP1Interval m_cut_allowedZ
Definition: VertexCollHandle.h:139
VertexCollHandle::setCutAllowedR
void setCutAllowedR(const VP1Interval &)
Definition: VertexCollHandle.cxx:358
VertexCollHandle::hintNumberOfHandlesInEvent
void hintNumberOfHandlesInEvent(unsigned)
Definition: VertexCollHandle.cxx:325
VertexCollHandle::load
virtual bool load()
Actually load the EDM objects.
Definition: VertexCollHandle.cxx:198
TruthTest.itE
itE
Definition: TruthTest.py:25
VertexCollHandle::getCutAllowedR
const VP1Interval & getCutAllowedR()
Definition: VertexCollHandle.h:126
VertexCollHandle::cut
virtual bool cut(AODHandleBase *)
Definition: VertexCollHandle.cxx:266
VertexCollHandle::m_cut_z_allowall
bool m_cut_z_allowall
Definition: VertexCollHandle.h:142
VertexCollHandle::setCutAllowedZ
void setCutAllowedZ(const VP1Interval &)
Definition: VertexCollHandle.cxx:411
VertexCollHandle::m_cut_y_allowall
bool m_cut_y_allowall
Definition: VertexCollHandle.h:140
VertexCollHandle::addHandle
void addHandle(AODHandleBase *)
Definition: VertexCollHandle.cxx:331
IVP1System
Definition: IVP1System.h:36
VertexCollHandle::setupSettingsFromControllerSpecific
virtual void setupSettingsFromControllerSpecific(const AODSystemController *)
For extensions specific to this collection.
Definition: VertexCollHandle.cxx:161
VP1ExtraSepLayerHelper
Definition: VP1ExtraSepLayerHelper.h:22
AODSystemController
Definition: AODSystemController.h:43
VertexCollHandle::m_cut_rz_allwillfail
bool m_cut_rz_allwillfail
Definition: VertexCollHandle.h:144
VertexCollHandle::getRAllowall
bool getRAllowall()
Definition: VertexCollHandle.h:129
VP1Interval.h
VertexCollHandle::getHandlesList
QList< AODHandleBase * > getHandlesList() const
Definition: VertexCollHandle.cxx:259
VertexCollHandle::m_d
Imp * m_d
Definition: VertexCollHandle.h:133
VertexCollHandle::m_cut_allowedY
VP1Interval m_cut_allowedY
Definition: VertexCollHandle.h:137
VertexCollHandle::availableCollections
static QStringList availableCollections(IVP1System *)
Definition: VertexCollHandle.cxx:141
VertexCollHandle
Definition: VertexCollHandle.h:42
VertexCollHandle::~VertexCollHandle
virtual ~VertexCollHandle()
Definition: VertexCollHandle.cxx:119
VP1MaterialButtonBase
Definition: VP1MaterialButton.h:25
AODCollHandleBase.h
VertexCollHandle::cleanupPtrContainer
void cleanupPtrContainer(T &) const
Definition: VertexCollHandle.h:148
VertexCollHandle::handleIterationBegin
void handleIterationBegin()
Definition: VertexCollHandle.cxx:343
VertexCollHandle::setCutAllowedY
void setCutAllowedY(const VP1Interval &)
Definition: VertexCollHandle.cxx:387
VertexHandle
Definition: VertexHandle.h:39
VertexCollHandle::m_cut_r_allowall
bool m_cut_r_allowall
Definition: VertexCollHandle.h:141
VP1Interval
Definition: VP1Interval.h:23
VertexCollHandle::getNextHandle
AODHandleBase * getNextHandle()
Definition: VertexCollHandle.cxx:350
VertexCollHandle::init
virtual void init(VP1MaterialButtonBase *matBut=0)
Definition: VertexCollHandle.cxx:149
VertexCollHandle::setState
virtual void setState(const QByteArray &)
Provide specific implementation.
Definition: VertexCollHandle.cxx:443
VertexCollHandle::m_cut_allowedR
VP1Interval m_cut_allowedR
Definition: VertexCollHandle.h:138
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
AODCollHandleBase::name
QString name() const
Definition: AODCollHandleBase.cxx:130
VertexCollHandle::mayHaveAssociatedObjects
virtual bool mayHaveAssociatedObjects() const
Definition: VertexCollHandle.h:104