16#include "Acts/Surfaces/PerigeeSurface.hpp"
17#include "Acts/Surfaces/Surface.hpp"
20#include "CLHEP/Units/SystemOfUnits.h"
29#include <Inventor/nodes/SoSeparator.h>
30#include <Inventor/nodes/SoNode.h>
51 const Acts::BoundTrackParameters trackparams(
53 std::nullopt, Acts::ParticleHypothesis::pion());
54 return trackparams.momentum()*1000.;
57const std::vector<Amg::Vector3D>*
60 auto trackContainerCollHandle =
62 auto points =
new std::vector<Amg::Vector3D>;
63 if (!trackContainerCollHandle)[[
unlikely]]{
69 if (trackstate.hasSmoothed() && trackstate.hasReferenceSurface()) {
70 const Acts::BoundTrackParameters params(
71 trackstate.referenceSurface().getSharedPtr(), trackstate.smoothed(),
72 trackstate.smoothedCovariance(), Acts::ParticleHypothesis::pion());
73 points->push_back(params.position(ctx));
89 QList<QTreeWidgetItem*>& listOfItems) {
95 unsigned int listSize = list.size();
99 unsigned int trackStateNum=0;
101 QString surfaceText = QString(
" ");
102 surfaceText += trackState.hasReferenceSurface()?QString::number(trackState.referenceSurface().type()):
"No Surface";
110 if (trackStateNum<listSize) asc =
dynamic_cast<AscObj_TrackState*
>(list.at(trackStateNum));
118 TSOSitem->setFlags(Qt::ItemFlag());
119 QFont itemFont = TSOSitem->font(0);
120 itemFont.setStrikeOut(
true);
121 TSOSitem->setFont(0, itemFont);
122 TSOSitem->setFont(1, itemFont);
124 std::ostringstream s;
126 s <<
" | Flags: "<< trackState.typeFlags();
127 QString text = QString::number( trackStateNum )+QString(s.str().c_str());
128 TSOSitem->setText(0, QString(
"Track State "+text ) );
130 if (trackState.hasReferenceSurface()) {
131 auto& surface = trackState.referenceSurface();
132 QString surfaceText = QString(surface.toString(
common()->geometryContext().context()).c_str());
133 QTreeWidgetItem* surfItem =
new QTreeWidgetItem(TSOSitem);
134 surfItem->setExpanded(
true);
135 surfItem->setFlags(Qt::ItemIsEnabled);
136 surfItem->setText(0, QString(surface.name().c_str()));
137 surfItem->setText(1, surfaceText );
142 QString trackStateText;
146 if (trackState.hasCalibrated() ){
148 trackStateText+=measName;
150 QTreeWidgetItem* measItem =
new QTreeWidgetItem(TSOSitem);
151 measItem->setExpanded(
true);
152 measItem->setFlags(Qt::ItemIsEnabled);
153 measItem->setText(0, measName);
234 TSOSitem->setText(1, trackStateText );
247 "TrackHandle_TrackContainer::zoomToTSOS: checking ASC " +
248 QString::number(
index) +
" of " + QString::number(list.size()));
250 if ( (
int)
index < list.size()){
252 if (asc && asc->
trackState().index()==trackState.index()) {
254 "TrackHandle_TrackContainer::zoomToTSOS: this ASC matches " +
255 QString::number(
index));
269 l +=
"|Pt|=" +
VP1Msg::str(mom.perp()) +
" [GeV], ";
279 "TrackHandle_TrackContainer::updateObjectBrowser: No m_objBrowseTree!");
300 "No ASC objects associated with this track - no track components "
305 unsigned int numOfTS = 0;
312 "Could not cast to AscObj_TrackState, or could not find matching Asc "
314 QString::number(list.size()));
319 if (asc->
trackState().index() != trackstate.index()) {
321 "WARNING! TrackHandle_TrackContainer::updateObjectBrowser: " +
322 QString::number(numOfTS) +
323 ": ASC index mismatch with trackstate from loop having " +
324 QString::number(trackstate.index()) +
" and ASC TS having " +
346 Qt::ItemIsSelectable | Qt::ItemIsEnabled);
349 itemFont.setStrikeOut(!asc->
visible());
357 const QString& )
const {
369 for (
auto trackstate :
m_track.trackStatesReversed()) {
378 std::unique_ptr<std::vector<AssociatedObjectHandleBase*>>& ascobjs) {
383 ascobjs = std::make_unique<std::vector<AssociatedObjectHandleBase*>>();
384 unsigned int index =0;
392 const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state,
393 std::vector<AssociatedObjectHandleBase*>* ascobjs,
unsigned int index) {
399 ascobjs->push_back(ao);
406 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
408 if (state.hasReferenceSurface()) {
410 state.referenceSurface().surfacePlacement());
411 if (actsElement &&
common()->muonIdHelperSvc().
get()) {
413 if (idhelper.is_mdt(actsElement->identify())) {
415 }
else if (idhelper.is_tgc(actsElement->identify())) {
417 }
else if (idhelper.is_rpc(actsElement->identify())) {
419 }
else if (idhelper.is_csc(actsElement->identify())) {
421 }
else if (idhelper.is_stgc(actsElement->identify())) {
423 }
else if (idhelper.is_mm(actsElement->identify())) {
433 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
434 QString text(
"Unknown Measurement");
435 if (state.hasReferenceSurface()) {
439 if (helperSvc->isMuon(actsElement->identify()))
440 text = QString(helperSvc->toString(actsElement->identify()).c_str());
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
Wrapper to avoid constant divisions when using units.
Acts::GeometryContext context() const
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
virtual void setVisible(bool)
virtual QTreeWidgetItem * browserTreeItem() const
virtual TrackCommonFlags::TSOSPartsFlags parts() const
const ActsTrk::TrackStateBackend::ConstTrackStateProxy trackState() const
virtual void setBrowserTreeItem(QTreeWidgetItem *obt)
SoSeparator * shapeDetailed() const
TrackSysCommonData * common() const
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Called in child classes.
virtual void visibleStateChanged()
override if need to take action in this case.
QTreeWidgetItem * browserTreeItem() const
friend class TrackCollHandleBase
TrackHandleBase(TrackCollHandleBase *)
TrackCommonFlags::TSOSPartsFlags shownTSOSParts() const
QStringList baseInfo() const
TrackCollHandleBase * collHandle() const
TrackSysCommonData * common() const
const QList< AssociatedObjectHandleBase * > & getAllAscObjHandles() const
override if need to take action in this case.
void registerAssocObject(AssociatedObjectHandleBase *)
Trackhandle assumes ownership.
SoNode * zoomToTSOS(unsigned int index)
Depending on controller configuration attempt to zoom to the corresponding TSOS & returned detailed n...
QString measurementText(const ActsTrk::TrackContainer::ConstTrackStateProxy &state) const
void currentMaterialChanged()
virtual const std::vector< Amg::Vector3D > * provide_pathInfoPoints()
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Called in child classes.
ActsTrk::TrackContainer::ConstTrackProxy m_track
void ensureInitTrackStateCache()
Ensure that the track state cache is initialized.
std::vector< ActsTrk::TrackContainer::ConstTrackStateProxy > m_trackStates
virtual QString shortInfo() const
returns mom and hit information about track
virtual Amg::Vector3D momentum() const
virtual ~TrackHandle_TrackContainer()
virtual bool containsDetElement(const QString &) const
TrkObjToString::MeasurementType measurementType(const ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) const
const ActsTrk::TrackContainer & m_container
virtual void ensureInitTSOSs(std::unique_ptr< std::vector< AssociatedObjectHandleBase * > > &ascobjs)
Ensure that the TSOSs are initialized.
virtual QStringList clicked() const
Called when user selects the node (stringlist is displayed in messagebox).
TrackHandle_TrackContainer(TrackCollHandleBase *, ActsTrk::TrackContainer::ConstTrackProxy, const ActsTrk::TrackContainer &)
void addTrackState(const typename ActsTrk::TrackContainer::ConstTrackStateProxy &state, std::vector< AssociatedObjectHandleBase * > *ascobjs, unsigned int index)
virtual void updateObjectBrowser()
virtual QString type() const
return very short word with type (maybe link with collection type?)
void visibleStateChanged()
override if need to take action in this case.
ServiceHandle< Muon::IMuonIdHelperSvc > & muonIdHelperSvc()
const ActsTrk::GeometryContext & geometryContext() const
static std::string typeName(MeasurementType type)
Returns a very short summary of the object type.
static void messageVerbose(const QString &)
static void messageDebug(const QString &)
static void message(const QString &, IVP1System *sys=0)
static QString str(const QString &s)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Eigen::Matrix< double, 3, 1 > Vector3D
void reverse(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of reverse for DataVector/List.