BOSS 7.0.2
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 ()
 
virtual ~TrigDataCnv ()
 
- 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
 
 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
 
destinationoperator (const source &) const
 

Static Public Member Functions

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.
 

Protected Member Functions

 TrigDataCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 TrigDataCnv (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
 
virtual destinationconvert (const source &) const =0
 

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

Concrete converter for the TrigData.

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Trig/TrigDataCnv.h.

Constructor & Destructor Documentation

◆ ~TrigDataCnv() [1/2]

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

◆ TrigDataCnv() [1/2]

TrigDataCnv::TrigDataCnv ( ISvcLocator *  svc)
protected

Definition at line 22 of file TrigDataCnv.cxx.

24{
25 // Here we associate this converter with the /Event path on the TDS.
26 MsgStream log(msgSvc(), "TrigDataCnv");
27 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
28 m_rootBranchname ="m_trigData";
29 //declareObject(EventModel::MC::TrigDataCol, objType(), m_rootTreename, m_rootBranchname);
30 m_adresses.push_back(&m_trigData);
31 m_trigData=0;
32}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~TrigDataCnv() [2/2]

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

◆ TrigDataCnv() [2/2]

TrigDataCnv::TrigDataCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & TrigDataCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Trig/TrigDataCnv.h.

26 {
27 return CLID_TrigData;
28 }
const CLID & CLID_TrigData
Definition: EventModel.cxx:280

◆ classID() [2/2]

static const CLID & TrigDataCnv::classID ( )
inlinestatic

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

26 {
27 return CLID_TrigData;
28 }

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 67 of file TrigDataCnv.cxx.

67 {
68
69 MsgStream log(msgSvc(), "TrigDataCnv");
70 log << MSG::DEBUG << "TrigDataCnv::DataObjectToTObject" << endreq;
71 StatusCode sc=StatusCode::SUCCESS;
72
73 TrigData * trigDataCnvTds=dynamic_cast<TrigData*> (obj);
74 if (!trigDataCnvTds) {
75 log << MSG::ERROR << "Could not downcast to TrigData" << endreq;
76 return StatusCode::FAILURE;
77 }
78
79 DataObject *evt;
80 m_eds->findObject(EventModel::Trig::Event,evt);
81 if (evt==NULL) {
82 log << MSG::ERROR << "Could not get TrigEvent in TDS " << endreq;
83 return StatusCode::FAILURE;
84 }
85
86 TrigEvent * devtTds=dynamic_cast<TrigEvent *> (evt);
87 if (!devtTds) {
88 log << MSG::ERROR << "TrigDataCnv:Could not downcast to TDS TrigEvent" << endreq;
89 }
90
91 IOpaqueAddress *addr;
92 m_cnvSvc->getTrigCnv()->createRep(evt,addr);
93
95
96 const TObject *ttrigData = TrigEvt->getTrigData();
97 if (!ttrigData) return sc;
98
99 const int* trigCond = trigDataCnvTds->getTrigCondition();
100 const int* trigChan = trigDataCnvTds->getTrigChannel();
101 int timewindow = trigDataCnvTds->getTimeWindow();
102 int timing = trigDataCnvTds->getTimingType();
103 bool prescale = trigDataCnvTds->getPreScale();
104
105 TTrigData *trigDataRoot = new TTrigData();
106
107 trigDataRoot->setTrigCondition(trigCond);
108 trigDataRoot->setTrigChannel(trigChan);
109 trigDataRoot->setTimeWindow(timewindow);
110 trigDataRoot->setTimingType(timing);
111 trigDataRoot->setPreScale(prescale);
112
113 TrigEvt->addTrigData(trigDataRoot);
114
115 return StatusCode::SUCCESS;
116}
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const TTrigData * getTrigData() const
Definition: TTrigEvent.cxx:50
void addTrigData(TTrigData *trigData)
TrigData.
Definition: TTrigEvent.cxx:45
static TTrigEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 34 of file TrigDataCnv.cxx.

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

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< TrigDataCnv >


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