Belle II Software  release-08-01-10
TrackSelector.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 <top/reconstruction_cpp/TOPTrack.h>
12 #include <framework/gearbox/Const.h>
13 #include <string>
14 #include <Math/Vector3D.h>
15 #include <Math/Point3D.h>
16 
17 namespace Belle2 {
22  namespace TOP {
23 
27  class TrackSelector {
28 
29  public:
30 
34  enum EType {
35  c_undefined = 0,
36  c_dimuon = 1,
37  c_bhabha = 2,
38  c_cosmics = 3
39  };
40 
45  {}
46 
51  explicit TrackSelector(const std::string& sampleName);
52 
57  void setMinMomentum(double minMomentum) {m_minMomentum = minMomentum;}
58 
63  void setDeltaEcms(double deltaEcms) {m_deltaEcms = deltaEcms;}
64 
70  void setCutOnPOCA(double dr, double dz)
71  {
72  m_dr = dr;
73  m_dz = dz;
74  }
75 
81  void setCutOnLocalZ(double minZ, double maxZ)
82  {
83  m_minZ = minZ;
84  m_maxZ = maxZ;
85  }
86 
91  const std::string& getSampleName() const {return m_sampleName;}
92 
97  double getMinMomentum() const {return m_minMomentum;}
98 
103  double getDeltaEcms() const {return m_deltaEcms;}
104 
109  double getDr() const {return m_dr;}
110 
115  double getDz() const {return m_dz;}
116 
121  double getMinZ() const {return m_minZ;}
122 
127  double getMaxZ() const {return m_maxZ;}
128 
133 
138  const ROOT::Math::XYZVector& getPOCAPosition() const {return m_pocaPosition;}
139 
144  const ROOT::Math::XYZVector& getPOCAMomentum() const {return m_pocaMomentum;}
145 
150  double getCMSEnergy() const {return m_cmsEnergy;}
151 
156  const ROOT::Math::XYZPoint& getLocalPosition() const {return m_localPosition;}
157 
162  const ROOT::Math::XYZVector& getLocalMomentum() const {return m_localMomentum;}
163 
169  bool isSelected(const TOPTrack& track) const;
170 
171  private:
172 
173  EType m_sampleType = c_undefined;
174  std::string m_sampleName;
175  double m_minMomentum = 0;
176  double m_deltaEcms = 0;
177  double m_dr = 0;
178  double m_dz = 0;
179  double m_minZ = 0;
180  double m_maxZ = 0;
183  /* cache for track parameters */
184  mutable ROOT::Math::XYZVector m_pocaPosition;
185  mutable ROOT::Math::XYZVector m_pocaMomentum;
186  mutable double m_cmsEnergy = 0;
187  mutable ROOT::Math::XYZPoint m_localPosition;
188  mutable ROOT::Math::XYZVector m_localMomentum;
190  };
191 
192  } // namespace TOP
194 } // namespace Belle2
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:580
static const ChargedStable muon
muon particle
Definition: Const.h:651
Reconstructed track at TOP.
Definition: TOPTrack.h:39
Utility for the track selection - used in various calibration modules.
Definition: TrackSelector.h:27
const std::string & getSampleName() const
Returns sample name.
Definition: TrackSelector.h:91
Const::ChargedStable m_chargedStable
track hypothesis
double getCMSEnergy() const
Returns c.m.s energy of the track in last isSelected call.
EType m_sampleType
data sample (skim) type
double getMinZ() const
Returns cut on local z.
ROOT::Math::XYZVector m_pocaPosition
position of POCA
void setDeltaEcms(double deltaEcms)
Sets cut on c.m.s.
Definition: TrackSelector.h:63
const ROOT::Math::XYZVector & getPOCAPosition() const
Returns position of POCA of the track in last isSelected call.
void setMinMomentum(double minMomentum)
Sets momentum cut (used for "cosmics" only)
Definition: TrackSelector.h:57
double m_minMomentum
minimal track momentum if sample is "cosmics"
const ROOT::Math::XYZVector & getLocalMomentum() const
Returns momentum at TOP in local frame of the track in last isSelected call.
double getDeltaEcms() const
Returns c.m.s.
double m_dz
cut on POCA in z
void setCutOnPOCA(double dr, double dz)
Sets cut on point of closest approach to (0, 0, 0)
Definition: TrackSelector.h:70
ROOT::Math::XYZVector m_localMomentum
momentum at TOP in local (module) frame
double getMinMomentum() const
Returns momentum cut.
Definition: TrackSelector.h:97
std::string m_sampleName
data sample (skim) name
double m_maxZ
maximal local z of extrapolated hit
bool isSelected(const TOPTrack &track) const
Returns selection status.
const ROOT::Math::XYZPoint & getLocalPosition() const
Returns position at TOP in local frame of the track in last isSelected call.
double getMaxZ() const
Returns cut on local z.
double m_minZ
minimal local z of extrapolated hit
double m_dr
cut on POCA in r
const Const::ChargedStable & getChargedStable() const
Returns track hypothesis.
TrackSelector()
Default constructor.
Definition: TrackSelector.h:44
void setCutOnLocalZ(double minZ, double maxZ)
Sets cut on local z coordinate (module frame) of the track extrapolated to TOP.
Definition: TrackSelector.h:81
ROOT::Math::XYZPoint m_localPosition
position at TOP in local (module) frame
double m_deltaEcms
c.m.s energy window for "dimuon" or "bhabha"
const ROOT::Math::XYZVector & getPOCAMomentum() const
Returns momentum vector at POCA of the track in last isSelected call.
ROOT::Math::XYZVector m_pocaMomentum
momentum at POCA
double getDz() const
Returns POCA cut in z.
EType
enumerators for possible data sample types (skims)
Definition: TrackSelector.h:34
double getDr() const
Returns POCA cut in r.
Abstract base class for different kinds of events.