99 {
100
101 MsgStream log(
msgSvc(),
"MdcMcHitCnv");
102 log << MSG::DEBUG << "MdcMcHitCnv::DataObjectToTObject" << endreq;
103 StatusCode sc=StatusCode::SUCCESS;
104
106 if (!mdcMcHitCnvTds) {
107 log << MSG::ERROR << "Could not downcast to MdcMcHitCol" << endreq;
108 return StatusCode::FAILURE;
109 }
110
111 DataObject *evt;
113 if (evt==NULL) {
114 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
115 return StatusCode::FAILURE;
116 }
118 if (!devtTds) {
119 log << MSG::ERROR << "MdcMcHitCnv:Could not downcast to TDS McEvent" << endreq;
120 }
121 IOpaqueAddress *addr;
122
125
127 if (!m_mdcMcHitCol) return sc;
129 MdcMcHitCol::const_iterator mdcMcTds;
130
131 for (mdcMcTds = mdcMcHitCnvTds->begin(); mdcMcTds != mdcMcHitCnvTds->end(); mdcMcTds++) {
132 UInt_t id = ((*mdcMcTds)->identify()).get_value() ;
133 UInt_t trackIndex = (*mdcMcTds) ->getTrackIndex();
134 Double_t xPosition = (*mdcMcTds) ->getPositionX() ;
135 Double_t yPosition = (*mdcMcTds) ->getPositionY() ;
136 Double_t zPosition = (*mdcMcTds) ->getPositionZ() ;
137 Double_t driftDistance= (*mdcMcTds) ->getDriftDistance();
138 Double_t depositEnergy = (*mdcMcTds) ->getDepositEnergy() ;
139 Int_t positionFlag = (*mdcMcTds) ->getPositionFlag();
140 Double_t px = (*mdcMcTds)->getMomentumX();
141 Double_t py = (*mdcMcTds)->getMomentumY();
142 Double_t pz = (*mdcMcTds)->getMomentumZ();
143 Double_t trkLen = (*mdcMcTds)->getFlightLength();
144 TString creatorProcess = (*mdcMcTds)->getCreatorProcess();
145 Int_t trkIdx = (*mdcMcTds)->getDigiIdx();
146 Int_t pdgCode = (*mdcMcTds)->getCurrentTrackPID();
147 Int_t isSec = (*mdcMcTds)->getIsSecondary();
148
150
151
152 mdcMcRoot->
setId(
id);
168
170 }
171
172 return StatusCode::SUCCESS;
173}
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 setPositionZ(Double_t positionZ)
void setDigiIdx(Int_t id)
void setMomentumY(Double_t momentumY)
void setPDGCode(Int_t code)
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 setIsSecondary(Int_t isSec)
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