 |
Belle II Software
release-05-02-19
|
11 #include "tracking/modules/genfitVisModule/GenfitVisModule.h"
13 #include <framework/datastore/StoreArray.h>
15 #include <geometry/GeometryManager.h>
16 #include <genfit/Track.h>
17 #include <genfit/FieldManager.h>
18 #include <genfit/MaterialEffects.h>
20 #include <TGeoManager.h>
36 setDescription(
"Visualize genfit::Tracks using the genfit::EventDisplay.");
39 addParam(
"onlyBadTracks", m_onlyBadTracks,
"show only unfitted and unconverged tracks",
false);
45 if (!genfit::MaterialEffects::getInstance()->isInitialized())
46 B2FATAL(
"No material effects setup. Please use SetupGenfitExtrapolationModule.");
48 if (gGeoManager == NULL) {
49 B2INFO(
"Setting up TGeo geometry for visualization.");
54 B2FATAL(
"Couldn't create TGeo geometry.");
57 B2FATAL(
"Magnetic field not set up. Please use SetupGenfitExtrapolationModule.");
60 m_display = genfit::EventDisplay::getInstance();
66 std::vector<const genfit::Track*> tracks;
69 for (
int iTrack = 0; iTrack < nTracks; ++iTrack) {
79 if (tracks.size() > 0)
void endRun() override
Open display.
void addEvent(std::vector< genfit::Track * > &tracks)
Add new event.
void event() override
Add genfit::Tracks to display.
genfit::EventDisplay * m_display
pointer to the genfit::EventDisplay which gets created in initialize()
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
FitStatus * getFitStatus(const AbsTrackRep *rep=nullptr) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
void open()
Open the event display.
static GeometryManager & getInstance()
Return a reference to the instance.
void createTGeoRepresentation()
Create a TGeo representation of the native geometry description.
bool m_onlyBadTracks
if true, tracks which have been fitted and the fit converged will no be shown
Class to manage the creation and conversion of the geometry.
void terminate() override
Close display.
Abstract base class for different kinds of events.
bool isFitConverged(bool inAllPoints=true) const
Did the fit converge (in all Points or only partially)?
Accessor to arrays stored in the data store.
static FieldManager * getInstance()
Get singleton instance.
bool isFitted() const
Has the track been fitted?
void initialize() override
Initialize the EventDisplay.
int getEntries() const
Get the number of objects in the array.
Visualize genfit::Tracks using the genfit::EventDisplay.