Pipi Class Reference

#include <Pipi.h>

List of all members.

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)

Private Attributes

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


Detailed Description

Definition at line 20 of file Pipi.h.


Constructor & Destructor Documentation

Pipi::Pipi (  ) 

Definition at line 28 of file Pipi.cxx.

00029 {}

Pipi::~Pipi (  ) 

Definition at line 31 of file Pipi.cxx.

00032 {}


Member Function Documentation

double Pipi::GetCQtm (  )  [inline]

Definition at line 30 of file Pipi.h.

References cqtm.

Referenced by Sing::Mdset().

00030 { return cqtm; }

double Pipi::GetdelE_tag (  )  [inline]

Definition at line 31 of file Pipi.h.

References delE_tag.

Referenced by Sing::Mdset().

00031 { return delE_tag; }

double Pipi::Getmass_bc (  )  [inline]

Definition at line 29 of file Pipi.h.

References mass_bc.

Referenced by Sing::Mdset().

00029 { return mass_bc; }

bool Pipi::GetPipimd (  )  [inline]

Definition at line 27 of file Pipi.h.

References pipimd.

Referenced by Sing::Mdset().

00027 { return pipimd; }

Vint Pipi::GettagGam1 (  )  [inline]

Definition at line 34 of file Pipi.h.

References iGamtag.

Referenced by Sing::Mdset().

00034 { return iGamtag; }

double Pipi::Gettagmd (  )  [inline]

Definition at line 28 of file Pipi.h.

References tagmd.

Referenced by Sing::Mdset().

00028 { return tagmd; }

HepLorentzVector Pipi::Gettagp1 (  )  [inline]

Definition at line 33 of file Pipi.h.

References ptag.

Referenced by Sing::Mdset().

00033 { return ptag; }

Vint Pipi::Gettagtrk1 (  )  [inline]

Definition at line 32 of file Pipi.h.

References iGoodtag.

Referenced by Sing::Mdset().

00032 { return iGoodtag; }

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.

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

00037 {
00038 
00039   int nGood=iGood.size();
00040   int nGam=iGam.size();
00041 
00042   iGoodtag.clear();
00043   iGamtag.clear();
00044   
00045   double mass_bcgg, delE_tag_temp;
00046   int m_chargetag,m_chargepi1,m_chargepi2;
00047   int ipi1_temp,ipi2_temp,ipi3_temp;
00048   HepLorentzVector kmfit1,kmfit2,kmfit3,kmfit4,pddd;
00049 
00050   HepLorentzVector pddd_temp;
00051   IDataProviderSvc* eventSvc = NULL;
00052   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
00053   SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc,EventModel::EvtRec::EvtRecEvent);
00054   SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
00055 
00056   int runNo=eventHeader->runNumber();
00057   int rec=eventHeader->eventNumber();
00058 
00059   double xecm=2*Ebeam;
00060 
00061   pipimd=false;
00062   double  tagmode=0;
00063 
00064   if((evtRecEvent->totalCharged() < 2)){    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   IVertexDbSvc*  vtxsvc;
00076   Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
00077   if(vtxsvc->isVertexValid())
00078   {
00079     double* dbv = vtxsvc->PrimaryVertex();
00080     double*  vv = vtxsvc->SigmaPrimaryVertex();
00081     xorigin.setX(dbv[0]);
00082     xorigin.setY(dbv[1]);
00083     xorigin.setZ(dbv[2]);
00084   }
00085 
00086   double xv=xorigin.x();
00087   double yv=xorigin.y();
00088   double zv=xorigin.z();
00089 
00090   HepPoint3D point0(0.,0.,0.);
00091   HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
00093   for(int i = 0; i < evtRecEvent->totalCharged(); i++) {
00094     EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + i;
00095 
00096     int ipi1= (*itTrk)->trackId();
00097 
00098     if(!(*itTrk)->isMdcKalTrackValid()) continue;
00099     RecMdcKalTrack*  mdcKalTrk1 = (*itTrk)->mdcKalTrack();
00100     RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00101 
00102     m_chargepi1=mdcKalTrk1->charge();
00103     if(abs(m_chargepi1) != 1) continue;
00104 
00106     HepVector a1 = mdcKalTrk1->getZHelix();
00107     HepSymMatrix Ea1 = mdcKalTrk1->getZError();
00108 
00109     VFHelix helixip3_1(point0,a1,Ea1);
00110     helixip3_1.pivot(IP);
00111     HepVector  vecipa1 = helixip3_1.a();
00112 
00113     double dr1 = fabs(vecipa1[0]);
00114     double dz1 = fabs(vecipa1[3]);
00115     double costheta1 = cos(mdcKalTrk1->theta());
00116 
00117     if (  dr1 >= 1.0) continue;
00118     if (  dz1 >= 10.0) continue; 
00119     if ( fabs(costheta1) >= 0.93) continue; 
00121     if(PID_flag == 5) {
00122       simple_pid->preparePID(*itTrk);
00123       if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;  
00124     } 
00126     WTrackParameter pip(xmass[2],mdcKalTrk1->getZHelix(),mdcKalTrk1->getZError());
00127 
00128     //  
00129     // select Pi2
00130     //  
00131     for(int j = 0; j< evtRecEvent->totalCharged();j++) {
00132       EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + j;
00133 
00134       int ipi2= (*itTrk)->trackId();
00135       if(ipi1==ipi2)  continue;
00136 
00137       if(!(*itTrk)->isMdcKalTrackValid()) continue;
00138       RecMdcKalTrack*  mdcKalTrk2 = (*itTrk)->mdcKalTrack();
00139       RecMdcKalTrack::setPidType(RecMdcKalTrack::pion);
00140 
00141       m_chargepi2=mdcKalTrk2->charge();
00142       if((m_chargepi1 + m_chargepi2) != 0) continue;
00143 
00145       HepVector a2 = mdcKalTrk2->getZHelix();
00146       HepSymMatrix Ea2 = mdcKalTrk2->getZError();
00147       VFHelix helixip3_2(point0,a2,Ea2);
00148       helixip3_2.pivot(IP);
00149       HepVector  vecipa2 = helixip3_2.a();
00150 
00151       double dr2 = fabs(vecipa2[0]);
00152       double dz2 = fabs(vecipa2[3]);
00153       double costheta2 = cos(mdcKalTrk2->theta());
00154       if (  dr2 >= 1.0) continue;
00155       if (  dz2 >= 10.0) continue; 
00156       if ( fabs(costheta2) >= 0.93) continue; 
00158       if(PID_flag == 5) {
00159         simple_pid->preparePID(*itTrk);
00160         if(simple_pid->probPion() < 0.0 || simple_pid->probPion() < simple_pid->probKaon()) continue;  
00161       } 
00163       WTrackParameter pim(xmass[2],mdcKalTrk2->getZHelix(),mdcKalTrk2->getZError()); 
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,  pip);
00177       vtxfit->AddTrack(1,  pim);
00178       vtxfit->AddVertex(0, vxpar, 0, 1);
00179       if(!vtxfit->Fit(0))  continue;
00180       vtxfit->Swim(0);
00181 
00182       WTrackParameter wpip = vtxfit->wtrk(0);
00183       WTrackParameter wpim = vtxfit->wtrk(1);
00184 
00185       HepVector pip_val = HepVector(7,0);
00186       pip_val = wpip.w();
00187       HepVector pim_val = HepVector(7,0);
00188       pim_val = wpim.w();
00189 
00190       HepLorentzVector P_PIP(pip_val[0],pip_val[1],pip_val[2],pip_val[3]);
00191       HepLorentzVector P_PIM(pim_val[0],pim_val[1],pim_val[2],pim_val[3]);
00192 
00193       P_PIP.boost(-0.011,0,0);
00194       P_PIM.boost(-0.011,0,0);
00195       pddd = P_PIP + P_PIM;
00196 
00197       double   ppipi = pddd.rho(); 
00198 
00199       double temp1 = (ecms/2)*(ecms/2)-ppipi*ppipi;
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 
00213         ipi1_temp=ipi1;
00214         ipi2_temp=ipi2;
00215 
00216         ncount1 = 1;
00217       }   
00218     }
00219   }
00220 
00221   if(ncount1 == 1){    
00222     tagmode=19;
00223     if(m_chargetag<0)  tagmode=-19;
00224     tagmd=tagmode;
00225     mass_bc  = mass_bcgg;
00226     delE_tag = delE_tag_temp;
00227     cqtm     = -0.0;       
00228 
00229     iGoodtag.push_back(ipi1_temp);
00230     iGoodtag.push_back(ipi2_temp);
00231 
00232     iGamtag.push_back(9999);
00233     iGamtag.push_back(9999);
00234     iGamtag.push_back(9999);
00235     iGamtag.push_back(9999);
00236 
00237     ptag = pddd_temp;
00238 
00239     pipimd=true;
00240 
00241   }
00242 }


Member Data Documentation

double Pipi::cqtm [private]

Definition at line 44 of file Pipi.h.

Referenced by GetCQtm(), and MTotal().

double Pipi::delE_tag [private]

Definition at line 45 of file Pipi.h.

Referenced by GetdelE_tag(), and MTotal().

Vint Pipi::iGamtag [private]

Definition at line 48 of file Pipi.h.

Referenced by GettagGam1(), and MTotal().

Vint Pipi::iGoodtag [private]

Definition at line 46 of file Pipi.h.

Referenced by Gettagtrk1(), and MTotal().

double Pipi::mass_bc [private]

Definition at line 43 of file Pipi.h.

Referenced by Getmass_bc(), and MTotal().

bool Pipi::pipimd [private]

Definition at line 41 of file Pipi.h.

Referenced by GetPipimd(), and MTotal().

HepLorentzVector Pipi::ptag [private]

Definition at line 47 of file Pipi.h.

Referenced by Gettagp1(), and MTotal().

double Pipi::tagmd [private]

Definition at line 42 of file Pipi.h.

Referenced by Gettagmd(), and MTotal().


Generated on Tue Nov 29 23:20:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7