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

#include <VP1TrackSystem.h>

Inheritance diagram for VP1TrackSystem:
Collaboration diagram for VP1TrackSystem:

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 setApplicableIDProjections (InDetProjFlags::InDetProjPartsFlags pixel, InDetProjFlags::InDetProjPartsFlags sct, InDetProjFlags::InDetProjPartsFlags trt)
void setSelectedPRDs (const QList< const Trk::PrepRawData * > &)
void updateAlignment ()
 Special mode to allow in VP1 alignment tests.
void tracksFromVertexChanged (QList< std::pair< const SoMaterial *, QList< const Trk::Track * > > > &)

Signals

void touchedMuonChambersChanged (const std::set< GeoPVConstLink > &)
void objectInMuonChamberSelected (const GeoPVConstLink &chamberPV)
void visibleTracksChanged (const std::vector< std::pair< const Trk::Track *, const SoMaterial * > > &)
void visibleSegmentsChanged (const std::vector< std::pair< const Trk::Segment *, const SoMaterial * > > &)
void usedIDProjectionsChanged (InDetProjFlags::DetTypeFlags)
void newTrackSelected (const TrackHandleBase &)
void muonChamberT0sChanged (const std::map< GeoPVConstLink, float > &, int)
 The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.
void itemFromSystemSelected ()
void sysmessage (QString) const
void inactiveSystemTurnedActive ()
void needErase ()

Public Member Functions

 VP1TrackSystem (const QString &name="Tracks")
virtual ~VP1TrackSystem ()
void systemcreate (StoreGateSvc *detstore)
void systemuncreate ()
QWidget * buildController ()
void buildEventSceneGraph (StoreGateSvc *sg, SoSeparator *root)
void systemerase ()
QByteArray saveState ()
void restoreFromState (QByteArray)
void userPickedNode (SoNode *pickedNode, SoPath *pickedPath)
void userSelectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
void userDeselectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
void userChangedSelection (SoCooperativeSelection *, const QSet< SoNode * > &, QSet< SoPath * >)
void userClickedOnBgd ()
SoCooperativeSelectionselTracks ()
 Needed in TrackSystemController::objectBrowserClicked(QTreeWidgetItem * item, int)
SoCooperativeSelectionselAscs ()
 Needed in TrackSystemController::objectBrowserClicked(QTreeWidgetItem * item, int)
SoMaterial * materialFromVertex (const TrackHandleBase *trk) const
 Returns the material for the vertex which knows this trackhandle (if known)
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 *sel, 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
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
StoreGateSvcstoreGate () const
StoreGateSvceventStore () const
StoreGateSvcdetectorStore () 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 registerController (QWidget *)

Private Slots

void emitTouchedMuonChambersChanged (const std::set< GeoPVConstLink > &)
void visibleObjectsChanged ()
void updateSelectionMode ()
void updateShownTotMomentum ()
void possiblyEmitUsedIDProjectionsChanged ()
void refit ()
void activateClickedOutside ()

Private Member Functions

void refitFromPRDs (const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
void refitSingleTrack (const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
SoSeparator * getSceneGraph () const
void create (StoreGateSvc *detstore)
void refresh (StoreGateSvc *storegate)
void erase ()
void uncreate ()
void disallowUpdateGUI ()
void allowUpdateGUI ()
void setChannel (IVP1ChannelWidget *)
IVP1ChannelWidgetchannel () 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

Impm_d

Static Private Attributes

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

Detailed Description

Definition at line 36 of file VP1TrackSystem.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 144 of file IVP1System.h.

144{ 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 143 of file IVP1System.h.

Constructor & Destructor Documentation

◆ VP1TrackSystem()

VP1TrackSystem::VP1TrackSystem ( const QString & name = "Tracks")

Definition at line 136 of file VP1TrackSystem.cxx.

138 "System showing all track-like objects.",
139 "Edward.Moyse@cern.ch, Thomas.Kittelmann@cern.ch"), m_d(new Imp)
140{
141 m_d->theclass = this;
142 m_d->sel_tracks = nullptr;
143 m_d->common = nullptr;
144 m_d->totmomsep = nullptr;
145 m_d->totmomline = nullptr;
146 m_d->totmomgev = Amg::Vector3D(0,0,0);
147 m_d->ascObjSelManager = nullptr;
149 m_d->lastEmittedUsedIDProjections = InDetProjFlags::NoDet;
150 const unsigned n_chamber_t0_sources=2;
151 m_d->chamberT0s.resize(n_chamber_t0_sources);
152}
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
const QString & name() const
Eigen::Matrix< double, 3, 1 > Vector3D

◆ ~VP1TrackSystem()

VP1TrackSystem::~VP1TrackSystem ( )
virtual

Definition at line 155 of file VP1TrackSystem.cxx.

156{
157 delete m_d;
158}

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 135 of file IVP1System.cxx.

136{
137 return m_d->activeState;
138}

◆ allowUpdateGUI()

void IVP1System::allowUpdateGUI ( )
privateinherited

Definition at line 256 of file IVP1System.cxx.

257{
258 m_d->allowupdategui=true;
259}

◆ buildController()

QWidget * VP1TrackSystem::buildController ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 191 of file VP1TrackSystem.cxx.

192{
193 messageVerbose("buildController start");
194 TrackSystemController * controller = new TrackSystemController(this);
195 m_d->common = new TrackSysCommonData(this,controller);//Fixme: Do this on-demand in buildeventscenegraph!!
196 controller->setCommonData(m_d->common);
197
198 connect(controller,SIGNAL(selectionModeChanged(TrackCommonFlags::SELECTIONMODE)),this,SLOT(updateSelectionMode()));
200 connect(controller,SIGNAL(showTotMomentumOnMultiTrackSelectionChanged(bool)),this,SLOT(updateShownTotMomentum()));
202
203 connect(controller,SIGNAL(refit()),this,SLOT(refit()));//temp.
204
205 controller->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),0);
206
207 messageVerbose("buildController end");
208 return controller;
209}
void messageVerbose(const QString &) const
void setNumberOfSelectedPRDsAndTracks(unsigned prds, unsigned trks)
void setCommonData(TrackSysCommonData *)
set pointer to the common data
void updateShownTotMomentum()

◆ buildEventSceneGraph()

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

Implements IVP13DSystemSimple.

Definition at line 212 of file VP1TrackSystem.cxx.

213{
214 messageVerbose("buildEventSceneGraph start2");
215
216 // set complexity to a lower value, so that e.g. the straws are manageable
217 SoComplexity * complexity = new SoComplexity;
218 complexity->value.setValue(0.3f);//Fixme: Hardcoded here and elsewhere (fixme: Recheck all complexity values!)
219 root->addChild(complexity);
220 root->addChild(m_d->common->controller()->ascObjDrawStyle());
221 root->addChild(m_d->common->controller()->ascObjComplexity());//this will be inherited to the tracks
222 // (but giving no effect)
223
224 m_d->sel_tracks = new SoCooperativeSelection;
225 m_d->sel_tracks->activePolicy = SoCooperativeSelection::ACTIVE;
226 m_d->sel_tracks->ref();
227 registerSelectionNode(m_d->sel_tracks);
228 // m_d->sel_tracks->addChild(m_d->common->controller()->trackLightModel());
229 // m_d->sel_tracks->addChild(m_d->common->controller()->trackDrawStyle());
230
231 m_d->ascObjSelManager = new AscObjSelectionManager (root,this,m_d->common->controller());
232 m_d->common->setEventData(m_d->ascObjSelManager);//commondata assumes ownership of ascObjMgr.
233 m_d->common->trackLODManager()->setAttachNode(m_d->ascObjSelManager->getAscObjAttachSep());
234
235// reset last selected trk
236 m_d->common->setLastSelectedTrack(nullptr);
238
239 if (!m_d->common->m_textSep) {
240 // FIXME!
241 // std::cout<<"Making new Text sep"<<std::endl;
242 m_d->common->m_textSep = new SoSeparator;
243 m_d->common->m_textSep->setName("TextSep");
244 m_d->common->m_textSep->ref();
245 }
246 root->addChild(m_d->common->m_textSep);
247
248 // Fixme - what if font is missing?
249 SoFont *myFont = new SoFont;
250 myFont->name.setValue("Arial");
251 myFont->size.setValue(12.0);
252 m_d->common->m_textSep->addChild(myFont);
253
254 messageVerbose("createCollections start");
255
256 //Create collection list based on contents of event store, populate gui and apply states:
257 m_d->common->controller()->collWidget()->setCollections(m_d->createCollections());
258
259 //Add collections to event scenegraph:
260 for (VP1StdCollection* col : m_d->common->controller()->collWidget()->collections<VP1StdCollection>())
261 m_d->sel_tracks->addChild(col->collSwitch());
262
263 root->addChild(m_d->sel_tracks);
264 if (!m_d->totmomsep) {
265 m_d->totmomsep = new SoSeparator;
266 m_d->totmomsep->ref();
267 }
268 // m_d->totmomsep->addChild(m_d->common->controller()->trackDrawStyle());
269 root->addChild(m_d->totmomsep);
270
271 //
272 // Loading T0 measurements of muon chambers
273 //
274 // This will loop over all the T0 measurements found for muon chambers.
275 // And it will store them into the 'm_d->chamberT0s' vector.
276 // TODO! But do we still need it here?? Allow this to be configured?
277 //
278 std::vector<std::string> key;
279 key.emplace_back("MooreMuonChamberT0s");
280 key.emplace_back("MboyMuonChamberT0s");
281 assert(m_d->chamberT0s.size()==key.size());
282
283 for (unsigned int i=0; i<m_d->chamberT0s.size(); i++){
284 assert(i<key.size());
285 m_d->chamberT0s.at(i).clear();
286 const Muon::ChamberT0s* chamberT0s(nullptr);
287 const MuonGM::MuonDetectorManager * muonDetManager = VP1DetInfo::muonDetMgr();
288
289 bool isThere = sg->contains<Muon::ChamberT0s>(key[i]);
290 if (isThere && sg->retrieve(chamberT0s, key[i]).isFailure())
291 message("Problems loading ChamberT0s!");
292 else
293 if (!isThere) messageVerbose("No " +QString(key[i].c_str())+ " in event");
294
295 if (chamberT0s ){
296 messageVerbose("Found " +QString(key[i].c_str())+ " Chamber T0s");
297
298 std::vector< std::pair< Identifier, float > >::const_iterator it, itEnd=chamberT0s->getAllT0s().end();
299 for (it=chamberT0s->getAllT0s().begin(); it!=itEnd; ++it){
300
301 // chamber name
302 std::string stationName( muonDetManager->mdtIdHelper()->stationNameString (muonDetManager->mdtIdHelper()->stationName( it->first )) );
303 messageVerbose("station="+QString(stationName.c_str()));
304
305
306 if (muonDetManager->mdtIdHelper()->is_mdt(it->first)){
307 messageDebug("---> getting MDT T0s");
308
309 std::string techStr( muonDetManager->mdtIdHelper()->technologyString(muonDetManager->mdtIdHelper()->technology(it->first)) );
310 //int stName = muonDetManager->mdtIdHelper()->stationName(it->first);
311 float stEta = muonDetManager->mdtIdHelper()->stationEta(it->first);
312 float stPhi = muonDetManager->mdtIdHelper()->stationPhi(it->first);
313 int ml = muonDetManager->mdtIdHelper()->multilayer(it->first);
314 //std::cout << "MDT chamber Info - Identifier: " << it->first << " - technology: " <<techStr << " - stName: " << stName << " - stEta: " << stEta << " - stPhi: " << stPhi << " - ml: " << ml << std::endl;
315 messageDebug( "MDT chamber Info - technology: " + QString::fromStdString(techStr) + " - stName: " + QString::fromStdString(stationName) + " - stEta: " + QString::number(stEta) + " - stPhi: " + QString::number(stPhi) + " - ml: " + QString::number(ml) );
316
317 const MuonGM::MuonReadoutElement* muonDetEl = dynamic_cast<const MuonGM::MuonReadoutElement*>(muonDetManager->getMdtReadoutElement (it->first));
318 if (muonDetEl) m_d->chamberT0s[i][muonDetEl->getMaterialGeom()->getParent()]=it->second;
319 }
320 else if (muonDetManager->cscIdHelper()->is_csc(it->first)){
321 messageDebug("---> getting CSC T0s");
322
323 std::string techStr( muonDetManager->cscIdHelper()->technologyString(muonDetManager->cscIdHelper()->technology(it->first)) );
324 //int stName = muonDetManager->cscIdHelper()->stationName(it->first);
325 float stEta = muonDetManager->cscIdHelper()->stationEta(it->first);
326 float stPhi = muonDetManager->cscIdHelper()->stationPhi(it->first);
327 //std::cout << "CSC chamber Info - Identifier: " << it->first << " - technology: " <<techStr << " - stName: " << stationName << " - stEta: " << stEta << " - stPhi: " << stPhi << std::endl;
328 messageDebug( "MDT chamber Info - technology: " + QString::fromStdString(techStr) + " - stName: " + QString::fromStdString(stationName) + " - stEta: " + QString::number(stEta) + " - stPhi: " + QString::number(stPhi) );
329
330 const MuonGM::CscReadoutElement* muonDetEl = dynamic_cast<const MuonGM::CscReadoutElement*>(muonDetManager->getCscReadoutElement (it->first));
331 if (muonDetEl) m_d->chamberT0s[i][muonDetEl->getMaterialGeom()->getParent()]=it->second;
332 }
333 }
334 emit muonChamberT0sChanged(m_d->chamberT0s[i],i);
335 }
336 }
337
338 messageVerbose("buildEventSceneGraph end");
339}
void registerSelectionNode(SoCooperativeSelection *)
void messageDebug(const QString &) const
void message(const QString &) const
int multilayer(const Identifier &id) const
Access to components of the ID.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
int stationEta(const Identifier &id) const
const std::string & technologyString(const int &index) const
bool is_csc(const Identifier &id) const
int stationPhi(const Identifier &id) const
int technology(const Identifier &id) const
int stationName(const Identifier &id) const
bool is_mdt(const Identifier &id) const
const std::string & stationNameString(const int &index) const
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
static const MuonGM::MuonDetectorManager * muonDetMgr()
void muonChamberT0sChanged(const std::map< GeoPVConstLink, float > &, int)
The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore,...

◆ 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 275 of file IVP1System.cxx.

276{
277 if (VP1Msg::verbose()&&!m_d->channel){
278 messageVerbose("WARNING channel() returning NULL");
279 }
280 assert(m_d->channel);
281 return m_d->channel;
282}
static bool verbose()
Definition VP1Msg.h:31

◆ contact_info()

const QString & IVP1System::contact_info ( ) const
inherited

Definition at line 62 of file IVP1System.cxx.

63{
64 return m_d->contact_info;
65}

◆ controllerWidget()

QWidget * IVP1System::controllerWidget ( )
inherited

Definition at line 202 of file IVP1System.cxx.

202 {
203 if (VP1Msg::verbose()) {
204 messageVerbose("controllerWidget()");
205 messageVerbose("registerController m_d->state==ERASED = "+QString(m_d->state==ERASED?"true":"false"));
206 messageVerbose("registerController m_d->state==REFRESHED = "+QString(m_d->state==REFRESHED?"true":"false"));
207 }
208 assert(m_d->state==REFRESHED||m_d->state==ERASED);
209 return m_d->controller;
210 }

◆ 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 213 of file IVP1System.cxx.

214{
215 if (VP1Msg::verbose()){
216 messageVerbose("deleteController()");
217 }
218 if (m_d->controller)
219 m_d->controller->deleteLater();
220 m_d->controller = 0;
221}

◆ 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:130
path
python interpreter configuration --------------------------------------—
Definition athena.py:128

◆ detectorStore()

StoreGateSvc * IVP1System::detectorStore ( ) const
inherited

Definition at line 318 of file IVP1System.cxx.

319{
321}
static StoreGateSvc * detectorStore()

◆ disallowUpdateGUI()

void IVP1System::disallowUpdateGUI ( )
privateinherited

Definition at line 250 of file IVP1System.cxx.

251{
252 m_d->allowupdategui=false;
253}

◆ emitTouchedMuonChambersChanged

void VP1TrackSystem::emitTouchedMuonChambersChanged ( const std::set< GeoPVConstLink > & s)
privateslot

Definition at line 434 of file VP1TrackSystem.cxx.

435{
436 messageVerbose("Emitting touchedMuonChambersChanged (with ntouchedchambers = "+QString::number(s.size())+")" );
438}
void touchedMuonChambersChanged(const std::set< GeoPVConstLink > &)

◆ 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 312 of file IVP1System.cxx.

313{
315}
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 56 of file IVP1System.cxx.

57{
58 return m_d->information;
59}

◆ isRefreshing()

bool IVP1System::isRefreshing ( )
privateinherited

Definition at line 108 of file IVP1System.cxx.

109{
110 return m_d->refreshing;
111}

◆ itemFromSystemSelected

void IVP13DSystem::itemFromSystemSelected ( )
signalinherited

◆ materialFromVertex()

SoMaterial * VP1TrackSystem::materialFromVertex ( const TrackHandleBase * trk) const

Returns the material for the vertex which knows this trackhandle (if known)

Definition at line 997 of file VP1TrackSystem.cxx.

997 {
998
999 const TrackHandle_TrkTrack* handle = dynamic_cast<const TrackHandle_TrkTrack*>(trk);
1000 if (handle) {
1001 std::map<const Trk::Track*, SoMaterial*>::const_iterator it = m_d->vertexMaterialForTrackBases.find(handle->trkTrackPointer());
1002
1003 if (it!=m_d->vertexMaterialForTrackBases.end()){
1004 return it->second;
1005 }
1006 }
1007 messageVerbose("VP1TrackSystem::materialFromVertex. No matching track handle for handle with pointer="+QString::number((uintptr_t)trk));
1008 return nullptr;
1009}
const Trk::Track * trkTrackPointer() const

◆ message() [1/3]

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

Definition at line 336 of file IVP1System.cxx.

337{
338 if (receivers(SIGNAL(sysmessage(QString))) > 0){
340 }
341 else{
342 std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
343 }
344}
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 400 of file IVP1System.cxx.

401{
402 if (addtostart.isEmpty()) {
403 message(l,addtoend);
404 return;
405 }
406 if (addtoend.isEmpty()) {
407 for (const QString& s : l)
408 message(addtostart+s);
409 } else {
410 for (const QString& s : l)
411 message(addtostart+s+addtoend);
412 }
413}

◆ message() [3/3]

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

Definition at line 362 of file IVP1System.cxx.

363{
364 if (addtoend.isEmpty()) {
365 for (const QString& s : l)
366 message(s);
367 } else {
368 for (const QString& s : l)
369 message(s+addtoend);
370 }
371}

◆ messageDebug() [1/3]

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

Definition at line 347 of file IVP1System.cxx.

348{
349 if (VP1Msg::debug())
350 std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
351}
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 416 of file IVP1System.cxx.

417{
418 if (addtostart.isEmpty()) {
419 messageDebug(l,addtoend);
420 return;
421 }
422 if (addtoend.isEmpty()) {
423 for (const QString& s : l)
424 messageDebug(addtostart+s);
425 } else {
426 for (const QString& s : l)
427 messageDebug(addtostart+s+addtoend);
428 }
429}

◆ messageDebug() [3/3]

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

Definition at line 374 of file IVP1System.cxx.

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

◆ messageVerbose() [1/3]

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

Definition at line 354 of file IVP1System.cxx.

355{
356 if (VP1Msg::verbose())
357 std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
358}
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 432 of file IVP1System.cxx.

433{
434 if (!VP1Msg::verbose())
435 return;
436 if (addtostart.isEmpty()) {
437 messageVerbose(l,addtoend);
438 return;
439 }
440 if (addtoend.isEmpty()) {
441 for (const QString& s : l)
442 messageVerbose(addtostart+s);
443 } else {
444 for (const QString& s : l)
445 messageVerbose(addtostart+s+addtoend);
446 }
447}

◆ messageVerbose() [3/3]

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

Definition at line 386 of file IVP1System.cxx.

387{
388 if (!VP1Msg::verbose())
389 return;
390 if (addtoend.isEmpty()) {
391 for (const QString& s : l)
393 } else {
394 for (const QString& s : l)
395 messageVerbose(s+addtoend);
396 }
397}

◆ muonChamberT0sChanged

void VP1TrackSystem::muonChamberT0sChanged ( const std::map< GeoPVConstLink, float > & ,
int  )
signal

The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.

◆ name()

const QString & IVP1System::name ( ) const
inherited

Definition at line 50 of file IVP1System.cxx.

51{
52 return m_d->name;
53}

◆ needErase

void IVP1System::needErase ( )
signalinherited

◆ newTrackSelected

void VP1TrackSystem::newTrackSelected ( const TrackHandleBase & )
signal

◆ objectInMuonChamberSelected

void VP1TrackSystem::objectInMuonChamberSelected ( const GeoPVConstLink & chamberPV)
signal

◆ possiblyEmitUsedIDProjectionsChanged

void VP1TrackSystem::possiblyEmitUsedIDProjectionsChanged ( )
privateslot

Definition at line 760 of file VP1TrackSystem.cxx.

761{
762 InDetProjFlags::DetTypeFlags usedidprojs = m_d->currentUsedIDProjections();
763 if (m_d->lastEmittedUsedIDProjections == usedidprojs)
764 return;
765 m_d->lastEmittedUsedIDProjections = usedidprojs;
766 usedIDProjectionsChanged(usedidprojs);
767}
void usedIDProjectionsChanged(InDetProjFlags::DetTypeFlags)

◆ refit

void VP1TrackSystem::refit ( )
privateslot

Definition at line 778 of file VP1TrackSystem.cxx.

779{
780 //FIXME: WE NEED A HELPER CLASS!!
781
782 if (!m_d->common||!m_d->common->controller()||!m_d->sel_tracks)//To check that we are actually refreshed
783 return;
784 messageVerbose("Refit requested with mode="+TrackCommonFlags::toString(m_d->common->controller()->fitterMode()));
785 const Trk::ITrackFitter* currentFitter = m_d->common->controller()->trackFitter();
786 if (!currentFitter) {
787 message("ERROR - Aborting refit as no fitter available.");
788 return;
789 }
790
791 QList<const Trk::Track*> fittedtracks;
792 switch (m_d->common->controller()->fitterMode()) {
793 case TrackCommonFlags::FROMPRDS: refitFromPRDs(currentFitter, fittedtracks);break;
794 case TrackCommonFlags::REFITSINGLETRACK: refitSingleTrack(currentFitter, fittedtracks);break;
795 case TrackCommonFlags::EXTENDTRACKWITHPRDS: message("Not yet implemented");break;
796 case TrackCommonFlags::COMBINETWOTRACKS: message("Not yet implemented");break;
797 }
798
799 if (fittedtracks.empty()) return;
800
801 TrackCollHandle_RefittedTracks * newtrackcoll =
802 new TrackCollHandle_RefittedTracks(m_d->common,
803 m_d->common->controller()->nameOfNewlyFittedCollections(),
804 fittedtracks);
805 newtrackcoll->init();
806
807 QList<TrackCollHandleBase*> newcols;
808 newcols << newtrackcoll;
809
810 m_d->common->controller()->collWidget()->addCollections(newcols);
811
812 //Add new collections to event scenegraph and turn them on:
813 for (TrackCollHandleBase* col : newcols) {
814 m_d->sel_tracks->addChild(col->collSwitch());
815 col->setVisible(true);
816 }
817}
virtual void init(VP1MaterialButtonBase *matBut=0)
static QString toString(const SELECTIONMODE &)
void refitSingleTrack(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
void refitFromPRDs(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)

◆ refitFromPRDs()

void VP1TrackSystem::refitFromPRDs ( const Trk::ITrackFitter * currentFitter,
QList< const Trk::Track * > & fittedtracks )
private
Parameters
currentFittercurrentFitter
fittedtracksfittedtracks

Definition at line 819 of file VP1TrackSystem.cxx.

820{
821 // FIXME (or remove, since no one used this I think - EJWM)
822
823 // std::vector<const Trk::PrepRawData*> prdSet;
824 // prdSet.reserve(m_d->selectedPRDs.count());
825 // for (const Trk::PrepRawData* prd : m_d->selectedPRDs)
826 // prdSet.push_back(prd);
827 //
828 // if (prdSet.size()==0) {
829 // message("ERROR - Aborting refit as prdset is empty");
830 // return;
831 // }
832 //
833 // //Get direction from PRD locations
834 // unsigned i1(0),i2(prdSet.size()-1);
835 // const Amg::Vector3D* globPos0 = prdSet.at(i1)->detectorElement()->surface(prdSet.at(i1)->identify()).localToGlobal(prdSet.at(i1)->localPosition());
836 // const Amg::Vector3D* globPos1 = prdSet.at(i2)->detectorElement()->surface(prdSet.at(i2)->identify()).localToGlobal(prdSet.at(i2)->localPosition());
837 // Amg::Vector3D globMom = *globPos1 - *globPos0;
838 //
839 // // Loop and try several momenta
840 // double minMom = 3000.0;
841 // double maxMom = 23000.0;
842 // int numberIterations = 10;
843 // double stepSize = (maxMom-minMom)/static_cast<double>(numberIterations);
844 //
845 // const Trk::Track* bestTrack=0;
846 // bool outlier = m_d->common->controller()->fitterRemoveOutliers();
847 // Trk::ParticleHypothesis hypo = m_d->common->controller()->fitterParticleHypthesis();
848 // for ( double initialMom = minMom ; initialMom<=maxMom ; initialMom+=stepSize){
849 // globMom.setMag(initialMom);
850 // Trk::Perigee params(*globPos0, globMom, 1.0, Amg::Vector3D(0.0,0.0,0.0));
851 //
852 // const Trk::Track* fittedtrk = currentFitter->fit(prdSet, params, outlier,hypo );
853 //
854 // QString mom=QString::number(initialMom);
855 // if (!fittedtrk || !(fittedtrk->fitQuality() ) ) {
856 // message("Track fit failed for seed momentum: "+mom+", outlier="+QString::number(outlier));
857 // delete fittedtrk; //Discard tracks with no FQ (shouldn't ever happen, but need to test)
858 // } else {
859 // if (!bestTrack) {
860 // bestTrack=fittedtrk; // first valid track
861 // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", and is new best track.");
862 // } else {
863 // // okay, have valid fit so now compare to previous track...
864 // const Trk::FitQuality* bestFQ = bestTrack->fitQuality();
865 // const Trk::FitQuality* fittedFQ = fittedtrk->fitQuality();
866 // if ( (fittedFQ->chiSquared()/fittedFQ->doubleNumberDoF())>(bestFQ->chiSquared()/bestFQ->doubleNumberDoF()) ){
867 // delete bestTrack; bestTrack=fittedtrk; // Replace old best track with this one
868 // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", and is new best track.");
869 // } else {
870 // delete fittedtrk; // fit not as good as previous fit.
871 // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", but is not best track.");
872 // }
873 // }
874 // }
875 //
876 // }
877 //
878 // if (!bestTrack) {
879 // message("All fits failed - no resulting track.");
880 // return;
881 // }
882 //
883 // delete globPos0; delete globPos1;
884 //
885 // fittedtracks << bestTrack;
886 //
887 // std::ostringstream s;
888 // s << *bestTrack;
889 // messageVerbose( QString(s.str().c_str()).split('\n'));
890}

◆ refitSingleTrack()

void VP1TrackSystem::refitSingleTrack ( const Trk::ITrackFitter * currentFitter,
QList< const Trk::Track * > & fittedtracks )
private

Definition at line 892 of file VP1TrackSystem.cxx.

893{
894 const TrackHandleBase* handle = m_d->common->lastSelectedTrackHandle();
895 const TrackHandle_TrkTrack* trkhandle = dynamic_cast<const TrackHandle_TrkTrack*>(handle);
896 if (!trkhandle) return; // shouldn't ever happen
897 const Trk::Track* track =trkhandle->trkTrackPointer();
898 if (!track) return; // shouldn't ever happen
899
900 bool outlier = m_d->common->controller()->fitterRemoveOutliers();
901 Trk::ParticleHypothesis hypo = m_d->common->controller()->fitterParticleHypthesis();
902
903 const Trk::Track* fittedtrk =
904 currentFitter->fit(Gaudi::Hive::currentContext(), *track, outlier, hypo).release();
905
906 if (!fittedtrk) {
907 message("Fit failed - no resulting track.");
908 return;
909 }
910
911 fittedtracks << fittedtrk;
912
913 std::ostringstream s;
914 s << *fittedtrk;
915 messageVerbose( QString(s.str().c_str()).split('\n'));
916}
virtual std::unique_ptr< Track > fit(const EventContext &ctx, const Track &track, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=Trk::nonInteracting) const =0
RE-FIT A TRACK.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.

◆ 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 224 of file IVP1System.cxx.

225{
226 if (VP1Msg::verbose()) {
227 messageVerbose("registerController ");
228 messageVerbose("registerController m_d->canregistercontroller = "+QString(m_d->canregistercontroller?"true":"false"));
229 messageVerbose("registerController m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
230 messageVerbose("registerController m_d->controller==0 = "+QString(m_d->controller==0?"true":"false"));
231 messageVerbose("registerController w!=0 = "+QString(w!=0?"true":"false"));
232 }
233 if (!m_d->canregistercontroller)
234 message("ERROR: Please don't register controllers after create().");
235 if (m_d->state!=CONSTRUCTED)
236 message("ERROR: Please only register controllers in CONSTRUCTED state.");
237 if (!w) {
238 message("ERROR: Attempt to register null controller.");
239 return;
240 }
241 if (m_d->controller) {
242 message("ERROR: Attempt to register controller twice.");
243 return;
244 }
245 m_d->controller = w;
246 w->setParent(0);
247}

◆ 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:138

◆ 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 VP1TrackSystem::restoreFromState ( QByteArray ba)
virtual

Reimplemented from IVP1System.

Definition at line 409 of file VP1TrackSystem.cxx.

410{
411 //Version & base state:
412 VP1Deserialise state(ba,this);
413 if (state.version()==0) {
414 //We simply won't support .vp1 files from the old track system.
415 message("Warning: State data has obsolete format - ignoring!");
416 return;
417 }
418 if (state.version()!=1) {
419 message("Warning: State data has wrong format - ignoring!");
420 return;
421 }
422
424
426
427 m_d->common->controller()->restoreSettings(state.restoreByteArray());
428 state.restore(static_cast<VP1CollectionWidget*>(m_d->common->controller()->collWidget()));
429
430 state.disableUnrestoredChecks();//We do the testing in the controller
431}
virtual void restoreFromState(QByteArray)
State state() const

◆ saveState()

QByteArray VP1TrackSystem::saveState ( )
virtual

Reimplemented from IVP1System.

Definition at line 392 of file VP1TrackSystem.cxx.

393{
394 //Version & base state:
395 VP1Serialise serialise(1/*version*/,this);
396 serialise.save(IVP13DSystemSimple::saveState());//Info from base class
397
398 // Actual state info:
400 serialise.save(m_d->common->controller()->saveSettings());
401 serialise.save(static_cast<VP1CollectionWidget*>(m_d->common->controller()->collWidget()));
402
403 serialise.disableUnsavedChecks();//We do the testing in the controller
404
405 return serialise.result();
406}
virtual QByteArray saveState()
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors

◆ selAscs()

◆ selTracks()

SoCooperativeSelection * VP1TrackSystem::selTracks ( )

Needed in TrackSystemController::objectBrowserClicked(QTreeWidgetItem * item, int)

Definition at line 918 of file VP1TrackSystem.cxx.

919{
920 return m_d->sel_tracks;
921}

◆ serviceLocator()

ISvcLocator * IVP1System::serviceLocator ( ) const
inherited

Definition at line 324 of file IVP1System.cxx.

325{
327}
static ISvcLocator * serviceLocator()

◆ setActiveState()

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

Definition at line 162 of file IVP1System.cxx.

163{
164 //First handle case where we dont actually change state. Only
165 //special consideration is OFF->OFF where we have to do something if
166 //we need to erase:
167 if (m_d->activeState==OFF&&s==OFF&&(m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
168 needErase();
169 m_d->channel->emitRefreshInfoChanged();
170 return;
171 } else if (m_d->activeState==s) {
172 m_d->channel->emitRefreshInfoChanged();
173 return;
174 }
175
176 //Ok, we know that we are either ON->OFF or OFF->ON.
177 m_d->activeState = s;
178
179 if (s==ON) {
180 //OFF->ON: We might need a refresh, so send out a signal for the scheduler:
182 } else {
183 //ON->OFF: We might need an erase signal:
184 if ((m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
185 needErase();
186 }
187 }
188 m_d->channel->emitRefreshInfoChanged();
189}
void inactiveSystemTurnedActive()
void needErase()

◆ setApplicableIDProjections

void VP1TrackSystem::setApplicableIDProjections ( InDetProjFlags::InDetProjPartsFlags pixel,
InDetProjFlags::InDetProjPartsFlags sct,
InDetProjFlags::InDetProjPartsFlags trt )
slot

Definition at line 473 of file VP1TrackSystem.cxx.

476{
477 messageVerbose("Signal received in setApplicableIDProjections slot");
479 if (!m_d->common)//After uncreate.
480 return;
481 bool changes(false);
482 if (m_d->common->indetProjHelper_Pixel()->parts() != pixel) {
483 m_d->common->indetProjHelper_Pixel()->setParts(pixel);
484 changes = true;
485 }
486 if (m_d->common->indetProjHelper_SCT()->parts() != sct) {
487 m_d->common->indetProjHelper_SCT()->setParts(sct);
488 changes = true;
489 }
490 if (m_d->common->indetProjHelper_TRT()->parts() != trt) {
491 m_d->common->indetProjHelper_TRT()->setParts(trt);
492 changes = true;
493 }
494
495 if (changes) {
496 messageVerbose(" => Flags changed.");
497 if (m_d->common->controller()) {
498 for( TrackCollHandleBase* collhandle : m_d->common->controller()->collWidget()->collections<TrackCollHandleBase>() )
499 collhandle->updateInDetProjectionsOfAllHandles();
500 }
501 } else {
502 messageVerbose(" => Flags unchanged.");
503 }
504}

◆ setCanRegisterController()

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

Definition at line 285 of file IVP1System.cxx.

286{
287 if (VP1Msg::verbose()){
288 messageVerbose("setCanRegisterController called with"+QString(c?"true":"false"));
289 }
290 m_d->canregistercontroller=c;
291}

◆ setChannel()

void IVP1System::setChannel ( IVP1ChannelWidget * cw)
privateinherited

Definition at line 94 of file IVP1System.cxx.

95{
96 if (VP1Msg::verbose()) {
97 messageVerbose("setChannel ");
98 messageVerbose("setChannel m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
99 messageVerbose("setChannel cw!=0 = "+QString(cw!=0?"true":"false"));
100 }
101 assert(!m_d->channel);
102 assert(cw);
103 assert(m_d->state==CONSTRUCTED);
104 m_d->channel = cw;
105}

◆ setRefreshing()

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

Definition at line 114 of file IVP1System.cxx.

115{
116 if (VP1Msg::verbose()){
117 messageVerbose("setRefreshing() called with b="+QString(b?"true":"false"));
118 }
119 if (b) {
120 assert(m_d->state==ERASED);
121 } else {
122 assert(m_d->state==REFRESHED);
123 }
124 m_d->refreshing = b;
125}

◆ setSelectedPRDs

void VP1TrackSystem::setSelectedPRDs ( const QList< const Trk::PrepRawData * > & s)
slot

Definition at line 770 of file VP1TrackSystem.cxx.

771{
772 m_d->selectedPRDs = s;
773 if (m_d->common&&m_d->common->controller())
774 m_d->common->controller()->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),0);
775}

◆ setState()

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

Definition at line 141 of file IVP1System.cxx.

142{
143#ifndef NDEBUG
144 assert (m_d->state != s);
145 assert(s!=CONSTRUCTED);
146 if (s==REFRESHED) {
147 assert(m_d->state==ERASED);
148 }
149 if (s==ERASED) {
150 assert(m_d->state==REFRESHED||m_d->state==CONSTRUCTED);
151 }
152 if (s==UNCREATED) {
153 assert(m_d->state==ERASED);
154 }
155#endif
156 m_d->state = s;
157 if (s==REFRESHED||s==ERASED)
158 m_d->channel->emitRefreshInfoChanged();
159}

◆ 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 129 of file IVP1System.cxx.

130{
131 return m_d->state;
132}

◆ storeGate()

StoreGateSvc * IVP1System::storeGate ( ) const
inlineinherited

Definition at line 119 of file IVP1System.h.

119{ 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); }

◆ sysmessage

void IVP1System::sysmessage ( QString ) const
signalinherited

◆ systemcreate()

void VP1TrackSystem::systemcreate ( StoreGateSvc * detstore)
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 161 of file VP1TrackSystem.cxx.

162{
163 messageVerbose("systemcreate");
165 m_d->common->controller()->initTools();
166
167 connect(m_d->common->controller(),SIGNAL(shownTrackPartsChanged(TrackCommonFlags::TrackPartsFlags)),
169 connect(m_d->common->controller()->collWidget(),SIGNAL(visibleStdCollectionsChanged(const QList<VP1StdCollection*>&)),
172
173}
void possiblyEmitUsedIDProjectionsChanged()

◆ systemerase()

void VP1TrackSystem::systemerase ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 343 of file VP1TrackSystem.cxx.

344{
345 messageVerbose("systemErase begin");
346
347 m_d->common->controller()->collWidget()->clear();
348 messageVerbose("collWidget cleared");
349
350 if (m_d->common->controller()->trackObjBrowser()) m_d->common->controller()->trackObjBrowser()->clear();
351
352 m_d->common->clearEventData();
353 if (m_d->sel_tracks) {
354 unregisterSelectionNode(m_d->sel_tracks);
355 m_d->sel_tracks->unref();
356 m_d->sel_tracks=nullptr;
357 }
358
359 if (m_d->totmomsep)
360 m_d->totmomsep->removeAllChildren();
361
362 if (m_d->common->m_textSep) // FIXME!
363 m_d->common->m_textSep->removeAllChildren();
364
365 m_d->totmomgev = Amg::Vector3D(0,0,0);
366
367 if (VP1Msg::verbose()) {
370 +" instances of AssociatedObjectHandleBase alive at end of systemerase(). "
371 "(ignore this warning if there is more than one track system instance).");
374 +" instances of TrackHandleBase alive at end of systemerase(). "
375 "(ignore this warning if there is more than one track system instance).");
376 }
377
378 std::map<const Trk::Track*, SoMaterial*>::iterator itMat = m_d->vertexMaterialForTrackBases.begin();
379 std::map<const Trk::Track*, SoMaterial*>::iterator itMatEnd = m_d->vertexMaterialForTrackBases.end();
380 for(;itMat!=itMatEnd;++itMat) {
381 SoMaterial* curmat = itMat->second;
382 curmat->unref();
383 }
384 m_d->vertexMaterialForTrackBases.clear();
385 for (unsigned int i=0;i<m_d->chamberT0s.size();++i)
386 m_d->chamberT0s.at(i).clear();
387
388 messageVerbose("systemErase end");
389}
void unregisterSelectionNode(SoCooperativeSelection *)
static int numberOfInstances()

◆ systemuncreate()

void VP1TrackSystem::systemuncreate ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 176 of file VP1TrackSystem.cxx.

177{
178 messageVerbose("systemuncreate");
179 if (m_d->totmomsep) {
180 m_d->totmomsep->unref();
181 m_d->totmomsep=nullptr;
182 }
183 if (m_d->totmomline) {
184 m_d->totmomline->unref();
185 m_d->totmomline = nullptr;
186 }
187 delete m_d->common; m_d->common = nullptr;
188}

◆ toolSvc()

IToolSvc * IVP1System::toolSvc ( ) const
inherited

Definition at line 330 of file IVP1System.cxx.

331{
332 return VP1AthenaPtrs::toolSvc();
333}
static IToolSvc * toolSvc()

◆ touchedMuonChambersChanged

void VP1TrackSystem::touchedMuonChambersChanged ( const std::set< GeoPVConstLink > & )
signal

◆ tracksFromVertexChanged

void VP1TrackSystem::tracksFromVertexChanged ( QList< std::pair< const SoMaterial *, QList< const Trk::Track * > > > & vertexList)
slot

Definition at line 973 of file VP1TrackSystem.cxx.

973 {
974 messageVerbose("VP1TrackSystem::tracksFromVertexChanged. Got a list THIS big! "+QString::number(vertexList.size()));
975
976 // firstly, by default option to cut tracks by vertex is disabled, so enable:
977 m_d->common->controller()->vertexCutsAllowed(true);
978
979 // do something with vertexList!
980 for (const auto& it : vertexList){
981 SoMaterial* mat = const_cast<SoMaterial*>(it.first);
982 messageVerbose("Number of tracks associated with this vertex= "+QString::number(it.second.size()));
983
984
985 for (const Trk::Track* trk : it.second) {
986 m_d->vertexMaterialForTrackBases[trk]=mat;
987 mat->ref();
988// messageVerbose("Adding TrackHandleBase with pointer= "+QString::number((unsigned int)handle)+" for trk="+QString::number((unsigned int)trk));
989 }
990 }
991
992 // update track collections too.
993 for (TrackCollHandleBase* coll : m_d->common->controller()->collWidget()->collections<TrackCollHandleBase>())
994 if (coll->allowColourByVertex()) coll->updateMaterialOfAllHandles();
995}

◆ 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}

◆ updateAlignment

void VP1TrackSystem::updateAlignment ( )
slot

Special mode to allow in VP1 alignment tests.

Definition at line 923 of file VP1TrackSystem.cxx.

923 {
924 messageVerbose("updateAlignment");
925
926 std::vector<double> values = m_d->common->controller()->alignmentShiftValue();
927 int level = m_d->common->controller()->alignmentShiftLevel();
928
929 messageVerbose("updateAlignment called with level="+QString::number(level));
930 assert (values.size()==6);
931 messageVerbose("0="+QString::number(values[0]));
932 messageVerbose("1="+QString::number(values[1]));
933 messageVerbose("2="+QString::number(values[2]));
934 messageVerbose("3="+QString::number(values[3]));
935 messageVerbose("4="+QString::number(values[4]));
936 messageVerbose("5="+QString::number(values[5]));
937
938 const Trk::TrkDetElementBase* detEl = nullptr;
939
940 // Try to find last selected TSOS
941 if (!m_d->ascObjSelManager) {
942 // this shouldn't happen!
943 message ("No selection manager - giving up.");
944 return;
945 }
946
947 QList<AssociatedObjectHandleBase*> currentsel = m_d->ascObjSelManager->currentSelection();
948 for (AssociatedObjectHandleBase* meas : currentsel) {
949 AscObj_TSOS* tsosAsc = dynamic_cast<AscObj_TSOS*>(meas);
950 if (tsosAsc){
951 if (tsosAsc->rioOnTrack() )
952 detEl= tsosAsc->rioOnTrack()->detectorElement ();
953 else if (tsosAsc->trackStateOnSurface()->trackParameters() )
955 }
956 if (detEl) break; // set, so can skip rest
957 }
958 if (!detEl){
959 messageVerbose("No det Element found");
960
961 return;// Abort!
962 } else {
963 const MdtIdHelper* mdtIdHelper = VP1DetInfo::mdtIDHelper();
964 std::string stationName(mdtIdHelper->stationNameString (mdtIdHelper->stationName(detEl->identify())));
965
966 messageVerbose("Found det Element from station="+QString(stationName.c_str()));
967 }
968
969 // redraw everything;
970 // FIXME
971}
const Trk::RIO_OnTrack * rioOnTrack() const
const Trk::TrackStateOnSurface * trackStateOnSurface() const
Definition AscObj_TSOS.h:65
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
virtual Identifier identify() const =0
Identifier.
static const MdtIdHelper * mdtIDHelper()

◆ updateGUI()

void IVP13DSystemSimple::updateGUI ( )
inlineinherited

Definition at line 89 of file IVP13DSystemSimple.h.

◆ updateSelectionMode

void VP1TrackSystem::updateSelectionMode ( )
privateslot

Definition at line 508 of file VP1TrackSystem.cxx.

509{
510 messageVerbose("updateSelectionMode start");
511 if (!m_d->sel_tracks||!m_d->ascObjSelManager) {
512 messageVerbose("updateSelectionMode Warning: Ignoring due to null pointers.");
513 return;
514 }
515 deselectAll();
516 m_d->ascObjSelManager->deselectAll();
517 m_d->selMode = m_d->common->controller()->selectionMode();//NB: Don't abort if unchanged (we call this method to init)
518 if (m_d->selMode==TrackCommonFlags::TRACKFIT) {
519 messageVerbose("updateSelectionMode => TRACKFIT");
520 m_d->sel_tracks->policy = SoCooperativeSelection::SINGLE;
521 m_d->ascObjSelManager->setMode(AscObjSelectionManager::SHIFT);
522 } else if (m_d->selMode==TrackCommonFlags::MULTITRACK) {
523 messageVerbose("updateSelectionMode => MULTITRACK");
524 m_d->sel_tracks->policy = SoCooperativeSelection::TOGGLE;
525 m_d->ascObjSelManager->setMode(AscObjSelectionManager::SINGLE);
526 } else {
528 message("updateSelectionMode ERROR: Unexpected selection mode flag");
529 messageVerbose("updateSelectionMode => SINGLEOBJECT");
530 m_d->sel_tracks->policy = SoCooperativeSelection::SINGLE;
531 m_d->ascObjSelManager->setMode(AscObjSelectionManager::SINGLE);
532 }
533 messageVerbose("updateSelectionMode end");
534}
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)

◆ updateShownTotMomentum

void VP1TrackSystem::updateShownTotMomentum ( )
privateslot

Definition at line 678 of file VP1TrackSystem.cxx.

679{
680 messageVerbose("updateShownTotMomentum");
681 if (!m_d->common->controller()->showTotMomentumOnMultiTrackSelection()) {
682 //ensure detach:
683 messageVerbose(" => detach");
684 if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
685 m_d->totmomsep->removeChild(m_d->totmomline);
686 return;
687 }
688 Amg::Vector3D totmom;
689 Amg::Vector3D totpos;
690 double totmass;
691 unsigned nused = m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass);
692 if (nused==0) {
693 //ensure detach:
694 messageVerbose(" => detach");
695 if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
696 m_d->totmomsep->removeChild(m_d->totmomline);
697 } else {
698 //ensure correct lineset:
699 Amg::Vector3D p2 = totpos+totmom.unit()*1*CLHEP::m;
700 if (!m_d->totmomline) {
701 m_d->totmomline = new SoLineSet;
702 m_d->totmomline->ref();
703 SoVertexProperty * vertices = new SoVertexProperty;
704 m_d->totmomline->vertexProperty = vertices;
705 m_d->totmomline->numVertices.set1Value(0,2);
706
707 }
708 SoVertexProperty * vertices = static_cast<SoVertexProperty*>(m_d->totmomline->vertexProperty.getValue());
709 vertices->vertex.set1Value(0,totpos.x(),totpos.y(),totpos.z());
710 vertices->vertex.set1Value(1,p2.x(),p2.y(),p2.z());
711 m_d->totmomgev = totmom / CLHEP::GeV;
712 m_d->totmass = totmass;
713 //ensure attach:
714 messageVerbose(" => attach");
715 if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)<0)
716 m_d->totmomsep->addChild(m_d->totmomline);
717 return;
718 }
719
720}

◆ usedIDProjectionsChanged

void VP1TrackSystem::usedIDProjectionsChanged ( InDetProjFlags::DetTypeFlags )
signal

◆ userChangedSelection()

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

Reimplemented from IVP13DSystem.

Definition at line 723 of file VP1TrackSystem.cxx.

724{
725 messageVerbose("userChangedSelection begin");
726 if (sel!=m_d->sel_tracks)
727 return;
728 messageVerbose("userChangedSelection => sel_tracks!!");
729
730
731 if (m_d->common->controller()->printTotMomentumOnMultiTrackSelection()) {
732 Amg::Vector3D totmom;
733 Amg::Vector3D totpos;
734 double totmass;
735 if (m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass)>0) {
736 Amg::Vector3D totmomgev = totmom;
737 totmomgev /= CLHEP::GeV;
738 message("Total momentum [GeV] : "+str(totmomgev));//Fixme: Eta/phi/etc...
739 message("Total mass [GeV] : "+str(totmass/CLHEP::GeV));//Fixme: Eta/phi/etc...
740 }
741 }
742
744}

◆ userClickedOnBgd()

void VP1TrackSystem::userClickedOnBgd ( )
virtual

Reimplemented from IVP13DSystem.

Definition at line 624 of file VP1TrackSystem.cxx.

625{
626 messageVerbose("userClickedOnBgd");
627 if (m_d->ascObjSelManager)
628 m_d->ascObjSelManager->userClickedOnBgd();
629 m_d->common->setLastSelectedTrack(nullptr);
630 QList<const Trk::PrepRawData*> prdSet;
631 setSelectedPRDs(prdSet ); // pass in empty collection. FIXME - this should depend on mode?
632}
void setSelectedPRDs(const QList< const Trk::PrepRawData * > &)

◆ userDeselectedSingleNode()

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

Reimplemented from IVP13DSystem.

Definition at line 635 of file VP1TrackSystem.cxx.

636{
637 messageVerbose("userDeselectedSingleNode");
638}

◆ userPickedNode()

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

Reimplemented from IVP13DSystemSimple.

Definition at line 537 of file VP1TrackSystem.cxx.

538{
539 messageVerbose("userPickedNode");
540 if (pickedNode==m_d->totmomline) {
541 message("Total momentum of selected tracks [GeV]: p = "+str(m_d->totmomgev)+", m = "+str(m_d->totmass/CLHEP::GeV));
542 return;
543 }
544
545 message("Unknown object clicked");
546}

◆ userSelectedSingleNode()

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

Reimplemented from IVP13DSystem.

Definition at line 549 of file VP1TrackSystem.cxx.

550{
551 messageVerbose("userSelectedSingleNode");
552 AssociatedObjectHandleBase* pickedHandle(nullptr);
553 if (!m_d->ascObjSelManager->handleUserSelectedSingleNode(sel,node,pickedPath,pickedHandle)) {
554 if (sel==m_d->sel_tracks) {
555 //Hack to get selections working when representing tracks with tubes:
556 if (node->getTypeId().isDerivedFrom(SoCylinder::getClassTypeId())) {
557 pickedPath->pop();
558 node=pickedPath->getTail();
559 }
560 TrackHandleBase * handle = m_d->common->trackHandle(node);
561 if (!handle) {
562 message("ERROR: Unknown track.");
563 return;
564 }
565 TrackHandle_TrkTrack * handle_trktrack = dynamic_cast<TrackHandle_TrkTrack *>(handle);
566 if (handle_trktrack&&m_d->selMode==TrackCommonFlags::TRACKFIT) {
567 messageVerbose("userSelectedSingleNode - find measurements for track fit");
568
569 QList<AssociatedObjectHandleBase*> trackmeas = handle_trktrack->getVisibleMeasurements();
570
571 if (trackmeas.empty()) message("In refit mode, but no visible measurements found so can't do anything. Perhaps they're not enabled in 'Details'?");
572 QList<AssociatedObjectHandleBase*> currentsel = m_d->ascObjSelManager->currentSelection();
573 //If at least one of the track measurements is unselected, we
574 //select them all. Otherwise we deselect them.
575 bool oneunselected(false);
576 for (AssociatedObjectHandleBase* meas : trackmeas) {
577 if (!currentsel.contains(meas)) {
578 oneunselected = true;
579 break;
580 }
581 }
582 QList<const Trk::PrepRawData*> prdSet;
583 if (oneunselected) {
584 messageVerbose("userSelectedSingleNode - selecting " +QString::number(trackmeas.size()) + " measurements.");
585 m_d->ascObjSelManager->ensureSelected(trackmeas);
586
587 // Add PRDs. Need to be careful as they might not exist.
588 for (AssociatedObjectHandleBase* meas : trackmeas) {
589 AscObj_TSOS* tsosAsc = dynamic_cast<AscObj_TSOS*>(meas);
590 if (tsosAsc && tsosAsc->rioOnTrack() && tsosAsc->rioOnTrack()->prepRawData()) prdSet.append(tsosAsc->rioOnTrack()->prepRawData());
591 }
592 } else {
593 messageVerbose("userSelectedSingleNode - deselecting " +QString::number(trackmeas.size()) + " measurements.");
594 m_d->ascObjSelManager->ensureDeselected(trackmeas);
595 }
596 setSelectedPRDs(prdSet); // FIXME - maybe I should append/remove from existing list?
597
598 m_d->sel_tracks->deselectAll();
599 } else {
600 if (m_d->common->controller()->printInfoOnSingleSelection()){
601 message(handle->clicked());
602 messageVerbose("Emitting newTrackSelected ");
603 m_d->common->setLastSelectedTrack(handle);
604 emit newTrackSelected(*handle);
605 m_d->common->controller()->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),1); // FIXME - we can do this more cleanly?
606 }
607 }
608 } else {
609 message("ERROR: Unknown selection.");
610 return;
611 }
612 }
613 if (m_d->common->controller()->orientAndZoomOnSingleSelection()) {
614 if (!pickedHandle||!pickedHandle->initiatesOwnZooms()) {
615 std::set<SoCamera*> cameras = getCameraList();
616 std::set<SoCamera*>::iterator it,itE = cameras.end();
617 for (it=cameras.begin();it!=itE;++it)
618 VP1CameraHelper::animatedZoomToPath(*it,sel,pickedPath,2.0,1.0);
619 }
620 }
621}
CamList getCameraList()
QList< AssociatedObjectHandleBase * > getVisibleMeasurements() const
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
static VP1CameraHelper * animatedZoomToPath(SoCamera *camera, SoGroup *sceneroot, SoPath *path, double duration_in_secs=1.0, double clipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
void newTrackSelected(const TrackHandleBase &)

◆ verbose()

bool IVP1System::verbose ( )
inlinestaticinherited

Definition at line 86 of file IVP1System.h.

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

◆ visibleObjectsChanged

void VP1TrackSystem::visibleObjectsChanged ( )
privateslot

Definition at line 441 of file VP1TrackSystem.cxx.

442{
443 VisibleObjectToMaterialHelper<Trk::Track>* trackhelper(dynamic_cast< VisibleObjectToMaterialHelper<Trk::Track>* >(sender()));
444 if (trackhelper) {
445 //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
446 // -> and remember not to put const in front of the so materials!!
447 std::vector< std::pair<const Trk::Track*, const SoMaterial*> > vistracks;
448 vistracks.reserve(trackhelper->visibleObjects().size());
449 std::map<const Trk::Track*,SoMaterial*>::const_iterator it, itE = trackhelper->visibleObjects().end();
450 for (it = trackhelper->visibleObjects().begin();it!=itE;++it)
451 vistracks.emplace_back(it->first,it->second);
452 messageVerbose("Emitting visibleTracksChanged (with nvistracks = "+QString::number(vistracks.size())+")" );
453 emit visibleTracksChanged(vistracks);
454 return;
455 }
456 VisibleObjectToMaterialHelper<Trk::Segment>* segmenthelper(dynamic_cast<VisibleObjectToMaterialHelper<Trk::Segment>*>(sender()));
457 if (segmenthelper) {
458 //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
459 // -> and remember not to put const in front of the so materials!!
460 std::vector< std::pair<const Trk::Segment*, const SoMaterial*> > vissegments;
461 vissegments.reserve(segmenthelper->visibleObjects().size());
462 std::map<const Trk::Segment*,SoMaterial*>::const_iterator it, itE = segmenthelper->visibleObjects().end();
463 for (it = segmenthelper->visibleObjects().begin();it!=itE;++it)
464 vissegments.emplace_back(it->first,it->second);
465 messageVerbose("Emitting visibleSegmentsChanged (with nvissegments = "+QString::number(vissegments.size())+")" );
466 emit visibleSegmentsChanged(vissegments);
467 return;
468 }
469 message("unexpected signal received in visibleObjectsChanged slot");
470}
void visibleTracksChanged(const std::vector< std::pair< const Trk::Track *, const SoMaterial * > > &)
void visibleSegmentsChanged(const std::vector< std::pair< const Trk::Segment *, const SoMaterial * > > &)

◆ visibleSegmentsChanged

void VP1TrackSystem::visibleSegmentsChanged ( const std::vector< std::pair< const Trk::Segment *, const SoMaterial * > > & )
signal

◆ visibleTracksChanged

void VP1TrackSystem::visibleTracksChanged ( const std::vector< std::pair< const Trk::Track *, const SoMaterial * > > & )
signal

◆ 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* VP1TrackSystem::m_d
private

Definition at line 102 of file VP1TrackSystem.h.

◆ s_vp1verbose

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

Definition at line 158 of file IVP1System.h.


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