RawDataTrigGTDCnv Class Reference

#include <RawDataTrigGTDCnv.h>

Inheritance diagram for RawDataTrigGTDCnv:

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

Public Types

typedef Ty1 source
typedef Ty2 destination

Public Member Functions

StatusCode init ()
virtual long repSvcType () const
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
 Convert the transient object to the requested representation.
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 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.
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
static const unsigned char storageType ()

Protected Member Functions

 RawDataTrigGTDCnv (ISvcLocator *svc)
virtual destinationconvert (const source &) const =0

Protected Attributes

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.

Private Attributes

IRawDataInputSvcm_inputSvc
PackedRawDataCnvSvcm_RawDataAccess

Friends

class CnvFactory< RawDataTrigGTDCnv >

Detailed Description

Definition at line 21 of file RawDataTrigGTDCnv.h.


Member Typedef Documentation

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

Definition at line 19 of file Converter.h.

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

Definition at line 18 of file Converter.h.


Constructor & Destructor Documentation

RawDataTrigGTDCnv::RawDataTrigGTDCnv ( ISvcLocator *  svc  )  [protected]

Definition at line 11 of file RawDataTrigGTDCnv.cxx.

References init().

00011                                                      :
00012 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc)
00013 {
00014   init();
00015 }


Member Function Documentation

const CLID & RawDataTrigGTDCnv::classID (  )  [static]

Reimplemented from RawDataBaseCnv.

Definition at line 18 of file RawDataTrigGTDCnv.cxx.

References CLID_TrigGTDCol.

Referenced by PackedRawDataCnvSvc::addConverters().

00019 {
00020   return CLID_TrigGTDCol;
00021 }

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

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

Definition at line 66 of file RawDataTrigGTDCnv.cxx.

References BufferHolder::bufSize(), IRawDataInputSvc::currentEvent(), calibUtil::ERROR, RAWEVENT::getGTDBuf(), genRecEmupikp::i, m_inputSvc, msgSvc(), BufferHolder::nBuf(), and EventModel::Trig::TrigGTDCol.

00067 {
00068   MsgStream log(msgSvc(), "RawDataTrigGTDCnv");
00069   RawDataAddress* pEFAddr;
00070 
00071   RAWEVENT* evt;
00072   TrigGTD*  trigGTD;
00073 
00074   TrigGTDCol* gtdCol = new TrigGTDCol;
00075   pObj = gtdCol;
00076 
00077   evt = m_inputSvc->currentEvent();
00078   if (evt == NULL) {
00079     log << MSG::ERROR << "RawDataTrigGTDCnv::createObj has no event!" << endreq;
00080     return StatusCode::FAILURE;
00081   }
00082 
00083   const BufferHolder& gtdBuf = evt->getGTDBuf();
00084   uint32_t nbuf = gtdBuf.nBuf();
00085 
00086   for (uint32_t i = 0; i < nbuf; i++) {
00087     uint32_t* buf = gtdBuf(i);
00088     uint32_t bufSize = gtdBuf.bufSize(i);
00089     uint32_t index = 0;
00090     while (bufSize - index > 1) {
00091       uint32_t blockSize = ( ((*(buf+index))>>14) & 0x3FF);
00092       uint32_t id = ((*(buf+index))>>24);
00093       if (blockSize == 0 || (index+blockSize) > bufSize) break;
00094       if ((id> 0xD1 && id < 0xD8 && id != 0xD5) || id == 0xDA || (id > 0xE1 && id < 0xED)) {
00095         trigGTD = new TrigGTD(buf+index);
00096         gtdCol->push_back(trigGTD);
00097       }
00098       index += blockSize;
00099     }
00100   }
00101 
00102   return StatusCode::SUCCESS;
00103 }

StatusCode RawDataTrigGTDCnv::createRep ( DataObject *  pObj,
IOpaqueAddress *&  pAddr 
) [virtual]

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 105 of file RawDataTrigGTDCnv.cxx.

00106 {
00107   MsgStream log(messageService(), "RawDataTrigGTDCnv");
00108 
00109   return StatusCode::SUCCESS;
00110 }

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.

Definition at line 81 of file RawDataBaseCnv.cxx.

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 }

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

Resolve the references of the converted object.

Definition at line 29 of file RawDataBaseCnv.cxx.

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 }

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

Definition at line 73 of file RawDataBaseCnv.cxx.

References RawDataBaseCnv::m_CnvSvc.

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

StatusCode RawDataTrigGTDCnv::init (  ) 

Definition at line 23 of file RawDataTrigGTDCnv.cxx.

References calibUtil::ERROR, Bes_Common::INFO, RawDataBaseCnv::initialize(), m_inputSvc, m_RawDataAccess, and Bes_Common::WARNING.

Referenced by RawDataTrigGTDCnv().

00024 {
00025   StatusCode sc = RawDataBaseCnv::initialize();
00026   if (sc.isFailure()) {
00027     return sc;
00028   }
00029 
00030   MsgStream log(messageService(), "RawDataTrigGTDCnv");
00031 
00032   IService* isvc = 0;
00033   StatusCode status = serviceLocator()->service("PackedRawDataCnvSvc", isvc, true);
00034 
00035   m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
00036   if (m_RawDataAccess == 0) {
00037     log << MSG::ERROR << "RawDataTrigGTDCnv: Cant cast to RawDataCnvSvc" << endreq;
00038     return StatusCode::FAILURE;
00039   }
00040 
00041   if (m_RawDataAccess) log << MSG::INFO << "RawDataCnvSvc retrieved" << endreq;
00042 
00043   IService* svc;
00044   sc = serviceLocator()->getService("RawDataInputSvc", svc);
00045   if (sc.isFailure()) {
00046     log << MSG::WARNING << "Cant get RawDataInputSvc" << endreq;
00047     return sc;
00048   }
00049 
00050   m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
00051   if (m_inputSvc == 0) {
00052     log << MSG::WARNING << "Cant cast to RawDataInputSvc" << endreq;
00053     return StatusCode::FAILURE;
00054   }
00055 
00056   return StatusCode::SUCCESS;
00057 }

StatusCode RawDataBaseCnv::initialize (  )  [inherited]

Reimplemented in RawDataCnv, RawDataDigiCnv, RawDataEmcDigiCnv, RawDataEmcMcHitCnv, RawDataEvtHeaderCnv, RawDataHltCnv, RawDataHltRawCnv, RawDataLumiDigiCnv, RawDataMcCnv, RawDataMcParticleCnv, RawDataMdcDigiCnv, RawDataMdcMcHitCnv, RawDataMucDigiCnv, RawDataMucMcHitCnv, RawDataTofDigiCnv, RawDataTofMcHitCnv, and RawDataZddEventCnv.

Definition at line 50 of file RawDataBaseCnv.cxx.

Referenced by init(), RawDataTrigCnv::init(), RawDataZddEventCnv::initialize(), RawDataTofMcHitCnv::initialize(), RawDataTofDigiCnv::initialize(), RawDataMucMcHitCnv::initialize(), RawDataMucDigiCnv::initialize(), RawDataMdcMcHitCnv::initialize(), RawDataMdcDigiCnv::initialize(), RawDataMcParticleCnv::initialize(), RawDataMcCnv::initialize(), RawDataLumiDigiCnv::initialize(), RawDataHltRawCnv::initialize(), RawDataHltCnv::initialize(), RawDataEvtHeaderCnv::initialize(), RawDataEmcMcHitCnv::initialize(), RawDataEmcDigiCnv::initialize(), RawDataDigiCnv::initialize(), and RawDataCnv::initialize().

00050                                         {
00051     // Purpose and Method:  Perform standard converter initialization.
00052     //   Access the EventCnvSvc to create an association between converters 
00053     //   and paths within the TDS, using the vector of leaves and the
00054     //   declareObject methods available in each specific converter.
00055     StatusCode status = Converter::initialize();
00056     /*
00057     if ( status.isSuccess() )   {
00058         IService* isvc = 0;
00059         status = serviceLocator()->service(cnvSvcName, isvc, true);        
00060         if ( status.isSuccess() )   {
00061             status = isvc->queryInterface(IID_IRawDataBaseCnv, (void**)&m_CnvSvc);
00062             if ( status.isSuccess() )   {
00063                 for ( std::vector<IRawDataCnvSvc::Leaf>::iterator i = m_leaves.begin(); i != m_leaves.end(); i++ )    {
00064                     m_CnvSvc->declareObject(*i);
00065                 }
00066             }
00067         }
00068     }
00069     */
00070     return status;
00071 }

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

virtual long RawDataTrigGTDCnv::repSvcType (  )  const [inline, virtual]

Reimplemented from RawDataBaseCnv.

Definition at line 35 of file RawDataTrigGTDCnv.h.

References PACKEDRAWEVENT_StorageType.

00035                                   {
00036     return PACKEDRAWEVENT_StorageType;
00037   }

static const unsigned char RawDataTrigGTDCnv::storageType (  )  [inline, static]

Reimplemented from RawDataBaseCnv.

Definition at line 39 of file RawDataTrigGTDCnv.h.

References PACKEDRAWEVENT_StorageType.

00039                                            {
00040     return PACKEDRAWEVENT_StorageType;
00041   }

StatusCode RawDataTrigGTDCnv::updateObj ( IOpaqueAddress *  ,
DataObject *   
) [virtual]

Definition at line 59 of file RawDataTrigGTDCnv.cxx.

References Bes_Common::DEBUG, and msgSvc().

00059                                                                                {
00060   MsgStream log(msgSvc(), "RawDataTrigGTDCnv");
00061   log << MSG::DEBUG << "RawDataTrigGTDCnv::updateObj" << endreq;
00062   return Converter::updateObj(pAddr, pObj);
00063 }

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

Update the converted representation of a transient object.

Definition at line 36 of file RawDataBaseCnv.cxx.

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 }

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

Update the references of an already converted object.

Definition at line 43 of file RawDataBaseCnv.cxx.

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

friend class CnvFactory< RawDataTrigGTDCnv > [friend]

Definition at line 24 of file RawDataTrigGTDCnv.h.


Member Data Documentation

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]

Pointer to event conversion service interface.

Definition at line 28 of file RawDataBaseCnv.h.

Referenced by RawDataBaseCnv::finalize().

IRawDataInputSvc* RawDataTrigGTDCnv::m_inputSvc [private]

Definition at line 52 of file RawDataTrigGTDCnv.h.

Referenced by createObj(), and init().

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

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

Definition at line 30 of file RawDataBaseCnv.h.

PackedRawDataCnvSvc* RawDataTrigGTDCnv::m_RawDataAccess [private]

Definition at line 54 of file RawDataTrigGTDCnv.h.

Referenced by init().


Generated on Tue Nov 29 23:20:46 2016 for BOSS_7.0.2 by  doxygen 1.4.7