137 {
138 StatusCode sc = StatusCode::SUCCESS;
139
140 MsgStream log(
msgSvc(), name());
141 log << MSG::INFO << "in execute()" << endreq;
142
143
144
145
146 setFilterPassed(false);
147
148 m_pass[0] += 1;
149
150 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
151 int run=eventHeader->runNumber();
152 int event=eventHeader->eventNumber();
153
156
157 m_pass[1] += 1;
158
159 Vint ikp, ikm, iGood;
160 iGood.clear();
161 ikp.clear();
162 ikm.clear();
163
165 pkp.clear();
166 pkm.clear();
167
168 int TotCharge = 0;
169 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
171 if(!(*itTrk)->isMdcTrackValid()) continue;
173 if(fabs(mdcTrk->
z()) >= m_vz0cut)
continue;
174 if(mdcTrk->
r() >= m_vr0cut)
continue;
175 iGood.push_back(i);
176 TotCharge += mdcTrk->
charge();
177 }
178
179
180
181 int nGood = iGood.size();
182
183
184
185
186
187 if((nGood < 2) || (TotCharge!=0)) return sc;
188
189 m_pass[2] += 1;
190
191
192
193
195 for(int i = 0; i < nGood; i++) {
197
206 if(!(*itTrk)->isMdcKalTrackValid()) continue ;
208
209
211
213 HepLorentzVector
ptrk;
214 ptrk.setPx(mdcKalTrk->
px());
215 ptrk.setPy(mdcKalTrk->
py());
216 ptrk.setPz(mdcKalTrk->
pz());
219 if(mdcKalTrk->
charge() >0) {
220 ikp.push_back(iGood[i]);
222 } else {
223 ikm.push_back(iGood[i]);
225 }
226 }
227
228 m_pass[4] += 1;
229 int nkp = ikp.size();
230 int nkm = ikm.size();
231
232 m_nkp=nkp;
233 m_nkm=nkm;
234 m_ncharge=nGood;
235
236
237 if(nkp < 1 || nkm <1) return sc;
238
239 m_pass[5] += 1;
240
241
242
243
244
245
246 HepLorentzVector pphi, pTot;
248 iphi.clear();
249
250 double difchi0=99999.0;
251 int ixk1 = -1;
252 int ixk2 = -1;
253
254 for (int i = 0; i < nkm; i++) {
255 for (int j = 0; j < nkp; j++) {
256
257 pphi = pkm[i] + pkp[j];
258 m_mphiall = pphi.m();
259 m_pphiall = pphi.rho();
260 m_tuple1->write();
261
262 double difchi =fabs(pphi.m()-
mphi);
263 if(difchi < difchi0){
264 difchi0 = difchi;
265 ixk1 = i;
266 ixk2 = j;
267 }
268 }
269 }
270
271 m_difchi = difchi0;
272
273 if (ixk1 == -1) return sc;
274
275 m_pass[6] += 1;
276
277 pTot = pkm[ixk1] + pkp[ixk2];
278
279 m_pk1 = pkm[ixk1].m();
280 m_mphi = pTot.m();
281 m_pphi = pTot.rho();
282
283 TH1 *h(0);
284 if (m_thsvc->getHist("/DQAHist/InclPhi/InclPhi_mass", h).isSuccess()) {
285 h->Fill(pTot.m());
286 } else {
287 log << MSG::ERROR << "Couldn't retrieve inclphi_mass" << endreq;
288 }
289 m_tuple2->write();
290
291
292
293
294
295
296 (*(evtRecTrkCol->begin()+ikm[ixk1]))->tagKaon();
297 (*(evtRecTrkCol->begin()+ikp[ixk2]))->tagKaon();
298
299
300
301
302
303 (*(evtRecTrkCol->begin()+ikm[ixk1]))->setQuality(3);
304 (*(evtRecTrkCol->begin()+ikp[ixk2]))->setQuality(3);
305
306
307
308 setFilterPassed(true);
309
310 return StatusCode::SUCCESS;
311}
EvtRecTrackCol::iterator EvtRecTrackIterator
std::vector< HepLorentzVector > Vp4
static void setPidType(PidType pidType)
int methodProbability() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol