Belle II Software development
TrgEclCluster Class Reference

A Class of ECL Trigger clustering
More...

#include <TrgEclCluster.h>

Public Member Functions

 TrgEclCluster ()
 Constructor.
 
virtual ~TrgEclCluster ()
 Constructor.
 
 TrgEclCluster (TrgEclCluster &)=delete
 Destructor.
 
TrgEclClusteroperator= (TrgEclCluster &)=delete
 Assignement operator, deleted.
 
void setICN (const std::vector< int > &)
 set ICN for each part(Fw,Br,Bw)
 
void setICN (const std::vector< int > &, const std::vector< double > &, const std::vector< double > &)
 set Belle 2 Clustering
 
void save (int)
 Save Cluster information in TRGECLCluster Table.
 
void setBarrelICN (int)
 calculate Belle 2 Cluster in Barrel
 
void setBarrelICNsub (int, std::vector< int >, int &, int &, int &, int &, int &, int &, int &, int &)
 calculate 3x3 TC hit map for ICN in Barrel
 
void setForwardICN (int)
 calculate Belle2 Cluster in Foward endcap
 
void setBackwardICN (int)
 calculate Belle 2 Cluster in Backward endcap
 
int setBarrelICN ()
 calculate Belle ICN in Barrel
 
int setForwardICN ()
 calculate Belle ICN in Foward endcap
 
int setBackwardICN ()
 calculate Belle ICN in Backward endcap
 
void setEventId (int eventId)
 Set EventId.
 
void setClusteringMethod (int method)
 Set.
 
void setClusterLimit (int limit)
 Set Limit of Cluster.
 
int getICNFwBr (void)
 get ICN in Barrel and Forward
 
int getICNSub (int)
 get ICN in each region(Fw(0), Br(1), Bw(2))
 
int getBrICNCluster (int ICNId, int)
 get ICN in QuadrantId in Fw or Br or Bw.
 
int getBwICNCluster (int ICNId, int)
 0 : center , 1; upper , 2: right , 3: lower , 4: lower right
 
int getFwICNCluster (int ICNId, int)
 0 : center , 1; upper , 2: right , 3: lower , 4: lower right
 
int getNofCluster ()
 0 : center , 1; upper , 2: right , 3: lower , 4: lower right
 
int getNofExceedCluster ()
 get # Cluster in case of exceeding limit
 

Private Attributes

int _BRICN
 get Beam bkg veto flag.
 
int _FWDICN
 ICN in Forward Endcap.
 
int _BWDICN
 ICN in Backward Endcap.
 
int _BRNofCluster
 Cluster in Barrel.
 
int _FWDNofCluster
 Cluster in Forward Endcap.
 
int _BWDNofCluster
 Cluster in Backward Endcap.
 
int _EventId
 event number
 
int _Method
 Clustering method.
 
int _LimitNCluster
 the Limit Number of Cluster
 
int _Position
 Position calculation method(0:Most energetic TC Postion, 1 : Energy weighted Postion)
 
std::vector< int > _icnfwbrbw
 icn

 
std::vector< int > TCId
 TC Id.
 
std::vector< double > Timing
 TC timing.
 
std::vector< double > Energy
 TC energy

 
std::vector< std::vector< int > > _Quadrant
 Quadrant for Beam Backgournd veto.
 
std::vector< std::vector< int > > _BrCluster
 cluster in barrel
 
std::vector< std::vector< int > > _FwCluster
 cluster in forward endcap
 
std::vector< std::vector< int > > _BwCluster
 cluster in backward endcap
 
std::vector< std::vector< double > > ClusterTiming
 Cluster timing.
 
std::vector< std::vector< double > > ClusterEnergy
 Cluster enrgy

 
std::vector< std::vector< double > > ClusterPositionX
 Cluster position in X-axis.
 
std::vector< std::vector< double > > ClusterPositionY
 Cluster position in Y-axis.
 
std::vector< std::vector< double > > ClusterPositionZ
 Cluster position in Z-axis.
 
std::vector< std::vector< int > > NofTCinCluster
 N of TC in Cluster

 
std::vector< std::vector< int > > MaxTCId
 Maximum contribution TC Id in Cluster.
 
std::vector< int > TempCluster
 Temporal Cluster.
 
TrgEclMapping_TCMap
 Object of TC Mapping.
 

Detailed Description

A Class of ECL Trigger clustering

Definition at line 30 of file TrgEclCluster.h.

Constructor & Destructor Documentation

◆ TrgEclCluster() [1/2]

Constructor.

Definition at line 45 of file TrgEclCluster.cc.

45 :
46 _BRICN(0), _FWDICN(0), _BWDICN(0),
49{
50 // initialize All parameters
51
52 _icnfwbrbw.clear();
53 _BrCluster.clear();
54 _FwCluster.clear();
55 _BwCluster.clear();
56 _Quadrant.clear();
57
58 TCId.clear();
59 Timing.clear();
60 Energy.clear();
61
62 ClusterTiming.clear();
63 ClusterEnergy.clear();
64 ClusterPositionX.clear();
65 ClusterPositionY.clear();
66 ClusterPositionZ.clear();
67 NofTCinCluster.clear();
68 MaxTCId.clear();
69 TempCluster.clear();
70
71 _icnfwbrbw.resize(3, 0);
72 TempCluster.resize(9);
73 _Quadrant.resize(3, std::vector<int>(4, 0.0));
74
75 ClusterTiming.resize(3);
76 ClusterEnergy.resize(3);
77 ClusterPositionX.resize(3);
78 ClusterPositionY.resize(3);
79 ClusterPositionZ.resize(3);
80 NofTCinCluster.resize(3);
81 MaxTCId.resize(3);
82
83
84 _TCMap = new TrgEclMapping();
85
86
87
88}
int _Position
Position calculation method(0:Most energetic TC Postion, 1 : Energy weighted Postion)
std::vector< std::vector< int > > _Quadrant
Quadrant for Beam Backgournd veto.
int _BRNofCluster
Cluster in Barrel.
std::vector< std::vector< int > > NofTCinCluster
N of TC in Cluster
std::vector< int > TempCluster
Temporal Cluster.
int _BWDNofCluster
Cluster in Backward Endcap.
std::vector< std::vector< int > > _FwCluster
cluster in forward endcap
std::vector< std::vector< double > > ClusterPositionX
Cluster position in X-axis.
std::vector< std::vector< double > > ClusterPositionZ
Cluster position in Z-axis.
std::vector< int > _icnfwbrbw
icn
std::vector< std::vector< int > > _BwCluster
cluster in backward endcap
int _Method
Clustering method.
int _BRICN
get Beam bkg veto flag.
std::vector< std::vector< double > > ClusterPositionY
Cluster position in Y-axis.
int _FWDNofCluster
Cluster in Forward Endcap.
std::vector< std::vector< int > > MaxTCId
Maximum contribution TC Id in Cluster.
int _LimitNCluster
the Limit Number of Cluster
int _EventId
event number
std::vector< std::vector< double > > ClusterTiming
Cluster timing.
std::vector< std::vector< double > > ClusterEnergy
Cluster enrgy
int _FWDICN
ICN in Forward Endcap.
TrgEclMapping * _TCMap
Object of TC Mapping.
int _BWDICN
ICN in Backward Endcap.
std::vector< int > TCId
TC Id.
std::vector< std::vector< int > > _BrCluster
cluster in barrel
std::vector< double > Energy
TC energy
std::vector< double > Timing
TC timing.
A class of TC Mapping.
Definition: TrgEclMapping.h:26

◆ ~TrgEclCluster()

~TrgEclCluster ( )
virtual

Constructor.

Destructor

Definition at line 92 of file TrgEclCluster.cc.

93{
94 delete _TCMap;
95}

◆ TrgEclCluster() [2/2]

TrgEclCluster ( TrgEclCluster )
delete

Destructor.

Copy constructor, deleted.

Member Function Documentation

◆ getBrICNCluster()

int getBrICNCluster ( int  ICNId,
int  location 
)

get ICN in QuadrantId in Fw or Br or Bw.

FwBrBwId = 0(Fw),1(Br),2(Bw) QuadrantId = 0,1,2,3

Definition at line 121 of file TrgEclCluster.cc.

122{
123 // get the # of Cluster in Barrel.
124 return _BrCluster[ICNId][location];
125
126}

◆ getBwICNCluster()

int getBwICNCluster ( int  ICNId,
int  location 
)

0 : center , 1; upper , 2: right , 3: lower , 4: lower right

Definition at line 131 of file TrgEclCluster.cc.

132{
133
134 return _BwCluster[ICNId][location];
135
136}

◆ getFwICNCluster()

int getFwICNCluster ( int  ICNId,
int  location 
)

0 : center , 1; upper , 2: right , 3: lower , 4: lower right

Definition at line 141 of file TrgEclCluster.cc.

142{
143
144 return _FwCluster[ICNId][location];
145
146}

◆ getICNFwBr()

int getICNFwBr ( void  )

get ICN in Barrel and Forward

Definition at line 100 of file TrgEclCluster.cc.

101{
102 // get ICN in Barrel and Forward Endcap except for the most inner (=Physics region : Theta Id 2 ~ 15)
103 return _icnfwbrbw[0] + _icnfwbrbw[1];
104
105}

◆ getICNSub()

int getICNSub ( int  FwBrBw)

get ICN in each region(Fw(0), Br(1), Bw(2))

Definition at line 110 of file TrgEclCluster.cc.

111{
112 // get ICN in Barrel and Backward endcap, Forward Endcap except for the most inner (=Physics region : Theta Id 2 ~ 15)
113
114 return _icnfwbrbw[FwBrBw];
115
116}

◆ getNofCluster()

int getNofCluster ( )
inline

0 : center , 1; upper , 2: right , 3: lower , 4: lower right

Output # of cluster

Definition at line 95 of file TrgEclCluster.h.

◆ getNofExceedCluster()

int getNofExceedCluster ( )

get # Cluster in case of exceeding limit

Definition at line 1755 of file TrgEclCluster.cc.

1756{
1757 int ncluster =
1758 ClusterEnergy[0].size() +
1759 ClusterEnergy[1].size() +
1760 ClusterEnergy[2].size();
1761 if (ncluster > _LimitNCluster) {
1762 return ncluster;
1763 } else {
1764 return 0;
1765 }
1766}

◆ save()

void save ( int  m_nEvent)

Save Cluster information in TRGECLCluster Table.

Definition at line 192 of file TrgEclCluster.cc.

193{
194 // Save Cluster
195 // Save order : Barrel, Forward, Backward
196
197 int m_hitNum = 0;
198 int clusterId = 0;
199 int counter = 0;
200 for (int iposition = 0; iposition < 3 ; iposition ++) {
201 const int Ncluster = ClusterEnergy[iposition].size();
202 for (int icluster = 0; icluster < Ncluster; icluster++) {
203 if (ClusterEnergy[iposition][icluster] <= 0) {continue;}
204
205 if (counter >= _LimitNCluster) {
206 continue;
207 } else {
208 counter ++;
209 }
210
211 StoreArray<TRGECLCluster> ClusterArray;
212 ClusterArray.appendNew();
213 m_hitNum = ClusterArray.getEntries() - 1;
214 ClusterArray[m_hitNum]->setEventId(m_nEvent);
215 ClusterArray[m_hitNum]->setClusterId(clusterId);
216 ClusterArray[m_hitNum]->setMaxTCId(MaxTCId[iposition][icluster]);
217 ClusterArray[m_hitNum]->setMaxThetaId(_TCMap->getTCThetaIdFromTCId(MaxTCId[iposition][icluster]));
218 ClusterArray[m_hitNum]->setMaxPhiId(_TCMap->getTCPhiIdFromTCId(MaxTCId[iposition][icluster]));
219 ClusterArray[m_hitNum]->setNofTCinCluster(NofTCinCluster[iposition][icluster]);
220 ClusterArray[m_hitNum]->setEnergyDep(ClusterEnergy[iposition][icluster]);
221 ClusterArray[m_hitNum]->setTimeAve(ClusterTiming[iposition][icluster]);
222
223 ClusterArray[m_hitNum]->setPositionX(ClusterPositionX[iposition][icluster]);
224 ClusterArray[m_hitNum]->setPositionY(ClusterPositionY[iposition][icluster]);
225 ClusterArray[m_hitNum]->setPositionZ(ClusterPositionZ[iposition][icluster]);
226 clusterId ++;
227 }
228 }
229
230
231}
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
int getTCPhiIdFromTCId(int)
get [TC Phi ID] from [TC ID]

◆ setBackwardICN() [1/2]

int setBackwardICN ( )

calculate Belle ICN in Backward endcap

Definition at line 1603 of file TrgEclCluster.cc.

1604{
1605 std::vector<int> TCFire;
1606
1607
1608 TCFire.clear();
1609
1610 TCFire.resize(64, 0);
1611
1612
1613
1614 const int hit_size = TCId.size();
1615 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
1616 if (TCId[ihit] < 513) {continue;}
1617
1618 // TCFire[TCId[ihit] - 513] = TCId[ihit];
1619 //------------------------------------
1620 // To rearrange the hitted map
1621 //
1622 // orignal converted
1623 // (<- Theta) (<- Theta)
1624 //
1625 // 516 515 32 0
1626 // 513 514 33 1
1627 // 520 519 => 34 2
1628 // 517 518 35 3
1629 // ... .
1630 // 576 575 62 30
1631 // 573 574 63 31
1632 //
1633 // Here, TCId-1 becomes TCId=0 and 1.
1634 //------------------------------------
1635 int iTCId0 = TCId[ihit] - 1;
1636 int kkk = 0;
1637 if ((iTCId0 - 512) % 4 == 2) {
1638 kkk = (iTCId0 - 512) / 2 - 1;
1639 }
1640 if ((iTCId0 - 512) % 4 == 1) {
1641 kkk = ((iTCId0 - 512) + 1) / 2;
1642 }
1643 if ((iTCId0 - 512) % 4 == 3) {
1644 kkk = 32 + ((iTCId0 - 512) - 3) / 2;
1645 }
1646 if ((iTCId0 - 512) % 4 == 0) {
1647 kkk = 33 + ((iTCId0 - 512)) / 2;
1648 }
1649
1650 TCFire[kkk] = iTCId0 + 1;
1651
1652 }
1653
1654
1655 for (int iii = 0 ; iii < 64 ; iii ++) {
1656
1657 if (TCFire[iii] == 0) { continue; }
1658
1659 for (int iinit = 0; iinit < 9; iinit ++) {TempCluster[iinit] = 0;}
1660 if (iii < 32) {
1661 if (iii == 0) {
1662 TempCluster[0] = TCFire[ 0];
1663 TempCluster[1] = TCFire[31]; // top
1664 TempCluster[2] = 0;// right top
1665 TempCluster[3] = 0; //right
1666 TempCluster[4] = 0; //right bottom
1667 TempCluster[5] = TCFire[ 1]; // bottom
1668 TempCluster[6] = TCFire[33]; // bottom left
1669 TempCluster[7] = TCFire[32]; // left
1670 TempCluster[8] = TCFire[63]; // top left
1671 } else if (iii == 31) {
1672 TempCluster[0] = TCFire[31];
1673 TempCluster[1] = TCFire[30];
1674 TempCluster[2] = 0;// right top
1675 TempCluster[3] = 0; //right
1676 TempCluster[4] = 0; //right bottom
1677 TempCluster[5] = TCFire[0]; //bottom
1678 TempCluster[6] = TCFire[32]; // bottom left
1679 TempCluster[7] = TCFire[63]; // left
1680 TempCluster[8] = TCFire[62]; //top left
1681 } else {
1682 TempCluster[0] = TCFire[iii];
1683 TempCluster[1] = TCFire[iii - 1]; // top
1684 TempCluster[2] = 0;// right top
1685 TempCluster[3] = 0; //right
1686 TempCluster[4] = 0; //right bottom
1687 TempCluster[5] = TCFire[iii + 1]; //bottom
1688 TempCluster[6] = TCFire[iii + 33]; //bottom left
1689 TempCluster[7] = TCFire[iii + 32]; // left
1690 TempCluster[8] = TCFire[iii + 31]; //top left
1691 }
1692 } else {
1693 if (iii == 32) {
1694 TempCluster[0] = TCFire[32];
1695 TempCluster[1] = TCFire[63]; // top
1696 TempCluster[2] = TCFire[31];// right top
1697 TempCluster[3] = TCFire[0]; //right
1698 TempCluster[4] = TCFire[1]; //right bottom
1699 TempCluster[5] = TCFire[33]; //bottom
1700 TempCluster[6] = 0; //bottom left
1701 TempCluster[7] = 0; // left
1702 TempCluster[8] = 0; //top left
1703 } else if (iii == 63) {
1704 TempCluster[0] = TCFire[63];
1705 TempCluster[1] = TCFire[62]; // top
1706 TempCluster[2] = TCFire[30];// right top
1707 TempCluster[3] = TCFire[31]; //right
1708 TempCluster[4] = TCFire[0]; //right bottom
1709 TempCluster[5] = TCFire[32]; //bottom
1710 TempCluster[6] = 0; //bottom left
1711 TempCluster[7] = 0; // left
1712 TempCluster[8] = 0; //top left
1713 } else {
1714 TempCluster[0] = TCFire[iii];
1715 TempCluster[1] = TCFire[iii - 1]; // top
1716 TempCluster[2] = TCFire[iii - 33]; // right top
1717 TempCluster[3] = TCFire[iii - 32]; //right
1718 TempCluster[4] = TCFire[iii - 31]; //right bottom
1719 TempCluster[5] = TCFire[iii + 1]; //bottom
1720 TempCluster[6] = 0; //bottom left
1721 TempCluster[7] = 0; // left
1722 TempCluster[8] = 0; //top left
1723 }
1724
1725 }
1726
1727 if (!(TempCluster[1] != 0 || TempCluster[7] != 0)) {
1728 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
1729 _BWDICN ++;
1730 int phiid = _TCMap->getTCPhiIdFromTCId(TCFire[iii]);
1731
1732 if (phiid == 32 || (phiid > 0 && phiid < 10)) {
1733 _Quadrant[2][0]++;
1734 }
1735 if (phiid > 7 && phiid < 18) {
1736 _Quadrant[2][1]++;
1737 }
1738 if (phiid > 15 && phiid < 26) {
1739 _Quadrant[2][2]++;
1740 }
1741 if ((phiid > 22 && phiid < 33) || phiid == 1) {
1742 _Quadrant[2][3]++;
1743 }
1744
1745
1746 }
1747 }
1748 }
1749
1750 return _BWDICN;
1751}

◆ setBackwardICN() [2/2]

void setBackwardICN ( int  Method)

calculate Belle 2 Cluster in Backward endcap

Definition at line 960 of file TrgEclCluster.cc.

961{
962 std::vector<int> TCFire;
963 std::vector<double> TCFireEnergy;
964 std::vector<double> TCFireTiming;
965 std::vector<std::vector<double>> TCFirePosition;
966
967
968 std::vector<double> TempClusterEnergy;
969 std::vector<double> TempClusterTiming;
970 std::vector<double> TempClusterPositionX;
971 std::vector<double> TempClusterPositionY;
972 std::vector<double> TempClusterPositionZ;
973 std::vector<int> TempNofTCinCluster;
974 std::vector<int> TempMaxTCId;
975
976 std::vector<double> Sort1D;
977 std::vector<std::vector<double>> Sort2D;
978
979 int TempICNTCId = 0;
980
981 TempClusterEnergy.clear();
982 TempClusterTiming.clear();
983 TempClusterPositionX.clear();
984 TempClusterPositionY.clear();
985 TempClusterPositionZ.clear();
986 TempNofTCinCluster.clear();
987 TempMaxTCId.clear();
988 Sort1D.clear();
989 Sort2D.clear();
990
991 TCFire.clear();
992 TCFireEnergy.clear();
993 TCFireTiming.clear();
994 TCFirePosition.clear();
995
996 TCFire.resize(64, 0);
997 TCFireEnergy.resize(64, 0.);
998 TCFireTiming.resize(64, 0.);
999 TCFirePosition.resize(64, std::vector<double>(3, 0.));
1000
1001 const int hit_size = TCId.size();
1002 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
1003 if (TCId[ihit] < 513) {continue;}
1004 TCFireEnergy[TCId[ihit] - 513] = Energy[ihit];
1005 TCFireTiming[TCId[ihit] - 513] = Timing[ihit];
1006 TCFirePosition[TCId[ihit] - 513][0] = (_TCMap->getTCPosition(TCId[ihit])).X();
1007 TCFirePosition[TCId[ihit] - 513][1] = (_TCMap->getTCPosition(TCId[ihit])).Y();
1008 TCFirePosition[TCId[ihit] - 513][2] = (_TCMap->getTCPosition(TCId[ihit])).Z();
1009
1010 //------------------------------------
1011 // To rearrange the hitted map
1012 //
1013 // orignal converted
1014 // (<- Theta) (<- Theta)
1015 //
1016 // 516 515 32 0
1017 // 513 514 33 1
1018 // 520 519 => 34 2
1019 // 517 518 35 3
1020 // ... .
1021 // 576 575 62 30
1022 // 573 574 63 31
1023 //
1024 // Here, TCId-1 becomes TCId=0 and 1.
1025 //------------------------------------
1026 int iTCId0 = TCId[ihit] - 1;
1027 int kkk = 0;
1028 if ((iTCId0 - 512) % 4 == 2) {
1029 kkk = (iTCId0 - 512) / 2 - 1;
1030 }
1031 if ((iTCId0 - 512) % 4 == 1) {
1032 kkk = ((iTCId0 - 512) + 1) / 2;
1033 }
1034 if ((iTCId0 - 512) % 4 == 3) {
1035 kkk = 32 + ((iTCId0 - 512) - 3) / 2;
1036 }
1037 if ((iTCId0 - 512) % 4 == 0) {
1038 kkk = 33 + ((iTCId0 - 512)) / 2;
1039 }
1040
1041 TCFire[kkk] = iTCId0 + 1;
1042
1043 }
1044
1045
1046 for (int iii = 0 ; iii < 64 ; iii ++) {
1047
1048 if (TCFire[iii] == 0) { continue; }
1049
1050 for (int iinit = 0; iinit < 9; iinit ++) {TempCluster[iinit] = 0;}
1051 if (iii < 32) {
1052 if (iii == 0) {
1053 TempCluster[0] = TCFire[ 0];
1054 TempCluster[1] = TCFire[31]; // top
1055 TempCluster[2] = 0;// right top
1056 TempCluster[3] = 0; //right
1057 TempCluster[4] = 0; //right bottom
1058 TempCluster[5] = TCFire[ 1]; // bottom
1059 TempCluster[6] = TCFire[33]; // bottom left
1060 TempCluster[7] = TCFire[32]; // left
1061 TempCluster[8] = TCFire[63]; // top left
1062 } else if (iii == 31) {
1063 TempCluster[0] = TCFire[31];
1064 TempCluster[1] = TCFire[30];
1065 TempCluster[2] = 0;// right top
1066 TempCluster[3] = 0; //right
1067 TempCluster[4] = 0; //right bottom
1068 TempCluster[5] = TCFire[0]; //bottom
1069 TempCluster[6] = TCFire[32]; // bottom left
1070 TempCluster[7] = TCFire[63]; // left
1071 TempCluster[8] = TCFire[62]; //top left
1072 } else {
1073 TempCluster[0] = TCFire[iii];
1074 TempCluster[1] = TCFire[iii - 1]; // top
1075 TempCluster[2] = 0;// right top
1076 TempCluster[3] = 0; //right
1077 TempCluster[4] = 0; //right bottom
1078 TempCluster[5] = TCFire[iii + 1]; //bottom
1079 TempCluster[6] = TCFire[iii + 33]; //bottom left
1080 TempCluster[7] = TCFire[iii + 32]; // left
1081 TempCluster[8] = TCFire[iii + 31]; //top left
1082 }
1083 } else {
1084 if (iii == 32) {
1085 TempCluster[0] = TCFire[32];
1086 TempCluster[1] = TCFire[63]; // top
1087 TempCluster[2] = TCFire[31];// right top
1088 TempCluster[3] = TCFire[0]; //right
1089 TempCluster[4] = TCFire[1]; //right bottom
1090 TempCluster[5] = TCFire[33]; //bottom
1091 TempCluster[6] = 0; //bottom left
1092 TempCluster[7] = 0; // left
1093 TempCluster[8] = 0; //top left
1094 } else if (iii == 63) {
1095 TempCluster[0] = TCFire[63];
1096 TempCluster[1] = TCFire[62]; // top
1097 TempCluster[2] = TCFire[30];// right top
1098 TempCluster[3] = TCFire[31]; //right
1099 TempCluster[4] = TCFire[0]; //right bottom
1100 TempCluster[5] = TCFire[32]; //bottom
1101 TempCluster[6] = 0; //bottom left
1102 TempCluster[7] = 0; // left
1103 TempCluster[8] = 0; //top left
1104 } else {
1105 TempCluster[0] = TCFire[iii];
1106 TempCluster[1] = TCFire[iii - 1]; // top
1107 TempCluster[2] = TCFire[iii - 33]; // right top
1108 TempCluster[3] = TCFire[iii - 32]; //right
1109 TempCluster[4] = TCFire[iii - 31]; //right bottom
1110 TempCluster[5] = TCFire[iii + 1]; //bottom
1111 TempCluster[6] = 0; //bottom left
1112 TempCluster[7] = 0; // left
1113 TempCluster[8] = 0; //top left
1114 }
1115
1116 }
1117
1118 if (!(TempCluster[1] != 0 || TempCluster[7] != 0)) {
1119 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
1120 TempICNTCId = TCFire[iii];
1121
1122 if (Method == 1) {
1123 int maxTCid = 0;
1124 double maxTCEnergy = 0;
1125 for (int iTC = 0; iTC < 9; iTC++) { //find center of Cluster
1126 if (TempCluster[iTC] == 0) {continue;}
1127 if (maxTCEnergy < TCFireEnergy[TempCluster[iTC] - 513]) {
1128 maxTCEnergy = TCFireEnergy[TempCluster[iTC] - 513];
1129 maxTCid = TempCluster[iTC];
1130 }
1131 }
1132 int kkk = 0;
1133 TempCluster[0] = maxTCid;
1134 if ((TempCluster[0] - 513) % 4 == 2) {
1135 kkk = (TempCluster[0] - 513) / 2 - 1;
1136 }
1137 if ((TempCluster[0] - 513) % 4 == 1) {
1138 kkk = ((TempCluster[0] - 513) + 1) / 2;
1139 }
1140 if ((TempCluster[0] - 513) % 4 == 3) {
1141 kkk = 32 + ((TempCluster[0] - 513) - 3) / 2;
1142 }
1143 if ((TempCluster[0] - 513) % 4 == 0) {
1144 kkk = 33 + ((TempCluster[0] - 513)) / 2;
1145 }
1146
1147 if (kkk < 32) {
1148 if (kkk == 0) {
1149 TempCluster[0] = TCFire[ 0];
1150 TempCluster[1] = TCFire[31]; // top
1151 TempCluster[2] = 0;// right top
1152 TempCluster[3] = 0; //right
1153 TempCluster[4] = 0; //right bottom
1154 TempCluster[5] = TCFire[ 1]; // bottom
1155 TempCluster[6] = TCFire[33]; // bottom left
1156 TempCluster[7] = TCFire[32]; // left
1157 TempCluster[8] = TCFire[63]; // top left
1158 } else if (kkk == 31) {
1159 TempCluster[0] = TCFire[31];
1160 TempCluster[1] = TCFire[30];
1161 TempCluster[2] = 0;// right top
1162 TempCluster[3] = 0; //right
1163 TempCluster[4] = 0; //right bottom
1164 TempCluster[5] = TCFire[0]; //bottom
1165 TempCluster[6] = TCFire[32]; // bottom left
1166 TempCluster[7] = TCFire[63]; // left
1167 TempCluster[8] = TCFire[62]; //top left
1168 } else {
1169 TempCluster[0] = TCFire[kkk];
1170 TempCluster[1] = TCFire[kkk - 1]; // top
1171 TempCluster[2] = 0;// right top
1172 TempCluster[3] = 0; //right
1173 TempCluster[4] = 0; //right bottom
1174 TempCluster[5] = TCFire[kkk + 1]; //bottom
1175 TempCluster[6] = TCFire[kkk + 33]; //bottom left
1176 TempCluster[7] = TCFire[kkk + 32]; // left
1177 TempCluster[8] = TCFire[kkk + 31]; //top left
1178 }
1179 } else {
1180 if (kkk == 32) {
1181 TempCluster[0] = TCFire[32];
1182 TempCluster[1] = TCFire[63]; // top
1183 TempCluster[2] = TCFire[31];// right top
1184 TempCluster[3] = TCFire[0]; //right
1185 TempCluster[4] = TCFire[1]; //right bottom
1186 TempCluster[5] = TCFire[33]; //bottom
1187 TempCluster[6] = 0; //bottom left
1188 TempCluster[7] = 0; // left
1189 TempCluster[8] = 0; //top left
1190 } else if (kkk == 63) {
1191 TempCluster[0] = TCFire[63];
1192 TempCluster[1] = TCFire[62]; // top
1193 TempCluster[2] = TCFire[30];// right top
1194 TempCluster[3] = TCFire[31]; //right
1195 TempCluster[4] = TCFire[0]; //right bottom
1196 TempCluster[5] = TCFire[32]; //bottom
1197 TempCluster[6] = 0; //bottom left
1198 TempCluster[7] = 0; // left
1199 TempCluster[8] = 0; //top left
1200 } else {
1201 TempCluster[0] = TCFire[kkk];
1202 TempCluster[1] = TCFire[kkk - 1]; // top
1203 TempCluster[2] = TCFire[kkk - 33]; // right top
1204 TempCluster[3] = TCFire[kkk - 32]; //right
1205 TempCluster[4] = TCFire[kkk - 31]; //right bottom
1206 TempCluster[5] = TCFire[kkk + 1]; //bottom
1207 TempCluster[6] = 0; //bottom left
1208 TempCluster[7] = 0; // left
1209 TempCluster[8] = 0; //top left
1210 }
1211
1212 }
1213 }
1214
1215 for (int iNearTC = 1; iNearTC < 9; iNearTC ++) {
1216 for (int jNearTC = 1; jNearTC < 9; jNearTC ++) {
1217 if (TempCluster[iNearTC] == 0) {continue;}
1218 if (iNearTC == jNearTC) {continue;}
1219 if (TempCluster[iNearTC] == TempCluster[jNearTC]) {
1220 TempCluster[jNearTC] = 0;
1221 }
1222 }
1223 }
1224
1225 int maxTCId = 999;
1226 double clusterenergy = 0;
1227 double clustertiming = 0;
1228 double clusterpositionX = 0;
1229 double clusterpositionY = 0;
1230 double clusterpositionZ = 0;
1231 int noftcincluster = 0;
1232 for (int iNearTC = 0; iNearTC < 9; iNearTC ++) {
1233 if (TempCluster[iNearTC] == 0) {continue;}
1234 else {noftcincluster++;}
1235
1236 clusterenergy += TCFireEnergy[TempCluster[iNearTC] - 513];
1237 clustertiming += TCFireEnergy[TempCluster[iNearTC] - 513] * TCFireTiming[TempCluster[iNearTC] - 513];
1238 clusterpositionX += TCFireEnergy[TempCluster[iNearTC] - 513] * TCFirePosition[TempCluster[iNearTC] - 513][0];
1239 clusterpositionY += TCFireEnergy[TempCluster[iNearTC] - 513] * TCFirePosition[TempCluster[iNearTC] - 513][1];
1240 clusterpositionZ += TCFireEnergy[TempCluster[iNearTC] - 513] * TCFirePosition[TempCluster[iNearTC] - 513][2];
1241
1242
1243 }
1244 //
1245 maxTCId = TempCluster[0];
1246 //
1247
1248 clustertiming /= clusterenergy;
1249 if (_Position == 1) {
1250 clusterpositionX /= clusterenergy;
1251 clusterpositionY /= clusterenergy;
1252 clusterpositionZ /= clusterenergy;
1253 } else if (_Position == 0) {
1254 clustertiming = TCFireTiming[maxTCId - 513];
1255 clusterpositionX = TCFirePosition[maxTCId - 513][0];
1256 clusterpositionY = TCFirePosition[maxTCId - 513][1];
1257 clusterpositionZ = TCFirePosition[maxTCId - 513][2];
1258 }
1259
1260 if (clustertiming == 0 && clusterenergy == 0) {continue;}
1261 TempClusterEnergy.push_back(clusterenergy);
1262 TempClusterTiming.push_back(clustertiming);
1263 TempClusterPositionX.push_back(clusterpositionX);
1264 TempClusterPositionY.push_back(clusterpositionY);
1265 TempClusterPositionZ.push_back(clusterpositionZ);
1266 TempNofTCinCluster.push_back(noftcincluster);
1267 TempMaxTCId.push_back(maxTCId);
1268
1269
1270 Sort1D.push_back(TempICNTCId);
1271 Sort1D.push_back(clusterenergy);
1272 Sort1D.push_back(clustertiming);
1273 Sort1D.push_back(clusterpositionX);
1274 Sort1D.push_back(clusterpositionY);
1275 Sort1D.push_back(clusterpositionZ);
1276 Sort1D.push_back(noftcincluster);
1277 Sort1D.push_back(maxTCId);
1278
1279 Sort2D.push_back(Sort1D);
1280 Sort1D.clear();
1281
1282
1283 }
1284 }
1285 }
1286
1287 sort(Sort2D.begin(), Sort2D.end(),
1288 [](const vector<double>& aa1, const vector<double>& aa2) {return aa1[0] < aa2[0];});
1289
1290 const int clustersize = Sort2D.size();
1291 for (int jtc = 0; jtc < clustersize; jtc++) {
1292 ClusterEnergy[2].push_back(Sort2D[jtc][1]);
1293 ClusterTiming[2].push_back(Sort2D[jtc][2]);
1294 ClusterPositionX[2].push_back(Sort2D[jtc][3]);
1295 ClusterPositionY[2].push_back(Sort2D[jtc][4]);
1296 ClusterPositionZ[2].push_back(Sort2D[jtc][5]);
1297 NofTCinCluster[2].push_back(Sort2D[jtc][6]);
1298 MaxTCId[2].push_back(Sort2D[jtc][7]);
1299 }
1300
1301 _BWDNofCluster = MaxTCId[2].size();
1302}
ROOT::Math::XYZVector getTCPosition(int)
TC position (cm)

◆ setBarrelICN() [1/2]

int setBarrelICN ( )

calculate Belle ICN in Barrel

Definition at line 1307 of file TrgEclCluster.cc.

1308{
1309
1310 std::vector<int> TCFire;
1311
1312 TCFire.clear();
1313
1314 TCFire.resize(432, 0);
1315
1316 const int hit_size = TCId.size();
1317 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
1318 if (TCId[ihit] >= 81 && TCId[ihit] <= 512) {
1319 TCFire[TCId[ihit] - 81] = TCId[ihit];
1320 }
1321 }
1322 //
1323 //
1324 //
1325 int tc_upper = 0; // check upper TC
1326 int tc_upper_right = 0; // check right TC
1327 int tc_right = 0; // check right TC
1328 int tc_lower_right = 0;
1329 int tc_lower = 0; // check lower TC
1330 int tc_lower_left = 0; // check lower TC
1331 int tc_left = 0;
1332 int tc_upper_left = 0;
1333
1334 for (int iii = 0 ; iii < 432 ; iii++) {
1335 if (TCFire[iii] == 0) { continue; }
1336
1337 setBarrelICNsub(iii,
1338 TCFire,
1339 tc_upper,
1340 tc_upper_right,
1341 tc_right,
1342 tc_lower_right,
1343 tc_lower,
1344 tc_lower_left,
1345 tc_left,
1346 tc_upper_left);
1347
1348 if (!(tc_upper != 0 || tc_left != 0)) {
1349 if (!(tc_lower != 0 && tc_lower_left != 0)) {
1350 _BRICN++;
1351 int phiid = _TCMap->getTCPhiIdFromTCId(iii + 80 + 1);
1352
1353 if (phiid == 36 || (phiid > 0 && phiid < 11)) {
1354 _Quadrant[1][0]++;
1355 }
1356 if (phiid > 8 && phiid < 20) {
1357 _Quadrant[1][1]++;
1358 }
1359 if (phiid > 17 && phiid < 29) {
1360 _Quadrant[1][2]++;
1361 }
1362 if ((phiid > 26 && phiid < 37) || phiid == 1) {
1363 _Quadrant[1][3]++;
1364 }
1365
1366 }
1367 }// iii loop
1368 }
1369 return _BRICN;
1370
1371}
void setBarrelICNsub(int, std::vector< int >, int &, int &, int &, int &, int &, int &, int &, int &)
calculate 3x3 TC hit map for ICN in Barrel

◆ setBarrelICN() [2/2]

void setBarrelICN ( int  Method)

calculate Belle 2 Cluster in Barrel

Definition at line 235 of file TrgEclCluster.cc.

236{
237
238 std::vector<int> TCFire;
239 std::vector<double> TCFireEnergy;
240 std::vector<double> TCFireTiming;
241 std::vector<std::vector<double>> TCFirePosition;
242
243 TCFire.clear();
244 TCFireEnergy.clear();
245 TCFireTiming.clear();
246 TCFirePosition.clear();
247
248 TCFire.resize(432, 0);
249 TCFireEnergy.resize(432, 0.);
250 TCFireTiming.resize(432, 0.);
251 TCFirePosition.resize(432, std::vector<double>(3, 0.));
252
253 const int hit_size = TCId.size();
254 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
255 if (TCId[ihit] >= 81 && TCId[ihit] <= 512) {
256 TCFire[TCId[ihit] - 81] = TCId[ihit];
257 TCFireEnergy[TCId[ihit] - 81] = Energy[ihit];
258 TCFireTiming[TCId[ihit] - 81] = Timing[ihit];
259 TCFirePosition[TCId[ihit] - 81][0] = (_TCMap->getTCPosition(TCId[ihit])).X();
260 TCFirePosition[TCId[ihit] - 81][1] = (_TCMap->getTCPosition(TCId[ihit])).Y();
261 TCFirePosition[TCId[ihit] - 81][2] = (_TCMap->getTCPosition(TCId[ihit])).Z();
262 }
263 }
264 //
265 //
266 //
267 int tc_upper = 0; // check upper TC
268 int tc_upper_right = 0; // check right TC
269 int tc_right = 0; // check right TC
270 int tc_lower_right = 0;
271 int tc_lower = 0; // check lower TC
272 int tc_lower_left = 0; // check lower TC
273 int tc_left = 0;
274 int tc_upper_left = 0;
275
276 for (int iii = 0 ; iii < 432 ; iii++) {
277
278 if (TCFire[iii] == 0) { continue; }
279
280 setBarrelICNsub(iii,
281 TCFire,
282 tc_upper,
283 tc_upper_right,
284 tc_right,
285 tc_lower_right,
286 tc_lower,
287 tc_lower_left,
288 tc_left,
289 tc_upper_left);
290
291 if (!(tc_upper != 0 || tc_left != 0)) {
292 if (!(tc_lower != 0 && tc_lower_left != 0)) {
293
294 if (Method == 1) {
295 // for cluster method2(Consider TC energy in oderto find the center of cluster)
296 int maxTCid = 0;
297 double maxTCEnergy = 0;
298 for (int iTC = 0; iTC < 9; iTC++) { //find center of Cluster
299 if (TempCluster[iTC] == 0) {continue;}
300 if (maxTCEnergy < TCFireEnergy[TempCluster[iTC] - 81]) {
301 maxTCEnergy = TCFireEnergy[TempCluster[iTC] - 81];
302 maxTCid = TempCluster[iTC];
303 }
304 }
305 TempCluster[0] = maxTCid;
306
307 if (maxTCid < 93) {
308
309 TempCluster[1] = TCFire[maxTCid + 420 - 81 ] ;
310 TempCluster[2] = TCFire[maxTCid + 419 - 81 ] ;
311 TempCluster[3] = TCFire[maxTCid - 1 - 81 ] ;
312 TempCluster[4] = TCFire[maxTCid + 11 - 81 ] ;
313 TempCluster[5] = TCFire[maxTCid + 12 - 81 ] ;
314 TempCluster[6] = TCFire[maxTCid + 13 - 81 ] ;
315 TempCluster[7] = TCFire[maxTCid + 1 - 81 ] ;
316 TempCluster[8] = TCFire[maxTCid + 421 - 81 ] ;
317
318 if ((maxTCid - 81) % 12 == 0) {
319 TempCluster[2] = 0 ;
320 TempCluster[3] = 0 ;
321 TempCluster[4] = 0 ;
322 }
323 if ((maxTCid - 81) % 12 == 11) {
324 TempCluster[6] = 0 ;
325 TempCluster[7] = 0 ;
326 TempCluster[8] = 0 ;
327 }
328 }
329 if (maxTCid > 92 && maxTCid < 501) {
330
331 TempCluster[1] = TCFire[maxTCid - 12 - 81] ;
332 // cppcheck-suppress negativeContainerIndex
333 TempCluster[2] = TCFire[maxTCid - 13 - 81] ;
334 TempCluster[3] = TCFire[maxTCid - 1 - 81] ;
335 TempCluster[4] = TCFire[maxTCid + 11 - 81] ;
336 TempCluster[5] = TCFire[maxTCid + 12 - 81] ;
337 TempCluster[6] = TCFire[maxTCid + 13 - 81] ;
338 TempCluster[7] = TCFire[maxTCid + 1 - 81] ;
339 TempCluster[8] = TCFire[maxTCid - 11 - 81] ;
340
341 if ((maxTCid - 81) % 12 == 0) {
342 TempCluster[2] = 0;
343 TempCluster[3] = 0;
344 TempCluster[4] = 0;
345 }
346 if ((maxTCid - 81) % 12 == 11) {
347 TempCluster[6] = 0;
348 TempCluster[7] = 0;
349 TempCluster[8] = 0;
350 }
351 }
352 if (maxTCid > 500) {
353 TempCluster[1] = TCFire[maxTCid - 12 - 81] ;
354 TempCluster[2] = TCFire[maxTCid - 13 - 81] ;
355 TempCluster[3] = TCFire[maxTCid - 1 - 81] ;
356 // cppcheck-suppress negativeContainerIndex
357 TempCluster[4] = TCFire[maxTCid - 421 - 81] ;
358 TempCluster[5] = TCFire[maxTCid - 420 - 81] ;
359 TempCluster[6] = TCFire[maxTCid - 419 - 81] ;
360 TempCluster[7] = TCFire[maxTCid + 1 - 81] ;
361 TempCluster[8] = TCFire[maxTCid - 11 - 81] ;
362 if ((maxTCid - 81) % 12 == 0) {
363 TempCluster[2] = 0 ;
364 TempCluster[3] = 0 ;
365 TempCluster[4] = 0 ;
366 }
367 if ((maxTCid - 81) % 12 == 11) {
368 TempCluster[6] = 0 ;
369 TempCluster[7] = 0 ;
370 TempCluster[8] = 0 ;
371 }
372 }
373 }
374
375 for (int iNearTC = 1; iNearTC < 9; iNearTC ++) {
376 for (int jNearTC = 1; jNearTC < 9; jNearTC ++) {
377 if (TempCluster[iNearTC] == 0) {continue;}
378 if (iNearTC == jNearTC) {continue;}
379 if (TempCluster[iNearTC] == TempCluster[jNearTC]) {
380 TempCluster[jNearTC] = 0;
381 }
382 }
383 }
384
385 int maxTCId = 999;
386 double clusterenergy = 0;
387 double clustertiming = 0;
388 double clusterpositionX = 0;
389 double clusterpositionY = 0;
390 double clusterpositionZ = 0;
391 int noftcincluster = 0;
392 for (int iNearTC = 0; iNearTC < 9; iNearTC ++) {
393 if (TempCluster[iNearTC] == 0) {continue;}
394 else {noftcincluster++;}
395 clusterenergy += TCFireEnergy[TempCluster[iNearTC] - 81];
396 clustertiming += TCFireEnergy[TempCluster[iNearTC] - 81] * TCFireTiming[TempCluster[iNearTC] - 81];
397 clusterpositionX += TCFireEnergy[TempCluster[iNearTC] - 81] * TCFirePosition[TempCluster[iNearTC] - 81][0];
398 clusterpositionY += TCFireEnergy[TempCluster[iNearTC] - 81] * TCFirePosition[TempCluster[iNearTC] - 81][1];
399 clusterpositionZ += TCFireEnergy[TempCluster[iNearTC] - 81] * TCFirePosition[TempCluster[iNearTC] - 81][2];
400 }
401 //
402 maxTCId = TempCluster[0];
403 //
404 clustertiming /= clusterenergy;
405 if (_Position == 1) {
406 clusterpositionX /= clusterenergy;
407 clusterpositionY /= clusterenergy;
408 clusterpositionZ /= clusterenergy;
409 } else if (_Position == 0) {
410 clustertiming = TCFireTiming[maxTCId - 81];
411 clusterpositionX = TCFirePosition[maxTCId - 81][0];
412 clusterpositionY = TCFirePosition[maxTCId - 81][1];
413 clusterpositionZ = TCFirePosition[maxTCId - 81][2];
414 }
415 if (clustertiming == 0 && clusterenergy == 0) {continue;}
416 _BrCluster.push_back(TempCluster);
417 ClusterEnergy[0].push_back(clusterenergy);
418 ClusterTiming[0].push_back(clustertiming);
419 ClusterPositionX[0].push_back(clusterpositionX);
420 ClusterPositionY[0].push_back(clusterpositionY);
421 ClusterPositionZ[0].push_back(clusterpositionZ);
422 NofTCinCluster[0].push_back(noftcincluster);
423 MaxTCId[0].push_back(maxTCId);
424 }
425 }
426 }// iii loop
427 _BRNofCluster = MaxTCId[0].size();
428
429}

◆ setBarrelICNsub()

void setBarrelICNsub ( int  iii,
std::vector< int >  TCFire,
int &  tc_upper,
int &  tc_upper_right,
int &  tc_right,
int &  tc_lower_right,
int &  tc_lower,
int &  tc_lower_left,
int &  tc_left,
int &  tc_upper_left 
)

calculate 3x3 TC hit map for ICN in Barrel

Definition at line 1376 of file TrgEclCluster.cc.

1386{
1387 // take into account TCId jump at boundary between FAM-9 and FAM-44
1388 int offset_upper = 0;
1389 int offset_lower = 0;
1390 if (iii <= 11) {
1391 // FAM-9
1392 offset_upper = 432;
1393 offset_lower = 0;
1394 } else if (iii <= 419) {
1395 // FAM-10 to FAM-43
1396 offset_upper = 0;
1397 offset_lower = 0;
1398 } else {
1399 // FAM-44
1400 offset_upper = 0;
1401 offset_lower = -432;
1402 }
1403
1404 // take into account TC at boundary near endcaps
1405 if (iii % 12 == 0) {
1406 // TC at most forward side
1407 tc_upper = TCFire[iii - 12 + offset_upper];
1408 tc_upper_right = 0;
1409 tc_right = 0;
1410 tc_lower_right = 0;
1411 tc_lower = TCFire[iii + 12 + offset_lower];
1412 tc_lower_left = TCFire[iii + 13 + offset_lower];
1413 tc_left = TCFire[iii + 1];
1414 tc_upper_left = TCFire[iii - 11 + offset_upper];
1415 } else if (iii % 12 == 11) {
1416 // TC at most backward side
1417 tc_upper = TCFire[iii - 12 + offset_upper];
1418 tc_upper_right = TCFire[iii - 13 + offset_upper];
1419 tc_right = TCFire[iii - 1];
1420 tc_lower_right = TCFire[iii + 11 + offset_lower];
1421 tc_lower = TCFire[iii + 12 + offset_lower];
1422 tc_lower_left = 0;
1423 tc_left = 0;
1424 tc_upper_left = 0;
1425 } else {
1426 tc_upper = TCFire[iii - 12 + offset_upper];
1427 tc_upper_right = TCFire[iii - 13 + offset_upper];
1428 tc_right = TCFire[iii - 1];
1429 tc_lower_right = TCFire[iii + 11 + offset_lower];
1430 tc_lower = TCFire[iii + 12 + offset_lower];
1431 tc_lower_left = TCFire[iii + 13 + offset_lower];
1432 tc_left = TCFire[iii + 1];
1433 tc_upper_left = TCFire[iii - 11 + offset_upper];
1434 }
1435
1436 TempCluster[0] = iii + 80 + 1; //middle of ICN
1437 TempCluster[1] = tc_upper; // upper
1438 TempCluster[2] = tc_upper_right; //right
1439 TempCluster[3] = tc_right; //right
1440 TempCluster[4] = tc_lower_right; //lower
1441 TempCluster[5] = tc_lower; //lower
1442 TempCluster[6] = tc_lower_left; //lower
1443 TempCluster[7] = tc_left; //lower
1444 TempCluster[8] = tc_upper_left; //lower right;
1445}

◆ setClusteringMethod()

void setClusteringMethod ( int  method)
inline

Set.

Definition at line 71 of file TrgEclCluster.h.

71{_Method = method; }

◆ setClusterLimit()

void setClusterLimit ( int  limit)
inline

Set Limit of Cluster.

Definition at line 73 of file TrgEclCluster.h.

73{_LimitNCluster = limit; }

◆ setEventId()

void setEventId ( int  eventId)
inline

Set EventId.

Definition at line 69 of file TrgEclCluster.h.

69{_EventId = eventId; }

◆ setForwardICN() [1/2]

int setForwardICN ( )

calculate Belle ICN in Foward endcap

Definition at line 1450 of file TrgEclCluster.cc.

1451{
1452
1453 std::vector<int> TCFire;
1454
1455
1456 TCFire.clear();
1457
1458 TCFire.resize(96, 0);
1459
1460
1461 const int hit_size = TCId.size();
1462 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
1463 if (TCId[ihit] > 80) {continue;}
1464
1465
1466 //------------------------------------
1467 // To rearrange the hitted map
1468 //
1469 // orignal converted
1470 // (<- Theta) (<- Theta)
1471 //
1472 // 3 2 1 64 32 0
1473 // 4 5 - 65 33 1
1474 // 8 7 6 => 66 34 2
1475 // 9 10 - 67 35 3
1476 // .... ...
1477 // 78 77 76 94 62 30
1478 // 79 80 - 95 63 31
1479 //
1480 // Here, TCId-1 becomes TCId=0 and 1.
1481 //------------------------------------
1482 int iTCId0 = TCId[ihit] - 1;
1483 int kkk = 0;
1484 if (iTCId0 % 5 == 0) {
1485 kkk = (iTCId0 / 5) * 2;
1486 TCFire[kkk] = TCId[ihit];
1487 TCFire[kkk + 1] = TCId[ihit];
1488 } else {
1489 kkk = iTCId0 / 5;
1490 switch (iTCId0 % 5) {
1491 case 1 :
1492 TCFire[32 + 2 * kkk] = TCId[ihit]; break;
1493 case 2 :
1494 TCFire[64 + 2 * kkk] = TCId[ihit]; break;
1495 case 3 :
1496 TCFire[64 + 2 * kkk + 1] = TCId[ihit]; break;
1497 case 4 :
1498 TCFire[32 + 2 * kkk + 1] = TCId[ihit]; break;
1499 default:
1500 break;
1501 }
1502 }
1503 }
1504
1505
1506 for (int iii = 32 ; iii < 96 ; iii++) {
1507 for (int iinit = 0; iinit < 9; iinit ++) {TempCluster[iinit] = 0;}
1508 if (TCFire[iii] == 0) { continue; }
1509 if (iii < 64) {
1510 if (iii == 32) {
1511 TempCluster[0] = TCFire[iii];
1512 TempCluster[1] = TCFire[63]; // top
1513 TempCluster[2] = 0;// right top
1514 TempCluster[3] = 0; //right
1515 TempCluster[4] = 0; //right bottom
1516 TempCluster[5] = TCFire[iii + 1]; //bottom
1517 TempCluster[6] = TCFire[iii + 33]; //bottom left
1518 TempCluster[7] = TCFire[iii + 32]; // left
1519 TempCluster[8] = TCFire[95]; //top left
1520 } else if (iii == 63) {
1521 TempCluster[0] = TCFire[iii];
1522 TempCluster[1] = TCFire[iii - 1]; // top
1523 TempCluster[2] = 0; // right top
1524 TempCluster[3] = 0; //right
1525 TempCluster[4] = 0; //right bottom
1526 TempCluster[5] = TCFire[32]; //bottom
1527 TempCluster[6] = TCFire[64]; //bottom left
1528 TempCluster[7] = TCFire[iii + 32]; // left
1529 TempCluster[8] = TCFire[iii + 31]; //top left
1530 } else {
1531 TempCluster[0] = TCFire[iii];
1532 TempCluster[1] = TCFire[iii - 1]; // top
1533 TempCluster[2] = 0; // right top
1534 TempCluster[3] = 0; //right
1535 TempCluster[4] = 0; //right bottom
1536 TempCluster[5] = TCFire[iii + 1]; //bottom
1537 TempCluster[6] = TCFire[iii + 33]; //bottom left
1538 TempCluster[7] = TCFire[iii + 32]; // left
1539 TempCluster[8] = TCFire[iii + 31]; //top left
1540 }
1541 } else {
1542 if (iii == 64) {
1543 TempCluster[0] = TCFire[iii];
1544 TempCluster[1] = TCFire[95]; // top
1545 TempCluster[2] = TCFire[63];// right top
1546 TempCluster[3] = TCFire[iii - 32]; //right
1547 TempCluster[4] = TCFire[iii - 31]; //right bottom
1548 TempCluster[5] = TCFire[iii + 1]; //bottom
1549 TempCluster[6] = 0; //bottom left
1550 TempCluster[7] = 0; // left
1551 TempCluster[8] = 0; //top left
1552 } else if (iii == 95) {
1553 TempCluster[0] = TCFire[iii];
1554 TempCluster[1] = TCFire[iii - 1]; // top
1555 TempCluster[2] = TCFire[iii - 33]; // right top
1556 TempCluster[3] = TCFire[iii - 32]; //right
1557 TempCluster[4] = TCFire[32]; //right bottom
1558 TempCluster[5] = TCFire[64]; //bottom
1559 TempCluster[6] = 0; //bottom left
1560 TempCluster[7] = 0; // left
1561 TempCluster[8] = 0; //top left
1562
1563 } else {
1564 TempCluster[0] = TCFire[iii];
1565 TempCluster[1] = TCFire[iii - 1]; // top
1566 TempCluster[2] = TCFire[iii - 33]; // right top
1567 TempCluster[3] = TCFire[iii - 32]; //right
1568 TempCluster[4] = TCFire[iii - 31]; //right bottom
1569 TempCluster[5] = TCFire[iii + 1]; //bottom
1570 TempCluster[6] = 0; //bottom left
1571 TempCluster[7] = 0; // left
1572 TempCluster[8] = 0; //top left
1573 }
1574
1575 }
1576 if (!(TempCluster[1] != 0 || TempCluster[7] != 0)) {
1577 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
1578 _FWDICN++;
1579 int phiid = _TCMap->getTCPhiIdFromTCId(TCFire[iii]);
1580
1581 if (phiid == 32 || (phiid > 0 && phiid < 10)) {
1582 _Quadrant[0][0]++;
1583 }
1584 if (phiid > 7 && phiid < 18) {
1585 _Quadrant[0][1]++;
1586 }
1587 if (phiid > 15 && phiid < 26) {
1588 _Quadrant[0][2]++;
1589 }
1590 if ((phiid > 22 && phiid < 33) || phiid == 1) {
1591 _Quadrant[0][3]++;
1592 }
1593
1594
1595 }
1596 }
1597 }
1598 return _FWDICN;
1599}

◆ setForwardICN() [2/2]

void setForwardICN ( int  Method)

calculate Belle2 Cluster in Foward endcap

Definition at line 434 of file TrgEclCluster.cc.

435{
436
437 std::vector<int> TCFire;
438 std::vector<double> TCFireEnergy;
439 std::vector<double> TCFireTiming;
440 std::vector<std::vector<double>> TCFirePosition;
441
442 std::vector<double> TempClusterEnergy;
443 std::vector<double> TempClusterTiming;
444 std::vector<double> TempClusterPositionX;
445 std::vector<double> TempClusterPositionY;
446 std::vector<double> TempClusterPositionZ;
447 std::vector<double> Sort1D;
448 std::vector<std::vector<double>> Sort2D;
449
450 std::vector<int> TempNofTCinCluster;
451 std::vector<int> TempMaxTCId;
452
453 int TempICNTCId = 0;;
454
455 TempClusterEnergy.clear();
456 TempClusterTiming.clear();
457 TempClusterPositionX.clear();
458 TempClusterPositionY.clear();
459 TempClusterPositionZ.clear();
460 TempNofTCinCluster.clear();
461 TempMaxTCId.clear();
462
463 Sort2D.clear();
464 Sort1D.clear();
465
466 TCFire.clear();
467 TCFireEnergy.clear();
468 TCFireTiming.clear();
469 TCFirePosition.clear();
470
471 TCFire.resize(96, 0);
472 TCFireEnergy.resize(96, 0.);
473 TCFireTiming.resize(96, 0.);
474
475 TCFirePosition.resize(96, std::vector<double>(3, 0.));
476
477
478 const int hit_size = TCId.size();
479 for (int ihit = 0 ; ihit < hit_size ; ihit++) {
480 if (TCId[ihit] > 80) {continue;}
481
482 TCFireEnergy[TCId[ihit] - 1] = Energy[ihit];
483 TCFireTiming[TCId[ihit] - 1] = Timing[ihit];
484 TCFirePosition[TCId[ihit] - 1][0] = (_TCMap->getTCPosition(TCId[ihit])).X();
485 TCFirePosition[TCId[ihit] - 1][1] = (_TCMap->getTCPosition(TCId[ihit])).Y();
486 TCFirePosition[TCId[ihit] - 1][2] = (_TCMap->getTCPosition(TCId[ihit])).Z();
487
488 //------------------------------------
489 // To rearrange the hitted map
490 //
491 // orignal converted
492 // (<- Theta) (<- Theta)
493 //
494 // 3 2 1 64 32 0
495 // 4 5 - 65 33 1
496 // 8 7 6 => 66 34 2
497 // 9 10 - 67 35 3
498 // .... ...
499 // 78 77 76 94 62 30
500 // 79 80 - 95 63 31
501 //
502 // Here, TCId-1 becomes TCId=0 and 1.
503 //------------------------------------
504 int iTCId0 = TCId[ihit] - 1;
505 int kkk = 0;
506 if (iTCId0 % 5 == 0) {
507 kkk = (iTCId0 / 5) * 2;
508 TCFire[kkk] = TCId[ihit];
509 TCFire[kkk + 1] = TCId[ihit];
510 } else {
511 kkk = iTCId0 / 5;
512 switch (iTCId0 % 5) {
513 case 1 :
514 TCFire[32 + 2 * kkk] = TCId[ihit]; break;
515 case 2 :
516 TCFire[64 + 2 * kkk] = TCId[ihit]; break;
517 case 3 :
518 TCFire[64 + 2 * kkk + 1] = TCId[ihit]; break;
519 case 4 :
520 TCFire[32 + 2 * kkk + 1] = TCId[ihit]; break;
521 default:
522 break;
523 }
524 }
525 }
526
527 for (int iii = 0 ; iii < 96 ; iii++) {
528 int icn_flag = 0;
529 if (iii < 32) {
530 if (iii % 2 == 1) {
531 continue;
532 }
533 }
534 for (int iinit = 0; iinit < 9; iinit ++)
535 TempCluster[iinit] = 0;
536 if (TCFire[iii] == 0)
537 continue;
538 // cppcheck-suppress knownConditionTrueFalse
539 if (iii < 32) { // most inner
540 if (iii == 0) {
541 TempCluster[0] = TCFire[iii];
542 TempCluster[1] = TCFire[30]; // top
543 TempCluster[2] = TCFire[63]; // left up
544 TempCluster[3] = TCFire[iii + 32] ; // left 1
545 TempCluster[4] = TCFire[iii + 33]; // left 2
546 TempCluster[5] = TCFire[iii + 34]; // left bottom
547 TempCluster[6] = TCFire[iii + 2]; // bottom
548 TempCluster[7] = 0;
549 TempCluster[8] = 0;
550
551 } else if (iii == 30) {
552 TempCluster[0] = TCFire[iii];
553 TempCluster[1] = TCFire[iii - 2]; // top
554 TempCluster[2] = TCFire[iii + 31]; // left up
555 TempCluster[3] = TCFire[iii + 32] ; // left 1
556 TempCluster[4] = TCFire[iii + 33]; // left 2
557 TempCluster[5] = TCFire[32]; // left bottom
558 TempCluster[6] = TCFire[0]; // bottom
559 TempCluster[7] = 0;
560 TempCluster[8] = 0;
561
562 } else {
563 TempCluster[0] = TCFire[iii];
564 TempCluster[1] = TCFire[iii - 2]; // top
565 TempCluster[2] = TCFire[iii + 31]; // left up
566 TempCluster[3] = TCFire[iii + 32] ; // left 1
567 TempCluster[4] = TCFire[iii + 33]; // left 2
568 TempCluster[5] = TCFire[iii + 34]; // left bottom
569 TempCluster[6] = TCFire[iii + 2]; // bottom
570 TempCluster[7] = 0;
571 TempCluster[8] = 0;
572
573 }
574 if (!(TempCluster[1] != 0 || (TempCluster[3] != 0 || TempCluster[4] != 0))) {
575 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
576 icn_flag = 1;
577
578
579 }
580 }
581
582 } else if (iii < 64) {
583 if (iii == 32) {
584 TempCluster[0] = TCFire[iii];
585 TempCluster[1] = TCFire[63]; // up
586 TempCluster[2] = TCFire[iii - 2]; // up right
587 TempCluster[3] = TCFire[iii - 32]; // right
588 TempCluster[4] = 0; //right bottom
589 TempCluster[5] = TCFire[iii + 1]; // bottom
590 TempCluster[6] = TCFire[iii + 33]; // left bottom
591 TempCluster[7] = TCFire[iii + 32]; // left
592 TempCluster[8] = TCFire[95]; // up left
593
594 } else if (iii == 33) {
595
596 TempCluster[0] = TCFire[iii];
597 TempCluster[1] = TCFire[iii - 1]; // up
598 TempCluster[2] = 0; // up right
599 TempCluster[3] = TCFire[iii - 32]; // right
600 TempCluster[4] = TCFire[iii - 30]; //right bottom
601 TempCluster[5] = TCFire[iii + 1]; // bottom
602 TempCluster[6] = TCFire[iii + 33]; // left bottom
603 TempCluster[7] = TCFire[iii + 32]; // left
604 TempCluster[8] = TCFire[iii + 31]; // up left
605
606 }
607
608 else if (iii == 62) {
609 TempCluster[0] = TCFire[iii];
610 TempCluster[1] = TCFire[iii - 1]; // up
611 TempCluster[2] = TCFire[iii - 34]; // up right
612 TempCluster[3] = TCFire[iii - 32]; // right
613 TempCluster[4] = 0; //right bottom
614 TempCluster[5] = TCFire[iii + 1]; // bottom
615 TempCluster[6] = TCFire[iii + 33]; // left bottom
616 TempCluster[7] = TCFire[iii + 32]; // left
617 TempCluster[8] = TCFire[iii + 31]; // up left
618
619
620 } else if (iii == 63) {
621 TempCluster[0] = TCFire[iii];
622 TempCluster[1] = TCFire[iii - 1]; // up
623 TempCluster[2] = 0; // up right
624 TempCluster[3] = TCFire[iii - 32]; // right
625 TempCluster[4] = TCFire[1]; //right bottom
626 TempCluster[5] = TCFire[32]; // bottom
627 TempCluster[6] = TCFire[64]; // left bottom
628 TempCluster[7] = TCFire[iii + 32]; // left
629 TempCluster[8] = TCFire[iii + 31]; // up left
630
631 }
632
633 else {
634
635 TempCluster[0] = TCFire[iii];
636 TempCluster[1] = TCFire[iii - 1]; // up
637 TempCluster[2] = TCFire[iii - 34]; // up right
638 TempCluster[3] = TCFire[iii - 32]; // right
639 TempCluster[4] = TCFire[iii - 30]; //right bottom
640 TempCluster[5] = TCFire[iii + 1]; // bottom
641 TempCluster[6] = TCFire[iii + 33]; // left bottom
642 TempCluster[7] = TCFire[iii + 32]; // left
643 TempCluster[8] = TCFire[iii + 31]; // up left
644 if (iii % 2 == 0) {
645 TempCluster[4] = 0;
646 } else {
647 TempCluster[2] = 0;
648 }
649 }
650 if (!(TempCluster[1] != 0 || TempCluster[7] != 0)) {
651 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
652 icn_flag = 1;
653 }
654 }
655
656 } else {
657 if (iii == 64) {
658 TempCluster[0] = TCFire[iii];
659 TempCluster[1] = TCFire[95]; // top
660 TempCluster[2] = TCFire[63];// right top
661 TempCluster[3] = TCFire[iii - 32]; //right
662 TempCluster[4] = TCFire[iii - 31]; //right bottom
663 TempCluster[5] = TCFire[iii + 1]; //bottom
664 TempCluster[6] = 0; //bottom left
665 TempCluster[7] = 0; // left
666 TempCluster[8] = 0; //top left
667 } else if (iii == 95) {
668 TempCluster[0] = TCFire[iii];
669 TempCluster[1] = TCFire[iii - 1]; // top
670 TempCluster[2] = TCFire[iii - 33]; // right top
671 TempCluster[3] = TCFire[iii - 32]; //right
672 TempCluster[4] = TCFire[32]; //right bottom
673 TempCluster[5] = TCFire[64]; //bottom
674 TempCluster[6] = 0; //bottom left
675 TempCluster[7] = 0; // left
676 TempCluster[8] = 0; //top left
677
678 } else {
679 TempCluster[0] = TCFire[iii];
680 TempCluster[1] = TCFire[iii - 1]; // top
681 TempCluster[2] = TCFire[iii - 33]; // right top
682 TempCluster[3] = TCFire[iii - 32]; //right
683 TempCluster[4] = TCFire[iii - 31]; //right bottom
684 TempCluster[5] = TCFire[iii + 1]; //bottom
685 TempCluster[6] = 0; //bottom left
686 TempCluster[7] = 0; // left
687 TempCluster[8] = 0; //top left
688 }
689 if (!(TempCluster[1] != 0 || TempCluster[7] != 0)) {
690 if (!(TempCluster[5] != 0 && TempCluster[6] != 0)) {
691 icn_flag = 1;
692
693 }
694 }
695
696
697 }
698
699 if (icn_flag == 1) {
700 TempICNTCId = TCFire[iii];
701
702 if (Method == 1) { //for cluster method2
703 int maxTCid = 0;
704 double maxTCEnergy = 0;
705 for (int iTC = 0; iTC < 9; iTC++) { //find center of Cluster
706 if (TempCluster[iTC] == 0) {continue;}
707 if (maxTCEnergy < TCFireEnergy[TempCluster[iTC] - 1]) {
708 maxTCEnergy = TCFireEnergy[TempCluster[iTC] - 1];
709 maxTCid = TempCluster[iTC];
710 }
711 }
712 TempCluster.resize(9, 0);
713 TempCluster[0] = maxTCid;
714 int kkk = (TempCluster[0] - 1) / 5;
715 if ((TempCluster[0] - 1) % 5 == 0) {
716 kkk = kkk * 2;
717 } else if ((TempCluster[0] - 1) % 5 == 1) {
718 kkk = 32 + 2 * kkk;
719 } else if ((TempCluster[0] - 1) % 5 == 2) {
720 kkk = 64 + 2 * kkk;
721 } else if ((TempCluster[0] - 1) % 5 == 3) {
722 kkk = 64 + 1 + 2 * kkk;
723 } else if ((TempCluster[0] - 1) % 5 == 4) {
724 kkk = 32 + 1 + 2 * kkk;
725 }
726
727 if (kkk < 32) { // most inner
728 if (kkk == 0) {
729 TempCluster[0] = TCFire[kkk];
730 TempCluster[1] = TCFire[30]; // top
731 TempCluster[2] = TCFire[63]; // left up
732 TempCluster[3] = TCFire[kkk + 32] ; // left 1
733 TempCluster[4] = TCFire[kkk + 33]; // left 2
734 TempCluster[5] = TCFire[kkk + 34]; // left bottom
735 TempCluster[6] = TCFire[kkk + 2]; // bottom
736 TempCluster[7] = 0;
737 TempCluster[8] = 0;
738
739 } else if (kkk == 30) {
740 TempCluster[0] = TCFire[kkk];
741 TempCluster[1] = TCFire[kkk - 2]; // top
742 TempCluster[2] = TCFire[kkk + 31]; // left up
743 TempCluster[3] = TCFire[kkk + 32] ; // left 1
744 TempCluster[4] = TCFire[kkk + 33]; // left 2
745 TempCluster[5] = TCFire[32]; // left bottom
746 TempCluster[6] = TCFire[0]; // bottom
747 TempCluster[7] = 0;
748 TempCluster[8] = 0;
749
750 } else {
751 TempCluster[0] = TCFire[kkk];
752 TempCluster[1] = TCFire[kkk - 2]; // top
753 TempCluster[2] = TCFire[kkk + 31]; // left up
754 TempCluster[3] = TCFire[kkk + 32] ; // left 1
755 TempCluster[4] = TCFire[kkk + 33]; // left 2
756 TempCluster[5] = TCFire[kkk + 34]; // left bottom
757 TempCluster[6] = TCFire[kkk + 2]; // bottom
758 TempCluster[7] = 0;
759 TempCluster[8] = 0;
760
761 }
762
763 } else if (kkk < 64) {
764 if (kkk == 32) {
765 TempCluster[0] = TCFire[kkk];
766 TempCluster[1] = TCFire[63]; // up
767 TempCluster[2] = TCFire[kkk - 2]; // up right
768 TempCluster[3] = TCFire[kkk - 32]; // right
769 TempCluster[4] = 0; //right bottom
770 TempCluster[5] = TCFire[kkk + 1]; // bottom
771 TempCluster[6] = TCFire[kkk + 33]; // left bottom
772 TempCluster[7] = TCFire[kkk + 32]; // left
773 TempCluster[8] = TCFire[95]; // up left
774
775 } else if (kkk == 33) {
776
777 TempCluster[0] = TCFire[kkk];
778 TempCluster[1] = TCFire[kkk - 1]; // up
779 TempCluster[2] = 0; // up right
780 TempCluster[3] = TCFire[kkk - 32]; // right
781 TempCluster[4] = TCFire[kkk - 30]; //right bottom
782 TempCluster[5] = TCFire[kkk + 1]; // bottom
783 TempCluster[6] = TCFire[kkk + 33]; // left bottom
784 TempCluster[7] = TCFire[kkk + 32]; // left
785 TempCluster[8] = TCFire[kkk + 31]; // up left
786
787 }
788
789 else if (kkk == 62) {
790 TempCluster[0] = TCFire[kkk];
791 TempCluster[1] = TCFire[kkk - 1]; // up
792 TempCluster[2] = TCFire[kkk - 34]; // up right
793 TempCluster[3] = TCFire[kkk - 32]; // right
794 TempCluster[4] = 0; //right bottom
795 TempCluster[5] = TCFire[kkk + 1]; // bottom
796 TempCluster[6] = TCFire[kkk + 33]; // left bottom
797 TempCluster[7] = TCFire[kkk + 32]; // left
798 TempCluster[8] = TCFire[kkk + 31]; // up left
799
800
801 } else if (kkk == 63) {
802 TempCluster[0] = TCFire[kkk];
803 TempCluster[1] = TCFire[kkk - 1]; // up
804 TempCluster[2] = 0; // up right
805 TempCluster[3] = TCFire[kkk - 32]; // right
806 TempCluster[4] = TCFire[1]; //right bottom
807 TempCluster[5] = TCFire[32]; // bottom
808 TempCluster[6] = TCFire[64]; // left bottom
809 TempCluster[7] = TCFire[kkk + 32]; // left
810 TempCluster[8] = TCFire[kkk + 31]; // up left
811
812 }
813
814 else {
815 TempCluster[0] = TCFire[kkk];
816 TempCluster[1] = TCFire[kkk - 1]; // up
817 TempCluster[2] = TCFire[kkk - 34]; // up right
818 TempCluster[3] = TCFire[kkk - 32]; // right
819 TempCluster[4] = TCFire[kkk - 30]; //right bottom
820 TempCluster[5] = TCFire[kkk + 1]; // bottom
821 TempCluster[6] = TCFire[kkk + 33]; // left bottom
822 TempCluster[7] = TCFire[kkk + 32]; // left
823 TempCluster[8] = TCFire[kkk + 31]; // up left
824 if (kkk % 2 == 0) {
825 TempCluster[4] = 0;
826 } else {
827 TempCluster[2] = 0;
828 }
829
830 }
831
832
833
834 } else {
835 if (kkk == 64) {
836 TempCluster[0] = TCFire[kkk];
837 TempCluster[1] = TCFire[95]; // top
838 TempCluster[2] = TCFire[63];// right top
839 TempCluster[3] = TCFire[kkk - 32]; //right
840 TempCluster[4] = TCFire[kkk - 31]; //right bottom
841 TempCluster[5] = TCFire[kkk + 1]; //bottom
842 TempCluster[6] = 0; //bottom left
843 TempCluster[7] = 0; // left
844 TempCluster[8] = 0; //top left
845 } else if (kkk == 95) {
846 TempCluster[0] = TCFire[kkk];
847 TempCluster[1] = TCFire[kkk - 1]; // top
848 TempCluster[2] = TCFire[kkk - 33]; // right top
849 TempCluster[3] = TCFire[kkk - 32]; //right
850 TempCluster[4] = TCFire[32]; //right bottom
851 TempCluster[5] = TCFire[64]; //bottom
852 TempCluster[6] = 0; //bottom left
853 TempCluster[7] = 0; // left
854 TempCluster[8] = 0; //top left
855
856 } else {
857 TempCluster[0] = TCFire[kkk];
858 TempCluster[1] = TCFire[kkk - 1]; // top
859 TempCluster[2] = TCFire[kkk - 33]; // right top
860 TempCluster[3] = TCFire[kkk - 32]; //right
861 TempCluster[4] = TCFire[kkk - 31]; //right bottom
862 TempCluster[5] = TCFire[kkk + 1]; //bottom
863 TempCluster[6] = 0; //bottom left
864 TempCluster[7] = 0; // left
865 TempCluster[8] = 0; //top left
866 }
867
868 }
869 }
870 for (int iNearTC = 1; iNearTC < 9; iNearTC ++) {
871 for (int jNearTC = 1; jNearTC < 9; jNearTC ++) {
872 if (TempCluster[iNearTC] == 0) {continue;}
873 if (iNearTC == jNearTC)continue;
874 if (TempCluster[iNearTC] == TempCluster[jNearTC]) {
875 TempCluster[jNearTC] = 0;
876 }
877 }
878 }
879
880 int maxTCId = 999;
881 double clusterenergy = 0;
882 double clustertiming = 0;
883 double clusterpositionX = 0;
884 double clusterpositionY = 0;
885 double clusterpositionZ = 0;
886 int noftcincluster = 0;
887 for (int iNearTC = 0; iNearTC < 9; iNearTC ++) {
888 if (TempCluster[iNearTC] == 0) {continue;}
889 else {noftcincluster++;}
890 clusterenergy += TCFireEnergy[TempCluster[iNearTC] - 1];
891 clustertiming += TCFireEnergy[TempCluster[iNearTC] - 1] * TCFireTiming[TempCluster[iNearTC] - 1];
892 clusterpositionX += TCFireEnergy[TempCluster[iNearTC] - 1] * TCFirePosition[TempCluster[iNearTC] - 1][0];
893 clusterpositionY += TCFireEnergy[TempCluster[iNearTC] - 1] * TCFirePosition[TempCluster[iNearTC] - 1][1];
894 clusterpositionZ += TCFireEnergy[TempCluster[iNearTC] - 1] * TCFirePosition[TempCluster[iNearTC] - 1][2];
895
896 }
897 //
898 maxTCId = TempCluster[0];
899 //
900
901 clustertiming /= clusterenergy;
902 if (_Position == 1) {
903 clusterpositionX /= clusterenergy;
904 clusterpositionY /= clusterenergy;
905 clusterpositionZ /= clusterenergy;
906 } else if (_Position == 0) {
907 clustertiming = TCFireTiming[maxTCId - 1];
908 clusterpositionX = TCFirePosition[maxTCId - 1][0];
909 clusterpositionY = TCFirePosition[maxTCId - 1][1];
910 clusterpositionZ = TCFirePosition[maxTCId - 1][2];
911 }
912 if (clustertiming == 0 && clusterenergy == 0) {continue;}
913
914 TempClusterEnergy.push_back(clusterenergy);
915 TempClusterTiming.push_back(clustertiming);
916 TempClusterPositionX.push_back(clusterpositionX);
917 TempClusterPositionY.push_back(clusterpositionY);
918 TempClusterPositionZ.push_back(clusterpositionZ);
919 TempNofTCinCluster.push_back(noftcincluster);
920 TempMaxTCId.push_back(maxTCId);
921
922 Sort1D.push_back(TempICNTCId);
923 Sort1D.push_back(clusterenergy);
924 Sort1D.push_back(clustertiming);
925 Sort1D.push_back(clusterpositionX);
926 Sort1D.push_back(clusterpositionY);
927 Sort1D.push_back(clusterpositionZ);
928 Sort1D.push_back(noftcincluster);
929 Sort1D.push_back(maxTCId);
930
931 Sort2D.push_back(Sort1D);
932 Sort1D.clear();
933
934 }
935
936 }
937
938 // Sorting in the order of TC Id
939
940 sort(Sort2D.begin(), Sort2D.end(),
941 [](const vector<double>& aa1, const vector<double>& aa2) {return aa1[0] < aa2[0];});
942
943 const int clustersize = Sort2D.size();
944 for (int jtc = 0; jtc < clustersize; jtc++) {
945
946 ClusterEnergy[1].push_back(Sort2D[jtc][1]);
947 ClusterTiming[1].push_back(Sort2D[jtc][2]);
948 ClusterPositionX[1].push_back(Sort2D[jtc][3]);
949 ClusterPositionY[1].push_back(Sort2D[jtc][4]);
950 ClusterPositionZ[1].push_back(Sort2D[jtc][5]);
951 NofTCinCluster[1].push_back(Sort2D[jtc][6]);
952 MaxTCId[1].push_back(Sort2D[jtc][7]);
953 }
954
955 _FWDNofCluster = MaxTCId[1].size();
956}

◆ setICN() [1/2]

void setICN ( const std::vector< int > &  tcid)

set ICN for each part(Fw,Br,Bw)

Definition at line 151 of file TrgEclCluster.cc.

152{
153 TCId = tcid ;
154 _Quadrant.clear();
155 _Quadrant.resize(3, std::vector<int>(4, 0.0));
156 _icnfwbrbw.clear();
157 _icnfwbrbw.resize(3, 0);
158 _BRICN = 0 ;
159 _FWDICN = 0;
160 _BWDICN = 0;
161
165
166 return;
167}
int setBarrelICN()
calculate Belle ICN in Barrel
int setBackwardICN()
calculate Belle ICN in Backward endcap
int setForwardICN()
calculate Belle ICN in Foward endcap

◆ setICN() [2/2]

void setICN ( const std::vector< int > &  tcid,
const std::vector< double > &  tcenergy,
const std::vector< double > &  tctiming 
)

set Belle 2 Clustering

Definition at line 172 of file TrgEclCluster.cc.

175{
176 TCId = tcid ;
177 Energy = tcenergy;
178 Timing = tctiming;
179
183
184 save(_EventId);
185
186 return;
187}
void save(int)
Save Cluster information in TRGECLCluster Table.

Member Data Documentation

◆ _BrCluster

std::vector<std::vector<int> > _BrCluster
private

cluster in barrel

Definition at line 144 of file TrgEclCluster.h.

◆ _BRICN

int _BRICN
private

get Beam bkg veto flag.

On = true, Off = false. ICN in Barrel

Definition at line 110 of file TrgEclCluster.h.

◆ _BRNofCluster

int _BRNofCluster
private

Cluster in Barrel.

Definition at line 116 of file TrgEclCluster.h.

◆ _BwCluster

std::vector<std::vector<int> > _BwCluster
private

cluster in backward endcap

Definition at line 148 of file TrgEclCluster.h.

◆ _BWDICN

int _BWDICN
private

ICN in Backward Endcap.

Definition at line 114 of file TrgEclCluster.h.

◆ _BWDNofCluster

int _BWDNofCluster
private

Cluster in Backward Endcap.

Definition at line 120 of file TrgEclCluster.h.

◆ _EventId

int _EventId
private

event number

Definition at line 122 of file TrgEclCluster.h.

◆ _FwCluster

std::vector<std::vector<int> > _FwCluster
private

cluster in forward endcap

Definition at line 146 of file TrgEclCluster.h.

◆ _FWDICN

int _FWDICN
private

ICN in Forward Endcap.

Definition at line 112 of file TrgEclCluster.h.

◆ _FWDNofCluster

int _FWDNofCluster
private

Cluster in Forward Endcap.

Definition at line 118 of file TrgEclCluster.h.

◆ _icnfwbrbw

std::vector<int> _icnfwbrbw
private

icn

Definition at line 132 of file TrgEclCluster.h.

◆ _LimitNCluster

int _LimitNCluster
private

the Limit Number of Cluster

Definition at line 126 of file TrgEclCluster.h.

◆ _Method

int _Method
private

Clustering method.

Definition at line 124 of file TrgEclCluster.h.

◆ _Position

int _Position
private

Position calculation method(0:Most energetic TC Postion, 1 : Energy weighted Postion)

Definition at line 128 of file TrgEclCluster.h.

◆ _Quadrant

std::vector<std::vector<int> > _Quadrant
private

Quadrant for Beam Backgournd veto.

Definition at line 141 of file TrgEclCluster.h.

◆ _TCMap

TrgEclMapping* _TCMap
private

Object of TC Mapping.

Definition at line 169 of file TrgEclCluster.h.

◆ ClusterEnergy

std::vector<std::vector<double> > ClusterEnergy
private

Cluster enrgy

Definition at line 155 of file TrgEclCluster.h.

◆ ClusterPositionX

std::vector<std::vector<double> > ClusterPositionX
private

Cluster position in X-axis.

Definition at line 157 of file TrgEclCluster.h.

◆ ClusterPositionY

std::vector<std::vector<double> > ClusterPositionY
private

Cluster position in Y-axis.

Definition at line 159 of file TrgEclCluster.h.

◆ ClusterPositionZ

std::vector<std::vector<double> > ClusterPositionZ
private

Cluster position in Z-axis.

Definition at line 161 of file TrgEclCluster.h.

◆ ClusterTiming

std::vector<std::vector<double> > ClusterTiming
private

Cluster timing.

Definition at line 153 of file TrgEclCluster.h.

◆ Energy

std::vector<double> Energy
private

TC energy

Definition at line 138 of file TrgEclCluster.h.

◆ MaxTCId

std::vector<std::vector<int> > MaxTCId
private

Maximum contribution TC Id in Cluster.

Definition at line 165 of file TrgEclCluster.h.

◆ NofTCinCluster

std::vector<std::vector<int> > NofTCinCluster
private

N of TC in Cluster

Definition at line 163 of file TrgEclCluster.h.

◆ TCId

std::vector<int> TCId
private

TC Id.

Definition at line 134 of file TrgEclCluster.h.

◆ TempCluster

std::vector<int> TempCluster
private

Temporal Cluster.

Definition at line 167 of file TrgEclCluster.h.

◆ Timing

std::vector<double> Timing
private

TC timing.

Definition at line 136 of file TrgEclCluster.h.


The documentation for this class was generated from the following files: