101 MsgStream log(
msgSvc(), name());
102 log << MSG::INFO <<
"in execute()" << endreq;
107 setFilterPassed(
false);
109 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
110 m_runNo=eventHeader->runNumber();
111 m_event=eventHeader->eventNumber();
112 log << MSG::DEBUG <<
"run, evtnum = "
118 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
119 << evtRecEvent->totalCharged() <<
" , "
120 << evtRecEvent->totalNeutral() <<
" , "
121 << evtRecEvent->totalTracks() <<endreq;
125 if(evtRecEvent->totalNeutral()>100) {
126 return StatusCode::SUCCESS;
129 Vint iGood, ipip, ipim;
137 Hep3Vector xorigin(0,0,0);
140 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
144 xorigin.setX(dbv[0]);
145 xorigin.setY(dbv[1]);
146 xorigin.setZ(dbv[2]);
150 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
152 if(!(*itTrk)->isMdcTrackValid())
continue;
153 if (!(*itTrk)->isMdcKalTrackValid())
continue;
156 double pch =mdcTrk->
p();
157 double x0 =mdcTrk->
x();
158 double y0 =mdcTrk->
y();
159 double z0 =mdcTrk->
z();
160 double phi0=mdcTrk->
helix(1);
161 double xv=xorigin.x();
162 double yv=xorigin.y();
163 double Rxy=fabs((x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0));
165 if(fabs(z0) >= m_vz0cut)
continue;
166 if(Rxy >= m_vr0cut)
continue;
168 iGood.push_back((*itTrk)->trackId());
169 nCharge += mdcTrk->
charge();
170 if (mdcTrk->
charge() > 0) {
171 ipip.push_back((*itTrk)->trackId());
173 ipim.push_back((*itTrk)->trackId());
180 int nGood = iGood.size();
181 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endreq;
182 if((nGood != 2)||(nCharge!=0)){
183 return StatusCode::SUCCESS;
188 for(
int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
190 if(!(*itTrk)->isEmcShowerValid())
continue;
192 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
197 for(
int j = 0; j < evtRecEvent->totalCharged(); j++) {
199 if(!(*jtTrk)->isExtTrackValid())
continue;
204 double angd = extpos.angle(emcpos);
205 double thed = extpos.theta() - emcpos.theta();
206 double phid = extpos.deltaPhi(emcpos);
207 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
208 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
218 if(dang>=200)
continue;
219 double eraw = emcTrk->
energy();
220 dthe = dthe * 180 / (CLHEP::pi);
221 dphi = dphi * 180 / (CLHEP::pi);
222 dang = dang * 180 / (CLHEP::pi);
223 if(eraw < m_energyThreshold)
continue;
224 if(dang < m_gammaAngCut)
continue;
229 iGam.push_back((*itTrk)->trackId());
235 int nGam = iGam.size();
237 log << MSG::DEBUG <<
"num Good Photon " << nGam <<
" , " <<evtRecEvent->totalNeutral()<<endreq;
239 return StatusCode::SUCCESS;
256 (*(evtRecTrkCol->begin()+ipip[0]))->setPartId(2);
257 (*(evtRecTrkCol->begin()+ipim[0]))->setPartId(2);
263 (*(evtRecTrkCol->begin()+ipip[0]))->setQuality(0);
264 (*(evtRecTrkCol->begin()+ipim[0]))->setQuality(0);
269 setFilterPassed(
true);
272 return StatusCode::SUCCESS;
const Hep3Vector emcPosition() const
const int emcVolumeNumber() const