2#define MdcDigiCnv_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(),
"MdcDigiCnv");
41 MsgStream log(
msgSvc(),
"MdcDigiCnv");
42 log << MSG::DEBUG <<
"MdcDigiCnv::TObjectToDataObject" << endreq;
43 StatusCode sc=StatusCode::SUCCESS;
47 refpObject=mdcDigiTdsCol;
56 if (!m_mdcDigiCol)
return sc;
57 TIter mdcDigiIter(m_mdcDigiCol);
59 while ((mdcDigiRoot = (
TMdcDigi*)mdcDigiIter.Next())) {
60 unsigned int id = mdcDigiRoot->
getIntId();
74 mdcDigiTdsCol->push_back(mdcDigiTds);
79 return StatusCode::SUCCESS;
84 MsgStream log(
msgSvc(),
"MdcDigiCnv");
85 log << MSG::DEBUG <<
"MdcDigiCnv::DataObjectToTObject" << endreq;
86 StatusCode sc=StatusCode::SUCCESS;
90 log << MSG::ERROR <<
"Could not downcast to MdcDigiCol" << endreq;
91 return StatusCode::FAILURE;
97 log << MSG::ERROR <<
"Could not get DigiEvent in TDS " << endreq;
98 return StatusCode::FAILURE;
102 log << MSG::ERROR <<
"MdcDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
105 IOpaqueAddress *addr;
115 if (!m_mdcDigiCol)
return sc;
117 MdcDigiCol::const_iterator mdcDigiTds;
119 for (mdcDigiTds = mdcDigiColTds->begin(); mdcDigiTds != mdcDigiColTds->end(); mdcDigiTds++) {
120 UInt_t overflow = (*mdcDigiTds)->getOverflow();
121 UInt_t
time = (*mdcDigiTds)->getTimeChannel();
122 UInt_t charge = (*mdcDigiTds)->getChargeChannel();
123 UInt_t
id = (*mdcDigiTds)->getIntId();
124 Int_t trackIndex = (*mdcDigiTds)->getTrackIndex();
135 return StatusCode::SUCCESS;
ObjectVector< MdcDigi > MdcDigiCol
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
MdcDigiCnv(ISvcLocator *svc)
void setOverflow(const unsigned int overflow)
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 clearMdcDigiCol()
clear the whole array (necessary because of the consts-s)
const TObjArray * getMdcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
void addMdcDigi(TMdcDigi *digi)
Add a TkrDigi into the TKR data collection.
void setOverflow(const UInt_t overflow)
UInt_t getOverflow() const
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 MdcDigi * > m_rootMdcDigiMap
Create a set of maps between ROOT Digi objects and TDS Digi data.
_EXTERN_ std::string Event