34 iGam,
double Ebeam,
int PID_flag,
int Charge_candidate_D)
37 int nGood=iGood.size();
42 double mass_bcgg, delE_tag_temp;
43 int m_chargetag,m_chargek,m_chargepi1,m_chargepi2,m_chargepi3;
44 int ika_temp,ipi1_temp,ipi2_temp,ipi3_temp,ipi4_temp;
45 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
48 HepLorentzVector pddd_temp;
49 IDataProviderSvc* eventSvc = NULL;
50 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
52 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,
"/Event/EventHeader");
54 int runNo=eventHeader->runNumber();
55 int rec=eventHeader->eventNumber();
62 if((evtRecEvent->totalCharged() < 4)){
return; }
67 Gaudi::svcLocator()->service(
"SimplePIDSvc", simple_pid);
69 double deltaE_tem = 0.20;
72 Hep3Vector xorigin(0,0,0);
74 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
84 double xv=xorigin.x();
85 double yv=xorigin.y();
86 double zv=xorigin.z();
89 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
91 HepLorentzVector ptrk1_temp, ptrk2_temp, ptrk3_temp, ptrk4_temp;
93 for(
int i = 0; i < evtRecEvent->totalCharged(); i++) {
96 int ika= (*itTrk1)->trackId();
98 if(!(*itTrk1)->isMdcKalTrackValid())
continue;
102 m_chargek=mdcKalTrk1->
charge();
103 if(Charge_candidate_D != 0) {
104 if(m_chargek != -Charge_candidate_D)
continue;
106 if(Charge_candidate_D == 0) {
107 if(
abs(m_chargek) != 1)
continue;
113 VFHelix helixip3_1(point0,a1,Ea1);
114 helixip3_1.
pivot(IP);
115 HepVector vecipa1 = helixip3_1.
a();
117 double dr1 = fabs(vecipa1[0]);
118 double dz1 = fabs(vecipa1[3]);
119 double costheta1 =
cos(mdcKalTrk1->
theta());
121 if ( dr1 >= 1.0)
continue;
122 if ( dz1 >= 10.0)
continue;
123 if ( fabs(costheta1) >= 0.93)
continue;
135 for(
int j = 0; j< evtRecEvent->totalCharged();j++) {
138 int ipi1= (*itTrk2)->trackId();
139 if(ipi1==ika)
continue;
141 if(!(*itTrk2)->isMdcKalTrackValid())
continue;
145 m_chargepi1=mdcKalTrk2->
charge();
146 if((m_chargek + m_chargepi1) != 0)
continue;
149 HepSymMatrix Ea2 = mdcKalTrk2->
getZError();
150 VFHelix helixip3_2(point0,a2,Ea2);
151 helixip3_2.
pivot(IP);
152 HepVector vecipa2 = helixip3_2.
a();
154 double dr2 = fabs(vecipa2[0]);
155 double dz2 = fabs(vecipa2[3]);
156 double costheta2 =
cos(mdcKalTrk2->
theta());
157 if ( dr2 >= 1.0)
continue;
158 if ( dz2 >= 10.0)
continue;
159 if ( fabs(costheta2) >= 0.93)
continue;
171 for(
int k = 0; k< evtRecEvent->totalCharged(); k++) {
174 int ipi2= (*itTrk3)->trackId();
175 if(ipi2==ika || ipi2==ipi1)
continue;
177 if(!(*itTrk3)->isMdcKalTrackValid())
continue;
181 m_chargepi2=mdcKalTrk3->
charge();
182 if((m_chargek + m_chargepi2) != 0)
continue;
185 HepSymMatrix Ea3 = mdcKalTrk3->
getZError();
186 VFHelix helixip3_3(point0,a3,Ea3);
187 helixip3_3.
pivot(IP);
188 HepVector vecipa3 = helixip3_3.
a();
190 double dr3 = fabs(vecipa3[0]);
191 double dz3 = fabs(vecipa3[3]);
192 double costheta3 =
cos(mdcKalTrk3->
theta());
193 if ( dr3 >= 1.0)
continue;
194 if ( dz3 >= 10.0)
continue;
195 if ( fabs(costheta3) >= 0.93)
continue;
207 for(
int l = 0; l< evtRecEvent->totalCharged(); l++) {
210 int ipi3= (*itTrk4)->trackId();
211 if(ipi3==ika || ipi3==ipi1 || ipi3==ipi2 )
continue;
213 if(!(*itTrk4)->isMdcKalTrackValid())
continue;
217 m_chargepi3=mdcKalTrk4->
charge();
218 if((m_chargepi2 + m_chargepi3) != 0)
continue;
221 HepSymMatrix Ea4 = mdcKalTrk4->
getZError();
222 VFHelix helixip3_4(point0,a4,Ea4);
223 helixip3_4.
pivot(IP);
224 HepVector vecipa4 = helixip3_4.
a();
226 double dr4 = fabs(vecipa4[0]);
227 double dz4 = fabs(vecipa4[3]);
228 double costheta4 =
cos(mdcKalTrk4->
theta());
229 if ( dr4 >= 1.0)
continue;
230 if ( dz4 >= 10.0)
continue;
231 if ( fabs(costheta4) >= 0.93)
continue;
241 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
242 HepSymMatrix Evx(3, 0);
243 double bx = 1E+6; Evx[0][0] = bx*bx;
244 double by = 1E+6; Evx[1][1] = by*by;
245 double bz = 1E+6; Evx[2][2] = bz*bz;
256 if(!vtxfit->
Fit(0))
continue;
264 HepVector kam_val = HepVector(7,0);
265 HepVector pip1_val = HepVector(7,0);
266 HepVector pip2_val = HepVector(7,0);
267 HepVector pip3_val = HepVector(7,0);
269 pip1_val = wpip1.
w();
270 pip2_val = wpip2.
w();
271 pip3_val = wpip3.
w();
273 HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
274 HepLorentzVector P_PIP1(pip1_val[0],pip1_val[1],pip1_val[2],pip1_val[3]);
275 HepLorentzVector P_PIP2(pip2_val[0],pip2_val[1],pip2_val[2],pip2_val[3]);
276 HepLorentzVector P_PIP3(pip3_val[0],pip3_val[1],pip3_val[2],pip3_val[3]);
278 P_KAM.boost(-0.011,0,0);
279 P_PIP1.boost(-0.011,0,0);
280 P_PIP2.boost(-0.011,0,0);
281 P_PIP3.boost(-0.011,0,0);
282 pddd = P_KAM + P_PIP1 + P_PIP2 + P_PIP3;
284 double pk3pi=pddd.rho();
286 double temp1 = (
ecms/2)*(
ecms/2)-pk3pi*pk3pi ;
287 if(temp1<0) temp1 =0;
288 double mass_bc_tem = sqrt(temp1);
289 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89)
continue;
291 double delE_tag_tag =
ecms/2-pddd.e();
293 if(fabs(delE_tag_tag)<deltaE_tem) {
294 deltaE_tem = fabs(delE_tag_tag);
295 delE_tag_temp = delE_tag_tag;
296 mass_bcgg = mass_bc_tem;
299 cqtm_temp = m_chargek;
315 if(cqtm_temp<0) tagmode=-13;
318 delE_tag = delE_tag_temp;
319 cqtm = -1.0*cqtm_temp;
321 iGoodtag.push_back(ika_temp);
322 iGoodtag.push_back(ipi1_temp);
323 iGoodtag.push_back(ipi2_temp);
324 iGoodtag.push_back(ipi3_temp);
326 iGamtag.push_back(9999);
327 iGamtag.push_back(9999);
328 iGamtag.push_back(9999);
329 iGamtag.push_back(9999);