126 {
127
129
130 MsgStream log(
msgSvc(), name());
131
133 char*
electron=getenv(
"BEPCII_INFO.BER_PRB");
136 }
137 else{
138 log << MSG::ERROR << "Cannot get beam energy (e-)! Please call online people" << endreq;
139 }
140 char* positron=getenv("BEPCII_INFO.BPR_PRB");
141 if(positron){
143 }
144 else{
145 log << MSG::ERROR << "Cannot get beam energy (e+)! Please call online people" << endreq;
146 }
149 }
150 else{
151 }
152 log << MSG::INFO <<
"beam energy = " <<
m_beam << endreq;
153
154
155 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
156 if (!eventHeader) {
157 log << MSG::FATAL << "Could not find Event Header" << endreq;
158 return( StatusCode::FAILURE);
159 }
160
161 SmartDataPtr<RecEmcShowerCol> emcShowerCol(eventSvc(),"/Event/Recon/RecEmcShowerCol");
162 if (!emcShowerCol) {
163 log << MSG::FATAL << "Could not find Emc rec!!" << endreq;
164 return( StatusCode::FAILURE);
165 }
166
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;
170
171 unsigned int nshower=emcShowerCol->size();
172 for(;iterShower!= emcShowerCol->end();iterShower++){
173 if((*iterShower)->energy()>=max1){
174 max3=max2;
175 max2=max1;
176 cost3=cost2;
177 cost2=cost1;
180 max1=(*iterShower)->energy();
181 cost1=
cos((*iterShower)->position().theta());
182 phi1=(*iterShower)->position().phi();
183 }
184 else if((*iterShower)->energy()>max2){
185 max3=max2;
186 cost3=cost2;
188 max2=(*iterShower)->energy();
189 cost2=
cos((*iterShower)->position().theta());
190 phi2=(*iterShower)->position().phi();
191 }
192 else if((*iterShower)->energy()>max3){
193 max3=(*iterShower)->energy();
194 cost3=(*iterShower)->position().theta();
195 phi3=(*iterShower)->position().phi();
196 }
197 }
198 double acop=180,acol=180.;
199 if(nshower>=2){
203 +cost1*cost2);
204 }
205
206 log << MSG::INFO << "nshower=" << nshower << "; acop=" << acop
207 <<"; emax1="<< max1 <<"; emax2="<< max2 <<endreq;
208
209
223
237
244
246
247 return StatusCode::SUCCESS;
248}
double sin(const BesAngle a)
double cos(const BesAngle a)
void setValue(float value)
bool addToEFVec(uint32_t val, uint32_t pos)
bool appToEFVec(double val, uint32_t pos)
bool setVecBit(uint32_t val, uint32_t vecpos, uint32_t bbegin, uint32_t bend)