BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
Pipipi0 Class Reference

#include <Pipipi0.h>

Public Member Functions

 Pipipi0 ()
 
 ~Pipipi0 ()
 
bool GetPipipi0md ()
 
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 Pipipi0.h.

Constructor & Destructor Documentation

◆ Pipipi0()

Pipipi0::Pipipi0 ( )

Definition at line 28 of file Pipipi0.cxx.

29{}

◆ ~Pipipi0()

Pipipi0::~Pipipi0 ( )

Definition at line 31 of file Pipipi0.cxx.

32{}

Member Function Documentation

◆ GetCQtm()

double Pipipi0::GetCQtm ( )
inline

Definition at line 30 of file Pipipi0.h.

30{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetdelE_tag()

double Pipipi0::GetdelE_tag ( )
inline

Definition at line 31 of file Pipipi0.h.

31{ return delE_tag; }

Referenced by Sing::Mdset().

◆ Getmass_bc()

double Pipipi0::Getmass_bc ( )
inline

Definition at line 29 of file Pipipi0.h.

29{ return mass_bc; }

Referenced by Sing::Mdset().

◆ GetPipipi0md()

bool Pipipi0::GetPipipi0md ( )
inline

Definition at line 27 of file Pipipi0.h.

27{ return pipipi0md; }

Referenced by Sing::Mdset().

◆ GettagGam1()

Vint Pipipi0::GettagGam1 ( )
inline

Definition at line 34 of file Pipipi0.h.

34{ return iGamtag; }

Referenced by Sing::Mdset().

◆ Gettagmd()

double Pipipi0::Gettagmd ( )
inline

Definition at line 28 of file Pipipi0.h.

28{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagp1()

HepLorentzVector Pipipi0::Gettagp1 ( )
inline

Definition at line 33 of file Pipipi0.h.

33{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1()

Vint Pipipi0::Gettagtrk1 ( )
inline

Definition at line 32 of file Pipipi0.h.

32{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ MTotal()

void Pipipi0::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 Pipipi0.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_chargepi1,m_chargepi2;
47 int ipi1_temp, ipi2_temp, iGam1_temp, iGam2_temp;
48 HepLorentzVector pddd, 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 pipipi0md=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 IVertexDbSvc* vtxsvc;
75 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
76 if(vtxsvc->isVertexValid())
77 {
78 double* dbv = vtxsvc->PrimaryVertex();
79 double* vv = vtxsvc->SigmaPrimaryVertex();
80 xorigin.setX(dbv[0]);
81 xorigin.setY(dbv[1]);
82 xorigin.setZ(dbv[2]);
83 }
84
85 double xv=xorigin.x();
86 double yv=xorigin.y();
87 double zv=xorigin.z();
88
89 HepPoint3D point0(0.,0.,0.);
90 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
91 //////////////////////////////////////////////////////////////////
92
93 HepLorentzVector p2gfit;
94 HepLorentzVector p2gg;
95
96 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
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(abs(m_chargepi1) != 1) continue;
107 /////////////////////////////////////////
108 HepVector a1 = mdcKalTrk1->getZHelix();
109 HepSymMatrix Ea1 = mdcKalTrk1->getZError();
110 VFHelix helixip3_1(point0,a1,Ea1);
111 helixip3_1.pivot(IP);
112 HepVector vecipa1 = helixip3_1.a();
113
114 double dr1 = fabs(vecipa1[0]);
115 double dz1 = fabs(vecipa1[3]);
116 double costheta1 = cos(mdcKalTrk1->theta());
117
118 if ( dr1 >= 1.0) continue;
119 if ( dz1 >= 10.0) continue;
120 if ( fabs(costheta1) >= 0.93) continue;
121 /////////////////////////////////////////
122 if(PID_flag == 5) {
123 simple_pid->preparePID(*itTrk);
124 if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;
125 }
126 /////////////////////////////////////////
127 WTrackParameter pip(xmass[2],mdcKalTrk1->getZHelix(),mdcKalTrk1->getZError() );
128
129 //
130 // select pi
131 //
132 for(int j = 0; j< evtRecEvent->totalCharged();j++) {
133 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
134
135 int ipi2= (*itTrk)->trackId();
136 if(ipi1==ipi2) continue;
137
138 if(!(*itTrk)->isMdcKalTrackValid()) continue;
139 RecMdcKalTrack* mdcKalTrk2 = (*itTrk)->mdcKalTrack();
141
142 m_chargepi2=mdcKalTrk2->charge();
143 if((m_chargepi1 + m_chargepi2) != 0) continue;
144
145 /////////////////////////////////////////
146 HepVector a2 = mdcKalTrk2->getZHelix();
147 HepSymMatrix Ea2 = mdcKalTrk2->getZError();
148 VFHelix helixip3_2(point0,a2,Ea2);
149 helixip3_2.pivot(IP);
150 HepVector vecipa2 = helixip3_2.a();
151
152 double dr2 = fabs(vecipa2[0]);
153 double dz2 = fabs(vecipa2[3]);
154 double costheta2 = cos(mdcKalTrk2->theta());
155 if ( dr2 >= 1.0) continue;
156 if ( dz2 >= 10.0) continue;
157 if ( fabs(costheta2) >= 0.93) continue;
158 /////////////////////////////////////////
159
160 if(PID_flag == 5) {
161 simple_pid->preparePID(*itTrk);
162 if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;
163 }
164 /////////////////////////////////////////
165 WTrackParameter pim(xmass[2],mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError() );
166
167 for(int m = 0; m < nGam-1; m++) {
168 if(iGam[m]==-1) continue;
169 int iGam1 = iGam[m];
170 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[m]))->emcShower();
171 double eraw1 = g1Trk->energy();
172 double phi1 = g1Trk->phi();
173 double the1 = g1Trk->theta();
174 HepLorentzVector ptrkg1,ptrkg10,ptrkg12;
175 ptrkg1.setPx(eraw1*sin(the1)*cos(phi1));
176 ptrkg1.setPy(eraw1*sin(the1)*sin(phi1));
177 ptrkg1.setPz(eraw1*cos(the1));
178 ptrkg1.setE(eraw1);
179 ptrkg10 = ptrkg1;
180 ptrkg12 = ptrkg1.boost(-0.011,0,0);
181
182 for(int n = m+1; n < nGam; n++) {
183 if(iGam[n]==-1) continue;
184 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+iGam[n]))->emcShower();
185 int iGam2 = iGam[n];
186 double eraw2 = g2Trk->energy();
187 double phi2 = g2Trk->phi();
188 double the2 = g2Trk->theta();
189 HepLorentzVector ptrkg2,ptrkg20,ptrkg22;
190 ptrkg2.setPx(eraw2*sin(the2)*cos(phi2));
191 ptrkg2.setPy(eraw2*sin(the2)*sin(phi2));
192 ptrkg2.setPz(eraw2*cos(the2));
193 ptrkg2.setE(eraw2);
194 ptrkg20 = ptrkg2;
195 ptrkg22 = ptrkg2.boost(-0.011,0,0);
196
197 /////////////////////////////////////////////////////////////
198 HepLorentzVector ptrkpi0;
199 ptrkpi0 = ptrkg12+ptrkg22;
200 double m_xmpi0_tem = ptrkpi0.m();
201 if(m_xmpi0_tem>0.150||m_xmpi0_tem<0.115) continue;
202 /////////////////////////////////////////////////////////////
203 bool IsEndcap1 = false; bool IsEndcap2 = false;
204 if(fabs(cos(the1)) > 0.86 && fabs(cos(the1)) < 0.92) IsEndcap1 = true;
205 if(fabs(cos(the2)) > 0.86 && fabs(cos(the2)) < 0.92) IsEndcap2 = true;
206 if(IsEndcap1 && IsEndcap2) continue;
207 /////////////////////////////////////////////////////////////
209 kmfit->init();
210 kmfit->setChisqCut(2500);
211 kmfit->AddTrack(0, 0.0, g1Trk);
212 kmfit->AddTrack(1, 0.0, g2Trk);
213 kmfit->AddResonance(0, mpi0, 0, 1);
214
215 kmfit->Fit(0); // Perform fit
216 kmfit->BuildVirtualParticle(0);
217
218 double pi0_chisq = kmfit->chisq(0);
219 if ( pi0_chisq >= 2500) continue;
220 HepLorentzVector p2gfit = kmfit->pfit(0) + kmfit->pfit(1);
221 p2gfit.boost(-0.011,0,0);
222
223 //////////////////////////////////////////////////////////////
224 HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
225 HepSymMatrix Evx(3, 0);
226 double bx = 1E+6; Evx[0][0] = bx*bx;
227 double by = 1E+6; Evx[1][1] = by*by;
228 double bz = 1E+6; Evx[2][2] = bz*bz;
229 VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
230 //////////////////////////////////////////////////////////////
231
232 VertexFit* vtxfit = VertexFit::instance();
233 vtxfit->init();
234 vtxfit->AddTrack(0, pip);
235 vtxfit->AddTrack(1, pim);
236 vtxfit->AddVertex(0, vxpar, 0, 1);
237 if(!vtxfit->Fit(0)) continue;
238 vtxfit->Swim(0);
239
240 WTrackParameter wpip = vtxfit->wtrk(0);
241 WTrackParameter wpim = vtxfit->wtrk(1);
242
243 HepVector pip_val = HepVector(7,0);
244 HepVector pim_val = HepVector(7,0);
245 pip_val = wpip.w();
246 pim_val = wpim.w();
247
248 HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
249 HepLorentzVector P_PIM(pim_val[0],pim_val[1],pim_val[2],pim_val[3]);
250
251 P_PIM.boost(-0.011,0,0);
252 P_PIP.boost(-0.011,0,0);
253 HepLorentzVector ppipi = P_PIM + P_PIP;
254 pddd = P_PIM + P_PIP + p2gfit;
255
256 double mpipi = ppipi.m();
257 //if((mpipi-0.497)<0.020) continue;
258
259 double ppipipi0=pddd.rho();
260
261 double temp1 = (ecms/2)*(ecms/2)-ppipipi0*ppipipi0 ;
262 if(temp1<0) temp1 =0;
263 double mass_bc_tem = sqrt(temp1);
264 if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
265
266 double delE_tag_tag = ecms/2-pddd.e();
267
268 if(fabs(delE_tag_tag)<deltaE_tem) {
269 deltaE_tem = fabs(delE_tag_tag);
270 delE_tag_temp = delE_tag_tag;
271 mass_bcgg = mass_bc_tem;
272
273 pddd_temp = pddd;
274
275 ipi1_temp=ipi1;
276 ipi2_temp=ipi2;
277 iGam1_temp = iGam1;
278 iGam2_temp = iGam2;
279
280 ncount1 = 1;
281 }
282 }
283 }
284 }
285 }
286
287 if(ncount1 == 1){
288 tagmode=16;
289 if(m_chargetag<0) tagmode=-16;
290 tagmd=tagmode;
291 mass_bc = mass_bcgg;
292 delE_tag = delE_tag_temp;
293 cqtm = 0;
294
295 iGoodtag.push_back(ipi1_temp);
296 iGoodtag.push_back(ipi2_temp);
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 pipipi0md=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
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 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()
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
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:116

Referenced by Sing::Mdset().


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