108 {
109 MsgStream log(
msgSvc(),
"EvtRecVeeVertexCnv");
110 log << MSG::DEBUG << "EvtRecVeeVertexCnv::DataObjectToTObject" << endreq;
111
113 if ( ! evtRecVeeVertexCol ) {
114 log << MSG::ERROR << "Could not downcast to EvtRecVeeVertexCol" << endreq;
115 return StatusCode::FAILURE;
116 }
117
118 DataObject* evt;
121 log << MSG::ERROR << "Could not get EvtRecObject in TDS" << endreq;
122 return StatusCode::FAILURE;
123 }
125 if ( ! devtTds ) {
126 log << MSG::ERROR << "EvtRecVeeVertexCnv: Could not downcast to TDS EvtRecObject" << endreq;
127 }
128
129 IOpaqueAddress *addr;
132
134 if ( ! m_evtRecVeeVertexCol ) return StatusCode::SUCCESS;
135
136 IDataProviderSvc* dataSvc = 0;
137 StatusCode sc = serviceLocator()->getService("EventDataSvc",
138 IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc);
139 if ( sc.isFailure() ) {
140 log << MSG::FATAL << "Could not get EventDataSvc in EvtRecVeeVertexCnv" << endreq;
141 return sc;
142 }
143
144 EvtRecTrackCol::iterator evtRecTrackColbegin, evtRecTrackColend;
145
147 if ( ! evtRecTrackCol) {
148 log << MSG::INFO << "Could not find EvtRecTrackCol" << endreq;
149 }
150 else {
151 evtRecTrackColbegin = evtRecTrackCol->begin();
152 evtRecTrackColend = evtRecTrackCol->end();
153 }
154
155
157 EvtRecVeeVertexCol::const_iterator evtRecVeeVertex = evtRecVeeVertexCol->begin();
158
159 for ( ; evtRecVeeVertex != evtRecVeeVertexCol->end(); evtRecVeeVertex++) {
162
168
169 double wTrackParameter[7];
170 for (int i = 0; i < 7; i++) {
171 wTrackParameter[i] = ptr->
w()[i];
172 }
173 evtRecVeeVertexRoot->
setW( wTrackParameter );
174 double EwTrackParameter[28];
175 int i = 0;
176 for (int j = 0; j < 7; j++) {
177 for (int k = j; k < 7; k++) {
178 EwTrackParameter[i] = ptr->
Ew()[j][k];
179 i++;
180 }
181 }
182 assert(i == 28);
183 evtRecVeeVertexRoot->
setEw( EwTrackParameter );
184 int pairId[2];
185 pairId[0] = ptr->
pair(0);
186 pairId[1] = ptr->
pair(1);
187 evtRecVeeVertexRoot->
setPair( pairId );
190
191 int daughterId[2];
193 assert(evtRecTrackColbegin != evtRecTrackColend);
194 EvtRecTrackCol::iterator it0 = find(evtRecTrackColbegin,
195 evtRecTrackColend, ptr->
daughter(0).target());
196 EvtRecTrackCol::iterator it1 = find(evtRecTrackColbegin,
197 evtRecTrackColend, ptr->
daughter(1).target());
198 assert(it0 != evtRecTrackColend);
199 assert(it1 != evtRecTrackColend);
200 daughterId[0] = it0 - evtRecTrackColbegin;
201 daughterId[1] = it1 - evtRecTrackColbegin;
203 }
205 }
206
207 return StatusCode::SUCCESS;
208}
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
static TEvtRecObject * getWriteObject()
const std::pair< int, int > & pair() const
SmartRef< EvtRecTrack > & daughter(int i)
const HepVector & w() const
const HepSymMatrix & Ew() const
EvtRecCnv * getEvtRecCnv()
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void clearEvtRecVeeVertexCol()
void addEvtRecVeeVertex(TEvtRecVeeVertex *veeVertex)
const TObjArray * getEvtRecVeeVertexCol() const
void setDaughter(Int_t daughter[2])
void setVertexId(Int_t vtxId)
void setPair(Int_t pair[2])
void setVertexType(Int_t vtxType)
void setEw(Double_t Ew[28])
void setChi2(Double_t chi2)
void setNTracks(Int_t nTracks)
void setMass(Double_t mass)
void setNCharge(Int_t nCharge)
_EXTERN_ std::string Event
_EXTERN_ std::string EvtRecTrackCol