51 #define TRG_SHORT_NAMES
52 #define TRGECLCLUSTER_SHORT_NAMES
53 #include <framework/gearbox/Unit.h>
54 #include "framework/datastore/StoreArray.h"
56 #include <trg/ecl/TrgEclBhabha.h>
58 #include "trg/ecl/dataobjects/TRGECLCluster.h"
60 #include <analysis/utility/PCmsLabTransform.h>
67 TrgEclBhabha::TrgEclBhabha():
69 m_3DBhabhaVetoInTrackThetaRegion(3, 15)
88 m_3DBhabhaAddAngleCut.clear();
90 _2DBhabhaThresholdFWD = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 30, 35};
91 _2DBhabhaThresholdBWD = {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 30};
97 m_3DBhabhaAddAngleCut = {150, 210, 160, 200};
99 m_3DBhabhaVetoInTrackFlag = -10;
100 m_3DBhabhaVetoClusterTCIds.clear();
101 m_3DBhabhaVetoClusterEnergies.clear();
102 m_3DBhabhaVetoClusterTimings.clear();
103 m_3DBhabhaVetoClusterThetaIds.clear();
105 m_3DBhabhaVetoInTrackFlag = -10;
107 m_taub2bEtotCut = 7.0;
108 m_taub2bClusterECut1 = 1.9;
109 m_taub2bClusterECut2 = 999.0;
110 m_taub2bAngleFlag = 0;
111 m_taub2bEtotFlag = 0;
112 m_taub2bClusterEFlag = 0;
114 m_taub2b2EtotCut = 7.0;
115 m_taub2b2CLEEndcapCut = 3.0;
116 m_taub2b2CLECut = 1.62;
132 bool BtoBflag =
false;
135 vector<int> k011 = {3, 1, 2, 3 };
136 vector<int> k012 = {2, 16, 17};
138 vector<int> k021 = {1, 3};
139 vector<int> k022 = {1, 15};
141 vector<int> k03 = {2, 2, 3};
143 vector<int> k04 = {1, 4};
145 vector<int> k051 = {1, 4 };
146 vector<int> k052 = {2, 14, 15};
148 vector<int> k061 = {1, 5};
149 vector<int> k062 = {2, 14, 15};
151 vector<int> k071 = {2, 4, 5};
152 vector<int> k072 = {1, 14};
154 vector<int> k081 = {1, 5};
155 vector<int> k082 = {2, 13, 14};
157 vector<int> k091 = {1, 5 };
158 vector<int> k092 = {2, 12, 13};
160 vector<int> k101 = {2, 5, 6};
161 vector<int> k102 = {1, 13};
163 vector<int> k111 = {2, 5, 6};
164 vector<int> k112 = {1, 12};
166 vector<int> k121 = {2, 6, 7};
167 vector<int> k122 = {1, 12};
169 vector<int> k131 = {2, 6, 7};
170 vector<int> k132 = {1, 11};
172 vector<int> k141 = {2, 7, 8};
173 vector<int> k142 = {1, 11};
176 vector<int> k151 = {1, 8};
177 vector<int> k152 = {2, 10, 11};
179 vector<int> k161 = {2, 8, 9};
180 vector<int> k162 = {2, 9, 10};
186 vector<int> kLOM1 = {2, 2, 3 };
187 vector<int> kLOM2 = {2, 16, 17};
191 for (
int iii = 1; iii <= k011[0]; iii++) {
BhabhaComb[0] += PhiRingSum[k011[iii] - 1];}
192 for (
int iii = 1; iii <= k012[0]; iii++) {
BhabhaComb[1] += PhiRingSum[k012[iii] - 1];}
193 for (
int iii = 1; iii <= k021[0]; iii++) {
BhabhaComb[2] += PhiRingSum[k021[iii] - 1]; }
194 for (
int iii = 1; iii <= k022[0]; iii++) {
BhabhaComb[3] += PhiRingSum[k022[iii] - 1]; }
195 for (
int iii = 1; iii <= k03[0]; iii++) {
BhabhaComb[4] += PhiRingSum[k03[iii] - 1]; }
196 for (
int iii = 1; iii <= k04[0]; iii++) {
BhabhaComb[5] += PhiRingSum[k04[iii] - 1]; }
197 for (
int iii = 1; iii <= k051[0]; iii++) {
BhabhaComb[6] += PhiRingSum[k051[iii] - 1]; }
198 for (
int iii = 1; iii <= k052[0]; iii++) {
BhabhaComb[7] += PhiRingSum[k052[iii] - 1]; }
199 for (
int iii = 1; iii <= k061[0]; iii++) {
BhabhaComb[8] += PhiRingSum[k061[iii] - 1]; }
200 for (
int iii = 1; iii <= k062[0]; iii++) {
BhabhaComb[9] += PhiRingSum[k062[iii] - 1]; }
201 for (
int iii = 1; iii <= k071[0]; iii++) {
BhabhaComb[10] += PhiRingSum[k071[iii] - 1]; }
202 for (
int iii = 1; iii <= k072[0]; iii++) {
BhabhaComb[11] += PhiRingSum[k072[iii] - 1]; }
203 for (
int iii = 1; iii <= k081[0]; iii++) {
BhabhaComb[12] += PhiRingSum[k081[iii] - 1]; }
204 for (
int iii = 1; iii <= k082[0]; iii++) {
BhabhaComb[13] += PhiRingSum[k082[iii] - 1]; }
205 for (
int iii = 1; iii <= k091[0]; iii++) {
BhabhaComb[14] += PhiRingSum[k091[iii] - 1]; }
206 for (
int iii = 1; iii <= k092[0]; iii++) {
BhabhaComb[15] += PhiRingSum[k092[iii] - 1]; }
207 for (
int iii = 1; iii <= k101[0]; iii++) {
BhabhaComb[16] += PhiRingSum[k101[iii] - 1]; }
208 for (
int iii = 1; iii <= k102[0]; iii++) {
BhabhaComb[17] += PhiRingSum[k102[iii] - 1]; }
209 for (
int iii = 1; iii <= k111[0]; iii++) {
BhabhaComb[18] += PhiRingSum[k111[iii] - 1]; }
210 for (
int iii = 1; iii <= k112[0]; iii++) {
BhabhaComb[19] += PhiRingSum[k112[iii] - 1]; }
211 for (
int iii = 1; iii <= k121[0]; iii++) {
BhabhaComb[20] += PhiRingSum[k121[iii] - 1]; }
212 for (
int iii = 1; iii <= k122[0]; iii++) {
BhabhaComb[21] += PhiRingSum[k122[iii] - 1]; }
213 for (
int iii = 1; iii <= k131[0]; iii++) {
BhabhaComb[22] += PhiRingSum[k131[iii] - 1]; }
214 for (
int iii = 1; iii <= k132[0]; iii++) {
BhabhaComb[23] += PhiRingSum[k132[iii] - 1]; }
215 for (
int iii = 1; iii <= k141[0]; iii++) {
BhabhaComb[24] += PhiRingSum[k141[iii] - 1]; }
216 for (
int iii = 1; iii <= k142[0]; iii++) {
BhabhaComb[25] += PhiRingSum[k142[iii] - 1]; }
217 for (
int iii = 1; iii <= k151[0]; iii++) {
BhabhaComb[26] += PhiRingSum[k151[iii] - 1]; }
218 for (
int iii = 1; iii <= k152[0]; iii++) {
BhabhaComb[27] += PhiRingSum[k152[iii] - 1]; }
219 for (
int iii = 1; iii <= k161[0]; iii++) {
BhabhaComb[28] += PhiRingSum[k161[iii] - 1]; }
220 for (
int iii = 1; iii <= k162[0]; iii++) {
BhabhaComb[29] += PhiRingSum[k162[iii] - 1]; }
221 for (
int iii = 1; iii <= kLOM1[0]; iii++) {
BhabhaComb[30] += PhiRingSum[kLOM1[iii] - 1];}
222 for (
int iii = 1; iii <= kLOM2[0]; iii++) {
BhabhaComb[31] += PhiRingSum[kLOM2[iii] - 1];}
333 m_3DBhabhaVetoInTrackFlag = -1;
334 m_3DBhabhaVetoClusterTCIds.clear();
335 m_3DBhabhaVetoClusterEnergies.clear();
336 m_3DBhabhaVetoClusterTimings.clear();
337 m_3DBhabhaVetoClusterThetaIds.clear();
340 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
345 double clustertiming = aTRGECLCluster->
getTimeAve();
346 TVector3 clusterposition(aTRGECLCluster->
getPositionX(),
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;
368 if (icluster == jcluster) {
continue;}
398 m_3DBhabhaVetoClusterTCIds.push_back(
MaxTCId[cl_idx1]);
399 m_3DBhabhaVetoClusterTCIds.push_back(
MaxTCId[cl_idx2]);
400 m_3DBhabhaVetoClusterEnergies.push_back(
ClusterEnergy[cl_idx1]);
401 m_3DBhabhaVetoClusterEnergies.push_back(
ClusterEnergy[cl_idx2]);
402 m_3DBhabhaVetoClusterTimings.push_back(
ClusterTiming[cl_idx1]);
403 m_3DBhabhaVetoClusterTimings.push_back(
ClusterTiming[cl_idx2]);
406 m_3DBhabhaVetoClusterThetaIds.push_back(cl_thetaid1);
407 m_3DBhabhaVetoClusterThetaIds.push_back(cl_thetaid2);
409 if (cl_thetaid1 >= m_3DBhabhaVetoInTrackThetaRegion[0] &&
410 cl_thetaid1 <= m_3DBhabhaVetoInTrackThetaRegion[1] &&
411 cl_thetaid2 >= m_3DBhabhaVetoInTrackThetaRegion[0] &&
412 cl_thetaid2 <= m_3DBhabhaVetoInTrackThetaRegion[1]) {
413 m_3DBhabhaVetoInTrackFlag = 1;
415 m_3DBhabhaVetoInTrackFlag = 0;
433 m_3DBhabhaSelectionThetaFlag = -1;
436 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
441 double clustertiming = aTRGECLCluster->
getTimeAve();
442 TVector3 clusterposition(aTRGECLCluster->
getPositionX(),
459 bool BhabhaFlag =
false;
460 for (
int icluster = 0; icluster < ncluster ; icluster++) {
461 for (
int jcluster = icluster + 1; jcluster < ncluster; ++jcluster) {
462 bool BtoBFlag =
false;
464 if (icluster == jcluster) {
continue;}
494 m_3DBhabhaSelectionClusterTCIds.push_back(
MaxTCId[cl_idx1]);
495 m_3DBhabhaSelectionClusterTCIds.push_back(
MaxTCId[cl_idx2]);
496 m_3DBhabhaSelectionClusterEnergies.push_back(
ClusterEnergy[cl_idx1]);
497 m_3DBhabhaSelectionClusterEnergies.push_back(
ClusterEnergy[cl_idx2]);
498 m_3DBhabhaSelectionClusterTimings.push_back(
ClusterTiming[cl_idx1]);
499 m_3DBhabhaSelectionClusterTimings.push_back(
ClusterTiming[cl_idx2]);
502 m_3DBhabhaSelectionClusterThetaIds.push_back(cl_thetaid1);
503 m_3DBhabhaSelectionClusterThetaIds.push_back(cl_thetaid2);
505 int cl_thetaid0 = (cl_thetaid1 < cl_thetaid2) ? cl_thetaid1 : cl_thetaid2;
506 if (cl_thetaid0 <= 0 || cl_thetaid0 >= 18) {
507 m_3DBhabhaSelectionThetaFlag = -2;
509 if (cl_thetaid0 == 1) { m_3DBhabhaSelectionThetaFlag = 0; }
510 else if (cl_thetaid0 == 2) { m_3DBhabhaSelectionThetaFlag = 1; }
511 else if (cl_thetaid0 == 3) { m_3DBhabhaSelectionThetaFlag = 2; }
512 else { m_3DBhabhaSelectionThetaFlag = 3; }
523 bool BtoBFlag =
false;
524 bool BhabhaFlag =
false;
534 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
539 double clustertiming = aTRGECLCluster->
getTimeAve();
540 TVector3 clusterposition(aTRGECLCluster->
getPositionX(),
557 for (
int icluster = 0; icluster < ncluster ; icluster++) {
558 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
560 if (icluster == jcluster) {
continue;}
579 if (BtoBFlag) {BhabhaFlag =
true;}
598 m_taub2bAngleFlag = 0;
599 m_taub2bEtotFlag = 0;
600 m_taub2bClusterEFlag = 0;
602 if (E_total1to17 < m_taub2bEtotCut) {
603 m_taub2bEtotFlag = 1;
607 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
617 for (
int icluster = 0; icluster < ncluster ; icluster++) {
618 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
620 if (icluster == jcluster) {
continue;}
633 if (dphi > m_taub2bAngleCut[0] &&
634 dphi < m_taub2bAngleCut[1] &&
635 thetaSum > m_taub2bAngleCut[2] &&
636 thetaSum < m_taub2bAngleCut[3]) {
643 m_taub2bClusterEFlag++;
649 bool Taub2bFlag =
false;
650 if (m_taub2bAngleFlag > 0 &&
651 m_taub2bEtotFlag > 0 &&
652 m_taub2bClusterEFlag > 0) {
671 int taub2b2EtotFlag = 0;
672 int taub2b2AngleFlag = 0;
673 int taub2b2NCLEndcapFlag = 0;
674 int taub2b2AngleCLEFlag = 0;
676 if (E_total1to17 < m_taub2b2EtotCut) {
681 int ncl_clecut_endcap = 0;
684 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
692 if ((clusterthetaid <= 3 ||
693 clusterthetaid >= 16) &&
694 clusterenergy > m_taub2b2CLEEndcapCut) {
700 if (ncl_clecut_endcap < 2) {
701 taub2b2NCLEndcapFlag = 1;
708 for (
int icluster = 0; icluster < ncluster ; icluster++) {
709 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
710 if (icluster == jcluster) {
continue;}
722 if (dphi > m_taub2b2AngleCut[0] &&
723 dphi < m_taub2b2AngleCut[1] &&
724 thetaSum > m_taub2b2AngleCut[2] &&
725 thetaSum < m_taub2b2AngleCut[3]) {
729 taub2b2AngleCLEFlag++;
735 bool taub2b2Flag =
false;
736 if (taub2b2EtotFlag > 0 &&
737 taub2b2AngleFlag > 0 &&
738 taub2b2NCLEndcapFlag > 0 &&
739 taub2b2AngleCLEFlag > 0) {
748 int TrgEclBhabha::GetBhabhaAddition(
void)
751 std::vector<int> MaxThetaId;
753 int bit_bhabha_addition = 0;
756 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
761 MaxThetaId.push_back(maxThetaId);
763 int NofCluster1to17 = MaxThetaId.size();
765 if (NofCluster1to17 == 1) {
766 if (MaxThetaId[0] <= 3) {
767 bit_bhabha_addition |= 0x01;
769 }
else if (NofCluster1to17 == 2) {
782 if ((dphi > m_3DBhabhaAddAngleCut[0] &&
783 dphi < m_3DBhabhaAddAngleCut[1]) &&
784 (thetaSum > m_3DBhabhaAddAngleCut[2] &&
785 thetaSum < m_3DBhabhaAddAngleCut[3])) {
786 bit_bhabha_addition |= 0x02;
788 if ((dphi > m_3DBhabhaAddAngleCut[0] &&
789 dphi < m_3DBhabhaAddAngleCut[1]) ||
790 (thetaSum > m_3DBhabhaAddAngleCut[2] &&
791 thetaSum < m_3DBhabhaAddAngleCut[3])) {
792 bit_bhabha_addition |= 0x04;
795 int lowe_MaxThetaId = 0;
796 if (energy1 < energy2) {
797 lowe_MaxThetaId = MaxThetaId[0];
799 lowe_MaxThetaId = MaxThetaId[1];
801 if (lowe_MaxThetaId <= 3 ||
802 lowe_MaxThetaId >= 16) {
803 bit_bhabha_addition |= 0x08;
808 return bit_bhabha_addition;
826 int phi1 = 511 & lut1;
827 int phi2 = 511 & lut2;
832 dphi = abs(phi1 - phi2);
833 if (dphi > 180) {dphi = 360 - dphi;}
834 thetaSum = theta1 + theta2;
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
double getTimeAve() const
The method to get hit average time.
double getPositionZ() const
Get Energy weighted position Z.
int getMaxThetaId()
The method to set Theta Id of maximum TC in Cluster.
double getEnergyDep() const
The method to get deposited energy.
double getPositionX() const
The method to get hit average time Get Energy weighted position X.
double getPositionY() const
Get Energy weighted position Y.
int getMaxTCId() const
The method to get the Maximum(center) TC id.
bool GetBhabha00(std::vector< double >)
Belle 2D Bhabha veto method.
bool Getmumu()
MuMu selection for calibration.
std::vector< double > MaxTCId
Max TC Id.
void get2CLETP(int, int, int &, int &, int &, int &)
2 cluster energies, phi difference and theta sum
std::vector< TVector3 > ClusterPosition
Cluster Timing.
double _mumuThreshold
mumu bit Energy Threshold
TrgEclDataBase * _database
Object of Trigger ECL DataBase.
std::vector< double > _mumuAngle
mumu bit Angle
std::vector< double > _3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
std::vector< double > ClusterTiming
Cluster Timing.
bool GetBhabha02()
Belle II 3D Bhabha method for selection.
std::vector< double > _3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
std::vector< double > _2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
std::vector< double > BhabhaComb
Bhabha Combination.
std::vector< double > _3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
bool GetTaub2b(double)
Taub2b selection.
bool GetBhabha01()
Belle II 3D Bhabha method for veto.
virtual ~TrgEclBhabha()
Constructor.
std::vector< double > ClusterEnergy
Cluster Energy.
TrgEclMapping * _TCMap
Object of TC Mapping.
std::vector< double > _2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
std::vector< double > _3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
bool GetTaub2b2(double)
Taub2b selection (tighter selection than Taub2b)
int Get3DBhabhaLUT(int)
TC CM Phi
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
Abstract base class for different kinds of events.