ATLAS Offline Software
AODHandleBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Header file for class AODHandleBase.cxx //
9 // //
10 // Description: Base class for AOD handles. //
11 // //
12 // //
14 
15 #ifndef AODHANDLEBASE_H
16 #define AODHANDLEBASE_H
17 
18 //#include "GeoPrimitives/GeoPrimitives.h"
19 
20 #include <QStringList>
21 #include <QTreeWidgetItem>
22 #include <vector>
23 #include <set>
24 #include <QList>
25 #include <QFlags>
26 #include <iostream>
27 
30 //class IParticleCollHandleBase;
31 //class TrackSysCommonData;
32 
33 class SoMaterial;
34 class SoNode;
35 
36 namespace xAOD {
37  class IParticle;
38 }
39 
40 class AODCollHandleBase;
41 class AODSysCommonData;
42 
44 public:
45 
46  static int numberOfInstances();
47 
49  virtual ~AODHandleBase();
50 
51  const AODSysCommonData * common() const;
52 
53  void setVisible(bool);
54  bool visible() const { return m_visible; }
55  const AODCollHandleBase * collHandle() const { return m_collhandle; }
57  virtual bool has3DObjects() {return false;}
59  virtual void update3DObjects();
60  virtual void rebuild3DObjects();
62  virtual void clear3DObjects()=0;
64  virtual void attach3DObjects();
66  virtual void detach3DObjects();
68  virtual SoNode* nodes()=0;
71  virtual SoMaterial * determineMaterial()=0;
72 
74  void updateMaterial();
76  SoMaterial * currentMaterial() const { return m_currentmaterial; }
77 
78  virtual QStringList baseInfo() const;
81  virtual QStringList clicked() const = 0;
82 
83 // virtual Amg::Vector3D momentum() const { return Amg::Vector3D(0,0,0); }
84 
85 // virtual const xAOD::IParticle& iParticle() const =0;
86 
87 // virtual double charge() const =0 ;//!< Returns unknown() in case of trouble.
88 // virtual double mass() const;//!< Returns unknown() in case of trouble.
89 
90 // bool hasCharge() const { return charge()!=unknown(); }
91 // bool hasMass() const { return mass()!=unknown(); }
92 
93  static double unknown() { return -999.0; }
94 
95  virtual QString shortInfo() const { return QString("Not yet implemented"); }
96  virtual QString type() const { return QString("Not yet implemented"); }
97 
98  // Object browser code.
100  virtual void fillObjectBrowser(QList<QTreeWidgetItem *>& list);
104  QTreeWidgetItem* browserTreeItem() const ;
105 
106  virtual void dumpToJSON( std::ofstream& ) const {};
107 
108 protected:
109 
110  virtual void visibleStateChanged();
111  virtual void currentMaterialChanged() {};
112 
113 private:
114 
115  // It is illegal to copy/assign a AODHandleBase.cxx:
118 
120  class Imp;
121  Imp * m_d;
122 
123 
124  //Here for inlining:
125  bool m_visible;
127  SoMaterial * m_currentmaterial;
128 };
129 
130 
131 #endif
AODHandleBase::updateMaterial
void updateMaterial()
Called after some configuration related to material changes.
Definition: AODHandleBase.cxx:208
AODHandleBase::visible
bool visible() const
Definition: AODHandleBase.h:54
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:33
AODHandleBase::AODHandleBase
AODHandleBase(const AODHandleBase &)
override if need to take action in this case.
AODHandleBase::Imp
Definition: AODHandleBase.cxx:52
AODHandleBase::unknown
static double unknown()
Definition: AODHandleBase.h:93
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
AODSysCommonData
Definition: AODSysCommonData.h:42
AODHandleBase::AODHandleBase
AODHandleBase(AODCollHandleBase *)
Definition: AODHandleBase.cxx:73
AODHandleBase::detach3DObjects
virtual void detach3DObjects()
Remove from the scene graph.
Definition: AODHandleBase.cxx:191
AODHandleBase::m_collhandle
AODCollHandleBase * m_collhandle
Definition: AODHandleBase.h:126
AODHandleBase::collHandle
const AODCollHandleBase * collHandle() const
Definition: AODHandleBase.h:55
AODHandleBase::determineMaterial
virtual SoMaterial * determineMaterial()=0
Should be implemented by children, in order to change the material depending on the interface etc.
AODHandleBase::fillObjectBrowser
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Create and fill the object browser QTreeWidgetItem.
Definition: AODHandleBase.cxx:288
AODHandleBase::has3DObjects
virtual bool has3DObjects()
Returns true if the 3D objects have been created.
Definition: AODHandleBase.h:57
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
AODHandleBase::currentMaterialChanged
virtual void currentMaterialChanged()
Definition: AODHandleBase.h:111
AODHandleBase::updateObjectBrowser
void updateObjectBrowser()
Update object browser QTreeWidgetItem.
Definition: AODHandleBase.h:102
AODHandleBase::baseInfo
virtual QStringList baseInfo() const
Definition: AODHandleBase.cxx:247
AODHandleBase::attach3DObjects
virtual void attach3DObjects()
Connect to the scene graph.
Definition: AODHandleBase.cxx:157
AODHandleBase::numberOfInstances
static int numberOfInstances()
Definition: AODHandleBase.cxx:87
AssocObjAttachmentHandle
Definition: TrackHandleBase.h:197
AODHandleBase::visibleStateChanged
virtual void visibleStateChanged()
Dummy implementation does nothing.
Definition: AODHandleBase.cxx:316
AODHandleBase::browserTreeItem
QTreeWidgetItem * browserTreeItem() const
Return the QTreeWidgetItem;.
Definition: AODHandleBase.cxx:311
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
AODHandleBase::dumpToJSON
virtual void dumpToJSON(std::ofstream &) const
Definition: AODHandleBase.h:106
AODHandleBase::~AODHandleBase
virtual ~AODHandleBase()
Definition: AODHandleBase.cxx:80
AODHandleBase::currentMaterial
SoMaterial * currentMaterial() const
Returns the current material of the handle.
Definition: AODHandleBase.h:76
AODHandleBase::type
virtual QString type() const
return very short word with type (maybe link with collection type?)
Definition: AODHandleBase.h:96
AODHandleBase::nodes
virtual SoNode * nodes()=0
Returns the 3Dobjects.
AODHandleBase::clicked
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
AODHandleBase::m_d
Imp * m_d
Definition: AODHandleBase.h:120
AODHandleBase::m_visible
bool m_visible
Definition: AODHandleBase.h:125
AODHandleBase::setVisible
void setVisible(bool)
use by the collection handle.
Definition: AODHandleBase.cxx:99
AODHandleBase::shortInfo
virtual QString shortInfo() const
returns mom and hit information about track
Definition: AODHandleBase.h:95
AODHandleBase::rebuild3DObjects
virtual void rebuild3DObjects()
Definition: AODHandleBase.cxx:137
AODHandleBase::operator=
AODHandleBase & operator=(const AODHandleBase &)
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
AODHandleBase::m_currentmaterial
SoMaterial * m_currentmaterial
Definition: AODHandleBase.h:127
AODHandleBase::update3DObjects
virtual void update3DObjects()
Called after some configuration changes, or when the object is first created. Must be overloaded by c...
Definition: AODHandleBase.cxx:125
AODHandleBase::common
const AODSysCommonData * common() const
Definition: AODHandleBase.cxx:93
AODHandleBase::clear3DObjects
virtual void clear3DObjects()=0
Delete objects.