91 {
92
93 MsgStream log(
msgSvc(),
"MdcMcHitCnv");
94 log << MSG::DEBUG << "MdcMcHitCnv::DataObjectToTObject" << endreq;
95 StatusCode sc=StatusCode::SUCCESS;
96
98 if (!mdcMcHitCnvTds) {
99 log << MSG::ERROR << "Could not downcast to MdcMcHitCol" << endreq;
100 return StatusCode::FAILURE;
101 }
102
103 DataObject *evt;
106 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
107 return StatusCode::FAILURE;
108 }
110 if (!devtTds) {
111 log << MSG::ERROR << "MdcMcHitCnv:Could not downcast to TDS McEvent" << endreq;
112 }
113 IOpaqueAddress *addr;
114
117
119 if (!m_mdcMcHitCol) return sc;
121 MdcMcHitCol::const_iterator mdcMcTds;
122
123 for (mdcMcTds = mdcMcHitCnvTds->begin(); mdcMcTds != mdcMcHitCnvTds->end(); mdcMcTds++) {
124 UInt_t id = ((*mdcMcTds)->identify()).get_value() ;
125 UInt_t trackIndex = (*mdcMcTds) ->getTrackIndex();
126 Double_t xPosition = (*mdcMcTds) ->getPositionX() ;
127 Double_t yPosition = (*mdcMcTds) ->getPositionY() ;
128 Double_t zPosition = (*mdcMcTds) ->getPositionZ() ;
129 Double_t driftDistance= (*mdcMcTds) ->getDriftDistance();
130 Double_t depositEnergy = (*mdcMcTds) ->getDepositEnergy() ;
131 Int_t positionFlag = (*mdcMcTds) ->getPositionFlag();
132
134
135
136 mdcMcRoot->
setId(
id);
151 mdcMcRoot->
setDigiIdx((*mdcMcTds)->getDigiIdx());
152
154 }
155
156 return StatusCode::SUCCESS;
157}
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 setMomentumX(Double_t momentumX)
void setCurrentTrackPID(Int_t currentTrackPID)
void setPositionZ(Double_t positionZ)
void setIsSecondary(Int_t isSecondary)
void setDigiIdx(int digiIdx)
void setMomentumY(Double_t momentumY)
void setTrackIndex(UInt_t trackIndex)
void setFlightLength(Double_t flightLength)
void setDepositEnergy(Double_t depositEnergy)
void setPositionX(Double_t positionX)
void setCreatorProcess(TString creatorProcess)
void setPositionFlag(Int_t posFlag)
void setPositionY(Double_t positionY)
void setDriftDistance(Double_t driftDistance)
void setMomentumZ(Double_t momentumZ)
_EXTERN_ std::string Event
ObjectVector< MdcMcHit > MdcMcHitCol