9#include <alignment/modules/SetRecoTrackMomentum/SetRecoTrackMomentumModule.h>
11#include <framework/geometry/BFieldManager.h>
12#include <framework/geometry/B2Vector3.h>
28 setDescription(R
"DOC(Set momentum magnitude for RecoTracks seed to given value (for runs without magnetic field)
30 Take the momentum direction from seed and update its magnitude to artificial value for all RecoTracks - needed for tracks without magnetic field.
31 By default activated automatically, when zero B-field is detected at the origin
35 addParam(
"automatic",
m_automatic,
"Detect the B-field at origin automatically - disable module if non-zero",
true);
36 addParam(
"momentum",
m_momentum,
"Default momentum magnitude (GeV/c) to set for seed of RecoTracks", 10.);
56 track.setPositionAndMomentum(track.getPositionSeed(), mom);
DataType Mag() const
The magnitude (rho in spherical coordinate system).
static BFieldManager & getInstance()
Return the instance of the magnetic field manager.
void setDescription(const std::string &description)
Sets the description of the module.
virtual void initialize() override
Register input and output data.
bool m_automatic
Detect the B-field at origin automatically - disable module if non-zero.
virtual void event() override
Loop over RecoTracks and set the momentum magnitude.
double m_momentum
Default momentum magnitude (GeV/c) to set for RecoTracks.
SetRecoTrackMomentumModule()
Constructor: Sets the description, the properties and the parameters of the module.
StoreArray< RecoTrack > m_tracks
The array with RecoTracks to work with.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
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.