BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
K0pipi Class Reference

#include <K0pipi.h>

Public Member Functions

 K0pipi ()
 ~K0pipi ()
bool Getk0pipimd ()
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 K0pipi.h.

Constructor & Destructor Documentation

◆ K0pipi()

K0pipi::K0pipi ( )

Definition at line 28 of file K0pipi.cxx.

28{}

◆ ~K0pipi()

K0pipi::~K0pipi ( )

Definition at line 30 of file K0pipi.cxx.

30{}

Member Function Documentation

◆ GetCQtm()

double K0pipi::GetCQtm ( )
inline

Definition at line 29 of file K0pipi.h.

29{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double K0pipi::GetdelE_tag ( )
inline

Definition at line 30 of file K0pipi.h.

30{ return delE_tag; }

Referenced by Sing::Mdset().

◆ Getk0pipimd()

bool K0pipi::Getk0pipimd ( )
inline

Definition at line 26 of file K0pipi.h.

26{ return k0pipimd; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double K0pipi::Getmass_bc ( )
inline

Definition at line 28 of file K0pipi.h.

28{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint K0pipi::GettagGam1 ( )
inline

Definition at line 33 of file K0pipi.h.

33{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double K0pipi::Gettagmd ( )
inline

Definition at line 27 of file K0pipi.h.

27{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector K0pipi::Gettagp1 ( )
inline

Definition at line 32 of file K0pipi.h.

32{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint K0pipi::Gettagtrk1 ( )
inline

Definition at line 31 of file K0pipi.h.

31{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

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

Definition at line 32 of file K0pipi.cxx.

33 {
34
35 int nGood = iGood.size();
36 int nGam = iGam.size();
37
38 iGoodtag.clear();
39 iGamtag.clear();
40
41 double mass_bcgg, delE_tag_temp;
42 int m_chargetag, m_chargepi1, m_chargepi2, m_chargepi3, m_chargepi4;
43 int ipi1_temp, ipi2_temp, ipi3_temp, ipi4_temp;
44 HepLorentzVector pddd;
45 HepLorentzVector pddd_temp;
46
47 IDataProviderSvc* eventSvc = NULL;
48 Gaudi::svcLocator()->service( "EventDataSvc", eventSvc );
49 SmartDataPtr<EvtRecEvent> evtRecEvent( eventSvc, EventModel::EvtRec::EvtRecEvent );
50 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc, "/Event/EventHeader" );
51
52 int runNo = eventHeader->runNumber();
53 int rec = eventHeader->eventNumber();
54
55 double xecm = 2 * Ebeam;
56
57 k0pipimd = false;
58 double tagmode = 0;
59
60 if ( ( evtRecEvent->totalCharged() < 4 ) ) { return; }
61
62 double ecms = xecm;
63
64 ISimplePIDSvc* simple_pid;
65 Gaudi::svcLocator()->service( "SimplePIDSvc", simple_pid );
66
67 double deltaE_tem = 0.20;
68 int ncount1 = 0;
69
70 Hep3Vector xorigin( 0, 0, 0 );
71 HepSymMatrix xoriginEx( 3, 0 );
72 IVertexDbSvc* vtxsvc;
73 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc );
74 if ( vtxsvc->isVertexValid() )
75 {
76 double* dbv = vtxsvc->PrimaryVertex();
77 double* vv = vtxsvc->SigmaPrimaryVertex();
78 xorigin.setX( dbv[0] );
79 xorigin.setY( dbv[1] );
80 xorigin.setZ( dbv[2] );
81
82 xoriginEx[0][0] = vv[0] * vv[0];
83 xoriginEx[1][1] = vv[1] * vv[1];
84 xoriginEx[2][2] = vv[2] * vv[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 for ( int i = 0; i < evtRecEvent->totalCharged(); i++ )
96 {
97 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
98
99 int ipi1 = ( *itTrk )->trackId();
100
101 if ( !( *itTrk )->isMdcKalTrackValid() ) continue;
102 RecMdcKalTrack* mdcKalTrk1 = ( *itTrk )->mdcKalTrack();
104
105 m_chargepi1 = mdcKalTrk1->charge();
106 if ( m_chargepi1 != 1 ) continue;
107
108 /////////////////////////////////////////
109 HepVector a1 = mdcKalTrk1->getZHelix();
110 HepSymMatrix Ea1 = mdcKalTrk1->getZError();
111
112 VFHelix helixip3_1( point0, a1, Ea1 );
113 helixip3_1.pivot( IP );
114 HepVector vecipa1 = helixip3_1.a();
115
116 double dr1 = fabs( vecipa1[0] );
117 double dz1 = fabs( vecipa1[3] );
118 double costheta1 = cos( mdcKalTrk1->theta() );
119
120 if ( dr1 >= 15.0 ) continue;
121 if ( dz1 >= 25.0 ) continue;
122 if ( fabs( costheta1 ) >= 0.93 ) continue;
123 /////////////////////////////////////////
124 WTrackParameter pip1( xmass[2], mdcKalTrk1->getZHelix(), mdcKalTrk1->getZError() );
125
126 //
127 // select pi2
128 //
129 for ( int j = 0; j < evtRecEvent->totalCharged(); j++ )
130 {
131 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
132
133 int ipi2 = ( *itTrk )->trackId();
134 if ( ipi1 == ipi2 ) continue;
135
136 if ( !( *itTrk )->isMdcKalTrackValid() ) continue;
137 RecMdcKalTrack* mdcKalTrk2 = ( *itTrk )->mdcKalTrack();
139
140 m_chargepi2 = mdcKalTrk2->charge();
141 if ( ( m_chargepi2 + m_chargepi1 ) != 0 ) continue;
142
143 /////////////////////////////////////////
144 HepVector a2 = mdcKalTrk2->getZHelix();
145 HepSymMatrix Ea2 = mdcKalTrk2->getZError();
146 VFHelix helixip3_2( point0, a2, Ea2 );
147 helixip3_2.pivot( IP );
148 HepVector vecipa2 = helixip3_2.a();
149
150 double dr2 = fabs( vecipa2[0] );
151 double dz2 = fabs( vecipa2[3] );
152 double costheta2 = cos( mdcKalTrk2->theta() );
153 if ( dr2 >= 15.0 ) continue;
154 if ( dz2 >= 25.0 ) continue;
155 if ( fabs( costheta2 ) >= 0.93 ) continue;
156 /////////////////////////////////////////
157 WTrackParameter pim1( xmass[2], mdcKalTrk2->getZHelix(), mdcKalTrk2->getZError() );
158
159 HepVector pip1_val = HepVector( 7, 0 );
160 HepVector pim1_val = HepVector( 7, 0 );
161 pip1_val = pip1.w();
162 pim1_val = pim1.w();
163 HepLorentzVector ptrktagk0( pip1_val[0] + pim1_val[0], pip1_val[1] + pim1_val[1],
164 pip1_val[2] + pim1_val[2], pip1_val[3] + pim1_val[3] );
165 if ( fabs( ptrktagk0.m() - 0.498 ) > 0.1 ) continue;
166
167 HepPoint3D vx( xorigin.x(), xorigin.y(), xorigin.z() );
168 HepSymMatrix Evx( 3, 0 );
169 double bx = 1E+6;
170 Evx[0][0] = bx * bx;
171 double by = 1E+6;
172 Evx[1][1] = by * by;
173 double bz = 1E+6;
174 Evx[2][2] = bz * bz;
175 VertexParameter vxpar;
176 vxpar.setVx( vx );
177 vxpar.setEvx( Evx );
178
179 VertexFit* vtxfit0 = VertexFit::instance();
180 vtxfit0->init();
181 vtxfit0->AddTrack( 0, pip1 );
182 vtxfit0->AddTrack( 1, pim1 );
183 vtxfit0->AddVertex( 0, vxpar, 0, 1 );
184 if ( !( vtxfit0->Fit( 0 ) ) ) continue;
185 vtxfit0->Swim( 0 );
186 vtxfit0->BuildVirtualParticle( 0 );
187 WTrackParameter wksp = vtxfit0->wtrk( 0 );
188 WTrackParameter wksm = vtxfit0->wtrk( 1 );
189 WTrackParameter wks_Trk = vtxfit0->wVirtualTrack( 0 );
190 VertexParameter wks_var = vtxfit0->vpar( 0 );
191
192 //
193 // select pi3
194 //
195 for ( int k = 0; k < evtRecEvent->totalCharged(); k++ )
196 {
197 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + k;
198
199 int ipi3 = ( *itTrk )->trackId();
200 if ( ipi2 == ipi3 || ipi1 == ipi3 ) continue;
201
202 if ( !( *itTrk )->isMdcKalTrackValid() ) continue;
203 RecMdcKalTrack* mdcKalTrk3 = ( *itTrk )->mdcKalTrack();
205
206 m_chargepi3 = mdcKalTrk3->charge();
207 if ( ( m_chargepi3 ) != 1 ) continue;
208
209 /////////////////////////////////////////
210 HepVector a3 = mdcKalTrk3->getZHelix();
211 HepSymMatrix Ea3 = mdcKalTrk3->getZError();
212 VFHelix helixip3_3( point0, a3, Ea3 );
213 helixip3_3.pivot( IP );
214 HepVector vecipa3 = helixip3_3.a();
215
216 double dr3 = fabs( vecipa3[0] );
217 double dz3 = fabs( vecipa3[3] );
218 double costheta3 = cos( mdcKalTrk3->theta() );
219 if ( dr3 >= 1.0 ) continue;
220 if ( dz3 >= 10.0 ) continue;
221 if ( fabs( costheta3 ) >= 0.93 ) continue;
222 /////////////////////////////////////////
223 if ( PID_flag == 5 )
224 {
225 simple_pid->preparePID( *itTrk );
226 if ( simple_pid->probPion() < 0.0 ||
227 simple_pid->probPion() < simple_pid->probKaon() )
228 continue;
229 }
230 /////////////////////////////////////////
231 WTrackParameter pip2( xmass[2], mdcKalTrk3->getZHelix(), mdcKalTrk3->getZError() );
232
233 //
234 // select pi4
235 //
236 for ( int l = 0; l < evtRecEvent->totalCharged(); l++ )
237 {
238 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + l;
239
240 int ipi4 = ( *itTrk )->trackId();
241 if ( ipi4 == ipi3 || ipi4 == ipi2 || ipi4 == ipi1 ) continue;
242
243 if ( !( *itTrk )->isMdcKalTrackValid() ) continue;
244 RecMdcKalTrack* mdcKalTrk4 = ( *itTrk )->mdcKalTrack();
246
247 m_chargepi4 = mdcKalTrk4->charge();
248 if ( ( m_chargepi4 + m_chargepi3 ) != 0 ) continue;
249
250 /////////////////////////////////////////
251 HepVector a4 = mdcKalTrk4->getZHelix();
252 HepSymMatrix Ea4 = mdcKalTrk4->getZError();
253 VFHelix helixip3_4( point0, a4, Ea4 );
254 helixip3_4.pivot( IP );
255 HepVector vecipa4 = helixip3_4.a();
256
257 double dr4 = fabs( vecipa4[0] );
258 double dz4 = fabs( vecipa4[3] );
259 double costheta4 = cos( mdcKalTrk4->theta() );
260 if ( dr4 >= 1.0 ) continue;
261 if ( dz4 >= 10.0 ) continue;
262 if ( fabs( costheta4 ) >= 0.93 ) continue;
263 /////////////////////////////////////////
264 if ( PID_flag == 5 )
265 {
266 simple_pid->preparePID( *itTrk );
267 if ( simple_pid->probPion() < 0.0 ||
268 simple_pid->probPion() < simple_pid->probKaon() )
269 continue;
270 }
271 /////////////////////////////////////////
272 WTrackParameter pim2( xmass[2], mdcKalTrk4->getZHelix(), mdcKalTrk4->getZError() );
273
274 // all loop for the charged tracks overed here !!!!!!!
275
276 VertexFit* vtxfit_2 = VertexFit::instance();
277 vtxfit_2->init();
278 vtxfit_2->AddTrack( 0, pip2 );
279 vtxfit_2->AddTrack( 1, pim2 );
280 vtxfit_2->AddVertex( 0, vxpar, 0, 1 );
281 if ( !vtxfit_2->Fit( 0 ) ) continue;
282 vtxfit_2->Swim( 0 );
283
284 WTrackParameter wpip2 = vtxfit_2->wtrk( 0 );
285 WTrackParameter wpim2 = vtxfit_2->wtrk( 1 );
286
287 SecondVertexFit* vtxfit = SecondVertexFit::instance();
288 vtxfit->init();
289 vxpar.setEvx( xoriginEx );
290 vtxfit->setPrimaryVertex( vxpar );
291 vtxfit->AddTrack( 0, wks_Trk );
292 vtxfit->setVpar( wks_var );
293 if ( !vtxfit->Fit() ) continue;
294
295 if ( vtxfit->chisq() > 999. ) continue;
296 if ( vtxfit->decayLength() < 0.0 ) continue;
297
298 double m_massks1_tem = vtxfit->p4par().m();
299 if ( m_massks1_tem < 0.485 || m_massks1_tem > 0.515 ) continue;
300 HepLorentzVector p4kstag = vtxfit->p4par();
301 WTrackParameter para_ks = vtxfit0->wVirtualTrack( 0 );
302 WTrackParameter wksz = vtxfit->wpar();
303
304 HepVector pip2_val = HepVector( 7, 0 );
305 HepVector pim2_val = HepVector( 7, 0 );
306 HepVector ksp_val = HepVector( 7, 0 );
307 HepVector ksm_val = HepVector( 7, 0 );
308
309 pip2_val = wpip2.w();
310 pim2_val = wpim2.w();
311 ksp_val = wksp.w();
312 ksm_val = wksm.w();
313
314 HepLorentzVector P_PIP2( pip2_val[0], pip2_val[1], pip2_val[2], pip2_val[3] );
315 HepLorentzVector P_PIM2( pim2_val[0], pim2_val[1], pim2_val[2], pim2_val[3] );
316 HepLorentzVector P_KSP( ksp_val[0], ksp_val[1], ksp_val[2], ksp_val[3] );
317 HepLorentzVector P_KSM( ksm_val[0], ksm_val[1], ksm_val[2], ksm_val[3] );
318
319 p4kstag.boost( -0.011, 0, 0 );
320 P_PIP2.boost( -0.011, 0, 0 );
321 P_PIM2.boost( -0.011, 0, 0 );
322 P_KSP.boost( -0.011, 0, 0 );
323 P_KSM.boost( -0.011, 0, 0 );
324 // pddd = P_KSP + P_KSM + P_PIP2 + P_PIM2;
325 pddd = p4kstag + P_PIP2 + P_PIM2;
326
327 double pk0pipi = pddd.rho();
328
329 double temp1 = ( ecms / 2 ) * ( ecms / 2 ) - pk0pipi * pk0pipi;
330 if ( temp1 < 0 ) temp1 = 0;
331 double mass_bc_tem = sqrt( temp1 );
332 if ( mass_bc_tem < 1.82 || mass_bc_tem > 1.89 ) continue;
333
334 double delE_tag_tag = ecms / 2 - pddd.e();
335
336 if ( fabs( delE_tag_tag ) < deltaE_tem )
337 {
338 deltaE_tem = fabs( delE_tag_tag );
339 delE_tag_temp = delE_tag_tag;
340 mass_bcgg = mass_bc_tem;
341
342 pddd_temp = pddd;
343
344 ipi1_temp = ipi1;
345 ipi2_temp = ipi2;
346 ipi3_temp = ipi3;
347 ipi4_temp = ipi4;
348
349 ncount1 = 1;
350 }
351 }
352 }
353 }
354 }
355
356 if ( ncount1 == 1 )
357 {
358 tagmode = 14;
359 if ( m_chargetag < 0 ) tagmode = -14;
360 tagmd = tagmode;
361 mass_bc = mass_bcgg;
362 delE_tag = delE_tag_temp;
363 cqtm = 0.0;
364
365 iGoodtag.push_back( ipi1_temp );
366 iGoodtag.push_back( ipi2_temp );
367 iGoodtag.push_back( ipi3_temp );
368 iGoodtag.push_back( ipi4_temp );
369 iGamtag.push_back( 9999 );
370 iGamtag.push_back( 9999 );
371 iGamtag.push_back( 9999 );
372 iGamtag.push_back( 9999 );
373
374 ptag = pddd_temp;
375
376 k0pipimd = true;
377 }
378}
HepGeom::Point3D< double > HepPoint3D
int runNo
Definition DQA_TO_DB.cxx:13
EvtRecTrackCol::iterator EvtRecTrackIterator
const double xmass[5]
Definition Gam4pikp.cxx:35
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 setPrimaryVertex(const VertexParameter vpar)
static SecondVertexFit * instance()
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition TrackPool.cxx:21
WTrackParameter wtrk(int n) const
WTrackParameter wVirtualTrack(int n) const
void init()
Definition VertexFit.cxx:27
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
Definition VertexFit.cxx:85
static VertexFit * instance()
Definition VertexFit.cxx:15
void BuildVirtualParticle(int number)
bool Fit()
const double ecms
Definition inclkstar.cxx:26

Referenced by Sing::Mdset().


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