83 {
84
85 MsgStream log(
msgSvc(),
"MucMcHitCnv");
86 log << MSG::DEBUG << "MucMcHitCnv::DataObjectToTObject" << endreq;
87 StatusCode sc=StatusCode::SUCCESS;
88
90 if (!mucMcHitCnvTds) {
91 log << MSG::ERROR << "Could not downcast to MucMcHitCol" << endreq;
92 return StatusCode::FAILURE;
93 }
94
95 DataObject *evt;
97 if (evt==NULL) {
98 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
99 return StatusCode::FAILURE;
100 }
102 if (!devtTds) {
103 log << MSG::ERROR << "MucMcHitCnv:Could not downcast to TDS McEvent" << endreq;
104 }
105 IOpaqueAddress *addr;
106
109
111 if (!m_mucMcHitCol) return sc;
113 MucMcHitCol::const_iterator mucMcTds;
114
115 for (mucMcTds = mucMcHitCnvTds->begin(); mucMcTds != mucMcHitCnvTds->end(); mucMcTds++) {
116 UInt_t id = ((*mucMcTds)->identify()).get_value() ;
117 UInt_t trackIndex = (*mucMcTds) ->getTrackIndex();
118 Double_t xPosition = (*mucMcTds) ->getPositionX() ;
119 Double_t yPosition = (*mucMcTds) ->getPositionY() ;
120 Double_t zPosition = (*mucMcTds) ->getPositionZ() ;
121 Double_t px= (*mucMcTds) ->getPx() ;
122 Double_t py = (*mucMcTds) ->getPy() ;
123 Double_t pz = (*mucMcTds) ->getPz() ;
124
126
127
128 mucMcRoot->
setId(
id);
133 mucMcRoot->
setPx(px);
134 mucMcRoot->
setPy(py);
135 mucMcRoot->
setPz(pz);
136
138 }
139
140 return StatusCode::SUCCESS;
141}
static TMcEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addMucMc(TMucMc *mcHit)
Muc.
const TObjArray * getMucMcHitCol() const
void setPositionX(Double_t positionX)
void setTrackIndex(UInt_t trackIndex)
void setPositionY(Double_t positionY)
void setPositionZ(Double_t positionZ)
_EXTERN_ std::string Event
ObjectVector< MucMcHit > MucMcHitCol