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

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

◆ RawDataHltRawCnv() [1/2]

RawDataHltRawCnv::RawDataHltRawCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataHltRawCnv() [1/2]

RawDataHltRawCnv::~RawDataHltRawCnv ( )
protected

Definition at line 36 of file RawDataHltRawCnv.cxx.

36 {
37}

◆ RawDataHltRawCnv() [2/2]

RawDataHltRawCnv::RawDataHltRawCnv ( ISvcLocator *  svc)
protected

◆ ~RawDataHltRawCnv() [2/2]

RawDataHltRawCnv::~RawDataHltRawCnv ( )
protected

Member Function Documentation

◆ classID() [1/2]

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().

◆ classID() [2/2]

static const CLID & RawDataHltRawCnv::classID ( )
static

◆ createObj() [1/2]

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
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
void setIntChannel(const unsigned int intChannel)
virtual RAWEVENT * currentEvent()=0
void setChargeChannel(const unsigned int chargeChannel)
Definition: RawData.cxx:30

◆ createObj() [2/2]

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

◆ createRep() [1/2]

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

◆ createRep() [2/2]

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

◆ initialize() [1/2]

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()

◆ initialize() [2/2]

StatusCode RawDataHltRawCnv::initialize ( )

◆ repSvcType() [1/2]

virtual long RawDataHltRawCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 47 of file Event/RawDataCnv/RawDataCnv-00-04-37/RawDataCnv/RawDataHltRawCnv.h.

47 {
49 }

◆ repSvcType() [2/2]

virtual long RawDataHltRawCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 47 of file InstallArea/include/RawDataCnv/RawDataCnv/RawDataHltRawCnv.h.

47 {
49 }

◆ storageType() [1/2]

static const unsigned char RawDataHltRawCnv::storageType ( )
inlinestatic

◆ storageType() [2/2]

static const unsigned char RawDataHltRawCnv::storageType ( )
inlinestatic

◆ updateObj() [1/2]

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}

◆ updateObj() [2/2]

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

override the RawDataBaseCnv version

Friends And Related Function Documentation

◆ CnvFactory< RawDataHltRawCnv >


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