ATLAS Offline Software
TrackHandleBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class TrackHandleBase //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: February 2008 //
12 // //
14 
24 #include "VP1TrackSystems/SimBarCode.h"//For unknown pdg. Fixme: Use 0 for unknown pdg!
29 #include "VP1Utils/VP1DetInfo.h"
30 
34 
37 #include "VP1Base/VP1Msg.h"
39 #include "VP1Base/VP1QtUtils.h"
40 
41 #include "TrkTrack/Track.h"
45 
46 #include <Inventor/C/errors/debugerror.h>
47 #include <Inventor/nodes/SoLineSet.h>
48 #include <Inventor/nodes/SoVertexProperty.h>
49 #include <Inventor/nodes/SoSeparator.h>
50 #include <Inventor/nodes/SoMaterial.h>
51 #include <Inventor/nodes/SoPickStyle.h>
52 #include <Inventor/nodes/SoCylinder.h>
53 #include <Inventor/nodes/SoMatrixTransform.h>
54 #include <Inventor/SbRotation.h>
55 #include <Inventor/SbMatrix.h>
56 #include <Inventor/nodes/SoTranslation.h>
57 #include <Inventor/nodes/SoText2.h>
58 
59 #include "TrkVolumes/Volume.h"
70 #include <cassert>
71 
72 
73 
74 //____________________________________________________________________
76 public:
77  static void convertLineSetToCylinders(SoLineSet*line,SoSeparator*sep, const double& cylradius);
78  static double dist(const SbVec3f& p1,const SbVec3f& p2);
79 
80  static int ntrackhandles;
81 
83  chargeinit(false),
85  massinit(false),
87  line(nullptr),
88  extraRepresentation(nullptr),
89  extrapSurfaces_sep(nullptr),
90  extraRepAttached(false),
91  points_raw(nullptr), points_propagated(nullptr),
96  inittouchedchambers(false),
97  randommaterial(nullptr),
98  pathInfoLoaded(false),
99  pathInfo_TrkTrack(nullptr),
100  pathInfo_Points(nullptr),
101  label_sep(nullptr),
102  shownTSOSParts(TrackCommonFlags::TSOS_NoObjects),
103  customColouredTSOSParts(TrackCommonFlags::TSOS_NoObjects),
104  tsos_ascobjs(nullptr),
105  m_objBrowseTree(nullptr),
106  tempMaxPropRadius(0.0){}
107  ~Imp() { delete tsos_ascobjs; }
109 
111  double charge;
112  bool massinit;
113  double mass;
114 
115  SoLineSet * line;//This represents the line(s) representing the track and its projections
116  SoSeparator * extraRepresentation;//For alternative representations (e.g. tubes for lines)
117  SoSeparator* extrapSurfaces_sep;
119 
120  //For efficiency we cache parameterisations of the various track parts:
121 
122  //The next two vectors://=0 when not inited, !=0 but empty means previous attempt to init failed.
123  std::vector< Amg::Vector3D > * points_raw;
124  std::vector<Amg::Vector3D > * points_propagated;
125  //The following sets://=0 when not inited, !=0 and ->front().vector.empty() means previous attempt to init failed.
130 
131  void ensureInitPointsRaw();
133  void ensureInitPointsProjections_InDet( bool raw );
134  void ensureInitPointsProjections_Muon( bool raw );
135 
136  void materialChanged();
137 
138  void rebuild3DObjects();
139  void attach3DObjects();
140  void detach3DObjects();
141 
142  mutable std::set<GeoPVConstLink> touchedmuonchambers;
143  mutable bool inittouchedchambers;
144 
145  void addPathToSoLineSetAndSoVertexProperty(const std::vector<Amg::Vector3D >& points,
146  int & iver, int& numlines, SoLineSet *, SoVertexProperty * ) const;
148  int & iver, int& numlines,SoLineSet *, SoVertexProperty * ) const;
149 
150  SoMaterial * determineMaterial();
151  SoMaterial * randommaterial;
152 
153  QList<AssociatedObjectHandleBase*> associatedObjects;
154  std::map<std::pair<int,double>,AssocObjAttachmentHandle *> attachmentHandles;
155 
156  //We cache path info, but it might get invalidated (if switching off simhits for instance):
159  const std::vector< Amg::Vector3D > * pathInfo_Points;
160  SoSeparator * label_sep;
161  void ensureLoadPathInfo();
162 
163  static bool isSane(const Amg::Vector3D& p)
164  {
165  if (p.x()!=p.x()||fabs(p.x())>1.0*CLHEP::km)
166  return false;
167  if (p.y()!=p.y()||fabs(p.y())>1.0*CLHEP::km)
168  return false;
169  if (p.z()!=p.z()||fabs(p.z())>1.0*CLHEP::km)
170  return false;
171  return true;
172  }
173 
174 
175  TrackCommonFlags::TSOSPartsFlags shownTSOSParts;
176  TrackCommonFlags::TSOSPartsFlags customColouredTSOSParts;
177  std::vector<AscObj_TSOS*> * tsos_ascobjs;
178  void ensureInitTSOSs();
179  AscObj_TSOS* addTSOS(const Trk::TrackStateOnSurface * tsos,unsigned index) const;
180 
181  QTreeWidgetItem* m_objBrowseTree;
183 };
184 
185 
187 
188 //____________________________________________________________________
190 {
191  if (pathInfoLoaded)
192  return;
193  pathInfoLoaded = true;
195  if (pathInfo_TrkTrack)
196  return;
198  if (!pathInfo_Points) {
199  theclass->collHandle()->systemBase()->message("ERROR: No path information for track in collection "+theclass->collHandle()->name());
200  }
201 }
202 
203 //____________________________________________________________________
205  : m_d(new Imp(this)), m_visible(false), m_collhandle(ch), m_currentmaterial(nullptr)
206 {
207  assert(m_collhandle);
209 }
210 
211 //____________________________________________________________________
213 {
216 
217  //FIXME: if visible, should we call detach first?
219  delete ao;
220 
221  //Delete points the following way since we might use same points for raw and propagated.
223  delete m_d->points_propagated;
224  delete m_d->points_raw;
231 
232  clearLine();
233  if (m_currentmaterial)
234  m_currentmaterial->unref();
235  if (m_d->randommaterial)
236  m_d->randommaterial->unref();
237  if (m_d->label_sep)
238  m_d->label_sep->unref();
239 
240  std::map<std::pair<int,double>,AssocObjAttachmentHandle *>::iterator it,itE(m_d->attachmentHandles.end());
241  for (it = m_d->attachmentHandles.begin();it!=itE;++it)
242  delete it->second;
243 
244  delete m_d;
246 }
247 
248 //____________________________________________________________________
250 {
251  return Imp::ntrackhandles;
252 }
253 
254 //____________________________________________________________________
256 {
257  return m_collhandle->common();
258 }
259 
260 //____________________________________________________________________
262 {
263  if (!m_d->tsos_ascobjs)
264  return;
266  it(m_d->tsos_ascobjs->begin()),
267  itE(m_d->tsos_ascobjs->end());
268  for (;it!=itE;++it)
269  if ((*it)->hasMeasurement())
270  (*it)->update3DObjects();
271 }
272 
273 //____________________________________________________________________
275 {
276  if (!m_d->tsos_ascobjs)
277  return;
279  it(m_d->tsos_ascobjs->begin()),
280  itE(m_d->tsos_ascobjs->end());
281  for (;it!=itE;++it)
282  if ((*it)->hasError())
283  (*it)->update3DObjects();
284 }
285 
286 //____________________________________________________________________
288 {
289  if (!m_d->tsos_ascobjs)
290  return;
292  it(m_d->tsos_ascobjs->begin()),
293  itE(m_d->tsos_ascobjs->end());
294  for (;it!=itE;++it)
295  if ((*it)->hasMaterialEffect())
296  (*it)->update3DObjects();
297 }
298 
299 //____________________________________________________________________
300 TrackCommonFlags::TSOSPartsFlags TrackHandleBase::shownTSOSParts() const
301 {
302  return m_d->shownTSOSParts;//FIXME: inline?
303 }
304 
305 //____________________________________________________________________
306 TrackCommonFlags::TSOSPartsFlags TrackHandleBase::customColouredTSOSParts() const
307 {
308  return m_d->customColouredTSOSParts;//FIXME: inline?
309 }
310 
311 //____________________________________________________________________
312 void TrackHandleBase::setShownTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
313 {
314  VP1Msg::messageDebug(QString("TrackHandleBase::setShownTSOSParts to ")+QString::number(f) );
315 
316  if (m_d->shownTSOSParts==f)
317  return;
318  //Figure out changed bits:
319  TrackCommonFlags::TSOSPartsFlags change(m_d->shownTSOSParts ^ f);//^ is XOR
322  return;
323 
324  m_d->ensureInitTSOSs();
325  //Loop over all TSOS objects. Those with changed parts needs shape
326  //and visibility update:
328  for (;it!=itE;++it) {
329  if (!((*it)->parts()&change))
330  continue;
331  const bool vis = (*it)->parts() & m_d->shownTSOSParts;
332  if (vis==(*it)->visible()) {
333  //Just update shape:
334  (*it)->update3DObjects();
335  continue;
336  }
337  //Need both shape and visibility updates.
338  if (vis) {
339  //update shape and then turn visible:
340  (*it)->update3DObjects();
341  (*it)->setVisible(vis);
342  } else {
343  //turn invisible and then update (i.e. invalidate) shape:
344  (*it)->setVisible(vis);
345  (*it)->update3DObjects();
346  }
347  }
348 }
349 
350 //____________________________________________________________________
351 void TrackHandleBase::setCustomColouredTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
352 {
354  return;
355  //Figure out changed bits:
356  TrackCommonFlags::TSOSPartsFlags change(m_d->customColouredTSOSParts ^ f);//^ is XOR
358 
360  return;
361 
362  TrackCommonFlags::TSOSPartsFlags changedShownParts(change & m_d->shownTSOSParts);
363 
364  if (!changedShownParts)
365  return;
366 
367  //redundant m_d->ensureInitTSOSs();
369  for (;it!=itE;++it) {
370  if ((*it)->parts()&changedShownParts)
371  (*it)->update3DObjects();
372  }
373 }
374 
375 //____________________________________________________________________
377 {
378  if (tsos_ascobjs)
379  return;
380  tsos_ascobjs = new std::vector<AscObj_TSOS*>;
383  return;
384 
385  tsos_ascobjs->reserve(pathInfo_TrkTrack->trackParameters()->size());
386 
387  unsigned parindex(0);
388 
389  AscObj_TSOS* ascObjNeedDistToNext(nullptr);
392  const Trk::TrackParameters* trackParam(nullptr);
393  for (; tsos_iter != tsos_end; ++tsos_iter) {
394  trackParam = (*tsos_iter)->trackParameters();
395  if (!VP1TrackSanity::isSafe(*tsos_iter)) {
396  parindex++;
397  continue;
398  }
399  if (trackParam&&!VP1TrackSanity::isSafe(trackParam)) {
400  parindex++;
401  continue;
402  }
403  //FIXME: likewise check that we don't have a bad measurement, material effect, ...
404  if (ascObjNeedDistToNext&&trackParam) {
405  ascObjNeedDistToNext->setDistToNextPar((trackParam->position()-ascObjNeedDistToNext->approxCenter()).mag());
406  ascObjNeedDistToNext = nullptr;
407  }
408  VP1Msg::messageVerbose("Adding TSOS at index:"+QString::number(parindex));
409  ascObjNeedDistToNext = addTSOS(*tsos_iter,parindex++);
410  }
411 
412 }
413 
414 //____________________________________________________________________
416 {
417  AscObj_TSOS* ao = new AscObj_TSOS(theclass,tsos,index);
418  theclass->registerAssocObject(ao);
419  tsos_ascobjs->push_back(ao);
420  if (ao->parts()&shownTSOSParts)
421  ao->setVisible(true);
422  return ao;
423 }
424 
425 //____________________________________________________________________
427 {
428  QString tmp = (vis)?"True":"False";
429  QString tmp2 = (m_visible)?"True":"False";
430  VP1Msg::messageDebug(QString("TrackHandleBase calling setVisible with vis=")+tmp+QString(", and m_visible=")+tmp2 );
431  if (vis==m_visible)
432  return;
433 
434  m_visible=vis;
435  if (vis) {
437  if (!touchedMuonChambers().empty()) {
440  }
441  if (!m_d->line)
442  m_d->rebuild3DObjects();//The call to rebuild also fixes attached state.
443  else
444  m_d->attach3DObjects();
445  } else {
447  if (!touchedMuonChambers().empty()) {
450  }
451  m_d->detach3DObjects();
452  }
453 
454  bool initTSOS(false);
456  m_d->ensureInitTSOSs();
457  initTSOS = true;
458  }
459 
460  if (!initTSOS && m_d->tsos_ascobjs) {
462  it(m_d->tsos_ascobjs->begin()),
463  itE(m_d->tsos_ascobjs->end());
465  for (;it!=itE;++it) {
466  if ((*it)->visible()!=((*it)->parts() & m_d->shownTSOSParts))
467  (*it)->toggleVisible();
468  }
469  } else {
470  for (;it!=itE;++it) {
471  if ((*it)->visible())
472  (*it)->setVisible(false);
473  }
474  }
475  }
476 
478 
479  std::map<std::pair<int,double>,AssocObjAttachmentHandle *>::iterator it,itE(m_d->attachmentHandles.end());
480  for (it = m_d->attachmentHandles.begin();it!=itE;++it)
481  it->second->trackVisibilityChanged();
482 
483  //Label
484 
485 }
486 
487 //____________________________________________________________________
488 void TrackHandleBase::update3DObjects( bool invalidatePropagatedPoints, float maxR )
489 {
490  VP1Msg::messageVerbose(QString("TrackHandleBase::update3DObject with maxR set to ")+QString::number(maxR) );
491  if (maxR>0.0) {
492  m_d->tempMaxPropRadius=maxR;
493  }
494  if ( invalidatePropagatedPoints) {
495  if (m_d->points_propagated != m_d->points_raw) {
496  delete m_d->points_propagated;m_d->points_propagated = nullptr;
497  }
498  delete m_d->points_raw;m_d->points_raw = nullptr;
501  }
502  if (m_visible) {
504  } else {
505  //Simply clear the present 3D objects. They will only be recreated if/when the track becomes visible again.
506  clearLine();
507  }
508  m_d->tempMaxPropRadius=0.0;
509 }
510 
511 //____________________________________________________________________
513 {
514  //Invalidate points of indet projections if already calculated:
518  m_d->points_raw_id_projections = nullptr;
520  //Rebuild 3D objects:
521  update3DObjects();
522 }
523 
524 //____________________________________________________________________
526 {
527  //Invalidate points of indet projections if already calculated:
531  m_d->points_raw_muon_projections = nullptr;
533  //Rebuild 3D objects:
534  update3DObjects();
535 }
536 
537 
538 //____________________________________________________________________
539 void TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty(const std::vector<Amg::Vector3D >& points,
540  int & iver, int& numlines,
541  SoLineSet * line, SoVertexProperty * vertices ) const
542 {
543  if (points.size()<2)
544  return;
545  if (!line) {
546  theclass->collHandle()->systemBase()->message("TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty (1) ERROR: Unexpected null SoLineSet pointer!");
547  return;
548  }
549  if (!vertices) {
550  theclass->collHandle()->systemBase()->message("TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty (1) ERROR: Unexpected null SoVertexPropery pointer!");
551  return;
552  }
553  std::vector<Amg::Vector3D >::const_iterator pointsIt, pointsItEnd(points.end());
554  unsigned npointsused(0);
555 
556 
557  float maxR2=theclass->common()->controller()->propMaxRadius()>0.0?theclass->common()->controller()->propMaxRadius():std::numeric_limits<float>::max();
558  if (tempMaxPropRadius>0.0){
559  maxR2 = tempMaxPropRadius * tempMaxPropRadius;
560  theclass->collHandle()->systemBase()->messageVerbose("maxR2 is set to "+VP1Msg::str(maxR2));
561  }
562  float vertexPlanePhi = (theclass->common()->controller()->vertexProjectionAngle())*M_PI/180;// angle of plane to use for vertex projection
563  vertexPlanePhi-=M_PI; // ATLAS range is -PI to PI
564 
565  // debug msgs:
566  // theclass->collHandle()->systemBase()->messageVerbose("TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty - adding "
567  // +VP1Msg::str(points.size())+" points up to R2 of "+VP1Msg::str(maxR2));
568  theclass->collHandle()->systemBase()->messageVerbose("Vertex projection is set to "+VP1Msg::str(vertexPlanePhi));
569 
570  // unsigned int count=0; // for the debug msgs below
571 
572  //For vertex projection
573  Amg::Vector3D tempPoint;
574 
575  double trkPhi = theclass->momentum().phi(); // some tracks curve between sections otherwise.
576  double newPhi= vertexPlanePhi+M_PI;
577  if (cos(vertexPlanePhi-trkPhi)>0) newPhi=vertexPlanePhi;
578  // theclass->collHandle()->systemBase()->messageVerbose("Vertex projection is set to "+VP1Msg::str(vertexPlanePhi)+" trkPhi= "+VP1Msg::str(trkPhi)+" newPhi="+VP1Msg::str(newPhi)); // debug msg
579 
580  for (pointsIt = points.begin();pointsIt!=pointsItEnd && pointsIt->mag2()<maxR2; ++pointsIt) {
581  // theclass->collHandle()->systemBase()->messageVerbose(VP1Msg::str(count++)+": point has perp2="+VP1Msg::str(pointsIt->perp2())); // debug msg
582  if (!isSane(*pointsIt)) {
583  theclass->collHandle()->systemBase()->message("WARNING: Ignoring point on track:"+VP1Msg::str( *pointsIt ) );
584  continue;
585  }
586 
587  if (theclass->collHandle()->parts() & TrackCommonFlags::VertexProjections){
588  tempPoint = *pointsIt;
589  Amg::setPhi(tempPoint, newPhi);
590 
591  // std::cout<<trkPhi<<"\t"<<phi<<"\t"<<r0<<"\t"<<r1<<"\t"<<r2<<"\t"<<r3<<"\t"<<rotatePhi<<"\t"<<tempPoint.getPhi()<<std::endl; // debug msg
592 
593  vertices->vertex.set1Value(iver++,tempPoint.x(),tempPoint.y(),tempPoint.z());
594  } else {
595  vertices->vertex.set1Value(iver++,pointsIt->x(),pointsIt->y(),pointsIt->z());
596  }
597  ++npointsused;
598  }
599  line->numVertices.set1Value(numlines++,npointsused);
600 }
601 
602 //____________________________________________________________________
604  int & iver, int& numlines,
605  SoLineSet * line, SoVertexProperty * vertices ) const
606 {
607  if ( !paths || ( paths->size()==1 && paths->begin()->empty()) )
608  return;
609  if (!line) {
610  theclass->collHandle()->systemBase()->message("TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty (2) ERROR: Unexpected null SoLineSet pointer!");
611  return;
612  }
613  if (!vertices) {
614  theclass->collHandle()->systemBase()->message("TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty (2) ERROR: Unexpected null SoVertexPropery pointer!");
615  return;
616  }
617  Amg::SetVectorVector3D::const_iterator itProjPart, itProjPartEnd(paths->end());
618  for (itProjPart = paths->begin();itProjPart!=itProjPartEnd;++itProjPart)
619  addPathToSoLineSetAndSoVertexProperty(*itProjPart,iver,numlines,line,vertices);
620 }
621 
622 //____________________________________________________________________
624 {
625  if (m_d->line) {
627  m_d->line->unref();
628  m_d->line=nullptr;
629  }
630 }
631 
632 //____________________________________________________________________
634 {
635  if (m_d->line)
636  common()->registerTrack(m_d->line,this);
637 }
638 
639 
640 //____________________________________________________________________
642 {
643  //Ensure we are always detached while updating.
644  if (theclass->m_visible)
645  detach3DObjects();
646 
647  // Make sure we're not going to redraw old surfaces, for this debug mode.
648  if (theclass->common()->trackPropagationHelper()->showExtrapolationSurfaces())
649  theclass->common()->trackPropagationHelper()->getExtrapolationSurfaces().clear();
650 
651  Trk::IExtrapolator * propagator = theclass->collHandle()->propagator();
652 
653  if (propagator)
654  ensureInitPointsPropagated();
655  else
656  ensureInitPointsRaw();
657 
658  bool id_proj = theclass->collHandle()->parts() & TrackCommonFlags::InDetProjections;
659  if (id_proj)
660  ensureInitPointsProjections_InDet(!propagator);
661 
662  bool muon_proj = theclass->collHandle()->parts() & TrackCommonFlags::MuonProjections;
663  if (muon_proj)
664  ensureInitPointsProjections_Muon(!propagator);
665 
666  std::vector<Amg::Vector3D > * points;
667  Amg::SetVectorVector3D *proj_id, *proj_muon;
668  if (propagator) {
669  points = points_propagated;
670  proj_id = points_propagated_id_projections;
671  proj_muon = points_propagated_muon_projections;
672  } else {
673  points = points_raw;
674  proj_id = points_raw_id_projections;
675  proj_muon = points_raw_muon_projections;
676  }
677 
678  //Put points into an appropriate vertex property.
679  theclass->clearLine(); //FIXME: Since we are just changing shape - no need to delete line and take it
680  //out of the tree first. Just edit lineset properties instead.
681  line = new SoLineSet();
682  line->ref();
683  theclass->registerTrack();
684 
685  SoVertexProperty * vertices = new SoVertexProperty();
686 
687  int iver(0), numlines(0);
688 
689  //Add various parts to these vertices as appropriate:
690  if (theclass->collHandle()->parts() & TrackCommonFlags::ActualPath)
691  addPathToSoLineSetAndSoVertexProperty(*points,iver,numlines,line,vertices);
692  if (id_proj)
693  addPathsToSoLineSetAndSoVertexProperty( proj_id, iver, numlines, line, vertices );
694  if (muon_proj)
695  addPathsToSoLineSetAndSoVertexProperty( proj_muon, iver, numlines, line, vertices );
696 
697  line->vertexProperty = vertices;
698 
700 
701 
702 // Add debugging surfaces.
703  if (theclass->common()->trackPropagationHelper()->showExtrapolationSurfaces()){
704  std::vector<Trk::PlaneSurface>& surfaces = theclass->common()->trackPropagationHelper()->getExtrapolationSurfaces();
705  std::vector<Trk::PlaneSurface>::const_iterator surfIt=surfaces.begin(), surfEnd=surfaces.end();
706  SurfaceToSoNode surfCnv;//fixme: check if need in common()
707  extrapSurfaces_sep=new SoSeparator;
708  for (;surfIt!=surfEnd;++surfIt){
709  SoNode* theSurfSep = surfCnv.translateSurface(*surfIt);
710  if (theSurfSep) {
711  SoNode * nodeToAdd = theSurfSep;
712  extrapSurfaces_sep->addChild(nodeToAdd);
713  }
714  }
715  }
716 
717 // Add labels
718  if (!points->empty() && theclass->common()->controller()->doTrackLabels() ){
719 
720  // should detach first? This is all fairly suboptimal I'm sure... EJWM.
721  if (!label_sep){
722  label_sep = new SoSeparator;
723  label_sep->ref();
724  }
725  label_sep->removeAllChildren ();
726 
727  SoText2 *labelText = new SoText2;
728  labelText->ref();
729  QStringList text;
730  TrackSystemController::TrackLabelModes labels=theclass->common()->controller()->trackLabels();
732  text << "P="+VP1Msg::str(theclass->momentum().mag())+" MeV";
733  }
734 
736  text << "|Pt|="+VP1Msg::str(theclass->momentum().perp())+" MeV";
737  }
738 
740  int pdg = theclass->pdgCode();
741  if (pdg) {
742  bool ok;
743  QString name = VP1ParticleData::particleName(pdg,ok);
744  if (ok)
745  text << "pdg: "+QString::number(pdg)+" ["+name+"]";
746  else
747  text << "pdg: "+QString::number(pdg);
748  }
749  }
750 
751  if (labels&TrackSystemController::FitQuality && theclass->getFitQuality()){
752  text << TrkObjToString::shortInfo(*theclass->getFitQuality());
753  }
754 
756  text <<"Pix["+VP1Msg::str(theclass->getNPixelHits())+"], SCT["+VP1Msg::str(theclass->getNSCTHits())+"], TRT["+VP1Msg::str(theclass->getNTRTHits())+"],"
757  <<" MDT["+QString::number(theclass->getNMDTHits())+"], RPC["+QString::number(theclass->getNRPCHits())+"], TGC["+QString::number(theclass->getNTGCHits())+"], CSC["+QString::number(theclass->getNCSCHits())+"] MM["+QString::number(theclass->getNMMHits())+"], sTGC["+QString::number(theclass->getNsTGCHits())+"]";
758  }
759 
761  Amg::Vector3D mom = theclass->momentum();
762  mom /= CLHEP::GeV;
763  if (mom.mag2()==0.0) {
764  text << "Momentum : 0 (undefined)";
765  } else {
766  // current SoCoin classes don't support Unincode here, apparently.
767  // text << VP1Msg::str("(")+QChar(0x03B7)+","+QChar(0x03D5)+VP1Msg::str(")=(")
768  // +VP1Msg::str(mom.pseudoRapidity())+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ))+VP1Msg::str(")");
769  double pseudoRapidity = mom.eta();
770  text << VP1Msg::str("(eta,phi)=(")
771  +VP1Msg::str(pseudoRapidity)+VP1Msg::str(",")+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ))+VP1Msg::str(")");
772  }
773  }
774 
775  unsigned int row=0;
776  for(QString str : text){
777  QByteArray array = str.toLatin1();
778  labelText->string.set1Value(row++,array.data());
779  }
780 
781  //Position
782  float labelTrackOffset = theclass->common()->controller()->trackLabelTrkOffset();
783  unsigned int point=(points->size()-1)*labelTrackOffset;
784  Amg::Vector3D labelPos = (*points)[point] ;
785 
786 // NOTE: those options can be used if we want different label positions:
787 // if (labels&TrackSystemController::PosEndOfTrack)
788 // labelPos= points->back();
789 // else if (labels&TrackSystemController::PosBeginOfTrack)
790 // labelPos= points->front ();
791 // else if (labels&TrackSystemController::PosMidOfTrack)
792 // labelPos= (*points)[points->size()/2];
793 
794  SoTranslation *labelTranslate = new SoTranslation;
795  float offScale=10.0;
796  int xOffset = theclass->common()->controller()->labelXOffset() ;
797  int yOffset = theclass->common()->controller()->labelYOffset() ;
798  int zOffset = theclass->common()->controller()->labelZOffset() ;
799  labelTranslate->translation.setValue(labelPos.x()+(xOffset*offScale),labelPos.y()+(yOffset*offScale),labelPos.z()+(zOffset*offScale));
800 
801  SoMaterial *sMat = new SoMaterial();
802  SoMFColor sColor;
803  sColor.setValue(SbColor(0, 0, 1));
804  sMat->diffuseColor = sColor;
805 
806  label_sep->addChild(labelTranslate);
807  label_sep->addChild(labelText);
808  }
809 
810  //Attach if visible:
811  if (theclass->m_visible)
812  attach3DObjects();
813 }
814 
815 //____________________________________________________________________
817 {
818  theclass->currentMaterialChanged();
819  std::map<std::pair<int,double>,AssocObjAttachmentHandle *>::iterator it,itE(attachmentHandles.end());
820  for (it = attachmentHandles.begin();it!=itE;++it)
821  it->second->trackMaterialChanged();
822 }
823 
824 //____________________________________________________________________
825 double TrackHandleBase::Imp::dist(const SbVec3f& p1,const SbVec3f& p2)//TODO: to linalgs..
826 {
827  float x1,x2,y1,y2,z1,z2;
828  p1.getValue(x1,y1,z1);
829  p2.getValue(x2,y2,z2);
830  return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
831 }
832 
833 //____________________________________________________________________
834 void TrackHandleBase::Imp::convertLineSetToCylinders(SoLineSet*line,SoSeparator*sep,const double& cylradius)
835 {
836  //TODO: belongs in VP1Utils
837  SoVertexProperty *vertices = static_cast<SoVertexProperty *>(line->vertexProperty.getValue());
838  if (!vertices)
839  return;
840  int ivert(0);
841  SbMatrix lastTransf;
842  lastTransf.makeIdentity();
843 
844  for (int iline=0;iline<line->numVertices.getNum();++iline) {
845  int nvert=line->numVertices[iline];
846  if (nvert<2) {
847  ivert += nvert;
848  continue;
849  }
850  for (int jvert= ivert; jvert<ivert+nvert-1;++jvert) {
851  SbVec3f p1 = vertices->vertex[jvert].getValue();
852  SbVec3f p2 = vertices->vertex[jvert+1].getValue();
853  SoCylinder * cyl = new SoCylinder;
854  cyl->radius = cylradius;
855  const double l(dist(p1,p2));
856  cyl->height = l;
857  //First translate (0,l/2,0), then rotate (0,1,0) into (p2-p1), then translate p1.:
858  SbMatrix m;
859  m.setTranslate(SbVec3f(0,0.5*l,0));
860  SbVec3f v(p2); v -= p1;
861  SbRotation rot(SbVec3f(0,1,0),v);
862  SbMatrix m2; m2.setRotate(rot);
863  m.multRight(m2);
864  SbMatrix m3;
865  m3.setTranslate(p1);
866  m.multRight(m3);
867  //m is the transform we need in front of our cylinder.
868  //However, we need to first add the inverse of all previous transforms.
869  SbMatrix mat;
870  mat = m;
871  mat.multRight(lastTransf.inverse());
872  SoMatrixTransform * mt = new SoMatrixTransform;
873  mt->matrix.setValue(mat);
874  sep->addChild(mt);
875  sep->addChild(cyl);
876  lastTransf = m;
877  }
878  ivert += nvert;
879  }
880 }
881 
882 //____________________________________________________________________
884 {
885  VP1Msg::messageDebug("TrackHandleBase::Imp::attach3DObjects() - 1");
886 
887  if (!theclass->m_currentmaterial) {
888  theclass->m_currentmaterial = determineMaterial();
889  theclass->m_currentmaterial->ref();
890  materialChanged();
891  }
892  if (line && theclass->m_collhandle->sephelper()) {
893  VP1Msg::messageDebug("TrackHandleBase::Imp::attach3DObjects() - 2");
894  theclass->m_collhandle->sephelper()->addNodeUnderMaterial(line,theclass->m_currentmaterial);
895  double tube_r(theclass->m_collhandle->trackTubeRadius());
896  if (tube_r) {
897  if (extraRepresentation) {
898  extraRepresentation->removeAllChildren();
899  } else {
900  extraRepresentation = new SoSeparator;
901  extraRepresentation->ref();
902  theclass->common()->registerTrack(extraRepresentation,theclass);
903  }
904  convertLineSetToCylinders(line,extraRepresentation,tube_r);
905  if (!extraRepAttached) {
906  theclass->m_collhandle->sephelper()->addNodeUnderMaterial(extraRepresentation,theclass->m_currentmaterial);
907  extraRepAttached=true;
908  }
909  }
910  }
911  if (label_sep && theclass->common()->textSep() && theclass->common()->controller()->doTrackLabels())
912  theclass->common()->textSep()->addChild(label_sep);
913 
914  if (extrapSurfaces_sep) theclass->m_collhandle->sephelper()->addNodeUnderMaterial(extrapSurfaces_sep,theclass->m_currentmaterial);
915 }
916 
917 //____________________________________________________________________
919 {
920  if (!theclass->m_currentmaterial)
921  return;//Can never have been attached!
922  if (line && theclass->m_collhandle->sephelper()) {
923  theclass->m_collhandle->sephelper()->removeNodeUnderMaterial(line,theclass->m_currentmaterial);
924  if (extraRepresentation&&extraRepAttached) {
925  theclass->m_collhandle->sephelper()->removeNodeUnderMaterial(extraRepresentation,theclass->m_currentmaterial);
926  extraRepAttached=false;
927  }
928  }
929  if (label_sep && theclass->common()->textSep())
930  theclass->common()->textSep()->removeChild(label_sep);
931 
932  if (extrapSurfaces_sep)
933  theclass->m_collhandle->sephelper()->removeNodeUnderMaterial(extrapSurfaces_sep,theclass->m_currentmaterial);
934 }
935 
936 //____________________________________________________________________
938 {
939  //We need to change the current material. This means we need to
940  //clear the cache. Only if we are visible do we need to do a
941  //detach->clear material->attach cycle to trigger attachment under new material.
942 
943  if (!m_currentmaterial)
944  return;//We have no material cached and is thus not attached either.
945  if (m_visible) {
946  //See if the material changed. If it did, detach, update the material, attach again.
947  SoMaterial * newmat = m_d->determineMaterial();
948  newmat->ref();
949  if (newmat!=m_currentmaterial) {
950  m_d->detach3DObjects();
951  m_currentmaterial->unref();
952  m_currentmaterial = newmat;
953  m_d->attach3DObjects();
954  m_d->materialChanged();
955  } else {
956  newmat->unref();
957  }
958  } else {
959  //Just clear material.
960  m_currentmaterial->unref();
961  m_currentmaterial = nullptr;
962  m_d->materialChanged();
963  }
964 }
965 
966 //____________________________________________________________________
968 {
969  // debug msg:
970  // theclass->collHandle()->systemBase()->message("ensureInitPointsRaw start" );
971 
972  if (points_raw)
973  return;
974  points_raw = new std::vector<Amg::Vector3D >;
975 
977  // Get information about this path //
979 
980  ensureLoadPathInfo();
981 
982  if (pathInfo_TrkTrack) {
983  Amg::Vector3D * firstmomentum(nullptr);
984  if (pathInfo_TrkTrack->trackParameters())
985  points_raw->reserve(pathInfo_TrkTrack->trackParameters()->size());
986  bool unsafeparts(false);
987  Trk::TrackStates::const_iterator tsos_iter = pathInfo_TrkTrack->trackStateOnSurfaces()->begin();
988  Trk::TrackStates::const_iterator tsos_end = pathInfo_TrkTrack->trackStateOnSurfaces()->end();
989  const Trk::TrackParameters* trackParam;
990  for (; tsos_iter != tsos_end; ++tsos_iter) {
991  if (!VP1TrackSanity::isSafe(*tsos_iter)) {
992  unsafeparts = true;
993  continue;
994  }
995  if (theclass->collHandle()->ignoreMEOTinProp() && (*tsos_iter)->materialEffectsOnTrack())
996  continue;
997  trackParam = (*tsos_iter)->trackParameters();
998  if (trackParam) {
999  if (!VP1TrackSanity::isSafe(trackParam)) {
1000  unsafeparts = true;
1001  continue;
1002  }
1003  trackParam->position();//test
1004  points_raw->push_back( trackParam->position() );
1005  if (!firstmomentum) {
1006  firstmomentum = new Amg::Vector3D(trackParam->momentum());
1007  }
1008  }
1009  }
1010  if (unsafeparts)
1011  theclass->collHandle()->systemBase()->message("WARNING: Ignored unsafe parts of track!");
1012  if (points_raw->size()==1) {
1013  if (!firstmomentum) {
1014  theclass->collHandle()->systemBase()->message(" TrackHandleBase ERROR: Unexpected null firstmomentum!");
1015  firstmomentum = new Amg::Vector3D(0,0,0);
1016  }
1017  if (firstmomentum->mag()==0.0) {
1018  theclass->collHandle()->systemBase()->message("TrackHandleBase ERROR: Only point on track had zero momentum. Can't add second point.");
1019  points_raw->clear();
1020  } else {
1021  VP1Msg::messageVerbose("TrackHandleBase: Adding second point in direction of initial momentum.");
1022  points_raw->push_back(points_raw->front()+(*firstmomentum)*(100.0/firstmomentum->mag()));
1023  }
1024  } else if (points_raw->empty()) {
1025  theclass->collHandle()->systemBase()->message("TrackHandleBase ERROR: No points on track.");
1026  }
1027 
1028  delete firstmomentum;
1029  firstmomentum = nullptr;
1030  return;
1031  }
1032  if (pathInfo_Points)
1033  std::copy(pathInfo_Points->begin(), pathInfo_Points->end(), std::back_inserter(*points_raw));
1034  if (points_raw->size()<2) {
1035  theclass->collHandle()->systemBase()->message("TrackHandleBase ERROR: Less than two points on track provided.");
1036  points_raw->clear();
1037  } else {
1038  VP1Msg::messageVerbose( "TrackHandleBase: Created raw data "
1039  + QString::number(points_raw->size())
1040  + " points for track.");
1041  }
1042 }
1043 
1044 //____________________________________________________________________
1046 {
1047  if (points_propagated)
1048  return;
1049 
1050  ensureLoadPathInfo();
1051 
1052  if (pathInfo_TrkTrack) {
1053  points_propagated = new std::vector<Amg::Vector3D >();
1054  bool ok (false);
1055  if (theclass->hasCharge()&&theclass->charge()!=0.0)
1056  ok = theclass->common()->trackPropagationHelper()->makePointsCharged(*points_propagated,pathInfo_TrkTrack,
1057  theclass->collHandle()->propagator(),
1058  theclass->extrapolationParticleHypothesis(),
1059  !theclass->collHandle()->ignoreMEOTinProp(),
1060  theclass->collHandle()->extendTracks() ? theclass->common()->controller()->extrapolateToThisVolume() : nullptr );
1061  else
1062  ok = theclass->common()->trackPropagationHelper()->makePointsNeutral(*points_propagated,pathInfo_TrkTrack);
1063 
1064  if (!ok) {
1065  delete points_propagated;
1066  ensureInitPointsRaw();
1067  points_propagated = points_raw;
1068  }
1069  } else {
1070  //We just use the raw points:
1071  ensureInitPointsRaw();
1072  points_propagated = points_raw;
1073  }
1074 }
1075 
1076 //____________________________________________________________________
1078 {
1079  if (raw?points_raw_id_projections:points_propagated_id_projections)
1080  return;
1081 
1082  raw ? ensureInitPointsRaw() : ensureInitPointsPropagated();
1083 
1084  //First check if we use same points for raw/propagated modes:
1085  if (points_propagated==points_raw) {
1086  if (raw) {
1087  if (points_propagated_id_projections) {
1088  points_raw_id_projections = points_propagated_id_projections;
1089  return;
1090  }
1091  } else {
1092  if (points_raw_id_projections) {
1093  points_propagated_id_projections = points_raw_id_projections;
1094  return;
1095  }
1096  }
1097  }
1098 
1099  //Time for the hard work:
1100  std::vector<Amg::Vector3D > * points=nullptr;
1101  Amg::SetVectorVector3D* projections=nullptr;
1102  if (raw) {
1103  points_raw_id_projections = new Amg::SetVectorVector3D;
1104  points = points_raw;
1105  projections = points_raw_id_projections;
1106  } else {
1107  points_propagated_id_projections = new Amg::SetVectorVector3D;
1108  points = points_propagated;
1109  projections = points_propagated_id_projections;
1110  }
1111 
1112  if ( !points || points->empty() || points->size()<2 ) {
1113  projections->clear();
1114  projections->insert(std::vector<Amg::Vector3D >());//error signature
1115  return;
1116  }
1117 
1118  bool oneok(false);
1119  if (theclass->common()->indetProjHelper_Pixel()) {
1120  theclass->common()->indetProjHelper_Pixel()->projectPath(*points,*projections);
1121  oneok = true;
1122  }
1123  if (theclass->common()->indetProjHelper_SCT()) {
1124  theclass->common()->indetProjHelper_SCT()->projectPath(*points,*projections);
1125  oneok = true;
1126  }
1127  if (theclass->common()->indetProjHelper_TRT()) {
1128  theclass->common()->indetProjHelper_TRT()->projectPath(*points,*projections);
1129  oneok = true;
1130  }
1131 
1132  if (!oneok) {
1133  projections->clear();
1134  projections->insert(std::vector<Amg::Vector3D >());//error signature
1135  }
1136 }
1137 
1138 //____________________________________________________________________
1140 {
1141  if (raw?points_raw_muon_projections:points_propagated_muon_projections)
1142  return;
1143 
1144  raw ? ensureInitPointsRaw() : ensureInitPointsPropagated() ;
1145 
1146  //First check if we use same points for raw/propagated modes:
1147  if (points_propagated==points_raw) {
1148  if (raw) {
1149  if (points_propagated_muon_projections) {
1150  points_raw_muon_projections = points_propagated_muon_projections;
1151  return;
1152  }
1153  } else {
1154  if (points_raw_muon_projections) {
1155  points_propagated_muon_projections = points_raw_muon_projections;
1156  return;
1157  }
1158  }
1159  }
1160 
1161  //Time for the hard work:
1162  std::vector<Amg::Vector3D > * points;
1163  Amg::SetVectorVector3D * projections;
1164  if (raw) {
1165  points_raw_muon_projections = new Amg::SetVectorVector3D;
1166  points = points_raw;
1167  projections = points_raw_muon_projections;
1168  } else {
1169  points_propagated_muon_projections = new Amg::SetVectorVector3D;
1170  points = points_propagated;
1171  projections = points_propagated_muon_projections;
1172  }
1173 
1174  MuonChamberProjectionHelper * projhelper = theclass->common()->muonChamberProjectionHelper();
1175  if ( !VP1JobConfigInfo::hasMuonGeometry() || !projhelper || !points || points->empty() ) {
1176  projections->insert(std::vector<Amg::Vector3D >());//error signature
1177  return;
1178  }
1179 
1180  //Temporary variables:
1181  Amg::Vector3D firstEndWall_pointA, firstEndWall_pointB;
1182  Amg::Vector3D secondEndWall_pointA, secondEndWall_pointB;
1183  bool outsidechamber;
1184  std::vector<Amg::Vector3D > proj1, proj2;
1185 
1186  //For each (MDT) chamber we try to project all line segments on "points" to the ends of that chamber.
1187  for (std::set<GeoPVConstLink>::iterator it=theclass->touchedMuonChambers().begin(); it!=theclass->touchedMuonChambers().end(); ++it){
1188 
1189  //For now, only project to end of MDT chambers:
1190  if (!projhelper->isKnownMDTChamber(*it))
1191  continue;
1192 
1193  proj1.clear();
1194  proj2.clear();
1195 
1196  // now loop over the stored points
1197  std::vector<Amg::Vector3D >::const_iterator pointsIt=points->begin(), pointsItEnd=points->end()-1;
1198  for (;pointsIt!=pointsItEnd; ++pointsIt) {
1199 
1200  // Do projections
1201  bool ok = projhelper->projectAndConstrainLineSegmentToMDTChamberEndWalls( *it, *pointsIt, *(pointsIt+1),
1202  firstEndWall_pointA, firstEndWall_pointB,
1203  secondEndWall_pointA, secondEndWall_pointB,
1204  outsidechamber );
1205 
1206  if (!ok) {
1207  theclass->collHandle()->systemBase()->message("TrackHandleBase Error: "
1208  "Problems with projectAndConstrainLineSegmentToMDTChamberEndWalls(..)");
1209  // projections->clear();
1210  // projections->push_back(std::vector<Amg::Vector3D >);//error signature
1211  continue;
1212  }
1213 
1214  if (!outsidechamber){
1215  if ( proj1.empty() ) {
1216  proj1.push_back(firstEndWall_pointA); proj1.push_back(firstEndWall_pointB);
1217  } else {
1218  if ( proj1[proj1.size()-1] == firstEndWall_pointA ) {
1219  proj1.push_back(firstEndWall_pointB);//Keep adding to line part
1220  } else {
1221  //Start new line.
1222  projections->insert(proj1); proj1.clear();
1223  proj1.push_back(firstEndWall_pointA); proj1.push_back(firstEndWall_pointB);
1224  }
1225  }
1226  if ( proj2.empty() ) {
1227  proj2.push_back(secondEndWall_pointA); proj2.push_back(secondEndWall_pointB);
1228  } else {
1229  // unsure about this change...coverity 16206, sroe
1230  // if ( proj2[proj2.size()-1] == firstEndWall_pointA ) {
1231  if ( proj2[proj2.size()-1] == secondEndWall_pointA ) {
1232  proj2.push_back(secondEndWall_pointB);//Keep adding to line part
1233  } else {
1234  //Start new line.
1235  projections->insert(proj2); proj2.clear();
1236  proj2.push_back(secondEndWall_pointA); proj2.push_back(secondEndWall_pointB);
1237  }
1238  }
1239  }
1240  //proj2 fixme
1241  }
1242  if ( !proj1.empty() ) {
1243  projections->insert(proj1);
1244  }
1245  if ( !proj2.empty() ) {
1246  projections->insert(proj2);
1247  }
1248  }
1249 }
1250 
1251 //____________________________________________________________________
1252 void TrackHandleBase::registerTouchedMuonChamber( const GeoPVConstLink& chamberPV ) const
1253 {
1254  m_d->touchedmuonchambers.insert(chamberPV);
1255 }
1256 
1257 //____________________________________________________________________
1258 const std::set<GeoPVConstLink>& TrackHandleBase::touchedMuonChambers() const
1259 {
1260  if (!m_d->inittouchedchambers) {
1263  m_d->inittouchedchambers=true;
1264  }
1265  return m_d->touchedmuonchambers;
1266 }
1267 
1268 //____________________________________________________________________
1270 {
1271  // debug msg:
1272  // theclass->collHandle()->systemBase()->message("determineMaterial with material = "+QString::number(static_cast<unsigned int>(theclass->collHandle()->colourBy()))); //too verbose. EJWM.
1273 
1274  int pdgcode(0);
1275  switch(theclass->collHandle()->colourBy()) {
1276 
1278  pdgcode = theclass->pdgCode();
1279  return theclass->common()->controller()->getMaterialForPDGCode(pdgcode == SimBarCode::unknownPDG ? 0 : pdgcode);
1280 
1282  if (!randommaterial) {
1283  randommaterial = new SoMaterial;
1284  randommaterial->ref();
1285  theclass->rerandomiseRandomMaterial();
1286  }
1287  return randommaterial;
1288 
1290  return theclass->common()->controller()->getMaterialForCharge(theclass->hasCharge()?theclass->charge():0.0);
1292  return theclass->common()->controller()->getMaterialForMomentum(theclass->momentum().mag());
1293 
1295  {
1296  // debug code:
1297  // AscObjSelectionManager* selManager= theclass->common()->ascObjSelectionManager();
1298  // TrackHandleBase* handle = 0;
1299  // if ( selManager ) {
1300  // QList<AssociatedObjectHandleBase*> selection = selManager->currentSelection();
1301  // if (!selection.empty()) handle = selection[0]->trackHandle(); // Take first at the moment, but should loop and colour by all. FIXME!
1302  // else theclass->collHandle()->systemBase()->message("Empty selection!");
1303  // } else {
1304  // theclass->collHandle()->systemBase()->message("No AscObjSelectionManager");
1305  // }
1306 
1307  TrackHandleBase* handle = theclass->common()->lastSelectedTrackHandle();
1308  if (handle==nullptr) {
1309  //theclass->collHandle()->systemBase()->message("No previously selected track.");
1310  return theclass->collHandle()->material(); // use collection colouring
1311  }
1312 
1313  Amg::Vector3D selectedTrackMom = handle->momentum();
1314  Amg::Vector3D thisTrackMom = theclass->momentum();
1315 
1316  float phiDistance = sqrt ( pow( selectedTrackMom.phi() - thisTrackMom.phi(),2) );
1317  float etaDistance = sqrt ( pow( selectedTrackMom.eta() - thisTrackMom.eta(),2) );
1318 
1319  //theclass->collHandle()->systemBase()->message("Distance "+QString::number(distance)); // debug msg
1320  float colScale=std::max(0.0, std::min(1.0,phiDistance/(M_PI))); // means that min scale is reached 0.5 of total possible distance away.
1321  float brightness= std::max(0.2, 1.0-(etaDistance/5.0) );
1322  //theclass->collHandle()->systemBase()->message("Distance "+QString::number(distance)+"\t brightness "+QString::number(brightness)); // debug msg
1323 
1324  SoMaterial* mat = new SoMaterial;
1325  mat->ref();
1326 
1327  // get colour of collection.
1328  const SbColor& col=theclass->collHandle()->material()->diffuseColor[0];
1329  float r,g,b;
1330  col.getValue(r,g,b);
1331 
1332  double r3,g3,b3;
1333  if (colScale>0.01) {
1334 
1335  //Use QColor to get HSL
1336  QColor tempCol = QColor::fromRgbF( r,g,b );
1337  double h,s,v;
1338  tempCol.getHsvF(&h,&s,&v);
1339 
1340  //get opposite hue for farthest away points.
1341  h+=0.5;
1342  if (h>1.0) h-=1.0;
1343  tempCol.setHsvF(h,s,v);
1344  double r2,g2,b2;
1345  tempCol.getRgbF(&r2,&g2,&b2);
1346 
1347  // closest will have collection colour - far away will have opposite colour
1348  r3 = r+(r2-r)*colScale;
1349  b3 = b+(b2-b)*colScale;
1350  g3 = g+(g2-g)*colScale;
1351 
1352  } else {
1353  // too close - take default values
1354  r3=r;b3=b;g3=g;
1355  }
1356 
1357  VP1MaterialButton::setMaterialParameters(mat,r3*brightness,g3*brightness,b3*brightness,
1358  theclass->collHandle()->collMaterialBrightness(),
1359  theclass->collHandle()->collMaterialTransparency());
1360 
1361  return mat;
1362  }
1364  {
1365  SoMaterial* mat = theclass->common()->system()->materialFromVertex(theclass);
1366  if (mat)
1367  return mat;
1368  else
1369  return theclass->collHandle()->material();
1370  }
1372  default:
1373  return theclass->collHandle()->material();
1374  }
1375 }
1376 
1377 //____________________________________________________________________
1379 {
1380  if ( !m_d->randommaterial )//We will anyway rerandomize it when we need it
1381  return;
1382 
1383  double r2 = 0.3*0.3;
1384  unsigned i(0);
1385  double r,g,b;
1386  bool ok;
1387  while (true) {
1388  r = (rand() / static_cast<double>(RAND_MAX));
1389  g = (rand() / static_cast<double>(RAND_MAX));
1390  b = (rand() / static_cast<double>(RAND_MAX));
1391  ok = true;
1392  //For now we make sure that we avoid black and red. This should be updated from bgd and highlight col automatically! (fixme).
1393  // -> and we should probably also make sure that tracks close in (eta,phi) are well separated in colour-space.
1394  if ( (r-1.0)*(r-1.0)+g*g+b*b < r2*0.5 )//avoid red (distance)
1395  ok = false;
1396  else if ( r*r/(r*r+g*g+b*b) > 0.8 )//avoid red (angle)
1397  ok = false;
1398  else if ( r*r+g*g+b*b < r2*2.0 )//avoid black
1399  ok = false;
1400  if (ok)
1401  break;
1402  ++i;
1403  if (i>50 ) {
1404  r2 *= 0.99;//To avoid problem in case we add too many forbidden spheres.
1405  if (i>1000) {
1406  //Just a safety
1407  m_d->theclass->collHandle()->systemBase()->message("TrackHandleBase::rerandomiseRandomMaterial Warning: Random colour could"
1408  " not be selected such as to satisfy all separation criterias");
1409  break;
1410  }
1411  }
1412  }
1414  collHandle()->collMaterialBrightness(),
1415  collHandle()->collMaterialTransparency());
1416 }
1417 
1418 //____________________________________________________________________
1420 {
1421  if ( !m_d->randommaterial )//We will anyway set up correctly when needed.
1422  return;
1423  float r,g,b;
1424  m_d->randommaterial->diffuseColor[0].getValue(r,g,b);
1426  collHandle()->collMaterialBrightness(),
1427  collHandle()->collMaterialTransparency());
1428 }
1429 
1430 
1431 //____________________________________________________________________
1433 {
1434  if (VP1Msg::verbose()) {
1435  if (m_d->associatedObjects.contains(ao)) {
1436  m_d->theclass->collHandle()->systemBase()->message("TrackHandleBase::registerAssocObject ERROR: object already registered!");
1437  return;
1438  }
1439  }
1440  //Assume ownership of this associated object:
1441  if (!ao) {
1442  m_d->theclass->collHandle()->systemBase()->message("TrackHandleBase::registerAssocObject ERROR: object is null!");
1443  return;
1444  }
1445 
1446  m_d->associatedObjects << ao;
1447 }
1448 
1449 
1450 //____________________________________________________________________
1451 AssocObjAttachmentHandle * TrackHandleBase::getAttachmentHandle(int regionIndex, const double&crossoverval)
1452 {
1453  std::map<std::pair<int,double>,AssocObjAttachmentHandle *>::iterator
1454  it = m_d->attachmentHandles.find(std::make_pair(regionIndex,crossoverval));
1455  if (it!=m_d->attachmentHandles.end())
1456  return it->second;
1457  AssocObjAttachmentHandle *attachHandle
1458  = new AssocObjAttachmentHandle(common()->trackLODManager()->getLODHandle(regionIndex,crossoverval),this);
1459  m_d->attachmentHandles[std::make_pair(regionIndex,crossoverval)] = attachHandle;
1460  return attachHandle;
1461 }
1462 
1463 //____________________________________________________________________
1465 {
1466  //look up from pdgCode(); // valid PDG codes > 0
1467  int pdg = pdgCode();
1468  if (pdg) {
1469  bool ok;
1470  double c = VP1ParticleData::particleCharge(pdg,ok);
1471  if (ok) {
1472  VP1Msg::messageDebug("TrackHandleBase: Determined charge from pdg code "+VP1Msg::str(pdg)+": "+VP1Msg::str(c));
1473  return c;
1474  }
1475  }
1476 
1477  //Attempt to look at the first trackparameter.
1478  const Trk::Track * trk = provide_pathInfoTrkTrack();
1479  if (trk&&!trk->trackParameters()->empty()) {
1480  double c = (*(trk->trackParameters()->begin()))->charge();
1481  VP1Msg::messageDebug("TrackHandleBase: Determined charge from first track parameter: "+VP1Msg::str(c));
1482  return c;
1483  }
1484  if (VP1Msg::verbose())
1485  VP1Msg::messageDebug("Failed to determine charge.");
1486 
1487  return unknown();
1488 }
1489 
1490 //____________________________________________________________________
1492 {
1493  if (m_d->chargeinit)
1494  return m_d->charge;
1495  m_d->chargeinit = true;
1496  m_d->charge = calculateCharge();
1497  return m_d->charge;
1498 }
1499 
1500 //____________________________________________________________________
1502 {
1503  if (m_d->massinit)
1504  return m_d->mass;
1505  m_d->massinit = true;
1506  int pdg = pdgCode();
1507  if (pdg) {
1508  bool ok;
1509  double m = VP1ParticleData::particleMass(pdg,ok);
1510  if (ok)
1511  m_d->mass = m;
1512  }
1513  return m_d->mass;
1514 }
1515 
1516 //____________________________________________________________________
1518 {
1519  switch(abs(pdgCode())) {
1520  case 211: return Trk::pion;
1521  case 2212: return Trk::proton;
1522  case 11: return Trk::electron;
1523  case 13: return Trk::muon;
1524  case 321://k+
1525  case 323://k*+
1526  return Trk::kaon;
1527  case 0:
1528  default:
1530  }
1531 }
1532 
1533 //____________________________________________________________________
1534 QStringList TrackHandleBase::baseInfo() const
1535 {
1536  QStringList l;
1538  mom /= CLHEP::GeV;
1539  if (mom.mag2()==0.0) {
1540  l << "Momentum : 0 (undefined)";
1541  } else {
1542  l << "Momentum [GeV]: "+VP1Msg::str(mom);
1543  l << "|Pt|/|P| [GeV]: "+VP1Msg::str(mom.perp())+" / " + VP1Msg::str(mom.mag());
1544  l << VP1Msg::str("(")+QChar(0x03B7)+","+QChar(0x03D5)+VP1Msg::str(")=(")
1546 
1547  l << "Eta: "+VP1Msg::str(mom.eta());
1548  l << "Phi: "+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ));
1549  }
1550  l<<"Hit summary: Pix["+VP1Msg::str(getNPixelHits())+"], SCT["+VP1Msg::str(getNSCTHits())+"], TRT["+VP1Msg::str(getNTRTHits())
1552 
1553  return l;
1567 }
1568 
1569 //____________________________________________________________________
1570 std::optional<Amg::Vector3D> TrackHandleBase::startPoint() const
1571 {
1573  if (m_d->pathInfo_TrkTrack) {
1576  for (; tsos_iter != tsos_end; ++tsos_iter) {
1577  if (common()->trackSanityHelper()->isSafe(*tsos_iter)) {
1578  const Trk::TrackParameters* trackParam = (*tsos_iter)->trackParameters();
1579  if (common()->trackSanityHelper()->isSafe(trackParam))
1580  return trackParam->position();
1581  }
1582  }
1583  } else if (m_d->pathInfo_Points&&!m_d->pathInfo_Points->empty()) {
1584  return m_d->pathInfo_Points->at(0);
1585  }
1586  return {};
1587 }
1588 
1589 //____________________________________________________________________
1590 std::optional<Amg::Vector3D> TrackHandleBase::endPoint() const
1591 {
1593  if (m_d->pathInfo_TrkTrack) {
1596  for (; tsos_iter != tsos_end; ++tsos_iter) {
1597  if (common()->trackSanityHelper()->isSafe(*tsos_iter)) {
1598  const Trk::TrackParameters* trackParam = (*tsos_iter)->trackParameters();
1599  if (common()->trackSanityHelper()->isSafe(trackParam))
1600  return trackParam->position();
1601  }
1602  }
1603  } else if (m_d->pathInfo_Points&&!m_d->pathInfo_Points->empty()) {
1604  return m_d->pathInfo_Points->back();
1605  }
1606  return {};
1607 }
1608 
1610 {
1611  std::optional<Amg::Vector3D> start = startPoint();
1612  if (!start) return false;
1613  return start->perp()<1100 &&fabs( start->z())<3500;
1614 }
1615 
1616 //____________________________________________________________________
1617 QList<AssociatedObjectHandleBase*> TrackHandleBase::getAllAscObjHandles() const
1618 {
1619  return m_d->associatedObjects;
1620 }
1621 
1622 std::vector< Amg::Vector3D > * TrackHandleBase::hackGetPointsPropagated()
1623 {
1625  return m_d->points_propagated;
1626 }
1627 
1628 //____________________________________________________________________
1630 public:
1632  : trackhandle(th),
1633  trackmat(nullptr),
1634  lodHandle(tlh),
1635  septrack_simple(nullptr),
1636  septrack_detailed(nullptr),
1637  pickStyleChildIdx(-1),
1638  attached(false) {}
1640  SoMaterial* trackmat;
1642  SoSeparator * septrack_simple;
1643  SoSeparator * septrack_detailed;
1644  void ensureInit();
1645  static SoPickStyle * pickStyle;
1647  bool attached;
1649  {
1650  if (attached)
1651  return;
1652  attached=true;
1653  if (!septrack_detailed)
1654  return;//We attach in ensureInit in this case!
1655  lodHandle->addNodes(septrack_simple,septrack_detailed);
1656  }
1658  {
1659  if (!attached)
1660  return;
1661  attached=false;
1662  if (!septrack_detailed)
1663  return;
1664  lodHandle->removeNodes(septrack_simple,septrack_detailed);
1665  }
1666  static SoMaterial * dummymaterial;
1667 };
1668 SoPickStyle * AssocObjAttachmentHandle::Imp::pickStyle = nullptr;
1669 SoMaterial * AssocObjAttachmentHandle::Imp::dummymaterial = nullptr;
1670 
1671 //____________________________________________________________________
1673 {
1674  bool b = m_d->trackhandle->visible();
1675  if (b&&!m_d->trackhandle->currentMaterial())
1676  VP1Msg::message("ERROR: track is visible but has not current material!!");
1677  if (b)
1678  m_d->ensureAttached();
1679  else
1680  m_d->ensureDetached();
1681 }
1682 
1683 //____________________________________________________________________
1685  : m_d ( new Imp(tlh,th) )
1686 {
1687  if (!tlh)
1688  VP1Msg::message("AssocObjAttachmentHandle ERROR: constructed with null LOD handle!");
1689  if (!Imp::dummymaterial) {
1690  Imp::dummymaterial = new SoMaterial;
1691  Imp::dummymaterial->ref();
1692  }
1693 }
1694 
1695 //____________________________________________________________________
1697 {
1698  if (VP1Msg::verbose()) {
1701  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes detected wrong pickStyleChildIdx");
1702  return;
1703  }
1704  }
1705 
1706  if (Imp::pickStyle) {
1707  Imp::pickStyle->unref();
1708  if ( Imp::pickStyle->getRefCount()==1 ) {
1709  Imp::pickStyle->unref();
1710  Imp::pickStyle = nullptr;
1711  }
1712  }
1713 
1714  if (m_d->septrack_simple)
1715  m_d->septrack_simple->unref();
1716  if (m_d->septrack_detailed)
1717  m_d->septrack_detailed->unref();
1718  if (m_d->trackmat)
1719  m_d->trackmat->unref();
1720  delete m_d;
1721 }
1722 
1723 //____________________________________________________________________
1725 {
1726  SoMaterial * m = m_d->trackhandle->currentMaterial();
1727  if (m_d->trackmat==m)
1728  return;
1729  if (!m) {
1730  if (m_d->trackhandle->visible())
1731  VP1Msg::message("ERROR: track is visible but has no current material!!");
1733  }
1734  m->ref();
1735  if (m_d->trackmat) {
1736  if ( m_d->septrack_simple && m_d->septrack_simple->findChild(m_d->trackmat) > -1 )
1737  m_d->septrack_simple->replaceChild(m_d->trackmat,m);
1738  if ( m_d->septrack_detailed && m_d->septrack_detailed->findChild(m_d->trackmat) > -1 )
1739  m_d->septrack_detailed->replaceChild(m_d->trackmat,m);
1740  m_d->trackmat->unref();
1741  }
1742  m_d->trackmat = m;
1743 }
1744 
1745 //____________________________________________________________________
1747 {
1748  if (septrack_simple)
1749  return;
1750  septrack_simple = new SoSeparator;
1751  septrack_detailed = new SoSeparator;
1752  septrack_simple->ref();
1753  septrack_detailed->ref();
1754 
1755  if (!pickStyle) {
1756  pickStyle = new SoPickStyle;
1757  pickStyle->style=SoPickStyle::UNPICKABLE;
1758  pickStyle->ref();
1759  }
1760  pickStyle->ref();
1761  if (attached) {
1762  attached = false;
1763  ensureAttached();
1764  }
1765 }
1766 
1767 //____________________________________________________________________
1768 void AssocObjAttachmentHandle::attachNodes( SoNode*simple, SoNode*detailed, bool unpickable )
1769 {
1770  if (!m_d->trackhandle->visible())
1771  return;
1772  m_d->ensureInit();
1773  if (!m_d->trackmat) {
1774  SoMaterial * m = m_d->trackhandle->currentMaterial();
1775  if (!m)
1776  m = Imp::dummymaterial;//For now we attach a dummy material.
1777  m_d->trackmat=m;
1778  m->ref();
1779  m_d->septrack_simple->addChild(m);
1780  m_d->septrack_detailed->addChild(m);
1781  }
1782 
1783  if (VP1Msg::verbose()) {
1786  VP1Msg::message("ERROR: AssocObjAttachmentHandle::attachNodes detected wrong pickStyleChildIdx");
1787  return;
1788  }
1789  if (m_d->septrack_simple->findChild(simple)>-1||m_d->septrack_detailed->findChild(detailed)>-1) {
1790  VP1Msg::message("ERROR: AssocObjAttachmentHandle::attachNodes Already attached!");
1791  return;
1792  }
1793  }
1794  if (unpickable) {
1795  if (m_d->pickStyleChildIdx==-1) {
1796  m_d->pickStyleChildIdx = m_d->septrack_simple->getNumChildren();
1797  m_d->septrack_simple->addChild(Imp::pickStyle);
1798  m_d->septrack_detailed->addChild(Imp::pickStyle);
1799  }
1800  m_d->septrack_simple->addChild(simple);
1801  m_d->septrack_detailed->addChild(detailed);
1802  } else {
1803  if (m_d->pickStyleChildIdx>-1) {
1804  m_d->septrack_simple->insertChild(simple,m_d->pickStyleChildIdx);
1805  m_d->septrack_detailed->insertChild(detailed,m_d->pickStyleChildIdx);
1806  ++(m_d->pickStyleChildIdx);
1807  } else {
1808  m_d->septrack_simple->addChild(simple);
1809  m_d->septrack_detailed->addChild(detailed);
1810  }
1811  }
1812 
1813  //Should we update the overall attachment status?:
1814  if (m_d->trackhandle->visible() && m_d->septrack_simple->getNumChildren() == 2 + (m_d->pickStyleChildIdx==-1?0:1)) {
1815  m_d->ensureAttached();
1816  }
1817 }
1818 
1819 //____________________________________________________________________
1820 void AssocObjAttachmentHandle::setPickableStateOfNodes( SoNode*simple, SoNode*detailed, bool unpickable )
1821 {
1822  if (VP1Msg::verbose()) {
1823  VP1Msg::messageVerbose("AssocObjAttachmentHandle::setPickableStateOfNodes called with unpickable = "
1824  +QString(unpickable?"true":"false"));
1825  if (!simple||!detailed) {
1826  VP1Msg::messageVerbose("AssocObjAttachmentHandle::setPickableStateOfNodes ERROR: Called with null pointers!");
1827  return;
1828  }
1829  }
1830  m_d->ensureInit();
1831  int isimple = m_d->septrack_simple->findChild(simple);
1832  if (VP1Msg::verbose()) {
1833  if (m_d->septrack_simple->getNumChildren()!=m_d->septrack_detailed->getNumChildren()) {
1834  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes septrack_simple->getNumChildren()"
1835  "!=m_d->septrack_detailed->getNumChildren().");
1836  return;
1837  }
1838  int idetailed = m_d->septrack_detailed->findChild(detailed);
1839  if (idetailed!=isimple) {
1840  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes"
1841  " called with simple and detailed nodes that are not at same child idx!");
1842  return;
1843  }
1846  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes detected wrong pickStyleChildIdx");
1847  return;
1848  }
1849  }
1850  if (isimple<0) {
1851  VP1Msg::messageDebug( "WARNING: AssocObjAttachmentHandle::setPickableStateOfNodes"
1852  " called with nodes that are not currently children. Calling attachNodes(..)." );
1853  attachNodes(simple, detailed, unpickable);
1854  return;
1855  }
1856  if (unpickable == (m_d->pickStyleChildIdx>-1&&isimple>m_d->pickStyleChildIdx)) {
1857  VP1Msg::messageDebug("WARNING: AssocObjAttachmentHandle::setPickableStateOfNodes"
1858  " already in correct state.");
1859  return;
1860  }
1861 
1862  simple->ref();//To avoid deletion upon removeChild calls.
1863  detailed->ref();
1864  if (unpickable) {
1865  m_d->septrack_simple->removeChild(simple);
1866  m_d->septrack_detailed->removeChild(detailed);
1867  if (m_d->pickStyleChildIdx==-1) {
1868  m_d->pickStyleChildIdx = m_d->septrack_simple->getNumChildren();
1869  m_d->septrack_simple->addChild(Imp::pickStyle);
1870  m_d->septrack_detailed->addChild(Imp::pickStyle);
1871  } else {
1872  --(m_d->pickStyleChildIdx);
1873  }
1874  m_d->septrack_simple->addChild(simple);
1875  m_d->septrack_detailed->addChild(detailed);
1876  } else {
1877  if (m_d->pickStyleChildIdx==-1) {
1878  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes Inconsistent logic");
1879  simple->unref();
1880  detailed->unref();
1881  return;
1882  }
1883  if (m_d->pickStyleChildIdx==isimple-1&&isimple==m_d->septrack_simple->getNumChildren()-1) {
1884  //pickStyle object no longer needed:
1885  VP1Msg::messageVerbose("AssocObjAttachmentHandle::setPickableStateOfNodes detaching pickstyle");
1886  m_d->septrack_simple->removeChild(Imp::pickStyle);
1887  m_d->septrack_detailed->removeChild(Imp::pickStyle);
1888  m_d->pickStyleChildIdx = -1;
1889  } else {
1890  //Move children left of the pickstyle object.
1891  m_d->septrack_simple->removeChild(simple);
1892  m_d->septrack_detailed->removeChild(detailed);
1893  m_d->septrack_simple->insertChild(simple,m_d->pickStyleChildIdx);
1894  m_d->septrack_detailed->insertChild(detailed,m_d->pickStyleChildIdx);
1895  ++(m_d->pickStyleChildIdx);
1896  }
1897  }
1898  simple->unref();
1899  detailed->unref();
1900 }
1901 
1902 //____________________________________________________________________
1903 void AssocObjAttachmentHandle::detachNodes( SoNode*simple, SoNode*detailed )
1904 {
1905  if (!m_d->trackmat)
1906  return;
1907  int isimple = m_d->septrack_simple->findChild(simple);
1908  if (VP1Msg::verbose()) {
1909  if (!simple||!detailed) {
1910  VP1Msg::messageVerbose("AssocObjAttachmentHandle::detach ERROR: Called with null pointers!");
1911  return;
1912  }
1913  if (m_d->septrack_simple->getNumChildren()!=m_d->septrack_detailed->getNumChildren()) {
1914  VP1Msg::message("ERROR: AssocObjAttachmentHandle::detachNodes septrack_simple->getNumChildren()"
1915  "!=m_d->septrack_detailed->getNumChildren().");
1916  return;
1917  }
1920  VP1Msg::message("ERROR: AssocObjAttachmentHandle::detachNodes detected wrong pickStyleChildIdx");
1921  return;
1922  }
1923  if (isimple==-1) {
1924  VP1Msg::message("ERROR: AssocObjAttachmentHandle::detachNodes Not previously attached!");
1925  return;
1926  }
1927  if (m_d->septrack_detailed->findChild(detailed)!=isimple) {
1928  VP1Msg::message("ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes"
1929  " called with simple and detailed nodes that are not at same child idx!");
1930  return;
1931  }
1932  }
1933  m_d->septrack_simple->removeChild(simple);
1934  m_d->septrack_detailed->removeChild(detailed);
1935  if ( m_d->pickStyleChildIdx!=-1
1936  && isimple>m_d->pickStyleChildIdx
1937  && m_d->pickStyleChildIdx==m_d->septrack_simple->getNumChildren()-1 ) {
1938  VP1Msg::messageVerbose("AssocObjAttachmentHandle::detachNodes detaching pickstyle");
1939  m_d->septrack_simple->removeChild(Imp::pickStyle);
1940  m_d->septrack_detailed->removeChild(Imp::pickStyle);
1941  m_d->pickStyleChildIdx = -1;
1942  }
1943 
1944  //Should we update the overall attachment status?:
1945  if (m_d->trackhandle->visible() && m_d->septrack_simple->getNumChildren() == 1 + (m_d->pickStyleChildIdx==-1?0:1))
1946  m_d->ensureDetached();
1947 }
1948 
1950  const MuonGM::MuonReadoutElement* re = nullptr;
1951  switch (TrkObjToString::type(&mb)){
1952  case TrkObjToString::MDT:
1954  break;
1955  case TrkObjToString::CSC:
1957  break;
1958  case TrkObjToString::RPC:
1960  break;
1961  case TrkObjToString::TGC:
1963  break;
1964  case TrkObjToString::sTGC:
1966  break;
1967  case TrkObjToString::MM:
1969  break;
1970  default:
1971  VP1Msg::message("TrackHandleBase::getReadoutElement:: Unable to find matching readoutElement");
1972  }
1973  return re;
1974  }
1975 
1976 
1977 
1978 //____________________________________________________________________
1979 QList<AssociatedObjectHandleBase*> TrackHandleBase::getVisibleMeasurements() const
1980 {
1981  QList<AssociatedObjectHandleBase*> l;
1982  if (!m_d->tsos_ascobjs) return l;
1984  it(m_d->tsos_ascobjs->begin()),
1985  itE(m_d->tsos_ascobjs->end());
1986  for (;it!=itE;++it)
1987  if ((*it)->hasMeasurement()&&(*it)->visible())
1988  l << (*it);
1989  return l;
1990 }
1991 
1992 void TrackHandleBase::fillObjectBrowser( QList<QTreeWidgetItem *>& listOfItems) {
1993  VP1Msg::messageVerbose("TrackHandleBase::fillObjectBrowser");
1994 
1995  assert(m_d->m_objBrowseTree==0);
1996  m_d->m_objBrowseTree = new QTreeWidgetItem();
1997 
1998  QString direction = QString::fromUtf8("(\u03B7,\u03D5)=[") + QString::number(momentum().eta(),'f',2) + ","+QString::number(momentum().phi(),'f',2)+"], ";
1999  QString l = direction + shortInfo();
2000  m_d->m_objBrowseTree->setText(0, type()+QString(QString::number(listOfItems.size())) );
2001  m_d->m_objBrowseTree->setText(1, l );
2002 
2003  if (!visible()) {
2004  m_d->m_objBrowseTree->setFlags(Qt::ItemFlags()); // not selectable, not enabled
2005  }
2006  listOfItems << browserTreeItem();
2007 }
2008 
2009 QTreeWidgetItem* TrackHandleBase::browserTreeItem() const {return m_d->m_objBrowseTree;}
2010 
2011 //____________________________________________________________________
2013 {
2014  if ( !browserTreeItem()) {
2015  VP1Msg::messageVerbose("visibleStateChanged: No m_objBrowseTree!");
2016  return;
2017  }
2018 
2019  if (!visible()) {
2020  browserTreeItem()->setFlags(Qt::ItemFlags()); // not selectable, not enabled
2021  } else {
2022  browserTreeItem()->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); // selectable, enabled
2023  }
2024  QFont itemFont = browserTreeItem()->font(0);
2025  itemFont.setStrikeOut(!visible());
2026  browserTreeItem()->setFont(0, itemFont);
2027  browserTreeItem()->setFont(1, itemFont);
2028 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonGM::MuonDetectorManager::getRpcReadoutElement
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:168
TrackHandleBase::Imp::dist
static double dist(const SbVec3f &p1, const SbVec3f &p2)
Definition: TrackHandleBase.cxx:825
TrackHandleBase::browserTreeItem
QTreeWidgetItem * browserTreeItem() const
Definition: TrackHandleBase.cxx:2009
TrackLODHandle::removeNodes
void removeNodes(SoGroup *simple, SoGroup *detailed)
Definition: TrackLODManager.cxx:327
query_example.row
row
Definition: query_example.py:24
TrackCommonFlags::InDetProjections
@ InDetProjections
Definition: TrackCommonFlags.h:27
beamspotman.r
def r
Definition: beamspotman.py:676
TrackPropagationHelper.h
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:33
MdtReadoutElement.h
TrackHandleBase::~TrackHandleBase
virtual ~TrackHandleBase()
Definition: TrackHandleBase.cxx:212
TrackHandleBase::customColouredTSOSParts
TrackCommonFlags::TSOSPartsFlags customColouredTSOSParts() const
Definition: TrackHandleBase.cxx:306
TrackCollHandleBase.h
AssocObjAttachmentHandle::setPickableStateOfNodes
void setPickableStateOfNodes(SoNode *simple, SoNode *detailed, bool unpickable)
Will attach if not currently attached.
Definition: TrackHandleBase.cxx:1820
TrackHandleBase::touchedMuonChambers
const std::set< GeoPVConstLink > & touchedMuonChambers() const
Definition: TrackHandleBase.cxx:1258
AssocObjAttachmentHandle::Imp::ensureInit
void ensureInit()
Definition: TrackHandleBase.cxx:1746
TrackHandleBase::visibleStateChanged
virtual void visibleStateChanged()
override if need to take action in this case.
Definition: TrackHandleBase.cxx:2012
Trk::proton
@ proton
Definition: ParticleHypothesis.h:31
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
TrackCollHandleBase
Definition: TrackCollHandleBase.h:49
TrackHandleBase::Imp::theclass
TrackHandleBase * theclass
Definition: TrackHandleBase.cxx:108
MuonChamberProjectionHelper
Definition: MuonChamberProjectionHelper.h:32
AssocObjAttachmentHandle::Imp::Imp
Imp(TrackLODHandle *tlh, TrackHandleBase *th)
Definition: TrackHandleBase.cxx:1631
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
checkFileSG.line
line
Definition: checkFileSG.py:75
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TrackHandleBase::Imp::addTSOS
AscObj_TSOS * addTSOS(const Trk::TrackStateOnSurface *tsos, unsigned index) const
Definition: TrackHandleBase.cxx:415
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrackCollHandleBase::decrementNShownHandles
void decrementNShownHandles()
Definition: TrackCollHandleBase.h:126
AscObj_TSOS::parts
TrackCommonFlags::TSOSPartsFlags parts() const
Definition: AscObj_TSOS.h:59
TrackHandleBase::fillObjectBrowser
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Overload in child classes.
Definition: TrackHandleBase.cxx:1992
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
TrackHandleBase::registerTouchedMuonChamber
void registerTouchedMuonChamber(const GeoPVConstLink &) const
If not earlier, touched muon chambers must me registered at latest when this method is invoked.
Definition: TrackHandleBase.cxx:1252
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
AssocObjAttachmentHandle::~AssocObjAttachmentHandle
~AssocObjAttachmentHandle()
Definition: TrackHandleBase.cxx:1696
max
#define max(a, b)
Definition: cfImp.cxx:41
TrackHandleBase::Imp::attachmentHandles
std::map< std::pair< int, double >, AssocObjAttachmentHandle * > attachmentHandles
Definition: TrackHandleBase.cxx:154
AssocObjAttachmentHandle::Imp::septrack_simple
SoSeparator * septrack_simple
Definition: TrackHandleBase.cxx:1642
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
InDetProjHelper.h
TrkObjToString::RPC
@ RPC
Definition: TrkObjToString.h:44
TrackHandleBase::clearLine
void clearLine()
Definition: TrackHandleBase.cxx:623
VP1StdCollection::material
SoMaterial * material() const
Definition: VP1StdCollection.cxx:220
TrackSystemController.h
TrackLODHandle
Definition: TrackLODManager.h:56
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TouchedMuonChamberHelper::incrementNumberOfObjectsForPV
void incrementNumberOfObjectsForPV(const GeoPVConstLink &chamberPV)
Definition: TouchedMuonChamberHelper.cxx:59
TrackHandleBase::charge
double charge() const
Definition: TrackHandleBase.cxx:1491
AssocObjAttachmentHandle::Imp::pickStyleChildIdx
int pickStyleChildIdx
Definition: TrackHandleBase.cxx:1646
VP1MaterialButton.h
VP1ExtraSepLayerHelper.h
sTgcReadoutElement.h
DataVector::rend
const_reverse_iterator rend() const noexcept
Return a const_reverse_iterator pointing at the beginning of the collection.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
TrkObjToString::TGC
@ TGC
Definition: TrkObjToString.h:45
index
Definition: index.py:1
TrkObjToString::MM
@ MM
Definition: TrkObjToString.h:47
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
VP1Msg.h
TrackHandleBase::m_currentmaterial
SoMaterial * m_currentmaterial
Definition: TrackHandleBase.h:178
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
TrackHandleBase.h
TrackHandleBase::Imp::detach3DObjects
void detach3DObjects()
Definition: TrackHandleBase.cxx:918
VP1TrackSanity::isSafe
static bool isSafe(const Trk::TrackStateOnSurface *)
Definition: VP1TrackSanity.cxx:46
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
SurfaceToSoNode
Definition: SurfaceToSoNode.h:30
TrackHandleBase::Imp
Definition: TrackHandleBase.cxx:75
TrackHandleBase::Imp::touchedmuonchambers
std::set< GeoPVConstLink > touchedmuonchambers
Definition: TrackHandleBase.cxx:142
TrackCollHandleBase::COLOUR_MOMENTUM
@ COLOUR_MOMENTUM
Definition: TrackCollHandleBase.h:138
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
TrackCommonFlags
Definition: TrackCommonFlags.h:21
TrackHandleBase::Imp::convertLineSetToCylinders
static void convertLineSetToCylinders(SoLineSet *line, SoSeparator *sep, const double &cylradius)
Definition: TrackHandleBase.cxx:834
TrackHandleBase::getNTGCHits
virtual unsigned getNTGCHits() const
Definition: TrackHandleBase.h:113
TrackSysCommonData::touchedMuonChamberHelper
TouchedMuonChamberHelper * touchedMuonChamberHelper() const
Definition: TrackSysCommonData.h:121
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TrackHandleBase::collHandle
TrackCollHandleBase * collHandle() const
Definition: TrackHandleBase.h:68
TrackHandleBase::Imp::ensureInitPointsProjections_InDet
void ensureInitPointsProjections_InDet(bool raw)
Definition: TrackHandleBase.cxx:1077
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TrackCommonFlags::MuonProjections
@ MuonProjections
Definition: TrackCommonFlags.h:28
VP1QtUtils.h
TrackHandleBase::Imp::massinit
bool massinit
Definition: TrackHandleBase.cxx:112
TrackLODManager.h
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VP1ParticleData.h
TrackHandleBase::Imp::isSane
static bool isSane(const Amg::Vector3D &p)
Definition: TrackHandleBase.cxx:163
TrackHandleBase::updateShapes_TSOSWithMeasurements
void updateShapes_TSOSWithMeasurements()
Definition: TrackHandleBase.cxx:261
TrackSystemController::FitQuality
@ FitQuality
Definition: TrackSystemController.h:173
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
AssocObjAttachmentHandle::detachNodes
void detachNodes(SoNode *simple, SoNode *detailed)
Definition: TrackHandleBase.cxx:1903
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
TrackSysCommonData::registerTrack
void registerTrack(SoNode *, TrackHandleBase *)
Definition: TrackSysCommonData.cxx:125
TrackHandleBase::updateMuonProjections
void updateMuonProjections()
Definition: TrackHandleBase.cxx:525
TrackHandleBase::Imp::Imp
Imp(TrackHandleBase *tc)
Definition: TrackHandleBase.cxx:82
TrackHandleBase::Imp::extraRepresentation
SoSeparator * extraRepresentation
Definition: TrackHandleBase.cxx:116
AssocObjAttachmentHandle::AssocObjAttachmentHandle
AssocObjAttachmentHandle(TrackLODHandle *, TrackHandleBase *)
Definition: TrackHandleBase.cxx:1684
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TrackHandleBase::getNSCTHits
virtual unsigned getNSCTHits() const
Definition: TrackHandleBase.h:107
AssocObjAttachmentHandle::Imp::trackmat
SoMaterial * trackmat
Definition: TrackHandleBase.cxx:1640
AssocObjAttachmentHandle::trackMaterialChanged
void trackMaterialChanged()
Definition: TrackHandleBase.cxx:1724
Amg::SetVectorVector3D
std::set< std::vector< Amg::Vector3D >, VectorVector3DComparer > SetVectorVector3D
Definition: GeoPrimitivesHelpers.h:36
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
TrackHandleBase::Imp::tsos_ascobjs
std::vector< AscObj_TSOS * > * tsos_ascobjs
Definition: TrackHandleBase.cxx:177
AssocObjAttachmentHandle::Imp::trackhandle
TrackHandleBase * trackhandle
Definition: TrackHandleBase.cxx:1639
TrackHandleBase::Imp::ensureInitTSOSs
void ensureInitTSOSs()
Definition: TrackHandleBase.cxx:376
TrackHandleBase::Imp::points_propagated_muon_projections
Amg::SetVectorVector3D * points_propagated_muon_projections
Definition: TrackHandleBase.cxx:129
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
TruthTest.itE
itE
Definition: TruthTest.py:25
TrackHandleBase::AssocObjAttachmentHandle
friend class AssocObjAttachmentHandle
Definition: TrackHandleBase.h:170
VP1TrackSanity.h
TrackHandleBase::getMuonReadoutElement
virtual const MuonGM::MuonReadoutElement * getMuonReadoutElement(const Trk::RIO_OnTrack &mb) const
Definition: TrackHandleBase.cxx:1949
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
TrackHandleBase::hackGetPointsPropagated
std::vector< Amg::Vector3D > * hackGetPointsPropagated()
FIXME.
Definition: TrackHandleBase.cxx:1622
VP1LinAlgUtils::phiFromXY
static double phiFromXY(const double &x, const double &y)
Definition: VP1LinAlgUtils.cxx:374
Track.h
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
TrackHandleBase::getNsTGCHits
virtual unsigned getNsTGCHits() const
Definition: TrackHandleBase.h:116
TrackHandleBase::Imp::determineMaterial
SoMaterial * determineMaterial()
Definition: TrackHandleBase.cxx:1269
VP1LinAlgUtils.h
VP1DetInfo.h
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
TrackHandleBase::registerAssocObject
void registerAssocObject(AssociatedObjectHandleBase *)
Trackhandle assumes ownership.
Definition: TrackHandleBase.cxx:1432
TrackCollHandleBase::COLOUR_PERCOLLECTION
@ COLOUR_PERCOLLECTION
Definition: TrackCollHandleBase.h:138
TrackHandleBase::calculateCharge
virtual double calculateCharge() const
Definition: TrackHandleBase.cxx:1464
GeoPrimitives.h
TrackHandleBase::endPoint
virtual std::optional< Amg::Vector3D > endPoint() const
returns 0 if can't find start point.
Definition: TrackHandleBase.cxx:1590
TrackHandleBase::ensureTouchedMuonChambersInitialised
virtual void ensureTouchedMuonChambersInitialised() const
Definition: TrackHandleBase.h:155
TrackHandleBase::getNTRTHits
virtual unsigned getNTRTHits() const
Definition: TrackHandleBase.h:108
CylinderVolumeBounds.h
TrackLODHandle::addNodes
void addNodes(SoGroup *simple, SoGroup *detailed)
Definition: TrackLODManager.cxx:277
TrackSystemController::Direction
@ Direction
Definition: TrackSystemController.h:173
MMReadoutElement.h
Volume.h
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
TrackHandleBase::Imp::points_propagated_id_projections
Amg::SetVectorVector3D * points_propagated_id_projections
Definition: TrackHandleBase.cxx:128
TrackHandleBase::updateShapes_TSOSWithErrors
void updateShapes_TSOSWithErrors()
Definition: TrackHandleBase.cxx:274
AssocObjAttachmentHandle::Imp::septrack_detailed
SoSeparator * septrack_detailed
Definition: TrackHandleBase.cxx:1643
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
python.TriggerHandler.th
th
Definition: TriggerHandler.py:296
TrackHandleBase::Imp::m_objBrowseTree
QTreeWidgetItem * m_objBrowseTree
Definition: TrackHandleBase.cxx:181
SimBarCode.h
TrackHandleBase::Imp::randommaterial
SoMaterial * randommaterial
Definition: TrackHandleBase.cxx:151
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
AssocObjAttachmentHandle::Imp
Definition: TrackHandleBase.cxx:1629
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
TrkObjToString.h
TrackSysCommonData
Definition: TrackSysCommonData.h:47
AssociatedObjectHandleBase.h
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
AmgStringHelpers.h
TrackHandleBase::Imp::pathInfo_TrkTrack
const Trk::Track * pathInfo_TrkTrack
Definition: TrackHandleBase.cxx:158
TrackHandleBase::setCustomColouredTSOSParts
void setCustomColouredTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
Definition: TrackHandleBase.cxx:351
TrackHandleBase::updateRandomColourTransparencyAndBrightness
void updateRandomColourTransparencyAndBrightness()
Definition: TrackHandleBase.cxx:1419
AssocObjAttachmentHandle::attachNodes
void attachNodes(SoNode *simple, SoNode *detailed, bool unpickable)
Definition: TrackHandleBase.cxx:1768
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrackHandleBase::momentum
virtual Amg::Vector3D momentum() const
Definition: TrackHandleBase.h:83
VP1MaterialButton::setMaterialParameters
static void setMaterialParameters(SoMaterial *m, const QColor &, const double &brightness=0.0, const double &transp=0.0)
Definition: VP1MaterialButton.cxx:802
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
AssocObjAttachmentHandle::Imp::lodHandle
TrackLODHandle * lodHandle
Definition: TrackHandleBase.cxx:1641
SimBarCode::unknownPDG
static const int unknownPDG
Definition: SimBarCode.h:25
TrackHandleBase::Imp::materialChanged
void materialChanged()
Definition: TrackHandleBase.cxx:816
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
TrackHandleBase::visible
bool visible() const
Definition: TrackHandleBase.h:67
TrackHandleBase::Imp::ntrackhandles
static int ntrackhandles
Definition: TrackHandleBase.cxx:80
AssocObjAttachmentHandle::Imp::pickStyle
static SoPickStyle * pickStyle
Definition: TrackHandleBase.cxx:1645
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
TrackHandleBase::getNRPCHits
virtual unsigned getNRPCHits() const
Definition: TrackHandleBase.h:112
extractSporadic.h
list h
Definition: extractSporadic.py:97
TrackHandleBase::setShownTSOSParts
void setShownTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
Definition: TrackHandleBase.cxx:312
TrackHandleBase::Imp::associatedObjects
QList< AssociatedObjectHandleBase * > associatedObjects
Definition: TrackHandleBase.cxx:153
TrkObjToString::CSC
@ CSC
Definition: TrkObjToString.h:43
TrackCommonFlags::VertexProjections
@ VertexProjections
Definition: TrackCommonFlags.h:29
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
TrackHandleBase::getAllAscObjHandles
QList< AssociatedObjectHandleBase * > getAllAscObjHandles() const
override if need to take action in this case.
Definition: TrackHandleBase.cxx:1617
TrackHandleBase::rerandomiseRandomMaterial
void rerandomiseRandomMaterial()
Definition: TrackHandleBase.cxx:1378
TrackCommonFlags::ActualPath
@ ActualPath
Definition: TrackCommonFlags.h:26
AssocObjAttachmentHandle
Definition: TrackHandleBase.h:197
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
TrackHandleBase::provide_pathInfoPoints
virtual const std::vector< Amg::Vector3D > * provide_pathInfoPoints() const
Definition: TrackHandleBase.h:150
TrackCollHandleBase::name
QString name() const
Definition: TrackCollHandleBase.cxx:310
TrackHandleBase::getNMuonHits
virtual unsigned getNMuonHits() const
Definition: TrackHandleBase.h:109
VP1ParticleData::particleCharge
static double particleCharge(const int &pdgcode, bool &ok)
Definition: VP1ParticleData.cxx:104
CscReadoutElement.h
TrkObjToString::MDT
@ MDT
Definition: TrkObjToString.h:46
SurfaceToSoNode::translateSurface
SoNode * translateSurface(const Trk::Surface &sf, const bool &simple=false) const
Definition: SurfaceToSoNode.cxx:57
TrackHandleBase::Imp::extraRepAttached
bool extraRepAttached
Definition: TrackHandleBase.cxx:118
TrkObjToString::type
static MeasurementType type(const Trk::PrepRawData *prd)
Definition: TrkObjToString.cxx:64
TrackHandleBase::Imp::chargeinit
bool chargeinit
Definition: TrackHandleBase.cxx:110
TrackHandleBase::currentMaterial
SoMaterial * currentMaterial() const
Definition: TrackHandleBase.h:76
TrackHandleBase::Imp::~Imp
~Imp()
Definition: TrackHandleBase.cxx:107
TrackHandleBase::Imp::ensureInitPointsPropagated
void ensureInitPointsPropagated()
Definition: TrackHandleBase.cxx:1045
AssocObjAttachmentHandle::m_d
Imp * m_d
Definition: TrackHandleBase.h:211
TrackSystemController::P
@ P
Definition: TrackSystemController.h:172
TrackCollHandleBase::COLOUR_VERTEX
@ COLOUR_VERTEX
Definition: TrackCollHandleBase.h:138
MuonChamberProjectionHelper::projectAndConstrainLineSegmentToMDTChamberEndWalls
bool projectAndConstrainLineSegmentToMDTChamberEndWalls(const GeoPVConstLink &mdtChamber, const Amg::Vector3D &pointA, const Amg::Vector3D &pointB, Amg::Vector3D &firstEndWall_pointA, Amg::Vector3D &firstEndWall_pointB, Amg::Vector3D &secondEndWall_pointA, Amg::Vector3D &secondEndWall_pointB, bool &outsidechamber)
Definition: MuonChamberProjectionHelper.cxx:373
Trk::ParametersBase
Definition: ParametersBase.h:55
AscObjSelectionManager.h
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
AscObj_TSOS.h
TrackHandleBase::pdgCode
virtual int pdgCode() const
0 means unknown
Definition: TrackHandleBase.h:86
DataVector::rbegin
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
TrackHandleBase::getNMDTHits
virtual unsigned getNMDTHits() const
Definition: TrackHandleBase.h:111
TrackHandleBase::registerTrack
void registerTrack()
Definition: TrackHandleBase.cxx:633
TrackSystemController::Hits
@ Hits
Definition: TrackSystemController.h:172
TrackSystemController::Pid
@ Pid
Definition: TrackSystemController.h:172
TrackHandleBase::Imp::rebuild3DObjects
void rebuild3DObjects()
Definition: TrackHandleBase.cxx:641
TrackSysCommonData::unregisterTrack
void unregisterTrack(SoNode *)
Definition: TrackSysCommonData.cxx:140
TrackHandleBase::Imp::pathInfoLoaded
bool pathInfoLoaded
Definition: TrackHandleBase.cxx:157
min
#define min(a, b)
Definition: cfImp.cxx:40
lumiFormat.array
array
Definition: lumiFormat.py:98
TrackHandleBase::getNMMHits
virtual unsigned getNMMHits() const
Definition: TrackHandleBase.h:115
TrackHandleBase::m_collhandle
TrackCollHandleBase * m_collhandle
Definition: TrackHandleBase.h:177
TrackHandleBase::common
TrackSysCommonData * common() const
Definition: TrackHandleBase.cxx:255
TrackHandleBase::TrackHandleBase
TrackHandleBase(TrackCollHandleBase *)
Definition: TrackHandleBase.cxx:204
TrackHandleBase::extrapolationParticleHypothesis
virtual Trk::ParticleHypothesis extrapolationParticleHypothesis() const
Default implementation of this next method bases hypothesis on pdgCode() and charge():
Definition: TrackHandleBase.cxx:1517
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
TrackHandleBase::updateMaterial
void updateMaterial()
Definition: TrackHandleBase.cxx:937
TrackHandleBase::getNPixelHits
virtual unsigned getNPixelHits() const
Definition: TrackHandleBase.h:106
grepfile.sep
sep
Definition: grepfile.py:38
TrackHandleBase::Imp::addPathsToSoLineSetAndSoVertexProperty
void addPathsToSoLineSetAndSoVertexProperty(const Amg::SetVectorVector3D *paths, int &iver, int &numlines, SoLineSet *, SoVertexProperty *) const
Definition: TrackHandleBase.cxx:603
TrackCollHandleBase::COLOUR_DISTANCE
@ COLOUR_DISTANCE
Definition: TrackCollHandleBase.h:138
fitman.g2
g2
Definition: fitman.py:624
TrackHandleBase::Imp::attach3DObjects
void attach3DObjects()
Definition: TrackHandleBase.cxx:883
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
TrackHandleBase::startPoint
virtual std::optional< Amg::Vector3D > startPoint() const
returns 0 if can't find start point.
Definition: TrackHandleBase.cxx:1570
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition: VP1HelperClassBase.h:50
python.selection.number
number
Definition: selection.py:20
TrackHandleBase::Imp::shownTSOSParts
TrackCommonFlags::TSOSPartsFlags shownTSOSParts
Definition: TrackHandleBase.cxx:175
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrackSystemController::Pt
@ Pt
Definition: TrackSystemController.h:172
RIO_OnTrack.h
DataVector< const Trk::TrackStateOnSurface >::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Standard const_reverse_iterator.
Definition: DataVector.h:846
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrackHandleBase::Imp::extrapSurfaces_sep
SoSeparator * extrapSurfaces_sep
for debugging.
Definition: TrackHandleBase.cxx:117
TrackSysCommonData::lastSelectedTrackHandle
TrackHandleBase * lastSelectedTrackHandle()
pointer to base of last selected track (zero if nothing selected)
Definition: TrackSysCommonData.h:129
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
TrackHandleBase::Imp::pathInfo_Points
const std::vector< Amg::Vector3D > * pathInfo_Points
Definition: TrackHandleBase.cxx:159
TrackCollHandleBase::COLOUR_BYPID
@ COLOUR_BYPID
Definition: TrackCollHandleBase.h:138
TrackHandleBase::Imp::charge
double charge
Definition: TrackHandleBase.cxx:111
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::IExtrapolator
Definition: IExtrapolator.h:62
MuonChamberProjectionHelper.h
query_example.col
col
Definition: query_example.py:7
Trk::kaon
@ kaon
Definition: ParticleHypothesis.h:30
MuonDetectorManager.h
TrackHandleBase::isIDTrack
virtual bool isIDTrack() const
Definition: TrackHandleBase.cxx:1609
TrkObjToString::shortInfo
static QString shortInfo(const Trk::MeasurementBase &mb)
Definition: TrkObjToString.cxx:208
AssocObjAttachmentHandle::Imp::dummymaterial
static SoMaterial * dummymaterial
Definition: TrackHandleBase.cxx:1666
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuonChamberProjectionHelper::isKnownMDTChamber
bool isKnownMDTChamber(const GeoPVConstLink &mdtChamber)
Definition: MuonChamberProjectionHelper.cxx:268
AscObj_TSOS::setDistToNextPar
void setDistToNextPar(const double &)
Definition: AscObj_TSOS.cxx:165
python.PyAthena.v
v
Definition: PyAthena.py:157
TouchedMuonChamberHelper::decrementNumberOfObjectsForPV
void decrementNumberOfObjectsForPV(const GeoPVConstLink &chamberPV)
Definition: TouchedMuonChamberHelper.cxx:73
TrackHandleBase::updateShapes_TSOSWithMaterialEffects
void updateShapes_TSOSWithMaterialEffects()
Definition: TrackHandleBase.cxx:287
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
TrackHandleBase::m_d
Imp * m_d
Definition: TrackHandleBase.h:171
TrackHandleBase::getNCSCHits
virtual unsigned getNCSCHits() const
Definition: TrackHandleBase.h:114
VP1DetInfo::muonDetMgr
static const MuonGM::MuonDetectorManager * muonDetMgr()
Definition: VP1DetInfo.cxx:148
TrackHandleBase::getVisibleMeasurements
QList< AssociatedObjectHandleBase * > getVisibleMeasurements() const
Definition: TrackHandleBase.cxx:1979
TrackHandleBase::Imp::ensureInitPointsProjections_Muon
void ensureInitPointsProjections_Muon(bool raw)
Definition: TrackHandleBase.cxx:1139
TrackHandleBase::updateInDetProjections
void updateInDetProjections()
Definition: TrackHandleBase.cxx:512
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
h
TrackHandleBase::setVisible
void setVisible(bool)
use by the collection handle.
Definition: TrackHandleBase.cxx:426
TrackCollHandleBase::incrementNShownHandles
void incrementNShownHandles()
Definition: TrackCollHandleBase.h:125
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
TrackHandleBase::Imp::ensureLoadPathInfo
void ensureLoadPathInfo()
Definition: TrackHandleBase.cxx:189
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
AssocObjAttachmentHandle::trackVisibilityChanged
void trackVisibilityChanged()
Definition: TrackHandleBase.cxx:1672
TrackHandleBase::update3DObjects
void update3DObjects(bool invalidatePropagatedPoints=false, float maxR=0.0)
Definition: TrackHandleBase.cxx:488
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrackHandleBase::provide_pathInfoTrkTrack
virtual const Trk::Track * provide_pathInfoTrkTrack() const
Definition: TrackHandleBase.h:148
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:255
re
const boost::regex re(r_e)
VP1ParticleData::particleMass
static double particleMass(const int &pdgcode, bool &ok)
Definition: VP1ParticleData.cxx:84
TrackHandleBase::Imp::points_raw_muon_projections
Amg::SetVectorVector3D * points_raw_muon_projections
Definition: TrackHandleBase.cxx:127
TrackCollHandleBase::COLOUR_RANDOM
@ COLOUR_RANDOM
Definition: TrackCollHandleBase.h:138
TrackCommonFlags::TSOS_NoObjects
@ TSOS_NoObjects
Definition: TrackCommonFlags.h:43
TrackHandleBase::shownTSOSParts
TrackCommonFlags::TSOSPartsFlags shownTSOSParts() const
Definition: TrackHandleBase.cxx:300
TrackHandleBase::Imp::points_raw_id_projections
Amg::SetVectorVector3D * points_raw_id_projections
Definition: TrackHandleBase.cxx:126
TrackHandleBase::Imp::ensureInitPointsRaw
void ensureInitPointsRaw()
Definition: TrackHandleBase.cxx:967
TrackHandleBase::Imp::addPathToSoLineSetAndSoVertexProperty
void addPathToSoLineSetAndSoVertexProperty(const std::vector< Amg::Vector3D > &points, int &iver, int &numlines, SoLineSet *, SoVertexProperty *) const
Definition: TrackHandleBase.cxx:539
AscObj_TSOS::approxCenter
Amg::Vector3D approxCenter() const
Definition: AscObj_TSOS.cxx:173
TrackHandleBase::Imp::tempMaxPropRadius
float tempMaxPropRadius
Definition: TrackHandleBase.cxx:182
AssocObjAttachmentHandle::Imp::ensureDetached
void ensureDetached()
Definition: TrackHandleBase.cxx:1657
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TrackHandleBase::Imp::customColouredTSOSParts
TrackCommonFlags::TSOSPartsFlags customColouredTSOSParts
Definition: TrackHandleBase.cxx:176
AscObj_TSOS::setVisible
virtual void setVisible(bool)
Definition: AscObj_TSOS.cxx:1167
TrackHandleBase::Imp::points_propagated
std::vector< Amg::Vector3D > * points_propagated
Definition: TrackHandleBase.cxx:124
TrackHandleBase::Imp::line
SoLineSet * line
Definition: TrackHandleBase.cxx:115
TgcReadoutElement.h
TrackHandleBase::getAttachmentHandle
AssocObjAttachmentHandle * getAttachmentHandle(int regionIndex, const double &crossoverval)
Definition: TrackHandleBase.cxx:1451
TrackHandleBase::baseInfo
QStringList baseInfo() const
Definition: TrackHandleBase.cxx:1534
TrackHandleBase::hasCharge
bool hasCharge() const
Definition: TrackHandleBase.h:99
str
Definition: BTagTrackIpAccessor.cxx:11
VP1JobConfigInfo.h
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
TouchedMuonChamberHelper.h
calibdata.copy
bool copy
Definition: calibdata.py:27
SurfaceToSoNode.h
MuonGM::MuonDetectorManager::getsTgcReadoutElement
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:259
TrackCollHandleBase::common
TrackSysCommonData * common() const
Definition: TrackCollHandleBase.h:79
TrackHandleBase::m_visible
bool m_visible
Definition: TrackHandleBase.h:176
TrackHandleBase::mass
virtual double mass() const
Definition: TrackHandleBase.cxx:1501
TrackHandleBase::Imp::label_sep
SoSeparator * label_sep
Definition: TrackHandleBase.cxx:160
TrackHandleBase
Definition: TrackHandleBase.h:56
TrackHandleBase::numberOfInstances
static int numberOfInstances()
Definition: TrackHandleBase.cxx:249
AssocObjAttachmentHandle::Imp::attached
bool attached
Definition: TrackHandleBase.cxx:1647
VP1JobConfigInfo::hasMuonGeometry
static bool hasMuonGeometry()
Definition: VP1JobConfigInfo.cxx:134
TrkObjToString::sTGC
@ sTGC
Definition: TrkObjToString.h:48
TrackHandleBase::Imp::inittouchedchambers
bool inittouchedchambers
Definition: TrackHandleBase.cxx:143
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
TrackHandleBase::unknown
static double unknown()
Definition: TrackHandleBase.h:102
AssocObjAttachmentHandle::Imp::ensureAttached
void ensureAttached()
Definition: TrackHandleBase.cxx:1648
python.compressB64.c
def c
Definition: compressB64.py:93
python.SystemOfUnits.km
int km
Definition: SystemOfUnits.py:95
AscObj_TSOS
Definition: AscObj_TSOS.h:45
IVP1System::message
void message(const QString &) const
Definition: IVP1System.cxx:336
python.SystemOfUnits.m3
int m3
Definition: SystemOfUnits.py:93
TrackHandleBase::Imp::mass
double mass
Definition: TrackHandleBase.cxx:113
TrackStateOnSurface.h
TrackCollHandleBase::COLOUR_CHARGE
@ COLOUR_CHARGE
Definition: TrackCollHandleBase.h:138
VP1ParticleData::particleName
static QString particleName(const int &pdgcode, bool &ok)
Definition: VP1ParticleData.cxx:128
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
VP1TrackSystem.h
TrackHandleBase::Imp::points_raw
std::vector< Amg::Vector3D > * points_raw
Definition: TrackHandleBase.cxx:123
test_athena_ntuple_dumper.paths
paths
Definition: test_athena_ntuple_dumper.py:7
RpcReadoutElement.h