#include <RawDataTofMcHitCnv.h>
Inheritance diagram for RawDataTofMcHitCnv:
Public Types | |
typedef Ty2 | destination |
typedef Ty2 | destination |
typedef Ty1 | source |
typedef Ty1 | source |
Public Member Functions | |
StatusCode | createObj (IOpaqueAddress *pAddr, DataObject *&pObj) |
StatusCode | createObj (IOpaqueAddress *pAddr, DataObject *&pObj) |
virtual StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&pAddr) |
Convert the transient object to the requested representation. | |
virtual StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&pAddr) |
Convert the transient object to the requested representation. | |
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. | |
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 | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
Resolve the references of the converted object. | |
virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
Resolve the references of the converted object. | |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
StatusCode | initialize () |
StatusCode | initialize () |
destination * | operator (const source &) const |
destination * | operator (const source &) const |
virtual long | repSvcType () const |
virtual long | repSvcType () const |
virtual StatusCode | updateObj (IOpaqueAddress *, DataObject *) |
override the RawDataBaseCnv version | |
virtual StatusCode | updateObj (IOpaqueAddress *, DataObject *) |
override the RawDataBaseCnv version | |
virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) |
Update the converted representation of a transient 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. | |
virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
Update the references of an already converted object. | |
Static Public Member Functions | |
const CLID & | classID () |
const CLID & | classID () |
const unsigned char | storageType () |
const unsigned char | storageType () |
Protected Member Functions | |
virtual destination * | convert (const source &) const =0 |
virtual destination * | convert (const source &) const =0 |
RawDataTofMcHitCnv (ISvcLocator *svc) | |
RawDataTofMcHitCnv (ISvcLocator *svc) | |
Protected Attributes | |
IRawDataCnvSvc * | m_CnvSvc |
Pointer to event conversion service interface. | |
IRawDataCnvSvc * | m_CnvSvc |
Pointer to event conversion service interface. | |
std::vector< IRawDataCnvSvc::Leaf > | m_leaves |
Leaf objects giving the locations of the objects in the data store. | |
std::vector< IRawDataCnvSvc::Leaf > | m_leaves |
Leaf objects giving the locations of the objects in the data store. | |
Private Attributes | |
IRawDataInputSvc * | m_inputSvc |
IRawDataInputSvc * | m_inputSvc |
PackedRawDataCnvSvc * | m_RawDataAccess |
Define the interface to raw data cnv. | |
PackedRawDataCnvSvc * | m_RawDataAccess |
Define the interface to raw data cnv. | |
TofMcHitBuilder | m_tofMcHitBuilder |
TofMcHitder for packing or unpacking data. | |
Friends | |
class | CnvFactory<RawDataTofMcHitCnv> |
|
|
|
|
|
|
|
|
|
00036 : 00037 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 00038 { 00039 //init(); 00040 }
|
|
|
|
Reimplemented from RawDataBaseCnv. |
|
Reimplemented from RawDataBaseCnv. 00045 {
00046 return CLID_TofMcHitCol;
00047 }
|
|
|
|
|
|
|
|
00114 { 00115 //MsgStream log(msgSvc(), "RawDataTofMcHitCnv"); 00116 00117 //This converter will create an empty TofMcHitCol on the TDS 00118 TofMcHitCol *tofMcHitCol = new TofMcHitCol; 00119 pObj = tofMcHitCol; 00120 00121 RAWEVENT *evt = m_inputSvc->currentEvent(); 00122 if (evt == NULL) { 00123 //log << MSG::ERROR << "RawDataCnv has no event!" << endreq; 00124 return StatusCode::FAILURE; 00125 } 00126 00127 assert((evt->getTofTruth().size())%9 == 0); 00128 00129 TofTruth_t m_TofTruth; 00130 TofMcHit* tofMcHit; 00131 00132 std::vector<uint32_t>::const_iterator iter = evt->getTofTruth().begin(); 00133 std::vector<uint32_t>::const_iterator eiter = evt->getTofTruth().end(); 00134 00135 for (int tofMcHitId = 0; iter != eiter; tofMcHitId++) { 00136 // retrieve the TofTruth data 00137 m_tofMcHitBuilder.unPack(iter, eiter, m_TofTruth); 00138 // construct the identifier 00139 unsigned int layer = 0; 00140 unsigned int barrel_ec = m_TofTruth.partId; 00141 if (TofID::is_barrel(barrel_ec) && m_TofTruth.scinNb > TofID::getPHI_BARREL_MAX()) { 00142 layer = 1; 00143 m_TofTruth.scinNb -= (TofID::getPHI_BARREL_MAX() + 1); 00144 } 00145 00146 const Identifier ident = TofID::cell_id ( barrel_ec, layer, m_TofTruth.scinNb, 0); 00147 //construct the TofMcHit 00148 tofMcHit = new TofMcHit(ident, m_TofTruth.trackIndex, 00149 m_TofTruth.x/(m_tofMcHitBuilder.m_xCoeff*1.0), 00150 m_TofTruth.y/(m_tofMcHitBuilder.m_yCoeff*1.0), 00151 m_TofTruth.z/(m_tofMcHitBuilder.m_zCoeff*1.0), 00152 m_TofTruth.px/(m_tofMcHitBuilder.m_pxCoeff*1.0), 00153 m_TofTruth.py/(m_tofMcHitBuilder.m_pyCoeff*1.0), 00154 m_TofTruth.pz/(m_tofMcHitBuilder.m_pzCoeff*1.0), 00155 m_TofTruth.trackLength/(m_tofMcHitBuilder.m_trackLengthCoeff*1.0), 00156 m_TofTruth.time/(m_tofMcHitBuilder.m_timeCoeff*1.0) ); 00157 // And add the stuff to the container 00158 tofMcHitCol->push_back(tofMcHit); 00159 } 00160 00161 return StatusCode::SUCCESS; 00162 00163 }
|
|
Convert the transient object to the requested representation.
Reimplemented from RawDataBaseCnv. |
|
Convert the transient object to the requested representation.
Reimplemented from RawDataBaseCnv. 00166 { 00167 // convert PixelRaw in the container into ByteStream 00168 //MsgStream log(messageService(), "RawDataTofMcHitCnv"); 00169 00170 WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 00171 00172 if (re == 0) { 00173 //log << " get RawEvent failed !" << endreq; 00174 return StatusCode::FAILURE; 00175 } 00176 00177 SmartDataPtr<TofMcHitCol> mcHitCol(dataProvider(), EventModel::MC::TofMcHitCol); 00178 00179 if (mcHitCol == 0) { 00180 //log << "no TofMcHitCol found" << endreq; 00181 return StatusCode::FAILURE; 00182 } 00183 00184 StatusCode sc = m_tofMcHitBuilder.pack(mcHitCol, re); 00185 00186 return sc; 00187 00188 }
|
|
Store TDS path to link a particular converter to an object on the TDS.
|
|
Store TDS path to link a particular converter to an object on the TDS.
00082 { 00083 // Purpose and Method: Save the path on the TDS, in the m_leaves vector, 00084 // corresponding to the DataObject that the converter handles. 00085 // m_leaves.push_back(IRawDataCnvSvc::Leaf(path, cl, bank, par)); 00086 }
|
|
Resolve the references of the converted object.
|
|
Resolve the references of the converted object.
00030 { 00031 // Purpose and Method: Resolve the references of the converted object. 00032 // It is expected that derived classes will override this method. 00033 return StatusCode::SUCCESS; 00034 }
|
|
|
|
00073 { 00074 if ( m_CnvSvc ) { 00075 m_CnvSvc->release(); 00076 m_CnvSvc = 0; 00077 } 00078 return Converter::finalize(); 00079 }
|
|
Reimplemented from RawDataBaseCnv. |
|
Reimplemented from RawDataBaseCnv. 00050 { 00051 00052 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc"); 00053 std::string RawDataInputSvc_Name("RawDataInputSvc"); 00054 std::string RawDataTofMcHitCnv_Name("RawDataTofMcHitCnv"); 00055 00056 // for Mutil-thread by tianhl 00057 ConversionSvc* pCnvSvc = 0; 00058 if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){ 00059 if (isGaudiThreaded(pCnvSvc->name())){ 00060 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00061 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00062 RawDataTofMcHitCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00063 } 00064 } 00065 00066 MsgStream log(messageService(), RawDataTofMcHitCnv_Name.c_str()); 00067 00068 StatusCode sc = RawDataBaseCnv::initialize(); 00069 if (StatusCode::SUCCESS != sc) { 00070 log << MSG::ERROR << "RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq; 00071 return sc; 00072 } 00073 00074 // Check RawDataCnvSvc 00075 IService* isvc = 0; 00076 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true); 00077 if (sc != StatusCode::SUCCESS) { 00078 log << MSG::ERROR << "Cant get PackedRawDataCnvSvc" << endreq; 00079 } 00080 00081 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc); 00082 if (m_RawDataAccess == 0 ) { 00083 log << MSG::ERROR << "RawDataTofCnv: Cant cast to RawDataCnvSvc " << endreq; 00084 return StatusCode::FAILURE; 00085 } 00086 00087 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), isvc); 00088 if (sc != StatusCode::SUCCESS ) { 00089 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq; 00090 return sc ; 00091 } 00092 00093 m_inputSvc = dynamic_cast<RawDataInputSvc*> (isvc); 00094 if (m_inputSvc == 0 ) { 00095 log << MSG::WARNING << "Cant cast to RawDataInputSvc " << endreq; 00096 return StatusCode::FAILURE ; 00097 } 00098 00099 return StatusCode::SUCCESS; 00100 }
|
|
|
|
|
|
Reimplemented from RawDataBaseCnv. 00046 {
00047 return PACKEDRAWEVENT_StorageType;
00048 }
|
|
Reimplemented from RawDataBaseCnv. 00046 {
00047 return PACKEDRAWEVENT_StorageType;
00048 }
|
|
Reimplemented from RawDataBaseCnv. 00050 {
00051 return PACKEDRAWEVENT_StorageType;
00052 }
|
|
Reimplemented from RawDataBaseCnv. 00050 {
00051 return PACKEDRAWEVENT_StorageType;
00052 }
|
|
override the RawDataBaseCnv version
|
|
override the RawDataBaseCnv version
00103 { 00104 // Purpose and Method: This method does nothing other than announce it has 00105 // been called. 00106 00107 //MsgStream log(msgSvc(), "RawDataTofMcHitCnv"); 00108 //log << MSG::DEBUG << "RawDataTofMcHitCnv::updateObj" << endreq; 00109 return Converter::updateObj(pAddr, pObj); 00110 }
|
|
Update the converted representation of a transient object.
|
|
Update the converted representation of a transient object.
00037 { 00038 // Purpose and Method: Update the converted representation of a transient 00039 // object. It is expected that derived classes will override this. 00040 return StatusCode::SUCCESS; 00041 }
|
|
Update the references of an already converted object.
|
|
Update the references of an already converted object.
00044 { 00045 // Purpose and Method: Update the references of an already converted object. 00046 // It is expected that derived classes will override this method. 00047 return StatusCode::SUCCESS; 00048 }
|
|
|
|
Pointer to event conversion service interface.
|
|
Pointer to event conversion service interface.
|
|
|
|
|
|
Leaf objects giving the locations of the objects in the data store.
|
|
Leaf objects giving the locations of the objects in the data store.
|
|
Define the interface to raw data cnv.
|
|
Define the interface to raw data cnv.
|
|
TofMcHitder for packing or unpacking data.
|