BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
LumiDigiCnv Class Reference

#include <LumiDigiCnv.h>

+ Inheritance diagram for LumiDigiCnv:

Public Member Functions

virtual ~LumiDigiCnv ()
 
- Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
 
virtual ~RootEventBaseCnv ()
 
virtual long repSvcType () const
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
 
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
- Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
 

Protected Member Functions

 LumiDigiCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< LumiDigiCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootEventBaseCnv
RootCnvSvcm_cnvSvc
 
std::vector< RootCnvSvc::Leafm_leaves
 
RootInterfacem_rootInterface
 pointer to the RootInterface
 
IDataProviderSvc * m_eds
 pointer to eventdataservice
 
int m_branchNr
 the branchNr of this converter for writing
 
int m_branchNrDst
 
int m_branchNrMc
 
int m_branchNrRecon
 
int m_branchNrEvtRec
 
int m_branchNrEvtHeader
 
int m_branchNrEvtNavigator
 
TObject * m_objRead
 the object that was read
 
CLID CLID_top
 the CLID of the upper converter if any
 
TArrayS * m_branchNumbers
 array with number of branches for reading
 
std::string m_rootBranchname
 root branchname (may be concatenated of severals)
 
std::string m_rootTreename
 each converter knows it's treename
 
std::string m_currentFileName
 
std::vector< void * > m_adresses
 each converter knows the corresponding adresses
 
RootEvtSelectorm_evtsel
 

Detailed Description

Definition at line 15 of file LumiDigiCnv.h.

Constructor & Destructor Documentation

◆ ~LumiDigiCnv()

virtual LumiDigiCnv::~LumiDigiCnv ( )
inlinevirtual

Definition at line 25 of file LumiDigiCnv.h.

25{ };

◆ LumiDigiCnv()

LumiDigiCnv::LumiDigiCnv ( ISvcLocator *  svc)
protected

Definition at line 14 of file LumiDigiCnv.cxx.

16{
17 m_rootBranchname = "m_lumiDigiCol";
18
19 m_adresses.push_back(&m_lumiDigiCol);
20 m_lumiDigiCol = 0;
21}
static const CLID & classID()
Definition: LumiDigiCnv.h:20
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & LumiDigiCnv::classID ( )
inlinestatic

Definition at line 20 of file LumiDigiCnv.h.

21 {
22 return CLID_LumiDigiCol;
23 }
const CLID & CLID_LumiDigiCol
Definition: EventModel.cxx:243

◆ DataObjectToTObject()

StatusCode LumiDigiCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 52 of file LumiDigiCnv.cxx.

52 {
53
54 MsgStream log(msgSvc(), "LumiDigiCnv");
55 log << MSG::DEBUG << "LumiDigiCnv::DataObjectToTObject" << endreq;
56 StatusCode sc = StatusCode::SUCCESS;
57
58 LumiDigiCol* lumiDigiColTds = dynamic_cast<LumiDigiCol*>(obj);
59 if ( !lumiDigiColTds ) {
60 log << MSG::ERROR << "Could not downcast to LumiDigiCol" << endreq;
61 return StatusCode::FAILURE;
62 }
63
64 DataObject* evt;
65 m_eds->findObject(EventModel::Digi::Event, evt);
66 if ( evt == NULL ) {
67 log << MSG::ERROR << "Could not get DigiEvent in TDS" << endreq;
68 return StatusCode::FAILURE;
69 }
70 DigiEvent* devtTds = dynamic_cast<DigiEvent*>(evt);
71 if ( !devtTds ) {
72 log << MSG::ERROR << "LumiDigiCnv: Could not downcast to TDS DigiEvent" << endreq;
73 }
74 IOpaqueAddress* addr;
75
76 m_cnvSvc->getDigiCnv()->createRep(evt, addr);
77
79
80 const TObjArray* m_lumiDigiCol = recEvt->getLumiDigiCol();
81 if ( !m_lumiDigiCol ) return sc;
82 recEvt->clearLumiDigiCol();
83 LumiDigiCol::const_iterator lumiDigiTds;
84
85 for (lumiDigiTds = lumiDigiColTds->begin(); lumiDigiTds != lumiDigiColTds->end(); ++lumiDigiTds) {
86 TLumiDigi* lumiDigiRoot = new TLumiDigi();
87
88 lumiDigiRoot->initialize((*lumiDigiTds)->getIntId(),
89 (*lumiDigiTds)->getTimeChannel(), (*lumiDigiTds)->getChargeChannel());
90 lumiDigiRoot->setOverflow( (*lumiDigiTds)->getOverflow() );
91
92 recEvt->addLumiDigi(lumiDigiRoot);
93 }
94
95 return sc;
96}
ObjectVector< LumiDigi > LumiDigiCol
Definition: LumiDigi.h:36
IMessageSvc * msgSvc()
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: DigiCnv.h:35
DigiCnv * getDigiCnv()
Definition: RootCnvSvc.h:147
RootCnvSvc * m_cnvSvc
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
Definition: TDigiEvent.h:89
void addLumiDigi(TLumiDigi *digi)
Add a LumiDigi into the MUC Data collection.
Definition: TDigiEvent.cxx:165
const TObjArray * getLumiDigiCol() const
retrieve the whole TObjArray of LumiDigi Data
Definition: TDigiEvent.h:80
void setOverflow(const UInt_t overflow)
Definition: TLumiDigi.cxx:13
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
Definition: TRawData.cxx:34
_EXTERN_ std::string Event
Definition: EventModel.h:56

◆ TObjectToDataObject()

StatusCode LumiDigiCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 23 of file LumiDigiCnv.cxx.

23 {
24 // creation of TDS object from root object
25
26 MsgStream log(msgSvc(), "LumiDigiCnv");
27 log << MSG::DEBUG << "LumiDigiCnv::TObjectToDataObject" << endreq;
28 StatusCode sc = StatusCode::SUCCESS;
29
30 LumiDigiCol* lumiDigiTdsCol = new LumiDigiCol;
31 refpObject = lumiDigiTdsCol;
32
33 if ( !m_lumiDigiCol ) return sc;
34 TIter lumiDigiIter(m_lumiDigiCol);
35 TLumiDigi* lumiDigiRoot = 0;
36 while ((lumiDigiRoot = (TLumiDigi*)lumiDigiIter.Next())) {
37 LumiDigi* lumiDigiTds = new LumiDigi( lumiDigiRoot->getIntId() );
38 m_common.m_rootLumiDigiMap[lumiDigiRoot] = lumiDigiTds;
39
40 lumiDigiTds->setTimeChannel( lumiDigiRoot->getTimeChannel() );
41 lumiDigiTds->setChargeChannel( lumiDigiRoot->getChargeChannel() );
42 lumiDigiTds->setOverflow( lumiDigiRoot->getOverflow() );
43
44 lumiDigiTdsCol->push_back(lumiDigiTds);
45 }
46
47 delete m_lumiDigiCol;
48 m_lumiDigiCol = 0;
49 return sc;
50}
void setOverflow(const unsigned int overflow)
Definition: LumiDigi.h:19
void setChargeChannel(const unsigned int chargeChannel)
Definition: RawData.cxx:30
void setTimeChannel(const unsigned int timeChannel)
Definition: RawData.cxx:25
UInt_t getOverflow() const
Definition: TLumiDigi.cxx:17
UInt_t getIntId() const
Definition: TRawData.cxx:50
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55
static std::map< const TObject *, const LumiDigi * > m_rootLumiDigiMap
Definition: commonData.h:136

Friends And Related Function Documentation

◆ CnvFactory< LumiDigiCnv >

friend class CnvFactory< LumiDigiCnv >
friend

Definition at line 9 of file LumiDigiCnv.h.


The documentation for this class was generated from the following files: