19 MsgStream log(
msgSvc(), name() );
22 NTuplePtr nt1(
ntupleSvc(),
"DedxTuples/Mdc_dedx" );
23 if ( nt1 ) m_tuple1 = nt1;
26 m_tuple1 =
ntupleSvc()->book(
"DedxTuples/Mdc_dedx", CLID_RowWiseTuple,
"Dedx parameter" );
29 status = m_tuple1->addItem(
"dedx", m_dedx );
30 status = m_tuple1->addItem(
"parttype", m_parttype );
31 status = m_tuple1->addItem(
"chidedx", m_chidedx );
32 status = m_tuple1->addItem(
"chidedxE", m_chidedxE );
33 status = m_tuple1->addItem(
"chidedxMu", m_chidedxMu );
34 status = m_tuple1->addItem(
"chidedxPi", m_chidedxPi );
35 status = m_tuple1->addItem(
"chidedxK", m_chidedxK );
36 status = m_tuple1->addItem(
"chidedxP", m_chidedxP );
40 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
41 return StatusCode::FAILURE;
44 log << MSG::INFO <<
"Finished booking NTuples" << endmsg;
45 return StatusCode::SUCCESS;
49 MsgStream log(
msgSvc(), name() );
50 SmartDataPtr<RecMdcDedxCol> mdcDedx( eventSvc(),
"/Event/Recon/RecMdcDedxCol" );
53 log << MSG::ERROR <<
"Unable to retrieve RecMdcDedxCol" << endmsg;
54 return StatusCode::FAILURE;
58 log << MSG::DEBUG <<
"RecMdcDedxCol retrieved of size " << mdcDedx->size() << endmsg;
60 for ( RecMdcDedxCol::iterator it = mdcDedx->begin(); it != mdcDedx->end(); it++, i++ )
62 m_dedx = ( *it )->probPH();
63 m_parttype = ( *it )->particleId();
65 if ( m_parttype > 5 || m_parttype < 0 )
continue;
66 m_chidedx = ( *it )->chi( m_parttype - 1 );
67 m_chidedxE = ( *it )->chiE();
68 m_chidedxMu = ( *it )->chiMu();
69 m_chidedxPi = ( *it )->chiPi();
70 m_chidedxK = ( *it )->chiK();
71 m_chidedxP = ( *it )->chiP();
73 log << MSG::INFO <<
"particle chi=" << m_chidedx << endmsg;
74 log << MSG::INFO <<
"m_dedx=" << m_dedx << endmsg;
75 log << MSG::INFO <<
" m_parttype=" << m_parttype << endmsg;
76 StatusCode status1 = m_tuple1->write();
77 if ( status1.isFailure() ) { log << MSG::ERROR <<
"Cannot fill Ntuple1" << endmsg; }
80 return StatusCode::SUCCESS;