BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigDataCnv Class Reference

Concrete converter for the TrigData. More...

#include <TrigDataCnv.h>

Inheritance diagram for TrigDataCnv:

Public Member Functions

virtual ~TrigDataCnv ()
 TrigDataCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~TrigDataCnv ()
 TrigDataCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~TrigDataCnv ()
 TrigDataCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
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.
TObject * getReadObject () const
 get the object to be read
 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.
TObject * getReadObject () const
 get the object to be read
 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.
TObject * getReadObject () const
 get the object to be read
Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
destinationoperator (const source &) const
destinationoperator (const source &) const

Static Public Member Functions

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

Friends

class CnvFactory< TrigDataCnv >

Additional Inherited Members

Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RootEventBaseCnv
IRootCnvSvcm_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

Concrete converter for the TrigData.

Definition at line 20 of file Event/RootCnvSvc/include/RootCnvSvc/Trig/TrigDataCnv.h.

Constructor & Destructor Documentation

◆ ~TrigDataCnv() [1/3]

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

◆ TrigDataCnv() [1/3]

TrigDataCnv::TrigDataCnv ( ISvcLocator * svc)

Definition at line 21 of file TrigDataCnv.cxx.

21 : RootEventBaseCnv( classID(), svc ) {
22 // Here we associate this converter with the /Event path on the TDS.
23 MsgStream log( msgSvc(), "TrigDataCnv" );
24 // log << MSG::DEBUG << "Constructor called for " << objType() << endmsg;
25 m_rootBranchname = "m_trigData";
26 // declareObject(EventModel::MC::TrigDataCol, objType(), m_rootTreename, m_rootBranchname);
27 m_adresses.push_back( &m_trigData );
28 m_trigData = 0;
29}
IMessageSvc * msgSvc()
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)

◆ ~TrigDataCnv() [2/3]

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

◆ TrigDataCnv() [2/3]

TrigDataCnv::TrigDataCnv ( ISvcLocator * svc)

◆ ~TrigDataCnv() [3/3]

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

◆ TrigDataCnv() [3/3]

TrigDataCnv::TrigDataCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & TrigDataCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/include/RootCnvSvc/Trig/TrigDataCnv.h.

25{ return CLID_TrigData; }
const CLID & CLID_TrigData

Referenced by RootCnvSvc::createConverter(), and TrigDataCnv().

◆ classID() [2/3]

const CLID & TrigDataCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & TrigDataCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

StatusCode TrigDataCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 63 of file TrigDataCnv.cxx.

63 {
64
65 MsgStream log( msgSvc(), "TrigDataCnv" );
66 log << MSG::DEBUG << "TrigDataCnv::DataObjectToTObject" << endmsg;
67 StatusCode sc = StatusCode::SUCCESS;
68
69 TrigData* trigDataCnvTds = dynamic_cast<TrigData*>( obj );
70 if ( !trigDataCnvTds )
71 {
72 log << MSG::ERROR << "Could not downcast to TrigData" << endmsg;
73 return StatusCode::FAILURE;
74 }
75
76 DataObject* evt;
77 m_eds->findObject( EventModel::Trig::Event, evt );
78 if ( evt == NULL )
79 {
80 log << MSG::ERROR << "Could not get TrigEvent in TDS " << endmsg;
81 return StatusCode::FAILURE;
82 }
83
84 TrigEvent* devtTds = dynamic_cast<TrigEvent*>( evt );
85 if ( !devtTds )
86 { log << MSG::ERROR << "TrigDataCnv:Could not downcast to TDS TrigEvent" << endmsg; }
87
88 IOpaqueAddress* addr;
89 m_cnvSvc->getTrigCnv()->createRep( evt, addr );
90
91 TTrigEvent* TrigEvt = m_cnvSvc->getTrigCnv()->getWriteObject();
92
93 const TObject* ttrigData = TrigEvt->getTrigData();
94 if ( !ttrigData ) return sc;
95
96 const int* trigCond = trigDataCnvTds->getTrigCondition();
97 const int* trigChan = trigDataCnvTds->getTrigChannel();
98 int timewindow = trigDataCnvTds->getTimeWindow();
99 int timing = trigDataCnvTds->getTimingType();
100 bool prescale = trigDataCnvTds->getPreScale();
101
102 TTrigData* trigDataRoot = new TTrigData();
103
104 trigDataRoot->setTrigCondition( trigCond );
105 trigDataRoot->setTrigChannel( trigChan );
106 trigDataRoot->setTimeWindow( timewindow );
107 trigDataRoot->setTimingType( timing );
108 trigDataRoot->setPreScale( prescale );
109
110 TrigEvt->addTrigData( trigDataRoot );
111
112 return StatusCode::SUCCESS;
113}
IDataProviderSvc * m_eds
pointer to eventdataservice
const TTrigData * getTrigData() const
void addTrigData(TTrigData *trigData)
TrigData.
const int getTrigCondition(int i) const
const int getTrigChannel(int i) const

◆ DataObjectToTObject() [2/3]

virtual StatusCode TrigDataCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

virtual StatusCode TrigDataCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode TrigDataCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 31 of file TrigDataCnv.cxx.

31 {
32 // creation of TDS object from root object
33
34 MsgStream log( msgSvc(), "TrigDataCnv" );
35 log << MSG::DEBUG << "TrigDataCnv::TObjectToDataObject" << endmsg;
36 StatusCode sc = StatusCode::SUCCESS;
37
38 // create the TDS location for the trigger data
39 TrigData* trigDataTds = new TrigData;
40 refpObject = trigDataTds;
41
42 // now convert
43 if ( !m_trigData ) return sc;
44
45 const int* trigCond = m_trigData->getTrigCondition();
46 const int* trigChan = m_trigData->getTrigChannel();
47 int timewindow = m_trigData->getTimeWindow();
48 int timing = m_trigData->getTimingType();
49 bool prescale = m_trigData->getPreScale();
50
51 trigDataTds->setTrigCondition( trigCond );
52 trigDataTds->setTrigChannel( trigChan );
53 trigDataTds->setTimeWindow( timewindow );
54 trigDataTds->setTimingType( timing );
55 trigDataTds->setPreScale( prescale );
56
57 delete m_trigData;
58 m_trigData = 0;
59
60 return StatusCode::SUCCESS;
61}

◆ TObjectToDataObject() [2/3]

virtual StatusCode TrigDataCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode TrigDataCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ CnvFactory< TrigDataCnv >

friend class CnvFactory< TrigDataCnv >
friend

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