ATLAS Offline Software
Loading...
Searching...
No Matches
IParticleCollHandleBase.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 IParticleCollHandleBase //
9// //
10// Description: Base class for collection handles //
11// //
12// //
14
15#ifndef VP1AODSYSTEMS_IPARTICLECOLLHANDLEBASE_H
16#define VP1AODSYSTEMS_IPARTICLECOLLHANDLEBASE_H
17
18//Local
20#include "AODCollHandleBase.h"
21#include "IParticleHandleBase.h"
22
23//VP1
24#include "VP1Base/VP1Interval.h"
25#include "VP1Base/VP1QtUtils.h"
27
28//xAOD
29#include "xAODBase/IParticle.h" // for xAOD::Type::ObjectType
30
31// Qt
32#include <QColor>
33#include <QList>
34
35//Misc
36#include <iostream>
37
39class SoSeparator;
40class SoMaterial;
42
50{
51
52 Q_OBJECT
53
54public:
55
56 //Each derived class should implement a "static QStringList
57 //availableCollections();" method, which the collection widget will
58 //use to determine the available collections.
59
61 const QString& name,
64
65protected:
68public:
69
70 // Loops
71 // Must be called from derived classes when filling in new object handles.
72 virtual void hintNumberOfHandlesInEvent(unsigned);
74
75 //For iterating over object handles:
76 virtual void handleIterationBegin();
77 virtual AODHandleBase* getNextHandle(); //Returns 0 when done.
78 QList<AODHandleBase*> getHandlesList() const;
79
81 // For loading the data and resetting after each event: //
83 virtual QByteArray persistifiableState() const;
84 virtual void setState(const QByteArray&);
85
86protected:
87
88 //Override if special cuts. Remember to call base class implementation also for common cuts.
89 virtual bool cut(AODHandleBase*);//Return true if should be shown (based on various cuts), false otherwise.
90
91 //Utility (fixme: put in utility class elsewhere).
92 template <class T> void cleanupPtrContainer(T&) const;//Delete pointers and calls .clear()
93 // template <class T> void cleanupNodeContainer(T&) const;//unref's pointers and calls .clear()
94
95public:
96
97 virtual bool mayHaveAssociatedObjects() const { return false; }
98
99protected:
100
101 virtual QColor defaultColor() const = 0;//Will be used in assignDefaultMaterial
102
103public Q_SLOTS:
104
105 // setters
106 void setCutAllowedPt(const VP1Interval&);
107 void setCutAllowedEta(const VP1Interval&);
108 void setCutAllowedPhi(const QList<VP1Interval>&);
109
110 //getters
113 const QList<VP1Interval>& getCutAllowedPhi() {return m_cut_allowedPhi; };
117
118private:
119
120 class Imp;
122
123 VP1Interval m_cut_allowedPtSq;//We store the allowed interval for pt squared - to avoid sqrt's.
125 QList<VP1Interval> m_cut_allowedPhi;
130};
131
132#endif
133
134
135
136
AODCollHandleBase(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
const QString & name() const
const VP1Interval & getCutAllowedEta()
virtual void setupSettingsFromControllerSpecific(const AODSystemController *)
For extensions specific to this collection.
virtual void setState(const QByteArray &)
Provide specific implementation.
QList< VP1Interval > m_cut_allowedPhi
IParticleCollHandleBase(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
virtual QColor defaultColor() const =0
void cleanupPtrContainer(T &) const
virtual AODHandleBase * getNextHandle()
void setCutAllowedPt(const VP1Interval &)
const QList< VP1Interval > & getCutAllowedPhi()
virtual void hintNumberOfHandlesInEvent(unsigned)
const VP1Interval & getCutAllowedPt()
virtual bool mayHaveAssociatedObjects() const
virtual bool cut(AODHandleBase *)
QList< AODHandleBase * > getHandlesList() const
void setCutAllowedPhi(const QList< VP1Interval > &)
void setCutAllowedEta(const VP1Interval &)
virtual QByteArray persistifiableState() const
Provide specific implementation.
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32