ATLAS Offline Software
PRDCollHandleBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PRDCOLLECTIONHANDLEBASE_H
6 #define PRDCOLLECTIONHANDLEBASE_H
7 
8 // GeoModel
10 //
11 #include "GeoModelKernel/GeoVPhysVol.h"
12 
15 #include <vector>
16 
17 class PRDSysCommonData;
19 class PRDHandleBase;
21 class SoSeparator;
22 class SoMaterial;
23 namespace Trk { class PrepRawData; }
24 
26 
27  Q_OBJECT
28 
29 public:
30 
32  virtual void init(VP1MaterialButtonBase* mat=0);//reimplementations must start with a call to this.
33  virtual ~PRDCollHandleBase();
34 
35  //Called from init(). Should set current cut values and
36  //connections with controller to monitor future changes. Reimplement
37  //the ..Specific method to setup subsystem specific settings.
39 protected:
41 public:
42 
44  // For loading the data and resetting after each event: //
46 
47  virtual bool load();
48 
49  PRDSysCommonData * common() const { return m_common; }
50 
51  //For use by the handles:
54  SoMaterial * highLightMaterial() const;
55 
56  //If highlight outliers is set, other highlight modes (TRT HT, ...) will be ignored.
57  //Other highlight modes are indicated by the return value of highLight() in the PRDHandleBase's
58  bool highLightOutliers() const;
59  double highLightWeight() const { return m_highlightweight; }
60 
61  bool drawErrors() const;
62  bool drawRDOs() const;
63 
64 
65  //Detail level of shown prds:
66  enum DETAIL { SIMPLE, DETAILED, AUTO };//AUTO => Use Level of detail (SoLOD nodes) to switch between simple/detailed shapes.
67  static QString toString(const DETAIL&);
68 
69  void getLODSeparators(int index, VP1ExtraSepLayerHelper*& sephelper_detail,VP1ExtraSepLayerHelper*& sephelper_simple);
70 
72  static QString toString(const COLOURMETHOD&);
76 
77  DETAIL detailLevel() const;
78  bool simpleDetailLevel() const { return detailLevel()==SIMPLE; }
79 signals:
81 public Q_SLOTS:
84  void setDrawErrors(bool);
85  void setDrawRDOs(bool);
86  void setHighLightOutliers(bool);
87  void setHighLightWeight(const double&);
88  void setAllowedEta(const VP1Interval&);
89  void setAllowedPhi(const QList<VP1Interval>&);
90 
91 private Q_SLOTS:
93 
94 protected:
95  virtual PRDHandleBase* addPRD(const Trk::PrepRawData*) = 0;//Return pointer to the handle. Base class (this) will own it.
96 
97  virtual DETAIL defaultDetailLevel() const { return AUTO; }
98  //Use to loop over prds in derived classes:
99  void addHandle(PRDHandleBase*);//All handles must be added here (so they can be retrieved by the next methods).
100  std::vector<PRDHandleBase*>& getPrdHandles();
101  const std::vector<PRDHandleBase*>& getPrdHandles() const;
102 
103  virtual void postLoadInitialisation() {}
104  virtual bool cut(PRDHandleBase*) = 0;//Return true if should be shown (based on various cuts), false otherwise.
105  virtual void eraseEventDataSpecific() {}
106 
107  //Utility (fixme: put in utility class elsewhere).
108  template <class T> void cleanupPtrContainer(T&) const;//Delete pointers and calls .clear()
109  // template <class T> void cleanupNodeContainer(T&) const;//unref's pointers and calls .clear()
110 
111  virtual float lodArea() const { return 500.0f*500.0f; }//Reimplement Override to tune LOD shift for a given collection.
112 
113  void recheckCutStatus(PRDHandleBase*);//Call in derived classes for handles that might be effected by a change in cuts.
114 
115  //Convenience methods which can be called from derived classes (but specialised procedures might be more optimal)
119 
120 public:
121  int nShownHandles() { return m_nshownhandles; }
122 
123  //For use only by PRDHandleBase::setVisible(..):
126 
127 protected:
128  qint32 provideCollTypeID() const;
129  virtual QString provideText() const;
130  virtual void assignDefaultMaterial(SoMaterial*) const;
131  virtual QColor defaultColor() const = 0;//Will be used in assignDefaultMaterial
132  QString provideSection() const;
133  QString provideSectionToolTip() const;
134  QList<QWidget*> provideExtraWidgetsForGuiRow() const;
135  QByteArray extraWidgetsState() const;
136  void setExtraWidgetsState(const QByteArray&);
137 private Q_SLOTS:
138  void collVisibilityChanged(bool);
139 private:
140 
141  class Imp;
142  Imp * m_d;
143 
148 };
149 
150 //Fixme: Move elsewhere (at least to our cxx!):
151 template <class T> void PRDCollHandleBase::cleanupPtrContainer(T&t) const
152 {
153  typename T::iterator it(t.begin()), itE(t.end());
154  for (;it!=itE;++it)
155  delete *it;
156  t.clear();
157 }
158 
159 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PRDCollHandleBase::detailLevelChanged
void detailLevelChanged()
PRDCollHandleBase::BySegmentAndTrack
@ BySegmentAndTrack
Definition: PRDCollHandleBase.h:71
PRDCollHandleBase::m_d
Imp * m_d
Definition: PRDCollHandleBase.h:141
PRDCollHandleBase::defaultDetailLevel
virtual DETAIL defaultDetailLevel() const
Definition: PRDCollHandleBase.h:97
PRDCollHandleBase::~PRDCollHandleBase
virtual ~PRDCollHandleBase()
Definition: PRDCollHandleBase.cxx:132
PRDCollHandleBase::cut
virtual bool cut(PRDHandleBase *)=0
PRDCollHandleBase::ByTechOnly
@ ByTechOnly
Definition: PRDCollHandleBase.h:71
PRDCollHandleBase::colourBySegments
bool colourBySegments() const
Definition: PRDCollHandleBase.h:75
PRDCollHandleBase::SIMPLE
@ SIMPLE
Definition: PRDCollHandleBase.h:66
PRDCollHandleBase::provideSection
QString provideSection() const
Definition: PRDCollHandleBase.cxx:768
index
Definition: index.py:1
PRDCollHandleBase::recheckCutStatus
void recheckCutStatus(PRDHandleBase *)
Definition: PRDCollHandleBase.cxx:519
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
PRDCollHandleBase::setGeneralPRDDetailLevel
void setGeneralPRDDetailLevel(DETAIL)
Definition: PRDCollHandleBase.cxx:436
PRDCollHandleBase::drawRDOs
bool drawRDOs() const
Definition: PRDCollHandleBase.cxx:631
PRDSystemController
Definition: PRDSystemController.h:34
PRDCollHandleBase::postLoadInitialisation
virtual void postLoadInitialisation()
Definition: PRDCollHandleBase.h:103
skel.it
it
Definition: skel.GENtoEVGEN.py:423
PRDCollHandleBase::common
PRDSysCommonData * common() const
Definition: PRDCollHandleBase.h:49
PRDCollHandleBase::DETAILED
@ DETAILED
Definition: PRDCollHandleBase.h:66
PRDCollHandleBase::defaultColor
virtual QColor defaultColor() const =0
PRDCollHandleBase::addHandle
void addHandle(PRDHandleBase *)
Definition: PRDCollHandleBase.cxx:500
PRDCollHandleBase::toString
static QString toString(const DETAIL &)
Definition: PRDCollHandleBase.cxx:727
PRDCollHandleBase::collVisibilityChanged
void collVisibilityChanged(bool)
Definition: PRDCollHandleBase.cxx:214
PRDCollHandleBase::recheckCutStatusOfAllHandles
void recheckCutStatusOfAllHandles()
Definition: PRDCollHandleBase.cxx:566
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
PRDCollHandleBase::BySegment
@ BySegment
Definition: PRDCollHandleBase.h:71
PRDCollHandleBase::COLOURMETHOD
COLOURMETHOD
Definition: PRDCollHandleBase.h:71
PRDCollHandleBase::setDrawRDOs
void setDrawRDOs(bool)
Definition: PRDCollHandleBase.cxx:675
PRDSysCommonData
Definition: PRDSysCommonData.h:35
PRDCollHandleBase::m_colourmethod
COLOURMETHOD m_colourmethod
Definition: PRDCollHandleBase.h:146
PRDCollHandleBase::simpleDetailLevel
bool simpleDetailLevel() const
Definition: PRDCollHandleBase.h:78
PRDCollHandleBase::addPRD
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *)=0
PRDCollHandleBase::DETAIL
DETAIL
Definition: PRDCollHandleBase.h:66
TruthTest.itE
itE
Definition: TruthTest.py:25
PRDCollHandleBase::setAllowedPhi
void setAllowedPhi(const QList< VP1Interval > &)
Definition: PRDCollHandleBase.cxx:852
PRDCollHandleBase::provideCollTypeID
qint32 provideCollTypeID() const
Definition: PRDCollHandleBase.cxx:750
PRDCollHandleBase::assignDefaultMaterial
virtual void assignDefaultMaterial(SoMaterial *) const
Definition: PRDCollHandleBase.cxx:762
PRDCollHandleBase::decrementNShownHandles
void decrementNShownHandles()
Definition: PRDCollHandleBase.h:125
PRDCollHandleBase::AUTO
@ AUTO
Definition: PRDCollHandleBase.h:66
PRDCollHandleBase::load
virtual bool load()
Definition: PRDCollHandleBase.cxx:166
GeoPrimitives.h
PRDDetType::Type
Type
Definition: PRDDetTypes.h:12
PRDCollHandleBase::getLODSeparators
void getLODSeparators(int index, VP1ExtraSepLayerHelper *&sephelper_detail, VP1ExtraSepLayerHelper *&sephelper_simple)
Definition: PRDCollHandleBase.cxx:472
PRDCollHandleBase
Definition: PRDCollHandleBase.h:25
PRDCollHandleBase::setAllowedEta
void setAllowedEta(const VP1Interval &)
Definition: PRDCollHandleBase.cxx:836
PRDCollHandleBase::setupSettingsFromControllerSpecific
virtual void setupSettingsFromControllerSpecific(PRDSystemController *)
Definition: PRDCollHandleBase.h:40
VP1ExtraSepLayerHelper
Definition: VP1ExtraSepLayerHelper.h:22
PRDCollHandleBase::PRDCollHandleBase
PRDCollHandleBase(PRDDetType::Type, PRDSysCommonData *, const QString &key)
Definition: PRDCollHandleBase.cxx:80
PRDCollHandleBase::setHighLightWeight
void setHighLightWeight(const double &)
Definition: PRDCollHandleBase.cxx:692
PRDCollHandleBase::setExtraWidgetsState
void setExtraWidgetsState(const QByteArray &)
Definition: PRDCollHandleBase.cxx:825
PRDCollHandleBase::ByTrack
@ ByTrack
Definition: PRDCollHandleBase.h:71
PRDCollHandleBase::provideSectionToolTip
QString provideSectionToolTip() const
Definition: PRDCollHandleBase.cxx:790
PRDCollHandleBase::provideExtraWidgetsForGuiRow
QList< QWidget * > provideExtraWidgetsForGuiRow() const
Definition: PRDCollHandleBase.cxx:810
PRDCollHandleBase::highLightWeight
double highLightWeight() const
Definition: PRDCollHandleBase.h:59
PRDCollHandleBase::Imp
Definition: PRDCollHandleBase.cxx:39
PRDCollHandleBase::detailLevel
DETAIL detailLevel() const
Definition: PRDCollHandleBase.cxx:430
PRDCollHandleBase::setupSettingsFromController
void setupSettingsFromController(PRDSystemController *)
Definition: PRDCollHandleBase.cxx:527
PRDCollHandleBase::m_common
PRDSysCommonData * m_common
Definition: PRDCollHandleBase.h:144
python.L1.Config.LegacyTopoMergerMap.signals
signals
Definition: LegacyTopoMergerMap.py:13
PRDCollHandleBase::recheckCutStatusOfAllNotVisibleHandles
void recheckCutStatusOfAllNotVisibleHandles()
Definition: PRDCollHandleBase.cxx:603
PRDCollHandleBase::extraWidgetsState
QByteArray extraWidgetsState() const
Definition: PRDCollHandleBase.cxx:816
PRDCollHandleBase::eraseEventDataSpecific
virtual void eraseEventDataSpecific()
Definition: PRDCollHandleBase.h:105
Trk::PrepRawData
Definition: PrepRawData.h:62
PRDCollHandleBase::sephelperSimpleNodes
VP1ExtraSepLayerHelper * sephelperSimpleNodes() const
Definition: PRDCollHandleBase.cxx:406
PRDCollHandleBase::cleanupPtrContainer
void cleanupPtrContainer(T &) const
Definition: PRDCollHandleBase.h:151
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
PRDCollHandleBase::detailComboBoxItemChanged
void detailComboBoxItemChanged()
Definition: PRDCollHandleBase.cxx:412
PRDCollHandleBase::highLightOutliers
bool highLightOutliers() const
Definition: PRDCollHandleBase.cxx:619
PRDCollHandleBase::lodArea
virtual float lodArea() const
Definition: PRDCollHandleBase.h:111
PRDCollHandleBase::sephelperDetailedNodes
VP1ExtraSepLayerHelper * sephelperDetailedNodes() const
Definition: PRDCollHandleBase.cxx:400
VP1MaterialButtonBase
Definition: VP1MaterialButton.h:25
PRDCollHandleBase::m_nshownhandles
int m_nshownhandles
Definition: PRDCollHandleBase.h:145
VP1Interval
Definition: VP1Interval.h:23
PRDCollHandleBase::init
virtual void init(VP1MaterialButtonBase *mat=0)
Definition: PRDCollHandleBase.cxx:105
PRDCollHandleBase::nShownHandles
int nShownHandles()
Definition: PRDCollHandleBase.h:121
PRDCollHandleBase::recheckCutStatusOfAllVisibleHandles
void recheckCutStatusOfAllVisibleHandles()
Definition: PRDCollHandleBase.cxx:585
PRDCollHandleBase::provideText
virtual QString provideText() const
Definition: PRDCollHandleBase.cxx:756
PRDHandleBase
Definition: PRDHandleBase.h:35
PRDCollHandleBase::incrementNShownHandles
void incrementNShownHandles()
Definition: PRDCollHandleBase.h:124
VP1StdCollection
Definition: VP1StdCollection.h:31
VP1StdCollection.h
PRDCollHandleBase::drawErrors
bool drawErrors() const
Definition: PRDCollHandleBase.cxx:625
PRDCollHandleBase::setHighLightOutliers
void setHighLightOutliers(bool)
Definition: PRDCollHandleBase.cxx:643
PRDCollHandleBase::highLightMaterial
SoMaterial * highLightMaterial() const
Definition: PRDCollHandleBase.cxx:637
PRDCollHandleBase::getPrdHandles
std::vector< PRDHandleBase * > & getPrdHandles()
Definition: PRDCollHandleBase.cxx:507
PRDCollHandleBase::colourMethod
COLOURMETHOD colourMethod() const
Definition: PRDCollHandleBase.h:73
PRDCollHandleBase::colourByTracks
bool colourByTracks() const
Definition: PRDCollHandleBase.h:74
PRDCollHandleBase::setDrawErrors
void setDrawErrors(bool)
Definition: PRDCollHandleBase.cxx:659
PRDDetTypes.h
PRDCollHandleBase::m_highlightweight
double m_highlightweight
Definition: PRDCollHandleBase.h:147
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
PRDCollHandleBase::setColourMethod
void setColourMethod(PRDCollHandleBase::COLOURMETHOD)
Definition: PRDCollHandleBase.cxx:710
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37