13 #include <tracking/modules/genfitUtilities/SetupGenfitExtrapolationModule.h>
14 #include <tracking/modules/genfitUtilities/Geant4MaterialInterface.h>
16 #include <geometry/GeometryManager.h>
18 #include <tracking/gfbfield/GFGeant4Field.h>
19 #include <genfit/FieldManager.h>
20 #include <genfit/MaterialEffects.h>
21 #include <genfit/TGeoMaterialInterface.h>
22 #include <genfit/IO.h>
24 #include <boost/iostreams/stream_buffer.hpp>
25 #include <boost/iostreams/concepts.hpp>
27 #include <TGeoManager.h>
36 template<
size_t T_level>
37 class genfitSink :
public boost::iostreams::sink {
40 std::streamsize write(
const char* s, std::streamsize n)
48 genfitSink<200> debugSink;
50 boost::iostreams::stream_buffer<genfitSink<200> > debugStreamBuf(debugSink);
52 genfitSink<100> errorSink;
54 boost::iostreams::stream_buffer<genfitSink<100> > errorStreamBuf(errorSink);
56 genfitSink<150> printSink;
58 boost::iostreams::stream_buffer<genfitSink<150> > printStreamBuf(printSink);
61 void setupGenfitStreams()
73 setDescription(
"Sets up material handling for genfit extrapolation. Also setups up I/O streams for"
74 " genfit in order to integrate it into basf2 logging system. Also sets up update of VXDAlignment from DB (temporary).");
78 "If true this module will silently ignore if the geometry is already "
79 "present and do nothing in that case. If false a B2FATAL will be "
84 "Which geometry should be used, either 'TGeo' or 'Geant4'",
m_geometry);
96 "activate the material effect: NoiseBrems",
m_noiseBrems);
98 "switch off all material effects in Genfit. This overwrites all "
99 "individual material effects switches",
m_noEffects);
110 B2DEBUG(29,
"Magnetic field or material handling already initialized. Not touching settings.");
113 B2FATAL(
"Magnetic field or material handling already initialized. Not touching settings.");
117 setupGenfitStreams();
123 B2FATAL(
"No geometry set up so far. Load the geometry module.");
128 B2INFO(
"Building TGeo representation.");
136 B2FATAL(
"Invalid choice of geometry interface. Please use 'TGeo' or 'Geant4'.");
141 genfit::MaterialEffects::getInstance()->setNoEffects(
true);
145 genfit::MaterialEffects::getInstance()->setNoiseCoulomb(
m_noiseCoulomb);
147 genfit::MaterialEffects::getInstance()->setNoiseBrems(
m_noiseBrems);
AbsMaterialInterface implementation for use with Geant4's navigator.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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.
Interface of the Belle II B-field with GenFit.
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...
static FieldManager * getInstance()
Get singleton instance.
void init(AbsBField *b)
set the magnetic field here. Magnetic field classes must be derived from AbsBField.
void setMscModel(const std::string &modelName)
Select the multiple scattering model that will be used during track fit.
void init(AbsMaterialInterface *matIfc)
set the material interface here. Material interface classes must be derived from AbsMaterialInterface...
AbsMaterialInterface implementation for use with ROOT's TGeoManager.
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.
std::ostream debugOut
Default stream for debug output.
std::ostream printOut
Default stream for output of Print calls.
std::ostream errorOut
Default stream for error output.