Kk Class Reference

#include <Kk.h>

List of all members.

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)

Private Attributes

bool kkmd
double tagmd
double mass_bc
double cqtm
double delE_tag
Vint iGoodtag
HepLorentzVector ptag
Vint iGamtag


Detailed Description

Definition at line 20 of file Kk.h.


Constructor & Destructor Documentation

Kk::Kk (  ) 

Definition at line 26 of file Kk.cxx.

00027 {}

Kk::~Kk (  ) 

Definition at line 29 of file Kk.cxx.

00030 {}


Member Function Documentation

double Kk::GetCQtm (  )  [inline]

Definition at line 30 of file Kk.h.

References cqtm.

Referenced by Sing::Mdset().

00030 { return cqtm; }

double Kk::GetdelE_tag (  )  [inline]

Definition at line 31 of file Kk.h.

References delE_tag.

Referenced by Sing::Mdset().

00031 { return delE_tag; }

bool Kk::Getkkmd (  )  [inline]

Definition at line 27 of file Kk.h.

References kkmd.

Referenced by Sing::Mdset().

00027 { return kkmd; }

double Kk::Getmass_bc (  )  [inline]

Definition at line 29 of file Kk.h.

References mass_bc.

Referenced by Sing::Mdset().

00029 { return mass_bc; }

Vint Kk::GettagGam1 (  )  [inline]

Definition at line 34 of file Kk.h.

References iGamtag.

Referenced by Sing::Mdset().

00034 { return iGamtag; }

double Kk::Gettagmd (  )  [inline]

Definition at line 28 of file Kk.h.

References tagmd.

Referenced by Sing::Mdset().

00028 { return tagmd; }

HepLorentzVector Kk::Gettagp1 (  )  [inline]

Definition at line 33 of file Kk.h.

References ptag.

Referenced by Sing::Mdset().

00033 { return ptag; }

Vint Kk::Gettagtrk1 (  )  [inline]

Definition at line 32 of file Kk.h.

References iGoodtag.

Referenced by Sing::Mdset().

00032 { return iGoodtag; }

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.

References VFHelix::a(), TrackPool::AddTrack(), VertexFit::AddVertex(), DstMdcKalTrack::charge(), cos(), cqtm, delE_tag, ecms, EventModel::EvtRec::EvtRecEvent, VertexFit::Fit(), RecMdcKalTrack::getZErrorK(), RecMdcKalTrack::getZHelixK(), genRecEmupikp::i, iGamtag, iGoodtag, VertexFit::init(), VertexFit::instance(), IVertexDbSvc::isVertexValid(), ganga-rec::j, DstMdcKalTrack::kaon, kkmd, mass_bc, 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().

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


Member Data Documentation

double Kk::cqtm [private]

Definition at line 44 of file Kk.h.

Referenced by GetCQtm(), and MTotal().

double Kk::delE_tag [private]

Definition at line 45 of file Kk.h.

Referenced by GetdelE_tag(), and MTotal().

Vint Kk::iGamtag [private]

Definition at line 48 of file Kk.h.

Referenced by GettagGam1(), and MTotal().

Vint Kk::iGoodtag [private]

Definition at line 46 of file Kk.h.

Referenced by Gettagtrk1(), and MTotal().

bool Kk::kkmd [private]

Definition at line 41 of file Kk.h.

Referenced by Getkkmd(), and MTotal().

double Kk::mass_bc [private]

Definition at line 43 of file Kk.h.

Referenced by Getmass_bc(), and MTotal().

HepLorentzVector Kk::ptag [private]

Definition at line 47 of file Kk.h.

Referenced by Gettagp1(), and MTotal().

double Kk::tagmd [private]

Definition at line 42 of file Kk.h.

Referenced by Gettagmd(), and MTotal().


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