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

RawDataTofDigiCnv Class Reference

#include <RawDataTofDigiCnv.h>

Inheritance diagram for RawDataTofDigiCnv:

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
 RawDataTofDigiCnv (ISvcLocator *svc)
 RawDataTofDigiCnv (ISvcLocator *svc)
 ~RawDataTofDigiCnv ()
 ~RawDataTofDigiCnv ()

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

TofConverterm_cnv
 TofConverter for packing or unpacking data.
TofConverterm_cnv
 TofConverter 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<RawDataTofDigiCnv>

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

RawDataTofDigiCnv::RawDataTofDigiCnv ISvcLocator *  svc  )  [protected]
 

00031                                                      : 
00032 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00033 {
00034 }

RawDataTofDigiCnv::~RawDataTofDigiCnv  )  [protected]
 

00037 {
00038    TofConverter::destroy();
00039 }

RawDataTofDigiCnv::RawDataTofDigiCnv ISvcLocator *  svc  )  [protected]
 

RawDataTofDigiCnv::~RawDataTofDigiCnv  )  [protected]
 


Member Function Documentation

const CLID& RawDataTofDigiCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

const CLID & RawDataTofDigiCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

00044 {
00045    return CLID_TofDigiCol;
00046 }

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 RawDataTofDigiCnv::createObj IOpaqueAddress *  pAddr,
DataObject *&  pObj
 

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

00109 {
00110    MsgStream log(msgSvc(), "RawDataTofDigiCnv");
00111 
00112    uint32_t TEId, TEData, TEOverflow, TETorQ;
00113    TofDigi* tofDigi;
00114    // Purpose and Method:  This converter will create an empty TofDigiCol on
00115    //   the TDS.
00116    TofDigiCol *digiCol = new TofDigiCol;
00117    pObj = digiCol;
00118 
00119    //zoujh: for luminosity begin ...................
00120    LumiDigiCol *lumiDigiCol = 0;
00121    DataObject* pLumi;
00122    dataProvider()->findObject("/Event/Digi/LumiDigiCol", pLumi);
00123    if ( pLumi == NULL ) {
00124       lumiDigiCol = new LumiDigiCol;
00125       StatusCode sc = dataProvider()->registerObject("/Event/Digi/LumiDigiCol", lumiDigiCol);
00126       if ( sc.isFailure() ) {
00127          log << MSG::ERROR << "Could not register LumiDigiCol in TDS!" << endreq;
00128       }
00129    }
00130    else {
00131       lumiDigiCol = dynamic_cast<LumiDigiCol*>(pLumi);
00132    }
00133    //zoujh: for luminosity end ^^^^^^^^^^^^^^^^^^^^^
00134     
00135    RAWEVENT* evt = m_inputSvc->currentEvent(); 
00136    if (evt == NULL) {
00137      cout << "RawDataTofDigiCnv::createObj has no event!" << endl; 
00138      return StatusCode::FAILURE;
00139    }
00140 
00141    const BufferHolder& tofBuf = evt->getTofBuf();
00142 
00143    return m_cnv->convert(tofBuf, digiCol, lumiDigiCol);
00144 }

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

00147 {
00148   // convert PixelRaw in the container into ByteStream
00149   //MsgStream log(messageService(), "RawDataTofDigiCnv");
00150 
00151   WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 
00152   if (re == 0) {
00153     //log << " get RawEvent failed !" << endreq;
00154     return StatusCode::FAILURE; 
00155   }
00156 
00157   SmartDataPtr<TofDigiCol> digiCol(dataProvider(), EventModel::Digi::TofDigiCol);
00158   if (digiCol == 0) {
00159     //log << "no TofDigiCol found" << endreq;
00160     return StatusCode::FAILURE;
00161   }
00162   /*
00163   else {
00164     log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq;
00165     int ndigi = 0;
00166     TofDigiCol::const_iterator pTofDigi = digiCol->begin();
00167     for (pTofDigi; pTofDigi!= digiCol->end(); pTofDigi++) {
00168       log <<MSG::INFO << "Digi " << ndigi++ << " ";
00169       // output the digi proper:  " << digi " no longer works because
00170       // "digi" now returns an integer sort order
00171       (**pTofDigi).fillStream(log.stream());
00172       log << endreq;
00173     }
00174   }
00175   */
00176 
00177   return m_cnv->convert(digiCol, re);
00178 }

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 RawDataTofDigiCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

StatusCode RawDataTofDigiCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

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

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 RawDataTofDigiCnv::repSvcType  )  const [inline, virtual]
 

Reimplemented from RawDataBaseCnv.

00046                                    {
00047        return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047        return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051        return PACKEDRAWEVENT_StorageType;
00052    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051        return PACKEDRAWEVENT_StorageType;
00052    }

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

override the RawDataBaseCnv version

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

override the RawDataBaseCnv version

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

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<RawDataTofDigiCnv> [friend]
 


Member Data Documentation

TofConverter* RawDataTofDigiCnv::m_cnv [private]
 

TofConverter for packing or unpacking data.

TofConverter* RawDataTofDigiCnv::m_cnv [private]
 

TofConverter for packing or unpacking data.

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]
 

Pointer to event conversion service interface.

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]
 

Pointer to event conversion service interface.

IRawDataInputSvc* RawDataTofDigiCnv::m_inputSvc [private]
 

IRawDataInputSvc* RawDataTofDigiCnv::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* RawDataTofDigiCnv::m_RawDataAccess [private]
 

Define the interface to raw data cnv.

PackedRawDataCnvSvc* RawDataTofDigiCnv::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:43:00 2011 for BOSS6.5.5 by  doxygen 1.3.9.1