13#include "Trigger/BesEmcTrig.h"
14#include "Trigger/EmcESum.h"
15#include "Trigger/EmcCCount.h"
16#include "Trigger/TrigPara.h"
18#include "Trigger/IBesGlobalTrigSvc.h"
19#include "Trigger/BesGlobalTrigSvc.h"
20#include "GaudiKernel/ISvcLocator.h"
21#include "GaudiKernel/Bootstrap.h"
22#include "GaudiKernel/IDataProviderSvc.h"
23#include "CLHEP/Random/RandGauss.h"
36 if(m_EmcESum)
delete m_EmcESum;
37 if(m_EmcCCount)
delete m_EmcCCount;
67 ISvcLocator* svcLocator = Gaudi::svcLocator();
68 StatusCode sc = svcLocator->service(
"BesGlobalTrigSvc", m_tmpSvc);
72 int nbcluster = 0, necluster = 0;
75 if((nbcluster + necluster)>=1) NClus1 =
true;
76 if((nbcluster + necluster)>=2) NClus2 =
true;
77 if(nbcluster >= 1) NBClus1 =
true;
78 if(necluster >= 1) NEClus1 =
true;
100 if((m_EmcESum->
getTotE() > L1ETOT_M) ) Etot_M =
true;
102 if((m_EmcESum->
getTotE() > L1ETOT_L) ) Etot_L =
true;
126 if((m_EmcESum->
getBTotE()>L1ETOT_BR)) BEtot_H =
true;
128 if((m_EmcESum->
getETotE()>L1ETOT_EC)) EEtot_H =
true;
139 double energy0 = m_EmcESum->
getBBLKE(0);
140 double energy1 = m_EmcESum->
getBBLKE(1);
141 double energy2 = m_EmcESum->
getBBLKE(2);
142 double energy3 = m_EmcESum->
getBBLKE(3);
143 double energy4 = m_EmcESum->
getBBLKE(4);
144 double energy5 = m_EmcESum->
getBBLKE(5);
145 double energy9 = m_EmcESum->
getBBLKE(9);
146 double energy10 = m_EmcESum->
getBBLKE(10);
147 double energy6 = m_EmcESum->
getBBLKE(6);
148 double energy11 = m_EmcESum->
getBBLKE(11);
149 double energy7 = m_EmcESum->
getBBLKE(7);
150 double energy8 = m_EmcESum->
getBBLKE(8);
152 if((energy0+energy1)>L1BLK_GATE && (energy9+energy10)>L1BLK_GATE)
154 if((energy1+energy2)>L1BLK_GATE && (energy10+energy11)>L1BLK_GATE)
156 if((energy2+energy3)>L1BLK_GATE && (energy11+energy6)>L1BLK_GATE)
158 if((energy3+energy4)>L1BLK_GATE && (energy6+energy7)>L1BLK_GATE)
160 if((energy4+energy5)>L1BLK_GATE && (energy7+energy8)>L1BLK_GATE)
162 if((energy5+energy0)>L1BLK_GATE && (energy8+energy9)>L1BLK_GATE)
171 for(
int j =0;j<TrigConf::TCPHINO_B;j++)
174 if(bphi==0)
continue;
178 for(
int k =0;k<15;k++)
180 if((8+k+j)<TrigConf::TCPHINO_B)
190 if(BClus_Phi ==
true)
196 for(
int j = 0;j<TrigConf::TCPHINO_E/2;j++)
199 if(wephi == 0)
continue;
205 if((j+5+k)<TrigConf::TCPHINO_E/2)
215 if(EClus_Phi ==
true)
221 for(
int i=0;i<TrigConf::TCTHETANO_B;i++)
222 for(
int j=0;j<TrigConf::TCPHINO_B;j++)
226 if(BClusId==0)
continue;
229 if(i>0&&i<(TrigConf::TCTHETANO_B-1))
233 if(j+13+k<TrigConf::TCPHINO_B)
235 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i,j+13+k);
236 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i+1,j+13+k);
237 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i-1,j+13+k);
241 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i,j+13+k-TrigConf::TCPHINO_B);
242 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i+1,j+13+k-TrigConf::TCPHINO_B);
243 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1)-i-1,j+13+k-TrigConf::TCPHINO_B);
246 if(NCluster>0) { BClusBB =
true;
break; }
252 if(j+13+k<TrigConf::TCPHINO_B)
254 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1),j+13+k);
255 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-2),j+13+k);
259 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-2),j+13+k-TrigConf::TCPHINO_B);
260 NCluster+= m_EmcCCount->
getBClusterId((TrigConf::TCTHETANO_B-1),j+13+k-TrigConf::TCPHINO_B);
263 if(NCluster>0) { BClusBB =
true;
break; }
265 if(i==(TrigConf::TCTHETANO_B-1))
269 if(j+13+k<TrigConf::TCPHINO_B)
276 NCluster+= m_EmcCCount->
getBClusterId(0,j+13+k-TrigConf::TCPHINO_B);
277 NCluster+= m_EmcCCount->
getBClusterId(1,j+13+k-TrigConf::TCPHINO_B);
280 if(NCluster>0) { BClusBB =
true;
break; }
285 for(
int j = 0;j<TrigConf::TCPHINO_E/2;j++)
290 if(EClusId == 0)
continue;
296 if((j+7+k)<TrigConf::TCPHINO_E/2)
311 double L1EBL_Z = double (m_pIBGT->
getL1EBL_Z());
void setEClus_PHI(bool i)
void setBClus_PHI(bool i)
int getBClusterId(int i, int j)
int getBClusterPhi(int i)
int getEEClusterPhi(int i)
int getWEClusterPhi(int i)