130 MsgStream log(
msgSvc(), name());
133 char*
electron=getenv(
"BEPCII_INFO.BER_PRB");
138 log << MSG::ERROR <<
"Cannot get beam energy (e-)! Please call online people" << endreq;
140 char* positron=getenv(
"BEPCII_INFO.BPR_PRB");
145 log << MSG::ERROR <<
"Cannot get beam energy (e+)! Please call online people" << endreq;
152 log << MSG::INFO <<
"beam energy = " <<
m_beam << endreq;
155 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
157 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
158 return( StatusCode::FAILURE);
161 SmartDataPtr<RecEmcShowerCol> emcShowerCol(eventSvc(),
"/Event/Recon/RecEmcShowerCol");
163 log << MSG::FATAL <<
"Could not find Emc rec!!" << endreq;
164 return( StatusCode::FAILURE);
167 RecEmcShowerCol::iterator iterShower=emcShowerCol->begin();
168 double max1=-999,max2=-999,max3=-999;
169 double cost1=-999,cost2=-999,cost3=-999,
phi1=-999,
phi2=-999,phi3=-999;
171 unsigned int nshower=emcShowerCol->size();
172 for(;iterShower!= emcShowerCol->end();iterShower++){
173 if((*iterShower)->energy()>=max1){
180 max1=(*iterShower)->energy();
181 cost1=
cos((*iterShower)->position().theta());
182 phi1=(*iterShower)->position().phi();
184 else if((*iterShower)->energy()>max2){
188 max2=(*iterShower)->energy();
189 cost2=
cos((*iterShower)->position().theta());
190 phi2=(*iterShower)->position().phi();
192 else if((*iterShower)->energy()>max3){
193 max3=(*iterShower)->energy();
194 cost3=(*iterShower)->position().theta();
195 phi3=(*iterShower)->position().phi();
198 double acop=180,acol=180.;
206 log << MSG::INFO <<
"nshower=" << nshower <<
"; acop=" << acop
207 <<
"; emax1="<< max1 <<
"; emax2="<< max2 <<endreq;
210 m_nshower->setValue(nshower);
211 m_acop->setValue(acop);
212 m_acole->setValue(acol);
216 m_emax12->setValue((max1+max2)/
abs(
m_beam));
217 m_coste1->setValue(cost1);
218 m_coste2->setValue(cost2);
219 m_coste3->setValue(cost3);
220 m_phi1->setValue(
phi1);
221 m_phi2->setValue(
phi2);
222 m_phi3->setValue(phi3);
224 m_ef->addToEFVec(nshower, 38);
225 m_ef->appToEFVec(max1, 39);
226 m_ef->appToEFVec(cost1,40);
228 m_ef->appToEFVec(max2, 42);
229 m_ef->appToEFVec(cost2,43);
231 m_ef->appToEFVec(acop, 45);
232 m_ef->appToEFVec(acol, 46);
233 m_ef->appToEFVec(max1+max2, 47);
234 m_ef->appToEFVec(max3, 48);
235 m_ef->appToEFVec(cost3,49);
236 m_ef->appToEFVec(phi3,50);
238 m_ef->setVecBit(
true, 0, 2);
239 if(nshower==0)
m_ef->addToEFVec(1<<16,1);
240 else if(nshower==1)
m_ef->addToEFVec(4<<16,1);
241 else if(nshower==2)
m_ef->addToEFVec(10<<16,1);
242 else if(nshower>=3)
m_ef->addToEFVec(13<<16,1);
243 else m_ef->addToEFVec(0<<16,1);
247 return StatusCode::SUCCESS;