BOSS 7.0.3
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.
 
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

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

◆ RawDataTofDigiCnv() [1/2]

RawDataTofDigiCnv::RawDataTofDigiCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataTofDigiCnv() [1/2]

RawDataTofDigiCnv::~RawDataTofDigiCnv ( )
protected

Definition at line 36 of file RawDataTofDigiCnv.cxx.

37{
39}
static void destroy()

◆ RawDataTofDigiCnv() [2/2]

RawDataTofDigiCnv::RawDataTofDigiCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataTofDigiCnv() [2/2]

RawDataTofDigiCnv::~RawDataTofDigiCnv ( )
protected

Member Function Documentation

◆ classID() [1/2]

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:241

Referenced by PackedRawDataCnvSvc::addConverters().

◆ classID() [2/2]

static const CLID & RawDataTofDigiCnv::classID ( )
static

◆ createObj() [1/2]

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 const BufferHolder& etfBuf = evt->getEtfBuf();
144
145 return m_cnv->convert(tofBuf, etfBuf, digiCol, lumiDigiCol);
146}
ObjectVector< LumiDigi > LumiDigiCol
ObjectVector< TofDigi > TofDigiCol
virtual RAWEVENT * currentEvent()=0
StatusCode convert(const BufferHolder &src, TofDigiCol *des, LumiDigiCol *des2=0)

◆ createObj() [2/2]

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

◆ createRep() [1/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 148 of file RawDataTofDigiCnv.cxx.

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

◆ createRep() [2/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

◆ initialize() [1/2]

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:6

◆ initialize() [2/2]

StatusCode RawDataTofDigiCnv::initialize ( )

◆ repSvcType() [1/2]

virtual long RawDataTofDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

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

46 {
48 }

◆ repSvcType() [2/2]

virtual long RawDataTofDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

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

46 {
48 }

◆ storageType() [1/2]

static const unsigned char RawDataTofDigiCnv::storageType ( )
inlinestatic

◆ storageType() [2/2]

static const unsigned char RawDataTofDigiCnv::storageType ( )
inlinestatic

◆ updateObj() [1/2]

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}

◆ updateObj() [2/2]

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

override the RawDataBaseCnv version

Friends And Related Function Documentation

◆ CnvFactory< RawDataTofDigiCnv >


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