83 {
84
85 MsgStream log(
msgSvc(),
"MdcMcHitCnv");
86 log << MSG::DEBUG << "MdcMcHitCnv::DataObjectToTObject" << endreq;
87 StatusCode sc=StatusCode::SUCCESS;
88
90 if (!mdcMcHitCnvTds) {
91 log << MSG::ERROR << "Could not downcast to MdcMcHitCol" << endreq;
92 return StatusCode::FAILURE;
93 }
94
95 DataObject *evt;
98 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
99 return StatusCode::FAILURE;
100 }
102 if (!devtTds) {
103 log << MSG::ERROR << "MdcMcHitCnv:Could not downcast to TDS McEvent" << endreq;
104 }
105 IOpaqueAddress *addr;
106
109
111 if (!m_mdcMcHitCol) return sc;
113 MdcMcHitCol::const_iterator mdcMcTds;
114
115 for (mdcMcTds = mdcMcHitCnvTds->begin(); mdcMcTds != mdcMcHitCnvTds->end(); mdcMcTds++) {
116 UInt_t id = ((*mdcMcTds)->identify()).get_value() ;
117 UInt_t trackIndex = (*mdcMcTds) ->getTrackIndex();
118 Double_t xPosition = (*mdcMcTds) ->getPositionX() ;
119 Double_t yPosition = (*mdcMcTds) ->getPositionY() ;
120 Double_t zPosition = (*mdcMcTds) ->getPositionZ() ;
121 Double_t driftDistance= (*mdcMcTds) ->getDriftDistance();
122 Double_t depositEnergy = (*mdcMcTds) ->getDepositEnergy() ;
123 Int_t positionFlag = (*mdcMcTds) ->getPositionFlag();
124
126
127
128 mdcMcRoot->
setId(
id);
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 addMdcMc(TMdcMc *mcHit)
Mdc.
const TObjArray * getMdcMcHitCol() const
void setPositionZ(Double_t positionZ)
void setTrackIndex(UInt_t trackIndex)
void setDepositEnergy(Double_t depositEnergy)
void setPositionX(Double_t positionX)
void setPositionFlag(Int_t posFlag)
void setPositionY(Double_t positionY)
void setDriftDistance(Double_t driftDistance)
_EXTERN_ std::string Event
ObjectVector< MdcMcHit > MdcMcHitCol