Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BesEmcTrig Class Reference

#include <BesEmcTrig.h>

List of all members.

Public Member Functions

 BesEmcTrig ()
 BesEmcTrig ()
void startEmcTrig ()
void startEmcTrig ()
 ~BesEmcTrig ()
 ~BesEmcTrig ()

Private Attributes

bool BClus_Phi
bool BClusBB
bool BEtot_H
bool BL_BBLK
bool BL_EBLK
bool BL_Z
bool Clus_Z
bool Diff_B
bool Diff_E
bool EClus_Phi
bool EClusBB
bool EEtot_H
bool Etot_L
bool Etot_M
EmcCCountm_EmcCCount
EmcCCountm_EmcCCount
EmcESumm_EmcESum
EmcESumm_EmcESum
BesGlobalTrigSvcm_pIBGT
BesGlobalTrigSvcm_pIBGT
IBesGlobalTrigSvcm_tmpSvc
IBesGlobalTrigSvcm_tmpSvc
bool NBClus1
bool NClus1
bool NClus2
bool NEClus1


Constructor & Destructor Documentation

BesEmcTrig::BesEmcTrig  ) 
 

00029 {
00030   m_EmcESum = new EmcESum();
00031   m_EmcCCount = new EmcCCount();
00032   ISvcLocator* svcLocator = Gaudi::svcLocator();
00033   StatusCode sc = svcLocator->service("BesGlobalTrigSvc", m_tmpSvc);
00034   m_pIBGT = dynamic_cast<BesGlobalTrigSvc* >(m_tmpSvc);
00035 //  cout<<"BesEmcTrig output "<<endl;
00036 }

BesEmcTrig::~BesEmcTrig  ) 
 

00038 {
00039   if(m_EmcESum) delete m_EmcESum;
00040   if(m_EmcCCount) delete m_EmcCCount;
00041 }

BesEmcTrig::BesEmcTrig  ) 
 

BesEmcTrig::~BesEmcTrig  ) 
 


Member Function Documentation

void BesEmcTrig::startEmcTrig  ) 
 

void BesEmcTrig::startEmcTrig  ) 
 

00043 {
00044         m_EmcESum->getESum();
00045         m_EmcCCount->getClusterId();
00046         //reset values
00047         NClus1 = false;
00048         NClus2 = false;
00049         NBClus1 = false;
00050         NEClus1 = false;
00051 
00052         BClus_Phi = false;
00053         EClus_Phi = false;
00054         EClusBB = false;
00055         BClusBB = false;
00056         Clus_Z = false;
00057         BL_BBLK = false;
00058         
00059         Etot_L = false;
00060         Etot_M = false;
00061         BEtot_H = false;
00062         EEtot_H = false;
00063         
00064         BL_Z = false;
00065         Diff_E = false;
00066         Diff_B = false;
00067         //BL_BEMC = false; //not used
00068         BL_EBLK = false;
00069         
00070         //set cluster number trigger conditions including barrel and endcaps
00071         int nbcluster = 0, necluster = 0;
00072         nbcluster = m_pIBGT->getEmcNbCluster();
00073         necluster = m_pIBGT->getEmcNweCluster() + m_pIBGT->getEmcNeeCluster();
00074         if((nbcluster + necluster)>=1) NClus1 = true;
00075         if((nbcluster + necluster)>=2) NClus2 = true;
00076         if(nbcluster >= 1) NBClus1 = true;
00077         if(necluster >= 1) NEClus1 = true;
00078 
00079         double L1ETOT_L = double (m_pIBGT->getL1ETOT_L());
00080         double L1ETOT_M = double (m_pIBGT->getL1ETOT_M());
00081         double L1EDIFF_BR = double (m_pIBGT->getL1EDIFF_BR());
00082         double L1EDIFF_EC = double (m_pIBGT->getL1EDIFF_EC());
00083         //middle energy threshold neut_a used
00084         /*for(int i = 0; ; i++) {
00085           double theshold = RandGauss::shoot(m_pIBGT->getL1ETOT_M_Peak(),m_pIBGT->getL1ETOT_M_Sigma());
00086           if(theshold < m_pIBGT->getL1ETOT_M_Peak()) {
00087             L1ETOT_M = theshold;
00088             break;
00089           }
00090         }
00091         for(int i = 0; ; i++) {
00092           double theshold = RandGauss::shoot(m_pIBGT->getL1ETOT_L_Peak(),m_pIBGT->getL1ETOT_L_Sigma());
00093           if(theshold < m_pIBGT->getL1ETOT_L_Peak()) {
00094             L1ETOT_L = theshold;
00095             break;
00096           }
00097         }*/
00098         
00099         if((m_EmcESum->getTotE() > L1ETOT_M) ) Etot_M = true;
00100         //low energy threshold(charge channel used)
00101         if((m_EmcESum->getTotE() > L1ETOT_L) ) Etot_L = true;
00102         //energy balance check for reserved in barrel 
00103         if((std::abs(m_EmcESum->getLBTotE() - m_EmcESum->getRBTotE())<L1EDIFF_BR))
00104         Diff_B = true;
00105         //energy balance check for babar of endcap      
00106         if((std::abs(m_EmcESum->getWETotE() - m_EmcESum->getEETotE())<L1EDIFF_EC))
00107         Diff_E = true;
00108         //High energy threshold in barrel
00109         double L1ETOT_BR = double (m_pIBGT->getL1ETOT_BR());
00110         double L1ETOT_EC = double (m_pIBGT->getL1ETOT_EC());
00111         /*for(int i = 0; ; i++) {
00112           double theshold = RandGauss::shoot(m_pIBGT->getL1ETOT_BR_Peak(),m_pIBGT->getL1ETOT_BR_Sigma());
00113           if( theshold < m_pIBGT->getL1ETOT_BR_Peak()) {
00114             L1ETOT_BR = theshold;
00115             break;
00116           }
00117         }
00118         for(int i = 0; ; i++) {
00119           double theshold = RandGauss::shoot(m_pIBGT->getL1ETOT_EC_Peak(),m_pIBGT->getL1ETOT_EC_Sigma());
00120           if(theshold < m_pIBGT->getL1ETOT_EC_Peak()) {
00121             L1ETOT_EC = theshold;
00122             break;
00123           }
00124         }*/
00125         if((m_EmcESum->getBTotE()>L1ETOT_BR)) BEtot_H = true;
00126         //High energy threshold(for babar trigger condition) 
00127         if((m_EmcESum->getETotE()>L1ETOT_EC)) EEtot_H = true;
00128         //energy balance check for reserved in barrel
00129         //double L1EBL_BR = m_pIBGT->getL1EBL_BR();
00130         //if(m_EmcESum->GetLBTotE() > L1EBL_BR && m_EmcESum->GetRBTotE() > L1EBL_BR)
00131         //BL_BEMC = true;
00132         //energy balance check for babar of endcap
00133         double L1EBL_EC = double (m_pIBGT->getL1EBL_EC());
00134         if((m_EmcESum->getWETotE()>L1EBL_EC && m_EmcESum->getEETotE()>L1EBL_EC))
00135         BL_EBLK = true;
00136 
00137         //check balance condition of block energy for babar trigger 
00138         double energy0 = m_EmcESum->getBBLKE(0);
00139         double energy1 = m_EmcESum->getBBLKE(1);
00140         double energy2 = m_EmcESum->getBBLKE(2);
00141         double energy3 = m_EmcESum->getBBLKE(3);
00142         double energy4 = m_EmcESum->getBBLKE(4);
00143         double energy5 = m_EmcESum->getBBLKE(5);
00144         double energy9 = m_EmcESum->getBBLKE(9);
00145         double energy10 = m_EmcESum->getBBLKE(10);
00146         double energy6 = m_EmcESum->getBBLKE(6);
00147         double energy11 = m_EmcESum->getBBLKE(11);
00148         double energy7 = m_EmcESum->getBBLKE(7);
00149         double energy8 = m_EmcESum->getBBLKE(8);
00150         double L1BLK_GATE = double (m_pIBGT->getL1BLK_GATE());
00151         if((energy0+energy1)>L1BLK_GATE && (energy9+energy10)>L1BLK_GATE)
00152           BL_BBLK = true;
00153         if((energy1+energy2)>L1BLK_GATE && (energy10+energy11)>L1BLK_GATE)
00154           BL_BBLK = true;
00155         if((energy2+energy3)>L1BLK_GATE && (energy11+energy6)>L1BLK_GATE)
00156           BL_BBLK = true;
00157         if((energy3+energy4)>L1BLK_GATE && (energy6+energy7)>L1BLK_GATE)
00158           BL_BBLK = true;
00159         if((energy4+energy5)>L1BLK_GATE && (energy7+energy8)>L1BLK_GATE)
00160           BL_BBLK = true;
00161         if((energy5+energy0)>L1BLK_GATE && (energy8+energy9)>L1BLK_GATE)
00162           BL_BBLK = true;
00163         //double WEenergy1 = m_EmcESum->getWEBLKE(0);
00164         //double WEenergy2 = m_EmcESum->getWEBLKE(1);
00165         //double EEenergy1 = m_EmcESum->getEEBLKE(0);
00166         //double EEenergy2 = m_EmcESum->getEEBLKE(1);
00167         //if(((WEenergy1>L1BLK_GATE || WEenergy2>L1BLK_GATE) && (EEenergy1>L1BLK_GATE || EEenergy2>L1BLK_GATE)) ) BL_BBLK = true;
00168 
00169         //check cluster balance in phi of barral
00170         for(int j =0;j<TrigConf::TCPHINO_B;j++)
00171         {
00172           int bphi = m_EmcCCount->getBClusterPhi(j);
00173           if(bphi==0) continue;
00174           if(bphi==1)
00175           {
00176             int NCluster = 0;
00177             for(int k =0;k<15;k++)
00178             {
00179               if((8+k+j)<TrigConf::TCPHINO_B)      
00180                 NCluster+=m_EmcCCount->getBClusterPhi(8+k+j);
00181               else
00182                 NCluster+=m_EmcCCount->getBClusterPhi(8+k+j-TrigConf::TCPHINO_B);
00183               if(NCluster>=1)
00184               {
00185                 BClus_Phi = true;
00186                 break;
00187                }
00188             }
00189             if(BClus_Phi == true)
00190               break;
00191           }
00192         }
00193                 
00194         //check cluster balance in phi of endcap.
00195         for(int j = 0;j<TrigConf::TCPHINO_E/2;j++)
00196         {
00197           int wephi = m_EmcCCount->getWEClusterPhi(j);
00198           if(wephi == 0)  continue;
00199           if(wephi == 1)
00200           {
00201             int NCluster = 0;
00202             for(int k=0;k<7;k++)
00203             {
00204               if((j+5+k)<TrigConf::TCPHINO_E/2)
00205                 NCluster+= m_EmcCCount->getEEClusterPhi(j+5+k);
00206               else 
00207                 NCluster+= m_EmcCCount->getEEClusterPhi(j+5+k-TrigConf::TCPHINO_E/2);
00208               if(NCluster>=1)
00209               {
00210                 EClus_Phi = true;
00211                 break;
00212               }
00213             }
00214             if(EClus_Phi == true)
00215               break;
00216           }
00217         }
00218 
00219         //check barrel cluster balance in theta and phi for babar trigger
00220         for(int i=0;i<TrigConf::TCTHETANO_B;i++)
00221           for(int j=0;j<TrigConf::TCPHINO_B;j++)
00222           {
00223             int BClusId = m_EmcCCount->getBClusterId(i,j);
00224             int NCluster = 0;
00225             if(BClusId==0) continue;
00226             else
00227             {
00228               if(i>0&&i<(TrigConf::TCTHETANO_B-1))
00229               {
00230                 for(int k=0;k<5;k++)
00231                 {
00232                   if(j+13+k<TrigConf::TCPHINO_B) 
00233                   {
00234                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i,j+13+k);
00235                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i+1,j+13+k);
00236                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i-1,j+13+k);
00237                   }
00238                   else
00239                   {
00240                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i,j+13+k-TrigConf::TCPHINO_B);
00241                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i+1,j+13+k-TrigConf::TCPHINO_B);
00242                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1)-i-1,j+13+k-TrigConf::TCPHINO_B);
00243                   }
00244                 }
00245                 if(NCluster>0) { BClusBB = true; break; }
00246               }
00247               if(i==0) 
00248               {
00249                 for(int k=0;k<5;k++)
00250                 {
00251                   if(j+13+k<TrigConf::TCPHINO_B)                                      
00252                   {                                                  
00253                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1),j+13+k);
00254                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-2),j+13+k);
00255                   }                                                  
00256                   else                                               
00257                   {                                                  
00258                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-2),j+13+k-TrigConf::TCPHINO_B);
00259                     NCluster+= m_EmcCCount->getBClusterId((TrigConf::TCTHETANO_B-1),j+13+k-TrigConf::TCPHINO_B);
00260                   }                                                  
00261                 }
00262                 if(NCluster>0) { BClusBB = true; break; }
00263               }
00264               if(i==(TrigConf::TCTHETANO_B-1)) 
00265               {
00266                 for(int k=0;k<5;k++)
00267                 {
00268                   if(j+13+k<TrigConf::TCPHINO_B)                                      
00269                   {                                                  
00270                     NCluster+= m_EmcCCount->getBClusterId(0,j+13+k);
00271                     NCluster+= m_EmcCCount->getBClusterId(1,j+13+k);
00272                   }                                                  
00273                   else                                               
00274                   {                                                  
00275                     NCluster+= m_EmcCCount->getBClusterId(0,j+13+k-TrigConf::TCPHINO_B);
00276                     NCluster+= m_EmcCCount->getBClusterId(1,j+13+k-TrigConf::TCPHINO_B);
00277                   }                                                  
00278                 }
00279                 if(NCluster>0) { BClusBB = true; break; }
00280               }
00281             }
00282           }
00283         //check endcap cluster balance in phi for babar trigger
00284         for(int j = 0;j<TrigConf::TCPHINO_E/2;j++)
00285         {
00286           int NCluster = 0; 
00287           int EClusId = m_EmcCCount->getWEClusterPhi(j);
00288           
00289           if(EClusId == 0)  continue;
00290           else 
00291           {
00292             
00293             for(int k=0;k<3;k++)
00294             {
00295               if((j+7+k)<TrigConf::TCPHINO_E/2)
00296                 NCluster+= m_EmcCCount->getEEClusterPhi(j+7+k);
00297               else 
00298                 NCluster+= m_EmcCCount->getEEClusterPhi(j+7+k-TrigConf::TCPHINO_E/2);
00299               if(NCluster>=1)
00300               {
00301                 EClusBB = true;
00302                 break;
00303               }
00304             }
00305             if(EClusBB == true)
00306               break;
00307           }
00308         }
00309         //z energy balance (B+E)
00310         double L1EBL_Z = double (m_pIBGT->getL1EBL_Z());
00311         /*for(int i = 0; ; i++) {
00312           double theshold = RandGauss::shoot(m_pIBGT->getL1EBL_Z_Peak(),m_pIBGT->getL1EBL_Z_Sigma());
00313           if(theshold < m_pIBGT->getL1EBL_Z_Peak()) {
00314             L1EBL_Z = theshold;
00315             break;
00316           }
00317         }*/
00318         if((m_EmcESum->getRTotE()>=L1EBL_Z && m_EmcESum->getLTotE()>=L1EBL_Z))
00319         BL_Z = true;
00320 //      cout<<"RTotE and LTotE are "<<m_EmcESum->GetRTotE()<<" "<<m_EmcESum->GetLTotE()<<endl;
00321 //
00322         //z cluster balance (if one cluster is found in each side ,return true)
00323         if(m_EmcCCount->getEClus_Z()&&m_EmcCCount->getWClus_Z())
00324         Clus_Z = true;
00325 
00326         //set trigger conditions in service
00327 
00328         m_pIBGT->setNClus1(NClus1);
00329         m_pIBGT->setNClus2(NClus2);
00330         m_pIBGT->setNBClus1(NBClus1);
00331         m_pIBGT->setNEClus1(NEClus1);
00332 
00333         m_pIBGT->setBClusBB(BClusBB);
00334         m_pIBGT->setEClusBB(EClusBB);
00335         m_pIBGT->setClus_Z(Clus_Z);
00336         m_pIBGT->setBClus_PHI(BClus_Phi);
00337         m_pIBGT->setEClus_PHI(EClus_Phi);
00338         m_pIBGT->setBEtot_H(BEtot_H);
00339         m_pIBGT->setEEtot_H(EEtot_H);
00340         m_pIBGT->setEtot_L(Etot_L);
00341         m_pIBGT->setEtot_M(Etot_M);
00342         m_pIBGT->setBL_Z(BL_Z);
00343         m_pIBGT->setDiff_B(Diff_B);
00344         m_pIBGT->setDiff_E(Diff_E);
00345         m_pIBGT->setBL_BBLK(BL_BBLK);
00346         m_pIBGT->setBL_EBLK(BL_EBLK);
00347 }


Member Data Documentation

bool BesEmcTrig::BClus_Phi [private]
 

bool BesEmcTrig::BClusBB [private]
 

bool BesEmcTrig::BEtot_H [private]
 

bool BesEmcTrig::BL_BBLK [private]
 

bool BesEmcTrig::BL_EBLK [private]
 

bool BesEmcTrig::BL_Z [private]
 

bool BesEmcTrig::Clus_Z [private]
 

bool BesEmcTrig::Diff_B [private]
 

bool BesEmcTrig::Diff_E [private]
 

bool BesEmcTrig::EClus_Phi [private]
 

bool BesEmcTrig::EClusBB [private]
 

bool BesEmcTrig::EEtot_H [private]
 

bool BesEmcTrig::Etot_L [private]
 

bool BesEmcTrig::Etot_M [private]
 

EmcCCount* BesEmcTrig::m_EmcCCount [private]
 

EmcCCount* BesEmcTrig::m_EmcCCount [private]
 

EmcESum* BesEmcTrig::m_EmcESum [private]
 

EmcESum* BesEmcTrig::m_EmcESum [private]
 

BesGlobalTrigSvc* BesEmcTrig::m_pIBGT [private]
 

BesGlobalTrigSvc* BesEmcTrig::m_pIBGT [private]
 

IBesGlobalTrigSvc* BesEmcTrig::m_tmpSvc [private]
 

IBesGlobalTrigSvc* BesEmcTrig::m_tmpSvc [private]
 

bool BesEmcTrig::NBClus1 [private]
 

bool BesEmcTrig::NClus1 [private]
 

bool BesEmcTrig::NClus2 [private]
 

bool BesEmcTrig::NEClus1 [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:52:22 2011 for BOSS6.5.5 by  doxygen 1.3.9.1