Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawDataHltRawCnv Class Reference

#include <RawDataHltRawCnv.h>

Inheritance diagram for RawDataHltRawCnv:

RawDataBaseCnv RawDataBaseCnv Converter< Ty1, Ty2 > Converter< Ty1, Ty2 > Converter< Ty1, Ty2 > Converter< Ty1, Ty2 > List of all members.

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 ()
destinationoperator (const source &) const
destinationoperator (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 destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
 RawDataHltRawCnv (ISvcLocator *svc)
 RawDataHltRawCnv (ISvcLocator *svc)
 ~RawDataHltRawCnv ()
 ~RawDataHltRawCnv ()

Protected Attributes

IRawDataCnvSvcm_CnvSvc
 Pointer to event conversion service interface.
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.
std::vector< IRawDataCnvSvc::Leafm_leaves
 Leaf objects giving the locations of the objects in the data store.

Private Attributes

HltBuilder m_hltBuilder
 HltBuilder for packing or unpacking data.
IRawDataInputSvcm_inputSvc
IRawDataInputSvcm_inputSvc
PackedRawDataCnvSvcm_RawDataAccess
 Define the interface to raw data cnv.
PackedRawDataCnvSvcm_RawDataAccess
 Define the interface to raw data cnv.

Friends

class CnvFactory<RawDataHltRawCnv>

Member Typedef Documentation

template<class Ty1, class Ty2>
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited]
 

template<class Ty1, class Ty2>
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited]
 

template<class Ty1, class Ty2>
typedef Ty1 Converter< Ty1, Ty2 >::source [inherited]
 

template<class Ty1, class Ty2>
typedef Ty1 Converter< Ty1, Ty2 >::source [inherited]
 


Constructor & Destructor Documentation

RawDataHltRawCnv::RawDataHltRawCnv ISvcLocator *  svc  )  [protected]
 

00031                                                    : 
00032 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00033 {
00034     //init();
00035 }

RawDataHltRawCnv::~RawDataHltRawCnv  )  [protected]
 

00036                                    {
00037 }

RawDataHltRawCnv::RawDataHltRawCnv ISvcLocator *  svc  )  [protected]
 

RawDataHltRawCnv::~RawDataHltRawCnv  )  [protected]
 


Member Function Documentation

const CLID& RawDataHltRawCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

const CLID & RawDataHltRawCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

00042 {
00043    return CLID_HltRawCol;
00044 }

template<class Ty1, class Ty2>
virtual destination* Converter< Ty1, Ty2 >::convert const source  )  const [protected, pure virtual, inherited]
 

template<class Ty1, class Ty2>
virtual destination* Converter< Ty1, Ty2 >::convert const source  )  const [protected, pure virtual, inherited]
 

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

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

00110 {
00111    //MsgStream log(msgSvc(), "RawDataHltRawCnv");
00112    RawDataAddress *pEFAddr;
00113    uint32_t TEData[2];
00114    
00115    // Purpose and Method:  This converter will create an empty HltRawCol on
00116    //   the TDS.
00117    HltRawCol *digiCol = new HltRawCol;
00118    pObj = digiCol;
00119 
00120    RAWEVENT *evt = m_inputSvc->currentEvent(); 
00121    if (evt == NULL) {
00122      cout << "RawDataHltRawCnv::createObj can't get event!" << endl; 
00123      return StatusCode::FAILURE;
00124    }
00125 
00126    int digiId = 0;
00127    const BufferHolder& hltBuf = evt->getHltBuf();
00128    uint32_t nbuf = hltBuf.nBuf();
00129    
00130    uint32_t REId = 0, TEId = 0;
00131    uint32_t nmdc=0,ntof=0,nemc=0,nmuc=0;
00132    for (uint32_t i = 0; i < nbuf; i++) {
00133      uint32_t* buf = hltBuf(i);
00134      uint32_t bufSize = hltBuf.bufSize(i);
00135      for (uint32_t j = 0; j < bufSize; j++, digiId++) {
00136 
00137         m_hltBuilder.unPack(buf[j], digiId, REId, TEData[0], TEData[1]);
00138         TEId = m_hltBuilder.getTEID(REId);
00139         if ( TEId == 0xFFFFFFFF ) continue;
00140 
00141 //       log << MSG::NIL << "HLT digit No: " << digiId << "="<<std::hex<<buf[j]
00142 //         <<"===>"<<TEId<<" : "<<TEData[0]<<","<<TEData[1]<<std::dec<<endreq;
00143        for (uint32_t k=0; k< 2;k++){
00144          // Create new track
00145          if(k==0||(k==1&&TEData[k])){
00146            if(k==1) TEId+=1;
00147            if(HltID::is_number(HltID::convert(TEId))) {
00148              nmdc=TEData[k]&0xFF;
00149              ntof=(TEData[k]>>8)&0xFF;
00150              nemc=(TEData[k]>>16)&0xFF;
00151              nmuc=(TEData[k]>>24)&0xFF;
00152              //log << MSG::INFO << "number=" << std::hex <<TEData[k] <<std::dec<< endreq;
00153            }
00154            HltRaw* hltRaw = new HltRaw(HltID::convert(TEId,nmdc,ntof,nemc,nmuc));
00155            hltRaw->setIntChannel(TEData[k]);
00156            //hltRaw->setFloatChannel(TEData[k]);
00157            hltRaw->setChargeChannel(TEData[k]);
00158 
00159            digiCol->push_back ( hltRaw );
00160          }
00161        }
00162      }
00163    }
00164    return StatusCode::SUCCESS; 
00165 }

virtual StatusCode RawDataHltRawCnv::createRep DataObject *  pObj,
IOpaqueAddress *&  pAddr
[virtual]
 

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

StatusCode RawDataHltRawCnv::createRep DataObject *  pObj,
IOpaqueAddress *&  pAddr
[virtual]
 

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

00168 {
00169     // convert PixelRaw in the container into ByteStream
00170     //MsgStream log(messageService(), "RawDataHltRawCnv");
00171 
00172     WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 
00173     if(re == 0) {
00174       //log << " get RawEvent failed !" << endreq;
00175       return StatusCode::FAILURE; 
00176     }
00177 
00178     SmartDataPtr<HltRawCol> digiCol(dataProvider(), EventModel::Hlt::HltRawCol);
00179     if (digiCol == 0) {
00180         //log << "no HltRawCol found" << endreq;
00181         return StatusCode::FAILURE;
00182     }
00183     /*
00184     else {
00185         log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq;
00186         int ndigi = 0;
00187         HltRawCol::const_iterator pHltRaw = digiCol->begin();
00188         for (pHltRaw; pHltRaw!= digiCol->end(); pHltRaw++) {
00189             log <<MSG::INFO << "Raw " << ndigi++ << " ";
00190             // output the digi proper:  " << digi " no longer works because
00191             // "digi" now returns an integer sort order
00192             (**pHltRaw).fillStream(log.stream());
00193             log << endreq;
00194         }
00195     }
00196     */
00197     return m_hltBuilder.pack(digiCol, re);
00198 }

void RawDataBaseCnv::declareObject const std::string &  fullPath,
const CLID &  clid,
const std::string &  bank,
long  par = 0
[inherited]
 

Store TDS path to link a particular converter to an object on the TDS.

void RawDataBaseCnv::declareObject const std::string &  fullPath,
const CLID &  clid,
const std::string &  bank,
long  par = 0
[inherited]
 

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 }

virtual StatusCode RawDataBaseCnv::fillRepRefs IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

Resolve the references of the converted object.

StatusCode RawDataBaseCnv::fillRepRefs IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

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 }

virtual StatusCode RawDataBaseCnv::finalize  )  [virtual, inherited]
 

StatusCode RawDataBaseCnv::finalize  )  [virtual, inherited]
 

00073                                       {
00074     if ( m_CnvSvc )     {
00075         m_CnvSvc->release();
00076         m_CnvSvc = 0;
00077     }
00078     return Converter::finalize();
00079 }

StatusCode RawDataHltRawCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

StatusCode RawDataHltRawCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

00047 {
00048     std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
00049     std::string RawDataInputSvc_Name("RawDataInputSvc");
00050     std::string RawDataHltRawCnv_Name("RawDataHltRawCnv");
00051     
00052     // for Mutil-thread by tianhl
00053     ConversionSvc*  pCnvSvc = 0;
00054     if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
00055       if  (isGaudiThreaded(pCnvSvc->name())){
00056         PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00057         RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00058         RawDataHltRawCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00059       }
00060     }
00061     
00062    MsgStream log(messageService(), RawDataHltRawCnv_Name.c_str());
00063    StatusCode sc = RawDataBaseCnv::initialize();
00064    if (StatusCode::SUCCESS != sc) {
00065      
00066      return sc;
00067    }
00068 
00069    // Check RawDataCnvSvc
00070    IService* isvc = 0;
00071    StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
00072 
00073    m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc); 
00074     if(m_RawDataAccess  == 0 ) {
00075       log<<MSG::ERROR<< "  RawDataCnv: Cant cast to  RawDataCnvSvc " <<endreq; 
00076       return StatusCode::FAILURE ;
00077    }
00078    
00079    if(m_RawDataAccess)
00080         log << MSG::INFO << "RawDataCnvSvc retrieved "<< endreq;
00081 
00082     IService* svc ;
00083     sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
00084     if(sc != StatusCode::SUCCESS ) {
00085         log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
00086         return sc ;
00087     }
00088  
00089     m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
00090     if(m_inputSvc == 0 ) {
00091         log<<MSG::WARNING<< " Cant cast to  RawDataInputSvc " <<endreq;
00092         return StatusCode::FAILURE ;
00093     }
00094  
00095    return StatusCode::SUCCESS; 
00096 }

template<class Ty1, class Ty2>
destination* Converter< Ty1, Ty2 >::operator const source  )  const [inline, inherited]
 

template<class Ty1, class Ty2>
destination* Converter< Ty1, Ty2 >::operator const source  )  const [inline, inherited]
 

virtual long RawDataHltRawCnv::repSvcType  )  const [inline, virtual]
 

Reimplemented from RawDataBaseCnv.

00047                                    {
00048        return PACKEDRAWEVENT_StorageType;
00049    }

virtual long RawDataHltRawCnv::repSvcType  )  const [inline, virtual]
 

Reimplemented from RawDataBaseCnv.

00047                                    {
00048        return PACKEDRAWEVENT_StorageType;
00049    }

const unsigned char RawDataHltRawCnv::storageType  )  [inline, static]
 

Reimplemented from RawDataBaseCnv.

00051                                             {
00052        return PACKEDRAWEVENT_StorageType;
00053    }

const unsigned char RawDataHltRawCnv::storageType  )  [inline, static]
 

Reimplemented from RawDataBaseCnv.

00051                                             {
00052        return PACKEDRAWEVENT_StorageType;
00053    }

virtual StatusCode RawDataHltRawCnv::updateObj IOpaqueAddress *  ,
DataObject * 
[virtual]
 

override the RawDataBaseCnv version

StatusCode RawDataHltRawCnv::updateObj IOpaqueAddress *  ,
DataObject * 
[virtual]
 

override the RawDataBaseCnv version

00099                                                                               {
00100     // Purpose and Method:  This method does nothing other than announce it has
00101     //   been called.
00102 
00103     //MsgStream log(msgSvc(), "RawDataHltRawCnv");
00104     //log << MSG::DEBUG << "RawDataHltRawCnv::updateObj" << endreq;
00105     return Converter::updateObj(pAddr, pObj);
00106 }

virtual StatusCode RawDataBaseCnv::updateRep IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

Update the converted representation of a transient object.

StatusCode RawDataBaseCnv::updateRep IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

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 }

virtual StatusCode RawDataBaseCnv::updateRepRefs IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

Update the references of an already converted object.

StatusCode RawDataBaseCnv::updateRepRefs IOpaqueAddress *  pAddress,
DataObject *  pObject
[virtual, inherited]
 

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 }


Friends And Related Function Documentation

CnvFactory<RawDataHltRawCnv> [friend]
 


Member Data Documentation

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]
 

Pointer to event conversion service interface.

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]
 

Pointer to event conversion service interface.

HltBuilder RawDataHltRawCnv::m_hltBuilder [private]
 

HltBuilder for packing or unpacking data.

IRawDataInputSvc* RawDataHltRawCnv::m_inputSvc [private]
 

IRawDataInputSvc* RawDataHltRawCnv::m_inputSvc [private]
 

std::vector<IRawDataCnvSvc::Leaf> RawDataBaseCnv::m_leaves [protected, inherited]
 

Leaf objects giving the locations of the objects in the data store.

std::vector<IRawDataCnvSvc::Leaf> RawDataBaseCnv::m_leaves [protected, inherited]
 

Leaf objects giving the locations of the objects in the data store.

PackedRawDataCnvSvc* RawDataHltRawCnv::m_RawDataAccess [private]
 

Define the interface to raw data cnv.

PackedRawDataCnvSvc* RawDataHltRawCnv::m_RawDataAccess [private]
 

Define the interface to raw data cnv.


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:42:28 2011 for BOSS6.5.5 by  doxygen 1.3.9.1