BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcESum Class Reference

#include <EmcESum.h>

Public Member Functions

 EmcESum ()
 
 ~EmcESum ()
 
void getESum ()
 
double getTotE ()
 
double getLTotE ()
 
double getRTotE ()
 
double getBTotE ()
 
double getETotE ()
 
double getLBTotE ()
 
double getRBTotE ()
 
double getWETotE ()
 
double getEETotE ()
 
double getBBLKE (int i)
 
double getWEBLKE (int i)
 
double getEEBLKE (int i)
 
 EmcESum ()
 
 ~EmcESum ()
 
void getESum ()
 
double getTotE ()
 
double getLTotE ()
 
double getRTotE ()
 
double getBTotE ()
 
double getETotE ()
 
double getLBTotE ()
 
double getRBTotE ()
 
double getWETotE ()
 
double getEETotE ()
 
double getBBLKE (int i)
 
double getWEBLKE (int i)
 
double getEEBLKE (int i)
 

Detailed Description

Definition at line 9 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

Constructor & Destructor Documentation

◆ EmcESum() [1/2]

EmcESum::EmcESum ( )

Definition at line 29 of file EmcESum.cxx.

30{
31 m_EmcTCFinder = EmcTCFinder::get_Emc();
32}
static EmcTCFinder * get_Emc(void)
Definition: EmcTCFinder.cxx:32

◆ ~EmcESum() [1/2]

EmcESum::~EmcESum ( )

Definition at line 33 of file EmcESum.cxx.

34{
35}

◆ EmcESum() [2/2]

EmcESum::EmcESum ( )

◆ ~EmcESum() [2/2]

EmcESum::~EmcESum ( )

Member Function Documentation

◆ getBBLKE() [1/2]

double EmcESum::getBBLKE ( int  i)
inline

Definition at line 23 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

23{ return BLK[i]; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getBBLKE() [2/2]

double EmcESum::getBBLKE ( int  i)
inline

Definition at line 23 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

23{ return BLK[i]; }

◆ getBTotE() [1/2]

double EmcESum::getBTotE ( )
inline

Definition at line 17 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

17{ return _BTotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getBTotE() [2/2]

double EmcESum::getBTotE ( )
inline

Definition at line 17 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

17{ return _BTotE; }

◆ getEEBLKE() [1/2]

double EmcESum::getEEBLKE ( int  i)
inline

Definition at line 25 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

25{ return EEBLK[i]; }

◆ getEEBLKE() [2/2]

double EmcESum::getEEBLKE ( int  i)
inline

Definition at line 25 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

25{ return EEBLK[i]; }

◆ getEETotE() [1/2]

double EmcESum::getEETotE ( )
inline

Definition at line 22 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

22{ return _EETotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getEETotE() [2/2]

double EmcESum::getEETotE ( )
inline

Definition at line 22 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

22{ return _EETotE; }

◆ getESum() [1/2]

void EmcESum::getESum ( )

Definition at line 36 of file EmcESum.cxx.

37{
38 //reset values
39 _TotE = 0;
40 _RTotE = 0;
41 _LTotE = 0;
42 _BTotE = 0;
43 _ETotE = 0;
44 _LBTotE = 0;
45 _RBTotE = 0;
46 _WETotE = 0;
47 _EETotE = 0;
48/*
49 double L1TC_GATE = double (m_pIBGT->getL1TC_GATE());
50
51 for(int i=0;i<12;i++) BLK[i] = 0;
52 for(int i = 0; i < 2; i++) { WEBLK[i] = 0; EEBLK[i] = 0; }
53/////////////////////////////////////////////////////////////////////////////////////////////////
54 //Get total energy ,energy of right part and left part divided by z=0.The energy threshold of each trigger cell is 30*MeV.
55 for(int i=0;i<TrigConf::TCTHETANO_B;i++)
56 for(int j=0;j<TrigConf::TCPHINO_B;j++)
57 {
58 double BEnergy = m_EmcTCFinder->getBTC_ADC(i,j);
59
60 //set each barrel trigger cell energy to service
61 m_pIBGT->setBTCEnergy(i,j,BEnergy);
62
63 int blkId = m_EmcTCFinder->getBLKId(i,j);
64 //low energy threshold of trigger cell
65 if(m_EmcTCFinder->getBTCEnergy(i,j) < L1TC_GATE) BEnergy = 0.;
66
67 BLK[blkId] +=BEnergy;//Get each block energy for babar trigger
68 }
69
70 for(int i =0;i<TrigConf::TCTHETANO_E;i++)
71 for(int j =0;j<TrigConf::TCPHINO_E;j++)
72 {
73 double EEnergy = m_EmcTCFinder->getEETC_ADC(i,j);
74 //set each barrel trigger cell energy to service
75 m_pIBGT->setEETCEnergy(i,j,EEnergy);
76 //low energy threshold of trigger cell
77 if(m_EmcTCFinder->getEETCEnergy(i,j) < L1TC_GATE) EEnergy = 0.;
78
79 if(j >= 0 && j < TrigConf::TCPHINO_E/2) EEBLK[0] += EEnergy; // north energy block
80 else EEBLK[1] += EEnergy; // south energy block
81
82 double WEnergy = m_EmcTCFinder->getWETC_ADC(i,j);
83 //set each barrel trigger cell energy to service
84 m_pIBGT->setWETCEnergy(i,j,WEnergy);
85 //low energy threshold of trigger cell
86 if(m_EmcTCFinder->getWETCEnergy(i,j) < L1TC_GATE) WEnergy = 0.;
87
88 if(j >= 0 && j < TrigConf::TCPHINO_E/2) WEBLK[0] += WEnergy; // north energy block
89 else WEBLK[1] += WEnergy;
90 }
91
92 std::vector<double> BlockE;
93 BlockE.clear();
94
95 double bmean[12] = {8.02,10.1,12.3,7.43,14.8,13.0,12.5,13.2,10.9,12.3,14.7,15.7};
96 double bsigma[12] = {0.88,0.52,0.9,0.72,0.7,0.82,0.64,0.78,0.72,0.76,0.54,0.64};
97 double bratio[12] = {3.28,3.15,3.01,3.12,3.09,3.22,2.90,2.89,2.97,3.00,3.02,3.15};//run10584
98
99 for(int i = 0; i < 12; i++) {
100 //double block_E = (BLK[i]/bratio[i] - 0xa + RandGauss::shoot(bmean[i],bsigma[i]))*m_pIBGT->getEnergy_Ratio(); //mv convert to adc
101 double block_E = (BLK[i] - 0xa); //mv convert to adc
102 if(block_E < 0) block_E = 0;
103 _TotE += block_E; //Total energy of emc including barrel and endcaps
104 _BTotE += block_E;//Total energy of barrel emc
105
106 if(i >= 6)
107 {
108 _LTotE += block_E;//Total energy of left part emc(left barrel and west endcap)
109 _LBTotE += block_E;//Total energy of left part emc (only barrel)
110 }
111 else
112 {
113 _RTotE += block_E;//Total energy of right part emc(right barrel and east endcap)
114 _RBTotE += block_E;//Total energy of right part emc (only barrel)
115 }
116 //BlockE.push_back(block_E);
117 BlockE.push_back(BLK[i]);
118 }
119
120 double emean[2] = {11.8,12.4};
121 double esigma[2] = {0.77,0.43};
122 double eratio[2] = {3.19,3.19};
123
124 double wmean[2] = {19.9,8.89};
125 double wsigma[2] = {0.63,0.51};
126 double wratio[2] = {3.19,3.19};
127
128 for(int i = 0; i < 2; i++) {
129 //double wblock_E = (WEBLK[i]/wratio[i] - 0xa + RandGauss::shoot(wmean[i],wsigma[i]))*m_pIBGT->getEnergy_Ratio();
130 double wblock_E = (WEBLK[i] - 0xa);
131 //double wblock_E = WEBLK[i]*0.51 - 14.4 - 0xa + RandGauss::shoot(wmean[i],wsigma[i]);
132 double eblock_E = (EEBLK[i] - 0xa);
133 //double eblock_E = (EEBLK[i]/eratio[i] - 0xa + RandGauss::shoot(emean[i],esigma[i]))*m_pIBGT->getEnergy_Ratio();
134 //double eblock_E = EEBLK[i]*0.51 - 14.4 - 0xa + RandGauss::shoot(emean[i],esigma[i]);
135 if(wblock_E < 0) wblock_E = 0;
136 if(eblock_E < 0) eblock_E = 0;
137
138 _TotE += eblock_E;//Total energy of emc including barrel and endcaps
139 _RTotE += eblock_E;//Total energy of right part emc(right barrel and east endcap)
140 _ETotE += eblock_E;//Total energy of west and east endcaps
141 _EETotE += eblock_E;//Total energy of east endcap
142 //_EETotE += EEBLK[i];//Total energy of east endcap
143
144 _TotE += wblock_E;//Total energy of emc including barrel and endcaps
145 _LTotE += wblock_E;//Total energy of left part emc(left barrel and west endcap)
146 _ETotE += wblock_E;//Total energy of west and east endcaps
147 _WETotE += wblock_E;//Total energy of west endcap
148 //_WETotE += WEBLK[i];//Total energy of west endcap
149 }
150*/
151
152 for(int i=0;i<12;i++) BLK[i] = 0;
153 for(int i = 0; i < 2; i++) { WEBLK[i] = 0; EEBLK[i] = 0; }
154 /////////////////////////////////////////////////////////////////////////////////////////////////
155 //Get total energy ,energy of right part and left part divided by z=0.The energy threshold of each trigger cell is 30*MeV.
156 for(int i = 0; i < 12; i++) {
157 BLK[i] = m_EmcTCFinder->getBLKE(i+2);
158 }
159
160 for(int i = 0; i < 2; i++) {
161 EEBLK[i] = m_EmcTCFinder->getBLKE(i);
162 WEBLK[i] = m_EmcTCFinder->getBLKE(i+14);
163 }
164
165 std::vector<double> BlockE;
166 BlockE.clear();
167
168 double bmean[12] = {8.02,10.1,12.3,7.43,14.8,13.0,12.5,13.2,10.9,12.3,14.7,15.7};
169 double bsigma[12] = {0.88,0.52,0.9,0.72,0.7,0.82,0.64,0.78,0.72,0.76,0.54,0.64};
170
171 for(int i = 0; i < 12; i++) {
172 double block_E = (BLK[i]*0.333 - 0xa + RandGauss::shoot(bmean[i],bsigma[i])); //mv convert to adc
173 if(block_E < 0) block_E = 0;
174 _TotE += block_E; //Total energy of emc including barrel and endcaps
175 _BTotE += block_E;//Total energy of barrel emc
176
177 if(i >= 6)
178 {
179 _LTotE += block_E;//Total energy of left part emc(left barrel and west endcap)
180 _LBTotE += block_E;//Total energy of left part emc (only barrel)
181 }
182 else
183 {
184 _RTotE += block_E;//Total energy of right part emc(right barrel and east endcap)
185 _RBTotE += block_E;//Total energy of right part emc (only barrel)
186 }
187 BlockE.push_back(block_E);
188 }
189
190 double emean[2] = {11.8,12.4};
191 double esigma[2] = {0.77,0.43};
192
193 double wmean[2] = {19.9,8.89};
194 double wsigma[2] = {0.63,0.51};
195
196 for(int i = 0; i < 2; i++) {
197 double wblock_E = (WEBLK[i]*0.333 - 0xa + RandGauss::shoot(wmean[i],wsigma[i]));
198 double eblock_E = (EEBLK[i]*0.333 - 0xa + RandGauss::shoot(emean[i],esigma[i]));
199 if(wblock_E < 0) wblock_E = 0;
200 if(eblock_E < 0) eblock_E = 0;
201
202 _TotE += eblock_E;//Total energy of emc including barrel and endcaps
203 _RTotE += eblock_E;//Total energy of right part emc(right barrel and east endcap)
204 _ETotE += eblock_E;//Total energy of west and east endcaps
205 _EETotE += eblock_E;//Total energy of east endcap
206
207 _TotE += wblock_E;//Total energy of emc including barrel and endcaps
208 _LTotE += wblock_E;//Total energy of left part emc(left barrel and west endcap)
209 _ETotE += wblock_E;//Total energy of west and east endcaps
210 _WETotE += wblock_E;//Total energy of west endcap
211 }
212
213 ISvcLocator* svcLocator = Gaudi::svcLocator();
214 StatusCode sc = svcLocator->service("BesGlobalTrigSvc", m_tmpSvc);
215 m_pIBGT = dynamic_cast<BesGlobalTrigSvc* >(m_tmpSvc);
216
217 //set energy information related to emc in service
218 m_pIBGT->setEmcTotE(_TotE);
219 m_pIBGT->setEmcLTotE(_LTotE);
220 m_pIBGT->setEmcRTotE(_RTotE);
221 m_pIBGT->setEmcBTotE(_BTotE);
222 m_pIBGT->setEmcETotE(_ETotE);
223 m_pIBGT->setEmcLBTotE(_LBTotE);
224 m_pIBGT->setEmcRBTotE(_RBTotE);
225 m_pIBGT->setEmcWETotE(_WETotE);
226 m_pIBGT->setEmcEETotE(_EETotE);
227 m_pIBGT->setEmcBlockE(BlockE);
228}

Referenced by BesEmcTrig::startEmcTrig().

◆ getESum() [2/2]

void EmcESum::getESum ( )

◆ getETotE() [1/2]

double EmcESum::getETotE ( )
inline

Definition at line 18 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

18{ return _ETotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getETotE() [2/2]

double EmcESum::getETotE ( )
inline

Definition at line 18 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

18{ return _ETotE; }

◆ getLBTotE() [1/2]

double EmcESum::getLBTotE ( )
inline

Definition at line 19 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

19{ return _LBTotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getLBTotE() [2/2]

double EmcESum::getLBTotE ( )
inline

Definition at line 19 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

19{ return _LBTotE; }

◆ getLTotE() [1/2]

double EmcESum::getLTotE ( )
inline

Definition at line 15 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

15{ return _LTotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getLTotE() [2/2]

double EmcESum::getLTotE ( )
inline

Definition at line 15 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

15{ return _LTotE; }

◆ getRBTotE() [1/2]

double EmcESum::getRBTotE ( )
inline

Definition at line 20 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

20{ return _RBTotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getRBTotE() [2/2]

double EmcESum::getRBTotE ( )
inline

Definition at line 20 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

20{ return _RBTotE; }

◆ getRTotE() [1/2]

double EmcESum::getRTotE ( )
inline

Definition at line 16 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

16{ return _RTotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getRTotE() [2/2]

double EmcESum::getRTotE ( )
inline

Definition at line 16 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

16{ return _RTotE; }

◆ getTotE() [1/2]

double EmcESum::getTotE ( )
inline

Definition at line 14 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

14{ return _TotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getTotE() [2/2]

double EmcESum::getTotE ( )
inline

Definition at line 14 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

14{ return _TotE; }

◆ getWEBLKE() [1/2]

double EmcESum::getWEBLKE ( int  i)
inline

Definition at line 24 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

24{ return WEBLK[i]; }

◆ getWEBLKE() [2/2]

double EmcESum::getWEBLKE ( int  i)
inline

Definition at line 24 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

24{ return WEBLK[i]; }

◆ getWETotE() [1/2]

double EmcESum::getWETotE ( )
inline

Definition at line 21 of file InstallArea/include/Trigger/Trigger/EmcESum.h.

21{ return _WETotE; }

Referenced by BesEmcTrig::startEmcTrig().

◆ getWETotE() [2/2]

double EmcESum::getWETotE ( )
inline

Definition at line 21 of file Trigger/Trigger/Trigger-00-01-05/Trigger/EmcESum.h.

21{ return _WETotE; }

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