K0kpi Class Reference

#include <K0kpi.h>

List of all members.

Public Member Functions

 K0kpi ()
 ~K0kpi ()
bool Getk0kpimd ()
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 k0kpimd
double tagmd
double mass_bc
double cqtm
double delE_tag
Vint iGoodtag
HepLorentzVector ptag
Vint iGamtag


Detailed Description

Definition at line 20 of file K0kpi.h.


Constructor & Destructor Documentation

K0kpi::K0kpi (  ) 

Definition at line 27 of file K0kpi.cxx.

00028 {}

K0kpi::~K0kpi (  ) 

Definition at line 30 of file K0kpi.cxx.

00031 {}


Member Function Documentation

double K0kpi::GetCQtm (  )  [inline]

Definition at line 30 of file K0kpi.h.

References cqtm.

Referenced by Sing::Mdset().

00030 { return cqtm; }

double K0kpi::GetdelE_tag (  )  [inline]

Definition at line 31 of file K0kpi.h.

References delE_tag.

Referenced by Sing::Mdset().

00031 { return delE_tag; }

bool K0kpi::Getk0kpimd (  )  [inline]

Definition at line 27 of file K0kpi.h.

References k0kpimd.

Referenced by Sing::Mdset().

00027 { return k0kpimd; }

double K0kpi::Getmass_bc (  )  [inline]

Definition at line 29 of file K0kpi.h.

References mass_bc.

Referenced by Sing::Mdset().

00029 { return mass_bc; }

Vint K0kpi::GettagGam1 (  )  [inline]

Definition at line 34 of file K0kpi.h.

References iGamtag.

Referenced by Sing::Mdset().

00034 { return iGamtag; }

double K0kpi::Gettagmd (  )  [inline]

Definition at line 28 of file K0kpi.h.

References tagmd.

Referenced by Sing::Mdset().

00028 { return tagmd; }

HepLorentzVector K0kpi::Gettagp1 (  )  [inline]

Definition at line 33 of file K0kpi.h.

References ptag.

Referenced by Sing::Mdset().

00033 { return ptag; }

Vint K0kpi::Gettagtrk1 (  )  [inline]

Definition at line 32 of file K0kpi.h.

References iGoodtag.

Referenced by Sing::Mdset().

00032 { return iGoodtag; }

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

Definition at line 34 of file K0kpi.cxx.

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

Referenced by Sing::Mdset().

00036 {
00037 
00038   int nGood=iGood.size();
00039   int nGam=iGam.size();
00040 
00041   iGoodtag.clear();
00042   iGamtag.clear();
00043   
00044   double mass_bcgg,delE_tag_temp;
00045   int m_chargetag,m_chargepi1,m_chargepi2,m_chargek,m_chargepi3;
00046   int ik1_temp,ipi1_temp,ipi2_temp,ipi3_temp;
00047   HepLorentzVector pddd;
00048   HepLorentzVector pddd_temp;
00049 
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   k0kpimd=false;
00061   double  tagmode=0;
00062 
00063 
00064   if((evtRecEvent->totalCharged() < 4)){    return;  }
00065 
00066   double ecms = xecm;
00067 
00068   ISimplePIDSvc* simple_pid;
00069   Gaudi::svcLocator()->service("SimplePIDSvc", simple_pid);
00070 
00071   double deltaE_tem = 0.20;
00072   int ncount1 = 0; 
00073 
00074   Hep3Vector xorigin(0,0,0);
00075   HepSymMatrix xoriginEx(3,0);
00076   IVertexDbSvc*  vtxsvc;
00077   Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
00078   if(vtxsvc->isVertexValid())
00079   {
00080     double* dbv = vtxsvc->PrimaryVertex();
00081     double*  vv = vtxsvc->SigmaPrimaryVertex();
00082     xorigin.setX(dbv[0]);
00083     xorigin.setY(dbv[1]);
00084     xorigin.setZ(dbv[2]);
00085 
00086     xoriginEx[0][0] = vv[0] * vv[0];
00087     xoriginEx[1][1] = vv[1] * vv[1];
00088     xoriginEx[2][2] = vv[2] * vv[2];
00089 
00090   }
00091 
00092   double xv=xorigin.x();
00093   double yv=xorigin.y();
00094   double zv=xorigin.z();
00095 
00096   HepPoint3D point0(0.,0.,0.);
00097   HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
00099   for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
00100     EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
00101     
00102     int ipi1= (*itTrk)->trackId();
00103 
00104     if(!(*itTrk)->isMdcKalTrackValid()) continue;
00105     RecMdcKalTrack*  mdcKalTrk1 = (*itTrk)->mdcKalTrack();
00106     RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00107 
00108     m_chargepi1=mdcKalTrk1->charge();
00109     if(m_chargepi1 != 1) continue;
00110     
00112     HepVector a1 = mdcKalTrk1->getZHelix();
00113     HepSymMatrix Ea1 = mdcKalTrk1->getZError();
00114 
00115     VFHelix helixip3_1(point0,a1,Ea1);
00116     helixip3_1.pivot(IP);
00117     HepVector  vecipa1 = helixip3_1.a();
00118 
00119     double dr1 = fabs(vecipa1[0]);
00120     double dz1 = fabs(vecipa1[3]);
00121     double costheta1 = cos(mdcKalTrk1->theta());
00122 
00123     if (  dr1 >= 15.0) continue;
00124     if (  dz1 >= 25.0) continue; 
00125     if ( fabs(costheta1) >= 0.93) continue; 
00127     WTrackParameter pip(xmass[2],mdcKalTrk1->getZHelix(),mdcKalTrk1->getZError() );
00128 
00129     //  
00130     // select pi2
00131     //  
00132     for(int j = 0; j < evtRecEvent->totalCharged(); j++) {
00133       EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
00134 
00135       int ipi2= (*itTrk)->trackId();
00136       if(ipi1==ipi2)  continue;
00137 
00138       if(!(*itTrk)->isMdcKalTrackValid()) continue;
00139       RecMdcKalTrack*  mdcKalTrk2 = (*itTrk)->mdcKalTrack();
00140       RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00141 
00142       m_chargepi2=mdcKalTrk2->charge();
00143       if((m_chargepi2 + m_chargepi1) != 0) continue;
00144       
00146       HepVector a2 = mdcKalTrk2->getZHelix();
00147       HepSymMatrix Ea2 = mdcKalTrk2->getZError();
00148       VFHelix helixip3_2(point0,a2,Ea2);
00149       helixip3_2.pivot(IP);
00150       HepVector  vecipa2 = helixip3_2.a();
00151 
00152       double dr2 = fabs(vecipa2[0]);
00153       double dz2 = fabs(vecipa2[3]);
00154       double costheta2 = cos(mdcKalTrk2->theta());
00155       if (  dr2 >= 15.0) continue;
00156       if (  dz2 >= 25.0) continue; 
00157       if ( fabs(costheta2) >= 0.93) continue; 
00159       WTrackParameter pim(xmass[2],mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError() );
00160 
00161       HepVector pip_val = HepVector(7,0);
00162       HepVector pim_val = HepVector(7,0);
00163       pip_val = pip.w(); 
00164       pim_val = pim.w();
00165       HepLorentzVector ptrktagk0(pip_val[0]+pim_val[0],pip_val[1]+pim_val[1],pip_val[2]+pim_val[2],pip_val[3]+pim_val[3]);
00166       double m_xmtagk0_tem = ptrktagk0.mag();
00167       if(fabs(ptrktagk0.m()-0.498)>0.1) continue;
00168 
00169       HepPoint3D vx(xorigin.x(), xorigin.y(), xorigin.z());
00170       HepSymMatrix Evx(3, 0);
00171       double bx = 1E+6; Evx[0][0] = bx*bx;
00172       double by = 1E+6; Evx[1][1] = by*by;
00173       double bz = 1E+6; Evx[2][2] = bz*bz;
00174       VertexParameter vxpar; vxpar.setVx(vx); vxpar.setEvx(Evx);
00175 
00176       VertexFit *vtxfit0 = VertexFit::instance();
00177       vtxfit0->init();
00178       vtxfit0->AddTrack(0, pip);
00179       vtxfit0->AddTrack(1, pim);
00180       vtxfit0->AddVertex(0, vxpar, 0, 1);
00181       if(!(vtxfit0->Fit(0))) continue;
00182       vtxfit0->Swim(0); 
00183       vtxfit0->BuildVirtualParticle(0);
00184       WTrackParameter wksp = vtxfit0->wtrk(0);
00185       WTrackParameter wksm = vtxfit0->wtrk(1);
00186       WTrackParameter wks_Trk = vtxfit0->wVirtualTrack(0);
00187       VertexParameter wks_var = vtxfit0->vpar(0);
00188       
00189       //select kaon1
00190       //        
00191       for(int k = 0; k < evtRecEvent->totalCharged(); k++) {
00192         EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + k;
00193 
00194         int ik1 = (*itTrk)->trackId();
00195         if(ipi2==ik1 || ipi1==ik1)  continue;
00196 
00197         if(!(*itTrk)->isMdcKalTrackValid()) continue;
00198         RecMdcKalTrack*  mdcKalTrk3 = (*itTrk)->mdcKalTrack();
00199         RecMdcKalTrack::setPidType(RecMdcKalTrack::kaon);
00200 
00201         m_chargek = mdcKalTrk3->charge();
00202         if(abs(m_chargek) != 1) continue;
00203 
00205         HepVector a3 = mdcKalTrk3->getZHelixK();
00206         HepSymMatrix Ea3 = mdcKalTrk3->getZErrorK();
00207         VFHelix helixip3_3(point0,a3,Ea3);
00208         helixip3_3.pivot(IP);
00209         HepVector  vecipa3 = helixip3_3.a();
00210 
00211         double dr3 = fabs(vecipa3[0]);
00212         double dz3 = fabs(vecipa3[3]);
00213         double costheta3 = cos(mdcKalTrk3->theta());
00214         if (  dr3 >= 1.0) continue;
00215         if (  dz3 >= 10.0) continue; 
00216         if ( fabs(costheta3) >= 0.93) continue; 
00218         if(PID_flag == 5) {
00219           simple_pid->preparePID(*itTrk);
00220           if(simple_pid->probKaon() < 0.0 || simple_pid->probKaon() < simple_pid->probPion()) continue;  
00221         } 
00223         WTrackParameter ka(xmass[3],mdcKalTrk3->getZHelixK(),mdcKalTrk3->getZErrorK());
00224 
00225         //
00226         //select pi3
00227         //
00228         for(int l = 0; l < evtRecEvent->totalCharged(); l++) {
00229           EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + l;
00230 
00231           int ipi3= (*itTrk)->trackId();
00232           if(ipi3==ik1 || ipi3==ipi2 || ipi3 ==ipi1)  continue;
00233 
00234           if(!(*itTrk)->isMdcKalTrackValid()) continue;
00235           RecMdcKalTrack*  mdcKalTrk4 = (*itTrk)->mdcKalTrack();
00236           RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00237 
00238           m_chargepi3 = mdcKalTrk4->charge();
00239           if((m_chargepi3 + m_chargek) != 0) continue;
00240 
00242           HepVector a4 = mdcKalTrk4->getZHelix();
00243           HepSymMatrix Ea4 = mdcKalTrk4->getZError();
00244           VFHelix helixip3_4(point0,a4,Ea4);
00245           helixip3_4.pivot(IP);
00246           HepVector  vecipa4 = helixip3_4.a();
00247 
00248           double dr4 = fabs(vecipa4[0]);
00249           double dz4 = fabs(vecipa4[3]);
00250           double costheta4 = cos(mdcKalTrk4->theta());
00251           if (  dr4 >= 1.0) continue;
00252           if (  dz4 >= 10.0) continue; 
00253           if ( fabs(costheta4) >= 0.93) continue; 
00255           if(PID_flag == 5) {
00256             simple_pid->preparePID(*itTrk);
00257             if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;  
00258           } 
00260           WTrackParameter pi(xmass[2],mdcKalTrk4->getZHelix(),mdcKalTrk4->getZError() );
00261 
00262           VertexFit* vtxfit_2 = VertexFit::instance();
00263           vtxfit_2->init();
00264           vtxfit_2->AddTrack(0,  ka);
00265           vtxfit_2->AddTrack(1,  pi);
00266           vtxfit_2->AddVertex(0, vxpar, 0, 1);
00267           if(!vtxfit_2->Fit(0))  continue;
00268           vtxfit_2->Swim(0);
00269 
00270           WTrackParameter wka = vtxfit_2->wtrk(0);
00271           WTrackParameter wpi = vtxfit_2->wtrk(1);
00272 
00273           SecondVertexFit *vtxfit = SecondVertexFit::instance();
00274           vtxfit->init();
00275           vxpar.setEvx(xoriginEx);
00276           vtxfit->setPrimaryVertex(vxpar);
00277           vtxfit->AddTrack(0, wks_Trk);
00278           vtxfit->setVpar(wks_var);
00279           if(!vtxfit->Fit()) continue;
00280           
00281           if(vtxfit->chisq() > 999.) continue;
00282           if(vtxfit->decayLength()<0.0) continue;
00283 
00284           double m_massks1_tem = vtxfit->p4par().m();
00285           if(m_massks1_tem < 0.485 || m_massks1_tem > 0.515)  continue;
00286           HepLorentzVector  p4kstag =  vtxfit->p4par();
00287           WTrackParameter para_ks = vtxfit0->wVirtualTrack(0);
00288 
00289           HepVector ka_val = HepVector(7,0);
00290           HepVector pi_val = HepVector(7,0);
00291           HepVector ksp_val = HepVector(7,0);
00292           HepVector ksm_val = HepVector(7,0);
00293 
00294           ka_val = wka.w();
00295           pi_val = wpi.w();
00296           ksp_val = wksp.w();
00297           ksm_val = wksm.w();
00298 
00299           HepLorentzVector P_KA(ka_val[0],ka_val[1],ka_val[2],ka_val[3]);
00300           HepLorentzVector P_PI(pi_val[0],pi_val[1],pi_val[2],pi_val[3]);
00301           HepLorentzVector P_KSP(ksp_val[0],ksp_val[1],ksp_val[2],ksp_val[3]);
00302           HepLorentzVector P_KSM(ksm_val[0],ksm_val[1],ksm_val[2],ksm_val[3]);
00303           
00304           P_KA.boost(-0.011,0,0);  
00305           P_PI.boost(-0.011,0,0);  
00306           P_KSP.boost(-0.011,0,0);
00307           P_KSM.boost(-0.011,0,0);
00308 
00309           p4kstag.boost(-0.011,0,0);  
00310           //pddd = P_KA + P_PI + P_KSP + P_KSM;
00311           pddd = P_KA + P_PI + p4kstag;
00312 
00313           double pk0kpi=pddd.rho();
00314 
00315           double temp1 = (ecms/2)*(ecms/2)-pk0kpi*pk0kpi ;
00316           if(temp1<0) temp1 =0;
00317           double mass_bc_tem  = sqrt(temp1);
00318           if(mass_bc_tem < 1.82 || mass_bc_tem > 1.89) continue;
00319 
00320           double        delE_tag_tag = ecms/2-pddd.e();
00321 
00322           if(fabs(delE_tag_tag)<deltaE_tem)  {
00323             deltaE_tem = fabs(delE_tag_tag);
00324             delE_tag_temp = delE_tag_tag;
00325             mass_bcgg = mass_bc_tem;
00326 
00327             pddd_temp = pddd;
00328 
00329             ipi1_temp=ipi1;
00330             ipi2_temp=ipi2;
00331             ik1_temp =ik1;
00332             ipi3_temp=ipi3;
00333 
00334             ncount1 = 1;
00335 
00336           }   
00337         }   
00338       }     
00339     }
00340   }
00341 
00342   if(ncount1 == 1){
00343     tagmode=21;
00344     if(m_chargetag<0) tagmode=-21;
00345     tagmd=tagmode;
00346     mass_bc  = mass_bcgg;
00347     delE_tag = delE_tag_temp;
00348     cqtm     = 0.0;
00349 
00350     iGoodtag.push_back(ipi1_temp);
00351     iGoodtag.push_back(ipi2_temp);
00352     iGoodtag.push_back(ik1_temp);
00353     iGoodtag.push_back(ipi3_temp);
00354 
00355     iGamtag.push_back(9999);
00356     iGamtag.push_back(9999);
00357     iGamtag.push_back(9999);
00358     iGamtag.push_back(9999);
00359 
00360     ptag = pddd_temp;
00361 
00362     k0kpimd=true;
00363   }
00364 
00365 }


Member Data Documentation

double K0kpi::cqtm [private]

Definition at line 43 of file K0kpi.h.

Referenced by GetCQtm(), and MTotal().

double K0kpi::delE_tag [private]

Definition at line 44 of file K0kpi.h.

Referenced by GetdelE_tag(), and MTotal().

Vint K0kpi::iGamtag [private]

Definition at line 47 of file K0kpi.h.

Referenced by GettagGam1(), and MTotal().

Vint K0kpi::iGoodtag [private]

Definition at line 45 of file K0kpi.h.

Referenced by Gettagtrk1(), and MTotal().

bool K0kpi::k0kpimd [private]

Definition at line 40 of file K0kpi.h.

Referenced by Getk0kpimd(), and MTotal().

double K0kpi::mass_bc [private]

Definition at line 42 of file K0kpi.h.

Referenced by Getmass_bc(), and MTotal().

HepLorentzVector K0kpi::ptag [private]

Definition at line 46 of file K0kpi.h.

Referenced by Gettagp1(), and MTotal().

double K0kpi::tagmd [private]

Definition at line 41 of file K0kpi.h.

Referenced by Gettagmd(), and MTotal().


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