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.");
54 if (!genfit::FieldManager::getInstance()->isInitialized()) {
55 B2FATAL(
"Magnetic field not set up. Please use SetupGenfitExtrapolationModule.");
58 m_display = genfit::EventDisplay::getInstance();
63 StoreArray < genfit::Track > gfTracks(
"GF2Tracks");
64 std::vector<const genfit::Track*> tracks;
67 for (
int iTrack = 0; iTrack < nTracks; ++iTrack) {
68 const genfit::Track* tr = gfTracks[iTrack];
70 tr->getFitStatus()->isFitted() &&
71 tr->getFitStatus()->isFitConverged())
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 addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.