127 {
128
129 MsgStream log(
msgSvc(),
"CgemTrackCnv");
130
131 log << MSG::INFO << "My Message::CgemTrackCnv::DataObjectToTObject("<<rootaddr->getTreename()<<")"<<endreq;
132
133 log << MSG::DEBUG << "CgemTrackCnv::DataObjectToTObject" << endreq;
134 StatusCode sc=StatusCode::SUCCESS;
135
137 if (!cgemTrackColTds) {
138 log << MSG::ERROR << "Could not downcast to CgemTrackCol" << endreq;
139
140 log << MSG::INFO << "My Message::CgemTrackCnv::DataObjectToTObject("<<rootaddr->getTreename()<<")-finished"<<endreq;
141
142 return StatusCode::FAILURE;
143 }
144
145 DataObject *evt;
147 if (evt==NULL) {
148 log << MSG::ERROR << "Could not get DstEvent in TDS " << endreq;
149
150 log << MSG::INFO << "My Message::CgemTrackCnv::DataObjectToTObject("<<rootaddr->getTreename()<<")-finished"<<endreq;
151
152 return StatusCode::FAILURE;
153 }
155 if (!devtTds) {
156 log << MSG::ERROR << "CgemTrackCnv:Could not downcast to TDS DstEvent" << endreq;
157 }
158 IOpaqueAddress *addr;
159
160
161 log << MSG::INFO <<
"My Message::CgemTrackCnv::DataObjectToTObject("<<rootaddr->
getTreename()<<
")::DstCnv"<<endreq;
162
165
167 if (!m_cgemTrackCol) return sc;
169 DstCgemTrackCol::const_iterator cgemTrackTds;
170
171 for (cgemTrackTds = cgemTrackColTds->begin(); cgemTrackTds != cgemTrackColTds->end(); cgemTrackTds++) {
172 Int_t trackId =(*cgemTrackTds)->trackId();
173 Double_t helix[5];
174 for(int i=0;i<5;i++){
175 helix[i] = (*cgemTrackTds)->helix(i) ;
176 }
177 Int_t stat = (*cgemTrackTds)->stat();
178 Double_t chi = (*cgemTrackTds)->chi2();
179 Int_t ndof = (*cgemTrackTds)->ndof();
180 Double_t err[15];
181 for (Int_t i=0; i<15; i++){
182 err[i] = (*cgemTrackTds)->err(i);
183 }
184 Int_t fL = (*cgemTrackTds)->firstLayer();
185 Int_t lL = (*cgemTrackTds)->lastLayer();
186
188
190
192 log<<MSG::INFO<<
"test,trackId: "<<cgemTrackRoot->
trackId()<<endreq;
193 log<<MSG::INFO<<
"test,px: "<<cgemTrackRoot->
px()
194 <<
"test,py: "<<cgemTrackRoot->
py()
195 <<
"test,pz: "<<cgemTrackRoot->
pz()<<endreq;
196
197 cgemTrackRoot->
setStat( stat );
199 cgemTrackRoot->
setNdof( ndof );
200 cgemTrackRoot->
setErr( err );
203
205 }
206
207
208 log << MSG::INFO << "My Message::CgemTrackCnv::DataObjectToTObject("<<rootaddr->getTreename()<<")-finished"<<endreq;
209
210 return StatusCode::SUCCESS;
211}
ObjectVector< DstCgemTrack > DstCgemTrackCol
static TDstEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
std::string getTreename() const
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setLastLayer(const Int_t lL)
void setTrackId(const Int_t trackId)
const Int_t trackId() const
void setStat(const Int_t stat)
void setErr(const Double_t err[15])
void setHelix(const Double_t helix[5])
const Double_t pz() const
void setFirstLayer(const Int_t fL)
const Double_t px() const
const Double_t py() const
void setNdof(const Int_t ndof)
void setChi2(const Double_t chi)
const TObjArray * getCgemTrackCol() const
retrieve the whole TObjArray of CgemTrack Data
void addCgemTrack(TCgemTrack *Track)
Add a tkrtrack into the Cgem data collection.
void clearCgemTrackCol()
clear the whole array (necessary because of the consts-s)
_EXTERN_ std::string Event