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