2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
4#include "GaudiKernel/IHistogramSvc.h"
5#include "GaudiKernel/INTupleSvc.h"
12 Algorithm(name, pSvcLocator) {
20 MsgStream log(
msgSvc(), name() );
23 NTuplePtr nt1(
ntupleSvc(),
"DedxTuples/Mdc_dedx");
24 if ( nt1 ) m_tuple1 = nt1;
26 m_tuple1 =
ntupleSvc()->book (
"DedxTuples/Mdc_dedx", CLID_RowWiseTuple,
"Dedx parameter");
28 status = m_tuple1->addItem(
"dedx",m_dedx);
29 status = m_tuple1->addItem(
"parttype",m_parttype);
30 status = m_tuple1->addItem(
"chidedx",m_chidedx);
31 status = m_tuple1->addItem(
"chidedxE",m_chidedxE);
32 status = m_tuple1->addItem(
"chidedxMu",m_chidedxMu);
33 status = m_tuple1->addItem(
"chidedxPi",m_chidedxPi);
34 status = m_tuple1->addItem(
"chidedxK",m_chidedxK);
35 status = m_tuple1->addItem(
"chidedxP",m_chidedxP);
38 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
39 return StatusCode::FAILURE;
42 log << MSG::INFO <<
"Finished booking NTuples" << endmsg;
43 return StatusCode::SUCCESS;
50 MsgStream log(
msgSvc(), name());
51 SmartDataPtr<RecMdcDedxCol> mdcDedx(eventSvc(),
"/Event/Recon/RecMdcDedxCol");
54 log << MSG::ERROR <<
"Unable to retrieve RecMdcDedxCol" << endreq;
55 return StatusCode::FAILURE;
57 log << MSG::DEBUG <<
"RecMdcDedxCol retrieved of size "<< mdcDedx->size() << endreq;
59 for(RecMdcDedxCol::iterator it=mdcDedx->begin(); it!=mdcDedx->end(); it++,i++)
60 { m_dedx = (*it)->probPH();
61 m_parttype = (*it)->particleId();
63 if(m_parttype >5 || m_parttype<0)
continue;
64 m_chidedx = (*it)->chi(m_parttype-1);
65 m_chidedxE = (*it)->chiE();
66 m_chidedxMu = (*it)->chiMu();
67 m_chidedxPi = (*it)->chiPi();
68 m_chidedxK = (*it)->chiK();
69 m_chidedxP = (*it)->chiP();
71 log << MSG::INFO <<
"particle chi="<< m_chidedx <<endreq;
72 log << MSG::INFO <<
"m_dedx="<<m_dedx<<endreq;
73 log << MSG::INFO <<
" m_parttype="<< m_parttype<<endreq;
74 StatusCode status1 = m_tuple1->write();
75 if ( status1.isFailure() ) {
76 log << MSG::ERROR <<
"Cannot fill Ntuple1" << endreq;
81 return StatusCode::SUCCESS;
87 MsgStream log(
msgSvc(), name());
88 log << MSG::INFO <<
"Finalizing..." << endreq;