2#define TofDigiCnv_CXX 1
4#include "GaudiKernel/DataObject.h"
5#include "GaudiKernel/MsgStream.h"
6#include "GaudiKernel/ObjectVector.h"
8#include "TClonesArray.h"
10#include "EventModel/EventModel.h"
11#include "RawEvent/DigiEvent.h"
12#include "RootCnvSvc/Digi/DigiCnv.h"
13#include "RootCnvSvc/Digi/TofDigiCnv.h"
14#include "RootCnvSvc/RootAddress.h"
15#include "RootEventData/TDigiEvent.h"
16#include "RootEventData/TTofDigi.h"
17#include "TofRawEvent/TofDigi.h"
26 MsgStream log(
msgSvc(),
"TofDigiCnv" );
37 MsgStream log(
msgSvc(),
"TofDigiCnv" );
38 log << MSG::DEBUG <<
"TofDigiCnv::TObjectToDataObject" << endmsg;
39 StatusCode sc = StatusCode::SUCCESS;
43 refpObject = tofDigiTdsCol;
46 if ( !m_tofDigiCol )
return sc;
47 TIter tofDigiIter( m_tofDigiCol );
49 while ( ( tofDigiRoot = (
TTofDigi*)tofDigiIter.Next() ) )
51 unsigned int id = tofDigiRoot->
getIntId();
58 m_common.m_rootTofDigiMap[tofDigiRoot] = tofDigiTds;
65 tofDigiTdsCol->push_back( tofDigiTds );
70 return StatusCode::SUCCESS;
75 MsgStream log(
msgSvc(),
"TofDigiCnv" );
76 log << MSG::DEBUG <<
"TofDigiCnv::DataObjectToTObject" << endmsg;
77 StatusCode sc = StatusCode::SUCCESS;
82 log << MSG::ERROR <<
"Could not downcast to TofDigiCol" << endmsg;
83 return StatusCode::FAILURE;
90 log << MSG::ERROR <<
"Could not get DigiEvent in TDS " << endmsg;
91 return StatusCode::FAILURE;
95 { log << MSG::ERROR <<
"TofDigiCnv:Could not downcast to TDS DigiEvent" << endmsg; }
98 m_cnvSvc->getDigiCnv()->createRep( evt, addr );
103 if ( !m_tofDigiCol )
return sc;
106 TofDigiCol::const_iterator tofDigiTds;
108 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.
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)
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