Belle II Software  release-06-00-14
TrgEclBhabha.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 <vector>
12 
13 #include "trg/ecl/TrgEclMapping.h"
14 #include "trg/ecl/TrgEclDataBase.h"
15 
16 #include "TVector3.h"
17 //
18 //
19 //
20 namespace Belle2 {
25 //
26 //
27 //
28  //
30  //
31  class TrgEclBhabha {
32 
33  public:
35  TrgEclBhabha();
36 
38  virtual ~TrgEclBhabha();
39 
42 
45 
46  public:
48  bool GetBhabha00(std::vector<double>);
50  bool GetBhabha01();
52  bool GetBhabha02();
54  bool Getmumu();
56  bool GetTaub2b(double);
57  // Additional Bhabha veto
58  int GetBhabhaAddition(void);
60  std::vector<double> GetBhabhaComb() {return BhabhaComb ;}
62  void save(int);
64  void set2DBhabhaThreshold(const std::vector<double>& i2DBhabhaThresholdFWD,
65  const std::vector<double>& i2DBhabhaThresholdBWD)
66  {
67  _2DBhabhaThresholdFWD = i2DBhabhaThresholdFWD;
68  _2DBhabhaThresholdBWD = i2DBhabhaThresholdBWD;
69  }
71  void set3DBhabhaSelectionThreshold(const std::vector<double>& i3DBhabhaSelectionThreshold)
72  {
73  _3DBhabhaSelectionThreshold = i3DBhabhaSelectionThreshold;
74  };
76  void set3DBhabhaVetoThreshold(const std::vector<double>& i3DBhabhaVetoThreshold)
77  {
78  _3DBhabhaVetoThreshold = i3DBhabhaVetoThreshold;
79  };
81  void set3DBhabhaSelectionAngle(const std::vector<double>& i3DBhabhaSelectionAngle)
82  {
83  _3DBhabhaSelectionAngle = i3DBhabhaSelectionAngle;
84  };
86  void set3DBhabhaVetoAngle(const std::vector<double>& i3DBhabhaVetoAngle)
87  {
88  _3DBhabhaVetoAngle = i3DBhabhaVetoAngle;
89  };
91  void setmumuThreshold(int mumuThreshold) {_mumuThreshold = mumuThreshold; }
93  void setmumuAngle(const std::vector<double>& imumuAngle) {_mumuAngle = imumuAngle; }
95  void set3DBhabhaAddAngleCut(const std::vector<double>& i3DBhabhaAddAngleCut)
96  {
97  m_3DBhabhaAddAngleCut = i3DBhabhaAddAngleCut;
98  }
99  // set ThetaID (low and high) for 3DBhabhaVetoInTrack
100  void set3DBhabhaVetoInTrackThetaRegion(const std::vector<int>& i3DBhabhaVetoInTrackThetaRegion)
101  {
102  m_3DBhabhaVetoInTrackThetaRegion = i3DBhabhaVetoInTrackThetaRegion;
103  }
104  // set 2 Cluster angle selection for tau 1x1 decay
105  // [0], [1] for low and high of dphi, [2], [3] for low and high of Theta Sum
106  void setTaub2bAngleCut(const std::vector<int>& iTaub2bAngleCut)
107  {
108  m_Taub2bAngleCut = iTaub2bAngleCut;
109  }
110  //
111  void setTaub2bEtotCut(const double iTaub2bEtotCut)
112  {
113  m_Taub2bEtotCut = iTaub2bEtotCut;
114  }
115  //
116  void setTaub2bClusterECut(const double iTaub2bClusterECut1,
117  const double iTaub2bClusterECut2)
118  {
119  m_Taub2bClusterECut1 = iTaub2bClusterECut1;
120  m_Taub2bClusterECut2 = iTaub2bClusterECut2;
121  }
122  // get trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto
123  // are in CDCTRG region in theta (="InTrack") or not
124  int get3DBhabhaVetoInTrackFlag(void)
125  {
126  return m_3DBhabhaVetoInTrackFlag;
127  }
128  // get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha veto
129  int get3DBhabhaVetoClusterTCId(int cl_idx)
130  {
131  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterTCIds.size() != 2) {
132  return -10;
133  }
134  return m_3DBhabhaVetoClusterTCIds[cl_idx];
135  }
136  // get each TC theta ID(most energetic TC in a cluster) of
137  // two clusters of 3D Bhabha veto
138  int get3DBhabhaVetoClusterThetaId(int cl_idx)
139  {
140  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterThetaIds.size() != 2) {
141  return -10;
142  }
143  return m_3DBhabhaVetoClusterThetaIds[cl_idx];
144  }
145  // get each cluster energy of two clusters of 3D Bhabha veto (GeV)
146  double get3DBhabhaVetoClusterEnergy(int cl_idx)
147  {
148  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterEnergies.size() != 2) {
149  return -10;
150  }
151  return m_3DBhabhaVetoClusterEnergies[cl_idx];
152  }
153  // get each cluster timing of two clusters of 3D Bhabha veto (ns)
154  double get3DBhabhaVetoClusterTiming(int cl_idx)
155  {
156  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterTimings.size() != 2) {
157  return -1000;
158  }
159  return m_3DBhabhaVetoClusterTimings[cl_idx];
160  }
161  // get trigger bit(2bits) of flag which shows theta position of clusters
162  // of 3DBhabha Selection.
163  // flag=0 : one of clusters goes to ThetaID=1
164  // flag=1 : one of clusters goes to ThetaID=2
165  // flag=2 : one of clusters goes to ThetaID=3
166  // flag=3 : none of clusters fly to ThetaID=1-3
167  // Based on this flag, pre-scale is applied on GDL to have flat entry of
168  // Bhabha event in theta for calibration purpose
169  int get3DBhabhaSelectionThetaFlag(void)
170  {
171  return m_3DBhabhaSelectionThetaFlag;
172  }
173  // get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha selection
174  int get3DBhabhaSelectionClusterTCId(int cl_idx)
175  {
176  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterTCIds.size() != 2) {
177  return -10;
178  }
179  return m_3DBhabhaSelectionClusterTCIds[cl_idx];
180  }
181  // get each TC theta ID(most energetic TC in a cluster) of
182  // two clusters of 3D Bhabha selection
183  int get3DBhabhaSelectionClusterThetaId(int cl_idx)
184  {
185  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterThetaIds.size() != 2) {
186  return -10;
187  }
188  return m_3DBhabhaSelectionClusterThetaIds[cl_idx];
189  }
190  // get each cluster energy of two clusters of 3D Bhabha selection (GeV)
191  double get3DBhabhaSelectionClusterEnergy(int cl_idx)
192  {
193  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterEnergies.size() != 2) {
194  return -10;
195  }
196  return m_3DBhabhaSelectionClusterEnergies[cl_idx];
197  }
198  // get each cluster timing of two clusters of 3D Bhabha selection (ns)
199  double get3DBhabhaSelectionClusterTiming(int cl_idx)
200  {
201  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterTimings.size() != 2) {
202  return -1000;
203  }
204  return m_3DBhabhaSelectionClusterTimings[cl_idx];
205  }
206  // get taub2b 2 cluster angle cut flag
207  int getTaub2bAngleFlag(void) { return m_Taub2bAngleFlag; }
208  // get total energy(TC theta id=1-17) flag for taub2b
209  int getTaub2bEtotFlag(void) { return m_Taub2bEtotFlag; }
210  // taub2b Cluster energy flag
211  int getTaub2bClusterEFlag(void) { return m_Taub2bClusterEFlag; }
212 
213  private:
215  TrgEclMapping* _TCMap = nullptr;
217  // cppcheck-suppress unsafeClassCanLeak
219 
221  void get2CLETP(int, int, int&, int&, int&, int&);
222 
224  std::vector<double> BhabhaComb;
226  std::vector<double> MaxTCId;
228  std::vector<double> ClusterEnergy;
230  std::vector<double> ClusterTiming;
232  std::vector<TVector3> ClusterPosition;
234  std::vector<double> _2DBhabhaThresholdFWD;
236  std::vector<double> _2DBhabhaThresholdBWD;
238  std::vector<double> _3DBhabhaSelectionThreshold;
240  std::vector<double> _3DBhabhaVetoThreshold;
242  std::vector<double> _3DBhabhaSelectionAngle;
244  std::vector<double> _3DBhabhaVetoAngle;
248  std::vector<double> _mumuAngle;
249  // Angle selection of additional Bhabha veto in CM frame
250  std::vector<double> m_3DBhabhaAddAngleCut;
251  // taub2b 2 Cluster angle cut
252  std::vector<int> m_Taub2bAngleCut;
253  // taub2b total energy(TC theta id=1-17) cut
254  double m_Taub2bEtotCut;
255  // taub2b Cluster energy cut
256  double m_Taub2bClusterECut1;
257  double m_Taub2bClusterECut2;
258  // taub2b 2 cluster angle cut flag
259  int m_Taub2bAngleFlag;
260  // taub2b total energy(TC theta id=1-17) flag
261  int m_Taub2bEtotFlag;
262  // taub2b Cluster energy flag
263  int m_Taub2bClusterEFlag;
264  // trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto
265  // are in CDCTRG region in theta (="InTrack") or not
266  int m_3DBhabhaVetoInTrackFlag;
267  // TCIDs of two clusters of 3D Bhabha veto
268  std::vector<int> m_3DBhabhaVetoClusterTCIds;
269  // ThetaIds of two clusters of 3D Bhabha veto
270  std::vector<int> m_3DBhabhaVetoClusterThetaIds;
271  // Energies of two clusters of 3D Bhabha veto (GeV)
272  std::vector<double> m_3DBhabhaVetoClusterEnergies;
273  // Timings of two clusters of 3D Bhabha veto (ns)
274  std::vector<double> m_3DBhabhaVetoClusterTimings;
275  // theta region(low and high) of 3D Bhbabha veto InTrack
276  std::vector<int> m_3DBhabhaVetoInTrackThetaRegion;
277  // flag which shows theta position of clusters of 3DBhabha Selection.
278  int m_3DBhabhaSelectionThetaFlag = std::numeric_limits<int>::quiet_NaN();
279  // TCIDs of two clusters of 3D Bhabha selection
280  std::vector<int> m_3DBhabhaSelectionClusterTCIds;
281  // ThetaIDs of two clusters used for 3D Bhabha selection
282  std::vector<int> m_3DBhabhaSelectionClusterThetaIds;
283  // Energies of two clusters used for 3D Bhabha selection (GeV)
284  std::vector<double> m_3DBhabhaSelectionClusterEnergies;
285  // Timings of two clusters used for 3D Bhabha selection (ns)
286  std::vector<double> m_3DBhabhaSelectionClusterTimings;
287  };
288 //
289 //
290 //
292 } // namespace Belle2
A Class of ECL Trigger clustering
Definition: TrgEclBhabha.h:31
bool GetBhabha00(std::vector< double >)
Belle 2D Bhabha veto method.
void save(int)
Save.
bool Getmumu()
MuMu selection for calibration.
std::vector< double > GetBhabhaComb()
Output 2D Bhabha combination.
Definition: TrgEclBhabha.h:60
std::vector< double > MaxTCId
Max TC Id.
Definition: TrgEclBhabha.h:226
TrgEclBhabha()
Constructor.
Definition: TrgEclBhabha.cc:65
void get2CLETP(int, int, int &, int &, int &, int &)
2 cluster energies, phi difference and theta sum
void set3DBhabhaAddAngleCut(const std::vector< double > &i3DBhabhaAddAngleCut)
set 3D Bhabha addtion Angle selection
Definition: TrgEclBhabha.h:95
std::vector< TVector3 > ClusterPosition
Cluster Timing.
Definition: TrgEclBhabha.h:232
double _mumuThreshold
mumu bit Energy Threshold
Definition: TrgEclBhabha.h:246
TrgEclDataBase * _database
Object of Trigger ECL DataBase.
Definition: TrgEclBhabha.h:218
std::vector< double > _mumuAngle
mumu bit Angle
Definition: TrgEclBhabha.h:248
std::vector< double > _3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
Definition: TrgEclBhabha.h:240
TrgEclBhabha(TrgEclBhabha &)=delete
Destructor.
std::vector< double > ClusterTiming
Cluster Timing.
Definition: TrgEclBhabha.h:230
void setmumuThreshold(int mumuThreshold)
set mumu bit Threshold
Definition: TrgEclBhabha.h:91
void set2DBhabhaThreshold(const std::vector< double > &i2DBhabhaThresholdFWD, const std::vector< double > &i2DBhabhaThresholdBWD)
set 2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:64
void set3DBhabhaVetoAngle(const std::vector< double > &i3DBhabhaVetoAngle)
set 3D veto Bhabha Energy Angle
Definition: TrgEclBhabha.h:86
bool GetBhabha02()
Belle II 3D Bhabha method for selection.
TrgEclBhabha & operator=(TrgEclBhabha &)=delete
Assignement operator, deleted.
void set3DBhabhaSelectionAngle(const std::vector< double > &i3DBhabhaSelectionAngle)
set 3D selection Bhabha Energy Angle
Definition: TrgEclBhabha.h:81
void set3DBhabhaSelectionThreshold(const std::vector< double > &i3DBhabhaSelectionThreshold)
set 3D selection Bhabha Energy Threshold
Definition: TrgEclBhabha.h:71
std::vector< double > _3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
Definition: TrgEclBhabha.h:242
std::vector< double > _2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:236
std::vector< double > BhabhaComb
Bhabha Combination.
Definition: TrgEclBhabha.h:224
std::vector< double > _3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
Definition: TrgEclBhabha.h:238
bool GetTaub2b(double)
Taub2b selection.
bool GetBhabha01()
Belle II 3D Bhabha method for veto.
void set3DBhabhaVetoThreshold(const std::vector< double > &i3DBhabhaVetoThreshold)
set 3D veto Bhabha Energy Threshold
Definition: TrgEclBhabha.h:76
void setmumuAngle(const std::vector< double > &imumuAngle)
set mumu bit Angle selection
Definition: TrgEclBhabha.h:93
virtual ~TrgEclBhabha()
Constructor.
std::vector< double > ClusterEnergy
Cluster Energy.
Definition: TrgEclBhabha.h:228
TrgEclMapping * _TCMap
Object of TC Mapping.
Definition: TrgEclBhabha.h:215
std::vector< double > _2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:234
std::vector< double > _3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
Definition: TrgEclBhabha.h:244
class TrgEclDataBase;
A class of TC Mapping.
Definition: TrgEclMapping.h:26
Abstract base class for different kinds of events.