Kpi Class Reference

#include <Kpi.h>

List of all members.

Public Member Functions

 Kpi ()
 ~Kpi ()
bool Getkpimd ()
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)

Private Attributes

bool kpimd
double tagmd
double mass_bc
double mass_kf
double cqtm
double delE_tag
Vint iGoodtag
HepLorentzVector ptag
Vint iGamtag


Detailed Description

Definition at line 20 of file Kpi.h.


Constructor & Destructor Documentation

Kpi::Kpi (  ) 

Definition at line 27 of file Kpi.cxx.

00028 {}

Kpi::~Kpi (  ) 

Definition at line 30 of file Kpi.cxx.

00031 {}


Member Function Documentation

double Kpi::GetCQtm (  )  [inline]

Definition at line 30 of file Kpi.h.

References cqtm.

Referenced by Sing::Mdset().

00030 { return cqtm; }

double Kpi::GetdelE_tag (  )  [inline]

Definition at line 31 of file Kpi.h.

References delE_tag.

Referenced by Sing::Mdset().

00031 { return delE_tag; }

bool Kpi::Getkpimd (  )  [inline]

Definition at line 27 of file Kpi.h.

References kpimd.

Referenced by Sing::Mdset().

00027 { return kpimd; }

double Kpi::Getmass_bc (  )  [inline]

Definition at line 29 of file Kpi.h.

References mass_bc.

Referenced by Sing::Mdset().

00029 { return mass_bc; }

Vint Kpi::GettagGam1 (  )  [inline]

Definition at line 34 of file Kpi.h.

References iGamtag.

Referenced by Sing::Mdset().

00034 { return iGamtag; }

double Kpi::Gettagmd (  )  [inline]

Definition at line 28 of file Kpi.h.

References tagmd.

Referenced by Sing::Mdset().

00028 { return tagmd; }

HepLorentzVector Kpi::Gettagp1 (  )  [inline]

Definition at line 33 of file Kpi.h.

References ptag.

Referenced by Sing::Mdset().

00033 { return ptag; }

Vint Kpi::Gettagtrk1 (  )  [inline]

Definition at line 32 of file Kpi.h.

References iGoodtag.

Referenced by Sing::Mdset().

00032 { return iGoodtag; }

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

Definition at line 33 of file Kpi.cxx.

References VFHelix::a(), abs, TrackPool::AddTrack(), VertexFit::AddVertex(), DstMdcKalTrack::charge(), cos(), cqtm, delE_tag, ecms, EventModel::EvtRec::EvtRecEvent, VertexFit::Fit(), RecMdcKalTrack::getZError(), RecMdcKalTrack::getZErrorK(), RecMdcKalTrack::getZHelix(), RecMdcKalTrack::getZHelixK(), genRecEmupikp::i, iGamtag, iGoodtag, VertexFit::init(), VertexFit::instance(), IVertexDbSvc::isVertexValid(), ganga-rec::j, DstMdcKalTrack::kaon, kpimd, mass_bc, DstMdcKalTrack::pion, VFHelix::pivot(), ISimplePIDSvc::preparePID(), IVertexDbSvc::PrimaryVertex(), ISimplePIDSvc::probKaon(), ISimplePIDSvc::probPion(), ptag, runNo, VertexParameter::setEvx(), DstMdcKalTrack::setPidType(), VertexParameter::setVx(), IVertexDbSvc::SigmaPrimaryVertex(), VertexFit::Swim(), tagmd, DstMdcKalTrack::theta(), WTrackParameter::w(), VertexFit::wtrk(), and xmass.

Referenced by Sing::Mdset().

00035 {
00036 
00037   int nGood=iGood.size();
00038   int nGam=iGam.size();
00039 
00040   iGoodtag.clear();
00041   iGamtag.clear();
00042   
00043   double mass_bcgg, delE_tag_temp;
00044   int m_chargetag, m_chargek,m_chargepi;
00045   int ika_temp,ipi_temp,ipi2_temp,ipi3_temp;
00046   HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
00047 
00048   int cqtm_temp;
00049   HepLorentzVector pddd_temp;
00050   IDataProviderSvc* eventSvc = NULL;
00051   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
00052   SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
00053   SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
00054 
00055   int runNo=eventHeader->runNumber();
00056   int rec=eventHeader->eventNumber();
00057 
00058   double xecm=2*Ebeam;
00059 
00060   kpimd = false;
00061   double  tagmode=0;
00062 
00063   if((evtRecEvent->totalCharged() < 2)){     return;   }
00064 
00065   double ecms = xecm; ;
00066 
00067   ISimplePIDSvc* simple_pid;
00068   Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
00069 
00070   double deltaE_tem = 0.20;
00071   int ncount1 = 0; 
00072 
00073   Hep3Vector xorigin(0,0,0);
00074   IVertexDbSvc*  vtxsvc;
00075   Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
00076   if(vtxsvc->isVertexValid())
00077   {
00078     double* dbv = vtxsvc->PrimaryVertex();
00079     double*  vv = vtxsvc->SigmaPrimaryVertex();
00080     xorigin.setX(dbv[0]);
00081     xorigin.setY(dbv[1]);
00082     xorigin.setZ(dbv[2]);
00083   }
00084 
00085   double xv=xorigin.x();
00086   double yv=xorigin.y();
00087   double zv=xorigin.z();
00088 
00089   HepPoint3D point0(0.,0.,0.);
00090   HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
00091 
00092   HepLorentzVector ptrk1_temp, ptrk2_temp;
00094   for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
00095     EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
00096 
00097     int ika= (*itTrk)->trackId();
00098 
00099     if(!(*itTrk)->isMdcKalTrackValid()) continue;
00100     RecMdcKalTrack*  mdcKalTrk1 = (*itTrk)->mdcKalTrack();
00101     RecMdcKalTrack::setPidType(RecMdcKalTrack::kaon);
00103     m_chargek=mdcKalTrk1->charge();
00104     if(Charge_candidate_D != 0) {
00105       if(m_chargek != -Charge_candidate_D) continue;
00106     }
00107     if(Charge_candidate_D == 0) {
00108       if(abs(m_chargek) != 1) continue;
00109     } 
00111     HepVector a1 = mdcKalTrk1->getZHelixK();
00112     HepSymMatrix Ea1 = mdcKalTrk1->getZErrorK();
00113     VFHelix helixip3_1(point0,a1,Ea1);
00114     helixip3_1.pivot(IP);
00115     HepVector  vecipa1 = helixip3_1.a();
00116 
00117     double dr1 = fabs(vecipa1[0]);
00118     double dz1 = fabs(vecipa1[3]);
00119     double costheta1 = cos(mdcKalTrk1->theta());
00120     if (  dr1 >= 1.0) continue;
00121     if (  dz1 >= 10.0) continue; 
00122     if ( fabs(costheta1) >= 0.93) continue; 
00124     if(PID_flag == 5) {
00125       simple_pid->preparePID(*itTrk);
00126       if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;  
00127     } 
00129 
00130     WTrackParameter kam(xmass[3],mdcKalTrk1->getZHelixK(),mdcKalTrk1->getZErrorK() );
00131 
00132     //  
00133     // select pi
00134     //  
00135     for(int j = 0; j< evtRecEvent->totalCharged();j++) {
00136       EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
00137 
00138       int ipi= (*itTrk)->trackId();
00139       if(ipi==ika)  continue;
00140 
00141       if(!(*itTrk)->isMdcKalTrackValid()) continue;
00142       RecMdcKalTrack*  mdcKalTrk2 = (*itTrk)->mdcKalTrack();
00143       RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00144 
00146       m_chargepi=mdcKalTrk2->charge();
00147       if((m_chargek + m_chargepi) != 0) continue;
00149       HepVector a2 = mdcKalTrk2->getZHelix();
00150       HepSymMatrix Ea2 = mdcKalTrk2->getZError();
00151       VFHelix helixip3_2(point0,a2,Ea2);
00152       helixip3_2.pivot(IP);
00153       HepVector  vecipa2 = helixip3_2.a();
00154 
00155       double dr2 = fabs(vecipa2[0]);
00156       double dz2 = fabs(vecipa2[3]);
00157       double costheta2 = cos(mdcKalTrk2->theta());
00158       if (  dr2 >= 1.0) continue;
00159       if (  dz2 >= 10.0) continue; 
00160       if ( fabs(costheta2) >= 0.93) continue; 
00162       if(PID_flag == 5) {
00163         simple_pid->preparePID(*itTrk);
00164         if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;  
00165       } 
00167 
00168       WTrackParameter pip(xmass[2], mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError() );
00169 
00171       HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
00172       HepSymMatrix Evx(3, 0);
00173       double bx = 1E+6; Evx[0][0] = bx*bx;
00174       double by = 1E+6; Evx[1][1] = by*by;
00175       double bz = 1E+6; Evx[2][2] = bz*bz;
00176       VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
00178 
00179       VertexFit* vtxfit = VertexFit::instance();
00180       vtxfit->init();
00181       vtxfit->AddTrack(0,  kam);
00182       vtxfit->AddTrack(1,  pip);
00183       vtxfit->AddVertex(0, vxpar, 0, 1);
00184       if(!vtxfit->Fit(0))  continue;
00185       vtxfit->Swim(0);
00186 
00187       WTrackParameter wkam = vtxfit->wtrk(0);
00188       WTrackParameter wpip = vtxfit->wtrk(1);
00189 
00190       HepVector kam_val = HepVector(7,0);
00191       kam_val = wkam.w();       
00192       HepVector pip_val = HepVector(7,0);
00193       pip_val = wpip.w();
00194 
00195       HepLorentzVector P_KAM(kam_val[0],kam_val[1],kam_val[2],kam_val[3]);
00196       HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
00197 
00198       P_KAM.boost(-0.011,0,0);
00199       P_PIP.boost(-0.011,0,0);
00200       pddd = P_KAM + P_PIP;   
00201 
00202       double   pkpi=pddd.rho();
00203 
00204       double temp1 = (ecms/2)*(ecms/2)-pkpi*pkpi;
00205       if(temp1<0) temp1 =0;
00206       double mass_bc_tem  = sqrt(temp1);
00207 
00208       if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
00209 
00210       double  delE_tag_tag = ecms/2-pddd.e();
00211 
00212 
00213       if(fabs(delE_tag_tag)<deltaE_tem)  {
00214         deltaE_tem = fabs(delE_tag_tag);
00215         delE_tag_temp = delE_tag_tag;
00216         mass_bcgg = mass_bc_tem;
00217 
00218         pddd_temp = pddd;
00219         cqtm_temp = m_chargek;
00220         ika_temp=ika;
00221         ipi_temp=ipi;
00222         ncount1 = 1;
00223       }   
00224     }
00225   }
00226 
00227   if(ncount1 == 1){
00228     tagmode = 11;
00229     if(cqtm_temp<0)  tagmode=-11;
00230     tagmd = tagmode;
00231     mass_bc  = mass_bcgg;
00232     delE_tag = delE_tag_temp;
00233     cqtm     = -1.0*cqtm_temp; 
00234 
00235     // cqtm = +1 for D0-->K-Pi+; cqtm = -1 for D0-bar-->K+Pi-;
00236     // cqtm = 0 for D0-->K+K- ect. ...; cqtm = 0 means that we do not
00237     // know whether it s D0 or D0-bar decays;
00238 
00239     iGoodtag.push_back(ika_temp);
00240     iGoodtag.push_back(ipi_temp);
00241 
00242     iGamtag.push_back(9999); 
00243     iGamtag.push_back(9999); 
00244     iGamtag.push_back(9999); 
00245     iGamtag.push_back(9999); 
00246 
00247     ptag = pddd_temp; 
00248 
00249     kpimd = true;
00250 
00251   }
00252 }


Member Data Documentation

double Kpi::cqtm [private]

Definition at line 45 of file Kpi.h.

Referenced by GetCQtm(), and MTotal().

double Kpi::delE_tag [private]

Definition at line 46 of file Kpi.h.

Referenced by GetdelE_tag(), and MTotal().

Vint Kpi::iGamtag [private]

Definition at line 49 of file Kpi.h.

Referenced by GettagGam1(), and MTotal().

Vint Kpi::iGoodtag [private]

Definition at line 47 of file Kpi.h.

Referenced by Gettagtrk1(), and MTotal().

bool Kpi::kpimd [private]

Definition at line 41 of file Kpi.h.

Referenced by Getkpimd(), and MTotal().

double Kpi::mass_bc [private]

Definition at line 43 of file Kpi.h.

Referenced by Getmass_bc(), and MTotal().

double Kpi::mass_kf [private]

Definition at line 44 of file Kpi.h.

HepLorentzVector Kpi::ptag [private]

Definition at line 48 of file Kpi.h.

Referenced by Gettagp1(), and MTotal().

double Kpi::tagmd [private]

Definition at line 42 of file Kpi.h.

Referenced by Gettagmd(), and MTotal().


Generated on Tue Nov 29 23:19:59 2016 for BOSS_7.0.2 by  doxygen 1.4.7