 |
Belle II Software
release-05-02-19
|
15 #include <tracking/modules/genfitUtilities/SetupGenfitExtrapolationModule.h>
16 #include <tracking/modules/genfitUtilities/Geant4MaterialInterface.h>
18 #include <geometry/GeometryManager.h>
20 #include <tracking/gfbfield/GFGeant4Field.h>
21 #include <genfit/FieldManager.h>
22 #include <genfit/MaterialEffects.h>
23 #include <genfit/TGeoMaterialInterface.h>
24 #include <genfit/IO.h>
26 #include <boost/iostreams/stream_buffer.hpp>
27 #include <boost/iostreams/concepts.hpp>
29 #include <TGeoManager.h>
38 template<
size_t T_level>
39 class genfitSink :
public boost::iostreams::sink {
42 std::streamsize write(
const char* s, std::streamsize n)
50 genfitSink<200> debugSink;
52 boost::iostreams::stream_buffer<genfitSink<200> > debugStreamBuf(debugSink);
54 genfitSink<100> errorSink;
56 boost::iostreams::stream_buffer<genfitSink<100> > errorStreamBuf(errorSink);
58 genfitSink<150> printSink;
60 boost::iostreams::stream_buffer<genfitSink<150> > printStreamBuf(printSink);
63 void setupGenfitStreams()
75 setDescription(
"Sets up material handling for genfit extrapolation. Also setups up I/O streams for"
76 " genfit in order to integrate it into basf2 logging system. Also sets up update of VXDAlignment from DB (temporary).");
80 "If true this module will silently ignore if the geometry is already "
81 "present and do nothing in that case. If false a B2FATAL will be "
86 "Which geometry should be used, either 'TGeo' or 'Geant4'",
m_geometry);
98 "activate the material effect: NoiseBrems",
m_noiseBrems);
100 "switch off all material effects in Genfit. This overwrites all "
101 "individual material effects switches",
m_noEffects);
112 B2DEBUG(50,
"Magnetic field or material handling already initialized. Not touching settings.");
115 B2FATAL(
"Magnetic field or material handling already initialized. Not touching settings.");
119 setupGenfitStreams();
125 B2FATAL(
"No geometry set up so far. Load the geometry module.");
130 B2INFO(
"Building TGeo representation.");
138 B2FATAL(
"Invalid choice of geometry interface. Please use 'TGeo' or 'Geant4'.");
143 genfit::MaterialEffects::getInstance()->setNoEffects(
true);
147 genfit::MaterialEffects::getInstance()->setNoiseCoulomb(
m_noiseCoulomb);
149 genfit::MaterialEffects::getInstance()->setNoiseBrems(
m_noiseBrems);
void init(AbsMaterialInterface *matIfc)
set the material interface here. Material interface classes must be derived from AbsMaterialInterface...
std::ostream errorOut
Default stream for error output.
AbsMaterialInterface implementation for use with ROOT's TGeoManager.
void setDescription(const std::string &description)
Sets the description of the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
std::ostream printOut
Default stream for output of Print calls.
static GeometryManager & getInstance()
Return a reference to the instance.
void createTGeoRepresentation()
Create a TGeo representation of the native geometry description.
Class to manage the creation and conversion of the geometry.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void init(AbsBField *b)
set the magnetic field here. Magnetic field classes must be derived from AbsBField.
AbsMaterialInterface implementation for use with Geant4's navigator.
Abstract base class for different kinds of events.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
static FieldManager * getInstance()
Get singleton instance.
void useCache(bool opt=true, unsigned int nBuckets=8)
Cache last lookup positions, and use stored field values if a lookup at (almost) the same position is...
Interface of the Belle II B-field with GenFit.
void setMscModel(const std::string &modelName)
Select the multiple scattering model that will be used during track fit.
std::ostream debugOut
Default stream for debug output.