2#define MucDigiCnv_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 "MucRawEvent/MucDigi.h"
13#include "RootEventData/TMucDigi.h"
14#include "RootEventData/TDigiEvent.h"
15#include "RootCnvSvc/Digi/DigiCnv.h"
16#include "RootCnvSvc/Digi/MucDigiCnv.h"
17#include "RootCnvSvc/RootAddress.h"
29 MsgStream log(
msgSvc(),
"MucDigiCnv");
41 MsgStream log(
msgSvc(),
"MucDigiCnv");
42 log << MSG::DEBUG <<
"MucDigiCnv::TObjectToDataObject" << endreq;
43 StatusCode sc=StatusCode::SUCCESS;
47 refpObject=mucDigiTdsCol;
51 if (!m_mucDigiCol)
return sc;
52 TIter mucDigiIter(m_mucDigiCol);
54 while ((mucDigiRoot = (
TMucDigi*)mucDigiIter.Next())) {
55 unsigned int id = mucDigiRoot->
getIntId();
66 mucDigiTdsCol->push_back(mucDigiTds);
71 return StatusCode::SUCCESS;
76 MsgStream log(
msgSvc(),
"MucDigiCnv");
77 log << MSG::DEBUG <<
"MucDigiCnv::DataObjectToTObject" << endreq;
78 StatusCode sc=StatusCode::SUCCESS;
82 log << MSG::ERROR <<
"Could not downcast to MucDigiCol" << endreq;
83 return StatusCode::FAILURE;
89 log << MSG::ERROR <<
"Could not get DigiEvent in TDS " << endreq;
90 return StatusCode::FAILURE;
94 log << MSG::ERROR <<
"MucDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
102 if (!m_mucDigiCol)
return sc;
104 MucDigiCol::const_iterator mucDigiTds;
106 for (mucDigiTds = mucDigiColTds->begin(); mucDigiTds != mucDigiColTds->end(); mucDigiTds++) {
107 UInt_t
time = (*mucDigiTds)->getTimeChannel();
108 UInt_t
charge = (*mucDigiTds)->getChargeChannel();
109 UInt_t
id = (*mucDigiTds)->getIntId();
110 Int_t trackIndex = (*mucDigiTds)->getTrackIndex();
120 return StatusCode::SUCCESS;
ObjectVector< MucDigi > MucDigiCol
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
MucDigiCnv(ISvcLocator *svc)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
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.
const TObjArray * getMucDigiCol() const
retrieve the whole TObjArray of MucDigi Data
void addMucDigi(TMucDigi *digi)
Add a MucDigi into the MUC Data collection.
void clearMucDigiCol()
clear the whole array
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 MucDigi * > m_rootMucDigiMap
_EXTERN_ std::string Event