BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Pipi Class Reference

#include <Pipi.h>

Public Member Functions

 Pipi ()
 
 ~Pipi ()
 
bool GetPipimd ()
 
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)
 
 Pipi ()
 
 ~Pipi ()
 
bool GetPipimd ()
 
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

Constructor & Destructor Documentation

◆ Pipi() [1/2]

Pipi::Pipi ( )

Definition at line 28 of file Pipi.cxx.

29{}

◆ ~Pipi() [1/2]

Pipi::~Pipi ( )

Definition at line 31 of file Pipi.cxx.

32{}

◆ Pipi() [2/2]

Pipi::Pipi ( )

◆ ~Pipi() [2/2]

Pipi::~Pipi ( )

Member Function Documentation

◆ GetCQtm() [1/2]

double Pipi::GetCQtm ( )
inline

Definition at line 30 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

30{ return cqtm; }

Referenced by Sing::Mdset().

◆ GetCQtm() [2/2]

double Pipi::GetCQtm ( )
inline

Definition at line 30 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

30{ return cqtm; }

◆ GetdelE_tag() [1/2]

double Pipi::GetdelE_tag ( )
inline

Definition at line 31 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

31{ return delE_tag; }

Referenced by Sing::Mdset().

◆ GetdelE_tag() [2/2]

double Pipi::GetdelE_tag ( )
inline

Definition at line 31 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

31{ return delE_tag; }

◆ Getmass_bc() [1/2]

double Pipi::Getmass_bc ( )
inline

Definition at line 29 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

29{ return mass_bc; }

Referenced by Sing::Mdset().

◆ Getmass_bc() [2/2]

double Pipi::Getmass_bc ( )
inline

Definition at line 29 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

29{ return mass_bc; }

◆ GetPipimd() [1/2]

bool Pipi::GetPipimd ( )
inline

Definition at line 27 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

27{ return pipimd; }

Referenced by Sing::Mdset().

◆ GetPipimd() [2/2]

bool Pipi::GetPipimd ( )
inline

Definition at line 27 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

27{ return pipimd; }

◆ GettagGam1() [1/2]

Vint Pipi::GettagGam1 ( )
inline

Definition at line 34 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

34{ return iGamtag; }

Referenced by Sing::Mdset().

◆ GettagGam1() [2/2]

Vint Pipi::GettagGam1 ( )
inline

Definition at line 34 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

34{ return iGamtag; }

◆ Gettagmd() [1/2]

double Pipi::Gettagmd ( )
inline

Definition at line 28 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

28{ return tagmd; }

Referenced by Sing::Mdset().

◆ Gettagmd() [2/2]

double Pipi::Gettagmd ( )
inline

Definition at line 28 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

28{ return tagmd; }

◆ Gettagp1() [1/2]

HepLorentzVector Pipi::Gettagp1 ( )
inline

Definition at line 33 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

33{ return ptag; }

Referenced by Sing::Mdset().

◆ Gettagp1() [2/2]

HepLorentzVector Pipi::Gettagp1 ( )
inline

Definition at line 33 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

33{ return ptag; }

◆ Gettagtrk1() [1/2]

Vint Pipi::Gettagtrk1 ( )
inline

Definition at line 32 of file InstallArea/include/SD0TagAlg/SD0TagAlg/Pipi.h.

32{ return iGoodtag; }

Referenced by Sing::Mdset().

◆ Gettagtrk1() [2/2]

Vint Pipi::Gettagtrk1 ( )
inline

Definition at line 32 of file Reconstruction/SD0TagAlg/SD0TagAlg-00-00-03/SD0TagAlg/Pipi.h.

32{ return iGoodtag; }

◆ MTotal() [1/2]

void Pipi::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 Pipi.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,ipi3_temp;
48 HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
49
50 HepLorentzVector pddd_temp;
51 IDataProviderSvc* eventSvc = NULL;
52 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
53 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
54 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
55
56 int runNo=eventHeader->runNumber();
57 int rec=eventHeader->eventNumber();
58
59 double xecm=2*Ebeam;
60
61 pipimd=false;
62 double tagmode=0;
63
64 if((evtRecEvent->totalCharged() < 2)){ return; }
65
66 double ecms = xecm;
67
68 ISimplePIDSvc* simple_pid;
69 Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
70
71 double deltaE_tem = 0.20;
72 int ncount1 = 0;
73
74 Hep3Vector xorigin(0,0,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
86 double xv=xorigin.x();
87 double yv=xorigin.y();
88 double zv=xorigin.z();
89
90 HepPoint3D point0(0.,0.,0.);
91 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
92 //////////////////////////////////////////////////////////////////
93 for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
94 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
95
96 int ipi1= (*itTrk)->trackId();
97
98 if(!(*itTrk)->isMdcKalTrackValid()) continue;
99 RecMdcKalTrack* mdcKalTrk1 = (*itTrk)->mdcKalTrack();
101
102 m_chargepi1=mdcKalTrk1->charge();
103 if(abs(m_chargepi1) != 1) continue;
104
105 /////////////////////////////////////////
106 HepVector a1 = mdcKalTrk1->getZHelix();
107 HepSymMatrix Ea1 = mdcKalTrk1->getZError();
108
109 VFHelix helixip3_1(point0,a1,Ea1);
110 helixip3_1.pivot(IP);
111 HepVector vecipa1 = helixip3_1.a();
112
113 double dr1 = fabs(vecipa1[0]);
114 double dz1 = fabs(vecipa1[3]);
115 double costheta1 = cos(mdcKalTrk1->theta());
116
117 if ( dr1 >= 1.0) continue;
118 if ( dz1 >= 10.0) continue;
119 if ( fabs(costheta1) >= 0.93) continue;
120 /////////////////////////////////////////
121 if(PID_flag == 5) {
122 simple_pid->preparePID(*itTrk);
123 if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;
124 }
125 /////////////////////////////////////////
126 WTrackParameter pip(xmass[2],mdcKalTrk1->getZHelix(),mdcKalTrk1->getZError());
127
128 //
129 // select Pi2
130 //
131 for(int j = 0; j< evtRecEvent->totalCharged();j++) {
132 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
133
134 int ipi2= (*itTrk)->trackId();
135 if(ipi1==ipi2) continue;
136
137 if(!(*itTrk)->isMdcKalTrackValid()) continue;
138 RecMdcKalTrack* mdcKalTrk2 = (*itTrk)->mdcKalTrack();
140
141 m_chargepi2=mdcKalTrk2->charge();
142 if((m_chargepi1 + m_chargepi2) != 0) continue;
143
144 /////////////////////////////////////////
145 HepVector a2 = mdcKalTrk2->getZHelix();
146 HepSymMatrix Ea2 = mdcKalTrk2->getZError();
147 VFHelix helixip3_2(point0,a2,Ea2);
148 helixip3_2.pivot(IP);
149 HepVector vecipa2 = helixip3_2.a();
150
151 double dr2 = fabs(vecipa2[0]);
152 double dz2 = fabs(vecipa2[3]);
153 double costheta2 = cos(mdcKalTrk2->theta());
154 if ( dr2 >= 1.0) continue;
155 if ( dz2 >= 10.0) continue;
156 if ( fabs(costheta2) >= 0.93) continue;
157 /////////////////////////////////////////
158 if(PID_flag == 5) {
159 simple_pid->preparePID(*itTrk);
160 if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;
161 }
162 /////////////////////////////////////////
163 WTrackParameter pim(xmass[2],mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError());
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, pip);
177 vtxfit->AddTrack(1, pim);
178 vtxfit->AddVertex(0, vxpar, 0, 1);
179 if(!vtxfit->Fit(0)) continue;
180 vtxfit->Swim(0);
181
182 WTrackParameter wpip = vtxfit->wtrk(0);
183 WTrackParameter wpim = vtxfit->wtrk(1);
184
185 HepVector pip_val = HepVector(7,0);
186 pip_val = wpip.w();
187 HepVector pim_val = HepVector(7,0);
188 pim_val = wpim.w();
189
190 HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
191 HepLorentzVector P_PIM(pim_val[0],pim_val[1],pim_val[2],pim_val[3]);
192
193 P_PIP.boost(-0.011,0,0);
194 P_PIM.boost(-0.011,0,0);
195 pddd = P_PIP + P_PIM;
196
197 double ppipi = pddd.rho();
198
199 double temp1 = (ecms/2)*(ecms/2)-ppipi*ppipi;
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
213 ipi1_temp=ipi1;
214 ipi2_temp=ipi2;
215
216 ncount1 = 1;
217 }
218 }
219 }
220
221 if(ncount1 == 1){
222 tagmode=19;
223 if(m_chargetag<0) tagmode=-19;
224 tagmd=tagmode;
225 mass_bc = mass_bcgg;
226 delE_tag = delE_tag_temp;
227 cqtm = -0.0;
228
229 iGoodtag.push_back(ipi1_temp);
230 iGoodtag.push_back(ipi2_temp);
231
232 iGamtag.push_back(9999);
233 iGamtag.push_back(9999);
234 iGamtag.push_back(9999);
235 iGamtag.push_back(9999);
236
237 ptag = pddd_temp;
238
239 pipimd=true;
240
241 }
242}
int runNo
Definition: DQA_TO_DB.cxx:12
const double xmass[5]
Definition: Gam4pikp.cxx:50
double cos(const BesAngle a)
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:22
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
bool Fit()
Definition: VertexFit.cxx:301
const double ecms
Definition: inclkstar.cxx:42

Referenced by Sing::Mdset().

◆ MTotal() [2/2]

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

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