Belle II Software development
TrgEclBhabha.cc
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//---------------------------------------------------------------
10// Description : A class to tag Bhabha Veto
11//
12// Belle type Bhabha (Bhbha00())
13//
14// Theta Id combination
15// bit id | combination(FWD|BWD) | Energy Threshold (FWD|BWD) GeV
16// 0 | 1+2+3 | 16+17 | 4.0 | 2.5
17// 1 | 3 | 15 | 4.0 | 2.5
18// 2 | 4 | 14+15 | 4.0 | 2.5
19// 3 | 5 | 14+15 | 4.0 | 2.5
20// 4 | 4+5 | 14 | 4.0 | 2.5
21// 5 | 5 | 13+14 | 4.0 | 2.5
22// 6 | 5 | 12+13 | 4.0 | 2.5
23// 7 | 5+6 | 13 | 4.0 | 2.5
24// 8 | 5+6 | 12 | 4.0 | 2.5
25// 9 | 6+7 | 12 | 4.0 | 2.5
26// 10 | 6+7 | 11 | 4.0 | 2.5
27// 11 | 7+8 | 11 | 4.0 | 2.5
28// 12 | 8 | 10+11 | 3.0 | 3.0
29// 13 | 8+9 | 9+10 | 3.5 | 3.0
30//
31// Belle 2 3D Bhabha (Bhabha01)
32//
33// - Cluster base Logic
34// - Compare all clusters satisfying following conditions
35// @ Bhabha for veto
36// 160 degree < (CM Phi_Cluster 1 - CM Phi_Cluster 2) < 200 degree
37// 165 degree < (CM Theta Cluster 1 + CM Theta Cluster 2 ) < 190 degree
38// Both Cluster CM E > 3 GeV and One of cluster CM E > 4.5 GeV
39// @ Bhabha for calibration (selection bhabha)
40// 140 degree < (CM Phi_Cluster 1 - CM Phi_Cluster 2) < 220 degree
41// 160 degree < (CM Theta Cluster 1 + CM Theta Cluster 2 ) < 200 degree
42// Both Cluster CM E > 2.5 GeV and One of cluster CM E > 4.0 GeV
43//
44// ee->mumu selection
45// 160 degree < (CM Phi_Cluster 1 - CM Phi_Cluster 2) < 200 degree
46// 165 degree < (CM Theta Cluster 1 + CM Theta Cluster 2 ) < 190 degree
47// Both Cluster CM E < 2 GeV and One of cluster CM E < 2 GeV
48//
49//---------------------------------------------------------------
50
51#define TRG_SHORT_NAMES
52#define TRGECLCLUSTER_SHORT_NAMES
53#include <framework/gearbox/Unit.h>
54#include "framework/datastore/StoreArray.h"
55
56#include <trg/ecl/TrgEclBhabha.h>
57
58#include "trg/ecl/dataobjects/TRGECLCluster.h"
59
60#include <analysis/utility/PCmsLabTransform.h>
61
62using namespace std;
63using namespace Belle2;
64//
65//
66//
68{
69
70 m_BhabhaComb.clear();
71 m_MaxTCId.clear();
72 m_ClusterEnergyLab.clear();
73 m_ClusterTiming.clear();
74
75 m_TCMap = new TrgEclMapping();
76
78
84 m_3DBhabhaVetoAngle.clear();
85 m_mumuAngle.clear();
92
94 {4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5}; // GeV
96 {2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 3.0, 3.0}; // GeV
97 m_3DBhabhaVetoThreshold = {3.0, 4.5}; // GeV
98 m_3DBhabhaVetoAngle = {160, 200, 165, 190}; // (phi low, high, theta low, high) (degree)
99 m_3DBhabhaSelectionThreshold = {2.5, 4.0}; // GeV
100 m_3DBhabhaSelectionAngle = {140, 220, 160, 200}; // (phi low, high, theta low, high) (degree)
101 m_3DBhabhaSelectionPreScale = {1, 1, 1}; // (fw, br, bw)
102
103 m_mumuThreshold = 2.0; // GeV
104 m_mumuAngle = {160, 200, 165, 190}; // (phi low, high, theta low, high) (degree)
105
106 m_3DBhabhaVetoInTrackThetaRegion = {3, 15}; // theta ID
107
108 m_taub2bAngleCut = {110, 250, 130, 230}; // degree
109 m_taub2bCLELabCut = 1.9; // GeV
110 m_taub2bEtotCut = 7.0; // GeV
111
112 m_hie12BhabhaVetoAngle = {150, 210, 160, 200}; // (phi low, high, theta low, high) (degree)
113
114 m_taub2b2AngleCut = {120, 240, 140, 220}; // degree
115 m_taub2b2CLELabCut = {3.0, 0.162}; // GeV
116 m_taub2b2EtotCut = 7.0; // GeV
117
118 m_taub2b3AngleCut = {120, 240, 140, 220}; // degree
119 m_taub2b3EtotCut = 7.0; // GeV
120 m_taub2b3CLEb2bLabCut = 0.14; // GeV
121 m_taub2b3CLELabCut = {0.12, 4.5}; // GeV
122
123 m_hie4LowCLELabCut = 0.5; //GeV
124 //
126
130
131}
132//
133//
134//
136{
137 delete m_TCMap;
138 delete m_database;
139}
140//
141//
142//
143bool TrgEclBhabha::getBhabha00(std::vector<double> PhiRingSum) //Belle 2D Bhabha veto method
144{
145 bool BtoBflag = false;
146
147 vector<int> k011 = {3, 1, 2, 3 }; // (1) F1+F2 + F3 + B1+B2
148 vector<int> k012 = {2, 16, 17}; // (1) F1+F2 + F3 + B1+B2
149
150 vector<int> k021 = {1, 3}; // (2) F3 + C12
151 vector<int> k022 = {1, 15}; // (2) F3 + C12
152
153 vector<int> k03 = {2, 2, 3}; // (3) F2 + F3
154
155 vector<int> k04 = {1, 4}; // (4) C1 + backward gap
156
157 vector<int> k051 = {1, 4 }; // (5) C1+C11+C12
158 vector<int> k052 = {2, 14, 15}; // (5) C1+C11+C12
159
160 vector<int> k061 = {1, 5}; // (6) C2+C11+C12
161 vector<int> k062 = {2, 14, 15}; // (6) C2+C11+C12
162
163 vector<int> k071 = {2, 4, 5}; // (7) C1+C2+C11
164 vector<int> k072 = {1, 14}; // (7) C1+C2+C11
165
166 vector<int> k081 = {1, 5}; // (8) C2+C10+C11
167 vector<int> k082 = {2, 13, 14}; // (8) C2+C10+C11
168
169 vector<int> k091 = {1, 5 }; // (9) C2+C9+C10
170 vector<int> k092 = {2, 12, 13}; // (9) C2+C9+C10
171
172 vector<int> k101 = {2, 5, 6}; // (10) C2+C3+C10
173 vector<int> k102 = {1, 13}; // (10) C2+C3+C10
174
175 vector<int> k111 = {2, 5, 6}; // (11) C2+C3+C9
176 vector<int> k112 = {1, 12}; // (11) C2+C3+C9
177
178 vector<int> k121 = {2, 6, 7}; // (9) C3+C4+C9
179 vector<int> k122 = {1, 12}; // (9) C3+C4+C9
180
181 vector<int> k131 = {2, 6, 7}; // (10) C3+C4+C8
182 vector<int> k132 = {1, 11}; // (10) C3+C4+C8
183
184 vector<int> k141 = {2, 7, 8}; // (11) C4+C5+C8
185 vector<int> k142 = {1, 11}; // (11) C4+C5+C8
186
187
188 vector<int> k151 = {1, 8}; // (9) C5+C7+C8
189 vector<int> k152 = {2, 10, 11}; // (9) C5+C7+C8
190
191 vector<int> k161 = {2, 8, 9}; // (10) C5+C6+C7
192 vector<int> k162 = {2, 9, 10}; // (10) C5+C6+C7
193
194 //vector<int> k17 = {2, 14, 15}; // (11) C11+C12 +forward gap
195
196 //vector<int> k18 = {1, 16}; // (11) B1 + forward gap
197
198 vector<int> kLOM1 = {2, 2, 3 }; // (1) F1+F2 + F3 + B1+B2
199 vector<int> kLOM2 = {2, 16, 17}; // (1) F1+F2 + F3 + B1+B2
200
201 m_BhabhaComb.clear();
202 m_BhabhaComb.resize(32, 0.0);
203 for (int iii = 1; iii <= k011[0]; iii++) { m_BhabhaComb[0] += PhiRingSum[k011[iii] - 1];}
204 for (int iii = 1; iii <= k012[0]; iii++) { m_BhabhaComb[1] += PhiRingSum[k012[iii] - 1];}
205 for (int iii = 1; iii <= k021[0]; iii++) { m_BhabhaComb[2] += PhiRingSum[k021[iii] - 1];}
206 for (int iii = 1; iii <= k022[0]; iii++) { m_BhabhaComb[3] += PhiRingSum[k022[iii] - 1];}
207 for (int iii = 1; iii <= k03[0]; iii++) { m_BhabhaComb[4] += PhiRingSum[k03[iii] - 1];}
208 for (int iii = 1; iii <= k04[0]; iii++) { m_BhabhaComb[5] += PhiRingSum[k04[iii] - 1];}
209 for (int iii = 1; iii <= k051[0]; iii++) { m_BhabhaComb[6] += PhiRingSum[k051[iii] - 1];}
210 for (int iii = 1; iii <= k052[0]; iii++) { m_BhabhaComb[7] += PhiRingSum[k052[iii] - 1];}
211 for (int iii = 1; iii <= k061[0]; iii++) { m_BhabhaComb[8] += PhiRingSum[k061[iii] - 1];}
212 for (int iii = 1; iii <= k062[0]; iii++) { m_BhabhaComb[9] += PhiRingSum[k062[iii] - 1];}
213 for (int iii = 1; iii <= k071[0]; iii++) { m_BhabhaComb[10] += PhiRingSum[k071[iii] - 1];}
214 for (int iii = 1; iii <= k072[0]; iii++) { m_BhabhaComb[11] += PhiRingSum[k072[iii] - 1];}
215 for (int iii = 1; iii <= k081[0]; iii++) { m_BhabhaComb[12] += PhiRingSum[k081[iii] - 1];}
216 for (int iii = 1; iii <= k082[0]; iii++) { m_BhabhaComb[13] += PhiRingSum[k082[iii] - 1];}
217 for (int iii = 1; iii <= k091[0]; iii++) { m_BhabhaComb[14] += PhiRingSum[k091[iii] - 1];}
218 for (int iii = 1; iii <= k092[0]; iii++) { m_BhabhaComb[15] += PhiRingSum[k092[iii] - 1];}
219 for (int iii = 1; iii <= k101[0]; iii++) { m_BhabhaComb[16] += PhiRingSum[k101[iii] - 1];}
220 for (int iii = 1; iii <= k102[0]; iii++) { m_BhabhaComb[17] += PhiRingSum[k102[iii] - 1];}
221 for (int iii = 1; iii <= k111[0]; iii++) { m_BhabhaComb[18] += PhiRingSum[k111[iii] - 1];}
222 for (int iii = 1; iii <= k112[0]; iii++) { m_BhabhaComb[19] += PhiRingSum[k112[iii] - 1];}
223 for (int iii = 1; iii <= k121[0]; iii++) { m_BhabhaComb[20] += PhiRingSum[k121[iii] - 1];}
224 for (int iii = 1; iii <= k122[0]; iii++) { m_BhabhaComb[21] += PhiRingSum[k122[iii] - 1];}
225 for (int iii = 1; iii <= k131[0]; iii++) { m_BhabhaComb[22] += PhiRingSum[k131[iii] - 1];}
226 for (int iii = 1; iii <= k132[0]; iii++) { m_BhabhaComb[23] += PhiRingSum[k132[iii] - 1];}
227 for (int iii = 1; iii <= k141[0]; iii++) { m_BhabhaComb[24] += PhiRingSum[k141[iii] - 1];}
228 for (int iii = 1; iii <= k142[0]; iii++) { m_BhabhaComb[25] += PhiRingSum[k142[iii] - 1];}
229 for (int iii = 1; iii <= k151[0]; iii++) { m_BhabhaComb[26] += PhiRingSum[k151[iii] - 1];}
230 for (int iii = 1; iii <= k152[0]; iii++) { m_BhabhaComb[27] += PhiRingSum[k152[iii] - 1];}
231 for (int iii = 1; iii <= k161[0]; iii++) { m_BhabhaComb[28] += PhiRingSum[k161[iii] - 1];}
232 for (int iii = 1; iii <= k162[0]; iii++) { m_BhabhaComb[29] += PhiRingSum[k162[iii] - 1];}
233 for (int iii = 1; iii <= kLOM1[0]; iii++) { m_BhabhaComb[30] += PhiRingSum[kLOM1[iii] - 1];}
234 for (int iii = 1; iii <= kLOM2[0]; iii++) { m_BhabhaComb[31] += PhiRingSum[kLOM2[iii] - 1];}
235
236
237 BtoBflag =
266
267 int bhabha01 = 0;
268 int bhabha02 = 0;
269 int bhabha03 = 0;
270 int bhabha04 = 0;
271 int bhabha05 = 0;
272 int bhabha06 = 0;
273 int bhabha07 = 0;
274 int bhabha08 = 0;
275 int bhabha09 = 0;
276 int bhabha10 = 0;
277 int bhabha11 = 0;
278 int bhabha12 = 0;
279 int bhabha13 = 0;
280 int bhabha14 = 0;
281
282 if ((m_BhabhaComb[0] >= m_2DBhabhaThresholdFWD[0] &&
283 m_BhabhaComb[1] >= m_2DBhabhaThresholdBWD[0])) {bhabha01 = 1;}
284 if ((m_BhabhaComb[2] >= m_2DBhabhaThresholdFWD[1] &&
285 m_BhabhaComb[3] >= m_2DBhabhaThresholdBWD[1])) {bhabha02 = 1;}
286 if ((m_BhabhaComb[6] >= m_2DBhabhaThresholdFWD[2] &&
287 m_BhabhaComb[7] >= m_2DBhabhaThresholdBWD[2])) {bhabha03 = 1;}
288 if ((m_BhabhaComb[8] >= m_2DBhabhaThresholdFWD[3] &&
289 m_BhabhaComb[9] >= m_2DBhabhaThresholdBWD[3])) {bhabha04 = 1;}
290 if ((m_BhabhaComb[10] >= m_2DBhabhaThresholdFWD[4] &&
291 m_BhabhaComb[11] >= m_2DBhabhaThresholdBWD[4])) {bhabha05 = 1;}
292 if ((m_BhabhaComb[12] >= m_2DBhabhaThresholdFWD[5] &&
293 m_BhabhaComb[13] >= m_2DBhabhaThresholdBWD[5])) {bhabha06 = 1;}
294 if ((m_BhabhaComb[14] >= m_2DBhabhaThresholdFWD[6] &&
295 m_BhabhaComb[15] >= m_2DBhabhaThresholdBWD[6])) {bhabha07 = 1;}
296 if ((m_BhabhaComb[16] >= m_2DBhabhaThresholdFWD[7] &&
297 m_BhabhaComb[17] >= m_2DBhabhaThresholdBWD[7])) {bhabha08 = 1;}
298 if ((m_BhabhaComb[18] >= m_2DBhabhaThresholdFWD[8] &&
299 m_BhabhaComb[19] >= m_2DBhabhaThresholdBWD[8])) {bhabha09 = 1;}
300 if ((m_BhabhaComb[20] >= m_2DBhabhaThresholdFWD[9] &&
301 m_BhabhaComb[21] >= m_2DBhabhaThresholdBWD[9])) {bhabha10 = 1;}
302 if ((m_BhabhaComb[22] >= m_2DBhabhaThresholdFWD[10] &&
303 m_BhabhaComb[23] >= m_2DBhabhaThresholdBWD[10])) {bhabha11 = 1;}
304 if ((m_BhabhaComb[24] >= m_2DBhabhaThresholdFWD[11] &&
305 m_BhabhaComb[25] >= m_2DBhabhaThresholdBWD[11])) {bhabha12 = 1;}
306 if ((m_BhabhaComb[26] >= m_2DBhabhaThresholdFWD[12] &&
307 m_BhabhaComb[27] >= m_2DBhabhaThresholdBWD[12])) {bhabha13 = 1;}
308 if ((m_BhabhaComb[28] >= m_2DBhabhaThresholdFWD[13] &&
309 m_BhabhaComb[29] >= m_2DBhabhaThresholdBWD[13])) {bhabha14 = 1;}
310
311 m_BhabhaComb.clear();
312 m_BhabhaComb.push_back(bhabha01);
313 m_BhabhaComb.push_back(bhabha02);
314 m_BhabhaComb.push_back(bhabha03);
315 m_BhabhaComb.push_back(bhabha04);
316 m_BhabhaComb.push_back(bhabha05);
317 m_BhabhaComb.push_back(bhabha06);
318 m_BhabhaComb.push_back(bhabha07);
319 m_BhabhaComb.push_back(bhabha08);
320 m_BhabhaComb.push_back(bhabha09);
321 m_BhabhaComb.push_back(bhabha10);
322 m_BhabhaComb.push_back(bhabha11);
323 m_BhabhaComb.push_back(bhabha12);
324 m_BhabhaComb.push_back(bhabha13);
325 m_BhabhaComb.push_back(bhabha14);
326 m_BhabhaComb.push_back(0);
327 m_BhabhaComb.push_back(0);
328 m_BhabhaComb.push_back(0);
329 m_BhabhaComb.push_back(0);
330
331 return BtoBflag;
332}
333//========================================================
334// 3D Bhabha veto
335//========================================================
337{
338 //
339 // Read Cluster Table
340 //
341 m_MaxTCId.clear();
342 m_ClusterEnergyLab.clear();
343 m_ClusterTiming.clear();
349 StoreArray<TRGECLCluster> trgeclClusterArray;
350 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
351 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
352 int maxTCId = aTRGECLCluster->getMaxTCId();
353 double clusterenergy = aTRGECLCluster->getEnergyDep();
354 double clustertiming = aTRGECLCluster->getTimeAve();
355 m_ClusterTiming.push_back(clustertiming);
356 m_ClusterEnergyLab.push_back(clusterenergy);
357 m_MaxTCId.push_back(maxTCId);
358 }
359 const int ncluster = m_ClusterEnergyLab.size();
360
361 int cl_idx1 = -1;
362 int cl_idx2 = -1;
363 bool BhabhaFlag = false;
364 for (int icluster = 0; icluster < ncluster ; icluster++) {
365 for (int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
366 bool BtoBFlag = false;
367
368 if (icluster == jcluster) {continue;}
369
370 int energy1 = 0;
371 int energy2 = 0;
372 int dphi = 0;
373 int thetaSum = 0;
374 get2CLETP(m_MaxTCId[icluster],
375 m_MaxTCId[jcluster],
376 energy1,
377 energy2,
378 dphi,
379 thetaSum);
380
381 if (dphi > m_3DBhabhaVetoAngle[0] &&
382 dphi < m_3DBhabhaVetoAngle[1] &&
383 thetaSum > m_3DBhabhaVetoAngle[2] &&
384 thetaSum < m_3DBhabhaVetoAngle[3]) {
385 BtoBFlag = true;
386 }
387
388 // CL E threshold cut
389 if ((m_ClusterEnergyLab[icluster] > m_3DBhabhaVetoThreshold[0] * energy1 * 0.1 &&
390 m_ClusterEnergyLab[jcluster] > m_3DBhabhaVetoThreshold[0] * energy2 * 0.1) &&
391 (m_ClusterEnergyLab[icluster] > m_3DBhabhaVetoThreshold[1] * energy1 * 0.1 ||
392 m_ClusterEnergyLab[jcluster] > m_3DBhabhaVetoThreshold[1] * energy2 * 0.1)) {
393 if (BtoBFlag) {
394 BhabhaFlag = true;
395 cl_idx1 = icluster;
396 cl_idx2 = jcluster;
397 }
398 }
399 }
400 }
401
402 if (BhabhaFlag) {
403 m_3DBhabhaVetoClusterTCIds.push_back(m_MaxTCId[cl_idx1]);
404 m_3DBhabhaVetoClusterTCIds.push_back(m_MaxTCId[cl_idx2]);
409 int cl_thetaid1 = m_TCMap->getTCThetaIdFromTCId(m_MaxTCId[cl_idx1]);
410 int cl_thetaid2 = m_TCMap->getTCThetaIdFromTCId(m_MaxTCId[cl_idx2]);
411 m_3DBhabhaVetoClusterThetaIds.push_back(cl_thetaid1);
412 m_3DBhabhaVetoClusterThetaIds.push_back(cl_thetaid2);
413 // set InTrack flag
414 if ((cl_thetaid1 >= m_3DBhabhaVetoInTrackThetaRegion[0] &&
415 cl_thetaid1 <= m_3DBhabhaVetoInTrackThetaRegion[1]) ||
416 (cl_thetaid2 >= m_3DBhabhaVetoInTrackThetaRegion[0] &&
417 cl_thetaid2 <= m_3DBhabhaVetoInTrackThetaRegion[1])) {
419 } else {
421 }
422 }
423
424 return BhabhaFlag;
425}
426//========================================================
427// 3D Bhabha Selection
428//========================================================
430{
431 //
432 // Read Cluster Table
433 //
434 m_MaxTCId.clear();
435 m_ClusterEnergyLab.clear();
436 m_ClusterTiming.clear();
438 StoreArray<TRGECLCluster> trgeclClusterArray;
439 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
440 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
441 int maxTCId = aTRGECLCluster->getMaxTCId();
442 double clusterenergy = aTRGECLCluster->getEnergyDep();
443 double clustertiming = aTRGECLCluster->getTimeAve();
444 m_ClusterTiming.push_back(clustertiming);
445 m_ClusterEnergyLab.push_back(clusterenergy);
446 m_MaxTCId.push_back(maxTCId);
447 }
448 const int ncluster = m_ClusterEnergyLab.size();
449
450 int cl_idx1 = -1;
451 int cl_idx2 = -1;
452 bool BhabhaFlag = false;
453 for (int icluster = 0; icluster < ncluster ; icluster++) {
454 for (int jcluster = icluster + 1; jcluster < ncluster; ++jcluster) {
455 bool BtoBFlag = false;
456
457 if (icluster == jcluster) {continue;}
458
459 int energy1 = 0;
460 int energy2 = 0;
461 int dphi = 0;
462 int thetaSum = 0;
463 get2CLETP(m_MaxTCId[icluster],
464 m_MaxTCId[jcluster],
465 energy1,
466 energy2,
467 dphi,
468 thetaSum);
469
470 if (dphi > m_3DBhabhaSelectionAngle[0] &&
471 dphi < m_3DBhabhaSelectionAngle[1] &&
472 thetaSum > m_3DBhabhaSelectionAngle[2] &&
473 thetaSum < m_3DBhabhaSelectionAngle[3]) {BtoBFlag = true;}
474
475 if ((m_ClusterEnergyLab[icluster] > m_3DBhabhaSelectionThreshold[0] * energy1 * 0.1 &&
476 m_ClusterEnergyLab[jcluster] > m_3DBhabhaSelectionThreshold[0] * energy2 * 0.1) &&
477 (m_ClusterEnergyLab[icluster] > m_3DBhabhaSelectionThreshold[1] * energy1 * 0.1 ||
478 m_ClusterEnergyLab[jcluster] > m_3DBhabhaSelectionThreshold[1] * energy2 * 0.1)) {
479 if (BtoBFlag) {
480 BhabhaFlag = true;
481 cl_idx1 = icluster;
482 cl_idx2 = jcluster;
483 }
484 }
485 }
486 }
487 if (BhabhaFlag) {
488 m_3DBhabhaSelectionClusterTCIds.push_back(m_MaxTCId[cl_idx1]);
489 m_3DBhabhaSelectionClusterTCIds.push_back(m_MaxTCId[cl_idx2]);
494 int cl_thetaid1 = m_TCMap->getTCThetaIdFromTCId(m_MaxTCId[cl_idx1]);
495 int cl_thetaid2 = m_TCMap->getTCThetaIdFromTCId(m_MaxTCId[cl_idx2]);
496 m_3DBhabhaSelectionClusterThetaIds.push_back(cl_thetaid1);
497 m_3DBhabhaSelectionClusterThetaIds.push_back(cl_thetaid2);
498 // set theta flag(2bits) for prescale in GDL
499 int cl_thetaid0 = (cl_thetaid1 < cl_thetaid2) ? cl_thetaid1 : cl_thetaid2;
500 if (cl_thetaid0 <= 0 || cl_thetaid0 >= 18) {
502 } else {
503 if (cl_thetaid0 == 1) { m_3DBhabhaSelectionThetaFlag = 0; }
504 else if (cl_thetaid0 == 2) { m_3DBhabhaSelectionThetaFlag = 1; }
505 else if (cl_thetaid0 == 3) { m_3DBhabhaSelectionThetaFlag = 2; }
506 else { m_3DBhabhaSelectionThetaFlag = 3; }
507 }
508 }
509
510 return BhabhaFlag;
511}
512//========================================================
513// mu pair trigger
514//========================================================
516{
517 bool MumuFlag = false;
518 //
519 // Read Cluster Table
520 //
521 m_MaxTCId.clear();
522 m_ClusterEnergyLab.clear();
523 m_ClusterTiming.clear();
524 StoreArray<TRGECLCluster> trgeclClusterArray;
525 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
526 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
527 int maxTCId = aTRGECLCluster->getMaxTCId();
528 double clusterenergy = aTRGECLCluster->getEnergyDep();
529 double clustertiming = aTRGECLCluster->getTimeAve();
530 m_ClusterTiming.push_back(clustertiming);
531 m_ClusterEnergyLab.push_back(clusterenergy);
532 m_MaxTCId.push_back(maxTCId);
533 }
534 const int ncluster = m_ClusterEnergyLab.size();
535
536 for (int icluster = 0; icluster < ncluster ; icluster++) {
537 for (int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
538
539 bool BtoBFlag = false;
540 if (icluster == jcluster) {continue;}
541
542 int energy1 = 0;
543 int energy2 = 0;
544 int dphi = 0;
545 int thetaSum = 0;
546 get2CLETP(m_MaxTCId[icluster],
547 m_MaxTCId[jcluster],
548 energy1,
549 energy2,
550 dphi,
551 thetaSum);
552
553 if (dphi > m_mumuAngle[0] &&
554 dphi < m_mumuAngle[1] &&
555 thetaSum > m_mumuAngle[2] &&
556 thetaSum < m_mumuAngle[3]) {
557 BtoBFlag = true;
558 }
559
560 double mumuEThresholdLab_1 = m_mumuThreshold * energy1 * 0.1; // GeV
561 double mumuEThresholdLab_2 = m_mumuThreshold * energy2 * 0.1; // GeV
562 if (m_ClusterEnergyLab[icluster] < mumuEThresholdLab_1 &&
563 m_ClusterEnergyLab[jcluster] < mumuEThresholdLab_2) {
564 if (BtoBFlag) {
565 MumuFlag = true;
566 }
567 }
568 }
569 }
570
571 return MumuFlag;
572}
573//========================================================
574// taub2b selection for tau 1x1 process
575//========================================================
576bool TrgEclBhabha::getTaub2b(double E_total1to17)
577{
578 //
579 // Read Cluster Table
580 //
581 m_MaxTCId.clear();
582 m_ClusterEnergyLab.clear();
583 m_ClusterTiming.clear();
584
588
589 if (E_total1to17 < m_taub2bEtotCut) {
591 }
592
593 StoreArray<TRGECLCluster> trgeclClusterArray;
594 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
595 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
596 int maxTCId = aTRGECLCluster->getMaxTCId();
597 double clusterenergy = aTRGECLCluster->getEnergyDep();
598 m_ClusterEnergyLab.push_back(clusterenergy);
599 m_MaxTCId.push_back(maxTCId);
600 }
601
602 const int ncluster = m_ClusterEnergyLab.size();
603
604 for (int icluster = 0; icluster < ncluster ; icluster++) {
605 for (int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
606
607 if (icluster == jcluster) {continue;}
608
609 int energy1 = 0;
610 int energy2 = 0;
611 int dphi = 0;
612 int thetaSum = 0;
613 get2CLETP(m_MaxTCId[icluster],
614 m_MaxTCId[jcluster],
615 energy1,
616 energy2,
617 dphi,
618 thetaSum);
619
620 if (dphi > m_taub2bAngleCut[0] &&
621 dphi < m_taub2bAngleCut[1] &&
622 thetaSum > m_taub2bAngleCut[2] &&
623 thetaSum < m_taub2bAngleCut[3]) {
625 //
626 if (m_ClusterEnergyLab[icluster] < m_taub2bCLELabCut ||
629 }
630 }
631 }
632 }
633
634 bool Taub2bFlag = false;
635 if (m_taub2bAngleFlag > 0 &&
636 m_taub2bEtotFlag > 0 &&
638 Taub2bFlag = true;
639 }
640
641 return Taub2bFlag;
642}
643//========================================================
644// taub2b selection for tau 1x1 process (tigher selection than taub2b
645//========================================================
646bool TrgEclBhabha::getTaub2b2(double E_total1to17)
647{
648 //
649 // Read Cluster Table
650 //
651 m_MaxTCId.clear();
652 m_ClusterEnergyLab.clear();
653 m_ClusterTiming.clear();
654
655 int taub2b2EtotFlag = 0;
656 int taub2b2AngleFlag = 0;
657 int taub2b2NCLEndcapFlag = 0;
658 int taub2b2AngleCLEFlag = 0;
659
660 if (E_total1to17 < m_taub2b2EtotCut) {
661 taub2b2EtotFlag = 1;
662 }
663
664 // counter of cluster for E(cluster)>threshold in endcap
665 int ncl_clecut_endcap = 0;
666 // cluster array loop
667 StoreArray<TRGECLCluster> trgeclClusterArray;
668 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
669 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
670 int maxTCId = aTRGECLCluster->getMaxTCId();
671 double clusterenergy = aTRGECLCluster->getEnergyDep();
672 double clusterthetaid = aTRGECLCluster->getMaxThetaId();
673 m_ClusterEnergyLab.push_back(clusterenergy);
674 m_MaxTCId.push_back(maxTCId);
675
676 // count N(cluster) of E(cluster) > threshold in endcap
677 if ((clusterthetaid <= 3 ||
678 clusterthetaid >= 16) &&
679 clusterenergy > m_taub2b2CLELabCut[0]) {
680 ncl_clecut_endcap++;
681 }
682 }
683
684 // bool for N(cluster) of E(cluster)>threshold in endcap
685 if (ncl_clecut_endcap < 2) {
686 taub2b2NCLEndcapFlag = 1;
687 }
688
689 // total number of cluster
690 const int ncluster = m_ClusterEnergyLab.size();
691
692 // 2 cluster combination
693 for (int icluster = 0; icluster < ncluster ; icluster++) {
694 for (int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
695 if (icluster == jcluster) {continue;}
696 int energy1 = 0;
697 int energy2 = 0;
698 int dphi = 0;
699 int thetaSum = 0;
700 get2CLETP(m_MaxTCId[icluster],
701 m_MaxTCId[jcluster],
702 energy1,
703 energy2,
704 dphi,
705 thetaSum);
706 // delta phi and theta sum selection
707 if (dphi > m_taub2b2AngleCut[0] &&
708 dphi < m_taub2b2AngleCut[1] &&
709 thetaSum > m_taub2b2AngleCut[2] &&
710 thetaSum < m_taub2b2AngleCut[3]) {
711 taub2b2AngleFlag++;
712 if (m_ClusterEnergyLab[icluster] > m_taub2b2CLELabCut[1] &&
713 m_ClusterEnergyLab[jcluster] > m_taub2b2CLELabCut[1]) {
714 taub2b2AngleCLEFlag++;
715 }
716 }
717 }
718 }
719 //
720 bool taub2b2Flag = false;
721 if (taub2b2EtotFlag > 0 &&
722 taub2b2AngleFlag > 0 &&
723 taub2b2NCLEndcapFlag > 0 &&
724 taub2b2AngleCLEFlag > 0) {
725 taub2b2Flag = true;
726 }
727
728 return taub2b2Flag;
729}
730
731
732//========================================================
733// taub2b3
734//========================================================
735bool TrgEclBhabha::getTaub2b3(double E_total1to17)
736{
737 //
738 // Read Cluster Table
739 //
740 m_MaxTCId.clear();
741 m_MaxTCThetaId.clear();
742 m_ClusterEnergyLab.clear();
743 m_ClusterTiming.clear();
744
745 int taub2b3EtotFlag = 0;
746 int taub2b3AngleCLEThetaIdFlag = 0;
747 int taub2b3CLELowCutFlag = 1;
748 int taub2b3CLEHighCutFlag = 1;
749
750 // Total Energy Etot < 7 GeV in lab
751 if (E_total1to17 < m_taub2b3EtotCut) {
752 taub2b3EtotFlag = 1;
753 }
754
755 // cluster array loop
756 StoreArray<TRGECLCluster> trgeclClusterArray;
757 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
758 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
759 int maxTCId = aTRGECLCluster->getMaxTCId();
760 double clusterenergy = aTRGECLCluster->getEnergyDep();
761 m_ClusterEnergyLab.push_back(clusterenergy);
762 m_MaxTCId.push_back(maxTCId);
763 m_MaxTCThetaId.push_back(aTRGECLCluster->getMaxThetaId());
764
765 // All clusters in the event should be E > 0.12 GeV in lab.
766 if (clusterenergy <= m_taub2b3CLELabCut[0]) {
767 taub2b3CLELowCutFlag = 0;
768 }
769 // The number of clusters with E > 4.5 GeV in lab should be 0.
770 if (clusterenergy > m_taub2b3CLELabCut[1]) {
771 taub2b3CLEHighCutFlag = 0;
772 }
773 }
774
775 // total number of cluster
776 const int ncluster = m_ClusterEnergyLab.size();
777
778 // 2 cluster combination
779 for (int icluster = 0; icluster < ncluster ; icluster++) {
780 for (int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
781 if (icluster == jcluster) {continue;}
782 int energy1 = 0;
783 int energy2 = 0;
784 int dphi = 0;
785 int thetaSum = 0;
786 get2CLETP(m_MaxTCId[icluster],
787 m_MaxTCId[jcluster],
788 energy1,
789 energy2,
790 dphi,
791 thetaSum);
792
793 // delta phi and theta sum selection in cms
794 if (dphi > m_taub2b3AngleCut[0] &&
795 dphi < m_taub2b3AngleCut[1] &&
796 thetaSum > m_taub2b3AngleCut[2] &&
797 thetaSum < m_taub2b3AngleCut[3]) {
798 // Cluster ThetaID selection
799 if (m_MaxTCThetaId[icluster] >= 2 &&
800 m_MaxTCThetaId[icluster] <= 16 &&
801 m_MaxTCThetaId[jcluster] >= 2 &&
802 m_MaxTCThetaId[jcluster] <= 16) {
803 // Cluster energy selection in lab
806 taub2b3AngleCLEThetaIdFlag++;
807 }
808 }
809 }
810 }
811 }
812 // all selections
813 bool taub2b3Flag = false;
814 if (taub2b3EtotFlag > 0 &&
815 taub2b3AngleCLEThetaIdFlag > 0 &&
816 taub2b3CLELowCutFlag > 0 &&
817 taub2b3CLEHighCutFlag > 0) {
818 taub2b3Flag = true;
819 }
820
821 return taub2b3Flag;
822}
823
824//========================================================
825// additional Bhabha veto
826//========================================================
828{
829
830 std::vector<int> MaxThetaId;
831 MaxThetaId.clear();
832 m_ClusterEnergyLab.clear();
833
834 int bit_bhabha_addition = 0;
835
836 StoreArray<TRGECLCluster> trgeclClusterArray;
837 for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
838 TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
839 int maxTCId = aTRGECLCluster->getMaxTCId();
840 m_MaxTCId.push_back(maxTCId);
841 int maxThetaId = aTRGECLCluster->getMaxThetaId();
842 MaxThetaId.push_back(maxThetaId);
843 double clusterenergy = aTRGECLCluster->getEnergyDep();
844 m_ClusterEnergyLab.push_back(clusterenergy);
845 }
846 int NofCluster1to17 = MaxThetaId.size();
847
848 if (NofCluster1to17 == 1) {
849 if (MaxThetaId[0] <= 3) {
850 bit_bhabha_addition |= 0x01;
851 }
852 } else if (NofCluster1to17 == 2) {
853
854 int energy1 = 0;
855 int energy2 = 0;
856 int dphi = 0;
857 int thetaSum = 0;
859 m_MaxTCId[1],
860 energy1,
861 energy2,
862 dphi,
863 thetaSum);
864
865 // for hie1
866 if ((dphi > m_hie12BhabhaVetoAngle[0] &&
867 dphi < m_hie12BhabhaVetoAngle[1]) &&
868 (thetaSum > m_hie12BhabhaVetoAngle[2] &&
869 thetaSum < m_hie12BhabhaVetoAngle[3])) {
870 bit_bhabha_addition |= 0x02;
871 }
872 // for hie2
873 if ((dphi > m_hie12BhabhaVetoAngle[0] &&
874 dphi < m_hie12BhabhaVetoAngle[1]) ||
875 (thetaSum > m_hie12BhabhaVetoAngle[2] &&
876 thetaSum < m_hie12BhabhaVetoAngle[3])) {
877 bit_bhabha_addition |= 0x04;
878 }
879
880 // for hie3 and hie4
881 // get thetaID of lower energy cluster
882 int lowe_MaxThetaId = 0;
884 lowe_MaxThetaId = MaxThetaId[0];
885 } else {
886 lowe_MaxThetaId = MaxThetaId[1];
887 }
888 // select cluster in endcap region
889 if (lowe_MaxThetaId <= 3 ||
890 lowe_MaxThetaId >= 16) {
891 // for hie3
892 bit_bhabha_addition |= 0x08;
893 // for hie4
894 // require low energy bound for cluster
897 bit_bhabha_addition |= 0x10;
898 }
899 }
900 }
901
902 return bit_bhabha_addition;
903}
904//========================================================
905// get cluster energy and angles(dphi and theta_sum) from LUT
906//========================================================
908 int TCId2,
909 int& energy1,
910 int& energy2,
911 int& dphi,
912 int& thetaSum)
913{
914 int lut1 = m_database->get3DBhabhaLUT(TCId1);
915 int lut2 = m_database->get3DBhabhaLUT(TCId2);
916 energy1 = 15 & lut1;
917 energy2 = 15 & lut2;
918 lut1 >>= 4;
919 lut2 >>= 4;
920 int phi1 = 511 & lut1;
921 int phi2 = 511 & lut2;
922 lut1 >>= 9;
923 lut2 >>= 9;
924 int theta1 = lut1;
925 int theta2 = lut2;
926
927 dphi = abs(phi1 - phi2);
928 thetaSum = theta1 + theta2;
929
930 return;
931}
932//========================================================
933//
934//========================================================
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
int getEntries() const
Get the number of objects in the array.
Definition StoreArray.h:216
Example Detector.
double getTimeAve() const
The method to get hit average time.
int getMaxThetaId()
The method to set Theta Id of maximum TC in Cluster.
double getEnergyDep() const
The method to get deposited energy.
int getMaxTCId() const
The method to get the Maximum(center) TC id.
int m_3DBhabhaSelectionThetaFlag
flag which shows theta position of clusters of 3DBhabha Selection.
int m_taub2bAngleFlag
taub2b 2 cluster angle cut flag
double m_taub2bEtotCut
taub2b total energy(TC theta id=1-17) cut (GeV)
std::vector< int > m_hie12BhabhaVetoAngle
hie12 bit, Angle selection of additional Bhabha veto in CMS in degree
std::vector< double > m_3DBhabhaSelectionClusterEnergies
Energies of two clusters used for 3D Bhabha selection (GeV)
std::vector< int > m_3DBhabhaSelectionClusterThetaIds
ThetaIDs of two clusters used for 3D Bhabha selection.
std::vector< int > m_3DBhabhaSelectionPreScale
3D Selection Bhabha pre-scale
std::vector< double > m_2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
TrgEclBhabha()
Constructor.
std::vector< int > m_taub2bAngleCut
taub2b 2 Cluster angle cut (degree)
void get2CLETP(int, int, int &, int &, int &, int &)
2 cluster energies, phi difference and theta sum
std::vector< double > m_3DBhabhaSelectionClusterTimings
Timings of two clusters used for 3D Bhabha selection (ns)
std::vector< int > m_mumuAngle
mumu bit Angle
std::vector< int > m_3DBhabhaVetoInTrackThetaRegion
theta region(low and high) of 3D Bhbabha veto InTrack
bool getmumu()
MuMu selection for calibration.
int m_3DBhabhaVetoInTrackFlag
trigger bit of flag(1bit) whether two clusters satisfy 3D Bhabha veto are in CDCTRG region in theta (...
double m_hie4LowCLELabCut
(hie4) CL E cut for minimum energy cluster in Lab in GeV
std::vector< double > m_3DBhabhaVetoClusterEnergies
Energies of two clusters of 3D Bhabha veto (GeV)
std::vector< int > m_3DBhabhaSelectionClusterTCIds
TCIDs of two clusters of 3D Bhabha selection.
int m_taub2bEtotFlag
taub2b total energy(TC theta id=1-17) flag
std::vector< int > m_3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
std::vector< double > m_BhabhaComb
Bhabha Combination.
bool getBhabha02()
Belle II 3D Bhabha method for selection.
std::vector< double > m_3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
double m_taub2b2EtotCut
taub2b2 total energy cut (GeV)
bool getTaub2b3(double)
Taub2b3.
std::vector< double > m_taub2b2CLELabCut
taub2b2 cluster energy cut(high, low) (GeV) in lab
std::vector< double > m_ClusterTiming
Cluster Timing.
bool getBhabha00(std::vector< double >)
Belle 2D Bhabha veto method.
std::vector< int > m_3DBhabhaVetoClusterThetaIds
ThetaIds of two clusters of 3D Bhabha veto.
std::vector< double > m_3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
std::vector< double > m_ClusterEnergyLab
Cluster Energy.
bool getBhabha01()
Belle II 3D Bhabha method for veto.
bool getTaub2b(double)
Taub2b selection.
std::vector< double > m_MaxTCId
Max TC Id.
std::vector< int > m_3DBhabhaVetoClusterTCIds
TCIDs of two clusters of 3D Bhabha veto.
double m_taub2bCLELabCut
taub2b Cluster one of energy cut in b2b in lab (GeV)
double m_mumuThreshold
mumu bit Energy Threshold
std::vector< int > m_3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
std::vector< int > m_taub2b2AngleCut
taub2b2 two Cluster angle cut (degree)
double m_taub2b3EtotCut
taub2b3 total energy (TC theta ID =1-17) (GeV)
std::vector< double > m_3DBhabhaVetoClusterTimings
Timings of two clusters of 3D Bhabha veto (ns)
int m_taub2bClusterEFlag
taub2b Cluster energy flag
std::vector< double > m_MaxTCThetaId
Cluster ThetaId.
double m_taub2b3CLEb2bLabCut
taub2b3 cluster energy cut (GeV) with b2b cluster condition in lab
bool getTaub2b2(double)
Taub2b selection (tighter selection than Taub2b)
TrgEclDataBase * m_database
Object of Trigger ECL DataBase.
int getBhabhaAddition(void)
Additional Bhabha veto.
virtual ~TrgEclBhabha()
Constructor.
std::vector< double > m_2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
TrgEclMapping * m_TCMap
Object of TC Mapping.
std::vector< double > m_taub2b3CLELabCut
taub2b3 cluster energy cut (GeV) for all clusters in lab
std::vector< int > m_taub2b3AngleCut
taub2b3 selection cuts (3,2,1,0) = (dphi low, dphi high, theta_sum low, theta_sum high)
class TrgEclDataBase;
A class of TC Mapping.
Abstract base class for different kinds of events.
STL namespace.