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

RawDataEmcMcHitCnv Class Reference

#include <RawDataEmcMcHitCnv.h>

Inheritance diagram for RawDataEmcMcHitCnv:

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

EmcMcHitBuilder m_emcMcHitBuilder
 EmcMcHitBuilder 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<RawDataEmcMcHitCnv>

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

RawDataEmcMcHitCnv::RawDataEmcMcHitCnv ISvcLocator *  svc  )  [protected]
 

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

RawDataEmcMcHitCnv::RawDataEmcMcHitCnv ISvcLocator *  svc  )  [protected]
 


Member Function Documentation

const CLID& RawDataEmcMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

const CLID & RawDataEmcMcHitCnv::classID  )  [static]
 

Reimplemented from RawDataBaseCnv.

00043 {
00044   return CLID_EmcMcHitCol;
00045 }

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

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

00111 {
00112 
00113   //This converter will create an empty EmcMcHitCol on the TDS
00114   EmcMcHitCol *emcMcHitCol = new EmcMcHitCol;
00115   pObj = emcMcHitCol;
00116    
00117   RAWEVENT *evt = m_inputSvc->currentEvent(); 
00118   if (evt == NULL) {
00119       //MsgStream log(msgSvc(), "RawDataEmcMcHitCnv");
00120       //log << MSG::ERROR << "RawDataCnv has no event!" << endreq; 
00121       return StatusCode::FAILURE;
00122   }
00123   
00124   EmcMcHit* emcMcHit;
00125   EmcTruth_t m_EmcTruth;
00126 
00127   assert((evt->getEmcTruth().size()%8) == 0);
00128 
00129   std::vector<uint32_t>::const_iterator iter = evt->getEmcTruth().begin();
00130   std::vector<uint32_t>::const_iterator eiter = evt->getEmcTruth().end();
00131 
00132   for (int emcMcHitId = 0; iter != eiter; emcMcHitId++) {
00133     // retrieve the McTruth data
00134     m_emcMcHitBuilder.unPack(iter, eiter, m_EmcTruth);
00135     // construct the identifier
00136     Identifier ident = EmcID::crystal_id(m_EmcTruth.partId, m_EmcTruth.numTheta, m_EmcTruth.numPhi);
00137     // construct the EmcMcHit
00138     emcMcHit = new EmcMcHit(ident, m_EmcTruth.trackIndex,
00139                           m_EmcTruth.x/(m_emcMcHitBuilder.m_xCoeff*1.0),
00140                           m_EmcTruth.y/(m_emcMcHitBuilder.m_yCoeff*1.0),
00141                           m_EmcTruth.z/(m_emcMcHitBuilder.m_zCoeff*1.0),
00142                           m_EmcTruth.px/(m_emcMcHitBuilder.m_pxCoeff*1.0),
00143                           m_EmcTruth.py/(m_emcMcHitBuilder.m_pyCoeff*1.0),
00144                           m_EmcTruth.pz/(m_emcMcHitBuilder.m_pzCoeff*1.0),
00145                           m_EmcTruth.totalEdep/(m_emcMcHitBuilder.m_totalEdepCoeff*1.0)  );
00146     // And add the stuff to the container
00147     emcMcHitCol->push_back(emcMcHit);
00148   }
00149 
00150   return StatusCode::SUCCESS; 
00151 
00152 }

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

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

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

Reimplemented from RawDataBaseCnv.

StatusCode RawDataEmcMcHitCnv::initialize  ) 
 

Reimplemented from RawDataBaseCnv.

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

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00046                                    {
00047       return PACKEDRAWEVENT_StorageType;
00048    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

Reimplemented from RawDataBaseCnv.

00050                                             {
00051       return PACKEDRAWEVENT_StorageType;
00052    }

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

override the RawDataBaseCnv version

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

override the RawDataBaseCnv version

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

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

EmcMcHitBuilder RawDataEmcMcHitCnv::m_emcMcHitBuilder [private]
 

EmcMcHitBuilder for packing or unpacking data.

IRawDataInputSvc* RawDataEmcMcHitCnv::m_inputSvc [private]
 

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

Define the interface to raw data cnv.

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