Belle II Software  release-05-02-19
CDCRecoHit.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012, 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Guofu Cao, Martin Heck, Tobias Schlüter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CDCRECOHIT_H
12 #define CDCRECOHIT_H
13 
14 #include <cdc/dataobjects/CDCHit.h>
15 #include <cdc/dataobjects/ADCCountTranslatorBase.h>
16 #include <cdc/dataobjects/CDCGeometryTranslatorBase.h>
17 #include <cdc/dataobjects/TDCCountTranslatorBase.h>
18 
19 #include <genfit/AbsMeasurement.h>
20 #include <genfit/MeasurementOnPlane.h>
21 #include <genfit/TrackCandHit.h>
22 #include <genfit/HMatrixU.h>
23 
24 #include <framework/geometry/B2Vector3.h>
25 
26 #include <memory>
27 
28 
29 namespace Belle2 {
35  class CDCRecoHit : public genfit::AbsMeasurement {
36 
37  public:
39  CDCRecoHit();
40 
43  CDCRecoHit(const CDCHit* cdcHit, const genfit::TrackCandHit* trackCandHit);
44 
46  ~CDCRecoHit() {}
47 
49  CDCRecoHit* clone() const override;
50 
52  WireID getWireID() const
53  {
54  return m_wireID;
55  }
56 
58  static void setTranslators(CDC::ADCCountTranslatorBase* const adcCountTranslator,
59  CDC::CDCGeometryTranslatorBase* const cdcGeometryTranslator,
60  CDC::TDCCountTranslatorBase* const tdcCountTranslator,
61  //temp4cosmics bool useTrackTime = false);
62  bool useTrackTime = false, bool cosmics = false);
63 
66  genfit::SharedPlanePtr constructPlane(const genfit::StateOnPlane& state) const override;
67 
70  std::vector<genfit::MeasurementOnPlane*> constructMeasurementsOnPlane(const genfit::StateOnPlane& state) const override;
71 
74  virtual const genfit::HMatrixU* constructHMatrix(const genfit::AbsTrackRep*) const override;
75 
77  std::vector<double> timeDerivativesMeasurementsOnPlane(const genfit::StateOnPlane& state) const;
78 
91  bool getFlyByDistanceVector(B2Vector3D& pointingVector, B2Vector3D& trackDir,
92  const genfit::AbsTrackRep* rep = NULL,
93  bool usePlaneFromFit = false);
94 
103  void setLeftRightResolution(int lr) { m_leftRight = lr; }
104 
106  bool isLeftRightMeasurement() const override { return true; }
107 
109  int getLeftRightResolution() const override { return m_leftRight; }
110 
111 
115  const CDCHit* getCDCHit() const
116  {
117  return m_cdcHit;
118  }
119 
120  protected:
121 #ifndef __CINT__ // rootcint doesn't know smart pointers
122 
123  static std::unique_ptr<CDC::ADCCountTranslatorBase> s_adcCountTranslator;
124 
126  static std::unique_ptr<CDC::CDCGeometryTranslatorBase> s_cdcGeometryTranslator;
127 
129  static std::unique_ptr<CDC::TDCCountTranslatorBase> s_tdcCountTranslator;
130 
134  static bool s_useTrackTime;
139  static bool s_cosmics;
140 
141 #endif
142 
144  unsigned short m_tdcCount;
145 
147  unsigned short m_adcCount;
148 
151 
153  const CDCHit* m_cdcHit;
154 
156  signed char m_leftRight;
157 
160  // Version history:
161  // ver 10: ICalibrationParametersDerivatives interface moved to derived class.
162  // ClassDef -> ClassDefOverride + consistent override keyword usage.
163  // Private members -> protected for access from derived class.
164  // ver 9: Derives from ICalibrationParametersDerivatives to expose
165  // alignment/calibration interface
166  // ver 8: Rewrite to deal with realistic translators. No longer
167  // derives from genfit::WireMeasurement.
168  };
170 }
171 #endif
Belle2::CDCRecoHit::m_cdcHit
const CDCHit * m_cdcHit
Pointer to the CDCHit used to created this CDCRecoHit.
Definition: CDCRecoHit.h:161
Belle2::CDC::TDCCountTranslatorBase
Base class for translation of Drift Time into Drift Length.
Definition: TDCCountTranslatorBase.h:36
Belle2::WireID
Class to identify a wire inside the CDC.
Definition: WireID.h:44
genfit::SharedPlanePtr
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Definition: SharedPlanePtr.h:40
Belle2::CDCRecoHit::setLeftRightResolution
void setLeftRightResolution(int lr)
select how to resolve the left/right ambiguity: -1: negative (left) side on vector (wire direction) x...
Definition: CDCRecoHit.h:111
Belle2::CDCRecoHit::getFlyByDistanceVector
bool getFlyByDistanceVector(B2Vector3D &pointingVector, B2Vector3D &trackDir, const genfit::AbsTrackRep *rep=NULL, 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:370
Belle2::CDCHit
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:51
Belle2::CDCRecoHit::m_leftRight
signed char m_leftRight
Flag showing left/right passage.
Definition: CDCRecoHit.h:164
genfit::StateOnPlane
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:47
Belle2::CDCRecoHit::m_tdcCount
unsigned short m_tdcCount
TDC Count as out of CDCHit.
Definition: CDCRecoHit.h:152
Belle2::CDCRecoHit::timeDerivativesMeasurementsOnPlane
std::vector< double > timeDerivativesMeasurementsOnPlane(const genfit::StateOnPlane &state) const
Get the time derivative of the MesuredStateOnPlane (derived from the track fit).
Definition: CDCRecoHit.cc:263
Belle2::CDCRecoHit::setTranslators
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:35
genfit::TrackCandHit
Hit object for use in TrackCand.
Definition: TrackCandHit.h:34
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
Belle2::CDCRecoHit::constructPlane
genfit::SharedPlanePtr constructPlane(const genfit::StateOnPlane &state) const override
Methods that actually interface to Genfit.
Definition: CDCRecoHit.cc:82
Belle2::CDCRecoHit::constructMeasurementsOnPlane
std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const genfit::StateOnPlane &state) const override
build MeasurementsOnPlane
Definition: CDCRecoHit.cc:142
Belle2::CDCRecoHit::constructHMatrix
virtual const genfit::HMatrixU * constructHMatrix(const genfit::AbsTrackRep *) const override
construct error matrix
Definition: CDCRecoHit.cc:253
Belle2::CDC::CDCGeometryTranslatorBase
Abstract Base class for the geometry translator.
Definition: CDCGeometryTranslatorBase.h:33
Belle2::CDCRecoHit::s_adcCountTranslator
static std::unique_ptr< CDC::ADCCountTranslatorBase > s_adcCountTranslator
Object for ADC Count translation.
Definition: CDCRecoHit.h:131
Belle2::CDCRecoHit
This class is used to transfer CDC information to the track fit.
Definition: CDCRecoHit.h:43
Belle2::CDCRecoHit::clone
CDCRecoHit * clone() const override
Creating a copy of this hit.
Definition: CDCRecoHit.cc:76
Belle2::B2Vector3< double >
Belle2::CDCRecoHit::ClassDefOverride
ClassDefOverride(CDCRecoHit, 10)
ROOT Macro.
genfit::AbsMeasurement
Contains the measurement and covariance in raw detector coordinates.
Definition: AbsMeasurement.h:42
Belle2::CDCRecoHit::m_wireID
WireID m_wireID
Wire Identifier.
Definition: CDCRecoHit.h:158
Belle2::CDCRecoHit::getWireID
WireID getWireID() const
Getter for WireID object.
Definition: CDCRecoHit.h:60
Belle2::CDCRecoHit::getLeftRightResolution
int getLeftRightResolution() const override
Getter for left/right passage flag.
Definition: CDCRecoHit.h:117
Belle2::CDCRecoHit::s_cosmics
static bool s_cosmics
Switch to use cosmic events, or physics events from IP.
Definition: CDCRecoHit.h:147
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCRecoHit::s_tdcCountTranslator
static std::unique_ptr< CDC::TDCCountTranslatorBase > s_tdcCountTranslator
Object for getting drift-length and -resolution.
Definition: CDCRecoHit.h:137
Belle2::CDCRecoHit::isLeftRightMeasurement
bool isLeftRightMeasurement() const override
CDC RecoHits always have left-right ambiguity.
Definition: CDCRecoHit.h:114
Belle2::CDCRecoHit::m_adcCount
unsigned short m_adcCount
ADC Count as out of CDCHit.
Definition: CDCRecoHit.h:155
genfit::HMatrixU
AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization.
Definition: HMatrixU.h:37
Belle2::CDCRecoHit::getCDCHit
const CDCHit * getCDCHit() const
get the pointer to the CDCHit object that was used to create this CDCRecoHit object.
Definition: CDCRecoHit.h:123
Belle2::CDCRecoHit::s_cdcGeometryTranslator
static std::unique_ptr< CDC::CDCGeometryTranslatorBase > s_cdcGeometryTranslator
Object for geometry translation.
Definition: CDCRecoHit.h:134
Belle2::CDC::ADCCountTranslatorBase
Abstract Base class for the ADC count translator.
Definition: ADCCountTranslatorBase.h:33
Belle2::CDCRecoHit::CDCRecoHit
CDCRecoHit()
Default Constructor for ROOT IO.
Definition: CDCRecoHit.cc:49
Belle2::CDCRecoHit::~CDCRecoHit
~CDCRecoHit()
Destructor.
Definition: CDCRecoHit.h:54
Belle2::CDCRecoHit::s_useTrackTime
static bool s_useTrackTime
Whether to use the track time or not when building the measurementOnPlane.
Definition: CDCRecoHit.h:142