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

#include <RawDataHltRawCnv.h>

+ Inheritance diagram for RawDataHltRawCnv:

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

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

Friends

class CnvFactory< RawDataHltRawCnv >
 

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 32 of file RawDataHltRawCnv.h.

Constructor & Destructor Documentation

◆ RawDataHltRawCnv()

RawDataHltRawCnv::RawDataHltRawCnv ( ISvcLocator *  svc)
protected

Definition at line 31 of file RawDataHltRawCnv.cxx.

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

◆ ~RawDataHltRawCnv()

RawDataHltRawCnv::~RawDataHltRawCnv ( )
protected

Definition at line 36 of file RawDataHltRawCnv.cxx.

36 {
37}

Member Function Documentation

◆ classID()

const CLID & RawDataHltRawCnv::classID ( )
static

Definition at line 41 of file RawDataHltRawCnv.cxx.

42{
43 return CLID_HltRawCol;
44}
const CLID & CLID_HltRawCol
Definition: EventModel.cxx:285

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 110 of file RawDataHltRawCnv.cxx.

111{
112 //MsgStream log(msgSvc(), "RawDataHltRawCnv");
113 RawDataAddress *pEFAddr;
114 uint32_t TEData[2];
115
116 // Purpose and Method: This converter will create an empty HltRawCol on
117 // the TDS.
118 HltRawCol *digiCol = new HltRawCol;
119 pObj = digiCol;
120
121 RAWEVENT *evt = m_inputSvc->currentEvent();
122 if (evt == NULL) {
123 cout << "RawDataHltRawCnv::createObj can't get event!" << endl;
124 return StatusCode::FAILURE;
125 }
126
127 int digiId = 0;
128 const BufferHolder& hltBuf = evt->getHltBuf();
129 uint32_t nbuf = hltBuf.nBuf();
130
131 uint32_t REId = 0, TEId = 0;
132 uint32_t nmdc=0,ntof=0,nemc=0,nmuc=0;
133 for (uint32_t i = 0; i < nbuf; i++) {
134 uint32_t* buf = hltBuf(i);
135 uint32_t bufSize = hltBuf.bufSize(i);
136 for (uint32_t j = 0; j < bufSize; j++, digiId++) {
137
138 m_hltBuilder.unPack(buf[j], digiId, REId, TEData[0], TEData[1]);
139 TEId = m_hltBuilder.getTEID(REId);
140 if ( TEId == 0xFFFFFFFF ) continue;
141
142// log << MSG::NIL << "HLT digit No: " << digiId << "="<<std::hex<<buf[j]
143// <<"===>"<<TEId<<" : "<<TEData[0]<<","<<TEData[1]<<std::dec<<endreq;
144 for (uint32_t k=0; k< 2;k++){
145 // Create new track
146 if(k==0||(k==1&&TEData[k])){
147 if(k==1) TEId+=1;
149 nmdc=TEData[k]&0xFF;
150 ntof=(TEData[k]>>8)&0xFF;
151 nemc=(TEData[k]>>16)&0xFF;
152 nmuc=(TEData[k]>>24)&0xFF;
153 //log << MSG::INFO << "number=" << std::hex <<TEData[k] <<std::dec<< endreq;
154 }
155 HltRaw* hltRaw = new HltRaw(HltID::convert(TEId,nmdc,ntof,nemc,nmuc));
156 hltRaw->setIntChannel(TEData[k]);
157 //hltRaw->setFloatChannel(TEData[k]);
158 hltRaw->setChargeChannel(TEData[k]);
159
160 digiCol->push_back ( hltRaw );
161 }
162 }
163 }
164 }
165 return StatusCode::SUCCESS;
166}
ObjectVector< HltRaw > HltRawCol
Definition: HltRaw.h:35
#define NULL
uint32_t nBuf() const
Definition: BufferHolder.h:15
uint32_t bufSize(int i) const
Definition: BufferHolder.h:16
uint32_t getTEID(uint32_t reid)
Definition: HltBuilder.h:16
void unPack(uint32_t reDigi, uint32_t n, uint32_t &REId, uint32_t &TEData1, uint32_t &TEData2)
Definition: HltBuilder.cxx:22
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:12
static bool is_number(const Identifier &id)
Definition: HltID.cxx:102
Definition: HltRaw.h:15
void setIntChannel(const unsigned int intChannel)
Definition: HltRaw.h:21
virtual RAWEVENT * currentEvent()=0
const BufferHolder & getHltBuf() const
Definition: RAWEVENT.h:101
void setChargeChannel(const unsigned int chargeChannel)
Definition: RawData.cxx:30

◆ createRep()

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 168 of file RawDataHltRawCnv.cxx.

169{
170 // convert PixelRaw in the container into ByteStream
171 //MsgStream log(messageService(), "RawDataHltRawCnv");
172
173 WriteRawEvent*& re = m_RawDataAccess->getRawEvent();
174 if(re == 0) {
175 //log << " get RawEvent failed !" << endreq;
176 return StatusCode::FAILURE;
177 }
178
179 SmartDataPtr<HltRawCol> digiCol(dataProvider(), EventModel::Hlt::HltRawCol);
180 if (digiCol == 0) {
181 //log << "no HltRawCol found" << endreq;
182 return StatusCode::FAILURE;
183 }
184 /*
185 else {
186 log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq;
187 int ndigi = 0;
188 HltRawCol::const_iterator pHltRaw = digiCol->begin();
189 for (pHltRaw; pHltRaw!= digiCol->end(); pHltRaw++) {
190 log <<MSG::INFO << "Raw " << ndigi++ << " ";
191 // output the digi proper: " << digi " no longer works because
192 // "digi" now returns an integer sort order
193 (**pHltRaw).fillStream(log.stream());
194 log << endreq;
195 }
196 }
197 */
198 return m_hltBuilder.pack(digiCol, re);
199}
StatusCode pack(HltRawCol *digiCol, WriteRawEvent *&re)
Definition: HltBuilder.cxx:47
virtual WriteRawEvent *& getRawEvent()
_EXTERN_ std::string HltRawCol
Definition: EventModel.h:73

◆ initialize()

StatusCode RawDataHltRawCnv::initialize ( )

Definition at line 46 of file RawDataHltRawCnv.cxx.

47{
48 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
49 std::string RawDataInputSvc_Name("RawDataInputSvc");
50 std::string RawDataHltRawCnv_Name("RawDataHltRawCnv");
51
52 // for Mutil-thread by tianhl
53 //ConversionSvc* pCnvSvc = 0;
54 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
55 SmartIF<IService> pCnvSvc(conversionSvc());
56 if (isGaudiThreaded(pCnvSvc->name())){
57 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
58 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
59 RawDataHltRawCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
60 }
61 //}
62
63 MsgStream log(messageService(), RawDataHltRawCnv_Name.c_str());
64 StatusCode sc = RawDataBaseCnv::initialize();
65 if (StatusCode::SUCCESS != sc) {
66
67 return sc;
68 }
69
70 // Check RawDataCnvSvc
71 IService* isvc = 0;
72 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
73
74 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
75 if(m_RawDataAccess == 0 ) {
76 log<<MSG::ERROR<< " RawDataCnv: Cant cast to RawDataCnvSvc " <<endreq;
77 return StatusCode::FAILURE ;
78 }
79
80 if(m_RawDataAccess)
81 log << MSG::INFO << "RawDataCnvSvc retrieved "<< endreq;
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
90 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
91 if(m_inputSvc == 0 ) {
92 log<<MSG::WARNING<< " Cant cast to RawDataInputSvc " <<endreq;
93 return StatusCode::FAILURE ;
94 }
95
96 return StatusCode::SUCCESS;
97}
StatusCode initialize()

◆ repSvcType()

virtual long RawDataHltRawCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 47 of file RawDataHltRawCnv.h.

47 {
49 }

◆ storageType()

static const unsigned char RawDataHltRawCnv::storageType ( )
inlinestatic

Definition at line 51 of file RawDataHltRawCnv.h.

51 {
53 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 100 of file RawDataHltRawCnv.cxx.

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

Friends And Related Function Documentation

◆ CnvFactory< RawDataHltRawCnv >

friend class CnvFactory< RawDataHltRawCnv >
friend

Definition at line 1 of file RawDataHltRawCnv.h.


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