Belle II Software  release-06-02-00
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);
58  bool GetTaub2b2(double);
59  // Additional Bhabha veto
60  int GetBhabhaAddition(void);
62  std::vector<double> GetBhabhaComb() {return BhabhaComb ;}
64  void save(int);
66  void set2DBhabhaThreshold(const std::vector<double>& i2DBhabhaThresholdFWD,
67  const std::vector<double>& i2DBhabhaThresholdBWD)
68  {
69  _2DBhabhaThresholdFWD = i2DBhabhaThresholdFWD;
70  _2DBhabhaThresholdBWD = i2DBhabhaThresholdBWD;
71  }
73  void set3DBhabhaSelectionThreshold(const std::vector<double>& i3DBhabhaSelectionThreshold)
74  {
75  _3DBhabhaSelectionThreshold = i3DBhabhaSelectionThreshold;
76  };
78  void set3DBhabhaVetoThreshold(const std::vector<double>& i3DBhabhaVetoThreshold)
79  {
80  _3DBhabhaVetoThreshold = i3DBhabhaVetoThreshold;
81  };
83  void set3DBhabhaSelectionAngle(const std::vector<double>& i3DBhabhaSelectionAngle)
84  {
85  _3DBhabhaSelectionAngle = i3DBhabhaSelectionAngle;
86  };
88  void set3DBhabhaVetoAngle(const std::vector<double>& i3DBhabhaVetoAngle)
89  {
90  _3DBhabhaVetoAngle = i3DBhabhaVetoAngle;
91  };
93  void setmumuThreshold(int mumuThreshold) {_mumuThreshold = mumuThreshold; }
95  void setmumuAngle(const std::vector<double>& imumuAngle) {_mumuAngle = imumuAngle; }
97  void set3DBhabhaAddAngleCut(const std::vector<double>& i3DBhabhaAddAngleCut)
98  {
99  m_3DBhabhaAddAngleCut = i3DBhabhaAddAngleCut;
100  }
101  // set ThetaID (low and high) for 3DBhabhaVetoInTrack
102  void set3DBhabhaVetoInTrackThetaRegion(const std::vector<int>& i3DBhabhaVetoInTrackThetaRegion)
103  {
104  m_3DBhabhaVetoInTrackThetaRegion = i3DBhabhaVetoInTrackThetaRegion;
105  }
106  // set 2 Cluster angle selection for tau 1x1 decay
107  // [0], [1] for low and high of dphi, [2], [3] for low and high of Theta Sum
108  void setTaub2bAngleCut(const std::vector<int>& iTaub2bAngleCut)
109  {
110  m_taub2bAngleCut = iTaub2bAngleCut;
111  }
112  //
113  void setTaub2bEtotCut(const double iTaub2bEtotCut)
114  {
115  m_taub2bEtotCut = iTaub2bEtotCut;
116  }
117  //
118  void setTaub2bClusterECut(const double iTaub2bClusterECut1,
119  const double iTaub2bClusterECut2)
120  {
121  m_taub2bClusterECut1 = iTaub2bClusterECut1;
122  m_taub2bClusterECut2 = iTaub2bClusterECut2;
123  }
124  // set taub2b2 cut
125  void setTaub2b2Cut(const std::vector<int>& iTaub2b2AngleCut,
126  const double iTaub2b2EtotCut,
127  const double iTaub2b2CLEEndcapCut,
128  const double iTaub2b2CLECut)
129  {
130  m_taub2b2AngleCut = iTaub2b2AngleCut;
131  m_taub2b2EtotCut = iTaub2b2EtotCut;
132  m_taub2b2CLEEndcapCut = iTaub2b2CLEEndcapCut;
133  m_taub2b2CLECut = iTaub2b2CLECut;
134  }
135  // get trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto
136  // are in CDCTRG region in theta (="InTrack") or not
137  int get3DBhabhaVetoInTrackFlag(void)
138  {
139  return m_3DBhabhaVetoInTrackFlag;
140  }
141  // get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha veto
142  int get3DBhabhaVetoClusterTCId(int cl_idx)
143  {
144  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterTCIds.size() != 2) {
145  return -10;
146  }
147  return m_3DBhabhaVetoClusterTCIds[cl_idx];
148  }
149  // get each TC theta ID(most energetic TC in a cluster) of
150  // two clusters of 3D Bhabha veto
151  int get3DBhabhaVetoClusterThetaId(int cl_idx)
152  {
153  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterThetaIds.size() != 2) {
154  return -10;
155  }
156  return m_3DBhabhaVetoClusterThetaIds[cl_idx];
157  }
158  // get each cluster energy of two clusters of 3D Bhabha veto (GeV)
159  double get3DBhabhaVetoClusterEnergy(int cl_idx)
160  {
161  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterEnergies.size() != 2) {
162  return -10;
163  }
164  return m_3DBhabhaVetoClusterEnergies[cl_idx];
165  }
166  // get each cluster timing of two clusters of 3D Bhabha veto (ns)
167  double get3DBhabhaVetoClusterTiming(int cl_idx)
168  {
169  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaVetoClusterTimings.size() != 2) {
170  return -1000;
171  }
172  return m_3DBhabhaVetoClusterTimings[cl_idx];
173  }
174  // get trigger bit(2bits) of flag which shows theta position of clusters
175  // of 3DBhabha Selection.
176  // flag=0 : one of clusters goes to ThetaID=1
177  // flag=1 : one of clusters goes to ThetaID=2
178  // flag=2 : one of clusters goes to ThetaID=3
179  // flag=3 : none of clusters fly to ThetaID=1-3
180  // Based on this flag, pre-scale is applied on GDL to have flat entry of
181  // Bhabha event in theta for calibration purpose
182  int get3DBhabhaSelectionThetaFlag(void)
183  {
184  return m_3DBhabhaSelectionThetaFlag;
185  }
186  // get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha selection
187  int get3DBhabhaSelectionClusterTCId(int cl_idx)
188  {
189  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterTCIds.size() != 2) {
190  return -10;
191  }
192  return m_3DBhabhaSelectionClusterTCIds[cl_idx];
193  }
194  // get each TC theta ID(most energetic TC in a cluster) of
195  // two clusters of 3D Bhabha selection
196  int get3DBhabhaSelectionClusterThetaId(int cl_idx)
197  {
198  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterThetaIds.size() != 2) {
199  return -10;
200  }
201  return m_3DBhabhaSelectionClusterThetaIds[cl_idx];
202  }
203  // get each cluster energy of two clusters of 3D Bhabha selection (GeV)
204  double get3DBhabhaSelectionClusterEnergy(int cl_idx)
205  {
206  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterEnergies.size() != 2) {
207  return -10;
208  }
209  return m_3DBhabhaSelectionClusterEnergies[cl_idx];
210  }
211  // get each cluster timing of two clusters of 3D Bhabha selection (ns)
212  double get3DBhabhaSelectionClusterTiming(int cl_idx)
213  {
214  if (cl_idx < 0 || cl_idx > 1 || m_3DBhabhaSelectionClusterTimings.size() != 2) {
215  return -1000;
216  }
217  return m_3DBhabhaSelectionClusterTimings[cl_idx];
218  }
219  // get taub2b 2 cluster angle cut flag
220  int getTaub2bAngleFlag(void) { return m_taub2bAngleFlag; }
221  // get total energy(TC theta id=1-17) flag for taub2b
222  int getTaub2bEtotFlag(void) { return m_taub2bEtotFlag; }
223  // taub2b Cluster energy flag
224  int getTaub2bClusterEFlag(void) { return m_taub2bClusterEFlag; }
225 
226  private:
228  TrgEclMapping* _TCMap = nullptr;
230  // cppcheck-suppress unsafeClassCanLeak
232 
234  void get2CLETP(int, int, int&, int&, int&, int&);
235 
237  std::vector<double> BhabhaComb;
239  std::vector<double> MaxTCId;
241  std::vector<double> ClusterEnergy;
243  std::vector<double> ClusterTiming;
245  std::vector<TVector3> ClusterPosition;
247  std::vector<double> _2DBhabhaThresholdFWD;
249  std::vector<double> _2DBhabhaThresholdBWD;
251  std::vector<double> _3DBhabhaSelectionThreshold;
253  std::vector<double> _3DBhabhaVetoThreshold;
255  std::vector<double> _3DBhabhaSelectionAngle;
257  std::vector<double> _3DBhabhaVetoAngle;
261  std::vector<double> _mumuAngle;
262  // Angle selection of additional Bhabha veto in CM frame
263  std::vector<double> m_3DBhabhaAddAngleCut;
264  // taub2b 2 Cluster angle cut (degree)
265  std::vector<int> m_taub2bAngleCut;
266  // taub2b total energy(TC theta id=1-17) cut (GeV)
267  double m_taub2bEtotCut;
268  // taub2b Cluster energy cut (GeV)
269  double m_taub2bClusterECut1;
270  double m_taub2bClusterECut2;
271  // taub2b 2 cluster angle cut flag
272  int m_taub2bAngleFlag;
273  // taub2b total energy(TC theta id=1-17) flag
274  int m_taub2bEtotFlag;
275  // taub2b Cluster energy flag
276  int m_taub2bClusterEFlag;
277  // taub2b2 total energy cut (GeV)
278  double m_taub2b2EtotCut;
279  // taub2b2 two Cluster angle cut (degree)
280  std::vector<int> m_taub2b2AngleCut;
281  // taub2b2 cluster energy cut for endcap cluster (GeV)
282  double m_taub2b2CLEEndcapCut;
283  // taub2b2 cluster energy cut (GeV)
284  double m_taub2b2CLECut;
285  // trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto
286  // are in CDCTRG region in theta (="InTrack") or not
287  int m_3DBhabhaVetoInTrackFlag;
288  // TCIDs of two clusters of 3D Bhabha veto
289  std::vector<int> m_3DBhabhaVetoClusterTCIds;
290  // ThetaIds of two clusters of 3D Bhabha veto
291  std::vector<int> m_3DBhabhaVetoClusterThetaIds;
292  // Energies of two clusters of 3D Bhabha veto (GeV)
293  std::vector<double> m_3DBhabhaVetoClusterEnergies;
294  // Timings of two clusters of 3D Bhabha veto (ns)
295  std::vector<double> m_3DBhabhaVetoClusterTimings;
296  // theta region(low and high) of 3D Bhbabha veto InTrack
297  std::vector<int> m_3DBhabhaVetoInTrackThetaRegion;
298  // flag which shows theta position of clusters of 3DBhabha Selection.
299  int m_3DBhabhaSelectionThetaFlag = std::numeric_limits<int>::quiet_NaN();
300  // TCIDs of two clusters of 3D Bhabha selection
301  std::vector<int> m_3DBhabhaSelectionClusterTCIds;
302  // ThetaIDs of two clusters used for 3D Bhabha selection
303  std::vector<int> m_3DBhabhaSelectionClusterThetaIds;
304  // Energies of two clusters used for 3D Bhabha selection (GeV)
305  std::vector<double> m_3DBhabhaSelectionClusterEnergies;
306  // Timings of two clusters used for 3D Bhabha selection (ns)
307  std::vector<double> m_3DBhabhaSelectionClusterTimings;
308  };
309 //
310 //
311 //
313 } // 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:62
std::vector< double > MaxTCId
Max TC Id.
Definition: TrgEclBhabha.h:239
TrgEclBhabha()
Constructor.
Definition: TrgEclBhabha.cc:67
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:97
std::vector< TVector3 > ClusterPosition
Cluster Timing.
Definition: TrgEclBhabha.h:245
double _mumuThreshold
mumu bit Energy Threshold
Definition: TrgEclBhabha.h:259
TrgEclDataBase * _database
Object of Trigger ECL DataBase.
Definition: TrgEclBhabha.h:231
std::vector< double > _mumuAngle
mumu bit Angle
Definition: TrgEclBhabha.h:261
std::vector< double > _3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
Definition: TrgEclBhabha.h:253
TrgEclBhabha(TrgEclBhabha &)=delete
Destructor.
std::vector< double > ClusterTiming
Cluster Timing.
Definition: TrgEclBhabha.h:243
void setmumuThreshold(int mumuThreshold)
set mumu bit Threshold
Definition: TrgEclBhabha.h:93
void set2DBhabhaThreshold(const std::vector< double > &i2DBhabhaThresholdFWD, const std::vector< double > &i2DBhabhaThresholdBWD)
set 2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:66
void set3DBhabhaVetoAngle(const std::vector< double > &i3DBhabhaVetoAngle)
set 3D veto Bhabha Energy Angle
Definition: TrgEclBhabha.h:88
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:83
void set3DBhabhaSelectionThreshold(const std::vector< double > &i3DBhabhaSelectionThreshold)
set 3D selection Bhabha Energy Threshold
Definition: TrgEclBhabha.h:73
std::vector< double > _3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
Definition: TrgEclBhabha.h:255
std::vector< double > _2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:249
std::vector< double > BhabhaComb
Bhabha Combination.
Definition: TrgEclBhabha.h:237
std::vector< double > _3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
Definition: TrgEclBhabha.h:251
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:78
void setmumuAngle(const std::vector< double > &imumuAngle)
set mumu bit Angle selection
Definition: TrgEclBhabha.h:95
virtual ~TrgEclBhabha()
Constructor.
std::vector< double > ClusterEnergy
Cluster Energy.
Definition: TrgEclBhabha.h:241
TrgEclMapping * _TCMap
Object of TC Mapping.
Definition: TrgEclBhabha.h:228
std::vector< double > _2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
Definition: TrgEclBhabha.h:247
std::vector< double > _3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
Definition: TrgEclBhabha.h:257
bool GetTaub2b2(double)
Taub2b selection (tighter selection than Taub2b)
class TrgEclDataBase;
A class of TC Mapping.
Definition: TrgEclMapping.h:26
Abstract base class for different kinds of events.