28 MsgStream log(
msgSvc(),
"EvtRecPrimaryVertexCnv");
29 log << MSG::DEBUG <<
"EvtRecPrimaryVertexCnv::TObjectToDataObject" << endreq;
33 refpObject = evtRecPrimaryVertex;
35 if ( ! m_evtRecPrimaryVertex )
return StatusCode::SUCCESS;
37 evtRecPrimaryVertex->
setIsValid (m_evtRecPrimaryVertex->isValid() );
38 evtRecPrimaryVertex->
setNTracks (m_evtRecPrimaryVertex->nTracks() );
39 evtRecPrimaryVertex->
setTrackIdList (m_evtRecPrimaryVertex->trackIdList() );
40 evtRecPrimaryVertex->
setChi2 (m_evtRecPrimaryVertex->chi2() );
41 evtRecPrimaryVertex->
setNdof (m_evtRecPrimaryVertex->ndof() );
42 evtRecPrimaryVertex->
setFitMethod (m_evtRecPrimaryVertex->fitMethod() );
45 for (Int_t i = 0; i < 3; i++) {
46 vtx[i] = m_evtRecPrimaryVertex->vertex(i);
49 HepSymMatrix Evtx(3, 0);
50 Evtx[0][0] = m_evtRecPrimaryVertex->errorVertex(0);
51 Evtx[0][1] = Evtx[1][0] = m_evtRecPrimaryVertex->errorVertex(1);
52 Evtx[0][2] = Evtx[2][0] = m_evtRecPrimaryVertex->errorVertex(2);
53 Evtx[1][1] = m_evtRecPrimaryVertex->errorVertex(3);
54 Evtx[1][2] = Evtx[2][1] = m_evtRecPrimaryVertex->errorVertex(4);
55 Evtx[2][2] = m_evtRecPrimaryVertex->errorVertex(5);
60 delete m_evtRecPrimaryVertex;
61 m_evtRecPrimaryVertex = 0;
62 return StatusCode::SUCCESS;
67 MsgStream log(
msgSvc(),
"EvtRecPrimaryVertexCnv");
68 log << MSG::DEBUG <<
"EvtRecPrimaryVertexCnv::DataObjectToTObject" << endreq;
71 if ( ! evtRecPrimaryVertex ) {
72 log << MSG::ERROR <<
"Could not downcast to EvtRecPrimaryVertex" << endreq;
73 return StatusCode::FAILURE;
76 DataObject* evt =
NULL;
78 if ( sc.isFailure() ) {
79 log << MSG::ERROR <<
"Could not get EvtRecObject in TDS" << endreq;
80 return StatusCode::FAILURE;
85 log << MSG::ERROR <<
"EvtRecPrimaryVertexCnv: Could not downcast to TDS EvtRecObject" << endreq;
89 m_cnvSvc->getEvtRecCnv()->createRep(evt, addr);
97 m_evtRecPrimaryVertex->setNTracks (evtRecPrimaryVertex->
nTracks() );
98 m_evtRecPrimaryVertex->setTrackIdList (evtRecPrimaryVertex->
trackIdList() );
99 m_evtRecPrimaryVertex->setChi2 (evtRecPrimaryVertex->
chi2() );
100 m_evtRecPrimaryVertex->setNdof (evtRecPrimaryVertex->
ndof() );
101 m_evtRecPrimaryVertex->setFitMethod (evtRecPrimaryVertex->
fitMethod() );
104 for (Int_t i = 0; i < 3; i++) {
105 vtx[i] = evtRecPrimaryVertex->
vertex()[i];
108 Evtx[0] = evtRecPrimaryVertex->
errorVertex()[0][0];
109 Evtx[1] = evtRecPrimaryVertex->
errorVertex()[0][1];
110 Evtx[2] = evtRecPrimaryVertex->
errorVertex()[0][2];
111 Evtx[3] = evtRecPrimaryVertex->
errorVertex()[1][1];
112 Evtx[4] = evtRecPrimaryVertex->
errorVertex()[1][2];
113 Evtx[5] = evtRecPrimaryVertex->
errorVertex()[2][2];
114 m_evtRecPrimaryVertex->setVertex (vtx);
115 m_evtRecPrimaryVertex->setErrorVertex (Evtx);
117 return StatusCode::SUCCESS;