33 iGam,
double Ebeam,
int PID_flag,
int Charge_candidate_D)
36 int nGood=iGood.size();
42 double mass_bcgg, delE_tag_temp;
43 int m_chargetag, m_chargek1,m_chargek2;
44 int ika1_temp,ika2_temp,ipi2_temp,ipi3_temp;
45 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
47 HepLorentzVector pddd_temp;
48 IDataProviderSvc* eventSvc =
NULL;
49 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
51 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,
"/Event/EventHeader");
53 int runNo=eventHeader->runNumber();
54 int rec=eventHeader->eventNumber();
61 if((evtRecEvent->totalCharged() < 2)){
return; }
66 Gaudi::svcLocator()->service(
"SimplePIDSvc", simple_pid);
68 double deltaE_tem = 0.20;
71 Hep3Vector xorigin(0,0,0);
73 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
83 double xv=xorigin.x();
84 double yv=xorigin.y();
85 double zv=xorigin.z();
88 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
91 for(
int i = 0; i < evtRecEvent->totalCharged(); i++) {
94 int ika1= (*itTrk)->trackId();
96 if(!(*itTrk)->isMdcKalTrackValid())
continue;
100 m_chargek1=mdcKalTrk1->
charge();
101 if(m_chargek1 != 1)
continue;
107 VFHelix helixip3_1(point0,a1,Ea1);
108 helixip3_1.
pivot(IP);
109 HepVector vecipa1 = helixip3_1.
a();
111 double dr1 = fabs(vecipa1[0]);
112 double dz1 = fabs(vecipa1[3]);
113 double costheta1 =
cos(mdcKalTrk1->
theta());
115 if ( dr1 >= 1.0)
continue;
116 if ( dz1 >= 10.0)
continue;
117 if ( fabs(costheta1) >= 0.93)
continue;
129 for(
int j = 0; j< evtRecEvent->totalCharged();j++) {
132 int ika2= (*itTrk)->trackId();
133 if(ika1==ika2)
continue;
135 if(!(*itTrk)->isMdcKalTrackValid())
continue;
139 m_chargek2=mdcKalTrk2->
charge();
140 if((m_chargek1 + m_chargek2) != 0)
continue;
145 VFHelix helixip3_2(point0,a2,Ea2);
146 helixip3_2.
pivot(IP);
147 HepVector vecipa2 = helixip3_2.
a();
149 double dr2 = fabs(vecipa2[0]);
150 double dz2 = fabs(vecipa2[3]);
151 double costheta2 =
cos(mdcKalTrk2->
theta());
152 if ( dr2 >= 1.0)
continue;
153 if ( dz2 >= 10.0)
continue;
154 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 kap_val = HepVector(7,0);
187 HepVector kam_val = HepVector(7,0);
190 HepLorentzVector P_KAP(kap_val[0],kap_val[1],kap_val[2],kap_val[3]);
191 HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
193 P_KAP.boost(-0.011,0,0);
194 P_KAM.boost(-0.011,0,0);
195 pddd = P_KAP + P_KAM;
197 double pkk=pddd.rho();
199 double temp1 = (
ecms/2)*(
ecms/2)-pkk*pkk;
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;
221 if(m_chargetag<0) tagmode=-15;
224 delE_tag = delE_tag_temp;
227 iGoodtag.push_back(ika1_temp);
228 iGoodtag.push_back(ika2_temp);
229 iGamtag.push_back(9999);
230 iGamtag.push_back(9999);
231 iGamtag.push_back(9999);
232 iGamtag.push_back(9999);