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>
69 m_3DBhabhaVetoInTrackThetaRegion(3, 15)
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};
138 bool BtoBflag =
false;
141 vector<int> k011 = {3, 1, 2, 3 };
142 vector<int> k012 = {2, 16, 17};
144 vector<int> k021 = {1, 3};
145 vector<int> k022 = {1, 15};
147 vector<int> k03 = {2, 2, 3};
149 vector<int> k04 = {1, 4};
151 vector<int> k051 = {1, 4 };
152 vector<int> k052 = {2, 14, 15};
154 vector<int> k061 = {1, 5};
155 vector<int> k062 = {2, 14, 15};
157 vector<int> k071 = {2, 4, 5};
158 vector<int> k072 = {1, 14};
160 vector<int> k081 = {1, 5};
161 vector<int> k082 = {2, 13, 14};
163 vector<int> k091 = {1, 5 };
164 vector<int> k092 = {2, 12, 13};
166 vector<int> k101 = {2, 5, 6};
167 vector<int> k102 = {1, 13};
169 vector<int> k111 = {2, 5, 6};
170 vector<int> k112 = {1, 12};
172 vector<int> k121 = {2, 6, 7};
173 vector<int> k122 = {1, 12};
175 vector<int> k131 = {2, 6, 7};
176 vector<int> k132 = {1, 11};
178 vector<int> k141 = {2, 7, 8};
179 vector<int> k142 = {1, 11};
182 vector<int> k151 = {1, 8};
183 vector<int> k152 = {2, 10, 11};
185 vector<int> k161 = {2, 8, 9};
186 vector<int> k162 = {2, 9, 10};
192 vector<int> kLOM1 = {2, 2, 3 };
193 vector<int> kLOM2 = {2, 16, 17};
197 for (
int iii = 1; iii <= k011[0]; iii++) {
BhabhaComb[0] += PhiRingSum[k011[iii] - 1];}
198 for (
int iii = 1; iii <= k012[0]; iii++) {
BhabhaComb[1] += PhiRingSum[k012[iii] - 1];}
199 for (
int iii = 1; iii <= k021[0]; iii++) {
BhabhaComb[2] += PhiRingSum[k021[iii] - 1]; }
200 for (
int iii = 1; iii <= k022[0]; iii++) {
BhabhaComb[3] += PhiRingSum[k022[iii] - 1]; }
201 for (
int iii = 1; iii <= k03[0]; iii++) {
BhabhaComb[4] += PhiRingSum[k03[iii] - 1]; }
202 for (
int iii = 1; iii <= k04[0]; iii++) {
BhabhaComb[5] += PhiRingSum[k04[iii] - 1]; }
203 for (
int iii = 1; iii <= k051[0]; iii++) {
BhabhaComb[6] += PhiRingSum[k051[iii] - 1]; }
204 for (
int iii = 1; iii <= k052[0]; iii++) {
BhabhaComb[7] += PhiRingSum[k052[iii] - 1]; }
205 for (
int iii = 1; iii <= k061[0]; iii++) {
BhabhaComb[8] += PhiRingSum[k061[iii] - 1]; }
206 for (
int iii = 1; iii <= k062[0]; iii++) {
BhabhaComb[9] += PhiRingSum[k062[iii] - 1]; }
207 for (
int iii = 1; iii <= k071[0]; iii++) {
BhabhaComb[10] += PhiRingSum[k071[iii] - 1]; }
208 for (
int iii = 1; iii <= k072[0]; iii++) {
BhabhaComb[11] += PhiRingSum[k072[iii] - 1]; }
209 for (
int iii = 1; iii <= k081[0]; iii++) {
BhabhaComb[12] += PhiRingSum[k081[iii] - 1]; }
210 for (
int iii = 1; iii <= k082[0]; iii++) {
BhabhaComb[13] += PhiRingSum[k082[iii] - 1]; }
211 for (
int iii = 1; iii <= k091[0]; iii++) {
BhabhaComb[14] += PhiRingSum[k091[iii] - 1]; }
212 for (
int iii = 1; iii <= k092[0]; iii++) {
BhabhaComb[15] += PhiRingSum[k092[iii] - 1]; }
213 for (
int iii = 1; iii <= k101[0]; iii++) {
BhabhaComb[16] += PhiRingSum[k101[iii] - 1]; }
214 for (
int iii = 1; iii <= k102[0]; iii++) {
BhabhaComb[17] += PhiRingSum[k102[iii] - 1]; }
215 for (
int iii = 1; iii <= k111[0]; iii++) {
BhabhaComb[18] += PhiRingSum[k111[iii] - 1]; }
216 for (
int iii = 1; iii <= k112[0]; iii++) {
BhabhaComb[19] += PhiRingSum[k112[iii] - 1]; }
217 for (
int iii = 1; iii <= k121[0]; iii++) {
BhabhaComb[20] += PhiRingSum[k121[iii] - 1]; }
218 for (
int iii = 1; iii <= k122[0]; iii++) {
BhabhaComb[21] += PhiRingSum[k122[iii] - 1]; }
219 for (
int iii = 1; iii <= k131[0]; iii++) {
BhabhaComb[22] += PhiRingSum[k131[iii] - 1]; }
220 for (
int iii = 1; iii <= k132[0]; iii++) {
BhabhaComb[23] += PhiRingSum[k132[iii] - 1]; }
221 for (
int iii = 1; iii <= k141[0]; iii++) {
BhabhaComb[24] += PhiRingSum[k141[iii] - 1]; }
222 for (
int iii = 1; iii <= k142[0]; iii++) {
BhabhaComb[25] += PhiRingSum[k142[iii] - 1]; }
223 for (
int iii = 1; iii <= k151[0]; iii++) {
BhabhaComb[26] += PhiRingSum[k151[iii] - 1]; }
224 for (
int iii = 1; iii <= k152[0]; iii++) {
BhabhaComb[27] += PhiRingSum[k152[iii] - 1]; }
225 for (
int iii = 1; iii <= k161[0]; iii++) {
BhabhaComb[28] += PhiRingSum[k161[iii] - 1]; }
226 for (
int iii = 1; iii <= k162[0]; iii++) {
BhabhaComb[29] += PhiRingSum[k162[iii] - 1]; }
227 for (
int iii = 1; iii <= kLOM1[0]; iii++) {
BhabhaComb[30] += PhiRingSum[kLOM1[iii] - 1];}
228 for (
int iii = 1; iii <= kLOM2[0]; iii++) {
BhabhaComb[31] += PhiRingSum[kLOM2[iii] - 1];}
346 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
351 double clustertiming = aTRGECLCluster->
getTimeAve();
352 ROOT::Math::XYZVector clusterposition(aTRGECLCluster->
getPositionX(),
369 bool BhabhaFlag =
false;
370 for (
int icluster = 0; icluster < ncluster ; icluster++) {
371 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
372 bool BtoBFlag =
false;
374 if (icluster == jcluster) {
continue;}
442 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
447 double clustertiming = aTRGECLCluster->
getTimeAve();
448 ROOT::Math::XYZVector clusterposition(aTRGECLCluster->
getPositionX(),
465 bool BhabhaFlag =
false;
466 for (
int icluster = 0; icluster < ncluster ; icluster++) {
467 for (
int jcluster = icluster + 1; jcluster < ncluster; ++jcluster) {
468 bool BtoBFlag =
false;
470 if (icluster == jcluster) {
continue;}
511 int cl_thetaid0 = (cl_thetaid1 < cl_thetaid2) ? cl_thetaid1 : cl_thetaid2;
512 if (cl_thetaid0 <= 0 || cl_thetaid0 >= 18) {
529 bool BtoBFlag =
false;
530 bool BhabhaFlag =
false;
540 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
545 double clustertiming = aTRGECLCluster->
getTimeAve();
546 ROOT::Math::XYZVector clusterposition(aTRGECLCluster->
getPositionX(),
563 for (
int icluster = 0; icluster < ncluster ; icluster++) {
564 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
566 if (icluster == jcluster) {
continue;}
585 if (BtoBFlag) {BhabhaFlag =
true;}
613 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
623 for (
int icluster = 0; icluster < ncluster ; icluster++) {
624 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
626 if (icluster == jcluster) {
continue;}
655 bool Taub2bFlag =
false;
677 int taub2b2EtotFlag = 0;
678 int taub2b2AngleFlag = 0;
679 int taub2b2NCLEndcapFlag = 0;
680 int taub2b2AngleCLEFlag = 0;
687 int ncl_clecut_endcap = 0;
690 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
698 if ((clusterthetaid <= 3 ||
699 clusterthetaid >= 16) &&
706 if (ncl_clecut_endcap < 2) {
707 taub2b2NCLEndcapFlag = 1;
714 for (
int icluster = 0; icluster < ncluster ; icluster++) {
715 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
716 if (icluster == jcluster) {
continue;}
735 taub2b2AngleCLEFlag++;
741 bool taub2b2Flag =
false;
742 if (taub2b2EtotFlag > 0 &&
743 taub2b2AngleFlag > 0 &&
744 taub2b2NCLEndcapFlag > 0 &&
745 taub2b2AngleCLEFlag > 0) {
767 int taub2b3EtotFlag = 0;
768 int taub2b3AngleCLEThetaIdFlag = 0;
769 int taub2b3CLELowCutFlag = 1;
770 int taub2b3CLEHighCutFlag = 1;
779 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
789 taub2b3CLELowCutFlag = 0;
793 taub2b3CLEHighCutFlag = 0;
801 for (
int icluster = 0; icluster < ncluster ; icluster++) {
802 for (
int jcluster = icluster + 1; jcluster < ncluster; jcluster ++) {
803 if (icluster == jcluster) {
continue;}
828 taub2b3AngleCLEThetaIdFlag++;
835 bool taub2b3Flag =
false;
836 if (taub2b3EtotFlag > 0 &&
837 taub2b3AngleCLEThetaIdFlag > 0 &&
838 taub2b3CLELowCutFlag > 0 &&
839 taub2b3CLEHighCutFlag > 0) {
852 std::vector<int> MaxThetaId;
856 int bit_bhabha_addition = 0;
859 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
864 MaxThetaId.push_back(maxThetaId);
868 int NofCluster1to17 = MaxThetaId.size();
870 if (NofCluster1to17 == 1) {
871 if (MaxThetaId[0] <= 3) {
872 bit_bhabha_addition |= 0x01;
874 }
else if (NofCluster1to17 == 2) {
892 bit_bhabha_addition |= 0x02;
899 bit_bhabha_addition |= 0x04;
904 int lowe_MaxThetaId = 0;
906 lowe_MaxThetaId = MaxThetaId[0];
908 lowe_MaxThetaId = MaxThetaId[1];
911 if (lowe_MaxThetaId <= 3 ||
912 lowe_MaxThetaId >= 16) {
914 bit_bhabha_addition |= 0x08;
919 bit_bhabha_addition |= 0x10;
924 return bit_bhabha_addition;
942 int phi1 = 511 & lut1;
943 int phi2 = 511 & lut2;
948 dphi = abs(phi1 - phi2);
949 if (dphi > 180) {dphi = 360 - dphi;}
950 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.
double m_taub2b3CLELowCut
taub2b3 cluster energy cut2 (GeV)
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)
bool GetBhabha00(std::vector< double >)
Belle 2D Bhabha veto method.
double m_taub2b3CLEHighCut
taub2b3 cluster energy cut3 (GeV)
bool Getmumu()
MuMu selection for calibration.
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.
int GetBhabhaAddition(void)
Additional Bhabha veto.
std::vector< double > MaxTCId
Max TC Id.
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)
double _mumuThreshold
mumu bit Energy Threshold
std::vector< int > m_3DBhabhaVetoInTrackThetaRegion
theta region(low and high) of 3D Bhbabha veto InTrack
int m_3DBhabhaVetoInTrackFlag
trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto are in CDCTRG region in theta ...
TrgEclDataBase * _database
Object of Trigger ECL DataBase.
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< double > _mumuAngle
mumu bit Angle
std::vector< double > m_3DBhabhaAddAngleCut
Angle selection of additional Bhabha veto in CM frame.
std::vector< double > _3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
double m_taub2b2EtotCut
taub2b2 total energy cut (GeV)
std::vector< double > ClusterTiming
Cluster Timing.
std::vector< int > m_3DBhabhaVetoClusterThetaIds
ThetaIds of two clusters of 3D Bhabha veto.
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< int > m_3DBhabhaVetoClusterTCIds
TCIDs of two clusters of 3D Bhabha veto.
double m_taub2bClusterECut2
taub2b Cluster one of energy cut in b2b in lab (GeV)
std::vector< double > BhabhaComb
Bhabha Combination.
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 > _3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
std::vector< double > m_3DBhabhaVetoClusterTimings
Timings of two clusters of 3D Bhabha veto (ns)
bool GetTaub2b3(double)
Taub2b3.
int m_taub2bClusterEFlag
taub2b Cluster energy flag
std::vector< double > MaxTCThetaId
Cluster ThetaId.
bool GetTaub2b(double)
Taub2b selection.
bool GetBhabha01()
Belle II 3D Bhabha method for veto.
double m_taub2b3CLEb2bCut
taub2b3 cluster energy cut (GeV)
std::vector< ROOT::Math::XYZVector > ClusterPosition
Cluster Timing.
double m_taub2bClusterECut1
taub2b Cluster one of energy cut in b2b in lab (GeV)
virtual ~TrgEclBhabha()
Constructor.
std::vector< double > ClusterEnergy
Cluster Energy.
TrgEclMapping * _TCMap
Object of TC Mapping.
double m_taub2b2CLECut
taub2b2 cluster energy cut (GeV)
std::vector< double > _2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
std::vector< double > _3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
double m_taub2b2CLEEndcapCut
taub2b2 cluster energy cut for endcap cluster (GeV)
bool GetTaub2b2(double)
Taub2b selection (tighter selection than Taub2b)
std::vector< int > m_taub2b3AngleCut
taub2b3 selection cuts (3,2,1,0) = (dphi low, dphi high, theta_sum low, theta_sum high)
int Get3DBhabhaLUT(int)
TC CM Phi
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
Abstract base class for different kinds of events.