Belle II Software development
RadiusTrackTimeEstimatorModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/modules/fitter/timeEstimator/RadiusTrackTimeEstimatorModule.h>
9
10#include <tracking/dataobjects/RecoTrack.h>
11#include <framework/dataobjects/Helix.h>
12#include <framework/geometry/BFieldManager.h>
13
14using namespace Belle2;
15
16REG_MODULE(RadiusTrackTimeEstimator);
17
19{
20 addParam("radiusForExtrapolation", m_param_radiusForExtrapolation,
21 "Radius used for extrapolation. Please be aware that if the RecoTrack does not reach this radius, "
22 "the results are wrong.", m_param_radiusForExtrapolation);
23}
24
26 measuredStateOnPlane)
27const
28{
29 try {
30 const double s = measuredStateOnPlane.extrapolateToCylinder(m_param_radiusForExtrapolation);
31 return s;
32 } catch (const genfit::Exception& e) {
33 B2WARNING("Extrapolation failed: " << e.what());
34 return 0;
35 }
36}
37
39{
40 const ROOT::Math::XYZVector& momentum = recoTrack.getMomentumSeed();
41 const short int charge = recoTrack.getChargeSeed();
42 const ROOT::Math::XYZVector& position = recoTrack.getPositionSeed();
43
44 const double bZ = BFieldManager::getField(0, 0, 0).Z() / Unit::T;
45 const Helix h(position, momentum, charge, bZ);
46 const double arcLengthOfIntersection = h.getArcLength2DAtCylindricalR(m_param_radiusForExtrapolation);
47 const double s = arcLengthOfIntersection * hypot(1, h.getTanLambda());
48 return s;
49}
Base Module estimating the track time of RecoTracks - before or after the fit.
Helix parameter class.
Definition: Helix.h:48
double estimateFlightLengthUsingSeedInformation(const RecoTrack &recoTrack) const override
Use some helix functionality to calculate the distance to given the radius.
double estimateFlightLengthUsingFittedInformation(genfit::MeasuredStateOnPlane &measuredStateOnPlane) const override
Extrapolate the measured state on plane to the given radius.
double m_param_radiusForExtrapolation
Radius used for extrapolation. Please be aware that if the RecoTrack does not reach this radius,...
RadiusTrackTimeEstimatorModule()
Initialize the module parameters.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
ROOT::Math::XYZVector getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
Definition: RecoTrack.h:480
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
Definition: RecoTrack.h:508
ROOT::Math::XYZVector getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
Definition: RecoTrack.h:487
static const double T
[tesla]
Definition: Unit.h:120
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:91
Abstract base class for different kinds of events.