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

RawDataMucMcHitCnv Class Reference

#include <RawDataMucMcHitCnv.h>

Inheritance diagram for RawDataMucMcHitCnv:

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

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

IRawDataInputSvcm_inputSvc
IRawDataInputSvcm_inputSvc
MucMcHitBuilder m_mucMcHitBuilder
 MucMcHitder for packing or unpacking data.
PackedRawDataCnvSvcm_RawDataAccess
 Define the interface to raw data cnv.
PackedRawDataCnvSvcm_RawDataAccess
 Define the interface to raw data cnv.

Friends

class CnvFactory<RawDataMucMcHitCnv>

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

RawDataMucMcHitCnv::RawDataMucMcHitCnv ISvcLocator *  svc  )  [protected]
 

00038                                                        : 
00039 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00040 {
00041   //init();
00042 }

RawDataMucMcHitCnv::RawDataMucMcHitCnv ISvcLocator *  svc  )  [protected]
 


Member Function Documentation

const CLID& RawDataMucMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

const CLID & RawDataMucMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

00047 {
00048   return CLID_MucMcHitCol;
00049 }

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

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

00116 {
00117   //MsgStream log(msgSvc(), "RawDataMucMcHitCnv");
00118 
00119   //This converter will create an empty MucMcHitCol on the TDS
00120   MucMcHitCol *mucMcHitCol = new MucMcHitCol;
00121   pObj = mucMcHitCol;
00122    
00123   RAWEVENT *evt = m_inputSvc->currentEvent(); 
00124   if (evt == NULL) {
00125       //log << MSG::ERROR << "RawDataCnv has no event!" << endreq; 
00126       return StatusCode::FAILURE;
00127   }
00128   
00129   assert((evt->getMucTruth().size()%7) == 0);
00130 
00131   MucMcHit* mucMcHit;
00132   MucTruth_t m_MucTruth;
00133 
00134   std::vector<uint32_t>::const_iterator iter = evt->getMucTruth().begin();
00135   std::vector<uint32_t>::const_iterator eiter = evt->getMucTruth().end();
00136 
00137   for (int mucMcHitId = 0; iter != eiter; mucMcHitId++) {
00138     //retrieve the MucTruth data
00139     m_mucMcHitBuilder.unPack(iter, eiter, m_MucTruth);
00140     //construct the identifier
00141     const Identifier ident = MucID::channel_id
00142       (m_MucTruth.partId, m_MucTruth.segId, m_MucTruth.gapId, m_MucTruth.stripId);
00143     //construct the MucMcHit
00144     mucMcHit = new MucMcHit(ident, m_MucTruth.trackIndex%1000,
00145                        m_MucTruth.x/(m_mucMcHitBuilder.m_xCoeff*1.0),
00146                        m_MucTruth.y/(m_mucMcHitBuilder.m_yCoeff*1.0),
00147                        m_MucTruth.z/(m_mucMcHitBuilder.m_zCoeff*1.0),
00148                        m_MucTruth.px/(m_mucMcHitBuilder.m_pxCoeff*1.0),
00149                        m_MucTruth.py/(m_mucMcHitBuilder.m_pyCoeff*1.0),
00150                        m_MucTruth.pz/(m_mucMcHitBuilder.m_pzCoeff*1.0)  );
00151     // And add the stuff to the container
00152     mucMcHitCol->push_back(mucMcHit);
00153   }
00154 
00155   return StatusCode::SUCCESS; 
00156 
00157 }

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

00160 {
00161    // convert PixelRaw in the container into ByteStream
00162   //MsgStream log(messageService(), "RawDataMucMcHitCnv");
00163   
00164   WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 
00165   
00166   if (re == 0) {
00167      //log << " get RawEvent failed !" << endreq;
00168      return StatusCode::FAILURE; 
00169   }
00170 
00171   SmartDataPtr<MucMcHitCol> mcHitCol(dataProvider(), EventModel::MC::MucMcHitCol);
00172 
00173   if (mcHitCol == 0) {
00174      //log << "no MucMcHitCol found" << endreq;
00175      return StatusCode::FAILURE;
00176   }
00177   
00178   StatusCode sc = m_mucMcHitBuilder.pack(mcHitCol, re);
00179 
00180   return sc; 
00181 
00182 }

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

Reimplemented from RawDataBaseCnv.

StatusCode RawDataMucMcHitCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

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

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

override the RawDataBaseCnv version

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

override the RawDataBaseCnv version

00105                                                                                 {
00106   // Purpose and Method:  This method does nothing other than announce it has
00107   //   been called.
00108 
00109   //MsgStream log(msgSvc(), "RawDataMucMcHitCnv");
00110   //log << MSG::DEBUG << "RawDataMucMcHitCnv::updateObj" << endreq;
00111   return Converter::updateObj(pAddr, pObj);
00112 }

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<RawDataMucMcHitCnv> [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.

IRawDataInputSvc* RawDataMucMcHitCnv::m_inputSvc [private]
 

IRawDataInputSvc* RawDataMucMcHitCnv::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.

MucMcHitBuilder RawDataMucMcHitCnv::m_mucMcHitBuilder [private]
 

MucMcHitder for packing or unpacking data.

PackedRawDataCnvSvc* RawDataMucMcHitCnv::m_RawDataAccess [private]
 

Define the interface to raw data cnv.

PackedRawDataCnvSvc* RawDataMucMcHitCnv::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:49 2011 for BOSS6.5.5 by  doxygen 1.3.9.1