BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
K0pi0 Class Reference

#include <K0pi0.h>

Public Member Functions

 K0pi0 ()
 
 ~K0pi0 ()
 
bool GetK0pi0md ()
 
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 K0pi0.h.

Constructor & Destructor Documentation

◆ K0pi0()

K0pi0::K0pi0 ( )

Definition at line 27 of file K0pi0.cxx.

28{}

◆ ~K0pi0()

K0pi0::~K0pi0 ( )

Definition at line 30 of file K0pi0.cxx.

31{}

Member Function Documentation

◆ GetCQtm()

double K0pi0::GetCQtm ( )
inline

Definition at line 30 of file K0pi0.h.

30{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double K0pi0::GetdelE_tag ( )
inline

Definition at line 31 of file K0pi0.h.

31{ return delE_tag; }

Referenced by Sing::Mdset().

◆ GetK0pi0md()

bool K0pi0::GetK0pi0md ( )
inline

Definition at line 27 of file K0pi0.h.

27{ return k0pi0md; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double K0pi0::Getmass_bc ( )
inline

Definition at line 29 of file K0pi0.h.

29{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint K0pi0::GettagGam1 ( )
inline

Definition at line 34 of file K0pi0.h.

34{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double K0pi0::Gettagmd ( )
inline

Definition at line 28 of file K0pi0.h.

28{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector K0pi0::Gettagp1 ( )
inline

Definition at line 33 of file K0pi0.h.

33{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint K0pi0::Gettagtrk1 ( )
inline

Definition at line 32 of file K0pi0.h.

32{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

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

Definition at line 34 of file K0pi0.cxx.

36{
37
38 int nGood=iGood.size();
39 int nGam=iGam.size();
40
41 iGoodtag.clear();
42 iGamtag.clear();
43
44 double mass_bcgg,delE_tag_temp;
45 int m_chargetag,m_chargepi1,m_chargepi2;
46 int ika_temp,ipi1_temp,ipi2_temp,ipi3_temp, iGam1_temp, iGam2_temp;
47 HepLorentzVector pddd;
48 HepLorentzVector pddd_temp;
49
50 IDataProviderSvc* eventSvc = NULL;
51 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
52 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
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 k0pi0md=false;
61 double tagmode=0;
62
63 if((evtRecEvent->totalCharged() < 2||nGam<2)){ return; }
64
65 double ecms = xecm;
66
67 ISimplePIDSvc* simple_pid;
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);
74 HepSymMatrix xoriginEx(3,0);
75 IVertexDbSvc* vtxsvc;
76 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
77 if(vtxsvc->isVertexValid())
78 {
79 double* dbv = vtxsvc->PrimaryVertex();
80 double* vv = vtxsvc->SigmaPrimaryVertex();
81 xorigin.setX(dbv[0]);
82 xorigin.setY(dbv[1]);
83 xorigin.setZ(dbv[2]);
84
85 xoriginEx[0][0] = vv[0] * vv[0];
86 xoriginEx[1][1] = vv[1] * vv[1];
87 xoriginEx[2][2] = vv[2] * vv[2];
88
89 }
90
91 double xv=xorigin.x();
92 double yv=xorigin.y();
93 double zv=xorigin.z();
94
95 HepPoint3D point0(0.,0.,0.);
96 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
97 //////////////////////////////////////////////////////////////////
98 HepLorentzVector p2gfit;
99 HepLorentzVector p2gg;
100
101 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
102 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
103
104 int ipi1= (*itTrk)->trackId();
105
106 if(!(*itTrk)->isMdcKalTrackValid()) continue;
107 RecMdcKalTrack* mdcKalTrk1 = (*itTrk)->mdcKalTrack();
109
110 m_chargepi1=mdcKalTrk1->charge();
111 if(m_chargepi1 != 1) continue;
112
113 /////////////////////////////////////////
114 HepVector a1 = mdcKalTrk1->getZHelix();
115 HepSymMatrix Ea1 = mdcKalTrk1->getZError();
116
117 VFHelix helixip3_1(point0,a1,Ea1);
118 helixip3_1.pivot(IP);
119 HepVector vecipa1 = helixip3_1.a();
120
121 double dr1 = fabs(vecipa1[0]);
122 double dz1 = fabs(vecipa1[3]);
123 double costheta1 = cos(mdcKalTrk1->theta());
124
125 if ( dr1 >= 15.0) continue;
126 if ( dz1 >= 25.0) continue;
127 if ( fabs(costheta1) >= 0.93) continue;
128 /////////////////////////////////////////
129 WTrackParameter pip(xmass[2],mdcKalTrk1->getZHelix(),mdcKalTrk1->getZError() );
130
131 //
132 // select pi
133 //
134 for(int j = 0; j < evtRecEvent->totalCharged();j++) {
135 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
136
137 int ipi2= (*itTrk)->trackId();
138 if(ipi1==ipi2) continue;
139
140 if(!(*itTrk)->isMdcKalTrackValid()) continue;
141 RecMdcKalTrack* mdcKalTrk2 = (*itTrk)->mdcKalTrack();
143
144 m_chargepi2=mdcKalTrk2->charge();
145 if((m_chargepi1 + m_chargepi2) != 0) continue;
146
147 /////////////////////////////////////////
148 HepVector a2 = mdcKalTrk2->getZHelix();
149 HepSymMatrix Ea2 = mdcKalTrk2->getZError();
150 VFHelix helixip3_2(point0,a2,Ea2);
151 helixip3_2.pivot(IP);
152 HepVector vecipa2 = helixip3_2.a();
153
154 double dr2 = fabs(vecipa2[0]);
155 double dz2 = fabs(vecipa2[3]);
156 double costheta2 = cos(mdcKalTrk2->theta());
157 if ( dr2 >= 15.0) continue;
158 if ( dz2 >= 25.0) continue;
159 if ( fabs(costheta2) >= 0.93) continue;
160 /////////////////////////////////////////
161 WTrackParameter pim(xmass[2],mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError() );
162
163 HepVector pip_val = HepVector(7,0);
164 HepVector pim_val = HepVector(7,0);
165 pip_val = pip.w();
166 pim_val = pim.w();
167 HepLorentzVector ptrktagk0(pip_val[0]+pim_val[0],pip_val[1]+pim_val[1],pip_val[2]+pim_val[2],pip_val[3]+pim_val[3]);
168 double m_xmtagk0_tem = ptrktagk0.mag();
169 if(fabs(ptrktagk0.m()-0.498)>0.1) continue;
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;
176 VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
177
178 VertexFit *vtxfit0 = VertexFit::instance();
179 vtxfit0->init();
180 vtxfit0->AddTrack(0, pip);
181 vtxfit0->AddTrack(1, pim);
182 vtxfit0->AddVertex(0, vxpar, 0, 1);
183 if(!(vtxfit0->Fit(0))) continue;
184 vtxfit0->Swim(0);
185 vtxfit0->BuildVirtualParticle(0);
186 WTrackParameter wksp = vtxfit0->wtrk(0);
187 WTrackParameter wksm = vtxfit0->wtrk(1);
188 WTrackParameter wks_Trk = vtxfit0->wVirtualTrack(0);
189 VertexParameter wks_var = vtxfit0->vpar(0);
190
192 vtxfit->init();
193 vxpar.setEvx(xoriginEx);
194 vtxfit->setPrimaryVertex(vxpar);
195 vtxfit->AddTrack(0, wks_Trk);
196 vtxfit->setVpar(wks_var);
197 if(!vtxfit->Fit()) continue;
198
199 if(vtxfit->chisq() > 999.) continue;
200 if(vtxfit->decayLength()<0.0) continue;
201
202 double m_massks1_tem = vtxfit->p4par().m();
203 if(m_massks1_tem < 0.485 || m_massks1_tem > 0.515) continue;
204 HepLorentzVector p4kstag = vtxfit->p4par();
205 p4kstag.boost(-0.011,0,0);
206 WTrackParameter para_ks = vtxfit0->wVirtualTrack(0);
207
208 for(int m = 0; m < nGam-1; m++) {
209 if(iGam[m]==-1) continue;
210 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[m]))->emcShower();
211 double eraw1 = g1Trk->energy();
212 double phi1 = g1Trk->phi();
213 double the1 = g1Trk->theta();
214 HepLorentzVector ptrkg1,ptrkg10,ptrkg12;
215 ptrkg1.setPx(eraw1*sin(the1)*cos(phi1));
216 ptrkg1.setPy(eraw1*sin(the1)*sin(phi1));
217 ptrkg1.setPz(eraw1*cos(the1));
218 ptrkg1.setE(eraw1);
219 ptrkg10 = ptrkg1;
220 ptrkg12 = ptrkg1.boost(-0.011,0,0);
221
222 for(int n = m+1; n < nGam; n++) {
223 if(iGam[n]==-1) continue;
224 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+iGam[n]))->emcShower();
225 double eraw2 = g2Trk->energy();
226 double phi2 = g2Trk->phi();
227 double the2 = g2Trk->theta();
228 HepLorentzVector ptrkg2,ptrkg20,ptrkg22;
229 ptrkg2.setPx(eraw2*sin(the2)*cos(phi2));
230 ptrkg2.setPy(eraw2*sin(the2)*sin(phi2));
231 ptrkg2.setPz(eraw2*cos(the2));
232 ptrkg2.setE(eraw2);
233 ptrkg20 = ptrkg2;
234 ptrkg22 = ptrkg2.boost(-0.011,0,0);
235
236 /////////////////////////////////////////////////////////////
237 HepLorentzVector ptrkpi0;
238 ptrkpi0 = ptrkg12+ptrkg22;
239 double m_xmpi0_tem = ptrkpi0.m();
240 if(m_xmpi0_tem>0.150||m_xmpi0_tem<0.115) continue;
241 /////////////////////////////////////////////////////////////
242 bool IsEndcap1 = false; bool IsEndcap2 = false;
243 if(fabs(cos(the1)) > 0.86 && fabs(cos(the1)) < 0.92) IsEndcap1 = true;
244 if(fabs(cos(the2)) > 0.86 && fabs(cos(the2)) < 0.92) IsEndcap2 = true;
245 if(IsEndcap1 && IsEndcap2) continue;
246 /////////////////////////////////////////////////////////////
248 kmfit->init();
249 kmfit->setChisqCut(2500);
250 kmfit->AddTrack(0, 0.0, g1Trk);
251 kmfit->AddTrack(1, 0.0, g2Trk);
252 kmfit->AddResonance(0, mpi0, 0, 1);
253
254 kmfit->Fit(0); // Perform fit
255 kmfit->BuildVirtualParticle(0);
256
257 double pi0_chisq = kmfit->chisq(0);
258 if ( pi0_chisq >= 2500) continue;
259 HepLorentzVector p2gfit = kmfit->pfit(0) + kmfit->pfit(1);
260 p2gfit.boost(-0.011,0,0);
261 /////////////////////////////////////////////////////////////
262
263 HepVector ksp_val = HepVector(7,0);
264 HepVector ksm_val = HepVector(7,0);
265 ksp_val = wksp.w();
266 ksm_val = wksm.w();
267
268 HepLorentzVector P_KSP(ksp_val[0],ksp_val[1],ksp_val[2],ksp_val[3]);
269 HepLorentzVector P_KSM(ksm_val[0],ksm_val[1],ksm_val[2],ksm_val[3]);
270
271 P_KSP.boost(-0.011,0,0);
272 P_KSM.boost(-0.011,0,0);
273 pddd = p4kstag + p2gfit;
274
275 double pk0pi0=pddd.rho();
276
277 double temp1 = (ecms/2)*(ecms/2)-pk0pi0*pk0pi0 ;
278 if(temp1<0) temp1 =0;
279 double mass_bc_tem = sqrt(temp1);
280 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
281
282 double delE_tag_tag = ecms/2-pddd.e();
283
284 if(fabs(delE_tag_tag)<deltaE_tem){
285 deltaE_tem = fabs(delE_tag_tag);
286 delE_tag_temp = delE_tag_tag;
287 mass_bcgg = mass_bc_tem;
288
289 pddd_temp = pddd;
290
291 ipi1_temp=ipi1;
292 ipi2_temp=ipi2;
293
294 iGam1_temp = iGam[m];
295 iGam2_temp = iGam[n];
296
297 ncount1 = 1;
298 }
299 }
300 }
301 }
302 }
303
304 if(ncount1 == 1){
305 tagmode=18;
306 if(m_chargetag<0) tagmode=-18;
307 tagmd=tagmode;
308 mass_bc = mass_bcgg;
309 delE_tag = delE_tag_temp;
310 cqtm = 0.0;
311
312 iGoodtag.push_back(ipi1_temp);
313 iGoodtag.push_back(ipi2_temp);
314 iGamtag.push_back(iGam1_temp);
315 iGamtag.push_back(iGam2_temp);
316 iGamtag.push_back(9999);
317 iGamtag.push_back(9999);
318
319 ptag = pddd_temp;
320
321 k0pi0md = true;
322
323 }
324}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
const double mpi0
const Int_t n
Double_t phi2
Double_t phi1
int runNo
EvtRecTrackCol::iterator EvtRecTrackIterator
Definition: EvtRecTrack.h:111
const double xmass[5]
Definition: Gam4pikp.cxx:50
double theta() const
Definition: DstEmcShower.h:38
double phi() const
Definition: DstEmcShower.h:39
double energy() const
Definition: DstEmcShower.h:45
const double theta() const
static void setPidType(PidType pidType)
const int charge() const
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()
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
HepLorentzVector p4par() const
void setPrimaryVertex(const VertexParameter vpar)
double decayLength() const
static SecondVertexFit * instance()
void setVpar(const VertexParameter vpar)
double chisq() const
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition: TrackPool.cxx:22
WTrackParameter wtrk(int n) const
Definition: VertexFit.h:84
WTrackParameter wVirtualTrack(int n) const
Definition: VertexFit.h:97
void init()
Definition: VertexFit.cxx:29
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
Definition: VertexFit.cxx:87
static VertexFit * instance()
Definition: VertexFit.cxx:15
VertexParameter vpar(int n) const
Definition: VertexFit.h:94
void BuildVirtualParticle(int number)
Definition: VertexFit.cxx:616
void Swim(int n)
Definition: VertexFit.h:64
bool Fit()
Definition: VertexFit.cxx:299
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:111

Referenced by Sing::Mdset().


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