2#define TofDigiCnv_CXX 1
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
6#include "GaudiKernel/ObjectVector.h"
8#include "TClonesArray.h"
10#include "EventModel/EventModel.h"
11#include "RawEvent/DigiEvent.h"
12#include "TofRawEvent/TofDigi.h"
13#include "RootEventData/TTofDigi.h"
14#include "RootEventData/TDigiEvent.h"
15#include "RootCnvSvc/Digi/DigiCnv.h"
16#include "RootCnvSvc/Digi/TofDigiCnv.h"
17#include "RootCnvSvc/RootAddress.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();
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;
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
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
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.
IDataProviderSvc * m_eds
pointer to eventdataservice
std::vector< void * > m_adresses
each converter knows the corresponding adresses
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 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)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
void setOverflow(const unsigned int overflow)
static std::map< const TObject *, const TofDigi * > m_rootTofDigiMap
_EXTERN_ std::string Event