Belle II Software development
|
Produces visualisation for MCParticles, simhits, genfit::Tracks, geometry and other things. More...
#include <EVEVisualization.h>
Classes | |
struct | ElementGroup |
Group of TEveElements, remembers wether user wants it visible or not. More... | |
struct | MCTrack |
Hold MC tracks and associated visualisation objects. More... | |
Public Member Functions | |
EVEVisualization () | |
Constructor. | |
EVEVisualization (const EVEVisualization &)=delete | |
disabled. | |
EVEVisualization & | operator= (const EVEVisualization &)=delete |
disabled assignment | |
~EVEVisualization () | |
Destructor. | |
void | addTrack (const Belle2::Track *belle2Track) |
Add this genfit::Track to event data. | |
void | addTrackCandidate (const std::string &collectionName, const RecoTrack &recoTrack) |
Add a RecoTrack, to evaluate track finding. | |
void | addTrackCandidateImproved (const std::string &collectionName, const RecoTrack &recoTrack) |
Add a RecoTrack, but use stored genfit track representation to make visualisation objects. | |
void | addCDCTriggerTrack (const std::string &collectionName, const CDCTriggerTrack &track) |
Add a CDCTriggerTrack. | |
template<class T > | |
void | addSimHits (const StoreArray< T > &hits) |
Add all entries in the given 'hits' array (and the corresponding MCParticles) to the event scene. | |
void | addSimHit (const CDCSimHit *hit, const MCParticle *particle) |
Add a CDCSimHit. | |
void | addSimHit (const PXDSimHit *hit, const MCParticle *particle) |
Add a PXDSimHit. | |
void | addSimHit (const SVDSimHit *hit, const MCParticle *particle) |
Add a SVDSimHit. | |
void | addSimHit (const KLMSimHit *hit, const MCParticle *particle) |
Add a KLMSimHit. | |
void | addSimHit (const ROOT::Math::XYZVector &v, const MCParticle *particle) |
Add simhit as a simple point. | |
MCTrack * | addMCParticle (const MCParticle *particle) |
Return MCTrack for given particle, add it if it doesn't exist yet. | |
void | addVertex (const genfit::GFRaveVertex *vertex) |
Add a vertex point and its covariance matrix. | |
void | addECLCluster (const ECLCluster *cluster) |
Add a reconstructed cluster in the ECL. | |
void | addKLMCluster (const KLMCluster *cluster) |
Add a reconstructed cluster in the KLM. | |
void | addBKLMHit2d (const KLMHit2d *bklm2dhit) |
Add a reconstructed 2d hit in the BKLM. | |
void | addEKLMHit2d (const KLMHit2d *eklm2dhit) |
Add a reconstructed 2d hit in the EKLM. | |
void | addARICHHit (const ARICHHit *hit) |
Add recontructed hit in ARICH. | |
void | addROI (const ROIid *roi) |
Add a Region Of Interest, computed by the PXDDataReduction module. | |
template<class T > | |
void | addUnassignedRecoHits (const StoreArray< T > &hits) |
After adding recohits for tracks/candidates, this function adds the remaining hits in a global collection. | |
void | addCDCHit (const CDCHit *hit, bool showTriggerHits=false) |
show CDCHits directly. | |
void | addCDCTriggerSegmentHit (const std::string &collectionName, const CDCTriggerSegmentHit *hit) |
show outline of track segments. | |
void | addTOPDigits (const StoreArray< TOPDigit > &digits) |
Add TOPDigits (shown aggregated per module). | |
void | addObject (const TObject *dataStoreObject, TEveElement *visualRepresentation) |
Generic function to keep track of which objects have which visual representation. | |
void | showUserData (const DisplayData &displayData) |
Add user-defined data (labels, points, etc.) | |
void | makeTracks () |
Create visual representation of all tracks. | |
void | clearEvent () |
clear event data. | |
void | setOptions (const std::string &opts) |
Set the display options. | |
void | setErrScale (double errScale=1.) |
Set the scaling factor for the visualization of track hit errors. | |
void | setAssignToPrimaries (bool on) |
If true, hits created by secondary particles (e.g. | |
void | setHideSecondaries (bool on) |
If true, secondary MCParticles (and hits created by them) will not be shown. | |
Private Types | |
enum | eFitterType { SimpleKalman , RefKalman , DafSimple , DafRef , Gbl } |
Fitter type to be used for addTrack(). More... | |
Private Member Functions | |
TEveBox * | boxCreator (const ROOT::Math::XYZVector &o, ROOT::Math::XYZVector u, ROOT::Math::XYZVector v, float ud, float vd, float depth) |
Create a box around o, oriented along u and v with widths ud, vd and depth and return a pointer to the box object. | |
void | makeLines (TEveTrack *eveTrack, const genfit::StateOnPlane *prevState, const genfit::StateOnPlane *state, const genfit::AbsTrackRep *rep, TEvePathMark::EType_e markType, bool drawErrors, int markerPos=1) |
Create hit visualisation for the given options, and add them to 'eveTrack'. | |
template<class SomeVXDHit > | |
void | addRecoHit (const SomeVXDHit *hit, TEveStraightLineSet *lines) |
adds given VXD hit to lines. | |
void | addRecoHit (const SVDCluster *hit, TEveStraightLineSet *lines) |
specialisation for SVDCluster | |
void | addRecoHit (const CDCHit *hit, TEveStraightLineSet *lines) |
specialisation for CDCHit. | |
void | addToGroup (const std::string &name, TEveElement *elem) |
Add 'elem' to the element group 'name' (created if necessary). | |
Private Attributes | |
TEveCalo3D * | m_calo3d |
Object for the energy bar visualisation. | |
double | m_errorScale |
Rescale PXD/SVD errors with this factor to ensure visibility. | |
std::string | m_options |
Option string for genfit::Track visualisation. | |
bool | m_assignToPrimaries |
If true, hits created by secondary particles (e.g. | |
bool | m_hideSecondaries {false} |
If true, secondary MCParticles (and hits created by them) will not be shown. | |
std::map< const MCParticle *, MCTrack > | m_mcparticleTracks |
map MCParticles to MCTrack (so hits can be added to the correct track). | |
std::map< std::string, ElementGroup > | m_groups |
name -> grouping element. | |
TEveTrackList * | m_tracklist |
parent object for MC tracks. | |
TEveTrackPropagator * | m_trackpropagator |
Track propagator for MCParticles. | |
TEveTrackPropagator * | m_gftrackpropagator |
Track propagator for genfit::Tracks (different mainly because of drawing options) | |
TEveTrackPropagator * | m_consttrackpropagator |
Track propagator for CDCTriggerTracks (uses constant B field) | |
TEveCaloDataVec * | m_eclData |
ECL cluster data. | |
EveVisBField * | m_bfield |
The global magnetic field. | |
std::set< const TObject * > | m_shownRecohits |
List of shown recohits (PXDCluster, SVDCluster, CDCHit). | |
TEveStraightLineSet * | m_unassignedRecoHits = nullptr |
Unassigned recohits. | |
bool | m_unassignedRecoHitsVisibility = true |
is m_unassignedRecoHits visible? | |
bool | m_drawCardinalRep = true |
Draw cardinal representation in addTrack. | |
bool | m_drawErrors = false |
Draw errors in addTrack. | |
bool | m_drawRefTrack = false |
Draw reference track in addTrack. | |
bool | m_drawForward = false |
draw forward in addTrack | |
bool | m_drawBackward = false |
draw backward in addTrack | |
Static Private Attributes | |
static const int | c_recoHitColor = getTColorID("Orange", 1) |
Color for reco hits. | |
static const int | c_recoTrackColor = getTColorID("Sky Blue", 1) |
Color for TrackCandidates. | |
static const int | c_trackColor = getTColorID("Sky Blue", 2) |
Color for tracks. | |
static const int | c_trackMarkerColor = getTColorID("Chameleon", 3) |
Color for track markers. | |
static const int | c_unassignedHitColor = getTColorID("Plum", 1) |
Color for unassigned (reco)hits. | |
static const int | c_klmClusterColor = getTColorID("Chameleon", 1) |
Color for KLMCluster objects. | |
static constexpr double | c_minPCut = 0.00 |
don't show MCParticles with momentum below this cutoff. | |
Produces visualisation for MCParticles, simhits, genfit::Tracks, geometry and other things.
Creates TEve objects from the given data, and adds them to the global or event scene.
Definition at line 64 of file EVEVisualization.h.
|
private |
Fitter type to be used for addTrack().
Definition at line 66 of file EVEVisualization.h.
|
explicit |
Constructor.
Definition at line 135 of file EVEVisualization.cc.
~EVEVisualization | ( | ) |
Destructor.
Definition at line 187 of file EVEVisualization.cc.
void addARICHHit | ( | const ARICHHit * | hit | ) |
Add recontructed hit in ARICH.
Definition at line 1773 of file EVEVisualization.cc.
void addBKLMHit2d | ( | const KLMHit2d * | bklm2dhit | ) |
Add a reconstructed 2d hit in the BKLM.
Definition at line 1495 of file EVEVisualization.cc.
void addCDCHit | ( | const CDCHit * | hit, |
bool | showTriggerHits = false |
||
) |
show CDCHits directly.
Definition at line 1614 of file EVEVisualization.cc.
void addCDCTriggerSegmentHit | ( | const std::string & | collectionName, |
const CDCTriggerSegmentHit * | hit | ||
) |
show outline of track segments.
Definition at line 1682 of file EVEVisualization.cc.
void addCDCTriggerTrack | ( | const std::string & | collectionName, |
const CDCTriggerTrack & | track | ||
) |
Add a CDCTriggerTrack.
Definition at line 347 of file EVEVisualization.cc.
void addECLCluster | ( | const ECLCluster * | cluster | ) |
Add a reconstructed cluster in the ECL.
Definition at line 1404 of file EVEVisualization.cc.
void addEKLMHit2d | ( | const KLMHit2d * | eklm2dhit | ) |
Add a reconstructed 2d hit in the EKLM.
Definition at line 1537 of file EVEVisualization.cc.
void addKLMCluster | ( | const KLMCluster * | cluster | ) |
Add a reconstructed cluster in the KLM.
Definition at line 1441 of file EVEVisualization.cc.
EVEVisualization::MCTrack * addMCParticle | ( | const MCParticle * | particle | ) |
Return MCTrack for given particle, add it if it doesn't exist yet.
If particle is NULL, a dummy MCTrack (with track=0) is created which can accept otherwise unassigned hits. Returns NULL if this particle and its hits shouldn't be shown.
Definition at line 1103 of file EVEVisualization.cc.
void addObject | ( | const TObject * | dataStoreObject, |
TEveElement * | visualRepresentation | ||
) |
Generic function to keep track of which objects have which visual representation.
Should be called by functions adding TEveElements to the event scene (Hits are currently excluded).
Definition at line 1907 of file EVEVisualization.cc.
|
private |
specialisation for CDCHit.
Definition at line 1603 of file EVEVisualization.cc.
|
inlineprivate |
adds given VXD hit to lines.
Definition at line 290 of file EVEVisualization.h.
|
private |
specialisation for SVDCluster
Definition at line 1583 of file EVEVisualization.cc.
void addROI | ( | const ROIid * | roi | ) |
Add a Region Of Interest, computed by the PXDDataReduction module.
Definition at line 1552 of file EVEVisualization.cc.
void addSimHit | ( | const CDCSimHit * | hit, |
const MCParticle * | particle | ||
) |
Add a CDCSimHit.
Definition at line 1074 of file EVEVisualization.cc.
void addSimHit | ( | const KLMSimHit * | hit, |
const MCParticle * | particle | ||
) |
Add a KLMSimHit.
Definition at line 1090 of file EVEVisualization.cc.
void addSimHit | ( | const PXDSimHit * | hit, |
const MCParticle * | particle | ||
) |
Add a PXDSimHit.
Definition at line 1078 of file EVEVisualization.cc.
void addSimHit | ( | const ROOT::Math::XYZVector & | v, |
const MCParticle * | particle | ||
) |
Add simhit as a simple point.
Definition at line 1095 of file EVEVisualization.cc.
void addSimHit | ( | const SVDSimHit * | hit, |
const MCParticle * | particle | ||
) |
Add a SVDSimHit.
Definition at line 1084 of file EVEVisualization.cc.
|
inline |
Add all entries in the given 'hits' array (and the corresponding MCParticles) to the event scene.
Definition at line 136 of file EVEVisualization.h.
|
private |
Add 'elem' to the element group 'name' (created if necessary).
name can also be a path, e.g. MyOwnStuff/SpecialObject A, which will automatically create sub-groups.
slashes at beginning and end of name are ignored.
Definition at line 1912 of file EVEVisualization.cc.
void addTOPDigits | ( | const StoreArray< TOPDigit > & | digits | ) |
Add TOPDigits (shown aggregated per module).
Definition at line 1799 of file EVEVisualization.cc.
void addTrack | ( | const Belle2::Track * | belle2Track | ) |
Add this genfit::Track to event data.
Adapted from GenfitDisplay, originally written by Karl Bicker.
Definition at line 385 of file EVEVisualization.cc.
void addTrackCandidate | ( | const std::string & | collectionName, |
const RecoTrack & | recoTrack | ||
) |
Add a RecoTrack, to evaluate track finding.
Definition at line 203 of file EVEVisualization.cc.
void addTrackCandidateImproved | ( | const std::string & | collectionName, |
const RecoTrack & | recoTrack | ||
) |
Add a RecoTrack, but use stored genfit track representation to make visualisation objects.
FIXME this is mostly just a workaround for monopoles.
Definition at line 262 of file EVEVisualization.cc.
|
inline |
After adding recohits for tracks/candidates, this function adds the remaining hits in a global collection.
Definition at line 191 of file EVEVisualization.h.
void addVertex | ( | const genfit::GFRaveVertex * | vertex | ) |
Add a vertex point and its covariance matrix.
Definition at line 1352 of file EVEVisualization.cc.
|
private |
Create a box around o, oriented along u and v with widths ud, vd and depth and return a pointer to the box object.
Definition at line 850 of file EVEVisualization.cc.
void clearEvent | ( | ) |
clear event data.
Definition at line 1309 of file EVEVisualization.cc.
|
private |
Create hit visualisation for the given options, and add them to 'eveTrack'.
Definition at line 890 of file EVEVisualization.cc.
void makeTracks | ( | ) |
Create visual representation of all tracks.
Needs to be called after all hits / tracks are added.
Definition at line 1250 of file EVEVisualization.cc.
|
inline |
If true, hits created by secondary particles (e.g.
delta electrons) will be assigned to the original primary particle.
Definition at line 268 of file EVEVisualization.h.
void setErrScale | ( | double | errScale = 1. | ) |
Set the scaling factor for the visualization of track hit errors.
(only affects PXD and SpacePoint hits, which are somewhat small
Definition at line 185 of file EVEVisualization.cc.
|
inline |
If true, secondary MCParticles (and hits created by them) will not be shown.
Definition at line 271 of file EVEVisualization.h.
void setOptions | ( | const std::string & | opts | ) |
Set the display options.
The option string lets you steer the way the events are displayed. The following options are available:
'D': Draw detectors. This causes a simple representation for all detectors to be drawn. For planar detectors, this is a plane with the same position and orientation of the real detector plane, but with different size. For wires, this is a tube whose diameter is equal to the value measured by the wire. Spacepoint hits are not affected by this option.
'H': Draw hits. This causes the hits to be visualized. Normally, the size of the hit representation is connected to the covariance matrix of the hit, scaled by the value set in setErrScale which is normally 1. Normally used in connection with 'D'.
'M': Draw track markers. Draw the intersection points between the track and the virtual (and/or real) detector planes. 'P': Draw detector planes. Draws the virtual (and/or real) detector planes.
Definition at line 183 of file EVEVisualization.cc.
void showUserData | ( | const DisplayData & | displayData | ) |
Add user-defined data (labels, points, etc.)
Definition at line 1844 of file EVEVisualization.cc.
|
staticprivate |
Color for KLMCluster objects.
Definition at line 100 of file EVEVisualization.h.
|
staticconstexprprivate |
don't show MCParticles with momentum below this cutoff.
Definition at line 364 of file EVEVisualization.h.
|
staticprivate |
Color for reco hits.
Definition at line 90 of file EVEVisualization.h.
|
staticprivate |
Color for TrackCandidates.
Definition at line 92 of file EVEVisualization.h.
|
staticprivate |
Color for tracks.
Definition at line 94 of file EVEVisualization.h.
|
staticprivate |
Color for track markers.
Definition at line 96 of file EVEVisualization.h.
|
staticprivate |
Color for unassigned (reco)hits.
Definition at line 98 of file EVEVisualization.h.
|
private |
If true, hits created by secondary particles (e.g.
delta electrons) will be assigned to the original primary particle.
Definition at line 326 of file EVEVisualization.h.
|
private |
The global magnetic field.
Definition at line 353 of file EVEVisualization.h.
|
private |
Object for the energy bar visualisation.
Definition at line 276 of file EVEVisualization.h.
|
private |
Track propagator for CDCTriggerTracks (uses constant B field)
Definition at line 347 of file EVEVisualization.h.
|
private |
draw backward in addTrack
Definition at line 379 of file EVEVisualization.h.
|
private |
Draw cardinal representation in addTrack.
Definition at line 367 of file EVEVisualization.h.
|
private |
Draw errors in addTrack.
Definition at line 370 of file EVEVisualization.h.
|
private |
draw forward in addTrack
Definition at line 376 of file EVEVisualization.h.
|
private |
Draw reference track in addTrack.
Definition at line 373 of file EVEVisualization.h.
|
private |
ECL cluster data.
Definition at line 350 of file EVEVisualization.h.
|
private |
Rescale PXD/SVD errors with this factor to ensure visibility.
Definition at line 317 of file EVEVisualization.h.
|
private |
Track propagator for genfit::Tracks (different mainly because of drawing options)
Definition at line 344 of file EVEVisualization.h.
|
private |
name -> grouping element.
Definition at line 335 of file EVEVisualization.h.
|
private |
If true, secondary MCParticles (and hits created by them) will not be shown.
Definition at line 329 of file EVEVisualization.h.
|
private |
map MCParticles to MCTrack (so hits can be added to the correct track).
Definition at line 332 of file EVEVisualization.h.
|
private |
Option string for genfit::Track visualisation.
Definition at line 323 of file EVEVisualization.h.
|
private |
List of shown recohits (PXDCluster, SVDCluster, CDCHit).
Definition at line 356 of file EVEVisualization.h.
|
private |
parent object for MC tracks.
Definition at line 338 of file EVEVisualization.h.
|
private |
Track propagator for MCParticles.
Definition at line 341 of file EVEVisualization.h.
|
private |
Unassigned recohits.
Definition at line 359 of file EVEVisualization.h.
|
private |
is m_unassignedRecoHits visible?
Definition at line 361 of file EVEVisualization.h.