18#include "GaudiKernel/ISvcLocator.h"
19#include "GaudiKernel/Bootstrap.h"
20#include "GaudiKernel/IDataProviderSvc.h"
21#include "CLHEP/Random/RandGauss.h"
42 for(
int j=0;j<TrigConf::TCPHINO_B;j++)
45 for(
int i=0;i<TrigConf::TCTHETANO_B;i++)
51 for(
int j =0;j<TrigConf::TCPHINO_E/2;j++)
53 if(j < TrigConf::TCPHINO_E/2) {
57 for(
int i =0;i<TrigConf::TCTHETANO_E;i++)
59 EEClusterId[i][j] = 0;
60 WEClusterId[i][j] = 0;
64 std::vector<double> emcClusE;
67 for(
int i=0;i<TrigConf::TCTHETANO_B;i++)
68 for(
int j=0;j<TrigConf::TCPHINO_B;j++)
75 int block_phi = int (j/5);
76 if(((block_phi%2 == 0) && i > 5) || ((block_phi%2 == 1) && i > 4)) WClus_Z =
true;
82 for(
int i =0;i<TrigConf::TCTHETANO_E;i++)
83 for(
int j =0;j<TrigConf::TCPHINO_E/2;j++)
85 if(
findCluster(0,i,j)) { EEClusterId[i][j] = 1; EClus_Z =
true; emcClusE.push_back(m_EmcTCFinder->
getEETCEnergy(i,j)); }
86 if(
findCluster(2,i,j)) { WEClusterId[i][j] = 1; WClus_Z =
true; emcClusE.push_back(m_EmcTCFinder->
getWETCEnergy(i,j)); }
89 for(
int j = 0;j<TrigConf::TCPHINO_B;j++)
90 for(
int i =0;i<TrigConf::TCTHETANO_B;i++)
92 if(BClusterId[i][j]==1)
99 for(
int j =0;j<TrigConf::TCPHINO_E/2;j++)
100 for(
int i =0;i<TrigConf::TCTHETANO_E;i++)
102 if(WEClusterId[i][j] == 1)
108 for(
int j =0;j<TrigConf::TCPHINO_E/2;j++)
109 for(
int i =0;i<TrigConf::TCTHETANO_E;i++)
111 if(EEClusterId[i][j] == 1)
119 int nbCluster = 0, neeCluster = 0, nweCluster = 0;
121 map<int,vector<complex<int> >, greater<int> > mClusId;
122 std::vector<complex<int> > vClusIdBR;
123 std::vector<complex<int> > vClusIdEE;
124 std::vector<complex<int> > vClusIdWE;
125 typedef pair<int, vector<complex<int> > > vpair;
131 for(
int i=0;i<TrigConf::TCTHETANO_B;i++)
132 for(
int j=0;j<TrigConf::TCPHINO_B;j++)
134 int BClusId = BClusterId[i][j];
137 complex<int> clusId(i,j);
138 vClusIdBR.push_back(clusId);
141 for(
int i=0; i<TrigConf::TCTHETANO_E; i++)
142 for(
int j=0; j<TrigConf::TCPHINO_E/2; j++)
144 if(EEClusterPhi[j]) {
146 complex<int> clusId(i,j);
147 vClusIdEE.push_back(clusId);
149 if(WEClusterPhi[j]) {
151 complex<int> clusId(i,j);
152 vClusIdWE.push_back(clusId);
156 mClusId.insert(vpair(1,vClusIdBR));
157 mClusId.insert(vpair(0,vClusIdEE));
158 mClusId.insert(vpair(2,vClusIdWE));
160 ISvcLocator* svcLocator = Gaudi::svcLocator();
161 StatusCode sc = svcLocator->service(
"BesGlobalTrigSvc", m_tmpSvc);
183 int clus0,clus1,clus3,clus4,clus8;
246 clus0 = m_EmcTCFinder->
getBTC(TCThetaNb,TCPhiNb);
250 if(TCPhiNb != 0) clus1 = m_EmcTCFinder->
getBTC(TCThetaNb,TCPhiNb - 1);
251 else clus1 = m_EmcTCFinder->
getBTC(TCThetaNb,TrigConf::TCPHINO_B-1);
256 if(TCThetaNb!=0) clus3 = m_EmcTCFinder->
getBTC(TCThetaNb - 1,TCPhiNb);
259 if(TCPhiNb!=(TrigConf::TCPHINO_B-1)) clus4 = m_EmcTCFinder->
getBTC(TCThetaNb,TCPhiNb+1);
260 else clus4 = m_EmcTCFinder->
getBTC(TCThetaNb,0);
274 if(TCThetaNb!=0&&TCPhiNb!=(TrigConf::TCPHINO_B-1)) clus8 = m_EmcTCFinder->
getBTC(TCThetaNb-1,TCPhiNb+1);
275 if(TCThetaNb==0) clus8 = 1;
276 if(TCThetaNb!=0&&TCPhiNb==(TrigConf::TCPHINO_B-1)) clus8 = m_EmcTCFinder->
getBTC(TCThetaNb-1,0);
279 if(!((clus3 > 0)||(clus1 > 0)) && !((clus4 > 0)&&(clus8 > 0)))
405 int etc1,etc2,etc3,etc4;
406 etc1 = m_EmcTCFinder->
getEETC(TCThetaNb,TCPhiNb*2);
407 etc2 = m_EmcTCFinder->
getEETC(TCThetaNb,TCPhiNb*2+1);
408 if(etc1 > 0 || etc2 > 0) clus0 = 1;
412 etc3 = m_EmcTCFinder->
getEETC(TCThetaNb,(TCPhiNb-1)*2);
413 etc4 = m_EmcTCFinder->
getEETC(TCThetaNb,(TCPhiNb-1)*2+1);
414 if(etc3 > 0 || etc4 > 0) clus1 = 1;
418 etc3 = m_EmcTCFinder->
getEETC(TCThetaNb,(TrigConf::TCPHINO_E/2-1)*2);
419 etc4 = m_EmcTCFinder->
getEETC(TCThetaNb,(TrigConf::TCPHINO_E/2-1)*2+1);
420 if(etc3 > 0 || etc4 > 0) clus1 = 1;
424 if((clus0 > 0)&&(clus1 == 0))
return true;
437 int etc1,etc2,etc3,etc4;
438 etc1 = m_EmcTCFinder->
getWETC(TCThetaNb,TCPhiNb*2);
439 etc2 = m_EmcTCFinder->
getWETC(TCThetaNb,TCPhiNb*2+1);
440 if(etc1 > 0 || etc2 > 0) clus0 = 1;
443 if(TCPhiNb!= (TrigConf::TCPHINO_E/2-1)) {
444 etc3 = m_EmcTCFinder->
getWETC(TCThetaNb,(TCPhiNb+1)*2);
445 etc4 = m_EmcTCFinder->
getWETC(TCThetaNb,(TCPhiNb+1)*2+1);
446 if(etc3 > 0 || etc4 > 0) clus1 = 1;
450 etc3 = m_EmcTCFinder->
getWETC(TCThetaNb,0);
451 etc4 = m_EmcTCFinder->
getWETC(TCThetaNb,1);
452 if(etc3 > 0 || etc4 > 0) clus1 = 1;
456 if((clus0 > 0)&&(clus1 == 0))
return true;
void setEmcNbCluster(int i)
void setEmcClusE(std::vector< double > i)
void setEmcClusId(map< int, vector< complex< int > >, greater< int > > i)
void setEmcNweCluster(int i)
void setEmcNeeCluster(int i)
bool findCluster(int partId, int TCThetaNb, int TCPhiNb)
static EmcTCFinder * get_Emc(void)
int & getWETC(int i, int j)
double & getBTCEnergy(int i, int j)
int & getEETC(int i, int j)
double & getEETCEnergy(int i, int j)
int & getBTC(int i, int j)
double & getWETCEnergy(int i, int j)