44#include <Inventor/nodes/SoSeparator.h>
45#include <Inventor/nodes/SoMaterial.h>
46#include <Inventor/nodes/SoSwitch.h>
47#include <Inventor/nodes/SoComplexity.h>
48#include <Inventor/nodes/SoLineSet.h>
49#include <Inventor/nodes/SoVertexProperty.h>
50#include "Inventor/nodes/SoDrawStyle.h"
51#include "Inventor/nodes/SoLightModel.h"
52#include <Inventor/nodes/SoCylinder.h>
53#include <Inventor/SoPath.h>
54#include <Inventor/nodes/SoFont.h>
109 QList<AODCollHandleBase*> l;
110 for (
const QString&
name : T::availableCollections(
theclass)) {
126 QList<AODCollHandleBase*> l;
128 l << createSpecificCollections<IParticleCollHandle_Jet>(
xAOD::Type::Jet);
141"System showing all (x)AOD objects.",
142"Edward.Moyse@cern.ch, Riccardo.maria.bianchi@cern.ch, Sebastian.Andreas.Merkt@cern.ch"),
m_d(new
Imp)
145 m_d->theclass =
this;
158 if(
m_d->common->controller()) {
159 if (
m_d->common->controller()->objBrowser()) {
160 m_d->common->controller()->objBrowser()->close();
176 QString tooltype(
"Trk::ExtrapolationEngine");
181 for (
const QString& value : existingExtrapolators)
186 m_d->common->setExtrapolator(extrapolator);
191 emit signalLoadEvent(
this);
201 if (
m_d->totmomsep) {
202 m_d->totmomsep->unref();
205 if (
m_d->totmomline) {
206 m_d->totmomline->unref();
209 delete m_d->common;
m_d->common = 0;
246 m_d->selObjects->ref();
250 m_d->common->setLastSelectedHandle(0);
271 m_d->common->controller()->collWidget()->setCollections(
m_d->createCollections());
276 m_d->selObjects->addChild(col->collSwitch());
279 root->addChild(
m_d->selObjects);
280 if (!
m_d->totmomsep) {
281 m_d->totmomsep =
new SoSeparator;
282 m_d->totmomsep->ref();
285 root->addChild(
m_d->totmomsep);
296 m_d->common->controller()->collWidget()->clear();
297 if (
m_d->common->controller()->objBrowser())
m_d->common->controller()->objBrowser()->clear();
300 if (
m_d->selObjects) {
302 m_d->selObjects->unref();
307 m_d->totmomsep->removeAllChildren();
342 serialise.save(
m_d->common->controller()->saveSettings());
349 serialise.disableUnsavedChecks();
351 return serialise.result();
360 if (
state.version()==0) {
362 message(
"Warning: State data has obsolete format - ignoring!");
365 if (
state.version()!=1) {
366 message(
"Warning: State data has wrong format - ignoring!");
374 m_d->common->controller()->restoreSettings(
state.restoreByteArray());
378 state.disableUnrestoredChecks();
410 message(
"unexpected signal received in visibleObjectsChanged slot");
438 m_d->selObjects->policy = SoCooperativeSelection::SINGLE;
448 if (pickedNode==
m_d->totmomline) {
449 message(
"Total momentum of selected tracks [GeV]: p = "+
str(
m_d->totmomgev)+
", m = "+
str(
m_d->totmass/1000));
453 message(
"Unknown object clicked");
461 if (
sel!=
m_d->selObjects) {
462 message(
"userSelectedSingleNode - ERROR, sel=!d->selObjects");
467 if (!handle) handle =
m_d->common->getHandleFromNode(
node);
469 message(
"ERROR: Unknown handle from path or node.");
603 return m_d->selObjects;
683 for (
auto tp : trackparticles){
694 QList<IParticleCollHandle_TrackParticle*> newcolls;
698 m_d->common->controller()->collWidget()->addCollections(newcolls);
701 m_d->selObjects->addChild(col->collSwitch());
702 col->setVisible(
true);
720 std::cout<<
"Got "<<segments.size() <<
" from " <<
typeid(sender()).
name()<<std::endl;
735 std::ofstream outfile (
"EventDump.json");
736 if (outfile.is_open()){
738 outfile<<
"\"event number\":234, \"run number\":234,\n";
742 for (
auto col :
m_d->common->controller()->collWidget()->visibleStdCollections() ){
745 message(
"WAAAAH! Not an AODCollHandleBase! Should never happen!");
752 if (ahandle->
xAODType()!=lastType) {
763 outfile <<
"\""<<ahandle->
xAODType()<<
"\" : {";
777 message(
"WAAAAH! Problem opening EventDump.json for output!");
779 message(
"Wrote visible objects to \'EventDump.json\'");
Base class for all AOD object collections This class primarily handles setting up the interface,...
xAOD::Type::ObjectType xAODType() const
Dummy implementation does nothing.
virtual void dumpToJSON(std::ofstream &) const
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
void setCommonData(AODSysCommonData *)
set pointer to the common data
void addHandle(AODHandleBase *)
virtual void init(VP1MaterialButtonBase *matBut=0)
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
void ensureBuildController()
void unregisterSelectionNode(SoCooperativeSelection *)
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
void registerSelectionNode(SoCooperativeSelection *)
void messageVerbose(const QString &) const
virtual void restoreFromState(QByteArray)
void messageDebug(const QString &) const
const QString & name() const
void message(const QString &) const
virtual QByteArray saveState()
The Athena Transient Store API.
QList< AODCollHandleBase * > createCollections()
QList< AODCollHandleBase * > createSpecificCollections(xAOD::Type::ObjectType type)
SoCooperativeSelection * selObjects
unsigned calcTotalMomentumOfSelectedHandles(Amg::Vector3D &totmom, Amg::Vector3D &totpos, double &mass)
void updateShownTotMomentum()
void updateAssociatedObjects(const QList< const xAOD::TrackParticle * > &)
VP1AODSystem(const QString &name="Analysis")
void userSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
QWidget * buildController()
void userChangedSelection(SoCooperativeSelection *, const QSet< SoNode * > &, QSet< SoPath * >)
void userDeselectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
Reimplementing methods declared in IVP13DSystem.
void restoreFromState(QByteArray)
SoCooperativeSelection * selObjects() const
void systemcreate(StoreGateSvc *detstore)
void updateSelectionMode()
void visibleObjectsChanged()
Eigen::Matrix< double, 3, 1 > Vector3D
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ TrackParticle
The object is a charged track particle.
@ Jet
The object is a jet.
@ EventInfo
The object is an event information one.
@ Other
An object not falling into any of the other categories.
@ CaloCluster
The object is a calorimeter cluster.
@ Muon
The object is a muon.
@ Electron
The object is an electron.
@ Vertex
The object is a vertex.