BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataEmcDigiCnv Class Reference

#include <RawDataEmcDigiCnv.h>

+ Inheritance diagram for RawDataEmcDigiCnv:

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

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

Friends

class CnvFactory< RawDataEmcDigiCnv >
 

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

◆ RawDataEmcDigiCnv() [1/2]

RawDataEmcDigiCnv::RawDataEmcDigiCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataEmcDigiCnv() [1/2]

RawDataEmcDigiCnv::~RawDataEmcDigiCnv ( )
protected

Definition at line 37 of file RawDataEmcDigiCnv.cxx.

37 {
39}
static void destroy()

◆ RawDataEmcDigiCnv() [2/2]

RawDataEmcDigiCnv::RawDataEmcDigiCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataEmcDigiCnv() [2/2]

RawDataEmcDigiCnv::~RawDataEmcDigiCnv ( )
protected

Member Function Documentation

◆ classID() [1/2]

const CLID & RawDataEmcDigiCnv::classID ( )
static

Definition at line 43 of file RawDataEmcDigiCnv.cxx.

44{
45 return CLID_EmcDigiCol;
46}
const CLID & CLID_EmcDigiCol
Definition: EventModel.cxx:238

Referenced by PackedRawDataCnvSvc::addConverters().

◆ classID() [2/2]

static const CLID & RawDataEmcDigiCnv::classID ( )
static

◆ createObj() [1/2]

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

Definition at line 111 of file RawDataEmcDigiCnv.cxx.

112{
113 MsgStream log(msgSvc(), "RawDataEmcDigiCnv");
114
115 // Purpose and Method: This converter will create an empty EmcDigiCol on
116 // the TDS.
117 EmcDigiCol *digiCol = new EmcDigiCol;
118 pObj = digiCol;
119
120 RAWEVENT *evt = m_inputSvc->currentEvent();
121 if (evt == NULL) {
122 cout << "RawDataEmcDigiCnv::createObj can't get event!" << endl;
123 return StatusCode::FAILURE;
124 }
125
126 const BufferHolder& emcBuf = evt->getEmcBuf();
127
128 return m_cnv->convert(emcBuf, digiCol);
129}
StatusCode convert(const BufferHolder &src, EmcDigiCol *des)
virtual RAWEVENT * currentEvent()=0

◆ createObj() [2/2]

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

◆ createRep() [1/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 131 of file RawDataEmcDigiCnv.cxx.

132{
133 // convert PixelRaw in the container into ByteStream
134 MsgStream log(msgSvc(), "RawDataEmcDigiCnv");
135
136 WriteRawEvent*& re = m_RawDataAccess->getRawEvent();
137 if (re == 0) {
138 log << " get RawEvent failed !" << endreq;
139 return StatusCode::FAILURE;
140 }
141
142 SmartDataPtr<EmcDigiCol> digiCol(dataProvider(), EventModel::Digi::EmcDigiCol);
143 if (digiCol == 0) {
144 log << "no EmcDigiCol found" << endreq;
145 return StatusCode::FAILURE;
146 }
147 /*
148 else {
149 log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq;
150 int ndigi = 0;
151 EmcDigiCol::const_iterator pEmcDigi = digiCol->begin();
152 for (pEmcDigi; pEmcDigi!= digiCol->end(); pEmcDigi++) {
153 log <<MSG::INFO << "Digi " << ndigi++ << " ";
154 // output the digi proper: " << digi " no longer works because
155 // "digi" now returns an integer sort order
156 (**pEmcDigi).fillStream(log.stream());
157 log << endreq;
158 }
159 }
160 */
161
162 return m_cnv->convert(digiCol, re);
163}

◆ createRep() [2/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

◆ initialize() [1/2]

StatusCode RawDataEmcDigiCnv::initialize ( )

Definition at line 48 of file RawDataEmcDigiCnv.cxx.

49{
50 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
51 std::string RawDataInputSvc_Name("RawDataInputSvc");
52 std::string RawDataEmcDigiCnv_Name("RawDataEmcDigiCnv");
53 //std::string RawDataProviderSvc_Name("RawDataProviderSvc");
54
55 // for Mutil-thread by tianhl
56 //ConversionSvc* pCnvSvc = 0;
57 SmartIF<IService> pCnvSvc(conversionSvc());
58 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
59 if (isGaudiThreaded(pCnvSvc->name())){
60 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
61 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
62 RawDataEmcDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
63 //RawDataProviderSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
64 }
65 //}
66 // for Mutil-thread by tianhl
67 MsgStream log(msgSvc(), RawDataEmcDigiCnv_Name.c_str());
68
69 StatusCode sc = RawDataBaseCnv::initialize();
70 if ( sc.isFailure() ) {
71 return sc;
72 }
73
74 // Check RawDataCnvSvc
75 IService* isvc = 0;
76 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
77 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
78 if(m_RawDataAccess == 0 ) {
79 log<<MSG::ERROR<< " RawDataCnv: Cant cast to RawDataCnvSvc " <<endreq;
80 return StatusCode::FAILURE ;
81 }
82
83 IService* svc ;
84 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
85 //if(sc != StatusCode::SUCCESS ) {
86 // log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
87 // return sc ;
88 //}
89 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
90 if ( m_inputSvc == 0 ) {
91 log<<MSG::WARNING<< " Cant cast to RawDataInputSvc " <<endreq;
92 return StatusCode::FAILURE ;
93 }
94
95 m_cnv = EmcConverter::instance( m_inputSvc->runMode() );
96
97 return StatusCode::SUCCESS;
98}
static EmcConverter * instance(int runMode=2)
Definition: EmcConverter.cxx:9
virtual int runMode()=0
StatusCode initialize()

◆ initialize() [2/2]

StatusCode RawDataEmcDigiCnv::initialize ( )

◆ repSvcType() [1/2]

virtual long RawDataEmcDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 44 of file Event/RawDataCnv/RawDataCnv-00-04-37/RawDataCnv/RawDataEmcDigiCnv.h.

44 {
46 }

◆ repSvcType() [2/2]

virtual long RawDataEmcDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 44 of file InstallArea/include/RawDataCnv/RawDataCnv/RawDataEmcDigiCnv.h.

44 {
46 }

◆ storageType() [1/2]

static const unsigned char RawDataEmcDigiCnv::storageType ( )
inlinestatic

◆ storageType() [2/2]

static const unsigned char RawDataEmcDigiCnv::storageType ( )
inlinestatic

◆ updateObj() [1/2]

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

override the RawDataBaseCnv version

Definition at line 101 of file RawDataEmcDigiCnv.cxx.

101 {
102 // Purpose and Method: This method does nothing other than announce it has
103 // been called.
104
105 MsgStream log(msgSvc(), "RawDataEmcDigiCnv");
106 log << MSG::DEBUG << "RawDataEmcDigiCnv::updateObj" << endreq;
107 return Converter::updateObj(pAddr, pObj);
108}

◆ updateObj() [2/2]

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

override the RawDataBaseCnv version

Friends And Related Function Documentation

◆ CnvFactory< RawDataEmcDigiCnv >


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