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>;
66 if (trackstate.hasSmoothed() && trackstate.hasReferenceSurface()) {
67 const Acts::BoundTrackParameters params(
68 trackstate.referenceSurface().getSharedPtr(), trackstate.smoothed(),
69 trackstate.smoothedCovariance(), Acts::ParticleHypothesis::pion());
70 points->push_back(params.position(ctx));
86 QList<QTreeWidgetItem*>& listOfItems) {
92 unsigned int listSize = list.size();
96 unsigned int trackStateNum=0;
98 QString surfaceText = QString(
" ");
99 surfaceText += trackState.hasReferenceSurface()?QString::number(trackState.referenceSurface().type()):
"No Surface";
107 if (trackStateNum<listSize) asc =
dynamic_cast<AscObj_TrackState*
>(list.at(trackStateNum));
115 TSOSitem->setFlags(Qt::ItemFlag());
116 QFont itemFont = TSOSitem->font(0);
117 itemFont.setStrikeOut(
true);
118 TSOSitem->setFont(0, itemFont);
119 TSOSitem->setFont(1, itemFont);
121 std::ostringstream s;
123 s <<
" | Flags: "<< trackState.typeFlags();
124 QString text = QString::number( trackStateNum )+QString(s.str().c_str());
125 TSOSitem->setText(0, QString(
"Track State "+text ) );
127 if (trackState.hasReferenceSurface()) {
128 auto& surface = trackState.referenceSurface();
129 QString surfaceText = QString(surface.toString(
common()->geometryContext().context()).c_str());
130 QTreeWidgetItem* surfItem =
new QTreeWidgetItem(TSOSitem);
131 surfItem->setExpanded(
true);
132 surfItem->setFlags(Qt::ItemIsEnabled);
133 surfItem->setText(0, QString(surface.name().c_str()));
134 surfItem->setText(1, surfaceText );
139 QString trackStateText;
143 if (trackState.hasCalibrated() ){
145 trackStateText+=measName;
147 QTreeWidgetItem* measItem =
new QTreeWidgetItem(TSOSitem);
148 measItem->setExpanded(
true);
149 measItem->setFlags(Qt::ItemIsEnabled);
150 measItem->setText(0, measName);
231 TSOSitem->setText(1, trackStateText );
244 "TrackHandle_TrackContainer::zoomToTSOS: checking ASC " +
245 QString::number(
index) +
" of " + QString::number(list.size()));
247 if ( (
int)
index < list.size()){
249 if (asc && asc->
trackState().index()==trackState.index()) {
251 "TrackHandle_TrackContainer::zoomToTSOS: this ASC matches " +
252 QString::number(
index));
266 l +=
"|Pt|=" +
VP1Msg::str(mom.perp()) +
" [GeV], ";
276 "TrackHandle_TrackContainer::updateObjectBrowser: No m_objBrowseTree!");
297 "No ASC objects associated with this track - no track components "
302 unsigned int numOfTS = 0;
309 "Could not cast to AscObj_TrackState, or could not find matching Asc "
311 QString::number(list.size()));
316 if (asc->
trackState().index() != trackstate.index()) {
318 "WARNING! TrackHandle_TrackContainer::updateObjectBrowser: " +
319 QString::number(numOfTS) +
320 ": ASC index mismatch with trackstate from loop having " +
321 QString::number(trackstate.index()) +
" and ASC TS having " +
343 Qt::ItemIsSelectable | Qt::ItemIsEnabled);
346 itemFont.setStrikeOut(!asc->
visible());
354 const QString& )
const {
366 for (
auto trackstate :
m_track.trackStatesReversed()) {
375 std::unique_ptr<std::vector<AssociatedObjectHandleBase*>>& ascobjs) {
380 ascobjs = std::make_unique<std::vector<AssociatedObjectHandleBase*>>();
381 unsigned int index =0;
389 const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state,
390 std::vector<AssociatedObjectHandleBase*>* ascobjs,
unsigned int index) {
396 ascobjs->push_back(ao);
403 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
405 if (state.hasReferenceSurface()) {
407 state.referenceSurface().surfacePlacement());
408 if (actsElement &&
common()->muonIdHelperSvc().
get()) {
410 if (idhelper.is_mdt(actsElement->identify())) {
412 }
else if (idhelper.is_tgc(actsElement->identify())) {
414 }
else if (idhelper.is_rpc(actsElement->identify())) {
416 }
else if (idhelper.is_csc(actsElement->identify())) {
418 }
else if (idhelper.is_stgc(actsElement->identify())) {
420 }
else if (idhelper.is_mm(actsElement->identify())) {
430 const ActsTrk::TrackContainer::ConstTrackStateProxy& state)
const {
431 QString text(
"Unknown Measurement");
432 if (state.hasReferenceSurface()) {
434 state.referenceSurface().surfacePlacement());
437 if (helperSvc->isMuon(actsElement->identify()))
438 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.
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 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.