34 iGam,
double Ebeam,
int PID_flag,
int Charge_candidate_D)
37 int nGood=iGood.size();
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;
49 HepLorentzVector pddd_temp;
50 IDataProviderSvc* eventSvc =
NULL;
51 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
53 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,
"/Event/EventHeader");
55 int runNo=eventHeader->runNumber();
56 int rec=eventHeader->eventNumber();
63 if((evtRecEvent->totalCharged() < 2)){
return; }
68 Gaudi::svcLocator()->service(
"SimplePIDSvc", simple_pid);
70 double deltaE_tem = 0.20;
73 Hep3Vector xorigin(0,0,0);
75 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
85 double xv=xorigin.x();
86 double yv=xorigin.y();
87 double zv=xorigin.z();
90 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
92 HepLorentzVector ptrk1_temp, ptrk2_temp;
94 for(
int i = 0; i < evtRecEvent->totalCharged(); i++) {
97 int ika= (*itTrk)->trackId();
99 if(!(*itTrk)->isMdcKalTrackValid())
continue;
103 m_chargek=mdcKalTrk1->
charge();
104 if(Charge_candidate_D != 0) {
105 if(m_chargek != -Charge_candidate_D)
continue;
107 if(Charge_candidate_D == 0) {
108 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());
120 if ( dr1 >= 1.0)
continue;
121 if ( dz1 >= 10.0)
continue;
122 if ( fabs(costheta1) >= 0.93)
continue;
135 for(
int j = 0; j< evtRecEvent->totalCharged();j++) {
138 int ipi= (*itTrk)->trackId();
139 if(ipi==ika)
continue;
141 if(!(*itTrk)->isMdcKalTrackValid())
continue;
146 m_chargepi=mdcKalTrk2->
charge();
147 if((m_chargek + m_chargepi) != 0)
continue;
150 HepSymMatrix Ea2 = mdcKalTrk2->
getZError();
151 VFHelix helixip3_2(point0,a2,Ea2);
152 helixip3_2.
pivot(IP);
153 HepVector vecipa2 = helixip3_2.
a();
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;
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;
184 if(!vtxfit->
Fit(0))
continue;
190 HepVector kam_val = HepVector(7,0);
192 HepVector pip_val = HepVector(7,0);
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]);
198 P_KAM.boost(-0.011,0,0);
199 P_PIP.boost(-0.011,0,0);
200 pddd = P_KAM + P_PIP;
202 double pkpi=pddd.rho();
204 double temp1 = (
ecms/2)*(
ecms/2)-pkpi*pkpi;
205 if(temp1<0) temp1 =0;
206 double mass_bc_tem = sqrt(temp1);
208 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89)
continue;
210 double delE_tag_tag =
ecms/2-pddd.e();
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;
219 cqtm_temp = m_chargek;
229 if(cqtm_temp<0) tagmode=-11;
232 delE_tag = delE_tag_temp;
233 cqtm = -1.0*cqtm_temp;
239 iGoodtag.push_back(ika_temp);
240 iGoodtag.push_back(ipi_temp);
242 iGamtag.push_back(9999);
243 iGamtag.push_back(9999);
244 iGamtag.push_back(9999);
245 iGamtag.push_back(9999);
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
void MTotal(double event, SmartDataPtr< EvtRecTrackCol > evtRecTrkCol, Vint iGood, Vint iGam, double Ebeam, int PID_flag, int Charge_candidate_D)
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
HepSymMatrix & getZErrorK()
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.
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