BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
RecZddChannelCnv Class Reference

#include <RecZddChannelCnv.h>

+ Inheritance diagram for RecZddChannelCnv:

Public Member Functions

virtual ~RecZddChannelCnv ()
 
- 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

 RecZddChannelCnv (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< RecZddChannelCnv >
 

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 14 of file RecZddChannelCnv.h.

Constructor & Destructor Documentation

◆ ~RecZddChannelCnv()

virtual RecZddChannelCnv::~RecZddChannelCnv ( )
inlinevirtual

Definition at line 22 of file RecZddChannelCnv.h.

22{}

◆ RecZddChannelCnv()

RecZddChannelCnv::RecZddChannelCnv ( ISvcLocator *  svc)
protected

Definition at line 8 of file RecZddChannelCnv.cxx.

10{
11 m_rootBranchname = "m_recZddChannelCol";
12 m_adresses.push_back(&m_recZddChannelCol);
13 m_recZddChannelCol = 0;
14}
static const CLID & classID()
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 & RecZddChannelCnv::classID ( )
inlinestatic

Definition at line 20 of file RecZddChannelCnv.h.

20{ return CLID_RecZddChannelCol; }
const CLID & CLID_RecZddChannelCol
Definition: EventModel.cxx:367

◆ DataObjectToTObject()

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 49 of file RecZddChannelCnv.cxx.

50{
51 MsgStream log(msgSvc(), "RecZddChannelCnv");
52 log << MSG::DEBUG << "RecZddChannelCnv::DataObjectToTObject" << endreq;
53
54 RecZddChannelCol* zddCol = dynamic_cast<RecZddChannelCol*>(obj);
55 if ( ! zddCol ) {
56 log << MSG::ERROR << "Could not downcast to RecZddChannelCol" << endreq;
57 return StatusCode::FAILURE;
58 }
59
60 DataObject* evt;
61 m_eds->findObject(EventModel::Recon::Event, evt);
62 if ( evt == NULL ) {
63 log << MSG::ERROR << "Could not get ReconEvent in TDS" << endreq;
64 return StatusCode::FAILURE;
65 }
66 IOpaqueAddress *addr;
67 m_cnvSvc->getRecTrackCnv()->createRep(evt, addr);
69
70 const TObjArray* m_recZddChannelCol = recEvt->getRecZddChannelCol();
71 if ( ! m_recZddChannelCol ) return StatusCode::SUCCESS;
72
73 //convert
74 recEvt->clearRecZddChannelCol();
75 RecZddChannelCol::const_iterator zdd = zddCol->begin();
76
77 for ( ; zdd != zddCol->end(); ++zdd ) {
78 RecZddChannel* pzdd = *zdd;
79 TRecZddChannel* zddRoot = new TRecZddChannel();
80
81 zddRoot->setChannelId(pzdd->channelId());
82 zddRoot->setBaseLine(pzdd->baseLine());
83 zddRoot->setPhase(pzdd->phase());
84 zddRoot->setFragments(pzdd->fragments());
85
86 recEvt->addRecZddChannel(zddRoot);
87 }
88
89 return StatusCode::SUCCESS;
90}
ObjectVector< RecZddChannel > RecZddChannelCol
Definition: RecZddChannel.h:50
IMessageSvc * msgSvc()
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: RecTrackCnv.h:36
int phase() const
Definition: RecZddChannel.h:29
int baseLine() const
Definition: RecZddChannel.h:28
int channelId() const
Definition: RecZddChannel.h:26
const std::vector< FragType > & fragments() const
Definition: RecZddChannel.h:30
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:173
RootCnvSvc * m_cnvSvc
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const TObjArray * getRecZddChannelCol() const
void addRecZddChannel(TRecZddChannel *dtag)
void clearRecZddChannelCol()
void setPhase(int phase)
void setFragments(const Fragments &frags)
void setBaseLine(int baseLine)
void setChannelId(int chId)
_EXTERN_ std::string Event
Definition: EventModel.h:84

◆ TObjectToDataObject()

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 16 of file RecZddChannelCnv.cxx.

17{
18 MsgStream log(msgSvc(), "RecZddChannelCnv");
19 log << MSG::DEBUG << "RecZddChannelCnv::TObjectToDataObject" << endreq;
20
22 refpObject = zddCol;
23
24 if ( ! m_recZddChannelCol ) return StatusCode::SUCCESS;
25
26 // convert
27 TIter zddIter(m_recZddChannelCol);
28 TRecZddChannel* zddRoot = 0;
29 while ( (zddRoot = (TRecZddChannel*)zddIter.Next()) ) {
30 RecZddChannel* zddTDS = new RecZddChannel;
31 m_common.m_rootRecZddChannelMap[zddRoot] = zddTDS;
32
33 // settings
34 zddTDS->setChannelId(zddRoot->channelId());
35 zddTDS->setScanCode(zddRoot->scanCode());
36 zddTDS->setBaseLine(zddRoot->baseLine());
37 zddTDS->setPhase(zddRoot->phase());
38 zddTDS->setFragments(zddRoot->fragments());
39
40 zddCol->push_back(zddTDS);
41 }
42
43 delete m_recZddChannelCol;
44 m_recZddChannelCol = 0;
45
46 return StatusCode::SUCCESS;
47}
void setBaseLine(int baseLine)
Definition: RecZddChannel.h:34
void setPhase(int phase)
Definition: RecZddChannel.h:35
void setScanCode(int scanCode)
Definition: RecZddChannel.h:33
void setFragments(const std::vector< FragType > &frags)
Definition: RecZddChannel.h:36
void setChannelId(int chId)
Definition: RecZddChannel.h:32
Int_t baseLine() const
Int_t channelId() const
Int_t phase() const
const Fragments & fragments() const
Int_t scanCode() const
static std::map< const TObject *, const RecZddChannel * > m_rootRecZddChannelMap
Definition: commonData.h:251

Friends And Related Function Documentation

◆ CnvFactory< RecZddChannelCnv >

friend class CnvFactory< RecZddChannelCnv >
friend

Definition at line 9 of file RecZddChannelCnv.h.


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