Belle II Software  release-05-02-19
RadiusTrackTimeEstimatorModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/modules/fitter/timeEstimator/RadiusTrackTimeEstimatorModule.h>
11 
12 #include <tracking/dataobjects/RecoTrack.h>
13 #include <framework/dataobjects/Helix.h>
14 #include <framework/geometry/BFieldManager.h>
15 
16 using namespace std;
17 using namespace Belle2;
18 
19 REG_MODULE(RadiusTrackTimeEstimator)
20 
22 {
23  addParam("radiusForExtrapolation", m_param_radiusForExtrapolation,
24  "Radius used for extrapolation. Please be aware that if the RecoTrack does not reach this radius, "
25  "the results are wrong.", m_param_radiusForExtrapolation);
26 }
27 
28 double RadiusTrackTimeEstimatorModule::estimateFlightLengthUsingFittedInformation(genfit::MeasuredStateOnPlane&
29  measuredStateOnPlane)
30 const
31 {
32  try {
33  const double s = measuredStateOnPlane.extrapolateToCylinder(m_param_radiusForExtrapolation);
34  return s;
35  } catch (const genfit::Exception& e) {
36  B2WARNING("Extrapolation failed: " << e.what());
37  return 0;
38  }
39 }
40 
41 double RadiusTrackTimeEstimatorModule::estimateFlightLengthUsingSeedInformation(const RecoTrack& recoTrack) const
42 {
43  const TVector3& momentum = recoTrack.getMomentumSeed();
44  const short int charge = recoTrack.getChargeSeed();
45  const TVector3& position = recoTrack.getPositionSeed();
46 
47  const double bZ = BFieldManager::getField(0, 0, 0).Z() / Unit::T;
48  const Helix h(position, momentum, charge, bZ);
49  const double arcLengthOfIntersection = h.getArcLength2DAtCylindricalR(m_param_radiusForExtrapolation);
50  const double s = arcLengthOfIntersection * hypot(1, h.getTanLambda());
51  return s;
52 }
genfit::Exception
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition: Exception.h:48
genfit::MeasuredStateOnPlane
#StateOnPlane with additional covariance matrix.
Definition: MeasuredStateOnPlane.h:39
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::RecoTrack::getPositionSeed
TVector3 getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
Definition: RecoTrack.h:477
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDC::Helix
Helix parameter class.
Definition: Helix.h:51
Belle2::RecoTrack::getMomentumSeed
TVector3 getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
Definition: RecoTrack.h:484
Belle2::RecoTrack::getChargeSeed
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
Definition: RecoTrack.h:497
Belle2::BaseTrackTimeEstimatorModule
Base Module estimating the track time of RecoTracks - before or after the fit.
Definition: BaseTrackTimeEstimatorModule.h:30
Belle2::RadiusTrackTimeEstimatorModule
Module estimating the track time of RecoTracks - before or after the fit.
Definition: RadiusTrackTimeEstimatorModule.h:33