ATLAS Offline Software
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 
38 class AODSysCommonData;
39 class SoSeparator;
40 class SoMaterial;
42 
50 {
51 
52  Q_OBJECT
53 
54 public:
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,
63  virtual ~IParticleCollHandleBase();
64 
65 protected:
68 public:
69 
70  // Loops
71  // Must be called from derived classes when filling in new object handles.
72  virtual void hintNumberOfHandlesInEvent(unsigned);
73  void addHandle(AODHandleBase*);
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 
86 protected:
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 
95 public:
96 
97  virtual bool mayHaveAssociatedObjects() const { return false; }
98 
99 protected:
100 
101  virtual QColor defaultColor() const = 0;//Will be used in assignDefaultMaterial
102 
103 public 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  QList<VP1Interval> getCutAllowedPhi() {return m_cut_allowedPhi; };
114  bool getPtAllowall() {return m_cut_pt_allowall; };
117 
118 private:
119 
120  class Imp;
121  Imp * m_d;
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 
IParticleCollHandleBase::defaultColor
virtual QColor defaultColor() const =0
IParticleCollHandleBase::m_cut_pt_allowall
bool m_cut_pt_allowall
Definition: IParticleCollHandleBase.h:126
IParticle.h
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
IParticleCollHandleBase::setupSettingsFromControllerSpecific
virtual void setupSettingsFromControllerSpecific(const AODSystemController *)
For extensions specific to this collection.
Definition: IParticleCollHandleBase.h:67
ObjectType
ObjectType
Definition: BaseObject.h:11
AODSysCommonData
Definition: AODSysCommonData.h:42
IParticleCollHandleBase::getPtAllowall
bool getPtAllowall()
Definition: IParticleCollHandleBase.h:114
AODSystemController.h
VP1QtUtils.h
IParticleCollHandleBase::IParticleCollHandleBase
IParticleCollHandleBase(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
Definition: IParticleCollHandleBase.cxx:72
IParticleCollHandleBase::m_d
Imp * m_d
Definition: IParticleCollHandleBase.h:120
IParticleCollHandleBase::Imp
Definition: IParticleCollHandleBase.cxx:53
IParticleCollHandleBase::setCutAllowedPt
void setCutAllowedPt(const VP1Interval &)
Definition: IParticleCollHandleBase.cxx:218
IParticleCollHandleBase::setCutAllowedPhi
void setCutAllowedPhi(const QList< VP1Interval > &)
Definition: IParticleCollHandleBase.cxx:284
IParticleCollHandleBase::getCutAllowedEta
const VP1Interval & getCutAllowedEta()
Definition: IParticleCollHandleBase.h:112
IParticleCollHandleBase::persistifiableState
virtual QByteArray persistifiableState() const
Provide specific implementation.
Definition: IParticleCollHandleBase.cxx:330
IParticleCollHandleBase::getHandlesList
QList< AODHandleBase * > getHandlesList() const
Definition: IParticleCollHandleBase.cxx:139
IParticleCollHandleBase::cleanupPtrContainer
void cleanupPtrContainer(T &) const
VP1ExtraSepLayerHelper
Definition: VP1ExtraSepLayerHelper.h:22
AODSystemController
Definition: AODSystemController.h:43
IParticleCollHandleBase::m_cut_etaptphi_allwillfail
bool m_cut_etaptphi_allwillfail
Definition: IParticleCollHandleBase.h:129
IParticleHandleBase.h
IParticleCollHandleBase::getPhiAllowall
bool getPhiAllowall()
Definition: IParticleCollHandleBase.h:116
IParticleCollHandleBase::cut
virtual bool cut(AODHandleBase *)
Definition: IParticleCollHandleBase.cxx:146
IParticleCollHandleBase::getEtaAllowall
bool getEtaAllowall()
Definition: IParticleCollHandleBase.h:115
IParticleCollHandleBase::setCutAllowedEta
void setCutAllowedEta(const VP1Interval &)
Definition: IParticleCollHandleBase.cxx:259
VP1Interval.h
IParticleCollHandleBase::mayHaveAssociatedObjects
virtual bool mayHaveAssociatedObjects() const
Definition: IParticleCollHandleBase.h:97
AODCollHandleBase.h
IParticleCollHandleBase::m_cut_eta_allowall
bool m_cut_eta_allowall
Definition: IParticleCollHandleBase.h:127
IParticleCollHandleBase::handleIterationBegin
virtual void handleIterationBegin()
Definition: IParticleCollHandleBase.cxx:123
VP1Interval
Definition: VP1Interval.h:23
IParticleCollHandleBase::hintNumberOfHandlesInEvent
virtual void hintNumberOfHandlesInEvent(unsigned)
Definition: IParticleCollHandleBase.cxx:105
IParticleCollHandleBase::getCutAllowedPt
const VP1Interval & getCutAllowedPt()
Definition: IParticleCollHandleBase.h:111
IParticleCollHandleBase::getNextHandle
virtual AODHandleBase * getNextHandle()
Definition: IParticleCollHandleBase.cxx:130
IParticleCollHandleBase::~IParticleCollHandleBase
virtual ~IParticleCollHandleBase()
Definition: IParticleCollHandleBase.cxx:88
IParticleCollHandleBase::addHandle
void addHandle(AODHandleBase *)
Definition: IParticleCollHandleBase.cxx:111
IParticleCollHandleBase::m_cut_allowedPtSq
VP1Interval m_cut_allowedPtSq
Definition: IParticleCollHandleBase.h:123
IParticleCollHandleBase::getCutAllowedPhi
QList< VP1Interval > getCutAllowedPhi()
Definition: IParticleCollHandleBase.h:113
VP1StdCollection.h
IParticleCollHandleBase
Base class for collections holding AOD objects of iParticle type Handles pt etc cuts Local data:
Definition: IParticleCollHandleBase.h:50
IParticleCollHandleBase::m_cut_allowedPhi
QList< VP1Interval > m_cut_allowedPhi
Definition: IParticleCollHandleBase.h:125
IParticleCollHandleBase::m_cut_phi_allowall
bool m_cut_phi_allowall
Definition: IParticleCollHandleBase.h:128
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
AODCollHandleBase::name
QString name() const
Definition: AODCollHandleBase.cxx:130
IParticleCollHandleBase::setState
virtual void setState(const QByteArray &)
Provide specific implementation.
Definition: IParticleCollHandleBase.cxx:310
IParticleCollHandleBase::m_cut_allowedEta
VP1Interval m_cut_allowedEta
Definition: IParticleCollHandleBase.h:124