2#define EmcDigiCnv_CXX 1
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
6#include "GaudiKernel/ObjectVector.h"
8#include "TClonesArray.h"
29 MsgStream log(
msgSvc(),
"EmcDigiCnv");
40 MsgStream log(
msgSvc(),
"EmcDigiCnv");
41 log << MSG::DEBUG <<
"EmcDigiCnv::TObjectToDataObject" << endreq;
42 StatusCode sc=StatusCode::SUCCESS;
46 refpObject=emcDigiTdsCol;
50 if (!m_emcDigiCol)
return sc;
51 TIter emcDigiIter(m_emcDigiCol);
53 while ((emcDigiRoot = (
TEmcDigi*)emcDigiIter.Next())) {
54 unsigned int id = emcDigiRoot->
getIntId();
57 unsigned int measure = emcDigiRoot->
getMeasure();
68 emcDigiTdsCol->push_back(emcDigiTds);
73 return StatusCode::SUCCESS;
78 MsgStream log(
msgSvc(),
"EmcDigiCnv");
79 log << MSG::DEBUG <<
"EmcDigiCnv::DataObjectToTObject" << endreq;
80 StatusCode sc=StatusCode::SUCCESS;
84 log << MSG::ERROR <<
"Could not downcast to EmcDigiCol" << endreq;
85 return StatusCode::FAILURE;
91 log << MSG::ERROR <<
"Could not get DigiEvent in TDS " << endreq;
92 return StatusCode::FAILURE;
96 log << MSG::ERROR <<
"EmcDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
104 if (!m_emcDigiCol)
return sc;
106 EmcDigiCol::const_iterator emcDigiTds;
108 for (emcDigiTds = emcDigiColTds->begin(); emcDigiTds != emcDigiColTds->end(); emcDigiTds++) {
109 UInt_t measure = (*emcDigiTds)->getMeasure();
110 UInt_t
time = (*emcDigiTds)->getTimeChannel();
111 UInt_t charge = (*emcDigiTds)->getChargeChannel();
112 UInt_t
id = (*emcDigiTds)->getIntId();
113 Int_t trackIndex = (*emcDigiTds)->getTrackIndex();
125 return StatusCode::SUCCESS;
ObjectVector< EmcDigi > EmcDigiCol
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
EmcDigiCnv(ISvcLocator *svc)
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
void setMeasure(const unsigned int measure)
void setTrackIndex(const int trackIndex)
void setChargeChannel(const unsigned int chargeChannel)
void setTimeChannel(const unsigned int timeChannel)
Definition of a Root address, derived from IOpaqueAddress.
Base class for all Root Converters.
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 addEmcDigi(TEmcDigi *digi)
Add a TkrDigi into the TKR data collection.
void clearEmcDigiCol()
clear the whole array (necessary because of the consts-s)
const TObjArray * getEmcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
UInt_t getMeasure() const
void setMeasure(const UInt_t measure)
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
void setTrackIndex(const int trackIndex)
int getTrackIndex() const
UInt_t getChargeChannel() const
UInt_t getTimeChannel() const
static std::map< const TObject *, const EmcDigi * > m_rootEmcDigiMap
_EXTERN_ std::string Event