ATLAS Offline Software
AscObj_TSOS.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class AscObj_TSOS //
9 // //
10 // Author: Troels Kofoed Jacobsen //
11 // Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
12 // Initial version: June 2008 //
13 // //
15 
16 //Surface from materialeffects.
17 
18 //Troels todo:
19 // projections (not right away)
20 
21 //Thomas todo:
22 // print truth info (get rid of truth points)
23 // Notify when path changes.
24 //
25 // Fixme: shared objects? Or cache scene parts for faster updating??
26 
34 
35 #include "VP1Base/VP1Msg.h"
37 #include "VP1Base/IVP13DSystem.h"
39 #include "VP1Base/VP1QtUtils.h"
42 #include "VP1Utils/VP1ErrorUtils.h"
43 #include "VP1Utils/VP1DetInfo.h"
45 
47 
50 
51 
63 
65 
75 
76 #include <Inventor/nodes/SoLineSet.h>
77 #include <Inventor/nodes/SoSeparator.h>
78 #include <Inventor/nodes/SoVertexProperty.h>
79 #include <Inventor/nodes/SoPointSet.h>
80 #include <Inventor/nodes/SoCamera.h>
81 #include <Inventor/nodes/SoCylinder.h>
82 #include <Inventor/nodes/SoMaterial.h>
83 #include <Inventor/nodes/SoRotationXYZ.h>
84 #include <Inventor/nodes/SoTransform.h>
85 #include <Inventor/nodes/SoTranslation.h>
86 #include <Inventor/nodes/SoSphere.h>
87 
88 #include <set>
89 
92 
93 //____________________________________________________________________
95  const Trk::TrackStateOnSurface * tsos,
96  unsigned indexOfPointOnTrack )
97  : AssociatedObjectHandleBase(track), m_tsos(tsos),
98  m_parts(TrackCommonFlags::TSOS_NoObjects),
99  m_indexOfPointOnTrack(indexOfPointOnTrack),
100  m_distToNextPar(-1),
101  m_objBrowseTree(nullptr)
102 {
104 
105  const Trk::Surface * surf(nullptr);
106 
108 
109  if (m_tsos->trackParameters()) {
111  if (dynamic_cast<const Trk::TrackParameters *>(m_tsos->trackParameters())) {
114  }
115  else {
117  }
118  }
119  surf = &(m_tsos->trackParameters()->associatedSurface());
120  }
121 
122  if (measurement()) {
124  if (rioOnTrack()) {
127  else
129  } else if (competingRIOsOnTrack()) {
132  else
134  } else
135  VP1Msg::messageDebug("Warning: Ignoring measurement which is not a (competing) rio on track.");
136  if (!surf) surf = &(measurement()->associatedSurface());
137  }
139  if (matEff) {
140  const Trk::MaterialEffectsOnTrack * meot = dynamic_cast<const Trk::MaterialEffectsOnTrack * >(matEff);
141  if (meot) {
142  if (meot->energyLoss()&&meot->energyLoss()->deltaE()!=0)
144  else
146  } else {
147  if (dynamic_cast<const Trk::EstimatedBremOnTrack * >(matEff))
148  VP1Msg::messageDebug("Warning: Ignoring EstimatedBremOnTrack.");
149  else
150  VP1Msg::messageDebug("Warning: Ignoring material effect which is not MaterialEffectsOnTrack.");
151  }
152  if (!surf)
153  surf = &(matEff->associatedSurface());
154  }
155  if (surf) {
156  if (surf->associatedDetectorElement())
158  else
160 
161  }
162 }
163 
164 //____________________________________________________________________
165 void AscObj_TSOS::setDistToNextPar(const double& d)
166 {
167  //We assume this is called right after the constructor - so no need
168  //to update 3D objects.
169  m_distToNextPar = d;
170 }
171 
172 //____________________________________________________________________
174 {
175  if (hasParameters())
176  return m_tsos->trackParameters()->position();
177  if (hasSurface())
178  return surface()->center();
179  VP1Msg::message("AscObj_TSOS::approxCenter() WARNING: Failed to determine"
180  " position from either params or surface");
181  return Amg::Vector3D(0,0,0);
182 }
183 
184 //____________________________________________________________________
186 {
188  static const double l=30.0*CLHEP::cm;
189  return static_cast<int>(c.z()/l)
190  +1000*static_cast<int>(c.y()/l)
191  +1000000*static_cast<int>(c.x()/l);
192 }
193 
194 //____________________________________________________________________
196 {
197  return m_tsos->measurementOnTrack();
198 }
199 
200 //____________________________________________________________________
201 SoTranslation* AscObj_TSOS::getZTranslationTube( const Trk::Surface * theSurface,
202  const double& maxTrans ) const
203 {
204  const Amg::Vector3D origo = theSurface->localToGlobal(Amg::Vector2D(0,0));
205  const Amg::Vector3D unitz = theSurface->localToGlobal(Amg::Vector2D(0,1));
206 
207  std::vector< Amg::Vector3D > * points = trackHandle()->hackGetPointsPropagated();//FIXME
208 
210  double smin=0;
211  size_t imin=0;
212  //First we find the point in PointsPropageted closest to the line.
213  for ( size_t i = 0; i<points->size(); i++)
214  {
215  double s;
216  double dist = VP1LinAlgUtils::distPointLine2( (*points)[i], origo, unitz, s );
217  if (dist < min)
218  {
219  min = dist;
220  imin = i;
221  }
222  }
223 
224  if (points->size()>1 ){
225  // FIXME - don't think we should ever really need this test. EJWM.
226 
227  //Then we get the parameters on the forward and backward lines giving the points with
228  //the shortest distances.
229  //We then use the line which has the parameter closest to 0.5 which means that it
230  //is inside the part of the line between this point and the next/previous
231  double sp,tp,sm,tm;
232  if (imin+1 < points->size() && imin >= 1)
233  {
234  VP1LinAlgUtils::distLineLineParam((*points).at(imin),(*points).at(imin+1),origo,unitz,tp,sp);
235  VP1LinAlgUtils::distLineLineParam((*points).at(imin-1),(*points).at(imin),origo,unitz,tm,sm);
236  smin = std::abs(tm - 0.5) < std::abs(tp - 0.5) ? sm : sp;
237  } else if (imin+1 >= points->size() && imin >= 1 )
238  {
239  VP1LinAlgUtils::distLineLineParam((*points).at(imin-1),(*points).at(imin),origo,unitz,tm,sm);
240  smin = sm;
241  } else
242  {
243  VP1LinAlgUtils::distLineLineParam((*points).at(imin),(*points).at(imin+1),origo,unitz,tp,sp);
244  smin = sp;
245  }
246  } else {
247  // probably something is wrong!
248  VP1Msg::message("AscObj_TSOS::getZTranslationTube: <2 points returned by trackHandle!");
249  }
250 
251  //Ensure that we do not get out of bounds, preserve sign of translation.
252  if (std::abs(smin) > maxTrans)
253  {
254  double sign = smin > 0 ? 1.0 : -1.0;
255  smin = sign*maxTrans;
256  }
257 
258  SoTranslation * trans = new SoTranslation;
259  trans->translation.setValue(0,0,smin);
260 
261  return trans;
262 }
263 
265 {
266  double rioValue = 0;
267  double paramValue = 0;
268  double sigma = 1;
269 
270  const Trk::RIO_OnTrack* rio = rioOnTrack();
271  if (!rio && competingRIOsOnTrack()!=nullptr ) {
272  // must be crot
273  rio = &(competingRIOsOnTrack()->rioOnTrack(competingRIOsOnTrack()->indexOfMaxAssignProb () ));
274  } else {
275  VP1Msg::message(" No ROT or cROT in AscObj_TSOS::deviationFromMeasurement(const bool& absolute)!");
276  return 0.0;
277  }
278  Identifier id = rio->identify();
279  const AtlasDetectorID * idhelper = VP1DetInfo::atlasIDHelper();
280  //FIXME: should we check for idhelper before?
281  const bool isTRT = idhelper && idhelper->is_indet(id) && idhelper->is_trt(id);
282  const bool isMDT = idhelper && idhelper->is_muon(id) && idhelper->is_mdt(id);
283  if ( idhelper && ( isTRT||isMDT ) )
284  {
285  //Value from the measurement
286  rioValue = std::abs(rio->localParameters().get(Trk::driftRadius));
287 
288  //Value from the track
289  const Trk::TrackParameters* trackParams = m_tsos->trackParameters();
290  const Trk::TrackParameters * meas = dynamic_cast<const Trk::TrackParameters *>(trackParams);
291  const Trk::AtaStraightLine * atas = dynamic_cast<const Trk::AtaStraightLine *>(meas);
292  if (not atas) return std::nan("");
293  const Amg::Vector2D& localposMeas = atas->localPosition();
294  paramValue = std::abs(localposMeas[Trk::locR]);
295 
296  if (!absolute)
297  {
298  const AmgSymMatrix(5) covmat = *(meas->covariance());
299  sigma = sqrt( covmat(0,0) );
300  }
301  }
302 
303  return absolute ? std::abs( rioValue - paramValue ) : std::abs( rioValue - paramValue )/sigma;
304 }
305 
306 void AscObj_TSOS::addDeviationFromMeasurementInfoToShapes( SoSeparator*&shape_simple, SoSeparator*&shape_detailed)
307 {
308  const Trk::RIO_OnTrack* rio = rioOnTrack();
309  Identifier id = rio->identify();
310  const AtlasDetectorID * idhelper = VP1DetInfo::atlasIDHelper();
311  //FIXME: should we check for idhelper before?
312  const bool isTRT = idhelper && idhelper->is_indet(id) && idhelper->is_trt(id);
313  const bool isMDT = idhelper && idhelper->is_muon(id) && idhelper->is_mdt(id);
314  if ( idhelper && ( isTRT||isMDT ) )
315  {
316  const Trk::Surface& theSurface = rio->associatedSurface();
317  const Amg::Vector3D origo = theSurface.localToGlobal(Amg::Vector2D(0,0));
318  const Amg::Vector3D unitz = theSurface.localToGlobal(Amg::Vector2D(0,1));
319  const Amg::Vector3D& point = m_tsos->trackParameters()->position(); //FIXME: use the one from rio when it is fixed.
320  //const Amg::Vector3D& point = rio->globalPosition();
321  //this is currently returning a position on the z-axis which is wrong. Re-enable this feature
322  //when this is fixed
323 
324  //Get the point 'pointMeas' on the measurement z-axis which is closest to the point 'point'
325  double s;
326  VP1LinAlgUtils::distPointLineParam( point, origo, unitz, s );
327  const Amg::Vector3D pointMeas = origo + s*(unitz - origo);
328 
329  SoLineSet * line = new SoLineSet();
330  SoVertexProperty * vertices = new SoVertexProperty();
331  vertices->vertex.set1Value(0,point.x(),point.y(),point.z());
332  vertices->vertex.set1Value(1,pointMeas.x(),pointMeas.y(),pointMeas.z());
333  line->numVertices = 2;
334  line->vertexProperty = vertices;
335 
336  //colour according to side() (left=red, right=green)
337  if (isTRT)
338  {
339  const InDet::TRT_DriftCircleOnTrack * dcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>(rio);
340  if (not dcot) return;
341  if (dcot->side()!=Trk::NONE)
342  {
343  SoSeparator * sep = new SoSeparator;
344  SoMaterial * mat = new SoMaterial;
345  if (dcot->side()==Trk::LEFT)
346  mat->diffuseColor.setValue(1,0,0);
347  else //(dcot->side()==Trk::RIGHT)
348  mat->diffuseColor.setValue(0,1,0);
349  sep->addChild(mat);
350  sep->addChild(line);
351  shape_detailed->addChild(sep);
352  return;
353  }
354  } else if (isMDT){
355  const Muon::MdtDriftCircleOnTrack * dcot = dynamic_cast<const Muon::MdtDriftCircleOnTrack *>(rio);
356  if (not dcot) return;
357  if (dcot->side()!=Trk::NONE)
358  {
359  SoSeparator * sep = new SoSeparator;
360  SoMaterial * mat = new SoMaterial;
361  if (dcot->side()==Trk::LEFT)
362  mat->diffuseColor.setValue(1,0,0);
363  else //(dcot->side()==Trk::RIGHT)
364  mat->diffuseColor.setValue(0,1,0);
365  sep->addChild(mat);
366  sep->addChild(line);
367  shape_detailed->addChild(sep);
368  return;
369  }
370  }
371 
372  ensureInitSeps(shape_simple,shape_detailed);
373  shape_detailed->addChild(line);
374  }
375 }
376 
377 //____________________________________________________________________
378 void AscObj_TSOS::addTrackParamInfoToShapes( SoSeparator*&shape_simple,
379  SoSeparator*&shape_detailed,
380  bool showPars, bool showParsErrors, bool showSurfaces)
381 {
382  const Trk::TrackParameters* trackParams = m_tsos->trackParameters();
383  Q_ASSERT(trackParams);
384  ensureInitSeps(shape_simple,shape_detailed);
385 
386  Amg::Vector3D p1(trackParams->position());//point
387 
388  if (showPars) {
389 
390 // Trk::GlobalMomentum u(trackParams->momentum().unit());//mom direction
391  Amg::Vector3D u(trackParams->momentum().unit());//mom direction
392 
393  double length = 5*CLHEP::cm;
394  if (m_distToNextPar>0)
397 
398  //Line:
399  SoLineSet * line = new SoLineSet();
400  SoVertexProperty * vertices = new SoVertexProperty();
401  vertices->vertex.set1Value(0,p1.x(),p1.y(),p1.z());
402  vertices->vertex.set1Value(1,p2.x(),p2.y(),p2.z());
403  line->numVertices.set1Value(0,2);
404 
405  //Point:
406  SoPointSet * points = new SoPointSet;
407  SoVertexProperty * vertices2 = new SoVertexProperty;
408  vertices2->vertex.set1Value(0,p1.x(),p1.y(),p1.z());
409  points->numPoints=1;
410  line->vertexProperty = vertices;
411  points->vertexProperty = vertices2;
412 
413  bool isHole= m_parts & TrackCommonFlags::TSOS_Hole;
414  if (trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_TrackPars
415  || (isHole&&(trackHandle()->customColouredTSOSParts() & TrackCommonFlags::TSOS_Hole) ) ) {
416  SoMaterial * mat = isHole?common()->controller()->customMatHoleParameters():common()->controller()->customMatParameters();
417  SoSeparator * sep = new SoSeparator;
418  sep->addChild(mat);
419  sep->addChild(line);
420  sep->addChild(points);
421  shape_simple->addChild(sep);
422  shape_detailed->addChild(sep);
423  } else {
424  shape_simple->addChild(line);
425  shape_simple->addChild(points);
426  shape_detailed->addChild(line);
427  shape_detailed->addChild(points);
428  }
429  }
430 
431  if ( showParsErrors ){
432  SoTransform* theHitTransform = VP1LinAlgUtils::toSoTransform(surface()->transform()); // FIXME - remove if working in local coords
433  shape_detailed->addChild(theHitTransform);
434  // Need to cast in order to get error Matrix
435  if (trackParams->covariance()) // Only draw error if point is a measurement
436  {
437  // fixme! This is really ugly - can't be cast to a base class? MeasuredTrackParameters doesn't know LP.
438  const Trk::AtaStraightLine * atas = dynamic_cast<const Trk::AtaStraightLine *>(trackParams);
439  const Trk::Perigee * per = dynamic_cast<const Trk::Perigee *>(trackParams);
440  const Trk::AtaPlane * aap = dynamic_cast<const Trk::AtaPlane *>(trackParams);
441  const Trk::AtaDisc * aad = dynamic_cast<const Trk::AtaDisc *>(trackParams);
442  if (per||atas||aap||aad){
443  const Amg::Vector2D& localPos = atas ? atas->localPosition() : (per ? per->localPosition() : (aap ? aap->localPosition() : aad->localPosition()));
444 // addErrors(*(trackParams->associatedSurface()), meas->localErrorMatrix().covariance(), localPos, p1, showSurfaces, shape_simple, shape_detailed, false, false); //FIXME - last parameter false when working in correct local coords
445  addErrors(trackParams->associatedSurface(), *trackParams->covariance(), localPos, p1, showSurfaces, shape_simple, shape_detailed, false, false); //FIXME - last parameter false when working in correct local coords
446  } else {
447  VP1Msg::messageVerbose("Not a supported parameter for errors: ");
448  // std::cout<<(*trackParams)<<std::endl;
449  }
450  }
451  }
452 }
453 
454 void AscObj_TSOS::addErrors(const Trk::Surface& theSurface, const AmgSymMatrix(5)& tmpCovMat,
455  const Amg::Vector2D& localPos, const Amg::Vector3D& p1, bool showSurfaces, SoSeparator* shape_simple, SoSeparator* shape_detailed, bool force1D, bool applyLocalTrans )
456 {
457  VP1Msg::messageVerbose("addErrors");
458  if (applyLocalTrans) VP1Msg::messageVerbose("applyLocalTrans");
459 
460  //Fixme: get from collhandle:!!
461  const bool settingsDRAWCYLINDER = common()->controller()->parTubeErrorsDrawCylinders();
462  const bool settingsDRAWZERRCIRCLES = settingsDRAWCYLINDER;
463  const double settingsSIGMASCALE = common()->controller()->nStdDevForParamErrors();
464 
465  SoSeparator * errSimple = new SoSeparator;
466  SoSeparator * errDetailed = new SoSeparator;
467 
468  //Possibly a custom colour
469  if (trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_AnyParsErrors) {
470  // FIXME - what about meas errors?
471  SoMaterial * mat = common()->controller()->customMatParameterErrors();
472  errSimple->addChild( mat );
473  errDetailed->addChild( mat );
474  }
475  // SoTransparency * transparent = new SoTransparency;
476  // transparent->transparency.setValue(0.5);
477  // errSimple->addChild( transparent );
478  // errDetailed->addChild( transparent );
479 
480  const int npoints = common()->controller()->numberOfPointsOnCircles();
481  // Check for type of associated surface
482  // const Trk::Surface * theSurface = trackParams->associatedSurface();
483  const Trk::CylinderSurface * cylSurf = dynamic_cast<const Trk::CylinderSurface *>(&theSurface);
484  const Trk::DiscSurface * disSurf = dynamic_cast<const Trk::DiscSurface *>(&theSurface);
485  const Trk::PerigeeSurface * perSurf = dynamic_cast<const Trk::PerigeeSurface *>(&theSurface);
486  const Trk::PlaneSurface * plaSurf = dynamic_cast<const Trk::PlaneSurface *>(&theSurface);
487  const Trk::StraightLineSurface * strSurf = dynamic_cast<const Trk::StraightLineSurface *>(&theSurface);
488  if ( plaSurf ) /* Plane Surface */
489  {
490  // Shift from Surface centre to correct position
491  if (applyLocalTrans) {
492  SoTranslation * theTransform = new SoTranslation;
493  std::optional<Amg::Vector2D> locPosTmp = surface()->globalToLocal(p1);
494  if (locPosTmp) {
495  theTransform->translation.setValue(locPosTmp->x(),locPosTmp->y(),0.0);
496  // std::cout<<"applyLocalTrans & Offset=("<<locPosTmp->x()<<","<<locPosTmp->y()<<std::endl;
497  errSimple->addChild(theTransform);
498  errDetailed->addChild(theTransform);
499  } else {
500  VP1Msg::message("AscObj_TSOS::addErrors - failed to get tmp position");
501  }
502  }
503 
504  VP1Msg::messageVerbose("Plane surf error of size:"+QString::number(tmpCovMat.rows()));
505  if (force1D) VP1Msg::messageVerbose("Forcing 1D");
506  VP1ErrorUtils::errorAtPlaneSurface(errSimple, errDetailed, tmpCovMat, &theSurface, p1, settingsSIGMASCALE, npoints, showSurfaces, force1D, false );
507  ensureInitSeps(shape_simple,shape_detailed);
508  shape_simple->addChild( errSimple );
509  shape_detailed->addChild( errDetailed );
510  } else if ( strSurf || perSurf) {
511  /* Straight Line Surface or perigee surface*/
512  // Shift from Surface centre to correct position
513  if (applyLocalTrans){
514  SoTranslation * theTransform = getZTranslationTube(&theSurface,10000.0);
515  errSimple->addChild(theTransform);
516  errDetailed->addChild(theTransform);
517  }
518  VP1ErrorUtils::errorAtStraightLineSurface(errSimple, errDetailed, tmpCovMat, localPos, &theSurface, settingsSIGMASCALE, settingsDRAWZERRCIRCLES, settingsDRAWCYLINDER, npoints, force1D, false);
519  ensureInitSeps(shape_simple,shape_detailed);
520  shape_simple->addChild( errSimple );
521  shape_detailed->addChild( errDetailed );
522  } else if ( cylSurf ) {
523  VP1Msg::message("WARNING: Visualisation of errors on Cylinder Surface not implemented");
524  } else if ( disSurf ) {
525  VP1Msg::message("WARNING: Visualisation of errors on Disc Surface not implemented");
526  }
527  VP1Msg::messageVerbose("leaving addErrors");
528 }
529 
530 //____________________________________________________________________
531 void AscObj_TSOS::addSurfaceToShapes( SoSeparator*&shape_simple, SoSeparator*&shape_detailed)
532 {
533  // static int ignoreTubes=-1;
534  // if (ignoreTubes==-1)
535  // ignoreTubes = VP1QtUtils::environmentVariableIsOn("VP1_TRKSYS_NEVERSHOWTUBESURFACES") ? 1 : 0;
536  static int ignoreECModules=-1;
537  if (ignoreECModules==-1)
538  ignoreECModules = VP1QtUtils::environmentVariableIsOn("VP1_TRKSYS_NEVERSHOW_ENDCAPMODULES") ? 1 : 0;
539 
540  if (common()->controller()->hideTubeSurfaces() &&dynamic_cast<const Trk::StraightLineSurface*>(surface()))
541  return;
542 
543  if (ignoreECModules) {
544  const Trk::PlaneSurface* ps = dynamic_cast<const Trk::PlaneSurface*>(surface());
545  if (ps) {
546  Amg::Vector3D z(0.0,0.0,1.0);
547  double angle_z_normal = Amg::angle(z, ps->normal());
548  double abscostheta = std::abs(cos(angle_z_normal));
549  if (abscostheta>0.707) return;
550  }
551  }
552 
553  SurfaceToSoNode surfCnv;//fixme: check if need in common()
554  SoNode* theSurfSepSimple = surfCnv.translateSurface(*(surface()),true);
555  SoNode* theSurfSep = surfCnv.translateSurface(*(surface()));
556  if (theSurfSep) {
557  SoNode * nodeToAddSimple = theSurfSepSimple;
558  SoNode * nodeToAdd = theSurfSep;
559  ensureInitSeps(shape_simple,shape_detailed);
560  if (trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_AnySurface) {
561  SoMaterial * mat = common()->controller()->customMatSurfaces();
562  if (theSurfSep->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
563  static_cast<SoSeparator*>(theSurfSepSimple)->insertChild(mat,0);
564  static_cast<SoSeparator*>(theSurfSep)->insertChild(mat,0);
565  } else {
566  SoSeparator * sepSimple = new SoSeparator;
567  sepSimple->addChild(mat);
568  sepSimple->addChild(theSurfSepSimple);
569  nodeToAddSimple = sepSimple;
570  SoSeparator * sep = new SoSeparator;
571  sep->addChild(mat);
572  sep->addChild(theSurfSep);
573  nodeToAdd = sep;
574  }
575  }
576 // shape_simple->addChild(nodeToAdd); //todo: check this. I changed nodeToAdd to nodeToAddSimple
577  shape_simple->addChild(nodeToAddSimple);
578  shape_detailed->addChild(nodeToAdd);
579  } else {
580  VP1Msg::message("AscObj_TSOS::addSurfaceToShapes WARNING: Got null shape.");
581  }
582 }
583 
584 //____________________________________________________________________
585 void AscObj_TSOS::addMaterialEffectsToShapes( SoSeparator*&shape_simple, SoSeparator*&shape_detailed)
586 {
587  const double settingsForceOnTrack = false;
588 
589  ensureInitSeps(shape_simple,shape_detailed);
590  SoSeparator * matSepSimple = new SoSeparator;
591  SoSeparator * matSepDetailed = new SoSeparator;
592 
593  //1) Transformation.
594 
595  if (m_tsos->trackParameters()) {
596  //Put on position of track parameter
598  SoTranslation * theTransform = new SoTranslation;
599  theTransform->translation.setValue(p1.x(),p1.y(),p1.z());
600  matSepSimple->addChild(theTransform);
601  matSepDetailed->addChild(theTransform);
602  } else {
603  const Trk::Surface * surf = surface();
604  if (!surf) {
605  VP1Msg::message("AscObj_TSOS::addMaterialEffectsToShapes WARNING: Has neither surface or parameter to get position!");
606  } else {
607  if (settingsForceOnTrack) {
608  VP1Msg::message("AscObj_TSOS::addMaterialEffectsToShapes WARNING: settingsForceOnTrack not implemented");
609 
610  //Take position from surface and somehow constrain it onto the line.
611  //(Fixme... same kind of treatment as in the "short tubes"... how?).
612  } else {
613  //Take center of surface if present.
614  SoTransform * theTransform = VP1LinAlgUtils::toSoTransform(surf->transform());
615  matSepSimple->addChild(theTransform);
616  matSepDetailed->addChild(theTransform);
617  }
618  }
619  }
620  //2) Possibly a custom colour
621 
622  if (trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_AnyMaterialEffects) {
623  SoMaterial * mat = common()->controller()->customMatMaterialEffects();
624  matSepSimple->addChild(mat);
625  matSepDetailed->addChild(mat);
626  }
627 
628  //3) The shape
629 
630  SoPointSet * point = common()->singlePoint();
631  matSepSimple->addChild(point);
632 
634  matSepDetailed->addChild(point);
635  } else {
637  const Trk::MaterialEffectsOnTrack* matEffOnTrk = dynamic_cast<const Trk::MaterialEffectsOnTrack*>(matEff);
638  if (matEffOnTrk){
639  const double absDeltaE = std::abs(matEffOnTrk->energyLoss()->deltaE());
640  const double radius(absDeltaE > 1*CLHEP::eV ? 5.0*exp(log(absDeltaE/CLHEP::MeV)/3.0) : 0);//\propto cube root
641  //TK: radius used to be: 5.0*sqrt(absDE), but we want sphere volume \propto deltaE
642  const double scale = common()->controller()->materialEffectsOnTrackScale();
643  if (scale * radius > 0.1) {
644  SoSphere * meotSphere = new SoSphere;
645  meotSphere->radius.setValue( scale * radius );
646  matSepDetailed->addChild(meotSphere);
647  } else {
648  matSepDetailed->addChild(point);
649  }
650  }
651  }
652 
653  //Attach:
654  shape_simple->addChild(matSepSimple);
655  shape_detailed->addChild(matSepDetailed);
656 }
657 
658 //____________________________________________________________________
659 void AscObj_TSOS::addRIO_OnTrackInfoToShapes( SoSeparator*&shape_simple,
660  SoSeparator*&shape_detailed,
661  const Trk::RIO_OnTrack* rio, bool blockDrawingOfGP)
662 {
663  // VP1Msg::messageVerbose("AscObj_TSOS::addRIO_OnTrackInfoToShapes() start");
664 
665  if (!rio) { return;}
666 // Identifier id = rio->identify();
667 
668  ensureInitSeps(shape_simple,shape_detailed);
669 
670  TrackCommonFlags::TSOSPartsFlags f(trackHandle()->shownTSOSParts()&m_parts);
671  const bool showMeas(f & TrackCommonFlags::TSOS_AnyMeasurement);
672  const bool showMeasErrors(f & TrackCommonFlags::TSOS_MeasError);
673 
675  // std::cout<<">>>>>>>>>>> addRIO_OnTrackInfoToShapes: Have measurement of type: "<<static_cast<unsigned int>(type)<<" & showRioOnTrack="<<showMeas<<std::endl;
676  if (showMeas){
677  // std::pair<SoSeparator*, std::vector<SoNode*> > detailed_nodes, simple_nodes;
678  // handle colouring
679  // VP1Msg::message(m_objToType.name(*rio));
680 
681  if (m_parts & trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_AnyMeasRioOnTrack) {
682  SoMaterial * mat;
683  if (m_parts & trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_MeasRioOnTrackNotOutlier)
685  else
687  shape_simple->addChild(mat);
688  shape_detailed->addChild(mat);
689  }
690 
693  if (isStrip)
694  m_hitToSoNode.buildStripShapes(*rio,shape_simple,shape_detailed,blockDrawingOfGP); // transforms to localPos (i.e. assumes in surface frame)
695  else {
696  if (isDC) {
697  float zShift=0.0;
698  if (isShortMeasurement()){
699  SoTranslation * theTransform = getZTranslationTube(&(rio->associatedSurface ()),10000.0);
700  float x,y; // dummy
701  theTransform->translation.getValue().getValue(x,y,zShift);
702  shape_simple->addChild(theTransform);
703  shape_detailed->addChild(theTransform);
704  }
705  m_hitToSoNode.buildTubeShapes(*rio,shape_simple,shape_detailed,blockDrawingOfGP,isShortMeasurement()?common()->controller()->measurementsShorttubesScale():0.0, false);
706  if (isShortMeasurement()){
707  SoTranslation * theTransform = new SoTranslation;
708  theTransform->translation.setValue(0,0,-zShift);
709  shape_simple->addChild(theTransform);
710  shape_detailed->addChild(theTransform);
711  }
712  }
713  }
714  }
715 
716 //Errors
717  if (showMeasErrors){
718  const Trk::LocalParameters & locParams = rio->localParameters () ;
719 // VP1Msg::message( "Trying to draw measurement errors for ROT with id="+QString::number(rio->identify().get_compact())+" locparams have dim="+QString::number(locParams.dimension())+", locellmat="+QString::number(rio->localErrorMatrix().covariance().num_row()));
720  VP1Msg::message( "Trying to draw measurement errors for ROT with id="+QString::number(rio->identify().get_compact())+" locparams have dim="+QString::number(locParams.dimension())+", locellmat="+QString::number(rio->localCovariance().rows()));
721 
722  Amg::Vector2D localPos;
723  /*
724  * see:
725  * Tracking/TrkEvent/TrkEventPrimitives/trunk/TrkEventPrimitives/LocalParameters.h
726  * Tracking/TrkEvent/TrkEventPrimitives/trunk/src/LocalParameters.cxx
727  */
728  if (locParams.contains(Trk::loc1)) {
729  localPos( locParams.get(Trk::loc1), locParams.contains(Trk::loc2) ? locParams.get(Trk::loc2) : 0 );
730  } else{
731  VP1Msg::message( "WARNING: locParams.contains(Trk::loc1) is FALSE!!");
732  }
733 
734  bool force1D=false;
735  if (locParams.dimension ()!=rio->localCovariance().rows()){
736  VP1Msg::message( "WARNING: ROT has inconsistent dimensions between cov matrix and local parameters. Forcing to 1D.");
737  force1D=true;
738  }
739  force1D=true; //FIXME!
740 
741  // last parameter sets whether we do a local shift.
742  addErrors(rio->associatedSurface(), rio->localCovariance(), localPos, rio->globalPosition(), false,
743  shape_simple, shape_detailed, force1D, true);
744  VP1Msg::message( "Done with measurement errors");
745  }
746 }
747 
748 //____________________________________________________________________
749 void AscObj_TSOS::addCompetingRIO_OnTrackInfoToShapes( SoSeparator*&shape_simple,
750  SoSeparator*&shape_detailed)
751 {
752  // std::cout<<"addCompetingRIO_OnTrackInfoToShapes"<<std::endl;
754 
755  ensureInitSeps(shape_simple,shape_detailed);
756 
757  //Possibly a custom colour
759  SoMaterial * mat = common()->controller()->customMatMeasurements();
760  shape_simple->addChild(mat);
761  shape_detailed->addChild(mat);
762  } else if (m_parts & trackHandle()->customColouredTSOSParts()&TrackCommonFlags::TSOS_MeasCompetingRioOnTrackOutlier) {
763  SoMaterial * mat = common()->controller()->customMatMeasurementsOutliers();
764  shape_simple->addChild(mat);
765  shape_detailed->addChild(mat);
766  }
767 
768  if (common()->controller()->drawMeasGlobalPositions()){
769  // std::cout<<"cROT - showing globalpositions."<<std::endl;
770 
771  // if (surface()!=crio->rioOnTrack(crio->indexOfMaxAssignProb ())->associatedSurface())
772  // VP1Msg::message("AscObj_TSOS::addCompetingRIO_OnTrackInfoToShapes WARNING: cROT surface doesn't match one from surface()") ;
773 //Draw cross marking global position of the rio on track
774  SoTranslation * theTransform = new SoTranslation;
776  // std::cout<<"globalPOS=("<<crio->globalPosition().x()<<","<<crio->globalPosition().y()<<","<<crio->globalPosition().z()<<")"<<std::endl;
777  // std::cout<<"associatedSurf centre =("<<crio->associatedSurface().center().x()<<","<<crio->associatedSurface().center().y()<<","<<crio->associatedSurface().center().z()<<")"<<std::endl;
778  // std::cout<<"offset=("<<offset.x()<<","<<offset.y()<<","<<offset.z()<<")"<<std::endl;
779  // theTransform->translation.setValue( offset.x(), offset.y(), offset.z());
780 
781 
782  Amg::Vector3D locPos = (crio->associatedSurface().transform().rotation().inverse())*(offset);
783  theTransform->translation.setValue( locPos.x(), locPos.y(), locPos.z());
784  // std::cout<<"the GP Transform=("<<locPos.x()<<","<<locPos.y()<<","<<locPos.z()<<")"<<std::endl;
785 
786  // double xoff= crio->localParameters().get(Trk::loc1);
787  // double yoff= crio->localParameters().get(Trk::loc2);
788  // double zoff= globalpos.z()-surface().center().z();
789  // theTransform->translation.setValue(xoff,yoff,0.0);
790  // SoTranslation * theTransformBack = new SoTranslation;
791  // theTransformBack->translation.setValue(-locPos.x(), -locPos.y(), -locPos.z());
792  // std::cout<<"theTransformBack="<<Amg::toString(*theTransformBack)<<std::endl;
793 
794  SoSeparator * gpSep = new SoSeparator;
795 
796  gpSep->addChild(theTransform);
797  gpSep->addChild(common()->nodeManager().getShapeNode_Cross(50));
798  shape_detailed->addChild(gpSep);
799  }
800 
801  //Draw all contained rio on tracks
802  TrackCommonFlags::TSOSPartsFlags f(trackHandle()->shownTSOSParts()&m_parts);
803  const bool showcRioOnTrack(f & TrackCommonFlags::TSOS_AnyMeasurement);
804 
805  if (showcRioOnTrack){
806 
807  // FIXME - shouldn't need to use so many seps, but having problems with transformations.
808  SoSeparator * rotSepSimple = new SoSeparator;
809  SoSeparator * rotSepDetailed = new SoSeparator;
810 
811  // std::cout<<"addCompetingRIO_OnTrackInfoToShapes: About to draw most probable ROT"<<std::endl;
812  unsigned int maxProb = crio->indexOfMaxAssignProb ();
813  // std::cout<<"Drawing maxProb ["<<maxProb<<"] strip "<<std::endl;
814  addRIO_OnTrackInfoToShapes(rotSepSimple,rotSepDetailed, &(crio->rioOnTrack(maxProb)), true);
815  shape_detailed->addChild(rotSepDetailed);
816  shape_simple->addChild(rotSepSimple);
817 
818  // std::cout<<"addCompetingRIO_OnTrackInfoToShapes: Done drawing most probable"<<std::endl;
819 
820  SoTransparency * transparent = new SoTransparency;
821  transparent->transparency.setValue(0.5);
822  shape_detailed->addChild( transparent );
823 
824  const Trk::RIO_OnTrack* rot = &(crio->rioOnTrack(maxProb));
825  //if (rot==0 || rot == NULL) { VP1Msg::message("WARNING: cROT max prob ROT is NULL. Aborting."); return;}
826  if (!rot) { VP1Msg::message("WARNING: cROT has empty max prob ROT. Aborting."); return;}
827  // Now, last position drawn was that of strip pos for most probable ROT. So take this as basis.
828  if (!rot->detectorElement()) { VP1Msg::message("WARNING: most prob ROT from cROT has empty DE. Aborting."); return;}
829 
830  const MuonGM::TgcReadoutElement* tgcDetEl =
831  dynamic_cast<const MuonGM::TgcReadoutElement*>(rot->detectorElement());
832  const MuonGM::RpcReadoutElement* rpcDetEl =
833  dynamic_cast<const MuonGM::RpcReadoutElement*>(rot->detectorElement());
834 
835  // FIXME - could do all this a bit more elegantly with templates
836  if ( (!tgcDetEl) && (!rpcDetEl)) { VP1Msg::message("WARNING: most prob ROT from cROT has Unknown DE type. Aborting."); std::cout<<*rot<<std::endl;return;}
837 
838  // Amg::Vector3D lastPos,currPos;
839  // if (tgcDetEl){
840  // lastPos = tgcDetEl->stripPos(rot->identify());
841  // } else {
842  // lastPos = rpcDetEl->stripPos(rot->identify());
843  // }
844 
845  const Trk::Surface* lastSurf=&(crio->rioOnTrack(maxProb).associatedSurface());
846 
847  // std::cout<<"lastSurf = ("<<*lastSurf<<") for most prob="<<rot->identify().get_compact()<<std::endl;
848  unsigned int nrio = crio->numberOfContainedROTs();
849  for (unsigned int n = 0; n < nrio; n++)
850  {
851  if (n==maxProb) continue; // already drawn.
852  // std::cout<<"Strip #"<<n<<std::endl;
853  const Trk::RIO_OnTrack* rot = &(crio->rioOnTrack(n));
854 
855  // SoTranslation * theTransform = new SoTranslation;
856  if (!rot) { VP1Msg::message("WARNING: cROT has empty ROT. Skipping."); continue;}
857 
858  // Now do offset from last strip pos, to new one (for strips on different layers, this will include a zoffset)
859  // const MuonGM::TgcReadoutElement* tgcDetEl =
860  // dynamic_cast<const MuonGM::TgcReadoutElement*>(rot->detectorElement());
861  // const MuonGM::RpcReadoutElement* rpcDetEl =
862  // dynamic_cast<const MuonGM::RpcReadoutElement*>(rot->detectorElement());
863  //
864  // // FIXME - could do all this a bit more elegantly with templates
865  //
866  // if ( (!tgcDetEl) && (!rpcDetEl)) { VP1Msg::message("WARNING: ROT from cROT has Unknown DE type. Skipping."); std::cout<<*rot<<std::endl; continue;}
867  //
868  // if (tgcDetEl){
869  // currPos = tgcDetEl->stripPos(rot->identify());
870  // } else {
871  // currPos = rpcDetEl->stripPos(rot->identify());
872  // }
873  // Amg::Vector3D offset = currPos - lastPos;
874  // Amg::Vector3D<double> locPos = (rot->associatedSurface().transform().inverse())*(offset);
875  // theTransform->translation.setValue( locPos.x(), locPos.y(), locPos.z());
876  // lastPos=currPos;
877  SoSeparator * rotSepSimple = new SoSeparator;
878  SoSeparator * rotSepDetailed = new SoSeparator;
879 
880  if ( &(rot->associatedSurface ())!=lastSurf) {
881  // std::cout<<"New surface!"<<std::endl;
882  // Do transformation to centre of new surface, especially important if there is a zoffset.
883  // NB we're assuming that the surfaces are aligned! Might not be entirely safe, but really should be!
884  // (I hate cROTs)
885  Amg::Vector3D offset = rot->associatedSurface().center() - lastSurf->center();
886  // std::cout<<"new surf offset = "<<Amg::toString(offset)<<std::endl;
887 
888  // lastSurf = &(rot->associatedSurface());
889  Amg::Vector3D locPos = (rot->associatedSurface().transform().rotation().inverse())*(offset);
890  // std::cout<<"new surf locPos = "<<Amg::toString(locPos)<<std::endl;
891 
892  SoTranslation * theTransform = new SoTranslation;
893  theTransform->translation.setValue( locPos.x(), locPos.y(), locPos.z());
894  rotSepDetailed->addChild(theTransform);
895  rotSepSimple->addChild(theTransform);
896  }
897  // lastSurf = &(rot->associatedSurface());
898 
899  // rotSepDetailed->addChild(theTransform);
900  // rotSepSimple->addChild(theTransform);
901 
902 
903  m_hitToSoNode.buildStripShapes(crio->rioOnTrack(n),rotSepSimple,rotSepDetailed,true);
904  shape_simple->addChild(rotSepSimple);
905  shape_detailed->addChild(rotSepDetailed);
906  // back to centre
907 
908  // std::cout<<"Rot "<<n<<" Done"<<std::endl;
909 
910  }
911  }
912 }
913 
914 //____________________________________________________________________
915 void AscObj_TSOS::ensureInitSeps( SoSeparator*&shape_simple,
916  SoSeparator*&shape_detailed)
917 {
918  if (!shape_simple)
919  shape_simple = new SoSeparator;
920  if (!shape_detailed)
921  shape_detailed = new SoSeparator;
922 }
923 
924 //____________________________________________________________________
926 {
927  return dynamic_cast<const Trk::RIO_OnTrack *>(m_tsos->measurementOnTrack());
928 }
929 
930 //____________________________________________________________________
932 {
933  return dynamic_cast<const Trk::CompetingRIOsOnTrack *>(m_tsos->measurementOnTrack());
934 }
935 
936 //____________________________________________________________________
938 {
939  const Trk::Surface * surf(nullptr);
940  if (m_tsos->trackParameters())
941  surf = &(m_tsos->trackParameters()->associatedSurface());
942  if (!surf&&m_tsos->measurementOnTrack())
944  if (!surf&&m_tsos->materialEffectsOnTrack())
946  return surf;
947 }
948 
949 void AscObj_TSOS::addTransformToSurface(SoSeparator*& shape_simple,SoSeparator*& shape_detailed){
950  // SurfaceToSoNode surfCnv;//fixme: check if need in common()
951  // SoNode* theSurfSepSimple = surfCnv.translateSurface(*(surface()),true);
952  // SoNode* theSurfSep = surfCnv.translateSurface(*(surface()));
953  if (!surface()) {VP1Msg::message( "AscObj_TSOS::addTransformToSurface: WARNING: TSOS without Surface! Unable to get transform!");return;}
954 
955  // This is all a bit complicated, and can probably be cleaned up. The point is that TGCs need to be handled specially, or we could just use
956  // surface(), I think.
957 
959  if (surface()->associatedDetectorElement()) type= TrkObjToString::type(surface()->associatedDetectorElement());
960 
961 // const Trk::RIO_OnTrack* rio = rioOnTrack() ? rioOnTrack() : competingRIOsOnTrack() ? competingRIOsOnTrack()->rioOnTrack(competingRIOsOnTrack()->indexOfMaxAssignProb()) : 0;
962  const Trk::RIO_OnTrack* rio = rioOnTrack() ? rioOnTrack() : competingRIOsOnTrack() ? &(competingRIOsOnTrack()->rioOnTrack(competingRIOsOnTrack()->indexOfMaxAssignProb())) : nullptr;
964 
965  SoTransform* theHitTransform=nullptr;
966  if (rio) {
968  // std::cout<<"Got ROT of type"<<static_cast<unsigned int>(type)<<std::endl;
969  switch (type) {
971  case TrkObjToString::SCT:
972  case TrkObjToString::TRT:
973  case TrkObjToString::CSC:
974  case TrkObjToString::RPC:
975  case TrkObjToString::MDT:
976  case TrkObjToString::MM:
978  {
979  theHitTransform=m_hitToSoNode.createTransform(*rio, true);
980  break;
981  }
982  case TrkObjToString::TGC:
983  {
984  theHitTransform=m_hitToSoNode.createTGC_Transform(*rio, true);
985  break;
986  }
987  default:
988  {
989  VP1Msg::message( "AscObj_TSOS::addTransformToSurface: WARNING: Unknown type of ROT.");
990  // std::cout<<"ROT: "<<*rio<<std::endl;
991  }
992  }
993  } else {
994  if (hasSurface() ) theHitTransform = VP1LinAlgUtils::toSoTransform(surface()->transform());
995  }
996 
997  if (!theHitTransform) {
998  VP1Msg::message( "AscObj_TSOS::addTransformToSurface: WARNING: Unable to build transform");
999  return;
1000  }
1001  shape_simple->addChild(theHitTransform);
1002  shape_detailed->addChild(theHitTransform);
1003 }
1004 
1005 //____________________________________________________________________
1006 void AscObj_TSOS::buildShapes(SoSeparator*&shape_simple,
1007  SoSeparator*&shape_detailed)
1008 {
1009  VP1Msg::messageVerbose("AscObj_TSOS::buildShapes() start");
1010 
1011  TrackCommonFlags::TSOSPartsFlags f(trackHandle()->shownTSOSParts()&m_parts);
1013  return;
1014  const bool showPars(f & TrackCommonFlags::TSOS_TrackPars);
1015  const bool showParsErrors(f & TrackCommonFlags::TSOS_AnyParsErrors);
1016  const bool showRioOnTrack(f & TrackCommonFlags::TSOS_AnyMeasRioOnTrack);
1017  const bool showCompetingRioOnTrack(f & TrackCommonFlags::TSOS_AnyMeasCompetingRioOnTrack);
1018  const bool showSurfaces(f & TrackCommonFlags::TSOS_AnySurface);
1019  const bool showMaterialEffects(f & TrackCommonFlags::TSOS_AnyMaterialEffects);
1020  const bool showMeasErrors(f & TrackCommonFlags::TSOS_MeasError);
1021 
1022  ensureInitSeps(shape_simple,shape_detailed);
1023 
1024  // FIXME - would like to simplify this and use transform returned from surface, but means internal changes below
1025  SoSeparator* param_simple= new SoSeparator;
1026  SoSeparator* param_detailed= new SoSeparator;
1027  if (showPars||showParsErrors)
1028  addTrackParamInfoToShapes(param_simple,param_detailed,showPars,showParsErrors,showSurfaces);
1029  shape_simple->addChild(param_simple);
1030  shape_detailed->addChild(param_detailed);
1031 
1032  if (showMaterialEffects)
1033  addMaterialEffectsToShapes( shape_simple, shape_detailed);
1034 
1035  if (showSurfaces)
1036  addSurfaceToShapes( shape_simple, shape_detailed);
1037 
1038  // Transform to centre of surface. All other seps will (eventually) hang from this.
1039  // TGCs are special, in that the position returned is that of the strip, due to rotation
1040  addTransformToSurface(shape_simple,shape_detailed);
1041 
1042  // Measurements are a bit different and create a sep outside addRIO_OnTrackInfoToShapes, because addRIO_OnTrackInfoToShapes is used
1043  // by addCompetingRIO_OnTrackInfoToShapes too
1044  SoSeparator* meas_simple= new SoSeparator;
1045  SoSeparator* meas_detailed= new SoSeparator;
1046  if (rioOnTrack() && (showRioOnTrack||showMeasErrors))
1047  addRIO_OnTrackInfoToShapes(meas_simple,meas_detailed,rioOnTrack(), !(common()->controller()->drawMeasGlobalPositions()));
1048  if (showCompetingRioOnTrack)
1049  addCompetingRIO_OnTrackInfoToShapes(meas_simple,meas_detailed); // FIXME - handle cROT errors too.
1050  shape_simple->addChild(meas_simple);
1051  shape_detailed->addChild(meas_detailed);
1052 
1053  //Currently this doesn't do much as rio->globalPosition() returns a position
1054  //along the axis!
1062  VP1Msg::messageVerbose("AscObj_TSOS::buildShapes() end");
1063 
1064 }
1065 
1066 //____________________________________________________________________
1068 {
1069  QStringList l;
1070  if (!m_tsos) {
1071  l << "ERROR: This associated object handle has a NULL TSOS pointer!!";
1072  return l;
1073  }
1074 
1075 
1076  l << "---"<<"Track State On Surface #"+VP1Msg::str(m_indexOfPointOnTrack)+":";
1077 
1078  if (hasParameters())
1079  {
1080  l << "----> "+TrkObjToString::name(*(m_tsos->trackParameters()));
1081  QStringList list = TrkObjToString::fullInfo( *(m_tsos->trackParameters()) );
1082  for (int i = 0; i < (list.size()-1); ){
1083  l<< (list.at(i)+QString(" = ")+list.at(i+1) );
1084  i+=2;
1085  }
1086  // l << " -> Position (x,y,z) [CLHEP::mm]: "+VP1Msg::str(m_tsos->trackParameters()->position()/CLHEP::mm);
1087  // l << " -> Momentum (Px,Py,Pz) [MeV]: "+VP1Msg::str(m_tsos->trackParameters()->momentum()/MeV) + ", |P| [GeV]: "+VP1Msg::str(m_tsos->trackParameters()->momentum().mag()/GeV);
1088  // l << " -> Momentum (Pt) [GeV]: "+VP1Msg::str(m_tsos->trackParameters()->momentum().perp()/GeV);
1089  //FIXME: parameter errors
1090  }
1091 
1092  bool showDeviationsFromMeasurements = true;//Fixme (and see above)
1093  if ( showDeviationsFromMeasurements
1094  && hasParameters()
1095  && (rioOnTrack() || competingRIOsOnTrack() )
1096  && dynamic_cast<const Trk::TrackParameters *>(m_tsos->trackParameters()) )
1097  {
1099  l << " -> Std deviations from measurement: " + VP1Msg::str(deviationFromMeasurement()) + " (Outlier)";
1100  else
1101  l << " -> Std deviations from measurement: " + VP1Msg::str(deviationFromMeasurement());
1102  }
1103 
1104  if (m_tsos->measurementOnTrack()){
1105  l << "----> "+TrkObjToString::name(*(m_tsos->measurementOnTrack()));
1106  QStringList list = TrkObjToString::fullInfo( *(m_tsos->measurementOnTrack()) );
1107  for (int i = 0; i < (list.size()-1); ){
1108  l<< (list.at(i)+QString(" = ")+list.at(i+1) );
1109  i+=2;
1110  }
1111  }
1112 
1113 
1114  if (m_tsos->fitQualityOnSurface())
1115  {
1118  for (int i = 0; i < (list.size()-1); ){
1119  l<< (list.at(i)+QString(" = ")+list.at(i+1) );
1120  i+=2;
1121  }
1122  }
1123 
1125  {
1128  for (int i = 0; i < (list.size()-1); ){
1129  l<< (list.at(i)+QString(" = ")+list.at(i+1) );
1130  i+=2;
1131  }
1132  }
1133 
1135  l << " ===== TrackStateOnSurface =====";
1136  std::ostringstream s2;
1137  s2 << *m_tsos;
1138  l << QString(s2.str().c_str()).split('\n');
1139 
1140  if (surface()) {
1141  l << " ===== Surface =====";
1142  std::ostringstream s;
1143  s << *(surface());
1144  l << QString(s.str().c_str()).split('\n');
1145  s << "Identfier:"<<surface()->associatedDetectorElementIdentifier();
1146  }
1147  }
1148 
1149  // Object browser stuff m_indexOfPointOnTrack
1150  QTreeWidgetItem* trkObjBrowseritem = trackHandle()->browserTreeItem();
1151  if (trkObjBrowseritem){
1152  QTreeWidgetItem* me = trkObjBrowseritem->child(m_indexOfPointOnTrack); // I hope!
1153  if (!me) {
1154  VP1Msg::messageVerbose("ERROR! Can't find AscObj_TSOS item in track obj browser.");
1155  } else {
1156  QTreeWidget* trkObjBrowser = trkObjBrowseritem->treeWidget();
1157  trkObjBrowser->setCurrentItem(me);
1158  trkObjBrowser->scrollToItem(me);
1159  }
1160  }
1161 
1162  zoomView(); // depending on controller settings, zoom view
1163 
1164  return l;
1165 }
1166 
1167 void AscObj_TSOS::setVisible(bool vis) {
1169 
1170  QTreeWidgetItem* trkObjBrowseritem = trackHandle()->browserTreeItem();
1171  if (trkObjBrowseritem){
1172  QTreeWidgetItem* me = trkObjBrowseritem->child(m_indexOfPointOnTrack); // I hope!
1173  if (!me) {
1174  VP1Msg::messageVerbose("ERROR! Can't find AscObj_TSOS item in track obj browser.");
1175  } else {
1176  QFont itemFont = me->font(1);
1177 
1178  if (!visible()) {
1179  // std::cout<<"Hidden"<<std::endl;
1180  me->setFlags(Qt::ItemFlags()); // not selectable, not enabled
1181  itemFont.setStrikeOut(true);
1182 
1183  } else {
1184  // std::cout<<"Vis"<<std::endl;
1185  me->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); // selectable, enabled
1186  itemFont.setStrikeOut(false);
1187 
1188  }
1189  }
1190  }
1191 }
1192 
1193 
1195  bool isShortMeasurement;
1196 
1197  // FIXME! Duplication with clicked()
1198  const Trk::RIO_OnTrack* rio = rioOnTrack();
1199  if (!rio && competingRIOsOnTrack()){
1200  rio = &(competingRIOsOnTrack()->rioOnTrack(competingRIOsOnTrack()->indexOfMaxAssignProb()));
1201  }
1202 
1204  bool isTRT = (type==TrkObjToString::TRT);
1205  bool isMDT = (type==TrkObjToString::MDT);
1206 
1207  if (rio)
1208  {
1209  const bool settingsShort = (isTRT?common()->controller()->useShortTRTMeasurements()
1210  :isMDT&&common()->controller()->useShortMDTMeasurements());
1211  const bool showRioOnTrack(trackHandle()->shownTSOSParts()&m_parts & TrackCommonFlags::TSOS_AnyMeasRioOnTrack);
1212  isShortMeasurement = (settingsShort && showRioOnTrack);
1213  } else
1214  {
1215  isShortMeasurement = false;
1216  }
1217  return isShortMeasurement;
1218 }
1219 
1221  VP1Msg::messageVerbose("AscObj_TSOS::zoomView()");
1222 
1223  if ( common()->controller()->orientAndZoomOnSingleSelection() )
1224  {
1225  const bool showParsErrors( trackHandle()->shownTSOSParts()&m_parts & TrackCommonFlags::TSOS_AnyParsErrors);
1226 
1227 
1228  if (!showParsErrors && !isShortMeasurement())
1229  { // Zoom without orientation
1230  VP1Msg::messageVerbose("AscObj_TSOS::zoomView() Zoom without orientation");
1231  std::set<SoCamera*> cameras = common()->system()->getCameraList();
1232  std::set<SoCamera*>::iterator it,itE = cameras.end();
1233  for (it=cameras.begin();it!=itE;++it) {
1234  if (common()->controller()->assocObjDetailLevel()==TrackCommonFlags::SIMPLE)
1235  {
1236  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeSimple(),2.0,1.0);
1237  } else
1238  {
1239  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeDetailed(),2.0,1.0);
1240  }
1241  }
1242  } else
1243  { // Zoom and orient (this is dependant of surface type)
1244  VP1Msg::messageVerbose("AscObj_TSOS::zoomView() Zoom and orient");
1245 
1246  const Trk::Surface * theSurface = surface();
1247  const Trk::PerigeeSurface * perSurf = dynamic_cast<const Trk::PerigeeSurface *>(theSurface);
1248  const Trk::PlaneSurface * plaSurf = dynamic_cast<const Trk::PlaneSurface *>(theSurface);
1249  const Trk::StraightLineSurface * strSurf = dynamic_cast<const Trk::StraightLineSurface *>(theSurface);
1250  if ( plaSurf || perSurf )
1251  {
1252 // Trk::GlobalMomentum u(m_tsos->trackParameters()->momentum().unit());
1254 
1255  SbVec3f lookat0 = SbVec3f(-u[0],-u[1],-u[2]);
1256 
1257  std::set<SoCamera*> cameras = common()->system()->getCameraList();
1258  std::set<SoCamera*>::iterator it,itE = cameras.end();
1259  for (it=cameras.begin();it!=itE;++it) {
1260  if (common()->controller()->assocObjDetailLevel()==TrackCommonFlags::SIMPLE)
1261  {
1262  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeSimple(),2.0,100.0,100.0,1.0,lookat0);
1263  } else
1264  {
1265  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeDetailed(),2.0,100.0,100.0,1.0,lookat0);
1266  }
1267  }
1268  } else if ( strSurf )
1269  {
1270  SbVec3f lookat0 = SbVec3f(0,0,1);
1271  SbVec3f lookat1;
1272 
1273  SbRotation rot = VP1LinAlgUtils::toSoTransform(theSurface->transform())->rotation.getValue();
1274  rot.multVec(lookat0,lookat0);
1275 
1276  std::set<SoCamera*> cameras = common()->system()->getCameraList();
1277  std::set<SoCamera*>::iterator it,itE = cameras.end();
1278  for (it=cameras.begin();it!=itE;++it) {
1279  SbRotation camrot = (*it)->orientation.getValue();
1280  SbVec3f cameraDir = SbVec3f(0,0,-1);
1281  camrot.multVec(cameraDir,cameraDir);
1282 
1283  lookat1 = cameraDir.dot(lookat0) > 0 ? lookat0 : -lookat0;
1284  if (common()->controller()->assocObjDetailLevel()==TrackCommonFlags::SIMPLE)
1285  {
1286  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeSimple(),2.0,100.0,100.0,1.0,lookat1);
1287  } else
1288  {
1289  VP1CameraHelper::animatedZoomToSubTree(*it,common()->ascObjSelectionManager()->getAscObjAttachSep(),shapeDetailed(),2.0,100.0,100.0,1.0,lookat1);
1290  }
1291  }
1292  }
1293  }
1294  } else {
1295  VP1Msg::messageVerbose("AscObj_TSOS::zoomView() - zooming on selection not turned on.");
1296  }
1297 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AscObj_TSOS::surface
const Trk::Surface * surface() const
Definition: AscObj_TSOS.cxx:937
VP1ErrorUtils.h
TrackSystemController::useShortTRTMeasurements
bool useShortTRTMeasurements() const
Definition: TrackSystemController.cxx:1561
TrackHandleBase::browserTreeItem
QTreeWidgetItem * browserTreeItem() const
Definition: TrackHandleBase.cxx:2026
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:35
EstimatedBremOnTrack.h
AscObj_TSOS::addDeviationFromMeasurementInfoToShapes
void addDeviationFromMeasurementInfoToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:306
AscObj_TSOS::isShortMeasurement
bool isShortMeasurement()
Return true if TRT/MDT & shortened mode is on, false otherwise
Definition: AscObj_TSOS.cxx:1194
EnergyLoss.h
AssociatedObjectHandleBase::hasParameters
bool hasParameters() const
Definition: AssociatedObjectHandleBase.h:48
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
ScatteringAngles.h
checkFileSG.line
line
Definition: checkFileSG.py:75
Trk::NONE
@ NONE
it was not possible to determine the which side of the straw the track passed;
Definition: DriftCircleSide.h:18
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
DriftCircleSide.h
TrackSysCommonData::controller
TrackSystemController * controller() const
Definition: TrackSysCommonData.h:124
HitToSoNode::buildTubeShapes
void buildTubeShapes(const Trk::RIO_OnTrack &rio, SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool blockGP, double length, bool doProjection)
Definition: HitToSodeNode.cxx:180
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
max
#define max(a, b)
Definition: cfImp.cxx:41
StraightLineSurface.h
TrackParameters.h
AscObj_TSOS::measurement
const Trk::MeasurementBase * measurement() const
Definition: AscObj_TSOS.cxx:195
MeasurementBase.h
TrackCommonFlags::SIMPLE
@ SIMPLE
Definition: TrackCommonFlags.h:39
AssociatedObjectHandleBase::visible
bool visible() const
Definition: AssociatedObjectHandleBase.h:61
TrkObjToString::RPC
@ RPC
Definition: TrkObjToString.h:44
PerigeeSurface.h
TrkObjToString::SCT
@ SCT
Definition: TrkObjToString.h:41
Amg::angle
double angle(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
calculates the opening angle between two vectors
Definition: GeoPrimitivesHelpers.h:41
TrackCommonFlags::TSOS_AnyMeasurement
@ TSOS_AnyMeasurement
Definition: TrackCommonFlags.h:61
AscObj_TSOS::m_indexOfPointOnTrack
unsigned m_indexOfPointOnTrack
Definition: AscObj_TSOS.h:84
CompetingRIOsOnTrack.h
TrackSystemController.h
AscObj_TSOS::addErrors
void addErrors(const Trk::Surface &theSurface, const AmgSymMatrix(5)&tmpCovMat, const Amg::Vector2D &localPos, const Amg::Vector3D &p1, bool showSurfaces, SoSeparator *shape_simple, SoSeparator *shape_detailed, bool force1D, bool applyLocalTrans)
Definition: AscObj_TSOS.cxx:454
MuonEDMPrinterTool.h
SoTransparency
Definition: SoTransparency.h:20
AscObj_TSOS::AscObj_TSOS
AscObj_TSOS(TrackHandleBase *, const Trk::TrackStateOnSurface *, unsigned indexOfPointOnTrack)
Definition: AscObj_TSOS.cxx:94
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
AscObj_TSOS::rioOnTrack
const Trk::RIO_OnTrack * rioOnTrack() const
Definition: AscObj_TSOS.cxx:925
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
TrkObjToString::TGC
@ TGC
Definition: TrkObjToString.h:45
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
TrkObjToString::MM
@ MM
Definition: TrkObjToString.h:47
hist_file_dump.d
d
Definition: hist_file_dump.py:137
VP1Msg.h
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
VP1CameraHelper.h
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
AssociatedObjectHandleBase::hasSurface
bool hasSurface() const
Definition: AssociatedObjectHandleBase.h:52
TrackHandleBase.h
Trk::Surface::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
Trk::RIO_OnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override=0
Interface method to get the global Position.
SurfaceToSoNode
Definition: SurfaceToSoNode.h:30
plotBeamSpotVxVal.covmat
covmat
Definition: plotBeamSpotVxVal.py:206
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
TrackCommonFlags
Definition: TrackCommonFlags.h:21
TrackSystemController::nStdDevForParamErrors
double nStdDevForParamErrors() const
Definition: TrackSystemController.cxx:1598
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
Trk::LocalParameters::contains
bool contains(ParamDefs par) const
The simple check for the clients whether the parameter is contained.
plotting.yearwise_luminosity.absolute
absolute
Definition: yearwise_luminosity.py:29
skel.it
it
Definition: skel.GENtoEVGEN.py:396
VP1QtUtils.h
VP1ErrorUtils::errorAtPlaneSurface
static void errorAtPlaneSurface(SoSeparator *errSimple, SoSeparator *errDetailed, const AmgSymMatrix(5)&tmpCovMat, const Trk::Surface *theSurface, const Amg::Vector3D &p1, const double &nStdDev=3.0, int numNodes=12, const bool &moveToSurface=false, const bool &force1D=false, const bool &addTransform=true)
Definition: VP1ErrorUtils.cxx:172
TrackSysCommonData::system
VP1TrackSystem * system() const
Definition: TrackSysCommonData.h:122
AscObj_TSOS::addRIO_OnTrackInfoToShapes
void addRIO_OnTrackInfoToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed, const Trk::RIO_OnTrack *rio, bool blockDrawingOfGP=false)
Definition: AscObj_TSOS.cxx:659
ParticleTest.tp
tp
Definition: ParticleTest.py:25
yodamerge_tmp.npoints
npoints
Definition: yodamerge_tmp.py:250
Identifier::get_compact
value_type get_compact() const
Get the compact id.
AscObj_TSOS::addTrackParamInfoToShapes
void addTrackParamInfoToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool showPars, bool showParsErrors, bool showSurfaces)
Definition: AscObj_TSOS.cxx:378
TrackCommonFlags::TSOS_AnySurface
@ TSOS_AnySurface
Definition: TrackCommonFlags.h:60
Trk::TrackStateOnSurface::measurementOnTrack
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
TrackCommonFlags::TSOS_MaterialEffectsWithNoDeltaE
@ TSOS_MaterialEffectsWithNoDeltaE
bit 12
Definition: TrackCommonFlags.h:55
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:35
TrackCommonFlags::TSOS_MeasError
@ TSOS_MeasError
bit 3
Definition: TrackCommonFlags.h:47
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
AscObj_TSOS::competingRIOsOnTrack
const Trk::CompetingRIOsOnTrack * competingRIOsOnTrack() const
Definition: AscObj_TSOS.cxx:931
TrackCommonFlags::TSOS_TrackParsErrorsPerigee
@ TSOS_TrackParsErrorsPerigee
bit 2
Definition: TrackCommonFlags.h:46
VP1DetInfo::atlasIDHelper
static const AtlasDetectorID * atlasIDHelper()
Definition: VP1DetInfo.cxx:157
Trk::DiscSurface
Definition: DiscSurface.h:54
TrackSysCommonData.h
AscObj_TSOS::clicked
QStringList clicked()
Definition: AscObj_TSOS.cxx:1067
TrackSystemController::parTubeErrorsDrawCylinders
bool parTubeErrorsDrawCylinders() const
Definition: TrackSystemController.cxx:1604
Trk::locR
@ locR
Definition: ParamDefs.h:44
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MdtDriftCircleOnTrack.h
AscObj_TSOS::zoomView
void zoomView()
Depending on the controller settings, will attempt to zoom the view to this TSOS, for example in clic...
Definition: AscObj_TSOS.cxx:1220
Trk::MaterialEffectsBase
base class to integrate material effects on Trk::Track in a flexible way.
Definition: MaterialEffectsBase.h:35
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
AssociatedObjectHandleBase::trackHandle
TrackHandleBase * trackHandle() const
Definition: AssociatedObjectHandleBase.h:64
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
AscObj_TSOS::addSurfaceToShapes
void addSurfaceToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:531
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
MaterialEffectsBase.h
SoTransparency.h
x
#define x
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
SoTransparency::transparency
SoSFFloat transparency
Definition: SoTransparency.h:27
Trk::TrackStateOnSurface::fitQualityOnSurface
const FitQualityOnSurface & fitQualityOnSurface() const
return FitQuality On Surface const overload
TruthTest.itE
itE
Definition: TruthTest.py:25
AscObj_TSOS::deviationFromMeasurement
double deviationFromMeasurement(const bool &absolute=false)
Definition: AscObj_TSOS.cxx:264
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
TrackHandleBase::hackGetPointsPropagated
std::vector< Amg::Vector3D > * hackGetPointsPropagated()
FIXME.
Definition: TrackHandleBase.cxx:1639
VP1QtInventorUtils.h
MaterialEffectsOnTrack.h
TgcClusterOnTrack.h
VP1LinAlgUtils.h
VP1DetInfo.h
Trk::LocalParameters::get
double get(ParamDefs par) const
Retrieve specified parameter (const version).
TrackCommonFlags::TSOS_AnyMeasCompetingRioOnTrack
@ TSOS_AnyMeasCompetingRioOnTrack
Definition: TrackCommonFlags.h:65
TrkObjToString::fullInfo
static QStringList fullInfo(const Trk::MeasurementBase &tp)
Returns list of key, value, key, value etc.
Definition: TrkObjToString.cxx:394
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
Trk::MaterialEffectsOnTrack
represents the full description of deflection and e-loss of a track in material.
Definition: MaterialEffectsOnTrack.h:40
Trk::TrackStateOnSurface::type
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
RpcClusterOnTrack.h
TrackSystemController::printVerboseInfoOnSingleSelection
bool printVerboseInfoOnSingleSelection() const
Definition: TrackSystemController.cxx:1975
TrackCommonFlags::TSOS_TrackPars
@ TSOS_TrackPars
bit 0
Definition: TrackCommonFlags.h:44
TrkObjToString.h
EventPrimitivesToStringConverter.h
AssociatedObjectHandleBase::common
TrackSysCommonData * common() const
Definition: AssociatedObjectHandleBase.cxx:105
AscObj_TSOS::m_distToNextPar
double m_distToNextPar
Definition: AscObj_TSOS.h:85
TrackSystemController::useShortMDTMeasurements
bool useShortMDTMeasurements() const
Definition: TrackSystemController.cxx:1567
VP1QtUtils::environmentVariableIsOn
static bool environmentVariableIsOn(const QString &name)
Definition: VP1QtUtils.cxx:127
Trk::CompetingRIOsOnTrack::numberOfContainedROTs
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
SoTransparency::initClass
static void initClass()
Definition: SoTransparency.cxx:29
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
Trk::TrackStateOnSurface::materialEffectsOnTrack
const MaterialEffectsBase * materialEffectsOnTrack() const
return material effects const overload
beamspotman.n
n
Definition: beamspotman.py:731
TrackCommonFlags::TSOS_MeasRioOnTrackOutlier
@ TSOS_MeasRioOnTrackOutlier
bit 6
Definition: TrackCommonFlags.h:50
Trk::CylinderSurface
Definition: CylinderSurface.h:55
TrkObjToString::CSC
@ CSC
Definition: TrkObjToString.h:43
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
TrackSystemController::customMatSurfaces
SoMaterial * customMatSurfaces() const
Definition: TrackSystemController.cxx:1397
IVP13DSystem.h
AscObj_TSOS::m_parts
TrackCommonFlags::TSOSPartsFlags m_parts
Definition: AscObj_TSOS.h:83
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CscClusterOnTrack.h
CylinderSurface.h
TrkObjToString::name
static QString name(const Trk::MeasurementBase &mb)
Definition: TrkObjToString.cxx:144
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
TrackSystemController::customMatHoleParameters
SoMaterial * customMatHoleParameters() const
Definition: TrackSystemController.cxx:1379
Trk::EnergyLoss::deltaE
double deltaE() const
returns the
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
TrkObjToString::MDT
@ MDT
Definition: TrkObjToString.h:46
SurfaceToSoNode::translateSurface
SoNode * translateSurface(const Trk::Surface &sf, const bool &simple=false) const
Definition: SurfaceToSoNode.cxx:57
VP1LinAlgUtils::distLineLineParam
static void distLineLineParam(const Amg::Vector3D &point0, const Amg::Vector3D &point1, const Amg::Vector3D &point2, const Amg::Vector3D &point3, double &s, double &t)
Definition: VP1LinAlgUtils.cxx:422
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
TrkObjToString::type
static MeasurementType type(const Trk::PrepRawData *prd)
Definition: TrkObjToString.cxx:64
Trk::Surface::normal
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
hist_file_dump.f
f
Definition: hist_file_dump.py:135
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Trk::ParametersBase
Definition: ParametersBase.h:55
TRT_DriftCircleOnTrack.h
TrackSysCommonData::nodeManager
HitsSoNodeManager & nodeManager()
Definition: TrackSysCommonData.h:139
AscObjSelectionManager.h
AscObj_TSOS.h
HitToSoNode::buildStripShapes
void buildStripShapes(const Trk::RIO_OnTrack &rio, SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool blockGP)
Definition: HitToSodeNode.cxx:225
AssociatedObjectHandleBase::setVisible
virtual void setVisible(bool)
Definition: AssociatedObjectHandleBase.cxx:171
TrackSystemController::customMatParameters
SoMaterial * customMatParameters() const
Definition: TrackSystemController.cxx:1373
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
min
#define min(a, b)
Definition: cfImp.cxx:40
TrackCommonFlags::TSOS_AnyMaterialEffects
@ TSOS_AnyMaterialEffects
Definition: TrackCommonFlags.h:59
TrackCommonFlags::TSOS_MaterialEffects
@ TSOS_MaterialEffects
bit 13
Definition: TrackCommonFlags.h:56
Trk::MeasurementBase
Definition: MeasurementBase.h:58
TrkObjToString::TRT
@ TRT
Definition: TrkObjToString.h:42
TrackSystemController::customMatMaterialEffects
SoMaterial * customMatMaterialEffects() const
Definition: TrackSystemController.cxx:1391
grepfile.sep
sep
Definition: grepfile.py:38
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
TrackCommonFlags::TSOS_AnyMeasRioOnTrack
@ TSOS_AnyMeasRioOnTrack
Definition: TrackCommonFlags.h:64
TrackSystemController::customMatMeasurementsOutliers
SoMaterial * customMatMeasurementsOutliers() const
Definition: TrackSystemController.cxx:1367
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.selection.number
number
Definition: selection.py:20
TrackCommonFlags::TSOS_MeasRioOnTrackNotOutlier
@ TSOS_MeasRioOnTrackNotOutlier
bit 4
Definition: TrackCommonFlags.h:48
VP1LinAlgUtils::distPointLineParam
static void distPointLineParam(const Amg::Vector3D &point, const Amg::Vector3D &point0, const Amg::Vector3D &point1, double &s)
Definition: VP1LinAlgUtils.cxx:390
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
RIO_OnTrack.h
python.SystemOfUnits.eV
int eV
Definition: SystemOfUnits.py:155
TrackCommonFlags::TSOS_SurfacesDetElem
@ TSOS_SurfacesDetElem
bit 9
Definition: TrackCommonFlags.h:52
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
TrackCommonFlags::TSOS_Hole
@ TSOS_Hole
bit 14
Definition: TrackCommonFlags.h:57
AtlasDetectorID::is_indet
bool is_indet(Identifier id) const
Definition: AtlasDetectorID.h:683
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
TrackSystemController::materialEffectsOnTrackScale
double materialEffectsOnTrackScale() const
Definition: TrackSystemController.cxx:1627
Trk::MeasurementBase::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrackCommonFlags::TSOS_MeasCompetingRioOnTrackNotOutlier
@ TSOS_MeasCompetingRioOnTrackNotOutlier
bit 5
Definition: TrackCommonFlags.h:49
AscObj_TSOS::m_hitToSoNode
HitToSoNode m_hitToSoNode
Definition: AscObj_TSOS.h:104
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TrackSystemController::customMatParameterErrors
SoMaterial * customMatParameterErrors() const
Definition: TrackSystemController.cxx:1385
TrackSysCommonData::singlePoint
SoPointSet * singlePoint() const
Definition: TrackSysCommonData.h:135
AscObj_TSOS::regionIndex
int regionIndex() const
Definition: AscObj_TSOS.cxx:185
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
HitToSoNode::createTGC_Transform
SoTransform * createTGC_Transform(const Trk::RIO_OnTrack &rio, bool useSurfacePositionOnly) const
TGCs are rotated.
Definition: HitToSodeNode.cxx:126
VP1LinAlgUtils::distPointLine2
static double distPointLine2(const Amg::Vector3D &point, const Amg::Vector3D &point0, const Amg::Vector3D &point1, double &s)
Definition: VP1LinAlgUtils.cxx:406
Trk::LocalParameters::dimension
int dimension() const
Dimension of this localParameters() vector.
AscObj_TSOS::setDistToNextPar
void setDistToNextPar(const double &)
Definition: AscObj_TSOS.cxx:165
AscObj_TSOS::buildShapes
void buildShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:1006
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
IVP13DSystem::getCameraList
CamList getCameraList()
Definition: IVP13DSystem.cxx:395
Trk::MaterialEffectsOnTrack::energyLoss
const EnergyLoss * energyLoss() const
returns the energy loss object.
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
y
#define y
AtlasDetectorID::is_muon
bool is_muon(Identifier id) const
Definition: AtlasDetectorID.h:701
Trk::Surface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
Trk::EstimatedBremOnTrack
class holding information about momentum reduction and an additional noise term due to significant en...
Definition: EstimatedBremOnTrack.h:30
AscObj_TSOS::ensureInitSeps
static void ensureInitSeps(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:915
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
TrkObjToString::Unknown
@ Unknown
Definition: TrkObjToString.h:53
TrackCommonFlags::TSOS_MeasCompetingRioOnTrackOutlier
@ TSOS_MeasCompetingRioOnTrackOutlier
bit 7
Definition: TrackCommonFlags.h:51
Trk::PlaneSurface
Definition: PlaneSurface.h:64
PlaneSurface.h
TrackCommonFlags::TSOS_AnyParsErrors
@ TSOS_AnyParsErrors
Definition: TrackCommonFlags.h:66
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HitToSoNode::createTransform
SoTransform * createTransform(const Trk::RIO_OnTrack &rio, bool useSurfacePositionOnly) const
Definition: HitToSodeNode.cxx:107
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
TrackCommonFlags::TSOS_TrackParsErrorsNotPerigee
@ TSOS_TrackParsErrorsNotPerigee
bit 1
Definition: TrackCommonFlags.h:45
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
GeoPrimitivesToStringConverter.h
TrackCommonFlags::TSOS_NoObjects
@ TSOS_NoObjects
Definition: TrackCommonFlags.h:43
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
DiscSurface.h
AscObj_TSOS::approxCenter
Amg::Vector3D approxCenter() const
Definition: AscObj_TSOS.cxx:173
HitsSoNodeManager::getShapeNode_Cross
SoNode * getShapeNode_Cross(double extent)
Definition: HitsSoNodeManager.cxx:427
AssociatedObjectHandleBase::shapeSimple
SoSeparator * shapeSimple() const
Definition: AssociatedObjectHandleBase.cxx:200
AscObj_TSOS::m_tsos
const Trk::TrackStateOnSurface * m_tsos
Definition: AscObj_TSOS.h:82
AscObj_TSOS::setVisible
virtual void setVisible(bool)
Definition: AscObj_TSOS.cxx:1167
TrkObjToString::Pixel
@ Pixel
Definition: TrkObjToString.h:40
Trk::LEFT
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:20
AssociatedObjectHandleBase::shapeDetailed
SoSeparator * shapeDetailed() const
Definition: AssociatedObjectHandleBase.cxx:206
Trk::RIO_OnTrack::associatedSurface
virtual const Surface & associatedSurface() const override=0
returns the surface for the local to global transformation
AscObj_TSOS::addMaterialEffectsToShapes
void addMaterialEffectsToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:585
TrackSystemController::customMatMeasurements
SoMaterial * customMatMeasurements() const
Definition: TrackSystemController.cxx:1361
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::RIO_OnTrack::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
SurfaceToSoNode.h
TrackCommonFlags::TSOS_SurfacesCustom
@ TSOS_SurfacesCustom
bit 10
Definition: TrackCommonFlags.h:53
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
TrackHandleBase
Definition: TrackHandleBase.h:56
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
VP1ErrorUtils::errorAtStraightLineSurface
static void errorAtStraightLineSurface(SoSeparator *errSimple, SoSeparator *errDetailed, const AmgSymMatrix(5)&tmpcovmat, const Amg::Vector2D &localPos, const Trk::Surface *theSurface, const double &nStdDev=3.0, const bool &drawZErrCircles=false, const bool &drawCylinder=false, int numNodes=12, const bool &force1D=false, const bool &addTransform=true)
Definition: VP1ErrorUtils.cxx:227
TrkObjToString::sTGC
@ sTGC
Definition: TrkObjToString.h:48
VP1CameraHelper::animatedZoomToSubTree
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
Definition: VP1CameraHelper.cxx:413
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
python.compressB64.c
def c
Definition: compressB64.py:93
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition: VP1LinAlgUtils.cxx:40
TrkObjToString::MeasurementType
MeasurementType
Definition: TrkObjToString.h:39
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
Trk::MaterialEffectsBase::associatedSurface
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.
TrackSystemController::numberOfPointsOnCircles
int numberOfPointsOnCircles() const
Definition: TrackSystemController.cxx:1610
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::Surface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
TrackStateOnSurface.h
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
AtlasDetectorID::is_mdt
bool is_mdt(Identifier id) const
Definition: AtlasDetectorID.h:859
VP1TrackSystem.h
AscObj_TSOS::addCompetingRIO_OnTrackInfoToShapes
void addCompetingRIO_OnTrackInfoToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:749
AscObj_TSOS::addTransformToSurface
void addTransformToSurface(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Definition: AscObj_TSOS.cxx:949
AscObj_TSOS::getZTranslationTube
SoTranslation * getZTranslationTube(const Trk::Surface *, const double &maxTrans) const
Definition: AscObj_TSOS.cxx:201
DriftCircleStatus.h
Identifier
Definition: IdentifierFieldParser.cxx:14