Belle II Software  release-08-01-10
CDCRecoHit.h
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 
9 #pragma once
10 
11 #include <cdc/dataobjects/CDCHit.h>
12 #include <cdc/translators/ADCCountTranslatorBase.h>
13 #include <cdc/translators/CDCGeometryTranslatorBase.h>
14 #include <cdc/translators/TDCCountTranslatorBase.h>
15 
16 #include <genfit/AbsMeasurement.h>
17 #include <genfit/MeasurementOnPlane.h>
18 #include <genfit/TrackCandHit.h>
19 #include <genfit/HMatrixU.h>
20 
21 #include <framework/geometry/B2Vector3.h>
22 
23 #include <memory>
24 
25 
26 namespace Belle2 {
33 
34  public:
36  CDCRecoHit();
37 
40  CDCRecoHit(const CDCHit* cdcHit, const genfit::TrackCandHit* trackCandHit);
41 
44 
46  CDCRecoHit* clone() const override;
47 
49  WireID getWireID() const
50  {
51  return m_wireID;
52  }
53 
55  static void setTranslators(CDC::ADCCountTranslatorBase* const adcCountTranslator,
56  CDC::CDCGeometryTranslatorBase* const cdcGeometryTranslator,
57  CDC::TDCCountTranslatorBase* const tdcCountTranslator,
58  //temp4cosmics bool useTrackTime = false);
59  bool useTrackTime = false, bool cosmics = false);
60 
63  genfit::SharedPlanePtr constructPlane(const genfit::StateOnPlane& state) const override;
64 
67  std::vector<genfit::MeasurementOnPlane*> constructMeasurementsOnPlane(const genfit::StateOnPlane& state) const override;
68 
71  virtual const genfit::HMatrixU* constructHMatrix(const genfit::AbsTrackRep*) const override;
72 
74  std::vector<double> timeDerivativesMeasurementsOnPlane(const genfit::StateOnPlane& state) const;
75 
88  bool getFlyByDistanceVector(B2Vector3D& pointingVector, B2Vector3D& trackDir,
89  const genfit::AbsTrackRep* rep = nullptr,
90  bool usePlaneFromFit = false);
91 
100  void setLeftRightResolution(int lr) { m_leftRight = lr; }
101 
103  bool isLeftRightMeasurement() const override { return true; }
104 
106  int getLeftRightResolution() const override { return m_leftRight; }
107 
108 
112  const CDCHit* getCDCHit() const
113  {
114  return m_cdcHit;
115  }
116 
117  protected:
118 #ifndef __CINT__ // rootcint doesn't know smart pointers
120  static std::unique_ptr<CDC::ADCCountTranslatorBase> s_adcCountTranslator;
121 
123  static std::unique_ptr<CDC::CDCGeometryTranslatorBase> s_cdcGeometryTranslator;
124 
126  static std::unique_ptr<CDC::TDCCountTranslatorBase> s_tdcCountTranslator;
127 
131  static bool s_useTrackTime;
136  static bool s_cosmics;
137 
138 #endif
139 
141  unsigned short m_tdcCount;
142 
144  unsigned short m_adcCount;
145 
148 
150  const CDCHit* m_cdcHit;
151 
153  signed char m_leftRight;
154 
157  // Version history:
158  // ver 10: ICalibrationParametersDerivatives interface moved to derived class.
159  // ClassDef -> ClassDefOverride + consistent override keyword usage.
160  // Private members -> protected for access from derived class.
161  // ver 9: Derives from ICalibrationParametersDerivatives to expose
162  // alignment/calibration interface
163  // ver 8: Rewrite to deal with realistic translators. No longer
164  // derives from genfit::WireMeasurement.
165  };
167 }
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
This class is used to transfer CDC information to the track fit.
Definition: CDCRecoHit.h:32
signed char m_leftRight
Flag showing left/right passage.
Definition: CDCRecoHit.h:153
const CDCHit * m_cdcHit
Pointer to the CDCHit used to created this CDCRecoHit.
Definition: CDCRecoHit.h:150
std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const genfit::StateOnPlane &state) const override
build MeasurementsOnPlane
Definition: CDCRecoHit.cc:140
static void setTranslators(CDC::ADCCountTranslatorBase *const adcCountTranslator, CDC::CDCGeometryTranslatorBase *const cdcGeometryTranslator, CDC::TDCCountTranslatorBase *const tdcCountTranslator, bool useTrackTime=false, bool cosmics=false)
Setter for the Translators.
Definition: CDCRecoHit.cc:33
unsigned short m_tdcCount
TDC Count as out of CDCHit.
Definition: CDCRecoHit.h:141
bool isLeftRightMeasurement() const override
CDC RecoHits always have left-right ambiguity.
Definition: CDCRecoHit.h:103
const CDCHit * getCDCHit() const
get the pointer to the CDCHit object that was used to create this CDCRecoHit object.
Definition: CDCRecoHit.h:112
WireID getWireID() const
Getter for WireID object.
Definition: CDCRecoHit.h:49
static bool s_cosmics
Switch to use cosmic events, or physics events from IP.
Definition: CDCRecoHit.h:136
unsigned short m_adcCount
ADC Count as out of CDCHit.
Definition: CDCRecoHit.h:144
static bool s_useTrackTime
Whether to use the track time or not when building the measurementOnPlane.
Definition: CDCRecoHit.h:131
bool getFlyByDistanceVector(B2Vector3D &pointingVector, B2Vector3D &trackDir, const genfit::AbsTrackRep *rep=nullptr, bool usePlaneFromFit=false)
Get the vector pointing from the wire to the fitted trajectory as well as the direction of the track ...
Definition: CDCRecoHit.cc:368
~CDCRecoHit()
Destructor.
Definition: CDCRecoHit.h:43
static std::unique_ptr< CDC::TDCCountTranslatorBase > s_tdcCountTranslator
Object for getting drift-length and -resolution.
Definition: CDCRecoHit.h:126
std::vector< double > timeDerivativesMeasurementsOnPlane(const genfit::StateOnPlane &state) const
Get the time derivative of the MesuredStateOnPlane (derived from the track fit).
Definition: CDCRecoHit.cc:261
virtual const genfit::HMatrixU * constructHMatrix(const genfit::AbsTrackRep *) const override
construct error matrix
Definition: CDCRecoHit.cc:251
WireID m_wireID
Wire Identifier.
Definition: CDCRecoHit.h:147
genfit::SharedPlanePtr constructPlane(const genfit::StateOnPlane &state) const override
Methods that actually interface to Genfit.
Definition: CDCRecoHit.cc:80
void setLeftRightResolution(int lr)
select how to resolve the left/right ambiguity: -1: negative (left) side on vector (wire direction) x...
Definition: CDCRecoHit.h:100
CDCRecoHit()
Default Constructor for ROOT IO.
Definition: CDCRecoHit.cc:47
ClassDefOverride(CDCRecoHit, 10)
ROOT Macro.
int getLeftRightResolution() const override
Getter for left/right passage flag.
Definition: CDCRecoHit.h:106
CDCRecoHit * clone() const override
Creating a copy of this hit.
Definition: CDCRecoHit.cc:74
static std::unique_ptr< CDC::CDCGeometryTranslatorBase > s_cdcGeometryTranslator
Object for geometry translation.
Definition: CDCRecoHit.h:123
Abstract Base class for the ADC count translator.
Abstract Base class for the geometry translator.
Base class for translation of Drift Time into Drift Length.
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization.
Definition: HMatrixU.h:37
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:47
Hit object for use in TrackCand.
Definition: TrackCandHit.h:34
Abstract base class for different kinds of events.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.