BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataHltRawCnv Class Reference

#include <RawDataHltRawCnv.hpp>

Inheritance diagram for RawDataHltRawCnv:

Public Member Functions

 RawDataHltRawCnv (ISvcLocator *svc)
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
Public Member Functions inherited from RawDataBaseCnv
StatusCode initialize ()
long repSvcType () const
const long storageType ()
Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
destinationoperator (const source &) const
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()

Additional Inherited Members

Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from RawDataBaseCnv
 RawDataBaseCnv (long storageType, const CLID &clid, ISvcLocator *svc)
 RawDataBaseCnv (ISvcLocator *svc, const CLID &clid)
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RawDataBaseCnv
std::vector< IRawDataCnvSvc::Leafm_leaves
IRawDataCnvSvcm_cnvSvc
IRawDataInputSvcm_inputSvc

Detailed Description

Definition at line 12 of file RawDataHltRawCnv.hpp.

Constructor & Destructor Documentation

◆ RawDataHltRawCnv()

RawDataHltRawCnv::RawDataHltRawCnv ( ISvcLocator * svc)
inline

Definition at line 18 of file RawDataHltRawCnv.hpp.

18: RawDataBaseCnv( svc, classID() ) {}
RawDataBaseCnv(long storageType, const CLID &clid, ISvcLocator *svc)
static const CLID & classID()

Member Function Documentation

◆ classID()

const CLID & RawDataHltRawCnv::classID ( )
inlinestatic

Definition at line 20 of file RawDataHltRawCnv.hpp.

20{ return CLID_HltRawCol; }
const CLID & CLID_HltRawCol

Referenced by RawDataCnvSvc::addConverters(), RawDataCnvSvc::createConverter(), and RawDataHltRawCnv().

◆ createObj()

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

Definition at line 22 of file RawDataHltRawCnv.hpp.

22 {
23 // MsgStream log(msgSvc(), "RawDataHltRawCnv");
24 RawDataAddress* pEFAddr;
25 uint32_t TEData[2];
26
27 // Purpose and Method: This converter will create an empty HltRawCol on
28 // the TDS.
29 HltRawCol* digiCol = new HltRawCol;
30 pObj = digiCol;
31
32 RAWEVENT* evt = m_inputSvc->currentEvent();
33 if ( !evt )
34 {
35 cout << "RawDataHltRawCnv::createObj can't get event!" << endl;
36 return StatusCode::FAILURE;
37 }
38
39 int digiId = 0;
40 const BufferHolder& hltBuf = evt->getHltBuf();
41 uint32_t nbuf = hltBuf.nBuf();
42
43 uint32_t REId = 0, TEId = 0;
44 uint32_t nmdc = 0, ntof = 0, nemc = 0, nmuc = 0;
45 for ( uint32_t i = 0; i < nbuf; i++ )
46 {
47 uint32_t* buf = hltBuf( i );
48 uint32_t bufSize = hltBuf.bufSize( i );
49 for ( uint32_t j = 0; j < bufSize; j++, digiId++ )
50 {
51
52 m_hltBuilder.unPack( buf[j], digiId, REId, TEData[0], TEData[1] );
53 TEId = m_hltBuilder.getTEID( REId );
54 if ( TEId == 0xFFFFFFFF ) continue;
55
56 // log << MSG::NIL << "HLT digit No: " << digiId << "="<<std::hex<<buf[j]
57 // <<"===>"<<TEId<<" : "<<TEData[0]<<","<<TEData[1]<<std::dec<<endmsg;
58 for ( uint32_t k = 0; k < 2; k++ )
59 {
60 // Create new track
61 if ( k == 0 || ( k == 1 && TEData[k] ) )
62 {
63 if ( k == 1 ) TEId += 1;
64 if ( HltID::is_number( HltID::convert( TEId ) ) )
65 {
66 nmdc = TEData[k] & 0xFF;
67 ntof = ( TEData[k] >> 8 ) & 0xFF;
68 nemc = ( TEData[k] >> 16 ) & 0xFF;
69 nmuc = ( TEData[k] >> 24 ) & 0xFF;
70 // log << MSG::INFO << "number=" << std::hex <<TEData[k] <<std::dec<< endmsg;
71 }
72 HltRaw* hltRaw = new HltRaw( HltID::convert( TEId, nmdc, ntof, nemc, nmuc ) );
73 hltRaw->setIntChannel( TEData[k] );
74 // hltRaw->setFloatChannel(TEData[k]);
75 hltRaw->setChargeChannel( TEData[k] );
76
77 digiCol->push_back( hltRaw );
78 }
79 }
80 }
81 }
82 return StatusCode::SUCCESS;
83 }
ObjectVector< HltRaw > HltRawCol
static Identifier convert(const unsigned int id, const int nmdc=0, const int ntof=0, const int nemc=0, const int nmuc=0)
convert global id to sub-id(Identifier)
Definition HltID.cxx:10
static bool is_number(const Identifier &id)
Definition HltID.cxx:97
void setIntChannel(const unsigned int intChannel)
IRawDataInputSvc * m_inputSvc
void setChargeChannel(const unsigned int chargeChannel)
Definition RawData.cxx:24

◆ createRep()

StatusCode RawDataHltRawCnv::createRep ( DataObject * pObj,
IOpaqueAddress *& pAddr )
inline

Definition at line 85 of file RawDataHltRawCnv.hpp.

85 {
86 // convert PixelRaw in the container into ByteStream
87 // MsgStream log(msgSvc(), "RawDataHltRawCnv");
88
89 WriteRawEvent*& re = m_cnvSvc->getRawEvent();
90 if ( re == 0 )
91 {
92 // log << " get RawEvent failed !" << endmsg;
93 return StatusCode::FAILURE;
94 }
95
96 SmartDataPtr<HltRawCol> digiCol( dataProvider(), EventModel::Hlt::HltRawCol );
97 if ( digiCol == 0 )
98 {
99 // log << "no HltRawCol found" << endmsg;
100 return StatusCode::FAILURE;
101 }
102
103 return m_hltBuilder.pack( digiCol, re );
104 }
eformat::write::FullEventFragment WriteRawEvent
IRawDataCnvSvc * m_cnvSvc

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