2#define TofDigiCnv_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(),
"TofDigiCnv");
40 MsgStream log(
msgSvc(),
"TofDigiCnv");
41 log << MSG::DEBUG <<
"TofDigiCnv::TObjectToDataObject" << endreq;
42 StatusCode sc=StatusCode::SUCCESS;
46 refpObject=tofDigiTdsCol;
50 if (!m_tofDigiCol)
return sc;
51 TIter tofDigiIter(m_tofDigiCol);
53 while ((tofDigiRoot = (
TTofDigi*)tofDigiIter.Next())) {
54 unsigned int id = tofDigiRoot->
getIntId();
61 m_common.m_rootTofDigiMap[tofDigiRoot] = tofDigiTds;
68 tofDigiTdsCol->push_back(tofDigiTds);
73 return StatusCode::SUCCESS;
78 MsgStream log(
msgSvc(),
"TofDigiCnv");
79 log << MSG::DEBUG <<
"TofDigiCnv::DataObjectToTObject" << endreq;
80 StatusCode sc=StatusCode::SUCCESS;
84 log << MSG::ERROR <<
"Could not downcast to TofDigiCol" << endreq;
85 return StatusCode::FAILURE;
91 log << MSG::ERROR <<
"Could not get DigiEvent in TDS " << endreq;
92 return StatusCode::FAILURE;
96 log << MSG::ERROR <<
"TofDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
100 m_cnvSvc->getDigiCnv()->createRep(evt,addr);
105 if (!m_tofDigiCol)
return sc;
107 TofDigiCol::const_iterator tofDigiTds;
109 for (tofDigiTds = tofDigiColTds->begin(); tofDigiTds != tofDigiColTds->end(); tofDigiTds++) {
110 UInt_t overflow = (*tofDigiTds)->getOverflow();
111 UInt_t
time = (*tofDigiTds)->getTimeChannel();
112 UInt_t
charge = (*tofDigiTds)->getChargeChannel();
113 UInt_t
id = (*tofDigiTds)->getIntId();
114 Int_t trackIndex = (*tofDigiTds)->getTrackIndex();
126 return StatusCode::SUCCESS;
ObjectVector< TofDigi > TofDigiCol
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.
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)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)
void addTofDigi(TTofDigi *digi)
Add a TofDigi into the TOF Data collection.
void clearTofDigiCol()
clear the whole array
const TObjArray * getTofDigiCol() const
retrieve the whole TObjArray of TofDigi Data
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
UInt_t getOverflow() const
void setOverflow(const UInt_t overflow)
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
TofDigiCnv(ISvcLocator *svc)
static const CLID & classID()
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
void setOverflow(const unsigned int overflow)
_EXTERN_ std::string Event