BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataTofDigiCnv Class Reference

#include <RawDataTofDigiCnv.h>

+ Inheritance diagram for RawDataTofDigiCnv:

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

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

Friends

class CnvFactory< RawDataTofDigiCnv >
 

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 RawDataTofDigiCnv.h.

Constructor & Destructor Documentation

◆ RawDataTofDigiCnv()

RawDataTofDigiCnv::RawDataTofDigiCnv ( ISvcLocator *  svc)
protected

Definition at line 31 of file RawDataTofDigiCnv.cxx.

31 :
33{
34}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
static const CLID & classID()

◆ ~RawDataTofDigiCnv()

RawDataTofDigiCnv::~RawDataTofDigiCnv ( )
protected

Definition at line 36 of file RawDataTofDigiCnv.cxx.

37{
39}
static void destroy()

Member Function Documentation

◆ classID()

const CLID & RawDataTofDigiCnv::classID ( )
static

Definition at line 43 of file RawDataTofDigiCnv.cxx.

44{
45 return CLID_TofDigiCol;
46}
const CLID & CLID_TofDigiCol
Definition: EventModel.cxx:237

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 109 of file RawDataTofDigiCnv.cxx.

110{
111 MsgStream log(msgSvc(), "RawDataTofDigiCnv");
112
113 uint32_t TEId, TEData, TEOverflow, TETorQ;
114 TofDigi* tofDigi;
115 // Purpose and Method: This converter will create an empty TofDigiCol on
116 // the TDS.
117 TofDigiCol *digiCol = new TofDigiCol;
118 pObj = digiCol;
119
120 //zoujh: for luminosity begin ...................
121 LumiDigiCol *lumiDigiCol = 0;
122 DataObject* pLumi;
123 dataProvider()->findObject("/Event/Digi/LumiDigiCol", pLumi);
124 if ( pLumi == NULL ) {
125 lumiDigiCol = new LumiDigiCol;
126 StatusCode sc = dataProvider()->registerObject("/Event/Digi/LumiDigiCol", lumiDigiCol);
127 if ( sc.isFailure() ) {
128 log << MSG::ERROR << "Could not register LumiDigiCol in TDS!" << endreq;
129 }
130 }
131 else {
132 lumiDigiCol = dynamic_cast<LumiDigiCol*>(pLumi);
133 }
134 //zoujh: for luminosity end ^^^^^^^^^^^^^^^^^^^^^
135
136 RAWEVENT* evt = m_inputSvc->currentEvent();
137 if (evt == NULL) {
138 cout << "RawDataTofDigiCnv::createObj has no event!" << endl;
139 return StatusCode::FAILURE;
140 }
141
142 const BufferHolder& tofBuf = evt->getTofBuf();
143
144 return m_cnv->convert(tofBuf, digiCol, lumiDigiCol);
145}
ObjectVector< LumiDigi > LumiDigiCol
Definition: LumiDigi.h:36
IMessageSvc * msgSvc()
ObjectVector< TofDigi > TofDigiCol
Definition: TofDigi.h:41
virtual RAWEVENT * currentEvent()=0
const BufferHolder & getTofBuf() const
Definition: RAWEVENT.h:87
StatusCode convert(const BufferHolder &src, TofDigiCol *des, LumiDigiCol *des2=0)

◆ createRep()

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 147 of file RawDataTofDigiCnv.cxx.

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

◆ initialize()

StatusCode RawDataTofDigiCnv::initialize ( )

Definition at line 48 of file RawDataTofDigiCnv.cxx.

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

◆ repSvcType()

virtual long RawDataTofDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 46 of file RawDataTofDigiCnv.h.

46 {
48 }

◆ storageType()

static const unsigned char RawDataTofDigiCnv::storageType ( )
inlinestatic

Definition at line 50 of file RawDataTofDigiCnv.h.

50 {
52 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 99 of file RawDataTofDigiCnv.cxx.

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

Friends And Related Function Documentation

◆ CnvFactory< RawDataTofDigiCnv >

friend class CnvFactory< RawDataTofDigiCnv >
friend

Definition at line 1 of file RawDataTofDigiCnv.h.


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