221 {
222 MsgStream log(
msgSvc(),
"RecEmcShowerCnv" );
223 log << MSG::DEBUG << "RecEmcShowerCnv::DataObjectToTObject" << endmsg;
224
225 StatusCode sc = StatusCode::SUCCESS;
226
228 if ( !emcShowerColTds )
229 {
230 log << MSG::ERROR << "Could not downcast to RecEmcShowerCol" << endmsg;
231 return StatusCode::FAILURE;
232 }
233
234 DataObject* evt;
236 if ( evt == NULL )
237 {
238 log << MSG::ERROR << "Could not get RecEvent in TDS " << endmsg;
239 return StatusCode::FAILURE;
240 }
241 ReconEvent* devtTds = dynamic_cast<ReconEvent*>( evt );
242 if ( !devtTds )
243 { log << MSG::ERROR << "RecEmcShowerCnv:Could not downcast to TDS DstEvent" << endmsg; }
244 IOpaqueAddress* addr;
245
246 m_cnvSvc->getRecTrackCnv()->createRep( evt, addr );
247 TRecTrackEvent* recEvt =
m_cnvSvc->getRecTrackCnv()->getWriteObject();
248
250 if ( !m_emcShowerCol ) return sc;
252
253 RecEmcShowerCol::const_iterator emcShowerTds;
254
255 for ( emcShowerTds = emcShowerColTds->begin(); emcShowerTds != emcShowerColTds->end();
256 emcShowerTds++ )
257 {
258 Int_t trackId = ( *emcShowerTds )->trackId();
259 Int_t numHits = ( *emcShowerTds )->numHits();
260 Int_t status = ( *emcShowerTds )->status();
261 Int_t cellId = ( *emcShowerTds )->getShowerId();
262 Int_t clusterId = ( *emcShowerTds )->getClusterId();
263 Int_t module = ( *emcShowerTds )->module();
264 Double_t
x = ( *emcShowerTds )->x();
265 Double_t y = ( *emcShowerTds )->y();
266 Double_t z = ( *emcShowerTds )->z();
267 Double_t theta = ( *emcShowerTds )->theta();
268 Double_t dtheta = ( *emcShowerTds )->dtheta();
269 Double_t phi = ( *emcShowerTds )->phi();
270 Double_t dphi = ( *emcShowerTds )->dphi();
271 Double_t
energy = ( *emcShowerTds )->energy();
272 Double_t dE = ( *emcShowerTds )->dE();
273 Double_t eSeed = ( *emcShowerTds )->eSeed();
274 Double_t e3x3 = ( *emcShowerTds )->e3x3();
275 Double_t e5x5 = ( *emcShowerTds )->e5x5();
276 Double_t eall = ( *emcShowerTds )->getEAll();
277 Double_t elepton = ( *emcShowerTds )->getELepton();
278 Double_t
time = (Int_t)( *emcShowerTds )->time();
279 Double_t secondMoment = ( *emcShowerTds )->secondMoment();
280 Double_t latMoment = ( *emcShowerTds )->latMoment();
281 Double_t a20Moment = ( *emcShowerTds )->a20Moment();
282 Double_t a42Moment = ( *emcShowerTds )->a42Moment();
283
284 HepSymMatrix matrix = ( *emcShowerTds )->errorMatrix();
285
286 Double_t err[6];
287 err[0] = matrix[0][0];
288 err[1] = matrix[1][1];
289 err[2] = matrix[2][2];
290 err[3] = matrix[0][1];
291 err[4] = matrix[0][2];
292 err[5] = matrix[1][2];
293
294 map<Int_t, Double_t> cellIdMap;
295 RecEmcFractionMap::const_iterator pFractionMap;
296
297 for ( pFractionMap = ( *emcShowerTds )->Begin(); pFractionMap != ( *emcShowerTds )->End();
298 pFractionMap++ )
299 {
300 Int_t id = pFractionMap->first;
301 Double_t frac = pFractionMap->second.getFraction();
302 cellIdMap[id] = frac;
303 }
304
305 vector<Int_t> cellId3x3;
308 for ( ciCellId = id3x3.begin(); ciCellId != id3x3.end(); ciCellId++ )
309 {
310 Int_t id = *ciCellId;
311 cellId3x3.push_back( id );
312 }
313
314 vector<Int_t> cellId5x5;
316 for ( ciCellId = id5x5.begin(); ciCellId != id5x5.end(); ciCellId++ )
317 {
318 Int_t id = *ciCellId;
319 cellId5x5.push_back( id );
320 }
321
322 TRecEmcShower* emcShowerRoot = new TRecEmcShower();
323
324
325
326
333 emcShowerRoot->
setX(
x );
334 emcShowerRoot->
setY( y );
335 emcShowerRoot->
setZ( z );
337 emcShowerRoot->
setDE( dE );
340 emcShowerRoot->
setPhi( phi );
341 emcShowerRoot->
setDphi( dphi );
343 emcShowerRoot->
setE3x3( e3x3 );
344 emcShowerRoot->
setE5x5( e5x5 );
345 emcShowerRoot->
setEAll( eall );
352 emcShowerRoot->
setErr( err );
353
354
358
360 }
361 return StatusCode::SUCCESS;
362}
RecEmcIDVector::const_iterator ci_RecEmcIDVector
vector< RecEmcID > RecEmcIDVector
ObjectVector< RecEmcShower > RecEmcShowerCol
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
IDataProviderSvc * m_eds
pointer to eventdataservice
void setDphi(const Double_t dpi)
void setTime(const Double_t time)
void setCellIdMap(const map< Int_t, Double_t > &cellIdMap)
void setY(const Double_t y)
void setX(const Double_t x)
void setELepton(const Double_t elepton)
void setDtheta(const Double_t dt)
void setA20Moment(const Double_t a20Moment)
void setStatus(const Int_t st)
void setClusterId(const Int_t clusterId)
void setModule(const Int_t mod)
void setTheta(const Double_t theta)
void setEnergy(const Double_t e)
void setSecondMoment(const Double_t secondMoment)
void setE3x3(const Double_t e3x3)
void setZ(const Double_t z)
void setCellId5x5(const vector< Int_t > &cellId5x5)
void setE5x5(const Double_t e5x5)
void setCellId3x3(const vector< Int_t > &cellId3x3)
void setEAll(const Double_t eall)
void setCellId(const Int_t id)
void setESeed(const Double_t eSeed)
void setNumHits(const Int_t hit)
void setErr(const Double_t err[6])
void setDE(const Double_t de)
void setA42Moment(const Double_t a42Moment)
void setPhi(const Double_t pi)
void setTrackId(const Int_t trackId)
void setLatMoment(const Double_t latMoment)
void clearEmcShowerCol()
clear the whole array (necessary because of the consts-s) */
void addEmcShower(TRecEmcShower *Track)
Add a TkrTrack into the Emc data collection */.
const TObjArray * getEmcShowerCol() const
retrieve the whole TObjArray of EmcShower Data
_EXTERN_ std::string Event