|
ATLAS Offline Software
|
Go to the documentation of this file.
45 #include <Inventor/nodes/SoSeparator.h>
46 #include <Inventor/nodes/SoMaterial.h>
47 #include <Inventor/nodes/SoSwitch.h>
48 #include <Inventor/nodes/SoComplexity.h>
49 #include <Inventor/nodes/SoLineSet.h>
50 #include <Inventor/nodes/SoVertexProperty.h>
51 #include "Inventor/nodes/SoDrawStyle.h"
52 #include "Inventor/nodes/SoLightModel.h"
53 #include <Inventor/nodes/SoCylinder.h>
54 #include <Inventor/SoPath.h>
55 #include <Inventor/nodes/SoFont.h>
106 QList<TrackCollHandleBase*>
l;
107 for (
const QString&
name : T::availableCollections(
theclass)) {
108 std::cout<<
name.toStdString()<<std::endl;
116 QList<TrackCollHandleBase*>
l;
117 l << createSpecificCollections<TrackCollHandle_TrkTrack>();
118 l << createSpecificCollections<TrackCollHandle_TrkSegment>();
122 l << createSpecificCollections<TrackCollHandle_TruthTracks>();
123 l << createSpecificCollections<TrackCollHandle_SimulationTracks>();
125 l << createSpecificCollections<TrackCollHandle_TrackParticle>();
126 l << createSpecificCollections<TrackCollHandle_xAODTrackParticle>();
128 l << createSpecificCollections<TrackCollHandle_TrackContainer>();
138 "System showing all track-like objects.",
139 "Edward.Moyse@cern.ch, Thomas.Kittelmann@cern.ch"), m_d(
new Imp)
150 const unsigned n_chamber_t0_sources=2;
217 SoComplexity * complexity =
new SoComplexity;
218 complexity->value.setValue(0.3
f);
219 root->addChild(complexity);
249 SoFont *myFont =
new SoFont;
250 myFont->name.setValue(
"Arial");
251 myFont->size.setValue(12.0);
278 std::vector<std::string>
key;
279 key.emplace_back(
"MooreMuonChamberT0s");
280 key.emplace_back(
"MboyMuonChamberT0s");
284 assert(
i<
key.size());
290 if (isThere && sg->
retrieve(chamberT0s,
key[
i]).isFailure())
291 message(
"Problems loading ChamberT0s!");
298 std::vector< std::pair< Identifier, float > >::const_iterator
it, itEnd=chamberT0s->
getAllT0s().end();
370 +
" instances of AssociatedObjectHandleBase alive at end of systemerase(). "
371 "(ignore this warning if there is more than one track system instance).");
374 +
" instances of TrackHandleBase alive at end of systemerase(). "
375 "(ignore this warning if there is more than one track system instance).");
380 for(;itMat!=itMatEnd;++itMat) {
381 SoMaterial* curmat = itMat->second;
413 if (
state.version()==0) {
415 message(
"Warning: State data has obsolete format - ignoring!");
418 if (
state.version()!=1) {
419 message(
"Warning: State data has wrong format - ignoring!");
430 state.disableUnrestoredChecks();
447 std::vector< std::pair<const Trk::Track*, const SoMaterial*> > vistracks;
449 std::map<const Trk::Track*,SoMaterial*>::const_iterator
it,
itE = trackhelper->
visibleObjects().end();
451 vistracks.emplace_back(
it->first,
it->second);
460 std::vector< std::pair<const Trk::Segment*, const SoMaterial*> > vissegments;
462 std::map<const Trk::Segment*,SoMaterial*>::const_iterator
it,
itE = segmenthelper->
visibleObjects().end();
464 vissegments.emplace_back(
it->first,
it->second);
469 message(
"unexpected signal received in visibleObjectsChanged slot");
474 InDetProjFlags::InDetProjPartsFlags sct,
475 InDetProjFlags::InDetProjPartsFlags trt )
477 messageVerbose(
"Signal received in setApplicableIDProjections slot");
499 collhandle->updateInDetProjectionsOfAllHandles();
512 messageVerbose(
"updateSelectionMode Warning: Ignoring due to null pointers.");
528 message(
"updateSelectionMode ERROR: Unexpected selection mode flag");
545 message(
"Unknown object clicked");
556 if (
node->getTypeId().isDerivedFrom(SoCylinder::getClassTypeId())) {
558 node=pickedPath->getTail();
562 message(
"ERROR: Unknown track.");
567 messageVerbose(
"userSelectedSingleNode - find measurements for track fit");
571 if (trackmeas.empty())
message(
"In refit mode, but no visible measurements found so can't do anything. Perhaps they're not enabled in 'Details'?");
575 bool oneunselected(
false);
577 if (!currentsel.contains(meas)) {
578 oneunselected =
true;
582 QList<const Trk::PrepRawData*> prdSet;
609 message(
"ERROR: Unknown selection.");
630 QList<const Trk::PrepRawData*> prdSet;
650 for (
int i = 0;
i <
sel_tracks->getList()->getLength(); ++
i) {
651 SoFullPath *fPath =
static_cast<SoFullPath *
>((*(
sel_tracks->getList()))[
i]);
669 double msq = totenergy*totenergy - totmom.mag2();
670 mass = (msq<0?-1.0:1.0)*sqrt(fabs(msq));
703 SoVertexProperty * vertices =
new SoVertexProperty;
708 SoVertexProperty * vertices =
static_cast<SoVertexProperty*
>(
m_d->
totmomline->vertexProperty.getValue());
709 vertices->vertex.set1Value(0,totpos.x(),totpos.y(),totpos.z());
710 vertices->vertex.set1Value(1,
p2.x(),
p2.y(),
p2.z());
738 message(
"Total momentum [GeV] : "+
str(totmomgev));
752 if (
common->controller()->collWidget()->visibleStdCollections().isEmpty())
786 if (!currentFitter) {
787 message(
"ERROR - Aborting refit as no fitter available.");
791 QList<const Trk::Track*> fittedtracks;
799 if (fittedtracks.empty())
return;
805 newtrackcoll->
init();
807 QList<TrackCollHandleBase*> newcols;
808 newcols << newtrackcoll;
815 col->setVisible(
true);
896 if (!trkhandle)
return;
904 currentFitter->
fit(Gaudi::Hive::currentContext(), *
track, outlier, hypo).
release();
907 message(
"Fit failed - no resulting track.");
911 fittedtracks << fittedtrk;
913 std::ostringstream
s;
930 assert (
values.size()==6);
943 message (
"No selection manager - giving up.");
980 for (
const auto&
it : vertexList){
981 SoMaterial*
mat =
const_cast<SoMaterial*
>(
it.first);
994 if (coll->allowColourByVertex()) coll->updateMaterialOfAllHandles();
JetConstituentVector::iterator iterator
InDetProjFlags::DetTypeFlags lastEmittedUsedIDProjections
virtual ~VP1TrackSystem()
void userChangedSelection(SoCooperativeSelection *, QSet< SoNode * >, QSet< SoPath * >)
int multilayer(const Identifier &id) const
Access to components of the ID.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
InDetProjFlags::InDetProjPartsFlags parts() const
void updateShownTotMomentum()
bool handleUserSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *, AssociatedObjectHandleBase *&)
TrackSystemController * controller() const
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
void vertexCutsAllowed(bool)
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
void visibleObjectsChanged()
VP1TrackSystem(const QString &name="Tracks")
TrackLODManager * trackLODManager() const
void refitFromPRDs(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
SoSeparator * getAscObjAttachSep() const
const Trk::RIO_OnTrack * rioOnTrack() const
bool is_mdt(const Identifier &id) const
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
QList< const Trk::PrepRawData * > selectedPRDs
Stores links between chambers and the reconstructed T0.
QList< TrackCollHandleBase * > createSpecificCollections()
void setSelectedPRDs(const QList< const Trk::PrepRawData * > &)
void restoreSettings(const QByteArray &)
bool is_csc(const Identifier &id) const
void updateAlignment()
Special mode to allow in VP1 alignment tests.
const std::string & technologyString(const int &index) const
const Trk::Track * trkTrackPointer() const
void ensureSelected(const QList< AssociatedObjectHandleBase * > &)
static VP1CameraHelper * animatedZoomToPath(SoCamera *camera, SoGroup *sceneroot, SoPath *path, double duration_in_secs=1.0, double clipVolPercent=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)
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
int stationName(const Identifier &id) const
virtual Identifier identify() const =0
Identifier.
SoMaterial * materialFromVertex(const TrackHandleBase *trk) const
Returns the material for the vertex which knows this trackhandle (if known)
std::vector< double > alignmentShiftValue()
SoDrawStyle * ascObjDrawStyle() const
static QString str(const QString &s)
QByteArray saveSettings() const
void visibleSegmentsChanged(const std::vector< std::pair< const Trk::Segment *, const SoMaterial * > > &)
QString nameOfNewlyFittedCollections() const
virtual bool initiatesOwnZooms() const
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
QList< TrackCollHandleBase * > createCollections()
virtual QByteArray saveState()
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
Trk::ITrackFitter * trackFitter() const
int alignmentShiftLevel()
void registerSelectionNode(SoCooperativeSelection *)
The Athena Transient Store API.
AscObjSelectionManager * ascObjSelManager
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
void muonChamberT0sChanged(const std::map< GeoPVConstLink, float > &, int)
The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore,...
QWidget * buildController()
virtual Amg::Vector3D momentum() const
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
TrackCommonFlags::SELECTIONMODE selMode
const std::map< const objectT *, SoMaterial * > & visibleObjects()
InDetProjFlags::DetTypeFlags currentUsedIDProjections() const
unsigned calcTotalMomentumOfSelectedHandles(Amg::Vector3D &totmom, Amg::Vector3D &totpos, double &mass) const
void setCommonData(TrackSysCommonData *)
set pointer to the common data
void usedIDProjectionsChanged(InDetProjFlags::DetTypeFlags)
const QString & name() const
SoCooperativeSelection * sel_tracks
void restoreFromState(QByteArray)
const std::vector< std::pair< Identifier, float > > & getAllT0s() const
Returns entire list of T0s.
InDetProjHelper * indetProjHelper_SCT() const
void visibleTracksChanged(const std::vector< std::pair< const Trk::Track *, const SoMaterial * > > &)
static int numberOfInstances()
void ensureBuildController()
const MdtIdHelper * mdtIdHelper() const
void emitTouchedMuonChambersChanged(const std::set< GeoPVConstLink > &)
void newTrackSelected(const TrackHandleBase &)
void refitSingleTrack(const Trk::ITrackFitter *currentFitter, QList< const Trk::Track * > &fittedtracks)
Trk::ParticleHypothesis fitterParticleHypthesis() const
bool printInfoOnSingleSelection() const
void possiblyEmitUsedIDProjectionsChanged()
int stationPhi(const Identifier &id) const
void setLastSelectedTrack(TrackHandleBase *sel)
const std::string & stationNameString(const int &index) const
TrackCommonFlags::FITTERMODE fitterMode() const
bool fitterRemoveOutliers() const
virtual std::optional< Amg::Vector3D > startPoint() const
returns 0 if can't find start point.
void messageDebug(const QString &) const
TrackHandleBase * lastSelectedTrackHandle()
pointer to base of last selected track (zero if nothing selected)
TrackHandleBase * trackHandle(SoNode *n)
int stationEta(const Identifier &id) const
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
bool orientAndZoomOnSingleSelection() const
virtual void init(VP1MaterialButtonBase *matBut=0)
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
static const MdtIdHelper * mdtIDHelper()
void systemcreate(StoreGateSvc *detstore)
void setApplicableIDProjections(InDetProjFlags::InDetProjPartsFlags pixel, InDetProjFlags::InDetProjPartsFlags sct, InDetProjFlags::InDetProjPartsFlags trt)
static const MuonGM::MuonDetectorManager * muonDetMgr()
bool printTotMomentumOnMultiTrackSelection() const
QList< AssociatedObjectHandleBase * > getVisibleMeasurements() const
TrackCommonFlags::SELECTIONMODE selectionMode() const
QTreeWidget * trackObjBrowser() const
Returns a pointer to the Track Object Browser (if it exists)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
int technology(const Identifier &id) const
void touchedMuonChambersChanged(const std::set< GeoPVConstLink > &)
void unregisterSelectionNode(SoCooperativeSelection *)
static QString toString(const SELECTIONMODE &)
void tracksFromVertexChanged(QList< std::pair< const SoMaterial *, QList< const Trk::Track * > > > &)
SoComplexity * ascObjComplexity() const
InDetProjHelper * indetProjHelper_TRT() const
InDetProjHelper * indetProjHelper_Pixel() const
std::map< const Trk::Track *, SoMaterial * > vertexMaterialForTrackBases
TrackCollWidget * collWidget() const
virtual std::unique_ptr< Track > fit(const EventContext &ctx, const Track &track, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=Trk::nonInteracting) const =0
RE-FIT A TRACK.
VP1TrackSystem * theclass
TrackSysCommonData * common
const CscIdHelper * cscIdHelper() const
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
const Trk::TrackStateOnSurface * trackStateOnSurface() const
virtual double mass() const
InDetProjFlags::InDetProjPartsFlags setParts(InDetProjFlags::InDetProjPartsFlags)
bool showTotMomentumOnMultiTrackSelection() const
static int numberOfInstances()
const QList< AssociatedObjectHandleBase * > & currentSelection() const
void ensureDeselected(const QList< AssociatedObjectHandleBase * > &)
std::vector< std::map< GeoPVConstLink, float > > chamberT0s
void setAttachNode(SoGroup *attachnode)
PVConstLink parentStationPV() const
void userDeselectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
void message(const QString &) const
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
void messageVerbose(const QString &) const
void userSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
void setEventData(AscObjSelectionManager *)
void setNumberOfSelectedPRDsAndTracks(unsigned prds, unsigned trks)
void updateSelectionMode()
SoCooperativeSelection * selTracks()
Needed in TrackSystemController::objectBrowserClicked(QTreeWidgetItem * item, int)
virtual void restoreFromState(QByteArray)