224{
225 MsgStream log(
msgSvc(),
"RecEmcShowerCnv");
226 log << MSG::DEBUG << "RecEmcShowerCnv::DataObjectToTObject" << endreq;
227
228 StatusCode sc=StatusCode::SUCCESS;
229
231 if (!emcShowerColTds) {
232 log << MSG::ERROR << "Could not downcast to RecEmcShowerCol" << endreq;
233 return StatusCode::FAILURE;
234 }
235
236 DataObject *evt;
238 if (evt==NULL) {
239 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
240 return StatusCode::FAILURE;
241 }
243 if (!devtTds) {
244 log << MSG::ERROR << "RecEmcShowerCnv:Could not downcast to TDS DstEvent" << endreq;
245 }
246 IOpaqueAddress *addr;
247
250
252 if (!m_emcShowerCol) return sc;
254 RecEmcShowerCol::const_iterator emcShowerTds;
255
256 for (emcShowerTds = emcShowerColTds->begin(); emcShowerTds != emcShowerColTds->end(); emcShowerTds++) {
257 Int_t trackId = (*emcShowerTds)->trackId();
258 Int_t numHits = (*emcShowerTds)->numHits();
259 Int_t status =(*emcShowerTds)->status();
260 Int_t cellId =(*emcShowerTds)->getShowerId();
261 Int_t clusterId = (*emcShowerTds)->getClusterId();
262 Int_t module =(*emcShowerTds)->module();
263 Double_t
x = (*emcShowerTds)->x();
264 Double_t
y = (*emcShowerTds)->y();
265 Double_t z = (*emcShowerTds)->z();
266 Double_t theta = (*emcShowerTds)->theta();
267 Double_t dtheta =(*emcShowerTds)->dtheta();
268 Double_t phi =(*emcShowerTds)->phi();
269 Double_t dphi =(*emcShowerTds)->dphi();
270 Double_t
energy = (*emcShowerTds)->energy();
271 Double_t dE = (*emcShowerTds)->dE();
272 Double_t eSeed = (*emcShowerTds)->eSeed();
273 Double_t e3x3 = (*emcShowerTds)->e3x3();
274 Double_t e5x5 = (*emcShowerTds)->e5x5();
275 Double_t eall = (*emcShowerTds)->getEAll();
276 Double_t elepton = (*emcShowerTds)->getELepton();
277 Double_t time = (Int_t)(*emcShowerTds)->time();
278 Double_t secondMoment = (*emcShowerTds)->secondMoment();
279 Double_t latMoment = (*emcShowerTds)->latMoment();
280 Double_t a20Moment = (*emcShowerTds)->a20Moment();
281 Double_t a42Moment = (*emcShowerTds)->a42Moment();
282
283 HepSymMatrix matrix = (*emcShowerTds)->errorMatrix();
284
285 Double_t err[6];
286 err[0] = matrix[0][0];
287 err[1] = matrix[1][1];
288 err[2] = matrix[2][2];
289 err[3] = matrix[0][1];
290 err[4] = matrix[0][2];
291 err[5] = matrix[1][2];
292
293 map<Int_t, Double_t> cellIdMap;
294 RecEmcFractionMap::const_iterator pFractionMap;
295
296 for(pFractionMap=(*emcShowerTds)->Begin();
297 pFractionMap!=(*emcShowerTds)->End();
298 pFractionMap++) {
299 Int_t id = pFractionMap->first;
300 Double_t frac = pFractionMap->second.getFraction();
301 cellIdMap[id]=frac;
302 }
303
304 vector<Int_t> cellId3x3;
307 for(ciCellId=id3x3.begin();
308 ciCellId!=id3x3.end();
309 ciCellId++) {
310 Int_t id = *ciCellId;
311 cellId3x3.push_back(id);
312 }
313
314 vector<Int_t> cellId5x5;
316 for(ciCellId=id5x5.begin();
317 ciCellId!=id5x5.end();
318 ciCellId++) {
319 Int_t id = *ciCellId;
320 cellId5x5.push_back(id);
321 }
322
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 );
347 emcShowerRoot->
setTime( time );
352 emcShowerRoot->
setErr( err );
353
354
358
360 }
361 return StatusCode::SUCCESS;
362}
************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
RecEmcIDVector::const_iterator ci_RecEmcIDVector
vector< RecEmcID > RecEmcIDVector
ObjectVector< RecEmcShower > RecEmcShowerCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
RecTrackCnv * getRecTrackCnv()
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
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