9 #include "tracking/modules/genfitVisModule/GenfitVisModule.h"
11 #include <framework/datastore/StoreArray.h>
13 #include <geometry/GeometryManager.h>
14 #include <genfit/Track.h>
15 #include <genfit/FieldManager.h>
16 #include <genfit/MaterialEffects.h>
18 #include <TGeoManager.h>
34 setDescription(
"Visualize genfit::Tracks using the genfit::EventDisplay.");
43 if (!genfit::MaterialEffects::getInstance()->isInitialized())
44 B2FATAL(
"No material effects setup. Please use SetupGenfitExtrapolationModule.");
46 if (gGeoManager ==
nullptr) {
47 B2INFO(
"Setting up TGeo geometry for visualization.");
52 B2FATAL(
"Couldn't create TGeo geometry.");
55 B2FATAL(
"Magnetic field not set up. Please use SetupGenfitExtrapolationModule.");
58 m_display = genfit::EventDisplay::getInstance();
64 std::vector<const genfit::Track*> tracks;
67 for (
int iTrack = 0; iTrack < nTracks; ++iTrack) {
77 if (tracks.size() > 0)
bool m_onlyBadTracks
if true, tracks which have been fitted and the fit converged will no be shown
void initialize() override
Initialize the EventDisplay.
void event() override
Add genfit::Tracks to display.
void endRun() override
Open display.
void terminate() override
Close display.
GenfitVisModule()
Constructor: Sets the description, the properties and the parameters of the module.
genfit::EventDisplay * m_display
pointer to the genfit::EventDisplay which gets created in initialize()
void setDescription(const std::string &description)
Sets the description of the module.
int getEntries() const
Get the number of objects in the array.
Class to manage the creation and conversion of the geometry.
static GeometryManager & getInstance()
Return a reference to the instance.
void createTGeoRepresentation()
Create a TGeo representation of the native geometry description.
void open()
Open the event display.
void addEvent(std::vector< genfit::Track * > &tracks)
Add new event.
static FieldManager * getInstance()
Get singleton instance.
bool isFitConverged(bool inAllPoints=true) const
Did the fit converge (in all Points or only partially)?
bool isFitted() const
Has the track been fitted?
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
FitStatus * getFitStatus(const AbsTrackRep *rep=nullptr) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Abstract base class for different kinds of events.