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

#include <K3pi.h>

Public Member Functions

 K3pi ()
 ~K3pi ()
bool Getk3pimd ()
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 K3pi.h.

Constructor & Destructor Documentation

◆ K3pi()

K3pi::K3pi ( )

Definition at line 28 of file K3pi.cxx.

28{}

◆ ~K3pi()

K3pi::~K3pi ( )

Definition at line 30 of file K3pi.cxx.

30{}

Member Function Documentation

◆ GetCQtm()

double K3pi::GetCQtm ( )
inline

Definition at line 29 of file K3pi.h.

29{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double K3pi::GetdelE_tag ( )
inline

Definition at line 30 of file K3pi.h.

30{ return delE_tag; }

Referenced by Sing::Mdset().

◆ Getk3pimd()

bool K3pi::Getk3pimd ( )
inline

Definition at line 26 of file K3pi.h.

26{ return k3pimd; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double K3pi::Getmass_bc ( )
inline

Definition at line 28 of file K3pi.h.

28{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint K3pi::GettagGam1 ( )
inline

Definition at line 33 of file K3pi.h.

33{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double K3pi::Gettagmd ( )
inline

Definition at line 27 of file K3pi.h.

27{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector K3pi::Gettagp1 ( )
inline

Definition at line 32 of file K3pi.h.

32{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint K3pi::Gettagtrk1 ( )
inline

Definition at line 31 of file K3pi.h.

31{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

void K3pi::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 K3pi.cxx.

33 {
34
35 int nGood = iGood.size();
36 int nGam = iGam.size();
37 iGoodtag.clear();
38 iGamtag.clear();
39
40 double mass_bcgg, delE_tag_temp;
41 int m_chargetag, m_chargek, m_chargepi1, m_chargepi2, m_chargepi3;
42 int ika_temp, ipi1_temp, ipi2_temp, ipi3_temp, ipi4_temp;
43 HepLorentzVector kmfit1, kmfit2, kmfit3, kmfit4, pddd;
44
45 int cqtm_temp;
46 HepLorentzVector pddd_temp;
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 k3pimd = 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 IVertexDbSvc* vtxsvc;
72 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc );
73 if ( vtxsvc->isVertexValid() )
74 {
75 double* dbv = vtxsvc->PrimaryVertex();
76 double* vv = vtxsvc->SigmaPrimaryVertex();
77 xorigin.setX( dbv[0] );
78 xorigin.setY( dbv[1] );
79 xorigin.setZ( dbv[2] );
80 }
81
82 double xv = xorigin.x();
83 double yv = xorigin.y();
84 double zv = xorigin.z();
85
86 HepPoint3D point0( 0., 0., 0. );
87 HepPoint3D IP( xorigin[0], xorigin[1], xorigin[2] );
88
89 HepLorentzVector ptrk1_temp, ptrk2_temp, ptrk3_temp, ptrk4_temp;
90 //////////////////////////////////////////////////////////////////
91 for ( int i = 0; i < evtRecEvent->totalCharged(); i++ )
92 {
93 EvtRecTrackIterator itTrk1 = evtRecTrkCol->begin() + i;
94
95 int ika = ( *itTrk1 )->trackId();
96
97 if ( !( *itTrk1 )->isMdcKalTrackValid() ) continue;
98 RecMdcKalTrack* mdcKalTrk1 = ( *itTrk1 )->mdcKalTrack();
100 /////////////////////////////////////////
101 m_chargek = mdcKalTrk1->charge();
102 if ( Charge_candidate_D != 0 )
103 {
104 if ( m_chargek != -Charge_candidate_D ) continue;
105 }
106 if ( Charge_candidate_D == 0 )
107 {
108 if ( abs( m_chargek ) != 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 {
128 simple_pid->preparePID( *itTrk1 );
129 if ( simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion() )
130 continue;
131 }
132 /////////////////////////////////////////
133 WTrackParameter kam( xmass[3], mdcKalTrk1->getZHelixK(), mdcKalTrk1->getZErrorK() );
134
135 //
136 // select pi1
137 //
138 for ( int j = 0; j < evtRecEvent->totalCharged(); j++ )
139 {
140 EvtRecTrackIterator itTrk2 = evtRecTrkCol->begin() + j;
141
142 int ipi1 = ( *itTrk2 )->trackId();
143 if ( ipi1 == ika ) continue;
144
145 if ( !( *itTrk2 )->isMdcKalTrackValid() ) continue;
146 RecMdcKalTrack* mdcKalTrk2 = ( *itTrk2 )->mdcKalTrack();
148 /////////////////////////////////////////
149 m_chargepi1 = mdcKalTrk2->charge();
150 if ( ( m_chargek + m_chargepi1 ) != 0 ) continue;
151 /////////////////////////////////////////
152 HepVector a2 = mdcKalTrk2->getZHelix();
153 HepSymMatrix Ea2 = mdcKalTrk2->getZError();
154 VFHelix helixip3_2( point0, a2, Ea2 );
155 helixip3_2.pivot( IP );
156 HepVector vecipa2 = helixip3_2.a();
157
158 double dr2 = fabs( vecipa2[0] );
159 double dz2 = fabs( vecipa2[3] );
160 double costheta2 = cos( mdcKalTrk2->theta() );
161 if ( dr2 >= 1.0 ) continue;
162 if ( dz2 >= 10.0 ) continue;
163 if ( fabs( costheta2 ) >= 0.93 ) continue;
164 /////////////////////////////////////////
165 if ( PID_flag == 5 )
166 {
167 simple_pid->preparePID( *itTrk2 );
168 if ( simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon() )
169 continue;
170 }
171 /////////////////////////////////////////
172 WTrackParameter pip1( xmass[2], mdcKalTrk2->getZHelix(), mdcKalTrk2->getZError() );
173
174 //
175 // select pi2
176 //
177 for ( int k = 0; k < evtRecEvent->totalCharged(); k++ )
178 {
179 EvtRecTrackIterator itTrk3 = evtRecTrkCol->begin() + k;
180
181 int ipi2 = ( *itTrk3 )->trackId();
182 if ( ipi2 == ika || ipi2 == ipi1 ) continue;
183
184 if ( !( *itTrk3 )->isMdcKalTrackValid() ) continue;
185 RecMdcKalTrack* mdcKalTrk3 = ( *itTrk3 )->mdcKalTrack();
187 /////////////////////////////////////////
188 m_chargepi2 = mdcKalTrk3->charge();
189 if ( ( m_chargek + m_chargepi2 ) != 0 ) continue;
190 /////////////////////////////////////////
191 HepVector a3 = mdcKalTrk3->getZHelix();
192 HepSymMatrix Ea3 = mdcKalTrk3->getZError();
193 VFHelix helixip3_3( point0, a3, Ea3 );
194 helixip3_3.pivot( IP );
195 HepVector vecipa3 = helixip3_3.a();
196
197 double dr3 = fabs( vecipa3[0] );
198 double dz3 = fabs( vecipa3[3] );
199 double costheta3 = cos( mdcKalTrk3->theta() );
200 if ( dr3 >= 1.0 ) continue;
201 if ( dz3 >= 10.0 ) continue;
202 if ( fabs( costheta3 ) >= 0.93 ) continue;
203 /////////////////////////////////////////
204 if ( PID_flag == 5 )
205 {
206 simple_pid->preparePID( *itTrk3 );
207 if ( simple_pid->probPion() < 0.0 ||
208 simple_pid->probPion() < simple_pid->probKaon() )
209 continue;
210 }
211 /////////////////////////////////////////
212 WTrackParameter pip2( xmass[2], mdcKalTrk3->getZHelix(), mdcKalTrk3->getZError() );
213
214 //
215 // select pi3
216 //
217 for ( int l = 0; l < evtRecEvent->totalCharged(); l++ )
218 {
219 EvtRecTrackIterator itTrk4 = evtRecTrkCol->begin() + l;
220
221 int ipi3 = ( *itTrk4 )->trackId();
222 if ( ipi3 == ika || ipi3 == ipi1 || ipi3 == ipi2 ) continue;
223
224 if ( !( *itTrk4 )->isMdcKalTrackValid() ) continue;
225 RecMdcKalTrack* mdcKalTrk4 = ( *itTrk4 )->mdcKalTrack();
227 /////////////////////////////////////////
228 m_chargepi3 = mdcKalTrk4->charge();
229 if ( ( m_chargepi2 + m_chargepi3 ) != 0 ) continue;
230 /////////////////////////////////////////
231 HepVector a4 = mdcKalTrk4->getZHelix();
232 HepSymMatrix Ea4 = mdcKalTrk4->getZError();
233 VFHelix helixip3_4( point0, a4, Ea4 );
234 helixip3_4.pivot( IP );
235 HepVector vecipa4 = helixip3_4.a();
236
237 double dr4 = fabs( vecipa4[0] );
238 double dz4 = fabs( vecipa4[3] );
239 double costheta4 = cos( mdcKalTrk4->theta() );
240 if ( dr4 >= 1.0 ) continue;
241 if ( dz4 >= 10.0 ) continue;
242 if ( fabs( costheta4 ) >= 0.93 ) continue;
243 /////////////////////////////////////////
244 if ( PID_flag == 5 )
245 {
246 simple_pid->preparePID( *itTrk4 );
247 if ( simple_pid->probPion() < 0.0 ||
248 simple_pid->probPion() < simple_pid->probKaon() )
249 continue;
250 }
251 /////////////////////////////////////////
252 WTrackParameter pip3( xmass[2], mdcKalTrk4->getZHelix(), mdcKalTrk4->getZError() );
253
254 //////////////////////////////////////////////////////////////
255 HepPoint3D vx( xorigin.x(), xorigin.y(), xorigin.z() );
256 HepSymMatrix Evx( 3, 0 );
257 double bx = 1E+6;
258 Evx[0][0] = bx * bx;
259 double by = 1E+6;
260 Evx[1][1] = by * by;
261 double bz = 1E+6;
262 Evx[2][2] = bz * bz;
263 VertexParameter vxpar;
264 vxpar.setVx( vx );
265 vxpar.setEvx( Evx );
266 //////////////////////////////////////////////////////////////
267
268 VertexFit* vtxfit = VertexFit::instance();
269 vtxfit->init();
270 vtxfit->AddTrack( 0, kam );
271 vtxfit->AddTrack( 1, pip1 );
272 vtxfit->AddTrack( 2, pip2 );
273 vtxfit->AddTrack( 3, pip3 );
274 vtxfit->AddVertex( 0, vxpar, 0, 1, 2, 3 );
275 if ( !vtxfit->Fit( 0 ) ) continue;
276 vtxfit->Swim( 0 );
277
278 WTrackParameter wkam = vtxfit->wtrk( 0 );
279 WTrackParameter wpip1 = vtxfit->wtrk( 1 );
280 WTrackParameter wpip2 = vtxfit->wtrk( 2 );
281 WTrackParameter wpip3 = vtxfit->wtrk( 3 );
282
283 HepVector kam_val = HepVector( 7, 0 );
284 HepVector pip1_val = HepVector( 7, 0 );
285 HepVector pip2_val = HepVector( 7, 0 );
286 HepVector pip3_val = HepVector( 7, 0 );
287 kam_val = wkam.w();
288 pip1_val = wpip1.w();
289 pip2_val = wpip2.w();
290 pip3_val = wpip3.w();
291
292 HepLorentzVector P_KAM( kam_val[0], kam_val[1], kam_val[2], kam_val[3] );
293 HepLorentzVector P_PIP1( pip1_val[0], pip1_val[1], pip1_val[2], pip1_val[3] );
294 HepLorentzVector P_PIP2( pip2_val[0], pip2_val[1], pip2_val[2], pip2_val[3] );
295 HepLorentzVector P_PIP3( pip3_val[0], pip3_val[1], pip3_val[2], pip3_val[3] );
296
297 P_KAM.boost( -0.011, 0, 0 );
298 P_PIP1.boost( -0.011, 0, 0 );
299 P_PIP2.boost( -0.011, 0, 0 );
300 P_PIP3.boost( -0.011, 0, 0 );
301 pddd = P_KAM + P_PIP1 + P_PIP2 + P_PIP3;
302
303 double pk3pi = pddd.rho();
304
305 double temp1 = ( ecms / 2 ) * ( ecms / 2 ) - pk3pi * pk3pi;
306 if ( temp1 < 0 ) temp1 = 0;
307 double mass_bc_tem = sqrt( temp1 );
308 if ( mass_bc_tem < 1.82 || mass_bc_tem > 1.89 ) continue;
309
310 double delE_tag_tag = ecms / 2 - pddd.e();
311
312 if ( fabs( delE_tag_tag ) < deltaE_tem )
313 {
314 deltaE_tem = fabs( delE_tag_tag );
315 delE_tag_temp = delE_tag_tag;
316 mass_bcgg = mass_bc_tem;
317
318 pddd_temp = pddd;
319 cqtm_temp = m_chargek;
320
321 ika_temp = ika;
322 ipi1_temp = ipi1;
323 ipi2_temp = ipi2;
324 ipi3_temp = ipi3;
325 ncount1 = 1;
326 }
327 }
328 }
329 }
330 }
331
332 if ( ncount1 == 1 )
333 {
334 tagmode = 13;
335 if ( cqtm_temp < 0 ) tagmode = -13;
336 tagmd = tagmode;
337 mass_bc = mass_bcgg;
338 delE_tag = delE_tag_temp;
339 cqtm = -1.0 * cqtm_temp;
340
341 iGoodtag.push_back( ika_temp );
342 iGoodtag.push_back( ipi1_temp );
343 iGoodtag.push_back( ipi2_temp );
344 iGoodtag.push_back( ipi3_temp );
345
346 iGamtag.push_back( 9999 );
347 iGamtag.push_back( 9999 );
348 iGamtag.push_back( 9999 );
349 iGamtag.push_back( 9999 );
350
351 ptag = pddd_temp;
352
353 k3pimd = true;
354 }
355}
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 AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition TrackPool.cxx:21
WTrackParameter wtrk(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
bool Fit()
const double ecms
Definition inclkstar.cxx:26

Referenced by Sing::Mdset().


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