1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/DataObject.h"
3#include "GaudiKernel/ObjectVector.h"
5#include "TClonesArray.h"
7#include "EventModel/EventModel.h"
8#include "LumiDigi/LumiDigi.h"
9#include "RootEventData/TLumiDigi.h"
10#include "RootCnvSvc/Digi/DigiCnv.h"
11#include "RootCnvSvc/Digi/LumiDigiCnv.h"
12#include "RootCnvSvc/RootAddress.h"
17 m_rootBranchname =
"m_lumiDigiCol";
19 m_adresses.push_back(&m_lumiDigiCol);
26 MsgStream log(
msgSvc(),
"LumiDigiCnv");
27 log << MSG::DEBUG <<
"LumiDigiCnv::TObjectToDataObject" << endreq;
28 StatusCode sc = StatusCode::SUCCESS;
31 refpObject = lumiDigiTdsCol;
33 if ( !m_lumiDigiCol )
return sc;
34 TIter lumiDigiIter(m_lumiDigiCol);
36 while ((lumiDigiRoot = (
TLumiDigi*)lumiDigiIter.Next())) {
44 lumiDigiTdsCol->push_back(lumiDigiTds);
54 MsgStream log(
msgSvc(),
"LumiDigiCnv");
55 log << MSG::DEBUG <<
"LumiDigiCnv::DataObjectToTObject" << endreq;
56 StatusCode sc = StatusCode::SUCCESS;
59 if ( !lumiDigiColTds ) {
60 log << MSG::ERROR <<
"Could not downcast to LumiDigiCol" << endreq;
61 return StatusCode::FAILURE;
67 log << MSG::ERROR <<
"Could not get DigiEvent in TDS" << endreq;
68 return StatusCode::FAILURE;
72 log << MSG::ERROR <<
"LumiDigiCnv: Could not downcast to TDS DigiEvent" << endreq;
81 if ( !m_lumiDigiCol )
return sc;
83 LumiDigiCol::const_iterator lumiDigiTds;
85 for (lumiDigiTds = lumiDigiColTds->begin(); lumiDigiTds != lumiDigiColTds->end(); ++lumiDigiTds) {
88 lumiDigiRoot->
initialize((*lumiDigiTds)->getIntId(),
89 (*lumiDigiTds)->getTimeChannel(), (*lumiDigiTds)->getChargeChannel());
90 lumiDigiRoot->
setOverflow( (*lumiDigiTds)->getOverflow() );
ObjectVector< LumiDigi > LumiDigiCol
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
LumiDigiCnv(ISvcLocator *svc)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
void setOverflow(const unsigned int overflow)
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
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void clearLumiDigiCol()
clear the whole array
void addLumiDigi(TLumiDigi *digi)
Add a LumiDigi into the MUC Data collection.
const TObjArray * getLumiDigiCol() const
retrieve the whole TObjArray of LumiDigi Data
UInt_t getOverflow() const
void setOverflow(const UInt_t overflow)
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
UInt_t getChargeChannel() const
UInt_t getTimeChannel() const
static std::map< const TObject *, const LumiDigi * > m_rootLumiDigiMap
_EXTERN_ std::string Event