/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/RawDataCnv/RawDataCnv-00-04-35/src/RawDataHltCnv.cxx

Go to the documentation of this file.
00001 //====================================================================
00002 //      RawDataHltCnv.cxx
00003 //====================================================================
00004 //
00005 // Description: A converter class to unpack Event Filter packed raw   
00006 //              event persistent data and place it in the Transient    
00007 //              Data Store of Athena.
00008 //
00009 //--------------------------------------------------------------------
00010 
00011 // Include files.
00012 #include "GaudiKernel/MsgStream.h"
00013 #include "GaudiKernel/IRegistry.h"
00014 // for Mutil-thread by tianhl
00015 #include "GaudiKernel/ThreadGaudi.h"
00016 // for Mutil-thread by tianhl
00017 
00018 #include "HltEvent/HltEvent.h"
00019 #include "RawDataCnv/RawDataAddress.h"
00020 #include "RawDataCnv/RawDataInputSvc.h"
00021 //#include "RawDataCnv/EventManagement/RawEvent.h"
00022 #include "RawDataCnv/RawDataHltCnv.h"
00023 
00024 
00025 extern const CLID& CLID_HltEvent;  
00026 
00027 // Constructor.
00028 RawDataHltCnv::RawDataHltCnv(ISvcLocator* svc) : 
00029 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00030 {
00031     //init();
00032 }
00033 
00034 // Return the identification number of this converter to the 
00035 // persistency service.
00036 const CLID& RawDataHltCnv::classID()
00037 {
00038   return CLID_HltEvent;
00039 }
00040 
00041 StatusCode RawDataHltCnv::initialize() 
00042 {
00043     std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
00044     std::string RawDataInputSvc_Name("RawDataInputSvc");
00045     std::string RawDataHltCnv_Name("RawDataHltCnv");
00046     
00047     // for Mutil-thread by tianhl
00048     //ConversionSvc*  pCnvSvc = 0;
00049     //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
00050     SmartIF<IService> pCnvSvc(conversionSvc());  
00051     if  (isGaudiThreaded(pCnvSvc->name())){
00052         PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00053         RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00054         RawDataHltCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00055       }
00056     //}
00057     StatusCode sc = RawDataBaseCnv::initialize();
00058     if(StatusCode::SUCCESS!=sc)
00059     {
00060        return sc;
00061     }
00062 
00063     MsgStream log(messageService(), RawDataHltCnv_Name.c_str());
00064 
00065     IService* svc = 0;
00066     sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), svc);
00067     if (sc != StatusCode::SUCCESS) {
00068         log << MSG::ERROR << "Can't get RawDataAccess interface" << endreq;
00069         return StatusCode::FAILURE;
00070     }
00071 
00072     m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc);
00073     if (m_RawDataAccess  == 0 ) {
00074       log << MSG::ERROR << "RawDataCnv: Cant cast to RawDataCnvSvc" << endreq;
00075       return StatusCode::FAILURE;
00076     }
00077 
00078     sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
00079     if(sc != StatusCode::SUCCESS ) {
00080         log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
00081         return sc ;
00082     }
00083  
00084     m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
00085     if(m_inputSvc == 0 ) {
00086         log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq;
00087         return StatusCode::FAILURE ;
00088     }
00089 
00090     return StatusCode::SUCCESS;
00091 }
00092 
00093 
00094 StatusCode RawDataHltCnv::updateObj(IOpaqueAddress* pAddr, DataObject* pObj) {
00095     // Purpose and Method:  This method does nothing other than announce it has
00096     //   been called.
00097 
00098     //MsgStream log(msgSvc(), "RawDataHltCnv");
00099     //log << MSG::DEBUG << "RawDataHltCnv::updateObj" << endreq;
00100     return Converter::updateObj(pAddr, pObj);
00101 }
00102 
00103 // Create a converted object in the Transient Data Store.
00104 StatusCode RawDataHltCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj)
00105 {
00106    //MsgStream log(msgSvc(), "RawDataHltCnv");
00107    //RawDataAddress *pEFAddr;
00108    
00109    // Purpose and Method:  This converter will create an empty EventHeader on
00110    //   the TDS.
00111    HltEvent *digi = new HltEvent();
00112    // Set fromMc to false
00113    digi->initialize(false);
00114    pObj = digi;
00115    return StatusCode::SUCCESS;
00116 
00117 }
00118 
00119 StatusCode RawDataHltCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr)        
00120 {
00121     // convert Raws in the container into ByteStream
00122     StatusCode sc = StatusCode::SUCCESS ; 
00123     //MsgStream log(messageService(), "RawDataHltCnv");
00124  
00125     //WriteRawEvent* re = static_cast<WriteRawEvent*>(m_RawDataAccess->getRawEvent()); 
00126  
00127  
00128     std::string nm = pObj->registry()->name(); 
00129  
00130     RawDataAddress* addr = new RawDataAddress(classID(), nm, ""); 
00131  
00132     pAddr = addr; 
00133  
00134     return StatusCode::SUCCESS; 
00135  
00136 }
00137 
00138 

Generated on Tue Nov 29 22:58:32 2016 for BOSS_7.0.2 by  doxygen 1.4.7