BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataMcCnv Class Reference

#include <RawDataMcCnv.h>

+ Inheritance diagram for RawDataMcCnv:

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

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

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

Friends

class CnvFactory< RawDataMcCnv >
 

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 31 of file RawDataMcCnv.h.

Constructor & Destructor Documentation

◆ RawDataMcCnv()

RawDataMcCnv::RawDataMcCnv ( ISvcLocator *  svc)
protected

Definition at line 27 of file RawDataMcCnv.cxx.

27 :
29{
30 //init();
31}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
static const CLID & classID()

Member Function Documentation

◆ classID()

const CLID & RawDataMcCnv::classID ( )
static

Definition at line 35 of file RawDataMcCnv.cxx.

36{
37 return CLID_McEvent;
38}
const CLID & CLID_McEvent
Definition: EventModel.cxx:203

Referenced by PackedRawDataCnvSvc::addConverters(), and createRep().

◆ createObj()

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

Definition at line 105 of file RawDataMcCnv.cxx.

106{
107 //MsgStream log(msgSvc(), "RawDataMcCnv");
108
109 McEvent *mcEvent = new McEvent;
110 pObj = mcEvent;
111
112 return StatusCode::SUCCESS;
113
114}
Definition: McEvent.h:8

◆ createRep()

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 116 of file RawDataMcCnv.cxx.

117{
118 // convert PixelRaw in the container into ByteStream
119 //MsgStream log(messageService(), "RawDataMcCnv");
120
121 std::string nm = pObj->registry()->name();
122
123 RawDataAddress* addr = new RawDataAddress(classID(), nm, "");
124
125 pAddr = addr;
126
127 return StatusCode::SUCCESS;
128}

◆ initialize()

StatusCode RawDataMcCnv::initialize ( )

Definition at line 40 of file RawDataMcCnv.cxx.

41{
42 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
43 std::string RawDataInputSvc_Name("RawDataInputSvc");
44 std::string RawDataMcCnv_Name("RawDataMcCnv");
45
46 // for Mutil-thread by tianhl
47 //ConversionSvc* pCnvSvc = 0;
48 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
49 SmartIF<IService> pCnvSvc(conversionSvc());
50 if (isGaudiThreaded(pCnvSvc->name())){
51 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
52 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
53 RawDataMcCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
54 }
55 //}
56
57
58 MsgStream log(messageService(), RawDataMcCnv_Name.c_str());
59
60 StatusCode sc = RawDataBaseCnv::initialize();
61 if (StatusCode::SUCCESS != sc) {
62 log << MSG::ERROR << "RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq;
63 return sc;
64 }
65
66 // Check RawDataCnvSvc
67 IService* isvc = 0;
68 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
69 if (sc != StatusCode::SUCCESS) {
70 log << MSG::ERROR << "Cant get PackedRawDataCnvSvc" << endreq;
71 }
72
73 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
74 if (m_RawDataAccess == 0 ) {
75 log << MSG::ERROR << "RawDataMdcCnv: Cant cast to RawDataCnvSvc " << endreq;
76 return StatusCode::FAILURE;
77 }
78
79 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), isvc);
80 if (sc != StatusCode::SUCCESS ) {
81 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
82 return sc ;
83 }
84
85 m_inputSvc = dynamic_cast<RawDataInputSvc*> (isvc);
86 if (m_inputSvc == 0 ) {
87 log << MSG::ERROR << "Cant cast to RawDataInputSvc " << endreq;
88 return StatusCode::FAILURE ;
89 }
90
91 return StatusCode::SUCCESS;
92}
StatusCode initialize()

◆ repSvcType()

virtual long RawDataMcCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 45 of file RawDataMcCnv.h.

45 {
47 }

◆ storageType()

static const unsigned char RawDataMcCnv::storageType ( )
inlinestatic

Definition at line 49 of file RawDataMcCnv.h.

49 {
51 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 95 of file RawDataMcCnv.cxx.

95 {
96 // Purpose and Method: This method does nothing other than announce it has
97 // been called.
98
99 //MsgStream log(msgSvc(), "RawDataMcCnv");
100 //log << MSG::DEBUG << "RawDataMcCnv::updateObj" << endreq;
101 return Converter::updateObj(pAddr, pObj);
102}

Friends And Related Function Documentation

◆ CnvFactory< RawDataMcCnv >

friend class CnvFactory< RawDataMcCnv >
friend

Definition at line 1 of file RawDataMcCnv.h.


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