ATLAS Offline Software
Loading...
Searching...
No Matches
VP1AODSystem Class Reference

#include <VP1AODSystem.h>

Inheritance diagram for VP1AODSystem:
Collaboration diagram for VP1AODSystem:

Classes

class  Imp

Public Types

typedef std::set< SoCamera * > CamList
typedef CamList::iterator CamListItr
enum  State { CONSTRUCTED =0 , REFRESHED , ERASED , UNCREATED }
enum  ActiveState { ON =0 , OFF }

Public Slots

void updateAssociatedObjects (const QList< const xAOD::TrackParticle * > &)
void updateAssociatedObjects (const QList< const xAOD::MuonSegment * > &)
void dumpToJSON ()

Signals

void itemFromSystemSelected ()
void sysmessage (QString) const
void inactiveSystemTurnedActive ()
void needErase ()

Public Member Functions

 VP1AODSystem (const QString &name="Analysis")
virtual ~VP1AODSystem ()
void systemcreate (StoreGateSvc *detstore)
void systemuncreate ()
QWidget * buildController ()
void buildEventSceneGraph (StoreGateSvc *sg, SoSeparator *root)
void systemerase ()
QByteArray saveState ()
void restoreFromState (QByteArray)
SoCooperativeSelection * selObjects () const
void userPickedNode (SoNode *pickedNode, SoPath *pickedPath)
 Reimplementing methods declared in IVP13DSystem.
void userSelectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
void userDeselectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
void userChangedSelection (SoCooperativeSelection *, const QSet< SoNode * > &, QSet< SoPath * >)
void userClickedOnBgd ()
void ensureBuildController ()
virtual void buildPermanentSceneGraph (StoreGateSvc *detstore, SoSeparator *root)
void updateGUI ()
void warnOnDisabledNotifications () const
void registerCamera (SoCamera *camera)
void registerViewer (SoQtViewer *viewer)
void registerSelectionNode (SoCooperativeSelection *)
void unregisterSelectionNode (SoCooperativeSelection *)
void setUserSelectionNotificationsEnabled (SoCooperativeSelection *selsel, bool enabled)
virtual void deselectAll (SoCooperativeSelection *exception_sel=0)
CamList getCameraList ()
virtual QWidget * buildExtraDisplayWidget ()
const QString & name () const
const QString & information () const
const QString & contact_info () const
bool supportsJSON () const
QWidget * controllerWidget ()
void message (const QString &) const
void message (const QStringList &, const QString &addtoend="") const
void message (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &) const
void messageDebug (const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &) const
void messageVerbose (const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const
StoreGateSvc * storeGate () const
StoreGateSvc * eventStore () const
StoreGateSvc * detectorStore () const
ISvcLocator * serviceLocator () const
IToolSvc * toolSvc () const
State state () const
ActiveState activeState () const

Static Public Member Functions

static bool verbose ()
static QString str (const QString &s)
static QString str (const char *c)
static QString str (const bool b)
static QString str (const QColor &)
static QString str (const SbColor &)
static QString str (const VP1Interval &)
static QString str (const SbVec2d &)
static QString str (const SbVec2f &)
static QString str (const SbVec2s &)
static QString str (const SbVec3d &)
static QString str (const SbVec3f &)
static QString str (const SbVec3s &)
static QString str (const SbVec4d &)
static QString str (const SbVec4f &)
static QString str (short int n)
static QString str (unsigned short int n)
static QString str (long n)
static QString str (ulong n)
static QString str (int n)
static QString str (uint n)
static QString str (qlonglong n)
static QString str (qulonglong n)
static QString str (const double &d)
static QString str (const float &f)
static QString str (const void *)
template<class T>
static QString str (const T *t)
template<class T>
static QString str (const QFlags< T > &f)
template<class T>
static QString str (const HepGeom::BasicVector3D< T > &t)
static QString str (const Amg::Vector3D &t)
template<class T>
static QString str (const QList< T > &t)

Protected Member Functions

void setSupportsJSON (bool supported)
void registerController (QWidget *)

Private Slots

void visibleObjectsChanged ()
void updateSelectionMode ()
void updateShownTotMomentum ()
void activateClickedOutside ()

Private Member Functions

SoSeparator * getSceneGraph () const
void create (StoreGateSvc *detstore)
void refresh (StoreGateSvc *storegate)
void erase ()
void uncreate ()
void disallowUpdateGUI ()
void allowUpdateGUI ()
void setChannel (IVP1ChannelWidget *)
IVP1ChannelWidget * channel () const
void deleteController ()
void setState (const State &)
void setActiveState (const ActiveState &, const bool &donttriggererase=true)
bool isRefreshing ()
void setRefreshing (const bool &)
void setCanRegisterController (const bool &)

Private Attributes

Imp * m_d

Static Private Attributes

static const bool s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")

Detailed Description

Definition at line 34 of file VP1AODSystem.h.

Member Typedef Documentation

◆ CamList

typedef std::set<SoCamera*> IVP13DSystem::CamList
inherited

Definition at line 90 of file IVP13DSystem.h.

◆ CamListItr

typedef CamList::iterator IVP13DSystem::CamListItr
inherited

Definition at line 91 of file IVP13DSystem.h.

Member Enumeration Documentation

◆ ActiveState

enum IVP1System::ActiveState
inherited
Enumerator
ON 
OFF 

Definition at line 152 of file IVP1System.h.

152{ ON=0, OFF };//Whether it is part of the erase/refresh cycle.

◆ State

enum IVP1System::State
inherited
Enumerator
CONSTRUCTED 
REFRESHED 
ERASED 
UNCREATED 

Definition at line 151 of file IVP1System.h.

Constructor & Destructor Documentation

◆ VP1AODSystem()

VP1AODSystem::VP1AODSystem ( const QString & name = "Analysis")

Definition at line 139 of file VP1AODSystem.cxx.

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)
143
144{
145 m_d->theclass = this;
146 m_d->selObjects = 0;
147 m_d->common = 0;
148 m_d->totmomsep = 0;
149 m_d->totmomline = 0;
150 m_d->totmomgev = Amg::Vector3D(0,0,0);
151}
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
const QString & name() const
Eigen::Matrix< double, 3, 1 > Vector3D

◆ ~VP1AODSystem()

VP1AODSystem::~VP1AODSystem ( )
virtual

Definition at line 154 of file VP1AODSystem.cxx.

155{
156 if(m_d) {
157 if(m_d->common) {
158 if(m_d->common->controller()) {
159 if (m_d->common->controller()->objBrowser()) {
160 m_d->common->controller()->objBrowser()->close();
161 }
162 }
163 }
164 }
165 delete m_d; m_d=0;
166}

Member Function Documentation

◆ activateClickedOutside

void IVP13DSystem::activateClickedOutside ( )
privateslotinherited

Definition at line 85 of file IVP13DSystem.cxx.

86{
87 if (!m_d->clickedoutsideScheduled)
88 return;
89 m_d->clickedoutsideScheduled = false;
91}
virtual void userClickedOnBgd()

◆ activeState()

IVP1System::ActiveState IVP1System::activeState ( ) const
inherited

Definition at line 148 of file IVP1System.cxx.

149{
150 return m_d->activeState;
151}

◆ allowUpdateGUI()

void IVP1System::allowUpdateGUI ( )
privateinherited

Definition at line 269 of file IVP1System.cxx.

270{
271 m_d->allowupdategui=true;
272}

◆ buildController()

QWidget * VP1AODSystem::buildController ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 213 of file VP1AODSystem.cxx.

214{
215 messageVerbose("buildController start");
216 AODSystemController * controller = new AODSystemController(this);
217 m_d->common = new AODSysCommonData(this,controller);//Fixme: Do this on-demand in buildeventscenegraph!!
218 controller->setCommonData(m_d->common);
219
220 // connect(controller,SIGNAL(selectionModeChanged(TrackCommonFlags::SELECTIONMODE)),this,SLOT(updateSelectionMode()));
221 // updateSelectionMode();
222 // connect(controller,SIGNAL(showTotMomentumOnMultiTrackSelectionChanged(bool)),this,SLOT(updateShownTotMomentum()));
223 // updateShownTotMomentum();
224
225 messageVerbose("buildController end");
226 return controller;
227}
void setCommonData(AODSysCommonData *)
set pointer to the common data
void messageVerbose(const QString &) const

◆ buildEventSceneGraph()

void VP1AODSystem::buildEventSceneGraph ( StoreGateSvc * sg,
SoSeparator * root )
virtual

Implements IVP13DSystemSimple.

Definition at line 230 of file VP1AODSystem.cxx.

231{
232 // Note: 'sg' is not used here, so it's commented out to prevent compiler warnings
233
234 messageVerbose("VP1AODSystem::buildEventSceneGraph start");
235
236 // set complexity to a lower value, so that e.g. the straws are manageable
237 // SoComplexity * complexity = new SoComplexity;
238 // complexity->value.setValue(0.9f);//Fixme: Hardcoded here and elsewhere (fixme: Recheck all complexity values!)
239 // root->addChild(complexity);
240 // root->addChild(m_d->common->controller()->ascObjDrawStyle());
241 // root->addChild(m_d->common->controller()->ascObjComplexity());//this will be inherited to the tracks
242 // // (but giving no effect)
243
244 m_d->selObjects = new SoCooperativeSelection;
245 m_d->selObjects->activePolicy = SoCooperativeSelection::ACTIVE;
246 m_d->selObjects->ref();
247 registerSelectionNode(m_d->selObjects);
248
249 // reset last selected trk
250 m_d->common->setLastSelectedHandle(0);
252
253 // if (!m_d->common->m_textSep) {
254 // // FIXME!
255 // // std::cout<<"Making new Text sep"<<std::endl;
256 // m_d->common->m_textSep = new SoSeparator;
257 // m_d->common->m_textSep->setName("TextSep");
258 // m_d->common->m_textSep->ref();
259 // }
260 // root->addChild(m_d->common->m_textSep);
261
262 // Fixme - what if font is missing?
263 // SoFont *myFont = new SoFont;
264 // myFont->name.setValue("Arial");
265 // myFont->size.setValue(13.0);
266 // m_d->common->m_textSep->addChild(myFont);
267
268 messageVerbose("createCollections start");
269
270 //Create collection list based on contents of event store, populate gui and apply states:
271 m_d->common->controller()->collWidget()->setCollections(m_d->createCollections());
272
273 //Add collections to event scenegraph:
274 for (VP1StdCollection* col : m_d->common->controller()->collWidget()->collections<VP1StdCollection>()){
275 // std::cout<<"Add collswitch="<<col->collSwitch()<< " to EventSceneGraph"<<std::endl;
276 m_d->selObjects->addChild(col->collSwitch());
277 }
278
279 root->addChild(m_d->selObjects);
280 if (!m_d->totmomsep) {
281 m_d->totmomsep = new SoSeparator;
282 m_d->totmomsep->ref();
283 }
284 // m_d->totmomsep->addChild(m_d->common->controller()->trackDrawStyle());
285 root->addChild(m_d->totmomsep);
286
287 messageVerbose("buildEventSceneGraph end");
288}
void registerSelectionNode(SoCooperativeSelection *)
void updateSelectionMode()

◆ buildExtraDisplayWidget()

virtual QWidget * IVP13DSystem::buildExtraDisplayWidget ( )
inlinevirtualinherited

Definition at line 106 of file IVP13DSystem.h.

106{ return 0; }

◆ buildPermanentSceneGraph()

void IVP13DSystemSimple::buildPermanentSceneGraph ( StoreGateSvc * detstore,
SoSeparator * root )
virtualinherited

◆ channel()

IVP1ChannelWidget * IVP1System::channel ( ) const
privateinherited

Definition at line 288 of file IVP1System.cxx.

289{
290 if (VP1Msg::verbose()&&!m_d->channel){
291 messageVerbose("WARNING channel() returning NULL");
292 }
293 assert(m_d->channel);
294 return m_d->channel;
295}
static bool verbose()
Definition VP1Msg.h:31

◆ contact_info()

const QString & IVP1System::contact_info ( ) const
inherited

Definition at line 63 of file IVP1System.cxx.

64{
65 return m_d->contact_info;
66}

◆ controllerWidget()

QWidget * IVP1System::controllerWidget ( )
inherited

Definition at line 215 of file IVP1System.cxx.

215 {
216 if (VP1Msg::verbose()) {
217 messageVerbose("controllerWidget()");
218 messageVerbose("registerController m_d->state==ERASED = "+QString(m_d->state==ERASED?"true":"false"));
219 messageVerbose("registerController m_d->state==REFRESHED = "+QString(m_d->state==REFRESHED?"true":"false"));
220 }
221 assert(m_d->state==REFRESHED||m_d->state==ERASED);
222 return m_d->controller;
223 }

◆ create()

void IVP13DSystemSimple::create ( StoreGateSvc * detstore)
privatevirtualinherited

Implements IVP1System.

Definition at line 133 of file IVP13DSystemSimple.cxx.

134{
135 if(VP1Msg::verbose()){
136 messageVerbose("IVP13DSystemSimple create");
137 }
138 assert(!m_d->wasrefreshed);
139 assert(!m_d->wascreated);
140 ensureBuildController();//TODO: Move to refresh.
141 m_d->wascreated=true;
142 m_d->wasrefreshed=false;
143}

◆ deleteController()

void IVP1System::deleteController ( )
privateinherited

Definition at line 226 of file IVP1System.cxx.

227{
228 if (VP1Msg::verbose()){
229 messageVerbose("deleteController()");
230 }
231 if (m_d->controller)
232 m_d->controller->deleteLater();
233 m_d->controller = 0;
234}

◆ deselectAll()

void IVP13DSystem::deselectAll ( SoCooperativeSelection * exception_sel = 0)
virtualinherited

Reimplemented in VP1PrepRawDataSystem.

Definition at line 331 of file IVP13DSystem.cxx.

332{
333 static std::map<SoCooperativeSelection*,IVP13DSystem*>::iterator it, itE = Imp::selection2system.end();
334 for (it = Imp::selection2system.begin(); it!=itE;++it) {
335 if (it->second!=this)
336 continue;
337 if (it->first!=exception_sel) {
338 if (it->first->policy.getValue()!=SoCooperativeSelection::SINGLE) {
339 Imp::start_changeselection(this, it->first);
340 it->first->deselectAll();
341 Imp::finished_changeselection(this, it->first);
342 } else {
343 if (it->first->getList()->getLength()==1) {
344 Imp::start_changeselection(this, it->first);
345 SoPath * path = static_cast<SoPath*>(it->first->getList()->get(0));
346 Imp::made_deselection(it->first,path);
347 it->first->deselectAll();
348 Imp::finished_changeselection(this, it->first);
349 }
350 }
351 }
352 }
353}
static void start_changeselection(void *userdata, SoSelection *sel)
static void finished_changeselection(void *userdata, SoSelection *sel)
static std::map< SoCooperativeSelection *, IVP13DSystem * > selection2system
static void made_deselection(void *userdata, SoPath *path)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
path
python interpreter configuration --------------------------------------—
Definition athena.py:132

◆ detectorStore()

StoreGateSvc * IVP1System::detectorStore ( ) const
inherited

Definition at line 331 of file IVP1System.cxx.

332{
334}
static StoreGateSvc * detectorStore()

◆ disallowUpdateGUI()

void IVP1System::disallowUpdateGUI ( )
privateinherited

Definition at line 263 of file IVP1System.cxx.

264{
265 m_d->allowupdategui=false;
266}

◆ dumpToJSON

void VP1AODSystem::dumpToJSON ( )
slot

Definition at line 726 of file VP1AODSystem.cxx.

727{
728
729 // Format should be as follows:
730 // { "Type1Name" : { "Coll1name": {coll1data}, "Coll2name": {coll2data} } , "Type2Name" : { "Coll1name": {coll1data}, "Coll2name": {coll2data} } }
731 // "Coll1name": {coll1data} is handled by the appropriate collHandle, called by ahandle->dumpToJSON(outfile);
732 // All the outer dressing is done here i.e.
733 // { "Type1Name" : { xxx, xxx }, "Type2Name" : { xxx, xxx } }
734
735 std::ofstream outfile ("EventDump.json");
736 if (outfile.is_open()){
737 outfile << "{";
738 outfile<< "\"event number\":234, \"run number\":234,\n"; //FIXME - make this into a metadata section?
739
740 xAOD::Type::ObjectType lastType = xAOD::Type::EventInfo; // Set to this value because nothing that follows should use it i.e. can distinguish first loop.
741
742 for (auto col : m_d->common->controller()->collWidget()->visibleStdCollections() ){
743 AODCollHandleBase* ahandle = dynamic_cast<AODCollHandleBase*>(col);
744 if (!ahandle){
745 message("WAAAAH! Not an AODCollHandleBase! Should never happen!");
746 continue;
747 }
748
749 //unsigned int collNum=0; // Count of collection numbers
750 // std::cout<<"collNum="<<collNum++<<std::endl;
751
752 if (ahandle->xAODType()!=lastType) {
753 // std::cout<<"Last type = "<<lastType<<", new type="<<ahandle->xAODType()<<std::endl;
754 // New type, so Terminate the 'type' enclosure add a new level of JSON enclosure.
755 if (lastType != xAOD::Type::EventInfo) {
756 // std::cout<<"Not first loop, so do add },"<<std::endl;
757 outfile << "},\n"; // This is the }, marked *},* : { "Type1Name" : { xxx, xxx } , "Type2Name" : { xxx, xxx } *},*. Don't do this on the first loop!
758 }
759 lastType=ahandle->xAODType();
760
761 // Format is "TYPE":{ coll1, coll2, coll3 }
762 // Here we do just "TYPE":{
763 outfile << "\""<<ahandle->xAODType()<<"\" : {";
764 // std::cout<<"Dumping: "<< "\""<<ahandle->xAODType()<<"\" : {"<<std::endl;
765 } else {
766 // std::cout<<"Not the first loop, so add comma"<<std::endl;
767 // This is the comma marked *,*: { "Type1Name" : { xxx, xxx } *,* "Type2Name" : { xxx, xxx } }. Don't do this on the first loop!
768 outfile <<",";
769 }
770 // Dump collection
771 ahandle->dumpToJSON(outfile);
772
773 }
774
775 outfile << "}\n}\n"; // First closes last TYPE, second closes overall object
776 } else {
777 message("WAAAAH! Problem opening EventDump.json for output!");
778 }
779 message("Wrote visible objects to \'EventDump.json\'");
780}
xAOD::Type::ObjectType xAODType() const
Dummy implementation does nothing.
virtual void dumpToJSON(std::ofstream &) const
void message(const QString &) const
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
@ EventInfo
The object is an event information one.
Definition ObjectType.h:91

◆ ensureBuildController()

void IVP13DSystemSimple::ensureBuildController ( )
inherited

Definition at line 90 of file IVP13DSystemSimple.cxx.

91{
92 if (m_d->controllerBuilt)
93 return;
94 m_d->controllerBuilt=true;
95 if(VP1Msg::verbose()){
96 messageVerbose("IVP13DSystemSimple build controller");
97 }
98 QWidget * controller = buildController();
99 if (controller)
100 registerController(controller);
101 if(VP1Msg::verbose()){
102 messageVerbose("IVP13DSystemSimple controller was = "+str(controller));
103 }
104}
virtual QWidget * buildController()
void registerController(QWidget *)
static QString str(const QString &s)
Definition VP1String.h:49

◆ erase()

void IVP13DSystemSimple::erase ( )
privatevirtualinherited

Implements IVP1System.

Definition at line 173 of file IVP13DSystemSimple.cxx.

174{
175 if(VP1Msg::verbose()){
176 messageVerbose("IVP13DSystemSimple::erase() start");
177 }
178 assert(m_d->wascreated);
179 assert(m_d->wasrefreshed);
180
181 bool saveE = m_d->rootE->enableNotify(false);
182
183 systemerase();
184 if(VP1Msg::verbose()){
185 messageVerbose("IVP13DSystemSimple::erase() Removing all event objects from scene");
187 }
188 m_d->rootE->removeAllChildren();
189
190 if (saveE) {
191 m_d->rootE->enableNotify(true);
192 m_d->rootE->touch();
193 }
194
195 m_d->wasrefreshed=false;
196 if(VP1Msg::verbose()){
197 messageVerbose("IVP13DSystemSimple::erase() end");
198 }
199}
void warnOnDisabledNotifications() const

◆ eventStore()

StoreGateSvc * IVP1System::eventStore ( ) const
inherited

Definition at line 325 of file IVP1System.cxx.

326{
328}
static StoreGateSvc * eventStore()

◆ getCameraList()

std::set< SoCamera * > IVP13DSystem::getCameraList ( )
inherited

Definition at line 395 of file IVP13DSystem.cxx.

396{
397 std::set<SoCamera*> cameralist = m_d->staticcameras;
398 std::set<SoQtViewer*>::const_iterator it, itE=m_d->viewers.end();
399 for (it=m_d->viewers.begin();it!=itE;++it) {
400 SoCamera*cam = (*it)->getCamera();
401 if (cam)
402 cameralist.insert(cam);
403 }
404
405 //m_d->camerasfromviewer
406 return cameralist;
407}

◆ getSceneGraph()

SoSeparator * IVP13DSystemSimple::getSceneGraph ( ) const
privatevirtualinherited

Implements IVP13DSystem.

Definition at line 127 of file IVP13DSystemSimple.cxx.

128{
129 return static_cast<SoSeparator*>(m_d->root);
130}

◆ inactiveSystemTurnedActive

void IVP1System::inactiveSystemTurnedActive ( )
signalinherited

◆ information()

const QString & IVP1System::information ( ) const
inherited

Definition at line 57 of file IVP1System.cxx.

58{
59 return m_d->information;
60}

◆ isRefreshing()

bool IVP1System::isRefreshing ( )
privateinherited

Definition at line 121 of file IVP1System.cxx.

122{
123 return m_d->refreshing;
124}

◆ itemFromSystemSelected

void IVP13DSystem::itemFromSystemSelected ( )
signalinherited

◆ message() [1/3]

void IVP1System::message ( const QString & str) const
inherited

Definition at line 349 of file IVP1System.cxx.

350{
351 if (receivers(SIGNAL(sysmessage(QString))) > 0){
353 }
354 else{
355 std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
356 }
357}
void sysmessage(QString) const
static const char * prefix_msg()
Definition VP1Msg.h:56

◆ message() [2/3]

void IVP1System::message ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 413 of file IVP1System.cxx.

414{
415 if (addtostart.isEmpty()) {
416 message(l,addtoend);
417 return;
418 }
419 if (addtoend.isEmpty()) {
420 for (const QString& s : l)
421 message(addtostart+s);
422 } else {
423 for (const QString& s : l)
424 message(addtostart+s+addtoend);
425 }
426}

◆ message() [3/3]

void IVP1System::message ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 375 of file IVP1System.cxx.

376{
377 if (addtoend.isEmpty()) {
378 for (const QString& s : l)
379 message(s);
380 } else {
381 for (const QString& s : l)
382 message(s+addtoend);
383 }
384}

◆ messageDebug() [1/3]

void IVP1System::messageDebug ( const QString & str) const
inherited

Definition at line 360 of file IVP1System.cxx.

361{
362 if (VP1Msg::debug())
363 std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
364}
static bool debug()
Definition VP1Msg.h:32
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ messageDebug() [2/3]

void IVP1System::messageDebug ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 429 of file IVP1System.cxx.

430{
431 if (addtostart.isEmpty()) {
432 messageDebug(l,addtoend);
433 return;
434 }
435 if (addtoend.isEmpty()) {
436 for (const QString& s : l)
437 messageDebug(addtostart+s);
438 } else {
439 for (const QString& s : l)
440 messageDebug(addtostart+s+addtoend);
441 }
442}
void messageDebug(const QString &) const

◆ messageDebug() [3/3]

void IVP1System::messageDebug ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 387 of file IVP1System.cxx.

388{
389 if (addtoend.isEmpty()) {
390 for (const QString& s : l)
391 messageDebug(s);
392 } else {
393 for (const QString& s : l)
394 messageDebug(s+addtoend);
395 }
396}

◆ messageVerbose() [1/3]

void IVP1System::messageVerbose ( const QString & str) const
inherited

Definition at line 367 of file IVP1System.cxx.

368{
369 if (VP1Msg::verbose())
370 std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
371}
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ messageVerbose() [2/3]

void IVP1System::messageVerbose ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 445 of file IVP1System.cxx.

446{
447 if (!VP1Msg::verbose())
448 return;
449 if (addtostart.isEmpty()) {
450 messageVerbose(l,addtoend);
451 return;
452 }
453 if (addtoend.isEmpty()) {
454 for (const QString& s : l)
455 messageVerbose(addtostart+s);
456 } else {
457 for (const QString& s : l)
458 messageVerbose(addtostart+s+addtoend);
459 }
460}

◆ messageVerbose() [3/3]

void IVP1System::messageVerbose ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 399 of file IVP1System.cxx.

400{
401 if (!VP1Msg::verbose())
402 return;
403 if (addtoend.isEmpty()) {
404 for (const QString& s : l)
406 } else {
407 for (const QString& s : l)
408 messageVerbose(s+addtoend);
409 }
410}

◆ name()

const QString & IVP1System::name ( ) const
inherited

Definition at line 51 of file IVP1System.cxx.

52{
53 return m_d->name;
54}

◆ needErase

void IVP1System::needErase ( )
signalinherited

◆ refresh()

void IVP13DSystemSimple::refresh ( StoreGateSvc * storegate)
privatevirtualinherited

Implements IVP1System.

Definition at line 146 of file IVP13DSystemSimple.cxx.

147{
148 assert(m_d->wascreated);
149 assert(!m_d->wasrefreshed);
150
151 if (m_d->first) {
152 if(VP1Msg::verbose()){
153 messageVerbose("IVP13DSystemSimple first refresh - so calling create methods (i.e. delayed create).");
154 }
156 m_d->first = false;
157 m_d->root->removeChild(m_d->rootR);
159 m_d->root->addChild(m_d->rootR);
160 }
161
162 m_d->root->removeChild(m_d->rootE);
163 updateGUI();
164 buildEventSceneGraph(sg, m_d->rootE);
165 updateGUI();
166 m_d->root->addChild(m_d->rootE);
167
168 m_d->wasrefreshed=true;
169
170}
virtual void systemcreate(StoreGateSvc *detstore)
virtual void buildPermanentSceneGraph(StoreGateSvc *detstore, SoSeparator *root)
virtual void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)=0
StoreGateSvc * detectorStore() const

◆ registerCamera()

void IVP13DSystem::registerCamera ( SoCamera * camera)
inherited

Definition at line 410 of file IVP13DSystem.cxx.

410 {
411 if (!cam)
412 return;
413 m_d->staticcameras.insert(cam);
414 cam->ref();
415}

◆ registerController()

void IVP1System::registerController ( QWidget * w)
protectedinherited

Definition at line 237 of file IVP1System.cxx.

238{
239 if (VP1Msg::verbose()) {
240 messageVerbose("registerController ");
241 messageVerbose("registerController m_d->canregistercontroller = "+QString(m_d->canregistercontroller?"true":"false"));
242 messageVerbose("registerController m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
243 messageVerbose("registerController m_d->controller==0 = "+QString(m_d->controller==0?"true":"false"));
244 messageVerbose("registerController w!=0 = "+QString(w!=0?"true":"false"));
245 }
246 if (!m_d->canregistercontroller)
247 message("ERROR: Please don't register controllers after create().");
248 if (m_d->state!=CONSTRUCTED)
249 message("ERROR: Please only register controllers in CONSTRUCTED state.");
250 if (!w) {
251 message("ERROR: Attempt to register null controller.");
252 return;
253 }
254 if (m_d->controller) {
255 message("ERROR: Attempt to register controller twice.");
256 return;
257 }
258 m_d->controller = w;
259 w->setParent(0);
260}

◆ registerSelectionNode()

void IVP13DSystem::registerSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 257 of file IVP13DSystem.cxx.

258{
259 if (!selection) {
260 message("registerSelectionNode Error: NULL selection pointer!");
261 return;
262 }
264 message("registerSelectionNode Error: Trying to register selection node more than once!");
265 return;
266 }
267
268 selection->addSelectionCallback( Imp::made_selection, selection );
269 selection->addDeselectionCallback( Imp::made_deselection, selection );
270 selection->addStartCallback( Imp::start_changeselection, this );
271 selection->addFinishCallback( Imp::finished_changeselection, this );
272 selection->addClickOutsideCallback( Imp::clickedoutside, this );
273
275 selection->ref();
276
277 messageVerbose("selection node registered");
278}
static void clickedoutside(void *userdata, SoCooperativeSelection *sel)
static void made_selection(void *userdata, SoPath *path)
const std::string selection
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140

◆ registerViewer()

void IVP13DSystem::registerViewer ( SoQtViewer * viewer)
inherited

Definition at line 418 of file IVP13DSystem.cxx.

419{
420 if (!viewer)
421 return;
422 m_d->viewers.insert(viewer);
423}

◆ restoreFromState()

void VP1AODSystem::restoreFromState ( QByteArray ba)
virtual

Reimplemented from IVP1System.

Definition at line 355 of file VP1AODSystem.cxx.

356{
357 messageDebug("VP1AODSystem::restoreFromState()");
358 //Version & base state:
359 VP1Deserialise state(ba,this);
360 if (state.version()==0) {
361 //We simply won't support .vp1 files from the old track system.
362 message("Warning: State data has obsolete format - ignoring!");
363 return;
364 }
365 if (state.version()!=1) {
366 message("Warning: State data has wrong format - ignoring!");
367 return;
368 }
369
371
373
374 m_d->common->controller()->restoreSettings(state.restoreByteArray());
375
376 state.restore(static_cast<VP1CollectionWidget*>(m_d->common->controller()->collWidget()));
377
378 state.disableUnrestoredChecks();//We do the testing in the controller
379}
virtual void restoreFromState(QByteArray)
State state() const

◆ saveState()

QByteArray VP1AODSystem::saveState ( )
virtual

Reimplemented from IVP1System.

Definition at line 329 of file VP1AODSystem.cxx.

330{
331 messageDebug("VP1AODSystem::saveState()");
332
333 //Version & base state:
334 VP1Serialise serialise(1/*version*/,this);
335
336 messageDebug("saving the base class...");
337 serialise.save(IVP13DSystemSimple::saveState());//Info from base class
338
339 // Actual state info:
340 messageDebug("saving the controller...");
342 serialise.save(m_d->common->controller()->saveSettings());
343
344 messageDebug("saving the collectionWidget...");
345 serialise.save(static_cast<VP1CollectionWidget*>(m_d->common->controller()->collWidget()));
346
347
348
349 serialise.disableUnsavedChecks();//We do the testing in the controller
350
351 return serialise.result();
352}
virtual QByteArray saveState()
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors

◆ selObjects()

SoCooperativeSelection * VP1AODSystem::selObjects ( ) const

Definition at line 602 of file VP1AODSystem.cxx.

602 {
603 return m_d->selObjects;
604}

◆ serviceLocator()

ISvcLocator * IVP1System::serviceLocator ( ) const
inherited

Definition at line 337 of file IVP1System.cxx.

338{
340}
static ISvcLocator * serviceLocator()

◆ setActiveState()

void IVP1System::setActiveState ( const ActiveState & s,
const bool & donttriggererase = true )
privateinherited

Definition at line 175 of file IVP1System.cxx.

176{
177 //First handle case where we dont actually change state. Only
178 //special consideration is OFF->OFF where we have to do something if
179 //we need to erase:
180 if (m_d->activeState==OFF&&s==OFF&&(m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
181 needErase();
182 m_d->channel->emitRefreshInfoChanged();
183 return;
184 } else if (m_d->activeState==s) {
185 m_d->channel->emitRefreshInfoChanged();
186 return;
187 }
188
189 //Ok, we know that we are either ON->OFF or OFF->ON.
190 m_d->activeState = s;
191
192 if (s==ON) {
193 //OFF->ON: We might need a refresh, so send out a signal for the scheduler:
195 } else {
196 //ON->OFF: We might need an erase signal:
197 if ((m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
198 needErase();
199 }
200 }
201 m_d->channel->emitRefreshInfoChanged();
202}
void inactiveSystemTurnedActive()
void needErase()

◆ setCanRegisterController()

void IVP1System::setCanRegisterController ( const bool & c)
privateinherited

Definition at line 298 of file IVP1System.cxx.

299{
300 if (VP1Msg::verbose()){
301 messageVerbose("setCanRegisterController called with"+QString(c?"true":"false"));
302 }
303 m_d->canregistercontroller=c;
304}

◆ setChannel()

void IVP1System::setChannel ( IVP1ChannelWidget * cw)
privateinherited

Definition at line 107 of file IVP1System.cxx.

108{
109 if (VP1Msg::verbose()) {
110 messageVerbose("setChannel ");
111 messageVerbose("setChannel m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
112 messageVerbose("setChannel cw!=0 = "+QString(cw!=0?"true":"false"));
113 }
114 assert(!m_d->channel);
115 assert(cw);
116 assert(m_d->state==CONSTRUCTED);
117 m_d->channel = cw;
118}

◆ setRefreshing()

void IVP1System::setRefreshing ( const bool & b)
privateinherited

Definition at line 127 of file IVP1System.cxx.

128{
129 if (VP1Msg::verbose()){
130 messageVerbose("setRefreshing() called with b="+QString(b?"true":"false"));
131 }
132 if (b) {
133 assert(m_d->state==ERASED);
134 } else {
135 assert(m_d->state==REFRESHED);
136 }
137 m_d->refreshing = b;
138}

◆ setState()

void IVP1System::setState ( const State & s)
privateinherited

Definition at line 154 of file IVP1System.cxx.

155{
156#ifndef NDEBUG
157 assert (m_d->state != s);
158 assert(s!=CONSTRUCTED);
159 if (s==REFRESHED) {
160 assert(m_d->state==ERASED);
161 }
162 if (s==ERASED) {
163 assert(m_d->state==REFRESHED||m_d->state==CONSTRUCTED);
164 }
165 if (s==UNCREATED) {
166 assert(m_d->state==ERASED);
167 }
168#endif
169 m_d->state = s;
170 if (s==REFRESHED||s==ERASED)
171 m_d->channel->emitRefreshInfoChanged();
172}

◆ setSupportsJSON()

void IVP1System::setSupportsJSON ( bool supported)
protectedinherited

Definition at line 101 of file IVP1System.cxx.

102{
103 m_d->supportsJSON = supported;
104}

◆ setUserSelectionNotificationsEnabled()

void IVP13DSystem::setUserSelectionNotificationsEnabled ( SoCooperativeSelection * sel,
bool enabled )
inherited

Definition at line 310 of file IVP13DSystem.cxx.

311{
312 if (!selection) {
313 message("setUserSelectionNotificationsEnabled Error: NULL selection pointer!");
314 return;
315 }
317 message("setUserSelectionNotificationsEnabled Error: Called for selection which was never registered!");
318 return;
319 }
320 if (enabled != m_d->selectionsWithDisabledNotifications.contains(selection))
321 return;
322
323 if (enabled)
324 m_d->selectionsWithDisabledNotifications.remove(selection);
325 else
326 m_d->selectionsWithDisabledNotifications << selection;
327
328}

◆ state()

IVP1System::State IVP1System::state ( ) const
inherited

Definition at line 142 of file IVP1System.cxx.

143{
144 return m_d->state;
145}

◆ storeGate()

StoreGateSvc * IVP1System::storeGate ( ) const
inlineinherited

Definition at line 127 of file IVP1System.h.

127{ return eventStore(); }//OBSOLETE NAME. Use eventStore() instead.
StoreGateSvc * eventStore() const

◆ str() [1/30]

QString VP1String::str ( const Amg::Vector3D & t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [2/30]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53{ return b?"True":"False"; }

◆ str() [3/30]

QString VP1String::str ( const char * c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

QString VP1String::str ( const double & d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81{ return QString::number(d); }

◆ str() [5/30]

QString VP1String::str ( const float & f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82{ return QString::number(f); }

◆ str() [6/30]

template<class T>
QString VP1String::str ( const HepGeom::BasicVector3D< T > & t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor & c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31{
32 return c.isValid() ? c.name() : "Invalid";
33}

◆ str() [8/30]

template<class T>
QString VP1String::str ( const QFlags< T > & f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91{ return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T>
QString VP1String::str ( const QList< T > & t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102{ return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

QString VP1String::str ( const QString & s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49{ return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor & c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37{
39}
static QColor sbcol2qcol(const SbColor &)

◆ str() [12/30]

QString VP1String::str ( const SbVec2d & v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61{ double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }
#define y
#define x

◆ str() [13/30]

QString VP1String::str ( const SbVec2f & v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62{ float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s & v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63{ short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d & v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64{ double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }
#define z

◆ str() [16/30]

QString VP1String::str ( const SbVec3f & v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65{ float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s & v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66{ short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d & v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67{ double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f & v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68{ float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T>
QString VP1String::str ( const T * t)
inlinestaticinherited

Definition at line 87 of file VP1String.h.

87{ return str(static_cast<const void* >(t)); }

◆ str() [21/30]

QString VP1String::str ( const void * p)
staticinherited

Definition at line 48 of file VP1String.cxx.

49{
50 if (p) {
51 std::ostringstream s;
52 s << p;
53 // Explicitly naming QString here avoids a cppcheck warning.
54 return QString (s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}

◆ str() [22/30]

QString VP1String::str ( const VP1Interval & i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43{
44 return i.toString();
45}

◆ str() [23/30]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77{ return QString::number(n); }

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75{ return QString::number(n); }

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79{ return QString::number(n); }

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80{ return QString::number(n); }

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73{ return QString::number(n); }

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78{ return QString::number(n); }

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76{ return QString::number(n); }

◆ str() [30/30]

QString VP1String::str ( unsigned short int n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74{ return QString::number(n); }

◆ supportsJSON()

bool IVP1System::supportsJSON ( ) const
inherited

Definition at line 95 of file IVP1System.cxx.

96{
97 return m_d->supportsJSON;
98}

◆ sysmessage

void IVP1System::sysmessage ( QString ) const
signalinherited

◆ systemcreate()

void VP1AODSystem::systemcreate ( StoreGateSvc * detstore)
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 169 of file VP1AODSystem.cxx.

170{
171 messageVerbose("systemcreate");
173
174#ifndef BUILDVP1LIGHT
175 //Get available extrapolators:
176 QString tooltype("Trk::ExtrapolationEngine");
177 VP1AvailableToolsHelper availTools(this);
178 availTools.addMonitoredType(tooltype);
179 QStringList existingExtrapolators = availTools.availableTools();
180
181 for (const QString& value : existingExtrapolators)
182 messageVerbose(value);
183
184 VP1ToolAccessHelper toolaccess(this);
185 Trk::IExtrapolationEngine * extrapolator = toolaccess.getToolPointer<Trk::IExtrapolationEngine>("Trk::ExtrapolationEngine/AtlasExtrapolation",false/*silent*/,true/*create if not exists*/);
186 m_d->common->setExtrapolator(extrapolator);
187#endif
188
189#ifdef BUILDVP1LIGHT
190 // Load event from xAOD once AODSystem is created
191 emit signalLoadEvent(this);
192#endif // BUILDVP1LIGHT
193
194 // m_d->common->controller()->initTools();
195}

◆ systemerase()

void VP1AODSystem::systemerase ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 292 of file VP1AODSystem.cxx.

293{
294 messageVerbose("systemErase begin");
295
296 m_d->common->controller()->collWidget()->clear();
297 if (m_d->common->controller()->objBrowser()) m_d->common->controller()->objBrowser()->clear();
298
299 // m_d->common->clearEventData();
300 if (m_d->selObjects) {
301 unregisterSelectionNode(m_d->selObjects);
302 m_d->selObjects->unref();
303 m_d->selObjects=0;
304 }
305
306 if (m_d->totmomsep)
307 m_d->totmomsep->removeAllChildren();
308
309 // if (m_d->common->m_textSep) // FIXME!
310 // m_d->common->m_textSep->removeAllChildren();
311
312 m_d->totmomgev = Amg::Vector3D(0,0,0);
313
314 // if (verbose()) {
315 // if (AODHandleBase::numberOfInstances()!=0)
316 // message("Warning: "+str(AODHandleBase::numberOfInstances())
317 // +" instances of AODHandleBase alive at end of systemerase(). "
318 // "(ignore this warning if there is more than one track system instance).");
319 // if (AODHandleBase::numberOfInstances()!=0)
320 // message("Warning: "+str(AODHandleBase::numberOfInstances())
321 // +" instances of AODHandleBase alive at end of systemerase(). "
322 // "(ignore this warning if there is more than one track system instance).");
323 // }
324
325 messageVerbose("systemErase end");
326}
void unregisterSelectionNode(SoCooperativeSelection *)

◆ systemuncreate()

void VP1AODSystem::systemuncreate ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 198 of file VP1AODSystem.cxx.

199{
200 messageVerbose("systemuncreate");
201 if (m_d->totmomsep) {
202 m_d->totmomsep->unref();
203 m_d->totmomsep=0;
204 }
205 if (m_d->totmomline) {
206 m_d->totmomline->unref();
207 m_d->totmomline = 0;
208 }
209 delete m_d->common; m_d->common = 0;
210}

◆ toolSvc()

IToolSvc * IVP1System::toolSvc ( ) const
inherited

Definition at line 343 of file IVP1System.cxx.

344{
345 return VP1AthenaPtrs::toolSvc();
346}
static IToolSvc * toolSvc()

◆ uncreate()

void IVP13DSystemSimple::uncreate ( )
privatevirtualinherited

Reimplemented from IVP1System.

Definition at line 202 of file IVP13DSystemSimple.cxx.

203{
204
205 if(VP1Msg::verbose()){
206 messageDebug("uncreate()...");
207 }
208
209 assert(m_d->wascreated);
210 assert(!m_d->wasrefreshed);
211 m_d->rootE->enableNotify(false);
212 m_d->rootR->enableNotify(false);
214 m_d->root->removeAllChildren();
215 m_d->rootE->removeAllChildren();
216 m_d->rootR->removeAllChildren();
217 m_d->wascreated=false;
218}
virtual void systemuncreate()

◆ unregisterSelectionNode()

void IVP13DSystem::unregisterSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 281 of file IVP13DSystem.cxx.

282{
283 if (!selection) {
284 message("unregisterSelectionNode Error: NULL selection pointer!");
285 return;
286 }
288 message("registerSelectionNode Error: Trying to unregister unknown selection node!");
289 return;
290 }
291
292 selection->removeSelectionCallback( Imp::made_selection, selection );
293 selection->removeDeselectionCallback( Imp::made_deselection, selection );
294 selection->removeStartCallback( Imp::start_changeselection, this );
295 selection->removeFinishCallback( Imp::finished_changeselection, this );
296 selection->removeClickOutsideCallback( Imp::clickedoutside, this );
297
299 if (m_d->selectionsWithDisabledNotifications.contains(selection))
300 m_d->selectionsWithDisabledNotifications.remove(selection);
301 selection->unref();
302
303 messageVerbose("selection node unregistered");
304
305}

◆ updateAssociatedObjects [1/2]

void VP1AODSystem::updateAssociatedObjects ( const QList< const xAOD::MuonSegment * > & segments)
slot

Definition at line 717 of file VP1AODSystem.cxx.

718{
719 messageVerbose("updateAssociatedObjects Segment");
720 std::cout<<"Got "<<segments.size() << " from " <<typeid(sender()).name()<<std::endl;
721
722}

◆ updateAssociatedObjects [2/2]

void VP1AODSystem::updateAssociatedObjects ( const QList< const xAOD::TrackParticle * > & trackparticles)
slot

Definition at line 677 of file VP1AODSystem.cxx.

678{
679 messageVerbose("updateAssociatedObjects TrackParticle");
680
681 IParticleCollHandle_TrackParticle* newcoll = new IParticleCollHandle_TrackParticle( m_d->common, "TrackParticlesFromMuons", xAOD::Type::Muon, false );
682
683 for (auto tp : trackparticles){
684 IParticleHandle_TrackParticle* newhandle = new IParticleHandle_TrackParticle(newcoll, tp);
685 newcoll->addHandle( newhandle );
686 }
687
688 newcoll->init();
689 // TrackCollHandle_RefittedTracks * newtrackcoll =
690 // new TrackCollHandle_RefittedTracks(m_d->common,
691 // m_d->common->controller()->nameOfNewlyFittedCollections(),
692 // fittedtracks);
693
694 QList<IParticleCollHandle_TrackParticle*> newcolls;
695 newcolls << newcoll;
696
697
698 m_d->common->controller()->collWidget()->addCollections(newcolls);
699
700 for (IParticleCollHandle_TrackParticle* col : newcolls) {
701 m_d->selObjects->addChild(col->collSwitch());
702 col->setVisible(true);
703 }
704 messageVerbose("updateAssociatedObjects TrackParticle end");
705
706}
virtual void init(VP1MaterialButtonBase *matBut=0)
@ Muon
The object is a muon.
Definition ObjectType.h:48

◆ updateGUI()

void IVP13DSystemSimple::updateGUI ( )
inlineinherited

Definition at line 89 of file IVP13DSystemSimple.h.

◆ updateSelectionMode

void VP1AODSystem::updateSelectionMode ( )
privateslot

Definition at line 415 of file VP1AODSystem.cxx.

416{
417 messageVerbose("updateSelectionMode start");
418 // if (!m_d->selObjects||!m_d->ascObjSelManager) {
419 // messageVerbose("updateSelectionMode Warning: Ignoring due to null pointers.");
420 // return;
421 // }
422 deselectAll();
423 // m_d->ascObjSelManager->deselectAll();
424 // m_d->selMode = m_d->common->controller()->selectionMode();//NB: Don't abort if unchanged (we call this method to init)
425
426 // if (m_d->selMode==TrackCommonFlags::TRACKFIT) {
427 // messageVerbose("updateSelectionMode => TRACKFIT");
428 // m_d->selObjects->policy = SoCooperativeSelection::SINGLE;
429 // m_d->ascObjSelManager->setMode(AscObjSelectionManager::SHIFT);
430 // } else if (m_d->selMode==TrackCommonFlags::MULTITRACK) {
431 // messageVerbose("updateSelectionMode => MULTITRACK");
432 // m_d->selObjects->policy = SoCooperativeSelection::TOGGLE;
433 // m_d->ascObjSelManager->setMode(AscObjSelectionManager::SINGLE);
434 // } else {
435 // if (m_d->selMode!=TrackCommonFlags::SINGLEOBJECT)
436 // message("updateSelectionMode ERROR: Unexpected selection mode flag");
437 // messageVerbose("updateSelectionMode => SINGLEOBJECT");
438 m_d->selObjects->policy = SoCooperativeSelection::SINGLE;
439 // m_d->ascObjSelManager->setMode(AscObjSelectionManager::SINGLE);
440 // }
441 messageVerbose("updateSelectionMode end");
442}
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)

◆ updateShownTotMomentum

void VP1AODSystem::updateShownTotMomentum ( )
privateslot

Definition at line 608 of file VP1AODSystem.cxx.

609{
610 // messageVerbose("updateShownTotMomentum");
611 // if (!m_d->common->controller()->showTotMomentumOnMultiTrackSelection()) {
612 // //ensure detach:
613 // messageVerbose(" => detach");
614 // if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
615 // m_d->totmomsep->removeChild(m_d->totmomline);
616 // return;
617 // }
618 // Amg::Vector3D totmom;
619 // Amg::Vector3D totpos;
620 // double totmass;
621 // unsigned nused = m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass);
622 // if (nused==0) {
623 // //ensure detach:
624 // messageVerbose(" => detach");
625 // if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
626 // m_d->totmomsep->removeChild(m_d->totmomline);
627 // } else {
628 // //ensure correct lineset:
629 // Amg::Vector3D p2 = totpos+totmom.unit()*1*CLHEP::m;
630 // if (!m_d->totmomline) {
631 // m_d->totmomline = new SoLineSet;
632 // m_d->totmomline->ref();
633 // SoVertexProperty * vertices = new SoVertexProperty;
634 // m_d->totmomline->vertexProperty = vertices;
635 // m_d->totmomline->numVertices.set1Value(0,2);
636 //
637 // }
638 // SoVertexProperty * vertices = static_cast<SoVertexProperty*>(m_d->totmomline->vertexProperty.getValue());
639 // vertices->vertex.set1Value(0,totpos.x(),totpos.y(),totpos.z());
640 // vertices->vertex.set1Value(1,p2.x(),p2.y(),p2.z());
641 // m_d->totmomgev = totmom / CLHEP::GeV;
642 // m_d->totmass = totmass;
643 // //ensure attach:
644 // messageVerbose(" => attach");
645 // if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)<0)
646 // m_d->totmomsep->addChild(m_d->totmomline);
647 // return;
648 // }
649}

◆ userChangedSelection()

void VP1AODSystem::userChangedSelection ( SoCooperativeSelection * sel,
const QSet< SoNode * > & ,
QSet< SoPath * >  )
virtual

Reimplemented from IVP13DSystem.

Definition at line 652 of file VP1AODSystem.cxx.

653{
654 messageVerbose("userChangedSelection begin");
655 if (sel!=m_d->selObjects)
656 return;
657 messageVerbose("userChangedSelection => selObjects!!");
658 //
659 //
660 // if (m_d->common->controller()->printTotMomentumOnMultiTrackSelection()) {
661 // Amg::Vector3D totmom;
662 // Amg::Vector3D totpos;
663 // double totmass;
664 // if (m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass)>0) {
665 // Amg::Vector3D totmomgev = totmom;
666 // totmomgev /= CLHEP::GeV;
667 // message("Total momentum [GeV] : "+str(totmomgev));//Fixme: Eta/phi/etc...
668 // message("Total mass [GeV] : "+str(totmass/CLHEP::GeV));//Fixme: Eta/phi/etc...
669 // }
670 // }
671 //
672 // updateShownTotMomentum();
673}

◆ userClickedOnBgd()

void VP1AODSystem::userClickedOnBgd ( )
virtual

Reimplemented from IVP13DSystem.

Definition at line 546 of file VP1AODSystem.cxx.

547{
548 messageVerbose("userClickedOnBgd");
549 // if (m_d->ascObjSelManager)
550 // m_d->ascObjSelManager->userClickedOnBgd();
551 // m_d->common->setLastSelectedHandle(0);
552}

◆ userDeselectedSingleNode()

void VP1AODSystem::userDeselectedSingleNode ( SoCooperativeSelection * ,
SoNode * ,
SoPath *  )
virtual

Reimplemented from IVP13DSystem.

Definition at line 555 of file VP1AODSystem.cxx.

556{
557 messageVerbose("userDeselectedSingleNode");
558}

◆ userPickedNode()

void VP1AODSystem::userPickedNode ( SoNode * pickedNode,
SoPath * pickedPath )
virtual

Reimplementing methods declared in IVP13DSystem.

Reimplemented from IVP13DSystemSimple.

Definition at line 445 of file VP1AODSystem.cxx.

446{
447 messageVerbose("userPickedNode");
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));
450 return;
451 }
452
453 message("Unknown object clicked");
454}

◆ userSelectedSingleNode()

void VP1AODSystem::userSelectedSingleNode ( SoCooperativeSelection * sel,
SoNode * node,
SoPath * pickedPath )
virtual

Reimplemented from IVP13DSystem.

Definition at line 457 of file VP1AODSystem.cxx.

458{
459 messageVerbose("userSelectedSingleNode");
460
461 if (sel!=m_d->selObjects) {
462 message("userSelectedSingleNode - ERROR, sel=!d->selObjects");
463 return;
464 }
465
466 AODHandleBase* handle = m_d->common->getHandleFromNode(pickedPath);
467 if (!handle) handle = m_d->common->getHandleFromNode(node);
468 if (!handle) {
469 message("ERROR: Unknown handle from path or node.");
470 }
471
472 if (handle) message(handle->clicked());
473
474 // AODHandleBase* pickedHandle(0);
475 // if (!m_d->ascObjSelManager->handleUserSelectedSingleNode(sel,node,pickedPath,pickedHandle)) {
476 // if (sel==m_d->selObjects) {
477 // //Hack to get selections working when representing tracks with tubes:
478 // if (node->getTypeId().isDerivedFrom(SoCylinder::getClassTypeId())) {
479 // pickedPath->pop();
480 // node=pickedPath->getTail();
481 // }
482 // AODHandleBase * handle = m_d->common->getHandleFromNode(node);
483 // if (!handle) {
484 // message("ERROR: Unknown track.");
485 // return;
486 // }
487 // TrackHandle_TrkTrack * handle_trktrack = dynamic_cast<TrackHandle_TrkTrack *>(handle);
488 // if (handle_trktrack&&m_d->selMode==TrackCommonFlags::TRACKFIT) {
489 // messageVerbose("userSelectedSingleNode - find measurements for track fit");
490 //
491 // QList<AODHandleBase*> trackmeas = handle_trktrack->getVisibleMeasurements();
492 //
493 // if (trackmeas.size()==0) message("In refit mode, but no visible measurements found so can't do anything. Perhaps they're not enabled in 'Details'?");
494 // QList<AODHandleBase*> currentsel = m_d->ascObjSelManager->currentSelection();
495 // //If at least one of the track measurements is unselected, we
496 // //select them all. Otherwise we deselect them.
497 // bool oneunselected(false);
498 // for (AODHandleBase* meas : trackmeas) {
499 // if (!currentsel.contains(meas)) {
500 // oneunselected = true;
501 // break;
502 // }
503 // }
504 // QList<const Trk::PrepRawData*> prdSet;
505 // if (oneunselected) {
506 // messageVerbose("userSelectedSingleNode - selecting " +QString::number(trackmeas.size()) + " measurements.");
507 // m_d->ascObjSelManager->ensureSelected(trackmeas);
508 //
509 // // Add PRDs. Need to be careful as they might not exist.
510 // for (AODHandleBase* meas : trackmeas) {
511 // AscObj_TSOS* tsosAsc = dynamic_cast<AscObj_TSOS*>(meas);
512 // if (tsosAsc && tsosAsc->rioOnTrack() && tsosAsc->rioOnTrack()->prepRawData()) prdSet.append(tsosAsc->rioOnTrack()->prepRawData());
513 // }
514 // } else {
515 // messageVerbose("userSelectedSingleNode - deselecting " +QString::number(trackmeas.size()) + " measurements.");
516 // m_d->ascObjSelManager->ensureDeselected(trackmeas);
517 // }
518 // setSelectedPRDs(prdSet); // FIXME - maybe I should append/remove from existing list?
519 //
520 // m_d->selObjects->deselectAll();
521 // } else {
522 // if (m_d->common->controller()->printInfoOnSingleSelection()){
523 // message(handle->clicked());
524 // messageVerbose("Emitting newTrackSelected ");
525 // m_d->common->setLastSelectedHandle(handle);
526 // emit newTrackSelected(*handle);
527 // m_d->common->controller()->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),1); // FIXME - we can do this more cleanly?
528 // }
529 // }
530 // } else {
531 // message("ERROR: Unknown selection.");
532 // return;
533 // }
534 // }
535 // if (m_d->common->controller()->orientAndZoomOnSingleSelection()) {
536 // if (!pickedHandle||!pickedHandle->initiatesOwnZooms()) {
537 // std::set<SoCamera*> cameras = getCameraList();
538 // std::set<SoCamera*>::iterator it,itE = cameras.end();
539 // for (it=cameras.begin();it!=itE;++it)
540 // VP1CameraHelper::animatedZoomToPath(*it,sel,pickedPath,2.0,1.0);
541 // }
542 // }
543}
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

◆ verbose()

bool IVP1System::verbose ( )
inlinestaticinherited

Definition at line 94 of file IVP1System.h.

94{ return s_vp1verbose; }// Returns true if env var VP1_VERBOSE_OUTPUT=1
static const bool s_vp1verbose
Definition IVP1System.h:166

◆ visibleObjectsChanged

void VP1AODSystem::visibleObjectsChanged ( )
privateslot

Definition at line 382 of file VP1AODSystem.cxx.

383{
384 // VisibleObjectToMaterialHelper<Trk::Track>* trackhelper(dynamic_cast< VisibleObjectToMaterialHelper<Trk::Track>* >(sender()));
385 // if (trackhelper) {
386 // //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
387 // // -> and remember not to put const in front of the so materials!!
388 // std::vector< std::pair<const Trk::Track*, const SoMaterial*> > vistracks;
389 // vistracks.reserve(trackhelper->visibleObjects().size());
390 // std::map<const Trk::Track*,SoMaterial*>::const_iterator it, itE = trackhelper->visibleObjects().end();
391 // for (it = trackhelper->visibleObjects().begin();it!=itE;++it)
392 // vistracks.push_back(std::pair<const Trk::Track*, const SoMaterial*>(it->first,it->second));
393 // messageVerbose("Emitting visibleTracksChanged (with nvistracks = "+QString::number(vistracks.size())+")" );
394 // emit visibleTracksChanged(vistracks);
395 // return;
396 // }
397 // VisibleObjectToMaterialHelper<Trk::Segment>* segmenthelper(dynamic_cast<VisibleObjectToMaterialHelper<Trk::Segment>*>(sender()));
398 // if (segmenthelper) {
399 // //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
400 // // -> and remember not to put const in front of the so materials!!
401 // std::vector< std::pair<const Trk::Segment*, const SoMaterial*> > vissegments;
402 // vissegments.reserve(segmenthelper->visibleObjects().size());
403 // std::map<const Trk::Segment*,SoMaterial*>::const_iterator it, itE = segmenthelper->visibleObjects().end();
404 // for (it = segmenthelper->visibleObjects().begin();it!=itE;++it)
405 // vissegments.push_back(std::pair<const Trk::Segment*, const SoMaterial*>(it->first,it->second));
406 // messageVerbose("Emitting visibleSegmentsChanged (with nvissegments = "+QString::number(vissegments.size())+")" );
407 // emit visibleSegmentsChanged(vissegments);
408 // return;
409 // }
410 message("unexpected signal received in visibleObjectsChanged slot");
411}

◆ warnOnDisabledNotifications()

void IVP13DSystemSimple::warnOnDisabledNotifications ( ) const
inherited

Definition at line 221 of file IVP13DSystemSimple.cxx.

222{
223 QList<SoNode*> nodesR;
224 QList<SoNode*> nodesE;
225 m_d->getNodesWithDisabledNotifications(m_d->rootR, nodesR);
226 m_d->getNodesWithDisabledNotifications(m_d->rootE, nodesE);
227 if (!nodesR.isEmpty()) {
228 message("WARNING: Found "+str(nodesR.count())+" node"+QString(nodesR.count()>1?"s":0)+" with disabled notifications in permanent scenegraph:");
229 for (SoNode * node : nodesR)
230 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
231 }
232 if (!nodesE.isEmpty()) {
233 message("WARNING: Found "+str(nodesE.count())+" node"+QString(nodesE.count()>1?"s":0)+" with disabled notifications in event scenegraph:");
234 for (SoNode * node : nodesE)
235 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
236 }
237}

Member Data Documentation

◆ m_d

Imp* VP1AODSystem::m_d
private

Definition at line 79 of file VP1AODSystem.h.

◆ s_vp1verbose

const bool IVP1System::s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivateinherited

Definition at line 166 of file IVP1System.h.


The documentation for this class was generated from the following files: