1#include "ValidRecMucTrack/ValidRecMucTrackAlg.h"
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
6#include "MucRecEvent/RecMucTrack.h"
10 Algorithm(name, pSvcLocator) {
18 MsgStream log(
msgSvc(), name() );
19 log << MSG::INFO <<
"Booking Histograms" << endreq;
23 if ( nt1 ) m_tuple1 = nt1;
25 m_tuple1 =
ntupleSvc()->book (
"FILE105/T", CLID_RowWiseTuple,
"MucTrack parameter");
27 status = m_tuple1->addItem(
"depth",m_depth);
28 status = m_tuple1->addItem(
"distance",m_distance);
29 status = m_tuple1->addItem(
"deltaPhi",m_deltaPhi);
30 status = m_tuple1->addItem(
"maxHits",m_maxHits);
31 status = m_tuple1->addItem(
"numLayers",m_numLayers);
32 status = m_tuple1->addItem(
"numHits",m_numHits);
33 status = m_tuple1->addItem(
"chi2",m_chi2);
34 status = m_tuple1->addItem(
"xPos",m_xPos);
35 status = m_tuple1->addItem(
"yPos",m_yPos);
36 status = m_tuple1->addItem(
"zPos",m_zPos);
39 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
43 log << MSG::INFO <<
"Finished booking NTuples" << endmsg;
46 return StatusCode::SUCCESS;
53 MsgStream log(
msgSvc(), name());
54 SmartDataPtr<RecMucTrackCol> mucTracks(eventSvc(),
"/Event/Recon/RecMucTrackCol");
57 log << MSG::ERROR <<
"Unable to retrieve RecMucTrackCol" << endreq;
58 return StatusCode::FAILURE;
60 log << MSG::DEBUG <<
"RecMucTrackCol retrieved of size "<< mucTracks->size() << endreq;
61 for(RecMucTrackCol::iterator it=mucTracks->begin(); it!=mucTracks->end(); it++)
64 m_depth = (*it)->depth();
65 m_distance = (*it)->distance();
66 m_deltaPhi = (*it)->deltaPhi();
67 m_maxHits = (*it)->maxHitsInLayer();
68 m_numLayers= (*it)->numLayers();
69 m_numHits = (*it)->numHits();
70 m_chi2 = (*it)->chi2();
71 m_xPos = (*it)->xPos();
72 m_yPos = (*it)->yPos();
73 m_zPos = (*it)->zPos();
75 StatusCode status1 = m_tuple1->write();
76 if ( status1.isFailure() ) {
77 log << MSG::ERROR <<
"Cannot fill Ntuple1" << endreq;
81 return StatusCode::SUCCESS;
87 MsgStream log(
msgSvc(), name());
88 log << MSG::INFO <<
"Finalizing..." << endreq;
ValidRecMucTrackAlg(const std::string &name, ISvcLocator *pSvcLocator)