1#ifndef RecEmcHitCnv_CXX
2#define RecEmcHitCnv_CXX 1
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
6#include "GaudiKernel/ObjectVector.h"
8#include "TClonesArray.h"
37 MsgStream log(
msgSvc(),
"RecEmcHitCnv");
49 MsgStream log(
msgSvc(),
"RecEmcHitCnv");
50 log << MSG::DEBUG <<
"RecEmcHitCnv::TObjectToDataObject" << endreq;
52 StatusCode sc=StatusCode::SUCCESS;
56 refpObject=emcHitTdsCol;
59 if (!m_recEmcHitCol)
return sc;
60 TIter emcHitIter(m_recEmcHitCol);
62 while ((emcHitRoot = (
TRecEmcHit*)emcHitIter.Next())) {
65 double time = emcHitRoot->
time();
74 emcHitTdsCol->push_back(emcHitTds);
77 delete m_recEmcHitCol;
80 return StatusCode::SUCCESS;
85 MsgStream log(
msgSvc(),
"RecEmcHitCnv");
86 log << MSG::DEBUG <<
"RecEmcHitCnv::DataObjectToTObject" << endreq;
88 StatusCode sc=StatusCode::SUCCESS;
92 log << MSG::ERROR <<
"Could not downcast to RecEmcHitCol" << endreq;
93 return StatusCode::FAILURE;
99 log << MSG::ERROR <<
"Could not get RecEvent in TDS " << endreq;
100 return StatusCode::FAILURE;
104 log << MSG::ERROR <<
"RecEmcHitCnv:Could not downcast to TDS DstEvent" << endreq;
106 IOpaqueAddress *addr;
112 if (!m_emcHitCol)
return sc;
117 RecEmcHitCol::const_iterator emcHitTds;
119 for(emcHitTds = emcHitColTds->begin();
120 emcHitTds != emcHitColTds->end();
122 Int_t cellId = (*emcHitTds)->getCellId();
123 Double_t
energy = (*emcHitTds)->getEnergy();
124 Double_t time = (*emcHitTds)->getTime();
135 return StatusCode::SUCCESS;
************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
ObjectVector< RecEmcHit > RecEmcHitCol
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
RecEmcHitCnv(ISvcLocator *svc)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
void Assign(const RecEmcID &CellId, const RecEmcEnergy &Energy, const RecEmcTime &Time)
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition of a Root address, derived from IOpaqueAddress.
RecTrackCnv * getRecTrackCnv()
Base class for all Root Converters.
std::string m_rootTreename
each converter knows it's treename
std::vector< void * > m_adresses
each converter knows the corresponding adresses
IDataProviderSvc * m_eds
pointer to eventdataservice
std::string m_rootBranchname
root branchname (may be concatenated of severals)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setCellId(const Int_t id)
void setEnergy(const Double_t e)
void setTime(const Double_t time)
void addEmcHit(TRecEmcHit *Track)
Add a TkrTrack into the Emc data collection */.
void clearEmcHitCol()
clear the whole array (necessary because of the consts-s) */
const TObjArray * getEmcHitCol() const
retrieve the whole TObjArray of EmcHit Data
static std::map< const TObject *, const RecEmcHit * > m_rootRecEmcHitMap
_EXTERN_ std::string Event