Event display designed to run with Genfit. More...
#include <GenfitDisplay.h>
Public Member Functions | |
~GenfitDisplay () | |
void | reset () |
Drop all events. | |
void | addEvent (std::vector< GFTrack * > &tr) |
Add new event. | |
void | next (unsigned int stp=1) |
Go to the next event or step a certain number of events ahead. | |
void | prev (unsigned int stp=1) |
Go to the previous event or step a certain number of events back. | |
void | gotoEvent (unsigned int id) |
Go to event with index id. | |
int | getNEvents () |
Get the total number of events stored. | |
void | setOptions (std::string opts="ADHT") |
Set the display options. | |
void | setErrScale (double errScale=1.) |
Set the scaling factor for the visualization of the errors. | |
double | getErrScale () |
Get the error scaling factor. | |
void | open () |
Open the event display. | |
void | addHits (std::vector< std::vector< double > > hits) |
Add a vector of space point hits. | |
Static Public Member Functions | |
static GenfitDisplay * | getInstance () |
Private Member Functions | |
GenfitDisplay () | |
void | makeGui () |
Build the buttons for event navigation. | |
void | drawEvent (unsigned int id) |
Draw an event. | |
TEveBox * | boxCreator (TVector3 o, TVector3 u, TVector3 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. | |
Private Attributes | |
int | fEventId |
double | fErrorScale |
std::string | fOption |
std::vector< std::vector < GFTrack * > * > | fEvents |
std::vector< std::vector < std::vector< double > > > | fHits |
Static Private Attributes | |
static GenfitDisplay * | eventDisplay = NULL |
Event display designed to run with Genfit.
The GenfitDisplay class is a singelton used to visualize the events processed with Genfit. The event display uses the EVE event visualization package to visualize Tracks which are bundeled in a vector and which form one event. The information about the tracks is supplied in GFTrack objects. To use the event display, the geometry (TGeoManager)and magnetic field (GFFieldManager) have to be initialized and gApplication and gEve have to exist.
Definition at line 45 of file GenfitDisplay.h.
GenfitDisplay::GenfitDisplay | ( | ) | [private] |
Definition at line 47 of file GenfitDisplay.cxx.
References fEventId, setErrScale(), and setOptions().
Referenced by getInstance().
GenfitDisplay::~GenfitDisplay | ( | ) |
Definition at line 81 of file GenfitDisplay.cxx.
References reset().
void GenfitDisplay::addEvent | ( | std::vector< GFTrack * > & | tr | ) |
Add new event.
Add a new event. An event is a collection of GFTracks which are displayed at the the same time.
Definition at line 100 of file GenfitDisplay.cxx.
References fEvents.
void GenfitDisplay::addHits | ( | std::vector< std::vector< double > > | hits | ) |
Add a vector of space point hits.
The format is (x, y, z, simga_x, sigma_y, sigma_z). Use addHits at the same time like addEvent, because Hits and Events must have the same size.
Definition at line 650 of file GenfitDisplay.cxx.
References fHits.
TEveBox * GenfitDisplay::boxCreator | ( | TVector3 | o, | |
TVector3 | u, | |||
TVector3 | v, | |||
float | ud, | |||
float | vd, | |||
float | depth | |||
) | [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 657 of file GenfitDisplay.cxx.
Referenced by drawEvent().
void GenfitDisplay::drawEvent | ( | unsigned int | id | ) | [private] |
Draw an event.
Definition at line 199 of file GenfitDisplay.cxx.
References boxCreator(), fErrorScale, fEvents, fHits, fOption, GFTools::getBiasedSmoothedData(), GFTrack::getCardinalRep(), GFTrack::getCardinalRepID(), GFAbsRecoHit::getDetPlane(), GFTrack::getHit(), GFAbsRecoHit::getMeasurement(), GFTrack::getNumHits(), GFDetPlane::getO(), GFAbsRecoHit::getRawHitCov(), GFTrack::getSmoothing(), GFDetPlane::getU(), GFDetPlane::getV(), GFException::isFatal(), and GFException::what().
Referenced by gotoEvent(), and open().
double GenfitDisplay::getErrScale | ( | ) |
Get the error scaling factor.
Definition at line 70 of file GenfitDisplay.cxx.
References fErrorScale.
GenfitDisplay * GenfitDisplay::getInstance | ( | ) | [static] |
Definition at line 72 of file GenfitDisplay.cxx.
References eventDisplay, and GenfitDisplay().
Referenced by makeGui().
int GenfitDisplay::getNEvents | ( | ) |
Get the total number of events stored.
Definition at line 131 of file GenfitDisplay.cxx.
References fEvents.
Referenced by open().
void GenfitDisplay::gotoEvent | ( | unsigned int | id | ) |
Go to event with index id.
Definition at line 133 of file GenfitDisplay.cxx.
References drawEvent(), fErrorScale, fEventId, and fEvents.
void GenfitDisplay::makeGui | ( | ) | [private] |
Build the buttons for event navigation.
Definition at line 699 of file GenfitDisplay.cxx.
References getInstance().
Referenced by open().
void GenfitDisplay::next | ( | unsigned int | stp = 1 |
) |
Go to the next event or step a certain number of events ahead.
Definition at line 114 of file GenfitDisplay.cxx.
References fEventId, and gotoEvent().
void GenfitDisplay::open | ( | ) |
Open the event display.
Definition at line 155 of file GenfitDisplay.cxx.
References drawEvent(), fErrorScale, fOption, getNEvents(), gotoEvent(), and makeGui().
void GenfitDisplay::prev | ( | unsigned int | stp = 1 |
) |
Go to the previous event or step a certain number of events back.
Definition at line 120 of file GenfitDisplay.cxx.
References fEventId, fEvents, and gotoEvent().
void GenfitDisplay::reset | ( | ) |
Drop all events.
Definition at line 83 of file GenfitDisplay.cxx.
References fEvents, and fHits.
Referenced by ~GenfitDisplay().
void GenfitDisplay::setErrScale | ( | double | errScale = 1. |
) |
Set the scaling factor for the visualization of the errors.
Definition at line 68 of file GenfitDisplay.cxx.
References fErrorScale.
Referenced by GenfitDisplay().
void GenfitDisplay::setOptions | ( | std::string | opts = "ADHT" |
) |
Set the display options.
The option string lets you steer the way the events are displayed. The following options are available:
'A': Autoscale errors. The representation of hits are scaled with the error found their covariance matrix. This can lead to hits not being displayed beause the errors are too small. Autoscaling ensures that the errors are scaled up sufficiently to ensure all hits are displayed. However, this can lead to unwanted results if there are only a few hits with very small errors, as all hits are scaled by the same factor to ensure consistency.
'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. See also option 'A' and 'S'. Normally used in connection with 'D'.
'R': Draw Hits added via the function addHits. Then option 'H' shouldn't be used, otherwise the hits belonging to a track will be plotted twice. This feature is in a beta stage.
'G': Draw geometry. Draw also the geometry in the gGeoManager. This feature is experimental and may lead to strang things being drawn.
'M': Draw track markers. Draw the intersection points between the track and the virtual (and/or real) detector planes. Can only be used in connection with 'T'.
'P': Draw detector planes. Draws the virtual (and/or real) detector planes.
'S': Scale manually. This leads to the spacepoint hits (and only them up to now!) being drawn as spheres with radius 0.5 scaled with the error scale factor. Can be used if the scaling with errors leads to problems.
'T': Draw Track. Draw the track as straight lines between the virtual (and/or real) detector planes.
'X': Draw silent. Does not run the TApplication.
Definition at line 66 of file GenfitDisplay.cxx.
References fOption.
Referenced by GenfitDisplay().
GenfitDisplay * GenfitDisplay::eventDisplay = NULL [static, private] |
Definition at line 132 of file GenfitDisplay.h.
Referenced by getInstance().
double GenfitDisplay::fErrorScale [private] |
Definition at line 134 of file GenfitDisplay.h.
Referenced by drawEvent(), getErrScale(), gotoEvent(), open(), and setErrScale().
int GenfitDisplay::fEventId [private] |
Definition at line 133 of file GenfitDisplay.h.
Referenced by GenfitDisplay(), gotoEvent(), next(), and prev().
std::vector< std::vector<GFTrack*>* > GenfitDisplay::fEvents [private] |
Definition at line 136 of file GenfitDisplay.h.
Referenced by addEvent(), drawEvent(), getNEvents(), gotoEvent(), prev(), and reset().
std::vector< std::vector< std::vector<double> > > GenfitDisplay::fHits [private] |
Definition at line 137 of file GenfitDisplay.h.
Referenced by addHits(), drawEvent(), and reset().
std::string GenfitDisplay::fOption [private] |
Definition at line 135 of file GenfitDisplay.h.
Referenced by drawEvent(), open(), and setOptions().