BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataMdcDigiCnv Class Reference

#include <RawDataMdcDigiCnv.h>

+ Inheritance diagram for RawDataMdcDigiCnv:

Public Member Functions

StatusCode initialize ()
 
virtual long repSvcType () const
 
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
 
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
 override the RawDataBaseCnv version
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
 Convert the transient object to the requested representation.
 
- Public Member Functions inherited from RawDataBaseCnv
 RawDataBaseCnv (ISvcLocator *svc)
 
 RawDataBaseCnv (unsigned char storageType, const CLID &clid, ISvcLocator *svc)
 
virtual ~RawDataBaseCnv ()
 
StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &bank, long par=0)
 Store TDS path to link a particular converter to an object on the TDS.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the converted representation of a transient object.
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the references of an already converted object.
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
static const unsigned char storageType ()
 
- Static Public Member Functions inherited from RawDataBaseCnv
static const long storageType ()
 
static const CLID & classID ()
 

Protected Member Functions

 RawDataMdcDigiCnv (ISvcLocator *svc)
 
 ~RawDataMdcDigiCnv ()
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RawDataMdcDigiCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RawDataBaseCnv
IRawDataCnvSvcm_CnvSvc
 Pointer to event conversion service interface.
 
std::vector< IRawDataCnvSvc::Leafm_leaves
 Leaf objects giving the locations of the objects in the data store.
 

Detailed Description

Definition at line 30 of file RawDataMdcDigiCnv.h.

Constructor & Destructor Documentation

◆ RawDataMdcDigiCnv()

RawDataMdcDigiCnv::RawDataMdcDigiCnv ( ISvcLocator * svc)
protected

Definition at line 32 of file RawDataMdcDigiCnv.cxx.

32 :
34{
35 PropertyMgr m_propMgr;
36 m_propMgr.declareProperty("ExWireFromRun", m_runFrom = 0 );
37 m_propMgr.declareProperty("ExWireToRun", m_runTo = 999999);
38
39 IJobOptionsSvc* jobSvc;
40 serviceLocator()->service("JobOptionsSvc", jobSvc);
41 jobSvc->setMyProperties("RawDataMdcDigiCnv", &m_propMgr);
42}
unsigned const long PACKEDRAWEVENT_StorageType
RawDataBaseCnv(ISvcLocator *svc)
static const CLID & classID()

◆ ~RawDataMdcDigiCnv()

RawDataMdcDigiCnv::~RawDataMdcDigiCnv ( )
protected

Definition at line 44 of file RawDataMdcDigiCnv.cxx.

45{
47}
static void destroy()

Member Function Documentation

◆ classID()

const CLID & RawDataMdcDigiCnv::classID ( )
static

Definition at line 51 of file RawDataMdcDigiCnv.cxx.

52{
53 return CLID_MdcDigiCol;
54}
const CLID & CLID_MdcDigiCol

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

StatusCode RawDataMdcDigiCnv::createObj ( IOpaqueAddress * pAddr,
DataObject *& pObj )

Definition at line 120 of file RawDataMdcDigiCnv.cxx.

121{
122 //MsgStream log(msgSvc(), "RawDataMdcDigiCnv");
123
124 // Purpose and Method: This converter will create an empty MdcDigiCol on
125 // the TDS.
126 MdcDigiCol *digiCol = new MdcDigiCol;
127 pObj = digiCol;
128
129 RAWEVENT* evt = m_inputSvc->currentEvent();
130
131 if (evt == NULL) {
132 //log << MSG::ERROR << "RawDataMdcDigiCnv::createObj has event!" << endreq;
133 return StatusCode::FAILURE;
134 }
135
136 int runId = evt->eventHeader().run_number();
137 m_cnv->setRunId(runId);
138
139 const BufferHolder& mdcBuf = evt->getMdcBuf();
140
141 return m_cnv->convert(mdcBuf, digiCol);
142}
ObjectVector< MdcDigi > MdcDigiCol
Definition MdcDigi.h:39
#define NULL
StatusCode convert(const BufferHolder &src, MdcDigiCol *des)
void setRunId(int runId)
uint32_t run_number() const
Definition RAWEVENT.h:22
const BufferHolder & getMdcBuf() const
Definition RAWEVENT.h:95
const RawEventHeader & eventHeader() const
Definition RAWEVENT.h:93
virtual RAWEVENT * currentEvent()

◆ createRep()

StatusCode RawDataMdcDigiCnv::createRep ( DataObject * pObject,
IOpaqueAddress *& refpAddress )
virtual

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 144 of file RawDataMdcDigiCnv.cxx.

145{
146 // convert PixelRaw in the container into ByteStream
147 MsgStream log(messageService(), "RawDataMdcDigiCnv");
148
149 WriteRawEvent*& re = m_RawDataAccess->getRawEvent();
150 if (re == 0) {
151 log << " get RawEvent failed !" << endreq;
152 return StatusCode::FAILURE;
153 }
154
155 SmartDataPtr<MdcDigiCol> digiCol(dataProvider(), EventModel::Digi::MdcDigiCol);
156 if (digiCol == 0) {
157 log << "no MdcDigiCol found" << endreq;
158 return StatusCode::FAILURE;
159 }
160 /*
161 else {
162 log << MSG::DEBUG << endreq << "Detailed dump of 1st event: " << endreq << endreq;
163 int ndigi = 0;
164 MdcDigiCol::const_iterator pMdcDigi = digiCol->begin();
165 for (pMdcDigi; pMdcDigi!= digiCol->end(); pMdcDigi++) {
166 log <<MSG::INFO << "Digi " << ndigi++ << " ";
167 // output the digi proper: " << digi " no longer works because
168 // "digi" now returns an integer sort order
169 (**pMdcDigi).fillStream(log.stream());
170 log << endreq;
171 }
172 }
173 */
174
175 return m_cnv->convert(digiCol, re);
176}
virtual WriteRawEvent *& getRawEvent()
_EXTERN_ std::string MdcDigiCol
Definition EventModel.h:57

◆ initialize()

StatusCode RawDataMdcDigiCnv::initialize ( )

Definition at line 56 of file RawDataMdcDigiCnv.cxx.

57{
58 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
59 std::string RawDataInputSvc_Name("RawDataInputSvc");
60 std::string RawDataMdcDigiCnv_Name("RawDataMdcDigiCnv");
61
62 // for Mutil-thread by tianhl
63 //ConversionSvc* pCnvSvc = 0;
64 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
65 SmartIF<IService> pCnvSvc(conversionSvc());
66 if (isGaudiThreaded(pCnvSvc->name())){
67 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
68 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
69 RawDataMdcDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
70 }
71 //}
72
73
74 StatusCode sc = RawDataBaseCnv::initialize();
75 if ( sc.isFailure() ) {
76 return sc;
77 }
78
79 MsgStream log(messageService(), RawDataMdcDigiCnv_Name.c_str());
80
81 // Check RawDataCnvSvc
82 IService* isvc = 0;
83 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
84 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
85 if(m_RawDataAccess == 0 ) {
86 log<<MSG::ERROR<< " RawDataMdcCnv: Cant cast to RawDataCnvSvc " <<endreq;
87 return StatusCode::FAILURE ;
88 }
89
90 IService* svc ;
91 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
92 //if ( sc.isFailure() ) {
93 // log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
94 // return sc ;
95 //}
96 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
97 if(m_inputSvc == 0 ) {
98 log<<MSG::WARNING<< " Cant cast to RawDataInputSvc " <<endreq;
99 return StatusCode::FAILURE ;
100 }
101
102 m_cnv = MdcConverter::instance( m_inputSvc->runMode() );
103
104 m_cnv->init(m_inputSvc->config("MDCID_FIX"));
105
106 return StatusCode::SUCCESS;
107}
static MdcConverter * instance(int runMode=2)
void init(const SniperJSON &config)
StatusCode initialize()
const SniperJSON & config(const std::string &key)

◆ repSvcType()

virtual long RawDataMdcDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 46 of file RawDataMdcDigiCnv.h.

46 {
48 }

◆ storageType()

static const unsigned char RawDataMdcDigiCnv::storageType ( )
inlinestatic

Definition at line 50 of file RawDataMdcDigiCnv.h.

50 {
52 }

◆ updateObj()

StatusCode RawDataMdcDigiCnv::updateObj ( IOpaqueAddress * pAddr,
DataObject * pObj )
virtual

override the RawDataBaseCnv version

Definition at line 110 of file RawDataMdcDigiCnv.cxx.

110 {
111 // Purpose and Method: This method does nothing other than announce it has
112 // been called.
113
114 //MsgStream log(msgSvc(), "RawDataMdcDigiCnv");
115 //log << MSG::DEBUG << "RawDataMdcDigiCnv::updateObj" << endreq;
116 return Converter::updateObj(pAddr, pObj);
117}

Friends And Related Symbol Documentation

◆ CnvFactory< RawDataMdcDigiCnv >

friend class CnvFactory< RawDataMdcDigiCnv >
friend

Definition at line 1 of file RawDataMdcDigiCnv.h.


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