ATLAS Offline Software
VP1TrackSystem.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Implementation of class VP1TrackSystem //
8 // //
9 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10 // Initial version: February 2008 //
11 // //
13 
14 //TODO: Features in old system that are missing now (+ stuff really needed):
15 //
16 // --> short term:
17 // colour by clicked vertex
18 // check inner detector projections
19 //
20 // --> medium term:
21 // refit tracks
22 //
23 // --> longer term:
24 // object browser
25 // sdo's
26 //
27 // soonish: detail levels depending on meas. type, and colour-by
28 // depending on collection.
29 
39 
48 
52 #include "VP1Base/VP1Serialise.h"
53 #include "VP1Base/VP1Deserialise.h"
54 #include "VP1Base/VP1Msg.h"
55 
56 #include "VP1Utils/VP1DetInfo.h"
57 
59 
60 #include <Inventor/nodes/SoSeparator.h>
61 #include <Inventor/nodes/SoMaterial.h>
62 #include <Inventor/nodes/SoSwitch.h>
63 #include <Inventor/nodes/SoComplexity.h>
64 #include <Inventor/nodes/SoLineSet.h>
65 #include <Inventor/nodes/SoVertexProperty.h>
66 #include "Inventor/nodes/SoDrawStyle.h"
67 #include "Inventor/nodes/SoLightModel.h"
68 #include <Inventor/nodes/SoCylinder.h>
69 #include <Inventor/SoPath.h>
70 #include <Inventor/nodes/SoFont.h>
71 
73 #include <sstream>
74 
82 #include "StoreGate/StoreGateSvc.h"
83 
85 //FIXME: ONLY HERE TEMPORARILY. WE NEED A HELPER CLASS!!
87 #include "TrkTrack/Track.h"
96 
97 //____________________________________________________________________
99 public:
105 
106  InDetProjFlags::DetTypeFlags lastEmittedUsedIDProjections;
107  InDetProjFlags::DetTypeFlags currentUsedIDProjections() const;
108 
109  SoSeparator * totmomsep = nullptr;
110  SoLineSet * totmomline = nullptr;
112  double totmass = 0.0;
113 
114  QList<const Trk::PrepRawData*> selectedPRDs;
115 
116  //Return value is number of track handles used for input (e.g. those without valid momentum info are ignored)
117  unsigned calcTotalMomentumOfSelectedHandles(Amg::Vector3D& totmom, Amg::Vector3D& totpos, double& mass) const;
118 
119  template <class T>
120  QList<TrackCollHandleBase*> createSpecificCollections() {
121  QList<TrackCollHandleBase*> l;
122  for (QString name : T::availableCollections(theclass)) {
123  T * col = new T(common,name);
124  col->init();
125  l << col;
126  }
127  return l;
128  }
129  QList<TrackCollHandleBase*> createCollections() {
130  QList<TrackCollHandleBase*> l;
131  l << createSpecificCollections<TrackCollHandle_TrkTrack>();
132  l << createSpecificCollections<TrackCollHandle_TrkSegment>();
133  // theclass->messageVerbose("Creating coll handle for TrackCollHandle_FatrasTruthTracks");
134  // l << createSpecificCollections<TrackCollHandle_FatrasTruthTracks>();
135  // theclass->messageVerbose("Creating coll handle for TrackCollHandle_TruthTracks");
136  l << createSpecificCollections<TrackCollHandle_TruthTracks>();
137  l << createSpecificCollections<TrackCollHandle_SimulationTracks>();
138  // theclass->messageVerbose("Creating coll handle for TrackCollHandle_TrackParticle");
139  l << createSpecificCollections<TrackCollHandle_TrackParticle>();
140  l << createSpecificCollections<TrackCollHandle_xAODTrackParticle>();
141  // theclass->messageVerbose("Creating coll handle for Muons");
142  // l << createSpecificCollections<TrackCollHandle_Muon>();
143  // l << createSpecificCollections<TrackCollHandle_Egamma>();
144 
145  return l;
146  }
147  std::vector<std::map<GeoPVConstLink, float> > chamberT0s;
148  std::map<const Trk::Track*, SoMaterial*> vertexMaterialForTrackBases;
149 };
150 
151 //____________________________________________________________________
154  "System showing all track-like objects.",
155  "Edward.Moyse@cern.ch, Thomas.Kittelmann@cern.ch"), m_d(new Imp)
156 {
157  m_d->theclass = this;
158  m_d->sel_tracks = nullptr;
159  m_d->common = nullptr;
160  m_d->totmomsep = nullptr;
161  m_d->totmomline = nullptr;
162  m_d->totmomgev = Amg::Vector3D(0,0,0);
163  m_d->ascObjSelManager = nullptr;
166  const unsigned n_chamber_t0_sources=2;
167  m_d->chamberT0s.resize(n_chamber_t0_sources);
168 }
169 
170 //____________________________________________________________________
172 {
173  delete m_d;
174 }
175 
176 //____________________________________________________________________
178 {
179  messageVerbose("systemcreate");
182 
183  connect(m_d->common->controller(),SIGNAL(shownTrackPartsChanged(TrackCommonFlags::TrackPartsFlags)),
185  connect(m_d->common->controller()->collWidget(),SIGNAL(visibleStdCollectionsChanged(const QList<VP1StdCollection*>&)),
188 
189 }
190 
191 //____________________________________________________________________
193 {
194  messageVerbose("systemuncreate");
195  if (m_d->totmomsep) {
196  m_d->totmomsep->unref();
197  m_d->totmomsep=nullptr;
198  }
199  if (m_d->totmomline) {
200  m_d->totmomline->unref();
201  m_d->totmomline = nullptr;
202  }
203  delete m_d->common; m_d->common = nullptr;
204 }
205 
206 //____________________________________________________________________
208 {
209  messageVerbose("buildController start");
210  TrackSystemController * controller = new TrackSystemController(this);
211  m_d->common = new TrackSysCommonData(this,controller);//Fixme: Do this on-demand in buildeventscenegraph!!
212  controller->setCommonData(m_d->common);
213 
214  connect(controller,SIGNAL(selectionModeChanged(TrackCommonFlags::SELECTIONMODE)),this,SLOT(updateSelectionMode()));
216  connect(controller,SIGNAL(showTotMomentumOnMultiTrackSelectionChanged(bool)),this,SLOT(updateShownTotMomentum()));
218 
219  connect(controller,SIGNAL(refit()),this,SLOT(refit()));//temp.
220 
221  controller->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),0);
222 
223  messageVerbose("buildController end");
224  return controller;
225 }
226 
227 //____________________________________________________________________
229 {
230  messageVerbose("buildEventSceneGraph start2");
231 
232  // set complexity to a lower value, so that e.g. the straws are manageable
233  SoComplexity * complexity = new SoComplexity;
234  complexity->value.setValue(0.3f);//Fixme: Hardcoded here and elsewhere (fixme: Recheck all complexity values!)
235  root->addChild(complexity);
236  root->addChild(m_d->common->controller()->ascObjDrawStyle());
237  root->addChild(m_d->common->controller()->ascObjComplexity());//this will be inherited to the tracks
238  // (but giving no effect)
239 
242  m_d->sel_tracks->ref();
244  // m_d->sel_tracks->addChild(m_d->common->controller()->trackLightModel());
245  // m_d->sel_tracks->addChild(m_d->common->controller()->trackDrawStyle());
246 
248  m_d->common->setEventData(m_d->ascObjSelManager);//commondata assumes ownership of ascObjMgr.
250 
251 // reset last selected trk
252  m_d->common->setLastSelectedTrack(nullptr);
254 
255  if (!m_d->common->m_textSep) {
256  // FIXME!
257  // std::cout<<"Making new Text sep"<<std::endl;
258  m_d->common->m_textSep = new SoSeparator;
259  m_d->common->m_textSep->setName("TextSep");
260  m_d->common->m_textSep->ref();
261  }
262  root->addChild(m_d->common->m_textSep);
263 
264  // Fixme - what if font is missing?
265  SoFont *myFont = new SoFont;
266  myFont->name.setValue("Arial");
267  myFont->size.setValue(12.0);
268  m_d->common->m_textSep->addChild(myFont);
269 
270  messageVerbose("createCollections start");
271 
272  //Create collection list based on contents of event store, populate gui and apply states:
274 
275  //Add collections to event scenegraph:
277  m_d->sel_tracks->addChild(col->collSwitch());
278 
279  root->addChild(m_d->sel_tracks);
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  //
288  // Loading T0 measurements of muon chambers
289  //
290  // This will loop over all the T0 measurements found for muon chambers.
291  // And it will store them into the 'm_d->chamberT0s' vector.
292  // TODO! But do we still need it here?? Allow this to be configured?
293  //
294  std::vector<std::string> key;
295  key.emplace_back("MooreMuonChamberT0s");
296  key.emplace_back("MboyMuonChamberT0s");
297  assert(m_d->chamberT0s.size()==key.size());
298 
299  for (unsigned int i=0; i<m_d->chamberT0s.size(); i++){
300  assert(i<key.size());
301  m_d->chamberT0s.at(i).clear();
302  const Muon::ChamberT0s* chamberT0s(nullptr);
303  const MuonGM::MuonDetectorManager * muonDetManager = VP1DetInfo::muonDetMgr();
304 
305  bool isThere = sg->contains<Muon::ChamberT0s>(key[i]);
306  if (isThere && sg->retrieve(chamberT0s, key[i]).isFailure())
307  message("Problems loading ChamberT0s!");
308  else
309  if (!isThere) messageVerbose("No " +QString(key[i].c_str())+ " in event");
310 
311  if (chamberT0s ){
312  messageVerbose("Found " +QString(key[i].c_str())+ " Chamber T0s");
313 
314  std::vector< std::pair< Identifier, float > >::const_iterator it, itEnd=chamberT0s->getAllT0s().end();
315  for (it=chamberT0s->getAllT0s().begin(); it!=itEnd; ++it){
316 
317  // chamber name
318  std::string stationName( muonDetManager->mdtIdHelper()->stationNameString (muonDetManager->mdtIdHelper()->stationName( it->first )) );
319  messageVerbose("station="+QString(stationName.c_str()));
320 
321 
322  if (muonDetManager->mdtIdHelper()->is_mdt(it->first)){
323  messageDebug("---> getting MDT T0s");
324 
325  std::string techStr( muonDetManager->mdtIdHelper()->technologyString(muonDetManager->mdtIdHelper()->technology(it->first)) );
326  //int stName = muonDetManager->mdtIdHelper()->stationName(it->first);
327  float stEta = muonDetManager->mdtIdHelper()->stationEta(it->first);
328  float stPhi = muonDetManager->mdtIdHelper()->stationPhi(it->first);
329  int ml = muonDetManager->mdtIdHelper()->multilayer(it->first);
330  //std::cout << "MDT chamber Info - Identifier: " << it->first << " - technology: " <<techStr << " - stName: " << stName << " - stEta: " << stEta << " - stPhi: " << stPhi << " - ml: " << ml << std::endl;
331  messageDebug( "MDT chamber Info - technology: " + QString::fromStdString(techStr) + " - stName: " + QString::fromStdString(stationName) + " - stEta: " + QString::number(stEta) + " - stPhi: " + QString::number(stPhi) + " - ml: " + QString::number(ml) );
332 
333  const MuonGM::MuonReadoutElement* muonDetEl = dynamic_cast<const MuonGM::MuonReadoutElement*>(muonDetManager->getMdtReadoutElement (it->first));
334  if (muonDetEl) m_d->chamberT0s[i][muonDetEl->parentStationPV()]=it->second;
335  }
336  else if (muonDetManager->cscIdHelper()->is_csc(it->first)){
337  messageDebug("---> getting CSC T0s");
338 
339  std::string techStr( muonDetManager->cscIdHelper()->technologyString(muonDetManager->cscIdHelper()->technology(it->first)) );
340  //int stName = muonDetManager->cscIdHelper()->stationName(it->first);
341  float stEta = muonDetManager->cscIdHelper()->stationEta(it->first);
342  float stPhi = muonDetManager->cscIdHelper()->stationPhi(it->first);
343  //std::cout << "CSC chamber Info - Identifier: " << it->first << " - technology: " <<techStr << " - stName: " << stationName << " - stEta: " << stEta << " - stPhi: " << stPhi << std::endl;
344  messageDebug( "MDT chamber Info - technology: " + QString::fromStdString(techStr) + " - stName: " + QString::fromStdString(stationName) + " - stEta: " + QString::number(stEta) + " - stPhi: " + QString::number(stPhi) );
345 
346  const MuonGM::CscReadoutElement* muonDetEl = dynamic_cast<const MuonGM::CscReadoutElement*>(muonDetManager->getCscReadoutElement (it->first));
347  if (muonDetEl) m_d->chamberT0s[i][muonDetEl->parentStationPV()]=it->second;
348  }
349  }
351  }
352  }
353 
354  messageVerbose("buildEventSceneGraph end");
355 }
356 
357 
358 //____________________________________________________________________
360 {
361  messageVerbose("systemErase begin");
362 
364  messageVerbose("collWidget cleared");
365 
367 
369  if (m_d->sel_tracks) {
371  m_d->sel_tracks->unref();
372  m_d->sel_tracks=nullptr;
373  }
374 
375  if (m_d->totmomsep)
376  m_d->totmomsep->removeAllChildren();
377 
378  if (m_d->common->m_textSep) // FIXME!
379  m_d->common->m_textSep->removeAllChildren();
380 
381  m_d->totmomgev = Amg::Vector3D(0,0,0);
382 
383  if (VP1Msg::verbose()) {
386  +" instances of AssociatedObjectHandleBase alive at end of systemerase(). "
387  "(ignore this warning if there is more than one track system instance).");
390  +" instances of TrackHandleBase alive at end of systemerase(). "
391  "(ignore this warning if there is more than one track system instance).");
392  }
393 
396  for(;itMat!=itMatEnd;++itMat) {
397  SoMaterial* curmat = itMat->second;
398  curmat->unref();
399  }
401  for (unsigned int i=0;i<m_d->chamberT0s.size();++i)
402  m_d->chamberT0s.at(i).clear();
403 
404  messageVerbose("systemErase end");
405 }
406 
407 //____________________________________________________________________
409 {
410  //Version & base state:
411  VP1Serialise serialise(1/*version*/,this);
412  serialise.save(IVP13DSystemSimple::saveState());//Info from base class
413 
414  // Actual state info:
418 
419  serialise.disableUnsavedChecks();//We do the testing in the controller
420 
421  return serialise.result();
422 }
423 
424 //____________________________________________________________________
426 {
427  //Version & base state:
428  VP1Deserialise state(ba,this);
429  if (state.version()==0) {
430  //We simply won't support .vp1 files from the old track system.
431  message("Warning: State data has obsolete format - ignoring!");
432  return;
433  }
434  if (state.version()!=1) {
435  message("Warning: State data has wrong format - ignoring!");
436  return;
437  }
438 
440 
441  IVP13DSystemSimple::restoreFromState(state.restoreByteArray());
442 
443  m_d->common->controller()->restoreSettings(state.restoreByteArray());
445 
446  state.disableUnrestoredChecks();//We do the testing in the controller
447 }
448 
449 //____________________________________________________________________
450 void VP1TrackSystem::emitTouchedMuonChambersChanged(const std::set<GeoPVConstLink>& s)
451 {
452  messageVerbose("Emitting touchedMuonChambersChanged (with ntouchedchambers = "+QString::number(s.size())+")" );
454 }
455 
456 //____________________________________________________________________
458 {
460  if (trackhelper) {
461  //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
462  // -> and remember not to put const in front of the so materials!!
463  std::vector< std::pair<const Trk::Track*, const SoMaterial*> > vistracks;
464  vistracks.reserve(trackhelper->visibleObjects().size());
465  std::map<const Trk::Track*,SoMaterial*>::const_iterator it, itE = trackhelper->visibleObjects().end();
466  for (it = trackhelper->visibleObjects().begin();it!=itE;++it)
467  vistracks.emplace_back(it->first,it->second);
468  messageVerbose("Emitting visibleTracksChanged (with nvistracks = "+QString::number(vistracks.size())+")" );
469  emit visibleTracksChanged(vistracks);
470  return;
471  }
473  if (segmenthelper) {
474  //Fixme: For now we re-encode in a vector, to get old signal/slot signatures. We should change that!
475  // -> and remember not to put const in front of the so materials!!
476  std::vector< std::pair<const Trk::Segment*, const SoMaterial*> > vissegments;
477  vissegments.reserve(segmenthelper->visibleObjects().size());
478  std::map<const Trk::Segment*,SoMaterial*>::const_iterator it, itE = segmenthelper->visibleObjects().end();
479  for (it = segmenthelper->visibleObjects().begin();it!=itE;++it)
480  vissegments.emplace_back(it->first,it->second);
481  messageVerbose("Emitting visibleSegmentsChanged (with nvissegments = "+QString::number(vissegments.size())+")" );
482  emit visibleSegmentsChanged(vissegments);
483  return;
484  }
485  message("unexpected signal received in visibleObjectsChanged slot");
486 }
487 
488 //____________________________________________________________________
489 void VP1TrackSystem::setApplicableIDProjections( InDetProjFlags::InDetProjPartsFlags pixel,
490  InDetProjFlags::InDetProjPartsFlags sct,
491  InDetProjFlags::InDetProjPartsFlags trt )
492 {
493  messageVerbose("Signal received in setApplicableIDProjections slot");
495  if (!m_d->common)//After uncreate.
496  return;
497  bool changes(false);
498  if (m_d->common->indetProjHelper_Pixel()->parts() != pixel) {
500  changes = true;
501  }
502  if (m_d->common->indetProjHelper_SCT()->parts() != sct) {
504  changes = true;
505  }
506  if (m_d->common->indetProjHelper_TRT()->parts() != trt) {
508  changes = true;
509  }
510 
511  if (changes) {
512  messageVerbose(" => Flags changed.");
513  if (m_d->common->controller()) {
515  collhandle->updateInDetProjectionsOfAllHandles();
516  }
517  } else {
518  messageVerbose(" => Flags unchanged.");
519  }
520 }
521 
522 
523 //____________________________________________________________________
525 {
526  messageVerbose("updateSelectionMode start");
527  if (!m_d->sel_tracks||!m_d->ascObjSelManager) {
528  messageVerbose("updateSelectionMode Warning: Ignoring due to null pointers.");
529  return;
530  }
531  deselectAll();
533  m_d->selMode = m_d->common->controller()->selectionMode();//NB: Don't abort if unchanged (we call this method to init)
535  messageVerbose("updateSelectionMode => TRACKFIT");
536  m_d->sel_tracks->policy = SoCooperativeSelection::SINGLE;
539  messageVerbose("updateSelectionMode => MULTITRACK");
540  m_d->sel_tracks->policy = SoCooperativeSelection::TOGGLE;
542  } else {
544  message("updateSelectionMode ERROR: Unexpected selection mode flag");
545  messageVerbose("updateSelectionMode => SINGLEOBJECT");
546  m_d->sel_tracks->policy = SoCooperativeSelection::SINGLE;
548  }
549  messageVerbose("updateSelectionMode end");
550 }
551 
552 //____________________________________________________________________
553 void VP1TrackSystem::userPickedNode(SoNode* pickedNode, SoPath* /*pickedPath*/)
554 {
555  messageVerbose("userPickedNode");
556  if (pickedNode==m_d->totmomline) {
557  message("Total momentum of selected tracks [GeV]: p = "+str(m_d->totmomgev)+", m = "+str(m_d->totmass/CLHEP::GeV));
558  return;
559  }
560 
561  message("Unknown object clicked");
562 }
563 
564 //____________________________________________________________________
566 {
567  messageVerbose("userSelectedSingleNode");
568  AssociatedObjectHandleBase* pickedHandle(nullptr);
569  if (!m_d->ascObjSelManager->handleUserSelectedSingleNode(sel,node,pickedPath,pickedHandle)) {
570  if (sel==m_d->sel_tracks) {
571  //Hack to get selections working when representing tracks with tubes:
572  if (node->getTypeId().isDerivedFrom(SoCylinder::getClassTypeId())) {
573  pickedPath->pop();
574  node=pickedPath->getTail();
575  }
576  TrackHandleBase * handle = m_d->common->trackHandle(node);
577  if (!handle) {
578  message("ERROR: Unknown track.");
579  return;
580  }
581  TrackHandle_TrkTrack * handle_trktrack = dynamic_cast<TrackHandle_TrkTrack *>(handle);
582  if (handle_trktrack&&m_d->selMode==TrackCommonFlags::TRACKFIT) {
583  messageVerbose("userSelectedSingleNode - find measurements for track fit");
584 
585  QList<AssociatedObjectHandleBase*> trackmeas = handle_trktrack->getVisibleMeasurements();
586 
587  if (trackmeas.empty()) message("In refit mode, but no visible measurements found so can't do anything. Perhaps they're not enabled in 'Details'?");
588  QList<AssociatedObjectHandleBase*> currentsel = m_d->ascObjSelManager->currentSelection();
589  //If at least one of the track measurements is unselected, we
590  //select them all. Otherwise we deselect them.
591  bool oneunselected(false);
592  for (AssociatedObjectHandleBase* meas : trackmeas) {
593  if (!currentsel.contains(meas)) {
594  oneunselected = true;
595  break;
596  }
597  }
598  QList<const Trk::PrepRawData*> prdSet;
599  if (oneunselected) {
600  messageVerbose("userSelectedSingleNode - selecting " +QString::number(trackmeas.size()) + " measurements.");
601  m_d->ascObjSelManager->ensureSelected(trackmeas);
602 
603  // Add PRDs. Need to be careful as they might not exist.
604  for (AssociatedObjectHandleBase* meas : trackmeas) {
605  AscObj_TSOS* tsosAsc = dynamic_cast<AscObj_TSOS*>(meas);
606  if (tsosAsc && tsosAsc->rioOnTrack() && tsosAsc->rioOnTrack()->prepRawData()) prdSet.append(tsosAsc->rioOnTrack()->prepRawData());
607  }
608  } else {
609  messageVerbose("userSelectedSingleNode - deselecting " +QString::number(trackmeas.size()) + " measurements.");
611  }
612  setSelectedPRDs(prdSet); // FIXME - maybe I should append/remove from existing list?
613 
614  m_d->sel_tracks->deselectAll();
615  } else {
617  message(handle->clicked());
618  messageVerbose("Emitting newTrackSelected ");
619  m_d->common->setLastSelectedTrack(handle);
620  emit newTrackSelected(*handle);
621  m_d->common->controller()->setNumberOfSelectedPRDsAndTracks(m_d->selectedPRDs.count(),1); // FIXME - we can do this more cleanly?
622  }
623  }
624  } else {
625  message("ERROR: Unknown selection.");
626  return;
627  }
628  }
630  if (!pickedHandle||!pickedHandle->initiatesOwnZooms()) {
631  std::set<SoCamera*> cameras = getCameraList();
632  std::set<SoCamera*>::iterator it,itE = cameras.end();
633  for (it=cameras.begin();it!=itE;++it)
634  VP1CameraHelper::animatedZoomToPath(*it,sel,pickedPath,2.0,1.0);
635  }
636  }
637 }
638 
639 //____________________________________________________________________
641 {
642  messageVerbose("userClickedOnBgd");
643  if (m_d->ascObjSelManager)
645  m_d->common->setLastSelectedTrack(nullptr);
646  QList<const Trk::PrepRawData*> prdSet;
647  setSelectedPRDs(prdSet ); // pass in empty collection. FIXME - this should depend on mode?
648 }
649 
650 //____________________________________________________________________
652 {
653  messageVerbose("userDeselectedSingleNode");
654 }
655 
656 //____________________________________________________________________
658 {
659  totmom = Amg::Vector3D(0,0,0);
660  totpos = Amg::Vector3D(0,0,0);
661  mass = 0;
662  if (!sel_tracks)
663  return 0;
664  unsigned nused(0);
665  double totenergy(0);
666  for (int i = 0; i < sel_tracks->getList()->getLength(); ++i) {
667  SoFullPath *fPath = static_cast<SoFullPath *>((*(sel_tracks->getList()))[i]);
668  TrackHandleBase * handle = common->trackHandle(fPath?fPath->getTail():nullptr);
669  if (!handle)
670  continue;
671  Amg::Vector3D mom = handle->momentum();
672  if (mom.mag2()==0.0)
673  continue;
674  //Fixme: Get actual position of perigee!!
675  std::optional<Amg::Vector3D> pos = handle->startPoint();
676  if (!pos)
677  continue;
678  ++nused;
679  totmom += mom;
680  totpos += *pos;
681  mass = handle->hasMass() ? handle->mass() : 0;
682  totenergy += sqrt(mom.mag2() + mass*mass);
683  }
684  if (nused>1) {
685  double msq = totenergy*totenergy - totmom.mag2();
686  mass = (msq<0?-1.0:1.0)*sqrt(fabs(msq));
687  totpos /= nused;
688  }
689  return nused;
690 }
691 
692 
693 //____________________________________________________________________
695 {
696  messageVerbose("updateShownTotMomentum");
698  //ensure detach:
699  messageVerbose(" => detach");
700  if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
701  m_d->totmomsep->removeChild(m_d->totmomline);
702  return;
703  }
704  Amg::Vector3D totmom;
705  Amg::Vector3D totpos;
706  double totmass;
707  unsigned nused = m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass);
708  if (nused==0) {
709  //ensure detach:
710  messageVerbose(" => detach");
711  if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)>-1)
712  m_d->totmomsep->removeChild(m_d->totmomline);
713  } else {
714  //ensure correct lineset:
715  Amg::Vector3D p2 = totpos+totmom.unit()*1*CLHEP::m;
716  if (!m_d->totmomline) {
717  m_d->totmomline = new SoLineSet;
718  m_d->totmomline->ref();
719  SoVertexProperty * vertices = new SoVertexProperty;
720  m_d->totmomline->vertexProperty = vertices;
721  m_d->totmomline->numVertices.set1Value(0,2);
722 
723  }
724  SoVertexProperty * vertices = static_cast<SoVertexProperty*>(m_d->totmomline->vertexProperty.getValue());
725  vertices->vertex.set1Value(0,totpos.x(),totpos.y(),totpos.z());
726  vertices->vertex.set1Value(1,p2.x(),p2.y(),p2.z());
727  m_d->totmomgev = totmom / CLHEP::GeV;
728  m_d->totmass = totmass;
729  //ensure attach:
730  messageVerbose(" => attach");
731  if (m_d->totmomsep&&m_d->totmomline&&m_d->totmomsep->findChild(m_d->totmomline)<0)
732  m_d->totmomsep->addChild(m_d->totmomline);
733  return;
734  }
735 
736 }
737 
738 //____________________________________________________________________
739 void VP1TrackSystem::userChangedSelection(SoCooperativeSelection* sel, QSet<SoNode*> /*nodes*/, QSet<SoPath*>/*paths*/)
740 {
741  messageVerbose("userChangedSelection begin");
742  if (sel!=m_d->sel_tracks)
743  return;
744  messageVerbose("userChangedSelection => sel_tracks!!");
745 
746 
748  Amg::Vector3D totmom;
749  Amg::Vector3D totpos;
750  double totmass;
751  if (m_d->calcTotalMomentumOfSelectedHandles(totmom,totpos,totmass)>0) {
752  Amg::Vector3D totmomgev = totmom;
753  totmomgev /= CLHEP::GeV;
754  message("Total momentum [GeV] : "+str(totmomgev));//Fixme: Eta/phi/etc...
755  message("Total mass [GeV] : "+str(totmass/CLHEP::GeV));//Fixme: Eta/phi/etc...
756  }
757  }
758 
760 }
761 
762 
763 
764 
765 //____________________________________________________________________
766 InDetProjFlags::DetTypeFlags VP1TrackSystem::Imp::currentUsedIDProjections() const
767 {
768  if (common->controller()->collWidget()->visibleStdCollections().isEmpty())
769  return InDetProjFlags::NoDet;
770  if (common->controller()->shownTrackParts() & TrackCommonFlags::InDetProjections)
772  return InDetProjFlags::NoDet;
773 }
774 
775 //____________________________________________________________________
777 {
778  InDetProjFlags::DetTypeFlags usedidprojs = m_d->currentUsedIDProjections();
779  if (m_d->lastEmittedUsedIDProjections == usedidprojs)
780  return;
781  m_d->lastEmittedUsedIDProjections = usedidprojs;
782  usedIDProjectionsChanged(usedidprojs);
783 }
784 
785 //____________________________________________________________________
786 void VP1TrackSystem::setSelectedPRDs(const QList<const Trk::PrepRawData*>& s)
787 {
788  m_d->selectedPRDs = s;
789  if (m_d->common&&m_d->common->controller())
791 }
792 
793 //____________________________________________________________________
795 {
796  //FIXME: WE NEED A HELPER CLASS!!
797 
798  if (!m_d->common||!m_d->common->controller()||!m_d->sel_tracks)//To check that we are actually refreshed
799  return;
800  messageVerbose("Refit requested with mode="+TrackCommonFlags::toString(m_d->common->controller()->fitterMode()));
801  const Trk::ITrackFitter* currentFitter = m_d->common->controller()->trackFitter();
802  if (!currentFitter) {
803  message("ERROR - Aborting refit as no fitter available.");
804  return;
805  }
806 
807  QList<const Trk::Track*> fittedtracks;
808  switch (m_d->common->controller()->fitterMode()) {
809  case TrackCommonFlags::FROMPRDS: refitFromPRDs(currentFitter, fittedtracks);break;
810  case TrackCommonFlags::REFITSINGLETRACK: refitSingleTrack(currentFitter, fittedtracks);break;
811  case TrackCommonFlags::EXTENDTRACKWITHPRDS: message("Not yet implemented");break;
812  case TrackCommonFlags::COMBINETWOTRACKS: message("Not yet implemented");break;
813  }
814 
815  if (fittedtracks.empty()) return;
816 
817  TrackCollHandle_RefittedTracks * newtrackcoll =
820  fittedtracks);
821  newtrackcoll->init();
822 
823  QList<TrackCollHandleBase*> newcols;
824  newcols << newtrackcoll;
825 
826  m_d->common->controller()->collWidget()->addCollections(newcols);
827 
828  //Add new collections to event scenegraph and turn them on:
829  for (TrackCollHandleBase* col : newcols) {
830  m_d->sel_tracks->addChild(col->collSwitch());
831  col->setVisible(true);
832  }
833 }
834 
835 void VP1TrackSystem::refitFromPRDs(const Trk::ITrackFitter* , QList<const Trk::Track*>& )
836 {
837  // FIXME (or remove, since no one used this I think - EJWM)
838 
839  // std::vector<const Trk::PrepRawData*> prdSet;
840  // prdSet.reserve(m_d->selectedPRDs.count());
841  // for (const Trk::PrepRawData* prd : m_d->selectedPRDs)
842  // prdSet.push_back(prd);
843  //
844  // if (prdSet.size()==0) {
845  // message("ERROR - Aborting refit as prdset is empty");
846  // return;
847  // }
848  //
849  // //Get direction from PRD locations
850  // unsigned i1(0),i2(prdSet.size()-1);
851  // const Amg::Vector3D* globPos0 = prdSet.at(i1)->detectorElement()->surface(prdSet.at(i1)->identify()).localToGlobal(prdSet.at(i1)->localPosition());
852  // const Amg::Vector3D* globPos1 = prdSet.at(i2)->detectorElement()->surface(prdSet.at(i2)->identify()).localToGlobal(prdSet.at(i2)->localPosition());
853  // Amg::Vector3D globMom = *globPos1 - *globPos0;
854  //
855  // // Loop and try several momenta
856  // double minMom = 3000.0;
857  // double maxMom = 23000.0;
858  // int numberIterations = 10;
859  // double stepSize = (maxMom-minMom)/static_cast<double>(numberIterations);
860  //
861  // const Trk::Track* bestTrack=0;
862  // bool outlier = m_d->common->controller()->fitterRemoveOutliers();
863  // Trk::ParticleHypothesis hypo = m_d->common->controller()->fitterParticleHypthesis();
864  // for ( double initialMom = minMom ; initialMom<=maxMom ; initialMom+=stepSize){
865  // globMom.setMag(initialMom);
866  // Trk::Perigee params(*globPos0, globMom, 1.0, Amg::Vector3D(0.0,0.0,0.0));
867  //
868  // const Trk::Track* fittedtrk = currentFitter->fit(prdSet, params, outlier,hypo );
869  //
870  // QString mom=QString::number(initialMom);
871  // if (!fittedtrk || !(fittedtrk->fitQuality() ) ) {
872  // message("Track fit failed for seed momentum: "+mom+", outlier="+QString::number(outlier));
873  // delete fittedtrk; //Discard tracks with no FQ (shouldn't ever happen, but need to test)
874  // } else {
875  // if (!bestTrack) {
876  // bestTrack=fittedtrk; // first valid track
877  // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", and is new best track.");
878  // } else {
879  // // okay, have valid fit so now compare to previous track...
880  // const Trk::FitQuality* bestFQ = bestTrack->fitQuality();
881  // const Trk::FitQuality* fittedFQ = fittedtrk->fitQuality();
882  // if ( (fittedFQ->chiSquared()/fittedFQ->doubleNumberDoF())>(bestFQ->chiSquared()/bestFQ->doubleNumberDoF()) ){
883  // delete bestTrack; bestTrack=fittedtrk; // Replace old best track with this one
884  // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", and is new best track.");
885  // } else {
886  // delete fittedtrk; // fit not as good as previous fit.
887  // message("Track fit succeeded for seed momentum:"+mom+", outlier="+QString::number(outlier)+", but is not best track.");
888  // }
889  // }
890  // }
891  //
892  // }
893  //
894  // if (!bestTrack) {
895  // message("All fits failed - no resulting track.");
896  // return;
897  // }
898  //
899  // delete globPos0; delete globPos1;
900  //
901  // fittedtracks << bestTrack;
902  //
903  // std::ostringstream s;
904  // s << *bestTrack;
905  // messageVerbose( QString(s.str().c_str()).split('\n'));
906 }
907 
908 void VP1TrackSystem::refitSingleTrack(const Trk::ITrackFitter* currentFitter, QList<const Trk::Track*>& fittedtracks)
909 {
911  const TrackHandle_TrkTrack* trkhandle = dynamic_cast<const TrackHandle_TrkTrack*>(handle);
912  if (!trkhandle) return; // shouldn't ever happen
913  const Trk::Track* track =trkhandle->trkTrackPointer();
914  if (!track) return; // shouldn't ever happen
915 
916  bool outlier = m_d->common->controller()->fitterRemoveOutliers();
918 
919  const Trk::Track* fittedtrk =
920  currentFitter->fit(Gaudi::Hive::currentContext(), *track, outlier, hypo).release();
921 
922  if (!fittedtrk) {
923  message("Fit failed - no resulting track.");
924  return;
925  }
926 
927  fittedtracks << fittedtrk;
928 
929  std::ostringstream s;
930  s << *fittedtrk;
931  messageVerbose( QString(s.str().c_str()).split('\n'));
932 }
933 
935 {
936  return m_d->sel_tracks;
937 }
938 
940  messageVerbose("updateAlignment");
941 
942  std::vector<double> values = m_d->common->controller()->alignmentShiftValue();
944 
945  messageVerbose("updateAlignment called with level="+QString::number(level));
946  assert (values.size()==6);
953 
954  const Trk::TrkDetElementBase* detEl = nullptr;
955 
956  // Try to find last selected TSOS
957  if (!m_d->ascObjSelManager) {
958  // this shouldn't happen!
959  message ("No selection manager - giving up.");
960  return;
961  }
962 
963  QList<AssociatedObjectHandleBase*> currentsel = m_d->ascObjSelManager->currentSelection();
964  for (AssociatedObjectHandleBase* meas : currentsel) {
965  AscObj_TSOS* tsosAsc = dynamic_cast<AscObj_TSOS*>(meas);
966  if (tsosAsc){
967  if (tsosAsc->rioOnTrack() )
968  detEl= tsosAsc->rioOnTrack()->detectorElement ();
969  else if (tsosAsc->trackStateOnSurface()->trackParameters() )
971  }
972  if (detEl) break; // set, so can skip rest
973  }
974  if (!detEl){
975  messageVerbose("No det Element found");
976 
977  return;// Abort!
978  } else {
979  const MdtIdHelper* mdtIdHelper = VP1DetInfo::mdtIDHelper();
980  std::string stationName(mdtIdHelper->stationNameString (mdtIdHelper->stationName(detEl->identify())));
981 
982  messageVerbose("Found det Element from station="+QString(stationName.c_str()));
983  }
984 
985  // redraw everything;
986  // FIXME
987 }
988 
989 void VP1TrackSystem::tracksFromVertexChanged(QList< std::pair<const SoMaterial*, QList< const Trk::Track*> > >& vertexList){
990  messageVerbose("VP1TrackSystem::tracksFromVertexChanged. Got a list THIS big! "+QString::number(vertexList.size()));
991 
992  // firstly, by default option to cut tracks by vertex is disabled, so enable:
994 
995  // do something with vertexList!
996  for (const auto& it : vertexList){
997  SoMaterial* mat = const_cast<SoMaterial*>(it.first);
998  messageVerbose("Number of tracks associated with this vertex= "+QString::number(it.second.size()));
999 
1000 
1001  for (const Trk::Track* trk : it.second) {
1003  mat->ref();
1004 // messageVerbose("Adding TrackHandleBase with pointer= "+QString::number((unsigned int)handle)+" for trk="+QString::number((unsigned int)trk));
1005  }
1006  }
1007 
1008  // update track collections too.
1010  if (coll->allowColourByVertex()) coll->updateMaterialOfAllHandles();
1011 }
1012 
1014 
1015  const TrackHandle_TrkTrack* handle = dynamic_cast<const TrackHandle_TrkTrack*>(trk);
1016  if (handle) {
1017  std::map<const Trk::Track*, SoMaterial*>::const_iterator it = m_d->vertexMaterialForTrackBases.find(handle->trkTrackPointer());
1018 
1019  if (it!=m_d->vertexMaterialForTrackBases.end()){
1020  return it->second;
1021  }
1022  }
1023  messageVerbose("VP1TrackSystem::materialFromVertex. No matching track handle for handle with pointer="+QString::number((uintptr_t)trk));
1024  return nullptr;
1025 }
1026 
1027 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VP1Serialise.h
VP1TrackSystem::Imp::lastEmittedUsedIDProjections
InDetProjFlags::DetTypeFlags lastEmittedUsedIDProjections
Definition: VP1TrackSystem.cxx:106
VP1TrackSystem::~VP1TrackSystem
virtual ~VP1TrackSystem()
Definition: VP1TrackSystem.cxx:171
VP1TrackSystem::userChangedSelection
void userChangedSelection(SoCooperativeSelection *, QSet< SoNode * >, QSet< SoPath * >)
Definition: VP1TrackSystem.cxx:739
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
TrackCommonFlags::InDetProjections
@ InDetProjections
Definition: TrackCommonFlags.h:27
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
VP1TrackSystem::m_d
Imp * m_d
Definition: VP1TrackSystem.h:101
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:33
MdtReadoutElement.h
StoreGateSvc::contains
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
TrackCollHandleBase
Definition: TrackCollHandleBase.h:49
InDetProjHelper::parts
InDetProjFlags::InDetProjPartsFlags parts() const
Definition: InDetProjHelper.cxx:268
AscObjSelectionManager::deselectAll
void deselectAll()
Definition: AscObjSelectionManager.cxx:326
VP1AvailableToolsHelper.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1TrackSystem::updateShownTotMomentum
void updateShownTotMomentum()
Definition: VP1TrackSystem.cxx:694
AscObjSelectionManager::handleUserSelectedSingleNode
bool handleUserSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *, AssociatedObjectHandleBase *&)
Definition: AscObjSelectionManager.cxx:233
VP1Deserialise.h
VP1Serialise
Definition: VP1Serialise.h:45
TrackSysCommonData::controller
TrackSystemController * controller() const
Definition: TrackSysCommonData.h:116
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
IVP13DSystemSimple
Definition: IVP13DSystemSimple.h:24
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrackHandleBase::hasMass
bool hasMass() const
Definition: TrackHandleBase.h:100
TrackParameters.h
MeasurementBase.h
InDetProjHelper.h
TrackSystemController::vertexCutsAllowed
void vertexCutsAllowed(bool)
Definition: TrackSystemController.cxx:1772
TrackSystemController.h
RoiUtil::serialise
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
Definition: RoiSerialise.cxx:45
VP1CollectionWidget::addCollections
void addCollections(QList< VP1Collection * >, bool applySavedStates=true)
Definition: VP1CollectionWidget.cxx:237
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
VP1TrackSystem::visibleObjectsChanged
void visibleObjectsChanged()
Definition: VP1TrackSystem.cxx:457
TrackCommonFlags::EXTENDTRACKWITHPRDS
@ EXTENDTRACKWITHPRDS
Definition: TrackCommonFlags.h:36
VP1TrackSystem::VP1TrackSystem
VP1TrackSystem(const QString &name="Tracks")
Definition: VP1TrackSystem.cxx:152
TrackSysCommonData::trackLODManager
TrackLODManager * trackLODManager() const
Definition: TrackSysCommonData.h:123
VP1TrackSystem::refitFromPRDs
void refitFromPRDs(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
Definition: VP1TrackSystem.cxx:835
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
AscObjSelectionManager::currentSelection
QList< AssociatedObjectHandleBase * > currentSelection() const
Definition: AscObjSelectionManager.cxx:408
AscObjSelectionManager::getAscObjAttachSep
SoSeparator * getAscObjAttachSep() const
Definition: AscObjSelectionManager.cxx:135
AscObj_TSOS::rioOnTrack
const Trk::RIO_OnTrack * rioOnTrack() const
Definition: AscObj_TSOS.cxx:925
MuonIdHelper::is_mdt
bool is_mdt(const Identifier &id) const
Definition: MuonIdHelper.cxx:786
TrackHandleBase::clicked
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
TrackCollHandle_TrkTrack.h
VP1Msg.h
VP1TrackSystem::Imp::selectedPRDs
QList< const Trk::PrepRawData * > selectedPRDs
Definition: VP1TrackSystem.cxx:114
VP1CameraHelper.h
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
VisibleObjectToMaterialHelper< Trk::Track >
Muon::ChamberT0s
Stores links between chambers and the reconstructed T0.
Definition: ChamberT0s.h:17
TrackHandleBase.h
TrackCommonFlags::REFITSINGLETRACK
@ REFITSINGLETRACK
Definition: TrackCommonFlags.h:36
TrackSysCommonData::m_textSep
SoSeparator * m_textSep
Definition: TrackSysCommonData.h:88
VP1TrackSystem::Imp::totmomsep
SoSeparator * totmomsep
Definition: VP1TrackSystem.cxx:109
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
AscObjSelectionManager::SINGLE
@ SINGLE
Definition: AscObjSelectionManager.h:52
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
SoCooperativeSelection::activePolicy
SoSFEnum activePolicy
Definition: SoCooperativeSelection.h:49
skel.it
it
Definition: skel.GENtoEVGEN.py:423
VP1TrackSystem::Imp::createSpecificCollections
QList< TrackCollHandleBase * > createSpecificCollections()
Definition: VP1TrackSystem.cxx:120
VP1TrackSystem::setSelectedPRDs
void setSelectedPRDs(const QList< const Trk::PrepRawData * > &)
Definition: VP1TrackSystem.cxx:786
TrackLODManager.h
VP1TrackSystem::Imp::totmomgev
Amg::Vector3D totmomgev
Definition: VP1TrackSystem.cxx:111
MuonIdHelper::is_csc
bool is_csc(const Identifier &id) const
Definition: MuonIdHelper.cxx:789
VP1TrackSystem::updateAlignment
void updateAlignment()
Special mode to allow in VP1 alignment tests.
Definition: VP1TrackSystem.cxx:939
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
MuonIdHelper::technologyString
const std::string & technologyString(const int &index) const
Definition: MuonIdHelper.cxx:865
VisibleObjectToMaterialHelper.h
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
TrackHandle_TrkTrack::trkTrackPointer
const Trk::Track * trkTrackPointer() const
Definition: TrackHandle_TrkTrack.h:43
TrackSysCommonData.h
TrackCollHandle_TrkSegment.h
AscObjSelectionManager::ensureSelected
void ensureSelected(const QList< AssociatedObjectHandleBase * > &)
Definition: AscObjSelectionManager.cxx:350
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
VP1CameraHelper::animatedZoomToPath
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)
Definition: VP1CameraHelper.cxx:371
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
VP1CollectionWidget::clear
void clear(bool deleteCollections=true, bool deleteGuiElements=false)
Definition: VP1CollectionWidget.cxx:81
VP1TrackSystem::userPickedNode
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
Definition: VP1TrackSystem.cxx:553
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:804
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
VP1TrackSystem::materialFromVertex
SoMaterial * materialFromVertex(const TrackHandleBase *trk) const
Returns the material for the vertex which knows this trackhandle (if known)
Definition: VP1TrackSystem.cxx:1013
TrackSystemController::alignmentShiftValue
std::vector< double > alignmentShiftValue()
Definition: TrackSystemController.cxx:2159
TrackSystemController::ascObjDrawStyle
SoDrawStyle * ascObjDrawStyle() const
Definition: TrackSystemController.cxx:1458
TrackCollWidget.h
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1Controller::saveSettings
QByteArray saveSettings() const
Definition: VP1Controller.cxx:405
Trk::ITrackFitter
Definition: ITrackFitter.h:42
PrepRawData.h
VP1TrackSystem::visibleSegmentsChanged
void visibleSegmentsChanged(const std::vector< std::pair< const Trk::Segment *, const SoMaterial * > > &)
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
VP1CollectionWidget::setCollections
void setCollections(QList< VP1Collection * >, bool applySavedStates=true)
Definition: VP1CollectionWidget.cxx:258
TrackSystemController::nameOfNewlyFittedCollections
QString nameOfNewlyFittedCollections() const
Definition: TrackSystemController.cxx:1470
TruthTest.itE
itE
Definition: TruthTest.py:25
AssociatedObjectHandleBase::initiatesOwnZooms
virtual bool initiatesOwnZooms() const
Definition: AssociatedObjectHandleBase.h:62
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
IVP1System::state
State state() const
Definition: IVP1System.cxx:129
VP1TrackSystem::Imp::createCollections
QList< TrackCollHandleBase * > createCollections()
Definition: VP1TrackSystem.cxx:129
IVP1System::saveState
virtual QByteArray saveState()
Definition: IVP1System.cxx:294
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
Track.h
VP1TrackSystem::systemuncreate
void systemuncreate()
Definition: VP1TrackSystem.cxx:192
VP1DetInfo.h
VP1TrackSystem::Imp::totmomline
SoLineSet * totmomline
Definition: VP1TrackSystem.cxx:110
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
TrackSystemController::trackFitter
Trk::ITrackFitter * trackFitter() const
Definition: TrackSystemController.cxx:1666
TrackSystemController::alignmentShiftLevel
int alignmentShiftLevel()
Definition: TrackSystemController.cxx:2170
IVP13DSystem::registerSelectionNode
void registerSelectionNode(SoCooperativeSelection *)
Definition: IVP13DSystem.cxx:257
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
VP1TrackSystem::Imp::ascObjSelManager
AscObjSelectionManager * ascObjSelManager
Definition: VP1TrackSystem.cxx:103
TrackCommonFlags::MULTITRACK
@ MULTITRACK
Definition: TrackCommonFlags.h:33
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
VP1Controller::restoreSettings
void restoreSettings(QByteArray)
Definition: VP1Controller.cxx:387
TrackSysCommonData
Definition: TrackSysCommonData.h:47
AssociatedObjectHandleBase.h
VP1TrackSystem::muonChamberT0sChanged
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,...
VP1TrackSystem::buildController
QWidget * buildController()
Definition: VP1TrackSystem.cxx:207
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrackHandleBase::momentum
virtual Amg::Vector3D momentum() const
Definition: TrackHandleBase.h:83
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
VP1TrackSystem::Imp
Definition: VP1TrackSystem.cxx:98
VP1TrackSystem::Imp::selMode
TrackCommonFlags::SELECTIONMODE selMode
Definition: VP1TrackSystem.cxx:104
sel
sel
Definition: SUSYToolsTester.cxx:92
VisibleObjectToMaterialHelper::visibleObjects
const std::map< const objectT *, SoMaterial * > & visibleObjects()
Definition: VisibleObjectToMaterialHelper.h:51
VP1TrackSystem::Imp::currentUsedIDProjections
InDetProjFlags::DetTypeFlags currentUsedIDProjections() const
Definition: VP1TrackSystem.cxx:766
VP1TrackSystem::Imp::calcTotalMomentumOfSelectedHandles
unsigned calcTotalMomentumOfSelectedHandles(Amg::Vector3D &totmom, Amg::Vector3D &totpos, double &mass) const
Definition: VP1TrackSystem.cxx:657
TrackSystemController::setCommonData
void setCommonData(TrackSysCommonData *)
set pointer to the common data
Definition: TrackSystemController.cxx:2057
VP1TrackSystem::Imp::totmass
double totmass
Definition: VP1TrackSystem.cxx:112
VP1TrackSystem::usedIDProjectionsChanged
void usedIDProjectionsChanged(InDetProjFlags::DetTypeFlags)
CscReadoutElement.h
TrackCommonFlags::SINGLEOBJECT
@ SINGLEOBJECT
Definition: TrackCommonFlags.h:33
MdtIdHelper
Definition: MdtIdHelper.h:61
IVP1System::name
const QString & name() const
Definition: IVP1System.cxx:50
MdtIdHelper.h
TrackCollHandle_RefittedTracks
Definition: TrackCollHandle_RefittedTracks.h:24
VP1TrackSystem::Imp::sel_tracks
SoCooperativeSelection * sel_tracks
Definition: VP1TrackSystem.cxx:102
VP1TrackSystem::restoreFromState
void restoreFromState(QByteArray)
Definition: VP1TrackSystem.cxx:425
Muon::ChamberT0s::getAllT0s
const std::vector< std::pair< Identifier, float > > & getAllT0s() const
Returns entire list of T0s.
Definition: ChamberT0s.h:68
TrackSysCommonData::indetProjHelper_SCT
InDetProjHelper * indetProjHelper_SCT() const
Definition: TrackSysCommonData.h:119
TrackHandle_TrkTrack
Definition: TrackHandle_TrkTrack.h:29
VP1TrackSystem::visibleTracksChanged
void visibleTracksChanged(const std::vector< std::pair< const Trk::Track *, const SoMaterial * > > &)
TrackCommonFlags::TRACKFIT
@ TRACKFIT
Definition: TrackCommonFlags.h:33
TrackCommonFlags::COMBINETWOTRACKS
@ COMBINETWOTRACKS
Definition: TrackCommonFlags.h:36
AssociatedObjectHandleBase::numberOfInstances
static int numberOfInstances()
Definition: AssociatedObjectHandleBase.cxx:130
VP1TrackSystem
Definition: VP1TrackSystem.h:36
IVP13DSystemSimple::ensureBuildController
void ensureBuildController()
Definition: IVP13DSystemSimple.cxx:90
MuonGM::MuonDetectorManager::mdtIdHelper
const MdtIdHelper * mdtIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:221
VP1CollectionWidget::collections
QList< VP1Collection * > collections() const
Definition: VP1CollectionWidget.cxx:61
MuonClusterReadoutElement.h
MuonReadoutElement.h
VP1TrackSystem::emitTouchedMuonChambersChanged
void emitTouchedMuonChambersChanged(const std::set< GeoPVConstLink > &)
Definition: VP1TrackSystem.cxx:450
VP1TrackSystem::newTrackSelected
void newTrackSelected(const TrackHandleBase &)
AscObjSelectionManager.h
VP1Deserialise
Definition: VP1Deserialise.h:44
VP1TrackSystem::refitSingleTrack
void refitSingleTrack(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
Definition: VP1TrackSystem.cxx:908
AscObj_TSOS.h
TrackSystemController::fitterParticleHypthesis
Trk::ParticleHypothesis fitterParticleHypthesis() const
Definition: TrackSystemController.cxx:1734
TrackSystemController::printInfoOnSingleSelection
bool printInfoOnSingleSelection() const
Definition: TrackSystemController.cxx:1967
VP1TrackSystem::possiblyEmitUsedIDProjectionsChanged
void possiblyEmitUsedIDProjectionsChanged()
Definition: VP1TrackSystem.cxx:776
AscObjSelectionManager::userClickedOnBgd
void userClickedOnBgd()
Definition: AscObjSelectionManager.cxx:316
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:814
TrackSysCommonData::setLastSelectedTrack
void setLastSelectedTrack(TrackHandleBase *sel)
Definition: TrackSysCommonData.h:128
TrackSystemController::initTools
void initTools()
Definition: TrackSystemController.cxx:533
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:858
VP1TrackSystem::systemerase
void systemerase()
Definition: VP1TrackSystem.cxx:359
TrackSystemController::fitterMode
TrackCommonFlags::FITTERMODE fitterMode() const
Definition: TrackSystemController.cxx:1713
TrackSystemController::fitterRemoveOutliers
bool fitterRemoveOutliers() const
Definition: TrackSystemController.cxx:1729
SoCooperativeSelection::ACTIVE
@ ACTIVE
Definition: SoCooperativeSelection.h:41
TrackCollHandle_RefittedTracks.h
SoCooperativeSelection.h
VP1TrackSystem::userClickedOnBgd
void userClickedOnBgd()
Definition: VP1TrackSystem.cxx:640
TrackHandleBase::startPoint
virtual std::optional< Amg::Vector3D > startPoint() const
returns 0 if can't find start point.
Definition: TrackHandleBase.cxx:1570
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
IVP1System::messageDebug
void messageDebug(const QString &) const
Definition: IVP1System.cxx:347
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
RIO_OnTrack.h
TrackSysCommonData::lastSelectedTrackHandle
TrackHandleBase * lastSelectedTrackHandle()
pointer to base of last selected track (zero if nothing selected)
Definition: TrackSysCommonData.h:129
TrackSystemController
Definition: TrackSystemController.h:53
AscObjSelectionManager
Definition: AscObjSelectionManager.h:37
TrackSysCommonData::trackHandle
TrackHandleBase * trackHandle(SoNode *n)
Definition: TrackSysCommonData.cxx:157
TrackCollHandle_TrackParticle.h
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
TrackSystemController::orientAndZoomOnSingleSelection
bool orientAndZoomOnSingleSelection() const
Definition: TrackSystemController.cxx:1961
InDetProjFlags::TRT_all
@ TRT_all
Definition: InDetProjFlags.h:43
query_example.col
col
Definition: query_example.py:7
MuonDetectorManager.h
TrackCollHandleBase::init
virtual void init(VP1MaterialButtonBase *matBut=0)
Definition: TrackCollHandleBase.cxx:144
AscObjSelectionManager::setMode
void setMode(MODE)
Definition: AscObjSelectionManager.cxx:125
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
VP1TrackSystem::buildEventSceneGraph
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
Definition: VP1TrackSystem.cxx:228
TrackHandle_TrkTrack.h
TrackCommonFlags::SELECTIONMODE
SELECTIONMODE
Definition: TrackCommonFlags.h:33
VP1DetInfo::mdtIDHelper
static const MdtIdHelper * mdtIDHelper()
Definition: VP1DetInfo.cxx:163
VP1TrackSystem::systemcreate
void systemcreate(StoreGateSvc *detstore)
Definition: VP1TrackSystem.cxx:177
InDetProjFlags::NoDet
@ NoDet
Definition: InDetProjFlags.h:28
VP1TrackSystem::setApplicableIDProjections
void setApplicableIDProjections(InDetProjFlags::InDetProjPartsFlags pixel, InDetProjFlags::InDetProjPartsFlags sct, InDetProjFlags::InDetProjPartsFlags trt)
Definition: VP1TrackSystem.cxx:489
VP1DetInfo::muonDetMgr
static const MuonGM::MuonDetectorManager * muonDetMgr()
Definition: VP1DetInfo.cxx:148
TrackSystemController::printTotMomentumOnMultiTrackSelection
bool printTotMomentumOnMultiTrackSelection() const
Definition: TrackSystemController.cxx:1979
TrackHandleBase::getVisibleMeasurements
QList< AssociatedObjectHandleBase * > getVisibleMeasurements() const
Definition: TrackHandleBase.cxx:1979
ChamberT0s.h
IVP13DSystem::getCameraList
CamList getCameraList()
Definition: IVP13DSystem.cxx:395
TrackSystemController::selectionMode
TrackCommonFlags::SELECTIONMODE selectionMode() const
Definition: TrackSystemController.cxx:1701
VP1CollectionWidget
Definition: VP1CollectionWidget.h:32
TrackCommonFlags::FROMPRDS
@ FROMPRDS
Definition: TrackCommonFlags.h:36
AscObjSelectionManager::SHIFT
@ SHIFT
Definition: AscObjSelectionManager.h:52
VP1ToolAccessHelper.h
TrackSystemController::trackObjBrowser
QTreeWidget * trackObjBrowser() const
Returns a pointer to the Track Object Browser (if it exists)
Definition: TrackSystemController.cxx:2049
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
MuonIdHelper::technology
int technology(const Identifier &id) const
Definition: MuonIdHelper.cxx:819
VP1TrackSystem::touchedMuonChambersChanged
void touchedMuonChambersChanged(const std::set< GeoPVConstLink > &)
IVP13DSystem::unregisterSelectionNode
void unregisterSelectionNode(SoCooperativeSelection *)
Definition: IVP13DSystem.cxx:281
TrackSysCommonData::clearEventData
void clearEventData()
Definition: TrackSysCommonData.cxx:112
TrackCommonFlags::toString
static QString toString(const SELECTIONMODE &)
Definition: TrackCommonFlags.cxx:18
VP1TrackSystem::tracksFromVertexChanged
void tracksFromVertexChanged(QList< std::pair< const SoMaterial *, QList< const Trk::Track * > > > &)
Definition: VP1TrackSystem.cxx:989
TrackSystemController::ascObjComplexity
SoComplexity * ascObjComplexity() const
Definition: TrackSystemController.cxx:1464
TrackSysCommonData::indetProjHelper_TRT
InDetProjHelper * indetProjHelper_TRT() const
Definition: TrackSysCommonData.h:120
TrackSysCommonData::indetProjHelper_Pixel
InDetProjHelper * indetProjHelper_Pixel() const
Definition: TrackSysCommonData.h:118
TrackCollHandle_xAODTrackParticle.h
VP1TrackSystem::Imp::vertexMaterialForTrackBases
std::map< const Trk::Track *, SoMaterial * > vertexMaterialForTrackBases
Definition: VP1TrackSystem.cxx:148
TrackSystemController::collWidget
TrackCollWidget * collWidget() const
Definition: TrackSystemController.cxx:1264
Trk::ITrackFitter::fit
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.
VP1TrackSystem::Imp::theclass
VP1TrackSystem * theclass
Definition: VP1TrackSystem.cxx:100
str
Definition: BTagTrackIpAccessor.cxx:11
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
VP1TrackSystem::Imp::common
TrackSysCommonData * common
Definition: VP1TrackSystem.cxx:101
VP1StdCollection
Definition: VP1StdCollection.h:31
MuonGM::MuonDetectorManager::cscIdHelper
const CscIdHelper * cscIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:224
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::RIO_OnTrack::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
AscObj_TSOS::trackStateOnSurface
const Trk::TrackStateOnSurface * trackStateOnSurface() const
Definition: AscObj_TSOS.h:71
TrackHandleBase::mass
virtual double mass() const
Definition: TrackHandleBase.cxx:1501
FitQuality.h
InDetProjHelper::setParts
InDetProjFlags::InDetProjPartsFlags setParts(InDetProjFlags::InDetProjPartsFlags)
Definition: InDetProjHelper.cxx:196
TrackSystemController::showTotMomentumOnMultiTrackSelection
bool showTotMomentumOnMultiTrackSelection() const
Definition: TrackSystemController.cxx:1985
TrackHandleBase
Definition: TrackHandleBase.h:56
TrackHandleBase::numberOfInstances
static int numberOfInstances()
Definition: TrackHandleBase.cxx:249
AscObjSelectionManager::ensureDeselected
void ensureDeselected(const QList< AssociatedObjectHandleBase * > &)
Definition: AscObjSelectionManager.cxx:336
VP1TrackSystem::refit
void refit()
Definition: VP1TrackSystem.cxx:794
TrackCollHandle_SimulationTracks.h
VP1TrackSystem::Imp::chamberT0s
std::vector< std::map< GeoPVConstLink, float > > chamberT0s
Definition: VP1TrackSystem.cxx:147
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
StoreGateSvc.h
TrackLODManager::setAttachNode
void setAttachNode(SoGroup *attachnode)
Definition: TrackLODManager.cxx:122
VP1TrackSystem::saveState
QByteArray saveState()
Definition: VP1TrackSystem.cxx:408
ITrackFitter.h
MuonGM::MuonReadoutElement::parentStationPV
PVConstLink parentStationPV() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:100
TrackCollHandle_TruthTracks.h
AscObj_TSOS
Definition: AscObj_TSOS.h:45
VP1TrackSystem::userDeselectedSingleNode
void userDeselectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
Definition: VP1TrackSystem.cxx:651
IVP1System::message
void message(const QString &) const
Definition: IVP1System.cxx:336
IVP13DSystem::deselectAll
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
Definition: IVP13DSystem.cxx:331
SiliconTech::pixel
@ pixel
IVP1System::messageVerbose
void messageVerbose(const QString &) const
Definition: IVP1System.cxx:354
TrackStateOnSurface.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
node
Definition: memory_hooks-stdcmalloc.h:74
VP1TrackSystem::userSelectedSingleNode
void userSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
Definition: VP1TrackSystem.cxx:565
TrackSysCommonData::setEventData
void setEventData(AscObjSelectionManager *)
Definition: TrackSysCommonData.cxx:106
TrackSystemController::setNumberOfSelectedPRDsAndTracks
void setNumberOfSelectedPRDsAndTracks(unsigned prds, unsigned trks)
Definition: TrackSystemController.cxx:2016
VP1TrackSystem.h
common
Definition: common.py:1
SoCooperativeSelection
Definition: SoCooperativeSelection.h:29
VP1TrackSystem::updateSelectionMode
void updateSelectionMode()
Definition: VP1TrackSystem.cxx:524
VP1TrackSystem::selTracks
SoCooperativeSelection * selTracks()
Needed in TrackSystemController::objectBrowserClicked(QTreeWidgetItem * item, int)
Definition: VP1TrackSystem.cxx:934
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
IVP1System::restoreFromState
virtual void restoreFromState(QByteArray)
Definition: IVP1System.cxx:302