36 iGam,
double Ebeam,
int PID_flag,
int Charge_candidate_D)
39 int nGood=iGood.size();
45 double mass_bcgg, delE_tag_temp;
46 int m_chargetag,m_chargepi1,m_chargepi2;
47 int ipi1_temp,ipi2_temp,ipi3_temp;
48 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
50 HepLorentzVector pddd_temp;
51 IDataProviderSvc* eventSvc = NULL;
52 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
54 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,
"/Event/EventHeader");
56 int runNo=eventHeader->runNumber();
57 int rec=eventHeader->eventNumber();
64 if((evtRecEvent->totalCharged() < 2)){
return; }
69 Gaudi::svcLocator()->service(
"SimplePIDSvc", simple_pid);
71 double deltaE_tem = 0.20;
74 Hep3Vector xorigin(0,0,0);
76 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
86 double xv=xorigin.x();
87 double yv=xorigin.y();
88 double zv=xorigin.z();
91 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
93 for(
int i = 0; i < evtRecEvent->totalCharged(); i++) {
96 int ipi1= (*itTrk)->trackId();
98 if(!(*itTrk)->isMdcKalTrackValid())
continue;
102 m_chargepi1=mdcKalTrk1->
charge();
103 if(
abs(m_chargepi1) != 1)
continue;
107 HepSymMatrix Ea1 = mdcKalTrk1->
getZError();
109 VFHelix helixip3_1(point0,a1,Ea1);
110 helixip3_1.
pivot(IP);
111 HepVector vecipa1 = helixip3_1.
a();
113 double dr1 = fabs(vecipa1[0]);
114 double dz1 = fabs(vecipa1[3]);
115 double costheta1 =
cos(mdcKalTrk1->
theta());
117 if ( dr1 >= 1.0)
continue;
118 if ( dz1 >= 10.0)
continue;
119 if ( fabs(costheta1) >= 0.93)
continue;
131 for(
int j = 0; j< evtRecEvent->totalCharged();j++) {
134 int ipi2= (*itTrk)->trackId();
135 if(ipi1==ipi2)
continue;
137 if(!(*itTrk)->isMdcKalTrackValid())
continue;
141 m_chargepi2=mdcKalTrk2->
charge();
142 if((m_chargepi1 + m_chargepi2) != 0)
continue;
146 HepSymMatrix Ea2 = mdcKalTrk2->
getZError();
147 VFHelix helixip3_2(point0,a2,Ea2);
148 helixip3_2.
pivot(IP);
149 HepVector vecipa2 = helixip3_2.
a();
151 double dr2 = fabs(vecipa2[0]);
152 double dz2 = fabs(vecipa2[3]);
153 double costheta2 =
cos(mdcKalTrk2->
theta());
154 if ( dr2 >= 1.0)
continue;
155 if ( dz2 >= 10.0)
continue;
156 if ( fabs(costheta2) >= 0.93)
continue;
166 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
167 HepSymMatrix Evx(3, 0);
168 double bx = 1E+6; Evx[0][0] = bx*bx;
169 double by = 1E+6; Evx[1][1] = by*by;
170 double bz = 1E+6; Evx[2][2] = bz*bz;
179 if(!vtxfit->
Fit(0))
continue;
185 HepVector pip_val = HepVector(7,0);
187 HepVector pim_val = HepVector(7,0);
190 HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
191 HepLorentzVector P_PIM(pim_val[0],pim_val[1],pim_val[2],pim_val[3]);
193 P_PIP.boost(-0.011,0,0);
194 P_PIM.boost(-0.011,0,0);
195 pddd = P_PIP + P_PIM;
197 double ppipi = pddd.rho();
199 double temp1 = (
ecms/2)*(
ecms/2)-ppipi*ppipi;
200 if(temp1<0) temp1 =0;
201 double mass_bc_tem = sqrt(temp1);
202 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89)
continue;
204 double delE_tag_tag =
ecms/2-pddd.e();
206 if(fabs(delE_tag_tag)<deltaE_tem){
207 deltaE_tem = fabs(delE_tag_tag);
208 delE_tag_temp = delE_tag_tag;
209 mass_bcgg = mass_bc_tem;
223 if(m_chargetag<0) tagmode=-19;
226 delE_tag = delE_tag_temp;
229 iGoodtag.push_back(ipi1_temp);
230 iGoodtag.push_back(ipi2_temp);
232 iGamtag.push_back(9999);
233 iGamtag.push_back(9999);
234 iGamtag.push_back(9999);
235 iGamtag.push_back(9999);