BOSS 7.0.6
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 ()
 
- 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

 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
 

Friends

class CnvFactory< TrigDataCnv >
 

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

Concrete converter for the TrigData.

Definition at line 20 of file TrigDataCnv.h.

Constructor & Destructor Documentation

◆ ~TrigDataCnv()

virtual TrigDataCnv::~TrigDataCnv ( )
inlinevirtual

Definition at line 30 of file TrigDataCnv.h.

30{ };

◆ TrigDataCnv()

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}
IMessageSvc * msgSvc()
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)
static const CLID & classID()
Definition: TrigDataCnv.h:25

Member Function Documentation

◆ classID()

static const CLID & TrigDataCnv::classID ( )
inlinestatic

Definition at line 25 of file TrigDataCnv.h.

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

◆ DataObjectToTObject()

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}
TrigCnv * getTrigCnv()
Definition: RootCnvSvc.h:157
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 setTimeWindow(int i)
Definition: TTrigData.h:24
void setPreScale(bool i)
Definition: TTrigData.h:26
void setTrigCondition(int i, int j)
Definition: TTrigData.h:20
void setTrigChannel(int i, int j)
Definition: TTrigData.h:22
void setTimingType(int i)
Definition: TTrigData.h:25
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)
Definition: TrigCnv.h:35
const int getTimeWindow() const
Definition: TrigData.h:37
const int getTimingType() const
Definition: TrigData.h:38
const int getTrigCondition(int i) const
Definition: TrigData.h:33
const int getTrigChannel(int i) const
Definition: TrigData.h:35
const bool getPreScale() const
Definition: TrigData.h:39
_EXTERN_ std::string Event
Definition: EventModel.h:66

◆ TObjectToDataObject()

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}
const bool getPreScale() const
Definition: TTrigData.h:35
const int getTrigChannel(int i) const
Definition: TTrigData.h:31
const int getTimeWindow() const
Definition: TTrigData.h:33
const int getTrigCondition(int i) const
Definition: TTrigData.h:29
const int getTimingType() const
Definition: TTrigData.h:34
void setTimingType(int i)
Definition: TrigData.h:29
void setPreScale(bool i)
Definition: TrigData.h:30
void setTrigCondition(int i, int j)
Definition: TrigData.h:24
void setTimeWindow(int i)
Definition: TrigData.h:28
void setTrigChannel(int i, int j)
Definition: TrigData.h:26

Friends And Related Function Documentation

◆ CnvFactory< TrigDataCnv >

friend class CnvFactory< TrigDataCnv >
friend

Definition at line 10 of file TrigDataCnv.h.


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