|
ATLAS Offline Software
|
Go to the documentation of this file.
33 #include <Inventor/nodes/SoSeparator.h>
34 #include <Inventor/nodes/SoMaterial.h>
35 #include <Inventor/nodes/SoSwitch.h>
36 #include "Inventor/nodes/SoDrawStyle.h"
37 #include "Inventor/nodes/SoLightModel.h"
43 #include <QTreeWidgetItem>
44 #include <QElapsedTimer>
46 #include <qdatetime.h>
103 m_sephelper(nullptr),
104 m_propagator(nullptr),
106 m_propMaxRadius(0.0),
109 m_trackTubeRadius(0.0),
110 m_colourby(COLOUR_PERCOLLECTION),
114 m_cut_requiredNHits(QList<
unsigned>()),
115 m_requiredDetectorElement(),
116 m_cut_pt_allowall(false),
117 m_cut_eta_allowall(false),
118 m_cut_phi_allowall(false),
119 m_cut_etaptphi_allwillfail(true)
153 m_d->
comboBox_colourby->setToolTip(
"Determine how tracks from this collection are coloured.\n The 'Dist. Sel.' option means the tracks will be coloured by distance from the last selected track. ");
210 connect(controller,SIGNAL(propagationOptionsChanged(TrackSystemController::PropagationOptionFlags)),
this,SLOT(
setPropagationOptions(TrackSystemController::PropagationOptionFlags)));
219 connect(controller,SIGNAL(shownTrackPartsChanged(TrackCommonFlags::TrackPartsFlags)),
this,SLOT(
setParts(TrackCommonFlags::TrackPartsFlags)));
223 connect(controller,SIGNAL(vertexProjectionAngleChanged(
int)),
this,SLOT(
setParts(
int)));
246 connect(controller,SIGNAL(cutAllowedPhiChanged(
const QList<VP1Interval>&)),
this,SLOT(
setCutAllowedPhi(
const QList<VP1Interval>&)));
250 connect(controller,SIGNAL(cutRequiredNHitsChanged(
const QList<unsigned>&)),
this,SLOT(
setRequiredNHits(
const QList<unsigned>&)));
261 connect(controller,SIGNAL(customColouredTSOSPartsChanged(TrackCommonFlags::TSOSPartsFlags)),
289 connect(controller,SIGNAL(shownTSOSPartsChanged(TrackCommonFlags::TSOSPartsFlags)),
293 connect(controller,SIGNAL(customColouredTSOSPartsChanged(TrackCommonFlags::TSOSPartsFlags)),
297 connect(controller,SIGNAL(trackLabelsChanged(TrackSystemController::TrackLabelModes)),
this,SLOT(
setLabels(TrackSystemController::TrackLabelModes)));
344 if (
mom.mag2()!=0.0) {
397 if ((*it)->visible())
415 if (!(*it)->visible())
445 messageVerbose(
"update3DObjectsOfAllHandles start (onlythosetouchingmuonchambers = "
446 +
str(onlythosetouchingmuonchambers)+
", invalidatePropagatedPoints = "
447 +
str(invalidatePropagatedPoints)+
")");
450 if (onlythosetouchingmuonchambers) {
452 if (!(*it)->touchedMuonChambers().empty())
453 (*it)->update3DObjects(invalidatePropagatedPoints, maxR);
456 (*it)->update3DObjects(invalidatePropagatedPoints, maxR);
473 (*it)->updateInDetProjections();
488 (*it)->updateMuonProjections();
503 (*it)->updateMaterial();
670 if (
i>=0&&i<m_d->comboBox_colourby->count()) {
675 message(
"ERROR: Problems finding correct text in combo box");
697 (*it)->rerandomiseRandomMaterial();
711 (*it)->updateMaterial();
734 messageVerbose(
"setUseDefaultCuts changed to "+
str(useDefaults)+
"- rechecking all handles");
755 double signMin = allowedpt.
lower()<0.0 ? -1.0 : 1.0;
756 double signMax = allowedpt.
upper()<0.0 ? -1.0 : 1.0;
757 double minptsq = allowedpt.
lower() == -std::numeric_limits<double>::infinity() ? -std::numeric_limits<double>::infinity() : signMin*(allowedpt.
lower()*allowedpt.
lower());
758 double maxptsq = allowedpt.
upper() == std::numeric_limits<double>::infinity() ? std::numeric_limits<double>::infinity() : signMax*(allowedpt.
upper()*allowedpt.
upper());
840 bool relaxed(
false),tightened(
false);
852 for (
int i=0;
i<
l.count();++
i) {
860 assert(relaxed||tightened);
862 if (relaxed&&tightened) {
1081 messageVerbose(
"TrackCollHandleBase::updateObjectBrowserVisibilityCounts called for "+
name());
1084 messageVerbose(
"TrackCollHandleBase::updateObjectBrowserVisibilityCounts: no common()->controller()->trackObjBrowser() and/or m_d->objBrowseTree. Aborting");
1098 if (!trkObjBrowser) {
1099 messageVerbose(
"TrackCollHandleBase::fillObjectBrowser: no common()->controller()->trackObjBrowser(). Aborting");
1108 trkObjBrowser->setUpdatesEnabled(
false);
1110 bool firstTime=
false;
1114 messageVerbose(
"TrackCollHandleBase::fillObjectBrowser: First time so creating QTreeWidgetItem.");
1118 messageVerbose(
"Missing from WidgetTree! Will continue but something must be wrong");
1124 QList<QTreeWidgetItem *>
list;
1128 unsigned int numVisible=0;
1137 if (trkHandle->
visible() ) numVisible++;
1147 trkObjBrowser->setUpdatesEnabled(
true);
1169 default:
return "Unknown (ERROR)";
1202 messageVerbose(
"Collection detail level combo box changed index");
1239 message(
"ERROR: useDefaultCuts(..) called before init()");
1248 message(
"ERROR: cutOnlyVertexAssocTracks(..) called before init()");
1262 message(
"ERROR: setState(..) called before init()");
1266 des.disableUnrestoredChecks();
1267 if (
des.version()!=0&&
des.version()!=1) {
1268 messageDebug(
"Warning: Ignoring state with wrong version");
1271 bool vis =
des.restoreBool();
1273 QByteArray matState =
des.restoreByteArray();
1275 QByteArray extraWidgetState =
des.version()>=1 ?
des.restoreByteArray() : QByteArray();
1278 if (extraWidgetState!=QByteArray())
1286 message(
"ERROR: persistifiableState() called before init()");
1292 Q_ASSERT(
m_d->
matButton&&
"Did you forget to call init() on this VP1StdCollection?");
JetConstituentVector::iterator iterator
virtual bool allowColourByMomentum() const
bool useShortTRTMeasurements() const
static QString comboBoxEntry_ColourByDistanceFromSelectedTrack()
QList< unsigned > m_cut_requiredNHits
void setLabelTrkOffset(float)
std::vector< TrackHandleBase * > trackhandles
static QString comboBoxEntry_ColourByMomentum()
void setRequiredDetectorElement(const QString &id)
static QString comboBoxEntry_ColourByVertex()
void setShownTSOSParts(TrackCommonFlags::TSOSPartsFlags)
PropagationOptionFlags propagationOptions() const
TrackSystemController * controller() const
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Called in child classes.
VP1Interval m_cut_allowedPtSq
Scalar phi() const
phi method
double tsos_nStdDevForParamErrors
void setCutAllowedPhi(const QList< VP1Interval > &)
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
Trk::IExtrapolator * propagator() const
static QString comboBoxEntry_ColourByCharge()
TrackCommonFlags::TrackPartsFlags parts() const
void setUseDefaultCuts(bool)
bool tsos_drawMeasGlobalPositions
VP1Interval m_cut_allowedEta
void clipVolumeChanged(double)
TrackCommonFlags::TSOSPartsFlags customColouredTSOSParts() const
bool cutOnlyVertexAssocTracks() const
void messageVerbose(const QString &) const
Trk::IExtrapolator * lastUsedPropagator
virtual void setupSettingsFromControllerSpecific(TrackSystemController *)
SoSwitch * collSwitch() const
Add this somewhere in your scenegraph (do not add any children here!)
void disableUnrestoredChecks()
void updateMuonProjectionsOfAllHandles()
TrackCommonFlags::TrackPartsFlags m_parts
double nStdDevForParamErrors() const
TrackCommonFlags::TrackPartsFlags shownTrackParts() const
VP1TrackSystem * system() const
static QString comboBoxEntry_ColourByPID()
void setLabels(TrackSystemController::TrackLabelModes)
virtual void init(VP1MaterialButtonBase *button=0)
void updateShapes_TSOSWithMeasurements()
void setDrawMeasGlobalPositions(bool)
int vertexProjectionAngle() const
void setCustomColouredTSOSParts(TrackCommonFlags::TSOSPartsFlags)
void setOnlyVertexAssocTracks(bool)
virtual void largeChangesBegin()
void recheckCutStatusOfAllNotVisibleHandles()
bool cutOnlyVertexAssocTracks() const
Return true if this collection should only should tracks associated to a vertex.
static QString toString(const COLOURBY &)
bool parTubeErrorsDrawCylinders() const
virtual unsigned getNSCTHits() const
SoMaterial * materialFromVertex(const TrackHandleBase *trk) const
Returns the material for the vertex which knows this trackhandle (if known)
void hintNumberOfTracksInEvent(unsigned)
TrackCollHandleBase * theclass
void actualSetShownTSOSPartsOnHandles()
static QString str(const QString &s)
TrackCollHandleBase(TrackSysCommonData *, const QString &name, TrackType::Type)
virtual QByteArray persistifiableState() const
Provide specific implementation.
virtual COLOURBY defaultColourBy() const
TrackCommonFlags::TSOSPartsFlags shownTSOSParts
void messageDebug(const QString &) const
void setParts(TrackCommonFlags::TrackPartsFlags)
virtual QColor defaultColor() const =0
bool useDefaultCuts() const
Return true if this collection uses the default (i.e.
TrackCommonFlags::TSOSPartsFlags shownTSOSParts() const
double measurementsShorttubesScale() const
virtual void updateObjectBrowser()
static double phiFromXY(const double &x, const double &y)
bool tsos_parTubeErrorsDrawCylinders
void setPropagator(Trk::IExtrapolator *)
void updateInDetProjectionsOfAllHandles()
virtual bool cut(TrackHandleBase *)
VP1Interval cutAllowedEta() const
QList< VP1Interval > m_cut_allowedPhi
static VP1CustomTourEditor * customTourEditor()
QComboBox * comboBox_colourby
virtual unsigned getNTRTHits() const
void setNumberOfPointsOnCircles(int)
void colourByComboBoxItemChanged()
void setRequiredNHits(const QList< unsigned > &)
virtual void collMaterialTransparencyAndBrightnessChanged()
virtual bool allowColourByVertex() const
virtual bool allowColourByDistanceFromSelectedTrack() const
def save(self, fileName="./columbo.out")
bool drawMeasGlobalPositions() const
void updateShapes_TSOSWithErrors()
qint32 provideCollTypeID() const
virtual void setState(const QByteArray &)
Provide specific implementation.
std::vector< TrackHandleBase * >::iterator itTrackHandles
void updateMaterialOfAllHandles()
bool useShortMDTMeasurements() const
void setCustomColouredTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
void updateRandomColourTransparencyAndBrightness()
virtual bool hasSubSystemHitInfo() const
static QString comboBoxEntry_ColourByRandom()
virtual Amg::Vector3D momentum() const
void updateObjectBrowserVisibilityCounts()
void setShownTSOSParts(TrackCommonFlags::TSOSPartsFlags f)
COLOURBY colourBy() const
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
VP1Interval cutAllowedEta() const
void setCutAllowedEta(const VP1Interval &)
void cleanupPtrContainer(T &) const
void visibilityChanged(bool)
virtual unsigned getNMuonHits() const
virtual void assignDefaultMaterial(SoMaterial *) const
TrackLabelModes trackLabels()
bool m_cut_etaptphi_allwillfail
void setMeasurementsShorttubesScale(double)
virtual bool allowColourByPID() const
void restore(QCheckBox *sb)
QTreeWidgetItem * objBrowseTree
static qint32 typeToInt(const Type &)
void trackSelectionChanged()
QList< VP1Interval > cutAllowedPhi() const
QList< unsigned > cutRequiredNHits() const
void recheckCutStatusOfAllHandles()
bool tsos_useShortMDTMeasurements
QList< unsigned > cutRequiredNHits() const
void setPropagationOptions(TrackSystemController::PropagationOptionFlags)
void setLabelPosOffsets(const QList< int > &)
void update3DObjectsOfAllHandles(bool onlythosetouchingmuonchambers=false, bool invalidatePropagatedPoints=false, float maxR=0.0)
void setPropMaxRadius(float)
virtual unsigned getNPixelHits() const
QByteArray extraWidgetsState() const
IVP1System * systemBase() const
void actualSetCustomColouredTSOSPartsOnHandles()
bool contains(const double &x) const
void addTrackHandle(TrackHandleBase *)
void setExtraWidgetsState(const QByteArray &)
QString m_requiredDetectorElement
void setMaterialEffectsOnTrackScale(double)
double materialEffectsOnTrackScale() const
void setActualPathShown(bool)
VP1Interval cutAllowedPt() const
Eigen::Matrix< double, 3, 1 > Vector3D
void trackHandleIterationBegin()
double tsos_materialEffectsOnTrackScale
virtual void init(VP1MaterialButtonBase *matBut=0)
virtual bool isIDTrack() const
bool noUpperBound() const
std::string typeToString(Magnet::Type type)
virtual void largeChangesEnd()
VP1Interval cutAllowedPt() const
void rerandomiseRandomTrackColours()
void updateShapes_TSOSWithMaterialEffects()
void setCutAllowedPt(const VP1Interval &)
void setParTubeErrorsDrawCylinders(bool)
TrackSystemController::TrackLabelModes m_labels
virtual unsigned getNMuonPrecisionHits() const
Trk::IExtrapolator * m_propagator
int tsos_numberOfPointsOnCircles
void setVisible(bool)
use by the collection handle.
QTreeWidget * trackObjBrowser() const
Returns a pointer to the Track Object Browser (if it exists)
virtual bool allowColourByCharge() const
static void setMatColor(SoMaterial *, const double &r, const double &g, const double &b, const double &brightness=0.0, const double &transp=0.0)
void setNStdDevForParamErrors(const double &)
TrackSystemController::PropagationOptionFlags m_propagationOptions
virtual bool containsDetElement(const QString &) const
void setupSettingsFromController(TrackSystemController *)
SoSeparator * collSep() const
All 3D objects from this coll.
std::vector< TrackHandleBase * >::iterator itTrackHandlesEnd
double tsos_measurementsShorttubesScale
float propMaxRadius() const
virtual ~TrackCollHandleBase()
QList< int > m_labelsPosOffsets
void message(const QString &) const
static QString comboBoxEntry_ColourByCollection()
bool ignoreMeasurementEffectsOnTrackInProp()
If true (default) don't use TSOS with MEOT to draw track points.
void recheckCutStatusOfAllVisibleHandles()
bool tsos_useShortTRTMeasurements
void setColourBy(COLOURBY)
void recheckCutStatus(TrackHandleBase *)
QList< QWidget * > provideExtraWidgetsForGuiRow() const
void setUseShortMDTMeasurements(bool)
TrackCommonFlags::TSOSPartsFlags customColouredTSOSParts
TrackSysCommonData * m_commonData
TrackSysCommonData * common() const
void setTrackTubeRadius(const double &)
TrackHandleBase * getNextTrackHandle()
VP1ExtraSepLayerHelper * m_sephelper
void setUseShortTRTMeasurements(bool)
void collVisibilityChanged(bool)
int numberOfPointsOnCircles() const
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
TrackCollectionSettingsButton * matButton
virtual bool mightHaveSubSystemHitInfo() const
QList< VP1Interval > cutAllowedPhi() const
const QString & name() const
bool noLowerBound() const
void extrapolateToThisVolumeChanged(void)