BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Kkpi0 Class Reference

#include <Kkpi0.h>

Public Member Functions

 Kkpi0 ()
 
 ~Kkpi0 ()
 
bool Getkkpi0md ()
 
double Gettagmd ()
 
double Getmass_bc ()
 
double GetCQtm ()
 
double GetdelE_tag ()
 
Vint Gettagtrk1 ()
 
HepLorentzVector Gettagp1 ()
 
Vint GettagGam1 ()
 
void MTotal (double event, SmartDataPtr< EvtRecTrackCol > evtRecTrkCol, Vint iGood, Vint iGam, double Ebeam, int PID_flag, int Charge_candidate_D)
 

Detailed Description

Definition at line 20 of file Kkpi0.h.

Constructor & Destructor Documentation

◆ Kkpi0()

Kkpi0::Kkpi0 ( )

Definition at line 28 of file Kkpi0.cxx.

29{}

◆ ~Kkpi0()

Kkpi0::~Kkpi0 ( )

Definition at line 31 of file Kkpi0.cxx.

32{}

Member Function Documentation

◆ GetCQtm()

double Kkpi0::GetCQtm ( )
inline

Definition at line 30 of file Kkpi0.h.

30{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double Kkpi0::GetdelE_tag ( )
inline

Definition at line 31 of file Kkpi0.h.

31{ return delE_tag; }

Referenced by Sing::Mdset().

◆ Getkkpi0md()

bool Kkpi0::Getkkpi0md ( )
inline

Definition at line 27 of file Kkpi0.h.

27{ return kkpi0md; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double Kkpi0::Getmass_bc ( )
inline

Definition at line 29 of file Kkpi0.h.

29{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint Kkpi0::GettagGam1 ( )
inline

Definition at line 34 of file Kkpi0.h.

34{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double Kkpi0::Gettagmd ( )
inline

Definition at line 28 of file Kkpi0.h.

28{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector Kkpi0::Gettagp1 ( )
inline

Definition at line 33 of file Kkpi0.h.

33{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint Kkpi0::Gettagtrk1 ( )
inline

Definition at line 32 of file Kkpi0.h.

32{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

void Kkpi0::MTotal ( double event,
SmartDataPtr< EvtRecTrackCol > evtRecTrkCol,
Vint iGood,
Vint iGam,
double Ebeam,
int PID_flag,
int Charge_candidate_D )

Definition at line 35 of file Kkpi0.cxx.

37{
38
39 int nGood=iGood.size();
40 int nGam=iGam.size();
41
42 iGoodtag.clear();
43 iGamtag.clear();
44
45 double mass_bcgg,delE_tag_temp;
46 int m_chargetag,m_chargek1,m_chargek2;
47 int ik1_temp,ik2_temp, iGam1_temp, iGam2_temp;
48 HepLorentzVector pddd;
49 HepLorentzVector pddd_temp;
50
51 IDataProviderSvc* eventSvc = NULL;
52 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
53 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
54 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
55
56 int runNo=eventHeader->runNumber();
57 int rec=eventHeader->eventNumber();
58
59 double xecm=2*Ebeam;
60
61 kkpi0md=false;
62 double tagmode=0;
63
64 if((evtRecEvent->totalCharged() < 2||nGam<2)){ return; }
65
66 double ecms = xecm;
67
68
69 ISimplePIDSvc* simple_pid;
70 Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
71
72 double deltaE_tem = 0.20;
73 int ncount1 = 0;
74
75 Hep3Vector xorigin(0,0,0);
76 IVertexDbSvc* vtxsvc;
77 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
78 if(vtxsvc->isVertexValid())
79 {
80 double* dbv = vtxsvc->PrimaryVertex();
81 double* vv = vtxsvc->SigmaPrimaryVertex();
82 xorigin.setX(dbv[0]);
83 xorigin.setY(dbv[1]);
84 xorigin.setZ(dbv[2]);
85 }
86
87 double xv=xorigin.x();
88 double yv=xorigin.y();
89 double zv=xorigin.z();
90
91 HepPoint3D point0(0.,0.,0.);
92 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
93 //////////////////////////////////////////////////////////////////
94
95 HepLorentzVector p2gfit;
96 HepLorentzVector p2gg;
97
98 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
99 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
100
101 int ik1 = (*itTrk)->trackId();
102
103 if(!(*itTrk)->isMdcKalTrackValid()) continue;
104 RecMdcKalTrack* mdcKalTrk1 = (*itTrk)->mdcKalTrack();
106
107 m_chargek1 = mdcKalTrk1->charge();
108 if(abs(m_chargek1) != 1) continue;
109
110 /////////////////////////////////////////
111 HepVector a1 = mdcKalTrk1->getZHelixK();
112 HepSymMatrix Ea1 = mdcKalTrk1->getZErrorK();
113
114 VFHelix helixip3_1(point0,a1,Ea1);
115 helixip3_1.pivot(IP);
116 HepVector vecipa1 = helixip3_1.a();
117
118 double dr1 = fabs(vecipa1[0]);
119 double dz1 = fabs(vecipa1[3]);
120 double costheta1 = cos(mdcKalTrk1->theta());
121
122 if ( dr1 >= 1.0) continue;
123 if ( dz1 >= 10.0) continue;
124 if ( fabs(costheta1) >= 0.93) continue;
125 /////////////////////////////////////////
126 if(PID_flag == 5) {
127 simple_pid->preparePID(*itTrk);
128 if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;
129 }
130 /////////////////////////////////////////
131 WTrackParameter kap(xmass[3],mdcKalTrk1->getZHelixK(),mdcKalTrk1->getZErrorK() );
132
133 //
134 // select K2
135 //
136 for(int j = 0; j< evtRecEvent->totalCharged(); j++) {
137 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
138
139 int ik2= (*itTrk)->trackId();
140 if(ik2==ik1) continue;
141
142 if(!(*itTrk)->isMdcKalTrackValid()) continue;
143 RecMdcKalTrack* mdcKalTrk2 = (*itTrk)->mdcKalTrack();
145
146 m_chargek2 = mdcKalTrk2->charge();
147 if((m_chargek1 + m_chargek2) != 0) continue;
148
149 /////////////////////////////////////////
150 HepVector a2 = mdcKalTrk2->getZHelixK();
151 HepSymMatrix Ea2 = mdcKalTrk2->getZErrorK();
152 VFHelix helixip3_2(point0,a2,Ea2);
153 helixip3_2.pivot(IP);
154 HepVector vecipa2 = helixip3_2.a();
155
156 double dr2 = fabs(vecipa2[0]);
157 double dz2 = fabs(vecipa2[3]);
158 double costheta2 = cos(mdcKalTrk2->theta());
159 if ( dr2 >= 1.0) continue;
160 if ( dz2 >= 10.0) continue;
161 if ( fabs(costheta2) >= 0.93) continue;
162 /////////////////////////////////////////
163 if(PID_flag == 5) {
164 simple_pid->preparePID(*itTrk);
165 if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;
166 }
167 /////////////////////////////////////////
168 WTrackParameter kam(xmass[3],mdcKalTrk2->getZHelixK(),mdcKalTrk2->getZErrorK() );
169
170
171 for(int m = 0; m < nGam-1; m++) {
172 if(iGam[m]==-1) continue;
173 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[m]))->emcShower();
174 double eraw1 = g1Trk->energy();
175 double phi1 = g1Trk->phi();
176 double the1 = g1Trk->theta();
177 HepLorentzVector ptrkg1,ptrkg10,ptrkg12;
178 ptrkg1.setPx(eraw1*sin(the1)*cos(phi1));
179 ptrkg1.setPy(eraw1*sin(the1)*sin(phi1));
180 ptrkg1.setPz(eraw1*cos(the1));
181 ptrkg1.setE(eraw1);
182 ptrkg10 = ptrkg1;
183 ptrkg12 = ptrkg1.boost(-0.011,0,0);
184
185
186 for(int n = m+1; n < nGam; n++) {
187 if(iGam[n]==-1) continue;
188 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+iGam[n]))->emcShower();
189 double eraw2 = g2Trk->energy();
190 double phi2 = g2Trk->phi();
191 double the2 = g2Trk->theta();
192 HepLorentzVector ptrkg2,ptrkg20,ptrkg22;
193 ptrkg2.setPx(eraw2*sin(the2)*cos(phi2));
194 ptrkg2.setPy(eraw2*sin(the2)*sin(phi2));
195 ptrkg2.setPz(eraw2*cos(the2));
196 ptrkg2.setE(eraw2);
197 ptrkg20 = ptrkg2;
198 ptrkg22 = ptrkg2.boost(-0.011,0,0);
199
200 /////////////////////////////////////////////////////////////
201 HepLorentzVector ptrkpi0;
202 ptrkpi0 = ptrkg12+ptrkg22;
203 double m_xmpi0_tem = ptrkpi0.m();
204 if(m_xmpi0_tem>0.150||m_xmpi0_tem<0.115) continue;
205 /////////////////////////////////////////////////////////////
206 bool IsEndcap1 = false; bool IsEndcap2 = false;
207 if(fabs(cos(the1)) > 0.86 && fabs(cos(the1)) < 0.92) IsEndcap1 = true;
208 if(fabs(cos(the2)) > 0.86 && fabs(cos(the2)) < 0.92) IsEndcap2 = true;
209 if(IsEndcap1 && IsEndcap2) continue;
210 /////////////////////////////////////////////////////////////
212 kmfit->init();
213 kmfit->setChisqCut(2500);
214 kmfit->AddTrack(0, 0.0, g1Trk);
215 kmfit->AddTrack(1, 0.0, g2Trk);
216 kmfit->AddResonance(0, mpi0, 0, 1);
217
218 kmfit->Fit(0); // Perform fit
219 kmfit->BuildVirtualParticle(0);
220
221 double pi0_chisq = kmfit->chisq(0);
222 if ( pi0_chisq >= 2500) continue;
223 HepLorentzVector p2gfit = kmfit->pfit(0) + kmfit->pfit(1);
224 p2gfit.boost(-0.011,0,0);
225
226 //////////////////////////////////////////////////////////////
227 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
228 HepSymMatrix Evx(3, 0);
229 double bx = 1E+6; Evx[0][0] = bx*bx;
230 double by = 1E+6; Evx[1][1] = by*by;
231 double bz = 1E+6; Evx[2][2] = bz*bz;
232 VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
233 //////////////////////////////////////////////////////////////
234
235 VertexFit* vtxfit = VertexFit::instance();
236 vtxfit->init();
237 vtxfit->AddTrack(0, kam);
238 vtxfit->AddTrack(1, kap);
239 vtxfit->AddVertex(0, vxpar, 0, 1);
240 if(!vtxfit->Fit(0)) continue;
241 vtxfit->Swim(0);
242
243 WTrackParameter wkam = vtxfit->wtrk(0);
244 WTrackParameter wkap = vtxfit->wtrk(1);
245
246 HepVector kam_val = HepVector(7,0);
247 kam_val = wkam.w();
248 HepVector kap_val = HepVector(7,0);
249 kap_val = wkap.w();
250
251 HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
252 HepLorentzVector P_KAP(kap_val[0],kap_val[1],kap_val[2],kap_val[3]);
253
254 P_KAM.boost(-0.011,0,0);
255 P_KAP.boost(-0.011,0,0);
256 pddd = P_KAM + P_KAP + p2gfit;
257
258 double pkkpi0 = pddd.rho();
259
260 double temp1 = (ecms/2)*(ecms/2)-pkkpi0*pkkpi0 ;
261 if(temp1<0) temp1 =0;
262 double mass_bc_tem = sqrt(temp1);
263 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
264
265 double delE_tag_tag = ecms/2-pddd.e();
266
267 if(fabs(delE_tag_tag)<deltaE_tem) {
268 deltaE_tem = fabs(delE_tag_tag);
269 delE_tag_temp = delE_tag_tag;
270 mass_bcgg = mass_bc_tem;
271
272 pddd_temp = pddd;
273
274 ik1_temp = ik1;
275 ik2_temp = ik2;
276 iGam1_temp = iGam[m];
277 iGam2_temp = iGam[n];
278 ncount1 = 1;
279
280 }
281 }
282 }
283 }
284 }
285
286 if(ncount1 == 1) {
287 tagmode=23;
288 if(m_chargetag<0) tagmode=-23;
289 tagmd=tagmode;
290 mass_bc = mass_bcgg;
291 delE_tag = delE_tag_temp;
292 cqtm = 0.0;
293
294 iGoodtag.push_back(ik1_temp);
295 iGoodtag.push_back(ik2_temp);
296
297 iGamtag.push_back(iGam1_temp);
298 iGamtag.push_back(iGam2_temp);
299 iGamtag.push_back(9999);
300 iGamtag.push_back(9999);
301
302 ptag = pddd_temp;
303
304 kkpi0md = true;
305 }
306}
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
const double mpi0
int runNo
Definition DQA_TO_DB.cxx:12
const Int_t n
Double_t phi2
Double_t phi1
EvtRecTrackCol::iterator EvtRecTrackIterator
const double xmass[5]
Definition Gam4pikp.cxx:50
#define NULL
double theta() const
double phi() const
double energy() const
const double theta() const
static void setPidType(PidType pidType)
const int charge() const
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 setChisqCut(const double chicut=200, const double chiter=0.05)
HepLorentzVector pfit(int n) const
void BuildVirtualParticle(int number)
void AddResonance(int number, double mres, std::vector< int > tlis)
static KalmanKinematicFit * instance()
HepVector & getZHelixK()
HepSymMatrix & getZErrorK()
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition TrackPool.cxx:22
WTrackParameter wtrk(int n) const
Definition VertexFit.h:79
void init()
Definition VertexFit.cxx:29
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
Definition VertexFit.cxx:89
static VertexFit * instance()
Definition VertexFit.cxx:15
void Swim(int n)
Definition VertexFit.h:59
bool Fit()
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
HepVector w() const
const double ecms
Definition inclkstar.cxx:42
_EXTERN_ std::string EvtRecEvent
Definition EventModel.h:116

Referenced by Sing::Mdset().


The documentation for this class was generated from the following files: