107 {
108
109 MsgStream log(
msgSvc(), name() );
110
111
112 EFResult* efResult;
113 StatusCode sc = m_HltStoreSvc->get( "EFResult", efResult );
114 if ( sc.isFailure() )
115 {
116 log << MSG::ERROR << " Could not find EFResult" << endmsg;
117 return sc;
118 }
119
121 {
122 log << MSG::ERROR << " Unvalid efResult(AnswerIndex==-1)" << endmsg;
123 return StatusCode::FAILURE;
124 }
125
126 std::string answer = efResult->
getAnswer();
127
128 log << MSG::INFO << "this event is " << answer << endmsg;
129
130 if ( answer == "Accepted" )
131 {
132 EFResult* evtType;
133 sc = m_HltStoreSvc->get( "EventType", evtType );
134 if ( sc.isFailure() )
135 {
136 log << MSG::ERROR << " Could not find EventType" << endmsg;
137 return sc;
138 }
140 {
141 log << MSG::ERROR << " Unvalid evtType(AnswerIndex==-1)" << endmsg;
142 return StatusCode::FAILURE;
143 }
144 std::string typeStr = evtType->
getAnswer();
145 log << MSG::INFO << " ==> it's marked as " << typeStr << endmsg;
146
147
148 if ( typeStr == "Junk" ) m_evttype = 0;
149 else if ( typeStr == "GJunk" ) m_evttype = 1;
150 else if ( typeStr == "Beamgas" ) m_evttype = 2;
151 else if ( typeStr == "GBeamgas" ) m_evttype = 3;
152 else if ( typeStr == "Cosmic" ) m_evttype = 4;
153 else if ( typeStr == "GCosmic" ) m_evttype = 5;
154 else if ( typeStr == "EBhabha" ) m_evttype = 6;
155 else if ( typeStr == "GEBhabha" ) m_evttype = 7;
156 else if ( typeStr == "BBhabha" ) m_evttype = 8;
157 else if ( typeStr == "GBBhabha" ) m_evttype = 9;
158 else if ( typeStr == "Dimuon" ) m_evttype = 10;
159 else if ( typeStr == "GDimuon" ) m_evttype = 11;
160 else if ( typeStr == "Diphoton" ) m_evttype = 12;
161 else if ( typeStr == "GDiphoton" ) m_evttype = 13;
162 else if ( typeStr == "Hadron" ) m_evttype = 14;
163 else if ( typeStr == "GHadron" ) m_evttype = 15;
164 else if ( typeStr == "Twophoton" ) m_evttype = 16;
165 else if ( typeStr == "GTwophoton" ) m_evttype = 17;
166 else if ( typeStr == "RandomTrg" ) m_evttype = 31;
167 else if ( typeStr == "Error" ) m_evttype = 30;
168 else if ( typeStr == "Other" ) m_evttype = 29;
169 else m_evttype = -1;
170 }
171 log << MSG::DEBUG << "get event type info: " << m_evttype << endmsg;
172
173 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(), "/Event/EventHeader" );
174 if ( !eventHeader )
175 {
176 log << MSG::FATAL << "Could not find Event Header" << endmsg;
177 return ( StatusCode::FAILURE );
178 }
179 m_nevt = eventHeader->eventNumber();
180 log << MSG::INFO << "EventNo: " << m_nevt << endl;
181 if ( m_evttype == 1 || m_evttype == 3 || m_evttype == 5 )
182 m_notpass.push_back( eventHeader->eventNumber() );
183
184
185
186
187
188
189
190
191
192
193
194 float nmdc, ntof, nemc, nmuc, nshower, ntrk, nsec;
195 float etot, ebar, eend, ebal, acop, emax1, emax2, dtof1, dphi1, dtof2, dphi2, acol, mbal,
196 pmax1, pmax2;
197
198 CriteriaItemValue* pcri;
199
200 sc = m_HltStoreSvc->get( "nmdc", pcri );
201 if ( sc.isFailure() ) nmdc = -9;
203 sc = m_HltStoreSvc->get( "nmuc", pcri );
204 if ( sc.isFailure() ) nmuc = -9;
206 sc = m_HltStoreSvc->get( "ntof", pcri );
207 if ( sc.isFailure() ) ntof = -9;
209 sc = m_HltStoreSvc->get( "nemc", pcri );
210 if ( sc.isFailure() ) nemc = -9;
212
213 sc = m_HltStoreSvc->get( "nshw", pcri );
214 if ( sc.isFailure() ) nshower = -9;
216 sc = m_HltStoreSvc->get( "ntrk", pcri );
217 if ( sc.isFailure() ) ntrk = -9;
219 sc = m_HltStoreSvc->get( "etot", pcri );
220 if ( sc.isFailure() )
etot = -9;
222 sc = m_HltStoreSvc->get( "ebar", pcri );
223 if ( sc.isFailure() ) ebar = -9;
225 sc = m_HltStoreSvc->get( "eend", pcri );
226 if ( sc.isFailure() ) eend = -9;
228 sc = m_HltStoreSvc->get( "ebal", pcri );
229 if ( sc.isFailure() ) ebal = -9;
231 sc = m_HltStoreSvc->get( "acop", pcri );
232 if ( sc.isFailure() ) acop = -9;
234 sc = m_HltStoreSvc->get( "emax1", pcri );
235 if ( sc.isFailure() ) emax1 = -9;
237 sc = m_HltStoreSvc->get( "emax2", pcri );
238 if ( sc.isFailure() ) emax2 = -9;
240 sc = m_HltStoreSvc->get( "dtof1", pcri );
241 if ( sc.isFailure() ) dtof1 = -999;
243 sc = m_HltStoreSvc->get( "dphi1", pcri );
244 if ( sc.isFailure() ) dphi1 = -9;
246 sc = m_HltStoreSvc->get( "dtof2", pcri );
247 if ( sc.isFailure() ) dtof2 = -999;
249 sc = m_HltStoreSvc->get( "dphi2", pcri );
250 if ( sc.isFailure() ) dphi2 = -9;
252 sc = m_HltStoreSvc->get( "acol", pcri );
253 if ( sc.isFailure() ) acol = -9;
255 sc = m_HltStoreSvc->get( "pmax1", pcri );
256 if ( sc.isFailure() ) pmax1 = -9;
258 sc = m_HltStoreSvc->get( "pmax2", pcri );
259 if ( sc.isFailure() ) pmax2 = -9;
261 sc = m_HltStoreSvc->get( "nsec", pcri );
262 if ( sc.isFailure() ) nsec = -9;
264 sc = m_HltStoreSvc->get( "mbal", pcri );
265 if ( sc.isFailure() ) mbal = -9;
267 m_nmdc = long( nmdc );
268 m_ntof = long( ntof );
269 m_nemc = long( nemc );
270 m_nmuc = long( nmuc );
271 m_nshower = long( nshower );
272 m_ntrk = long( ntrk );
273 m_nsec = long( nsec );
275 m_ebarrel = ebar;
276 m_eendcap = eend;
277 m_ebalance = ebal;
278 m_acop = acop;
279 m_emax1 = emax1;
280 m_emax2 = emax2;
281 m_dtof1 = dtof1;
282 m_dphi1 = dphi1;
283 m_dtof2 = dtof2;
284 m_dphi2 = dphi2;
285 m_acol = acol;
286 m_mbalance = mbal;
287 m_pmax1 = pmax1;
288 m_pmax2 = pmax2;
289
290 std::vector<uint32_t> efVec = efResult->
getEFVec();
291 m_alg = efVec[0];
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312 log << MSG::INFO << efVec << endmsg;
313 log << MSG::INFO << acol <<
" " <<
etot << endmsg;
314 if ( m_tuple )
315 {
316 StatusCode status = m_tuple->write();
317 if ( !status.isSuccess() ) { log << MSG::ERROR << "Can't fill ntuple!" << endmsg; }
318 }
319
320
321
322 return StatusCode::SUCCESS;
323}
bool getValue(float &value) const
const std::string getAnswer() const
const int getAnswerIndex() const
const std::vector< uint32_t > getEFVec() const