BOSS 7.0.3
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.
 
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 ()
 
virtual long repSvcType () const
 
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 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 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.
 
 RawDataBaseCnv (ISvcLocator *svc)
 
 RawDataBaseCnv (unsigned char storageType, const CLID &clid, ISvcLocator *svc)
 
virtual ~RawDataBaseCnv ()
 
virtual long repSvcType () const
 
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 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 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
 
destinationoperator (const source &) const
 

Static Public Member Functions

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

Protected Member Functions

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

Constructor & Destructor Documentation

◆ RawDataMdcDigiCnv() [1/2]

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}
static const CLID & classID()

◆ ~RawDataMdcDigiCnv() [1/2]

RawDataMdcDigiCnv::~RawDataMdcDigiCnv ( )
protected

Definition at line 44 of file RawDataMdcDigiCnv.cxx.

45{
47}
static void destroy()

◆ RawDataMdcDigiCnv() [2/2]

RawDataMdcDigiCnv::RawDataMdcDigiCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataMdcDigiCnv() [2/2]

RawDataMdcDigiCnv::~RawDataMdcDigiCnv ( )
protected

Member Function Documentation

◆ classID() [1/2]

const CLID & RawDataMdcDigiCnv::classID ( )
static

Definition at line 51 of file RawDataMdcDigiCnv.cxx.

52{
53 return CLID_MdcDigiCol;
54}
const CLID & CLID_MdcDigiCol
Definition: EventModel.cxx:235

Referenced by PackedRawDataCnvSvc::addConverters().

◆ classID() [2/2]

static const CLID & RawDataMdcDigiCnv::classID ( )
static

◆ createObj() [1/2]

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
virtual RAWEVENT * currentEvent()=0
StatusCode convert(const BufferHolder &src, MdcDigiCol *des)

◆ createObj() [2/2]

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

◆ createRep() [1/2]

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}

◆ createRep() [2/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

◆ initialize() [1/2]

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_runFrom, m_runTo);
105
106 return StatusCode::SUCCESS;
107}
virtual int runMode()=0
static MdcConverter * instance(int runMode=2)
Definition: MdcConverter.cxx:6
void init(int runFrom, int runTo)
StatusCode initialize()

◆ initialize() [2/2]

StatusCode RawDataMdcDigiCnv::initialize ( )

◆ repSvcType() [1/2]

virtual long RawDataMdcDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 46 of file Event/RawDataCnv/RawDataCnv-00-04-37/RawDataCnv/RawDataMdcDigiCnv.h.

46 {
48 }

◆ repSvcType() [2/2]

virtual long RawDataMdcDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 46 of file InstallArea/include/RawDataCnv/RawDataCnv/RawDataMdcDigiCnv.h.

46 {
48 }

◆ storageType() [1/2]

static const unsigned char RawDataMdcDigiCnv::storageType ( )
inlinestatic

◆ storageType() [2/2]

static const unsigned char RawDataMdcDigiCnv::storageType ( )
inlinestatic

◆ updateObj() [1/2]

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}

◆ updateObj() [2/2]

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

override the RawDataBaseCnv version

Friends And Related Function Documentation

◆ CnvFactory< RawDataMdcDigiCnv >


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