89 {
90
91 MsgStream log(
msgSvc(),
"TofMcHitCnv");
92 log << MSG::DEBUG << "TofMcHitCnv::DataObjectToTObject" << endreq;
93 StatusCode sc=StatusCode::SUCCESS;
94
96 if (!tofMcHitCnvTds) {
97 log << MSG::ERROR << "Could not downcast to TofMcHitCol" << endreq;
98 return StatusCode::FAILURE;
99 }
100
101 DataObject *evt;
104 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
105 return StatusCode::FAILURE;
106 }
108 if (!devtTds) {
109 log << MSG::ERROR << "TofMcHitCnv:Could not downcast to TDS McEvent" << endreq;
110 }
111 IOpaqueAddress *addr;
112
115
117 if (!m_tofMcHitCol) return sc;
119 TofMcHitCol::const_iterator tofMcTds;
120
121 for (tofMcTds = tofMcHitCnvTds->begin(); tofMcTds != tofMcHitCnvTds->end(); tofMcTds++) {
122 UInt_t id = ((*tofMcTds)->identify()).get_value() ;
123 UInt_t trackIndex = (*tofMcTds) ->getTrackIndex();
124 Double_t xPosition = (*tofMcTds) ->getPositionX() ;
125 Double_t yPosition = (*tofMcTds) ->getPositionY() ;
126 Double_t zPosition = (*tofMcTds) ->getPositionZ() ;
127 Double_t px= (*tofMcTds) ->getPx() ;
128 Double_t py = (*tofMcTds) ->getPy() ;
129 Double_t pz = (*tofMcTds) ->getPz() ;
130 Double_t trackLength = (*tofMcTds) ->getTrackLength() ;
131 Double_t flightTime = (*tofMcTds) ->getFlightTime() ;
132
134
135
136 tofMcRoot->
setId(
id);
141 tofMcRoot->
setPx(px);
142 tofMcRoot->
setPy(py);
143 tofMcRoot->
setPz(pz);
146
148 }
149
150 return StatusCode::SUCCESS;
151}
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 addTofMc(TTofMc *mcHit)
Tof.
const TObjArray * getTofMcHitCol() const
void setTrackIndex(UInt_t trackIndex)
void setPositionY(Double_t positionY)
void setTrackLength(Double_t trackLength)
void setFlightTime(Double_t flightTime)
void setPositionZ(Double_t positionZ)
void setPositionX(Double_t positionX)
_EXTERN_ std::string Event
ObjectVector< TofMcHit > TofMcHitCol