Belle II Software  release-05-02-19
TrackSelector.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/gearbox/Const.h>
14 #include <string>
15 #include <TVector3.h>
16 
17 namespace Belle2 {
22  namespace TOP {
23 
24  class TOPtrack;
25 
29  class TrackSelector {
30 
31  public:
32 
36  enum EType {
37  c_undefined = 0,
38  c_dimuon = 1,
39  c_bhabha = 2,
40  c_cosmics = 3
41  };
42 
47  {}
48 
53  explicit TrackSelector(const std::string& sampleName);
54 
59  void setMinMomentum(double minMomentum) {m_minMomentum = minMomentum;}
60 
65  void setDeltaEcms(double deltaEcms) {m_deltaEcms = deltaEcms;}
66 
72  void setCutOnPOCA(double dr, double dz)
73  {
74  m_dr = dr;
75  m_dz = dz;
76  }
77 
83  void setCutOnLocalZ(double minZ, double maxZ)
84  {
85  m_minZ = minZ;
86  m_maxZ = maxZ;
87  }
88 
93  const std::string& getSampleName() const {return m_sampleName;}
94 
99  double getMinMomentum() const {return m_minMomentum;}
100 
105  double getDeltaEcms() const {return m_deltaEcms;}
106 
111  double getDr() const {return m_dr;}
112 
117  double getDz() const {return m_dz;}
118 
123  double getMinZ() const {return m_minZ;}
124 
129  double getMaxZ() const {return m_maxZ;}
130 
134  const Const::ChargedStable& getChargedStable() const {return m_chargedStable;}
135 
140  const TVector3& getPOCAPosition() const {return m_pocaPosition;}
141 
146  const TVector3& getPOCAMomentum() const {return m_pocaMomentum;}
147 
152  double getCMSEnergy() const {return m_cmsEnergy;}
153 
158  const TVector3& getLocalPosition() const {return m_localPosition;}
159 
164  const TVector3& getLocalMomentum() const {return m_localMomentum;}
165 
171  bool isSelected(const TOPtrack& track) const;
172 
173  private:
174 
175  EType m_sampleType = c_undefined;
176  std::string m_sampleName;
177  double m_minMomentum = 0;
178  double m_deltaEcms = 0;
179  double m_dr = 0;
180  double m_dz = 0;
181  double m_minZ = 0;
182  double m_maxZ = 0;
185  /* cache for track parameters */
186  mutable TVector3 m_pocaPosition;
187  mutable TVector3 m_pocaMomentum;
188  mutable double m_cmsEnergy = 0;
189  mutable TVector3 m_localPosition;
190  mutable TVector3 m_localMomentum;
192  };
193 
194  } // namespace TOP
196 } // namespace Belle2
Belle2::TOP::TrackSelector::m_maxZ
double m_maxZ
maximal local z of extrapolated hit
Definition: TrackSelector.h:190
Belle2::TOP::TrackSelector::m_sampleName
std::string m_sampleName
data sample (skim) name
Definition: TrackSelector.h:184
Belle2::TOP::TrackSelector::setDeltaEcms
void setDeltaEcms(double deltaEcms)
Sets cut on c.m.s.
Definition: TrackSelector.h:73
Belle2::TOP::TrackSelector::TrackSelector
TrackSelector()
Default constructor.
Definition: TrackSelector.h:54
Belle2::TOP::TrackSelector::getCMSEnergy
double getCMSEnergy() const
Returns c.m.s energy of the track in last isSelected call.
Definition: TrackSelector.h:160
Belle2::TOP::TrackSelector::getDr
double getDr() const
Returns POCA cut in r.
Definition: TrackSelector.h:119
Belle2::TOP::TrackSelector::getMinZ
double getMinZ() const
Returns cut on local z.
Definition: TrackSelector.h:131
Belle2::TOP::TrackSelector::getLocalMomentum
const TVector3 & getLocalMomentum() const
Returns momentum at TOP in local frame of the track in last isSelected call.
Definition: TrackSelector.h:172
Belle2::TOP::TrackSelector::m_localMomentum
TVector3 m_localMomentum
momentum at TOP in local (module) frame
Definition: TrackSelector.h:198
Belle2::TOP::TrackSelector::m_sampleType
EType m_sampleType
data sample (skim) type
Definition: TrackSelector.h:183
Belle2::TOP::TrackSelector::getDz
double getDz() const
Returns POCA cut in z.
Definition: TrackSelector.h:125
Belle2::TOP::TrackSelector::setCutOnLocalZ
void setCutOnLocalZ(double minZ, double maxZ)
Sets cut on local z coordinate (module frame) of the track extrapolated to TOP.
Definition: TrackSelector.h:91
Belle2::TOP::TrackSelector::m_dr
double m_dr
cut on POCA in r
Definition: TrackSelector.h:187
Belle2::TOP::TrackSelector::getChargedStable
const Const::ChargedStable & getChargedStable() const
Returns track hypothesis.
Definition: TrackSelector.h:142
Belle2::TOP::TrackSelector::getSampleName
const std::string & getSampleName() const
Returns sample name.
Definition: TrackSelector.h:101
Belle2::TOP::TrackSelector::getPOCAMomentum
const TVector3 & getPOCAMomentum() const
Returns momentum vector at POCA of the track in last isSelected call.
Definition: TrackSelector.h:154
Belle2::TOP::TrackSelector::m_chargedStable
Const::ChargedStable m_chargedStable
track hypothesis
Definition: TrackSelector.h:191
Belle2::TOP::TrackSelector::m_minZ
double m_minZ
minimal local z of extrapolated hit
Definition: TrackSelector.h:189
Belle2::TOP::TrackSelector::m_pocaPosition
TVector3 m_pocaPosition
position of POCA
Definition: TrackSelector.h:194
Belle2::TOP::TrackSelector::m_dz
double m_dz
cut on POCA in z
Definition: TrackSelector.h:188
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOP::TrackSelector::getMaxZ
double getMaxZ() const
Returns cut on local z.
Definition: TrackSelector.h:137
Belle2::TOP::TrackSelector::setMinMomentum
void setMinMomentum(double minMomentum)
Sets momentum cut (used for "cosmics" only)
Definition: TrackSelector.h:67
Belle2::TOP::TrackSelector::m_minMomentum
double m_minMomentum
minimal track momentum if sample is "cosmics"
Definition: TrackSelector.h:185
Belle2::TOP::TrackSelector::m_localPosition
TVector3 m_localPosition
position at TOP in local (module) frame
Definition: TrackSelector.h:197
Belle2::TOP::TrackSelector::m_pocaMomentum
TVector3 m_pocaMomentum
momentum at POCA
Definition: TrackSelector.h:195
Belle2::TOP::TrackSelector::EType
EType
enumerators for possible data sample types (skims)
Definition: TrackSelector.h:44
Belle2::TOP::TrackSelector::getDeltaEcms
double getDeltaEcms() const
Returns c.m.s.
Definition: TrackSelector.h:113
Belle2::TOP::TrackSelector::isSelected
bool isSelected(const TOPtrack &track) const
Returns selection status.
Definition: TrackSelector.cc:53
Belle2::TOP::TrackSelector::getMinMomentum
double getMinMomentum() const
Returns momentum cut.
Definition: TrackSelector.h:107
Belle2::TOP::TrackSelector::getLocalPosition
const TVector3 & getLocalPosition() const
Returns position at TOP in local frame of the track in last isSelected call.
Definition: TrackSelector.h:166
Belle2::TOP::TrackSelector::getPOCAPosition
const TVector3 & getPOCAPosition() const
Returns position of POCA of the track in last isSelected call.
Definition: TrackSelector.h:148
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::TOP::TrackSelector::m_deltaEcms
double m_deltaEcms
c.m.s energy window for "dimuon" or "bhabha"
Definition: TrackSelector.h:186
Belle2::Const::muon
static const ChargedStable muon
muon particle
Definition: Const.h:534
Belle2::TOP::TrackSelector::setCutOnPOCA
void setCutOnPOCA(double dr, double dz)
Sets cut on point of closest approach to (0, 0, 0)
Definition: TrackSelector.h:80
Belle2::TOP::TrackSelector::m_cmsEnergy
double m_cmsEnergy
c.m.s.
Definition: TrackSelector.h:196