BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
Kk Class Reference

#include <Kk.h>

Public Member Functions

 Kk ()
 
 ~Kk ()
 
bool Getkkmd ()
 
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 Kk.h.

Constructor & Destructor Documentation

◆ Kk()

Kk::Kk ( )

Definition at line 26 of file Kk.cxx.

27{}

◆ ~Kk()

Kk::~Kk ( )

Definition at line 29 of file Kk.cxx.

30{}

Member Function Documentation

◆ GetCQtm()

double Kk::GetCQtm ( )
inline

Definition at line 30 of file Kk.h.

30{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double Kk::GetdelE_tag ( )
inline

Definition at line 31 of file Kk.h.

31{ return delE_tag; }

Referenced by Sing::Mdset().

◆ Getkkmd()

bool Kk::Getkkmd ( )
inline

Definition at line 27 of file Kk.h.

27{ return kkmd; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double Kk::Getmass_bc ( )
inline

Definition at line 29 of file Kk.h.

29{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint Kk::GettagGam1 ( )
inline

Definition at line 34 of file Kk.h.

34{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double Kk::Gettagmd ( )
inline

Definition at line 28 of file Kk.h.

28{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector Kk::Gettagp1 ( )
inline

Definition at line 33 of file Kk.h.

33{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint Kk::Gettagtrk1 ( )
inline

Definition at line 32 of file Kk.h.

32{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

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

34{
35
36 int nGood=iGood.size();
37 int nGam=iGam.size();
38
39 iGoodtag.clear();
40 iGamtag.clear();
41
42 double mass_bcgg, delE_tag_temp;
43 int m_chargetag, m_chargek1,m_chargek2;
44 int ika1_temp,ika2_temp,ipi2_temp,ipi3_temp;
45 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
46
47 HepLorentzVector pddd_temp;
48 IDataProviderSvc* eventSvc = NULL;
49 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
50 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
51 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
52
53 int runNo=eventHeader->runNumber();
54 int rec=eventHeader->eventNumber();
55
56 double xecm=2*Ebeam;
57
58 kkmd=false;
59 double tagmode=0;
60
61 if((evtRecEvent->totalCharged() < 2)){ return; }
62
63 double ecms = xecm;
64
65 ISimplePIDSvc* simple_pid;
66 Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
67
68 double deltaE_tem = 0.20;
69 int ncount1 = 0;
70
71 Hep3Vector xorigin(0,0,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
83 double xv=xorigin.x();
84 double yv=xorigin.y();
85 double zv=xorigin.z();
86
87 HepPoint3D point0(0.,0.,0.);
88 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
89 //////////////////////////////////////////////////////////////////
90
91 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
92 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
93
94 int ika1= (*itTrk)->trackId();
95
96 if(!(*itTrk)->isMdcKalTrackValid()) continue;
97 RecMdcKalTrack* mdcKalTrk1 = (*itTrk)->mdcKalTrack();
99
100 m_chargek1=mdcKalTrk1->charge();
101 if(m_chargek1 != 1) continue;
102
103 /////////////////////////////////////////
104 HepVector a1 = mdcKalTrk1->getZHelixK();
105 HepSymMatrix Ea1 = mdcKalTrk1->getZErrorK();
106
107 VFHelix helixip3_1(point0,a1,Ea1);
108 helixip3_1.pivot(IP);
109 HepVector vecipa1 = helixip3_1.a();
110
111 double dr1 = fabs(vecipa1[0]);
112 double dz1 = fabs(vecipa1[3]);
113 double costheta1 = cos(mdcKalTrk1->theta());
114
115 if ( dr1 >= 1.0) continue;
116 if ( dz1 >= 10.0) continue;
117 if ( fabs(costheta1) >= 0.93) continue;
118 /////////////////////////////////////////
119 if(PID_flag == 5) {
120 simple_pid->preparePID(*itTrk);
121 if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;
122 }
123 /////////////////////////////////////////
124 WTrackParameter kap(xmass[3],mdcKalTrk1->getZHelixK(),mdcKalTrk1->getZErrorK() );
125
126 //
127 // select K2
128 //
129 for(int j = 0; j< evtRecEvent->totalCharged();j++) {
130 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
131
132 int ika2= (*itTrk)->trackId();
133 if(ika1==ika2) continue;
134
135 if(!(*itTrk)->isMdcKalTrackValid()) continue;
136 RecMdcKalTrack* mdcKalTrk2 = (*itTrk)->mdcKalTrack();
138
139 m_chargek2=mdcKalTrk2->charge();
140 if((m_chargek1 + m_chargek2) != 0) continue;
141
142 /////////////////////////////////////////
143 HepVector a2 = mdcKalTrk2->getZHelixK();
144 HepSymMatrix Ea2 = mdcKalTrk2->getZErrorK();
145 VFHelix helixip3_2(point0,a2,Ea2);
146 helixip3_2.pivot(IP);
147 HepVector vecipa2 = helixip3_2.a();
148
149 double dr2 = fabs(vecipa2[0]);
150 double dz2 = fabs(vecipa2[3]);
151 double costheta2 = cos(mdcKalTrk2->theta());
152 if ( dr2 >= 1.0) continue;
153 if ( dz2 >= 10.0) continue;
154 if ( fabs(costheta2) >= 0.93) continue;
155 /////////////////////////////////////////
156 if(PID_flag == 5) {
157 simple_pid->preparePID(*itTrk);
158 if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;
159 }
160 /////////////////////////////////////////
161 WTrackParameter kam(xmass[3],mdcKalTrk2->getZHelixK(),mdcKalTrk2->getZErrorK() );
162
163 // all loop for the charged tracks overed here !!!!!!!
164
165 //////////////////////////////////////////////////////////////
166 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
167 HepSymMatrix Evx(3, 0);
168 double bx = 1E+6; Evx[0][0] = bx*bx;
169 double by = 1E+6; Evx[1][1] = by*by;
170 double bz = 1E+6; Evx[2][2] = bz*bz;
171 VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
172 //////////////////////////////////////////////////////////////
173
174 VertexFit* vtxfit = VertexFit::instance();
175 vtxfit->init();
176 vtxfit->AddTrack(0, kap);
177 vtxfit->AddTrack(1, kam);
178 vtxfit->AddVertex(0, vxpar, 0, 1);
179 if(!vtxfit->Fit(0)) continue;
180 vtxfit->Swim(0);
181
182 WTrackParameter wkap = vtxfit->wtrk(0);
183 WTrackParameter wkam = vtxfit->wtrk(1);
184
185 HepVector kap_val = HepVector(7,0);
186 kap_val = wkap.w();
187 HepVector kam_val = HepVector(7,0);
188 kam_val = wkam.w();
189
190 HepLorentzVector P_KAP(kap_val[0],kap_val[1],kap_val[2],kap_val[3]);
191 HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
192
193 P_KAP.boost(-0.011,0,0);
194 P_KAM.boost(-0.011,0,0);
195 pddd = P_KAP + P_KAM;
196
197 double pkk=pddd.rho();
198
199 double temp1 = (ecms/2)*(ecms/2)-pkk*pkk;
200 if(temp1<0) temp1 =0;
201 double mass_bc_tem = sqrt(temp1);
202 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
203
204 double delE_tag_tag = ecms/2-pddd.e();
205
206 if(fabs(delE_tag_tag)<deltaE_tem){
207 deltaE_tem = fabs(delE_tag_tag);
208 delE_tag_temp = delE_tag_tag;
209 mass_bcgg = mass_bc_tem;
210
211 pddd_temp = pddd;
212 ika1_temp=ika1;
213 ika2_temp=ika2;
214 ncount1 = 1;
215 }
216 }
217 }
218
219 if(ncount1 == 1){
220 tagmode=15;
221 if(m_chargetag<0) tagmode=-15;
222 tagmd=tagmode;
223 mass_bc = mass_bcgg;
224 delE_tag = delE_tag_temp;
225 cqtm = -0.0;
226
227 iGoodtag.push_back(ika1_temp);
228 iGoodtag.push_back(ika2_temp);
229 iGamtag.push_back(9999);
230 iGamtag.push_back(9999);
231 iGamtag.push_back(9999);
232 iGamtag.push_back(9999);
233
234 ptag = pddd_temp;
235
236 kkmd = true;
237 }
238}
double cos(const BesAngle a)
Definition: BesAngle.h:213
int runNo
EvtRecTrackCol::iterator EvtRecTrackIterator
Definition: EvtRecTrack.h:111
const double xmass[5]
Definition: Gam4pikp.cxx:50
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
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:78
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:58
bool Fit()
Definition: VertexFit.cxx:301
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: