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

RawDataMdcMcHitCnv Class Reference

#include <RawDataMdcMcHitCnv.h>

Inheritance diagram for RawDataMdcMcHitCnv:

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
 RawDataMdcMcHitCnv (ISvcLocator *svc)
 RawDataMdcMcHitCnv (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
MdcMcHitBuilder m_mdcMcHitBuilder
 MdcBuilder 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<RawDataMdcMcHitCnv>

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

RawDataMdcMcHitCnv::RawDataMdcMcHitCnv ISvcLocator *  svc  )  [protected]
 

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

RawDataMdcMcHitCnv::RawDataMdcMcHitCnv ISvcLocator *  svc  )  [protected]
 


Member Function Documentation

const CLID& RawDataMdcMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

const CLID & RawDataMdcMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

00045 {
00046   return CLID_MdcMcHitCol;
00047 }

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

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

construct the MdcMcHit

00115 {
00116   //MsgStream log(msgSvc(), "RawDataMdcMcHitCnv");
00117 
00118   //This converter will create an empty MdcMcHitCol on the TDS
00119   MdcMcHitCol *mdcMcHitCol = new MdcMcHitCol;
00120   pObj = mdcMcHitCol;
00121    
00122   RAWEVENT *evt = m_inputSvc->currentEvent(); 
00123   if (evt == NULL) {
00124       //log << MSG::ERROR << "RawDataCnv has no event!" << endreq; 
00125       return StatusCode::FAILURE;
00126   }
00127 
00128   assert((evt->getMdcTruth().size())%6 == 0);
00129 
00130   MdcTruth_t m_MdcTruth;
00131   MdcMcHit* mdcMcHit;
00132 
00133   std::vector<uint32_t>::const_iterator iter = evt->getMdcTruth().begin();
00134   std::vector<uint32_t>::const_iterator eiter = evt->getMdcTruth().end();
00135 
00136   for (int mdcMcHitId = 0; iter != eiter; mdcMcHitId++) {
00137     // retrieve the MdcTruth data
00138     m_mdcMcHitBuilder.unPack(iter, eiter, m_MdcTruth);
00139     //construct the identifier
00140     const Identifier ident =  MdcID::wire_id (m_MdcTruth.layerId, m_MdcTruth.cellId);
00142     mdcMcHit = new MdcMcHit(ident, m_MdcTruth.trackIndex,
00143                        m_MdcTruth.x/(m_mdcMcHitBuilder.m_xCoeff*1.0),
00144                        m_MdcTruth.y/(m_mdcMcHitBuilder.m_yCoeff*1.0),
00145                        m_MdcTruth.z/(m_mdcMcHitBuilder.m_zCoeff*1.0),
00146                        m_MdcTruth.driftD/(m_mdcMcHitBuilder.m_driftDCoeff*1.0),
00147                        m_MdcTruth.edep/(m_mdcMcHitBuilder.m_edepCoeff*1.0),
00148                        m_MdcTruth.posFlag );
00149     // And add the stuff to the container
00150     mdcMcHitCol->push_back(mdcMcHit);
00151   }
00152 
00153   return StatusCode::SUCCESS; 
00154 }

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

00157 {
00158    // convert PixelRaw in the container into ByteStream
00159   //MsgStream log(messageService(), "RawDataMdcMcHitCnv");
00160   
00161   WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 
00162   
00163   if (re == 0) {
00164      //log << " get RawEvent failed !" << endreq;
00165      return StatusCode::FAILURE; 
00166   }
00167 
00168   SmartDataPtr<MdcMcHitCol> mdcHitCol(dataProvider(), EventModel::MC::MdcMcHitCol);
00169 
00170   if (mdcHitCol == 0) {
00171      //log << "no MdcMcHitCol found" << endreq;
00172      return StatusCode::FAILURE;
00173   }
00174   /*else {
00175      log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq;
00176      int nMcHit = 0;
00177      MdcMcHitCol::const_iterator pMdcMcHit = mdcHitCol->begin();
00178      for ( ; pMdcMcHit != mdcHitCol->end(); pMdcMcHit++) {
00179         log << MSG::INFO << "McHit " << nMcHit++ << " "
00180             << (*pMdcMcHit)->getTrackIndex() << "  "
00181             << (*pMdcMcHit)->identify() << "  "
00182             << (*pMdcMcHit)->getDepositEnergy() << "  "
00183             << (*pMdcMcHit)->getDriftDistance() << "  "
00184             << (*pMdcMcHit)->getPositionX() << "  "
00185             << (*pMdcMcHit)->getPositionY() << "  "
00186             << (*pMdcMcHit)->getPositionZ() << endreq;
00187      }
00188   }*/
00189   
00190   StatusCode sc = m_mdcMcHitBuilder.pack(mdcHitCol, re);
00191 
00192   return sc; 
00193 
00194 }

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

Reimplemented from RawDataBaseCnv.

StatusCode RawDataMdcMcHitCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

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

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

override the RawDataBaseCnv version

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

override the RawDataBaseCnv version

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

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<RawDataMdcMcHitCnv> [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* RawDataMdcMcHitCnv::m_inputSvc [private]
 

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

MdcMcHitBuilder RawDataMdcMcHitCnv::m_mdcMcHitBuilder [private]
 

MdcBuilder for packing or unpacking data.

PackedRawDataCnvSvc* RawDataMdcMcHitCnv::m_RawDataAccess [private]
 

Define the interface to raw data cnv.

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