35{
36
37 int nGood=iGood.size();
38 int nGam=iGam.size();
39
40 iGoodtag.clear();
41 iGamtag.clear();
42
43 double mass_bcgg, delE_tag_temp;
44 int m_chargetag, m_chargek,m_chargepi;
45 int ika_temp,ipi_temp,ipi2_temp,ipi3_temp;
46 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
47
48 int cqtm_temp;
49 HepLorentzVector pddd_temp;
50 IDataProviderSvc* eventSvc =
NULL;
51 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
53 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
54
55 int runNo=eventHeader->runNumber();
56 int rec=eventHeader->eventNumber();
57
58 double xecm=2*Ebeam;
59
60 kpimd = false;
61 double tagmode=0;
62
63 if((evtRecEvent->totalCharged() < 2)){ return; }
64
66
68 Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
69
70 double deltaE_tem = 0.20;
71 int ncount1 = 0;
72
73 Hep3Vector xorigin(0,0,0);
75 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
77 {
80 xorigin.setX(dbv[0]);
81 xorigin.setY(dbv[1]);
82 xorigin.setZ(dbv[2]);
83 }
84
85 double xv=xorigin.x();
86 double yv=xorigin.y();
87 double zv=xorigin.z();
88
90 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
91
92 HepLorentzVector ptrk1_temp, ptrk2_temp;
93
94 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
96
97 int ika= (*itTrk)->trackId();
98
99 if(!(*itTrk)->isMdcKalTrackValid()) continue;
102
103 m_chargek=mdcKalTrk1->
charge();
104 if(Charge_candidate_D != 0) {
105 if(m_chargek != -Charge_candidate_D) continue;
106 }
107 if(Charge_candidate_D == 0) {
108 if(
abs(m_chargek) != 1)
continue;
109 }
110
113 VFHelix helixip3_1(point0,a1,Ea1);
114 helixip3_1.pivot(IP);
115 HepVector vecipa1 = helixip3_1.a();
116
117 double dr1 = fabs(vecipa1[0]);
118 double dz1 = fabs(vecipa1[3]);
119 double costheta1 =
cos(mdcKalTrk1->
theta());
120 if ( dr1 >= 1.0) continue;
121 if ( dz1 >= 10.0) continue;
122 if ( fabs(costheta1) >= 0.93) continue;
123
124 if(PID_flag == 5) {
127 }
128
129
131
132
133
134
135 for(int j = 0; j< evtRecEvent->totalCharged();j++) {
137
138 int ipi= (*itTrk)->trackId();
139 if(ipi==ika) continue;
140
141 if(!(*itTrk)->isMdcKalTrackValid()) continue;
144
145
146 m_chargepi=mdcKalTrk2->
charge();
147 if((m_chargek + m_chargepi) != 0) continue;
148
150 HepSymMatrix Ea2 = mdcKalTrk2->
getZError();
151 VFHelix helixip3_2(point0,a2,Ea2);
152 helixip3_2.pivot(IP);
153 HepVector vecipa2 = helixip3_2.a();
154
155 double dr2 = fabs(vecipa2[0]);
156 double dz2 = fabs(vecipa2[3]);
157 double costheta2 =
cos(mdcKalTrk2->
theta());
158 if ( dr2 >= 1.0) continue;
159 if ( dz2 >= 10.0) continue;
160 if ( fabs(costheta2) >= 0.93) continue;
161
162 if(PID_flag == 5) {
165 }
166
167
169
170
171 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
172 HepSymMatrix Evx(3, 0);
173 double bx = 1E+6; Evx[0][0] = bx*bx;
174 double by = 1E+6; Evx[1][1] = by*by;
175 double bz = 1E+6; Evx[2][2] = bz*bz;
177
178
184 if(!vtxfit->
Fit(0))
continue;
186
189
190 HepVector kam_val = HepVector(7,0);
192 HepVector pip_val = HepVector(7,0);
194
195 HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
196 HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
197
198 P_KAM.boost(-0.011,0,0);
199 P_PIP.boost(-0.011,0,0);
200 pddd = P_KAM + P_PIP;
201
202 double pkpi=pddd.rho();
203
204 double temp1 = (
ecms/2)*(
ecms/2)-pkpi*pkpi;
205 if(temp1<0) temp1 =0;
206 double mass_bc_tem = sqrt(temp1);
207
208 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
209
210 double delE_tag_tag =
ecms/2-pddd.e();
211
212
213 if(fabs(delE_tag_tag)<deltaE_tem) {
214 deltaE_tem = fabs(delE_tag_tag);
215 delE_tag_temp = delE_tag_tag;
216 mass_bcgg = mass_bc_tem;
217
218 pddd_temp = pddd;
219 cqtm_temp = m_chargek;
220 ika_temp=ika;
221 ipi_temp=ipi;
222 ncount1 = 1;
223 }
224 }
225 }
226
227 if(ncount1 == 1){
228 tagmode = 11;
229 if(cqtm_temp<0) tagmode=-11;
230 tagmd = tagmode;
231 mass_bc = mass_bcgg;
232 delE_tag = delE_tag_temp;
233 cqtm = -1.0*cqtm_temp;
234
235
236
237
238
239 iGoodtag.push_back(ika_temp);
240 iGoodtag.push_back(ipi_temp);
241
242 iGamtag.push_back(9999);
243 iGamtag.push_back(9999);
244 iGamtag.push_back(9999);
245 iGamtag.push_back(9999);
246
247 ptag = pddd_temp;
248
249 kpimd = true;
250
251 }
252}
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
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
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
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