1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/PropertyMgr.h"
7#include "VertexFit/IVertexDbSvc.h"
8#include "GaudiKernel/Bootstrap.h"
9#include "GaudiKernel/ISvcLocator.h"
11#include "EventModel/EventModel.h"
12#include "EventModel/Event.h"
14#include "EvtRecEvent/EvtRecEvent.h"
15#include "EvtRecEvent/EvtRecTrack.h"
16#include "DstEvent/TofHitStatus.h"
17#include "EventModel/EventHeader.h"
22#include "GaudiKernel/INTupleSvc.h"
23#include "GaudiKernel/NTuple.h"
24#include "GaudiKernel/Bootstrap.h"
25#include "GaudiKernel/IHistogramSvc.h"
26#include "CLHEP/Vector/ThreeVector.h"
27#include "CLHEP/Vector/LorentzVector.h"
28#include "CLHEP/Vector/TwoVector.h"
29using CLHEP::Hep3Vector;
30using CLHEP::Hep2Vector;
31using CLHEP::HepLorentzVector;
32#include "CLHEP/Geometry/Point3D.h"
33#ifndef ENABLE_BACKWARDS_COMPATIBILITY
36#include "RhopiAlg/Rhopi.h"
39#include "VertexFit/KalmanKinematicFit.h"
40#include "VertexFit/VertexFit.h"
41#include "VertexFit/Helix.h"
42#include "ParticleID/ParticleID.h"
47const double mpi = 0.13957;
48const double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
50const double velc = 299.792458;
51typedef std::vector<int>
Vint;
52typedef std::vector<HepLorentzVector>
Vp4;
59 Algorithm(name, pSvcLocator) {
62 declareProperty(
"Vr0cut", m_vr0cut=1.0);
63 declareProperty(
"Vz0cut", m_vz0cut=5.0);
64 declareProperty(
"EnergyThreshold", m_energyThreshold=0.04);
65 declareProperty(
"GammaPhiCut", m_gammaPhiCut=20.0);
66 declareProperty(
"GammaThetaCut", m_gammaThetaCut=20.0);
67 declareProperty(
"GammaAngleCut", m_gammaAngleCut=20.0);
68 declareProperty(
"Test4C", m_test4C = 1);
69 declareProperty(
"Test5C", m_test5C = 1);
70 declareProperty(
"CheckDedx", m_checkDedx = 1);
71 declareProperty(
"CheckTof", m_checkTof = 1);
76 MsgStream log(
msgSvc(), name());
78 log << MSG::INFO <<
"in initialize()" << endmsg;
82 if ( nt1 ) m_tuple1 = nt1;
84 m_tuple1 =
ntupleSvc()->book (
"FILE1/vxyz", CLID_ColumnWiseTuple,
"ks N-Tuple example");
86 status = m_tuple1->addItem (
"vx0", m_vx0);
87 status = m_tuple1->addItem (
"vy0", m_vy0);
88 status = m_tuple1->addItem (
"vz0", m_vz0);
89 status = m_tuple1->addItem (
"vr0", m_vr0);
90 status = m_tuple1->addItem (
"rvxy0", m_rvxy0);
91 status = m_tuple1->addItem (
"rvz0", m_rvz0);
92 status = m_tuple1->addItem (
"rvphi0", m_rvphi0);
95 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
96 return StatusCode::FAILURE;
100 NTuplePtr nt2(
ntupleSvc(),
"FILE1/photon");
101 if ( nt2 ) m_tuple2 = nt2;
103 m_tuple2 =
ntupleSvc()->book (
"FILE1/photon", CLID_ColumnWiseTuple,
"ks N-Tuple example");
105 status = m_tuple2->addItem (
"dthe", m_dthe);
106 status = m_tuple2->addItem (
"dphi", m_dphi);
107 status = m_tuple2->addItem (
"dang", m_dang);
108 status = m_tuple2->addItem (
"eraw", m_eraw);
111 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple2) << endmsg;
112 return StatusCode::FAILURE;
117 NTuplePtr nt3(
ntupleSvc(),
"FILE1/etot");
118 if ( nt3 ) m_tuple3 = nt3;
120 m_tuple3 =
ntupleSvc()->book (
"FILE1/etot", CLID_ColumnWiseTuple,
"ks N-Tuple example");
122 status = m_tuple3->addItem (
"m2gg", m_m2gg);
123 status = m_tuple3->addItem (
"etot", m_etot);
126 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple3) << endmsg;
127 return StatusCode::FAILURE;
131 NTuplePtr nt4(
ntupleSvc(),
"FILE1/fit4c");
132 if ( nt4 ) m_tuple4 = nt4;
134 m_tuple4 =
ntupleSvc()->book (
"FILE1/fit4c", CLID_ColumnWiseTuple,
"ks N-Tuple example");
136 status = m_tuple4->addItem (
"chi2", m_chi1);
137 status = m_tuple4->addItem (
"mpi0", m_mpi0);
140 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple4) << endmsg;
141 return StatusCode::FAILURE;
148 NTuplePtr nt5(
ntupleSvc(),
"FILE1/fit5c");
149 if ( nt5 ) m_tuple5 = nt5;
151 m_tuple5 =
ntupleSvc()->book (
"FILE1/fit5c", CLID_ColumnWiseTuple,
"ks N-Tuple example");
153 status = m_tuple5->addItem (
"chi2", m_chi2);
154 status = m_tuple5->addItem (
"mrh0", m_mrh0);
155 status = m_tuple5->addItem (
"mrhp", m_mrhp);
156 status = m_tuple5->addItem (
"mrhm", m_mrhm);
159 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple5) << endmsg;
160 return StatusCode::FAILURE;
164 NTuplePtr nt6(
ntupleSvc(),
"FILE1/geff");
165 if ( nt6 ) m_tuple6 = nt6;
167 m_tuple6 =
ntupleSvc()->book (
"FILE1/geff", CLID_ColumnWiseTuple,
"ks N-Tuple example");
169 status = m_tuple6->addItem (
"fcos", m_fcos);
170 status = m_tuple6->addItem (
"elow", m_elow);
173 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple6) << endmsg;
174 return StatusCode::FAILURE;
179 if(m_checkDedx == 1) {
180 NTuplePtr nt7(
ntupleSvc(),
"FILE1/dedx");
181 if ( nt7 ) m_tuple7 = nt7;
183 m_tuple7 =
ntupleSvc()->book (
"FILE1/dedx", CLID_ColumnWiseTuple,
"ks N-Tuple example");
185 status = m_tuple7->addItem (
"ptrk", m_ptrk);
186 status = m_tuple7->addItem (
"chie", m_chie);
187 status = m_tuple7->addItem (
"chimu", m_chimu);
188 status = m_tuple7->addItem (
"chipi", m_chipi);
189 status = m_tuple7->addItem (
"chik", m_chik);
190 status = m_tuple7->addItem (
"chip", m_chip);
191 status = m_tuple7->addItem (
"probPH", m_probPH);
192 status = m_tuple7->addItem (
"normPH", m_normPH);
193 status = m_tuple7->addItem (
"ghit", m_ghit);
194 status = m_tuple7->addItem (
"thit", m_thit);
197 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple7) << endmsg;
198 return StatusCode::FAILURE;
203 if(m_checkTof == 1) {
204 NTuplePtr nt8(
ntupleSvc(),
"FILE1/tofe");
205 if ( nt8 ) m_tuple8 = nt8;
207 m_tuple8 =
ntupleSvc()->book (
"FILE1/tofe",CLID_ColumnWiseTuple,
"ks N-Tuple example");
209 status = m_tuple8->addItem (
"ptrk", m_ptot_etof);
210 status = m_tuple8->addItem (
"cntr", m_cntr_etof);
211 status = m_tuple8->addItem (
"ph", m_ph_etof);
212 status = m_tuple8->addItem (
"rhit", m_rhit_etof);
213 status = m_tuple8->addItem (
"qual", m_qual_etof);
214 status = m_tuple8->addItem (
"te", m_te_etof);
215 status = m_tuple8->addItem (
"tmu", m_tmu_etof);
216 status = m_tuple8->addItem (
"tpi", m_tpi_etof);
217 status = m_tuple8->addItem (
"tk", m_tk_etof);
218 status = m_tuple8->addItem (
"tp", m_tp_etof);
221 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple8) << endmsg;
222 return StatusCode::FAILURE;
229 if(m_checkTof == 1) {
230 NTuplePtr nt9(
ntupleSvc(),
"FILE1/tof1");
231 if ( nt9 ) m_tuple9 = nt9;
233 m_tuple9 =
ntupleSvc()->book (
"FILE1/tof1", CLID_ColumnWiseTuple,
"ks N-Tuple example");
235 status = m_tuple9->addItem (
"ptrk", m_ptot_btof1);
236 status = m_tuple9->addItem (
"cntr", m_cntr_btof1);
237 status = m_tuple9->addItem (
"ph", m_ph_btof1);
238 status = m_tuple9->addItem (
"zhit", m_zhit_btof1);
239 status = m_tuple9->addItem (
"qual", m_qual_btof1);
240 status = m_tuple9->addItem (
"te", m_te_btof1);
241 status = m_tuple9->addItem (
"tmu", m_tmu_btof1);
242 status = m_tuple9->addItem (
"tpi", m_tpi_btof1);
243 status = m_tuple9->addItem (
"tk", m_tk_btof1);
244 status = m_tuple9->addItem (
"tp", m_tp_btof1);
247 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple9) << endmsg;
248 return StatusCode::FAILURE;
254 if(m_checkTof == 1) {
255 NTuplePtr nt10(
ntupleSvc(),
"FILE1/tof2");
256 if ( nt10 ) m_tuple10 = nt10;
258 m_tuple10 =
ntupleSvc()->book (
"FILE1/tof2", CLID_ColumnWiseTuple,
"ks N-Tuple example");
260 status = m_tuple10->addItem (
"ptrk", m_ptot_btof2);
261 status = m_tuple10->addItem (
"cntr", m_cntr_btof2);
262 status = m_tuple10->addItem (
"ph", m_ph_btof2);
263 status = m_tuple10->addItem (
"zhit", m_zhit_btof2);
264 status = m_tuple10->addItem (
"qual", m_qual_btof2);
265 status = m_tuple10->addItem (
"te", m_te_btof2);
266 status = m_tuple10->addItem (
"tmu", m_tmu_btof2);
267 status = m_tuple10->addItem (
"tpi", m_tpi_btof2);
268 status = m_tuple10->addItem (
"tk", m_tk_btof2);
269 status = m_tuple10->addItem (
"tp", m_tp_btof2);
272 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple10) << endmsg;
273 return StatusCode::FAILURE;
279 NTuplePtr nt11(
ntupleSvc(),
"FILE1/pid");
280 if ( nt11 ) m_tuple11 = nt11;
282 m_tuple11 =
ntupleSvc()->book (
"FILE1/pid", CLID_ColumnWiseTuple,
"ks N-Tuple example");
284 status = m_tuple11->addItem (
"ptrk", m_ptrk_pid);
285 status = m_tuple11->addItem (
"cost", m_cost_pid);
286 status = m_tuple11->addItem (
"dedx", m_dedx_pid);
287 status = m_tuple11->addItem (
"tof1", m_tof1_pid);
288 status = m_tuple11->addItem (
"tof2", m_tof2_pid);
289 status = m_tuple11->addItem (
"prob", m_prob_pid);
292 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple11) << endmsg;
293 return StatusCode::FAILURE;
302 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
303 return StatusCode::SUCCESS;
310 std::cout <<
"execute()" << std::endl;
312 MsgStream log(
msgSvc(), name());
313 log << MSG::INFO <<
"in execute()" << endreq;
315 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
316 int runNo=eventHeader->runNumber();
317 int event=eventHeader->eventNumber();
318 log << MSG::DEBUG <<
"run, evtnum = "
321 cout<<
"event "<<
event<<endl;
326 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
327 << evtRecEvent->totalCharged() <<
" , "
328 << evtRecEvent->totalNeutral() <<
" , "
329 << evtRecEvent->totalTracks() <<endreq;
336 Vint iGood, ipip, ipim;
346 Hep3Vector xorigin(0,0,0);
350 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
356 xorigin.setX(dbv[0]);
357 xorigin.setY(dbv[1]);
358 xorigin.setZ(dbv[2]);
361 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
363 if(!(*itTrk)->isMdcTrackValid())
continue;
365 double pch=mdcTrk->
p();
366 double x0=mdcTrk->
x();
367 double y0=mdcTrk->
y();
368 double z0=mdcTrk->
z();
369 double phi0=mdcTrk->
helix(1);
370 double xv=xorigin.x();
371 double yv=xorigin.y();
372 double Rxy=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
378 HepVector a = mdcTrk->
helix();
379 HepSymMatrix Ea = mdcTrk->
err();
381 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
384 HepVector vecipa = helixip.
a();
385 double Rvxy0=fabs(vecipa[0]);
386 double Rvz0=vecipa[3];
387 double Rvphi0=vecipa[1];
396 if(fabs(Rvz0) >= 10.0)
continue;
397 if(fabs(Rvxy0) >= 1.0)
continue;
400 nCharge += mdcTrk->
charge();
406 int nGood = iGood.size();
407 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endreq;
408 if((nGood != 2)||(nCharge!=0)){
409 return StatusCode::SUCCESS;
415 for(
int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
417 if(!(*itTrk)->isEmcShowerValid())
continue;
419 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
424 for(
int j = 0; j < evtRecEvent->totalCharged(); j++) {
426 if(!(*jtTrk)->isExtTrackValid())
continue;
431 double angd = extpos.angle(emcpos);
432 double thed = extpos.theta() - emcpos.theta();
433 double phid = extpos.deltaPhi(emcpos);
434 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
435 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
442 if(dang>=200)
continue;
443 double eraw = emcTrk->
energy();
444 dthe = dthe * 180 / (CLHEP::pi);
445 dphi = dphi * 180 / (CLHEP::pi);
446 dang = dang * 180 / (CLHEP::pi);
452 if(eraw < m_energyThreshold)
continue;
454 if(fabs(dang) < m_gammaAngleCut)
continue;
464 int nGam = iGam.size();
466 log << MSG::DEBUG <<
"num Good Photon " << nGam <<
" , " <<evtRecEvent->totalNeutral()<<endreq;
468 return StatusCode::SUCCESS;
480 if(m_checkDedx == 1) {
481 for(
int i = 0; i < nGood; i++) {
483 if(!(*itTrk)->isMdcTrackValid())
continue;
484 if(!(*itTrk)->isMdcDedxValid())
continue;
487 m_ptrk = mdcTrk->
p();
489 m_chie = dedxTrk->
chiE();
490 m_chimu = dedxTrk->
chiMu();
491 m_chipi = dedxTrk->
chiPi();
492 m_chik = dedxTrk->
chiK();
493 m_chip = dedxTrk->
chiP();
496 m_probPH = dedxTrk->
probPH();
497 m_normPH = dedxTrk->
normPH();
507 if(m_checkTof == 1) {
508 for(
int i = 0; i < nGood; i++) {
510 if(!(*itTrk)->isMdcTrackValid())
continue;
511 if(!(*itTrk)->isTofTrackValid())
continue;
514 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
516 double ptrk = mdcTrk->
p();
518 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
519 for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
521 status->
setStatus((*iter_tof)->status());
524 if( status->
layer()!=0 )
continue;
525 double path=(*iter_tof)->path();
526 double tof = (*iter_tof)->tof();
527 double ph = (*iter_tof)->ph();
528 double rhit = (*iter_tof)->zrhit();
529 double qual = 0.0 + (*iter_tof)->quality();
530 double cntr = 0.0 + (*iter_tof)->tofID();
532 for(
int j = 0; j < 5; j++) {
533 double gb = ptrk/
xmass[j];
534 double beta = gb/sqrt(1+gb*gb);
535 texp[j] = 10 * path /beta/
velc;
542 m_te_etof = tof - texp[0];
543 m_tmu_etof = tof - texp[1];
544 m_tpi_etof = tof - texp[2];
545 m_tk_etof = tof - texp[3];
546 m_tp_etof = tof - texp[4];
551 if(status->
layer()==1){
552 double path=(*iter_tof)->path();
553 double tof = (*iter_tof)->tof();
554 double ph = (*iter_tof)->ph();
555 double rhit = (*iter_tof)->zrhit();
556 double qual = 0.0 + (*iter_tof)->quality();
557 double cntr = 0.0 + (*iter_tof)->tofID();
559 for(
int j = 0; j < 5; j++) {
560 double gb = ptrk/
xmass[j];
561 double beta = gb/sqrt(1+gb*gb);
562 texp[j] = 10 * path /beta/
velc;
570 m_te_btof1 = tof - texp[0];
571 m_tmu_btof1 = tof - texp[1];
572 m_tpi_btof1 = tof - texp[2];
573 m_tk_btof1 = tof - texp[3];
574 m_tp_btof1 = tof - texp[4];
578 if(status->
layer()==2){
579 double path=(*iter_tof)->path();
580 double tof = (*iter_tof)->tof();
581 double ph = (*iter_tof)->ph();
582 double rhit = (*iter_tof)->zrhit();
583 double qual = 0.0 + (*iter_tof)->quality();
584 double cntr = 0.0 + (*iter_tof)->tofID();
586 for(
int j = 0; j < 5; j++) {
587 double gb = ptrk/
xmass[j];
588 double beta = gb/sqrt(1+gb*gb);
589 texp[j] = 10 * path /beta/
velc;
597 m_te_btof2 = tof - texp[0];
598 m_tmu_btof2 = tof - texp[1];
599 m_tpi_btof2 = tof - texp[2];
600 m_tk_btof2 = tof - texp[3];
601 m_tp_btof2 = tof - texp[4];
618 for(
int i = 0; i < nGam; i++) {
621 double eraw = emcTrk->
energy();
622 double phi = emcTrk->
phi();
623 double the = emcTrk->
theta();
624 HepLorentzVector ptrk;
625 ptrk.setPx(eraw*
sin(the)*
cos(phi));
626 ptrk.setPy(eraw*
sin(the)*
sin(phi));
627 ptrk.setPz(eraw*
cos(the));
632 pGam.push_back(ptrk);
634 cout<<
"before pid"<<endl;
639 for(
int i = 0; i < nGood; i++) {
655 m_ptrk_pid = mdcTrk->
p();
664 if(pid->
probPion() < 0.001)
continue;
670 if(mdcKalTrk->
charge() >0) {
671 ipip.push_back(iGood[i]);
672 HepLorentzVector ptrk;
673 ptrk.setPx(mdcKalTrk->
px());
674 ptrk.setPy(mdcKalTrk->
py());
675 ptrk.setPz(mdcKalTrk->
pz());
676 double p3 = ptrk.mag();
677 ptrk.setE(sqrt(p3*p3+
mpi*
mpi));
681 ppip.push_back(ptrk);
683 ipim.push_back(iGood[i]);
684 HepLorentzVector ptrk;
685 ptrk.setPx(mdcKalTrk->
px());
686 ptrk.setPy(mdcKalTrk->
py());
687 ptrk.setPz(mdcKalTrk->
pz());
688 double p3 = ptrk.mag();
689 ptrk.setE(sqrt(p3*p3+
mpi*
mpi));
693 ppim.push_back(ptrk);
723 int npip = ipip.size();
724 int npim = ipim.size();
725 if(npip*npim != 1)
return SUCCESS;
734 HepLorentzVector pTot;
735 for(
int i = 0; i < nGam - 1; i++){
736 for(
int j = i+1; j < nGam; j++) {
737 HepLorentzVector p2g = pGam[i] + pGam[j];
738 pTot = ppip[0] + ppim[0];
748 RecMdcKalTrack *pipTrk = (*(evtRecTrkCol->begin()+ipip[0]))->mdcKalTrack();
749 RecMdcKalTrack *pimTrk = (*(evtRecTrkCol->begin()+ipim[0]))->mdcKalTrack();
766 HepSymMatrix Evx(3, 0);
783 if(!vtxfit->
Fit(0))
return SUCCESS;
795 cout<<
"before 4c"<<endl;
798 HepLorentzVector
ecms(0.034,0,0,3.097);
800 double chisq = 9999.;
803 for(
int i = 0; i < nGam-1; i++) {
804 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[i]))->emcShower();
805 for(
int j = i+1; j < nGam; j++) {
806 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+iGam[j]))->emcShower();
813 bool oksq = kmfit->
Fit();
815 double chi2 = kmfit->
chisq();
827 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+ig1))->emcShower();
828 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+ig2))->emcShower();
835 bool oksq = kmfit->
Fit();
837 HepLorentzVector ppi0 = kmfit->
pfit(2) + kmfit->
pfit(3);
839 m_chi1 = kmfit->
chisq();
853 HepLorentzVector
ecms(0.034,0,0,3.097);
854 double chisq = 9999.;
857 for(
int i = 0; i < nGam-1; i++) {
858 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[i]))->emcShower();
859 for(
int j = i+1; j < nGam; j++) {
860 RecEmcShower *g2Trk = (*(evtRecTrkCol->begin()+iGam[j]))->emcShower();
868 if(!kmfit->
Fit(0))
continue;
869 if(!kmfit->
Fit(1))
continue;
870 bool oksq = kmfit->
Fit();
872 double chi2 = kmfit->
chisq();
883 log << MSG::INFO <<
" chisq = " << chisq <<endreq;
886 RecEmcShower* g1Trk = (*(evtRecTrkCol->begin()+ig1))->emcShower();
887 RecEmcShower* g2Trk = (*(evtRecTrkCol->begin()+ig2))->emcShower();
896 bool oksq = kmfit->
Fit();
898 HepLorentzVector ppi0 = kmfit->
pfit(2) + kmfit->
pfit(3);
899 HepLorentzVector prho0 = kmfit->
pfit(0) + kmfit->
pfit(1);
900 HepLorentzVector prhop = ppi0 + kmfit->
pfit(0);
901 HepLorentzVector prhom = ppi0 + kmfit->
pfit(1);
903 m_chi2 = kmfit->
chisq();
907 double eg1 = (kmfit->
pfit(2)).e();
908 double eg2 = (kmfit->
pfit(3)).e();
909 double fcos =
abs(eg1-eg2)/ppi0.rho();
916 if(fabs(prho0.m()-0.770)<0.150) {
917 if(fabs(fcos)<0.99) {
918 m_fcos = (eg1-eg2)/ppi0.rho();
919 m_elow = (eg1 < eg2) ? eg1 : eg2;
927 return StatusCode::SUCCESS;
933 cout<<
"total number: "<<
Ncut0<<endl;
934 cout<<
"nGood==2, nCharge==0: "<<
Ncut1<<endl;
935 cout<<
"nGam>=2: "<<
Ncut2<<endl;
936 cout<<
"Pass Pid: "<<
Ncut3<<endl;
937 cout<<
"Pass 4C: "<<
Ncut4<<endl;
938 cout<<
"Pass 5C: "<<
Ncut5<<endl;
939 cout<<
"J/psi->rho0 pi0: "<<
Ncut6<<endl;
940 MsgStream log(
msgSvc(), name());
941 log << MSG::INFO <<
"in finalize()" << endmsg;
942 return StatusCode::SUCCESS;
EvtRecTrackCol::iterator EvtRecTrackIterator
double abs(const EvtComplex &c)
std::vector< HepLorentzVector > Vp4
double sin(const BesAngle a)
double cos(const BesAngle a)
HepGeom::Point3D< double > HepPoint3D
std::vector< HepLorentzVector > Vp4
const Hep3Vector emcPosition() const
const int emcVolumeNumber() const
static void setPidType(PidType pidType)
const double theta() const
const HepSymMatrix err() const
const HepVector helix() const
......
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
void AddFourMomentum(int number, HepLorentzVector p4)
HepLorentzVector pfit(int n) const
void AddResonance(int number, double mres, std::vector< int > tlis)
static KalmanKinematicFit * instance()
int methodProbability() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
double chiTof2(int n) const
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const
double chiTof1(int n) const
double chiDedx(int n) const
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
Rhopi(const std::string &name, ISvcLocator *pSvcLocator)
unsigned int layer() const
void setStatus(unsigned int status)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.
WTrackParameter wtrk(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol