16#include "Acts/Surfaces/PerigeeSurface.hpp"
17#include "Acts/Surfaces/Surface.hpp"
21#include "CLHEP/Units/SystemOfUnits.h"
30#include <Inventor/nodes/SoSeparator.h>
31#include <Inventor/nodes/SoNode.h>
52 const Acts::BoundTrackParameters trackparams(
54 std::nullopt, Acts::ParticleHypothesis::pion());
55 return trackparams.momentum()*1000.;
58const std::vector<Amg::Vector3D>*
61 auto trackContainerCollHandle =
63 auto points =
new std::vector<Amg::Vector3D>;
67 if (trackstate.hasSmoothed() && trackstate.hasReferenceSurface()) {
68 const Acts::BoundTrackParameters params(
69 trackstate.referenceSurface().getSharedPtr(), trackstate.smoothed(),
70 trackstate.smoothedCovariance(), Acts::ParticleHypothesis::pion());
71 points->push_back(params.position(ctx));
87 QList<QTreeWidgetItem*>& listOfItems) {
93 unsigned int listSize = list.size();
97 unsigned int trackStateNum=0;
99 QString surfaceText = QString(
" ");
100 surfaceText += trackState.hasReferenceSurface()?QString::number(trackState.referenceSurface().type()):
"No Surface";
108 if (trackStateNum<listSize) asc =
dynamic_cast<AscObj_TrackState*
>(list.at(trackStateNum));
116 TSOSitem->setFlags(Qt::ItemFlag());
117 QFont itemFont = TSOSitem->font(0);
118 itemFont.setStrikeOut(
true);
119 TSOSitem->setFont(0, itemFont);
120 TSOSitem->setFont(1, itemFont);
122 std::ostringstream s;
124 s <<
" | Flags: "<< trackState.typeFlags();
125 QString text = QString::number( trackStateNum )+QString(s.str().c_str());
126 TSOSitem->setText(0, QString(
"Track State "+text ) );
128 if (trackState.hasReferenceSurface()) {
129 auto& surface = trackState.referenceSurface();
130 QString surfaceText = QString(surface.toString(
common()->geometryContext().context()).c_str());
131 QTreeWidgetItem* surfItem =
new QTreeWidgetItem(TSOSitem);
132 surfItem->setExpanded(
true);
133 surfItem->setFlags(Qt::ItemIsEnabled);
134 surfItem->setText(0, QString(surface.name().c_str()));
135 surfItem->setText(1, surfaceText );
140 QString trackStateText;
144 if (trackState.hasCalibrated() ){
146 trackStateText+=measName;
148 QTreeWidgetItem* measItem =
new QTreeWidgetItem(TSOSitem);
149 measItem->setExpanded(
true);
150 measItem->setFlags(Qt::ItemIsEnabled);
151 measItem->setText(0, measName);
232 TSOSitem->setText(1, trackStateText );
245 "TrackHandle_TrackContainer::zoomToTSOS: checking ASC " +
246 QString::number(
index) +
" of " + QString::number(list.size()));
248 if ( (
int)
index < list.size()){
250 if (asc && asc->
trackState().index()==trackState.index()) {
252 "TrackHandle_TrackContainer::zoomToTSOS: this ASC matches " +
253 QString::number(
index));
267 l +=
"|Pt|=" +
VP1Msg::str(mom.perp()) +
" [GeV], ";
277 "TrackHandle_TrackContainer::updateObjectBrowser: No m_objBrowseTree!");
298 "No ASC objects associated with this track - no track components "
303 unsigned int numOfTS = 0;
310 "Could not cast to AscObj_TrackState, or could not find matching Asc "
312 QString::number(list.size()));
317 if (asc->
trackState().index() != trackstate.index()) {
319 "WARNING! TrackHandle_TrackContainer::updateObjectBrowser: " +
320 QString::number(numOfTS) +
321 ": ASC index mismatch with trackstate from loop having " +
322 QString::number(trackstate.index()) +
" and ASC TS having " +
344 Qt::ItemIsSelectable | Qt::ItemIsEnabled);
347 itemFont.setStrikeOut(!asc->
visible());
355 const QString& )
const {
367 for (
auto trackstate :
m_track.trackStatesReversed()) {
376 std::vector<AssociatedObjectHandleBase*>*& ascobjs) {
381 ascobjs =
new std::vector<AssociatedObjectHandleBase*>;
382 unsigned int index =0;
390 const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state,
391 std::vector<AssociatedObjectHandleBase*>* ascobjs,
unsigned int index) {
397 ascobjs->push_back(ao);
404 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
406 if (state.hasReferenceSurface()) {
408 state.referenceSurface().associatedDetectorElement());
409 if (actsElement &&
common()->muonIdHelperSvc().
get()) {
411 if (idhelper.is_mdt(actsElement->identify())) {
413 }
else if (idhelper.is_tgc(actsElement->identify())) {
415 }
else if (idhelper.is_rpc(actsElement->identify())) {
417 }
else if (idhelper.is_csc(actsElement->identify())) {
419 }
else if (idhelper.is_stgc(actsElement->identify())) {
421 }
else if (idhelper.is_mm(actsElement->identify())) {
431 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
432 QString text(
"Unknown Measurement");
433 if (state.hasReferenceSurface()) {
435 state.referenceSurface().associatedDetectorElement());
438 if (helperSvc->isMuon(actsElement->identify()))
439 text = QString(helperSvc->toString(actsElement->identify()).c_str());
Wrapper to avoid constant divisions when using units.
Acts::GeometryContext context() const
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.
virtual void ensureInitTSOSs(std::vector< AssociatedObjectHandleBase * > *&ascobjs)
Ensure that the TSOSs are initialized.
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 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 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.