Belle II Software  release-06-02-00
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 <TVector3.h>
15 
16 namespace Belle2 {
21  namespace TOP {
22 
26  class TrackSelector {
27 
28  public:
29 
33  enum EType {
34  c_undefined = 0,
35  c_dimuon = 1,
36  c_bhabha = 2,
37  c_cosmics = 3
38  };
39 
44  {}
45 
50  explicit TrackSelector(const std::string& sampleName);
51 
56  void setMinMomentum(double minMomentum) {m_minMomentum = minMomentum;}
57 
62  void setDeltaEcms(double deltaEcms) {m_deltaEcms = deltaEcms;}
63 
69  void setCutOnPOCA(double dr, double dz)
70  {
71  m_dr = dr;
72  m_dz = dz;
73  }
74 
80  void setCutOnLocalZ(double minZ, double maxZ)
81  {
82  m_minZ = minZ;
83  m_maxZ = maxZ;
84  }
85 
90  const std::string& getSampleName() const {return m_sampleName;}
91 
96  double getMinMomentum() const {return m_minMomentum;}
97 
102  double getDeltaEcms() const {return m_deltaEcms;}
103 
108  double getDr() const {return m_dr;}
109 
114  double getDz() const {return m_dz;}
115 
120  double getMinZ() const {return m_minZ;}
121 
126  double getMaxZ() const {return m_maxZ;}
127 
132 
137  const TVector3& getPOCAPosition() const {return m_pocaPosition;}
138 
143  const TVector3& getPOCAMomentum() const {return m_pocaMomentum;}
144 
149  double getCMSEnergy() const {return m_cmsEnergy;}
150 
155  const TVector3& getLocalPosition() const {return m_localPosition;}
156 
161  const TVector3& getLocalMomentum() const {return m_localMomentum;}
162 
168  bool isSelected(const TOPTrack& track) const;
169 
170  private:
171 
172  EType m_sampleType = c_undefined;
173  std::string m_sampleName;
174  double m_minMomentum = 0;
175  double m_deltaEcms = 0;
176  double m_dr = 0;
177  double m_dz = 0;
178  double m_minZ = 0;
179  double m_maxZ = 0;
182  /* cache for track parameters */
183  mutable TVector3 m_pocaPosition;
184  mutable TVector3 m_pocaMomentum;
185  mutable double m_cmsEnergy = 0;
186  mutable TVector3 m_localPosition;
187  mutable TVector3 m_localMomentum;
189  };
190 
191  } // namespace TOP
193 } // namespace Belle2
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:470
static const ChargedStable muon
muon particle
Definition: Const.h:541
Reconstructed track at TOP.
Definition: TOPTrack.h:40
Utility for the track selection - used in various calibration modules.
Definition: TrackSelector.h:26
const std::string & getSampleName() const
Returns sample name.
Definition: TrackSelector.h:90
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.
const TVector3 & getLocalMomentum() const
Returns momentum at TOP in local frame of the track in last isSelected call.
TVector3 m_pocaMomentum
momentum at POCA
void setDeltaEcms(double deltaEcms)
Sets cut on c.m.s.
Definition: TrackSelector.h:62
const TVector3 & getLocalPosition() const
Returns position at TOP in local frame of the track in last isSelected call.
void setMinMomentum(double minMomentum)
Sets momentum cut (used for "cosmics" only)
Definition: TrackSelector.h:56
double m_minMomentum
minimal track momentum if sample is "cosmics"
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:69
TVector3 m_pocaPosition
position of POCA
double getMinMomentum() const
Returns momentum cut.
Definition: TrackSelector.h:96
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.
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:43
void setCutOnLocalZ(double minZ, double maxZ)
Sets cut on local z coordinate (module frame) of the track extrapolated to TOP.
Definition: TrackSelector.h:80
double m_deltaEcms
c.m.s energy window for "dimuon" or "bhabha"
const TVector3 & getPOCAMomentum() const
Returns momentum vector at POCA of the track in last isSelected call.
double getDz() const
Returns POCA cut in z.
EType
enumerators for possible data sample types (skims)
Definition: TrackSelector.h:33
TVector3 m_localMomentum
momentum at TOP in local (module) frame
double getDr() const
Returns POCA cut in r.
const TVector3 & getPOCAPosition() const
Returns position of POCA of the track in last isSelected call.
TVector3 m_localPosition
position at TOP in local (module) frame
Abstract base class for different kinds of events.