34{
35
36 int nGood=iGood.size();
37 int nGam=iGam.size();
38
39 iGoodtag.clear();
40 iGamtag.clear();
41
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;
46
47 HepLorentzVector pddd_temp;
48 IDataProviderSvc* eventSvc = NULL;
49 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
51 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
52
53 int runNo=eventHeader->runNumber();
54 int rec=eventHeader->eventNumber();
55
56 double xecm=2*Ebeam;
57
58 kkmd=false;
59 double tagmode=0;
60
61 if((evtRecEvent->totalCharged() < 2)){ return; }
62
64
66 Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
67
68 double deltaE_tem = 0.20;
69 int ncount1 = 0;
70
71 Hep3Vector xorigin(0,0,0);
73 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
75 {
78 xorigin.setX(dbv[0]);
79 xorigin.setY(dbv[1]);
80 xorigin.setZ(dbv[2]);
81 }
82
83 double xv=xorigin.x();
84 double yv=xorigin.y();
85 double zv=xorigin.z();
86
88 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
89
90
91 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
93
94 int ika1= (*itTrk)->trackId();
95
96 if(!(*itTrk)->isMdcKalTrackValid()) continue;
99
100 m_chargek1=mdcKalTrk1->
charge();
101 if(m_chargek1 != 1) continue;
102
103
106
107 VFHelix helixip3_1(point0,a1,Ea1);
108 helixip3_1.pivot(IP);
109 HepVector vecipa1 = helixip3_1.a();
110
111 double dr1 = fabs(vecipa1[0]);
112 double dz1 = fabs(vecipa1[3]);
113 double costheta1 =
cos(mdcKalTrk1->
theta());
114
115 if ( dr1 >= 1.0) continue;
116 if ( dz1 >= 10.0) continue;
117 if ( fabs(costheta1) >= 0.93) continue;
118
119 if(PID_flag == 5) {
122 }
123
125
126
127
128
129 for(int j = 0; j< evtRecEvent->totalCharged();j++) {
131
132 int ika2= (*itTrk)->trackId();
133 if(ika1==ika2) continue;
134
135 if(!(*itTrk)->isMdcKalTrackValid()) continue;
138
139 m_chargek2=mdcKalTrk2->
charge();
140 if((m_chargek1 + m_chargek2) != 0) continue;
141
142
145 VFHelix helixip3_2(point0,a2,Ea2);
146 helixip3_2.pivot(IP);
147 HepVector vecipa2 = helixip3_2.a();
148
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;
155
156 if(PID_flag == 5) {
159 }
160
162
163
164
165
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;
172
173
179 if(!vtxfit->
Fit(0))
continue;
181
184
185 HepVector kap_val = HepVector(7,0);
187 HepVector kam_val = HepVector(7,0);
189
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]);
192
193 P_KAP.boost(-0.011,0,0);
194 P_KAM.boost(-0.011,0,0);
195 pddd = P_KAP + P_KAM;
196
197 double pkk=pddd.rho();
198
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;
203
204 double delE_tag_tag =
ecms/2-pddd.e();
205
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;
210
211 pddd_temp = pddd;
212 ika1_temp=ika1;
213 ika2_temp=ika2;
214 ncount1 = 1;
215 }
216 }
217 }
218
219 if(ncount1 == 1){
220 tagmode=15;
221 if(m_chargetag<0) tagmode=-15;
222 tagmd=tagmode;
223 mass_bc = mass_bcgg;
224 delE_tag = delE_tag_temp;
225 cqtm = -0.0;
226
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);
233
234 ptag = pddd_temp;
235
236 kkmd = true;
237 }
238}
EvtRecTrackCol::iterator EvtRecTrackIterator
double cos(const BesAngle a)
const double theta() const
static void setPidType(PidType pidType)
virtual double probKaon()=0
virtual void preparePID(EvtRecTrack *track)=0
virtual double probPion()=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
HepSymMatrix & getZErrorK()
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
WTrackParameter wtrk(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
_EXTERN_ std::string EvtRecEvent