Belle II Software  release-06-01-15
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 
14 using namespace std;
15 using namespace Belle2;
16 
17 REG_MODULE(RadiusTrackTimeEstimator)
18 
20 {
21  addParam("radiusForExtrapolation", m_param_radiusForExtrapolation,
22  "Radius used for extrapolation. Please be aware that if the RecoTrack does not reach this radius, "
23  "the results are wrong.", m_param_radiusForExtrapolation);
24 }
25 
26 double RadiusTrackTimeEstimatorModule::estimateFlightLengthUsingFittedInformation(genfit::MeasuredStateOnPlane&
27  measuredStateOnPlane)
28 const
29 {
30  try {
31  const double s = measuredStateOnPlane.extrapolateToCylinder(m_param_radiusForExtrapolation);
32  return s;
33  } catch (const genfit::Exception& e) {
34  B2WARNING("Extrapolation failed: " << e.what());
35  return 0;
36  }
37 }
38 
39 double RadiusTrackTimeEstimatorModule::estimateFlightLengthUsingSeedInformation(const RecoTrack& recoTrack) const
40 {
41  const TVector3& momentum = recoTrack.getMomentumSeed();
42  const short int charge = recoTrack.getChargeSeed();
43  const TVector3& position = recoTrack.getPositionSeed();
44 
45  const double bZ = BFieldManager::getField(0, 0, 0).Z() / Unit::T;
46  const Helix h(position, momentum, charge, bZ);
47  const double arcLengthOfIntersection = h.getArcLength2DAtCylindricalR(m_param_radiusForExtrapolation);
48  const double s = arcLengthOfIntersection * hypot(1, h.getTanLambda());
49  return s;
50 }
Base Module estimating the track time of RecoTracks - before or after the fit.
Helix parameter class.
Definition: Helix.h:48
Module estimating the track time of RecoTracks - before or after the fit.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:76
TVector3 getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
Definition: RecoTrack.h:483
TVector3 getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
Definition: RecoTrack.h:476
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
Definition: RecoTrack.h:496
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition: Exception.h:48
#StateOnPlane with additional covariance matrix.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.