/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Protected Attributes
RecRpcEventCnv Class Reference

#include <RecRpcEventCnv.h>

Inheritance diagram for RecRpcEventCnv:
Inheritance graph
[legend]
Collaboration diagram for RecRpcEventCnv:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RecRpcEventCnv (ISvcLocator *svc)
virtual ~RecRpcEventCnv ()
StatusCode PerToTran (const PerRecRpcHeader &pobj, DayaBay::RecRpcHeader &tobj)
StatusCode TranToPer (const DayaBay::RecRpcHeader &tobj, PerRecRpcHeader &pobj)
StatusCode fillRepRefs (IOpaqueAddress *addr, DataObject *dobj)
StatusCode fillObjRefs (IOpaqueAddress *addr, DataObject *dobj)
PerType & getPerInputObject ()
PerType & getPerOutputObject ()
const RootIOBaseObjectgetBaseInputObject ()
const RootIOBaseObjectgetBaseOutputObject ()
virtual StatusCode PerToTran (const PerType &pobj, TranType &tobj)=0
virtual StatusCode TranToPer (const TranType &tobj, PerType &pobj)=0
virtual StatusCode TranObjectToPerObject (DataObject &dat, const RootOutputAddress &)
virtual StatusCode PerObjectToTranObject (DataObject *&dat)
virtual RootInputStreammakeInputStream (const RootInputAddress &ria)
virtual RootOutputStreammakeOutputStream (const RootOutputAddress &ria)
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
int commit (const RootOutputAddress &roa)
RootIOBaseCnvotherConverter (int clID)

Static Public Member Functions

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

Protected Attributes

std::string m_perclassName
PerType * m_perInObj
PerType * m_perOutObj
IRootIOSvcm_rioSvc
IConversionSvc * m_cnvSvc
RootInputStreamm_ris

Detailed Description

Definition at line 8 of file RecRpcEventCnv.h.


Constructor & Destructor Documentation

RecRpcEventCnv::RecRpcEventCnv ( ISvcLocator *  svc)

Definition at line 8 of file RecRpcEventCnv.cc.

    : RootIOTypedCnv<PerRecRpcHeader,RecRpcHeader>("PerRecRpcHeader",
                                             classID(),svc)
{
}
RecRpcEventCnv::~RecRpcEventCnv ( ) [virtual]

Definition at line 14 of file RecRpcEventCnv.cc.

{
}

Member Function Documentation

static const CLID& RecRpcEventCnv::classID ( ) [inline, static]

Definition at line 13 of file RecRpcEventCnv.h.

                                     {
            return DayaBay::CLID_RecRpcHeader;
        }
StatusCode RecRpcEventCnv::PerToTran ( const PerRecRpcHeader pobj,
DayaBay::RecRpcHeader tobj 
)

Definition at line 19 of file RecRpcEventCnv.cc.

{
    MsgStream log(msgSvc(), "RecRpcEventCnv::PerToTran");
    StatusCode sc = HeaderObjectCnv::toTran(perobj, tranobj);
    if(sc.isFailure()) return sc;

    RecRpcTrigger& recTr = tranobj.recTrigger();
    recTr.setHeader(&tranobj);
    Detector det((Site::Site_t)perobj.site,
                 (DetectorId::DetectorId_t)perobj.detector);
    recTr.setDetector(det);
    recTr.setTriggerNumber( perobj.triggerNumber );
    recTr.setTriggerType(Trigger::TriggerType_t (perobj.triggerType));

    timespec value = {perobj.triggerTimeSec, perobj.triggerTimeNanoSec};
    TimeStamp tstamp(value);
    recTr.setTriggerTime(tstamp);

    recTr.setEventType(perobj.eventType);

    for ( int i = 0; i < perobj.nClusters; ++i ) {
        const PerRecRpcHeader::RpcCluster& per = perobj.clusters.at(i);
        RecRpcCluster* tran = new RecRpcCluster(
                CLHEP::HepLorentzVector(per.x, per.y, per.z, per.t),
                ReconStatus::ReconStatus_t(per.status),
                per.quality,
                RecRpcCluster::ClusterType(per.type));
        tran->setMaxHitsInLayer(per.maxHitsInLayer);
        tran->setIs4of4(per.is4of4);
        recTr.addCluster(tran);
    }

    const std::vector<const RecRpcCluster*>& clusters = recTr.clusters();
    for ( int i = 0; i < perobj.nTracks; ++i ) {
        const PerRecRpcHeader::RpcTrack& per = perobj.tracks.at(i);
        recTr.addTrack(RecRpcTrack(clusters[per.start], clusters[per.end]));
    }

    return StatusCode::SUCCESS;
}
StatusCode RecRpcEventCnv::TranToPer ( const DayaBay::RecRpcHeader tobj,
PerRecRpcHeader pobj 
)

Definition at line 61 of file RecRpcEventCnv.cc.

{
    MsgStream log(msgSvc(), "RecRpcEventCnv::TranToPer");
    StatusCode sc = HeaderObjectCnv::toPer(tranobj,perobj);
    if (sc.isFailure()) return sc;
    const RecRpcTrigger& recTr = tranobj.recTrigger();

    perobj.site = recTr.detector().site();
    perobj.detector = recTr.detector().detectorId();
    perobj.triggerNumber = recTr.triggerNumber();
    perobj.triggerType = recTr.triggerType();
    perobj.triggerTimeSec = recTr.triggerTime().GetSec();
    perobj.triggerTimeNanoSec = recTr.triggerTime().GetNanoSec();

    perobj.combinationType = recTr.combinationType();
    perobj.eventType = recTr.eventType();

    perobj.reset(recTr.numCluster(), recTr.numTrack());

    const std::vector<const RecRpcCluster*>& clusters = recTr.clusters();
    for ( int i = 0; i < perobj.nClusters; ++i ) {
        const RecRpcCluster* iCluster = clusters.at(i);
        perobj.clusters[i].status = iCluster->status();
        perobj.clusters[i].type = iCluster->type();
        perobj.clusters[i].maxHitsInLayer = iCluster->maxHitsInLayer();
        perobj.clusters[i].is4of4 = iCluster->is4of4();
        perobj.clusters[i].x    = iCluster->position().x();
        perobj.clusters[i].y    = iCluster->position().y();
        perobj.clusters[i].z    = iCluster->position().z();
        perobj.clusters[i].t    = iCluster->position().t();
        perobj.clusters[i].quality = iCluster->quality();
    }

    std::vector<const RecRpcCluster*>::const_iterator begin = clusters.begin();
    std::vector<const RecRpcCluster*>::const_iterator end = clusters.end();
    const std::vector<RecRpcTrack>& tracks = recTr.tracks();
    for ( int i = 0; i < perobj.nTracks; ++i ) {
        perobj.tracks[i].start = std::find(begin, end, tracks[i].start()) - begin;
        perobj.tracks[i].end = std::find(begin, end, tracks[i].end()) - begin;
    }

    return StatusCode::SUCCESS;
}
StatusCode RecRpcEventCnv::fillRepRefs ( IOpaqueAddress *  addr,
DataObject *  dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerRecRpcHeader, DayaBay::RecRpcHeader >.

Definition at line 106 of file RecRpcEventCnv.cc.

                                                                        {
  
  MsgStream log(msgSvc(), "RecRpcEventCnv::fillRepRefs");
  RecRpcHeader* rh = dynamic_cast<RecRpcHeader*>(tobj);

  log << MSG::DEBUG
      << "Saving links to " << rh->inputHeaders().size() 
      << " input headers" << endreq;
  
  StatusCode sc = HeaderObjectCnv::fillPer(m_rioSvc,*rh,*m_perOutObj);

  if (sc.isFailure()) {
    log << MSG::ERROR << "Failed to fill HeaderObject part" << endreq;
    return sc;
  }
  
  // ... fill RecRpcHeader part...
  return sc;
}
StatusCode RecRpcEventCnv::fillObjRefs ( IOpaqueAddress *  addr,
DataObject *  dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerRecRpcHeader, DayaBay::RecRpcHeader >.

Definition at line 126 of file RecRpcEventCnv.cc.

                                                                        {
  //MsgStream log(msgSvc(), "RecRpcEventCnv::fillObjRefs");
  MsgStream log(msgSvc(), "fillObjRefs");
  HeaderObject* hobj = dynamic_cast<HeaderObject*>(tobj);

  StatusCode sc = HeaderObjectCnv::fillTran(m_rioSvc,*m_perInObj,*hobj);
  if (sc.isFailure()) {
    log << MSG::ERROR << "Failed to fill HeaderObject part" << endreq;
    return sc;
  }
  
  log << MSG::DEBUG
      << "Restored links to " << hobj->inputHeaders().size() 
      << " input headers" << endreq;
  
  // ... fill RecRpcHeader part...
  return sc;
}
PerType & RootIOTypedCnv< class, class >::getPerInputObject ( ) [inherited]
PerType & RootIOTypedCnv< class, class >::getPerOutputObject ( ) [inherited]
const RootIOBaseObject * RootIOTypedCnv< class, class >::getBaseInputObject ( ) [virtual, inherited]

Implements RootIOBaseCnv.

const RootIOBaseObject * RootIOTypedCnv< class, class >::getBaseOutputObject ( ) [virtual, inherited]

Implements RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::PerToTran ( const PerType &  pobj,
TranType &  tobj 
) [pure virtual, inherited]
virtual StatusCode RootIOTypedCnv< class, class >::TranToPer ( const TranType &  tobj,
PerType &  pobj 
) [pure virtual, inherited]
virtual StatusCode RootIOTypedCnv< class, class >::TranObjectToPerObject ( DataObject &  dat,
const RootOutputAddress  
) [virtual, inherited]

Implements RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::PerObjectToTranObject ( DataObject *&  dat) [virtual, inherited]

Implements RootIOBaseCnv.

virtual RootInputStream * RootIOTypedCnv< class, class >::makeInputStream ( const RootInputAddress ria) [virtual, inherited]

Implements RootIOBaseCnv.

virtual RootOutputStream * RootIOTypedCnv< class, class >::makeOutputStream ( const RootOutputAddress ria) [virtual, inherited]

Implements RootIOBaseCnv.

virtual long RootIOTypedCnv< class, class >::repSvcType ( ) const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::initialize ( ) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::finalize ( ) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::createObj ( IOpaqueAddress *  addr,
DataObject *&  dat 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< class, class >::createRep ( DataObject *  pObject,
IOpaqueAddress *&  refpAddress 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

int RootIOTypedCnv< class, class >::commit ( const RootOutputAddress roa) [inherited]

Reimplemented from RootIOBaseCnv.

RootIOBaseCnv * RootIOTypedCnv< class, class >::otherConverter ( int  clID) [inherited]

Reimplemented from RootIOBaseCnv.

static unsigned char RootIOTypedCnv< class, class >::storageType ( ) [static, inherited]

Reimplemented from RootIOBaseCnv.

static const InterfaceID & RootIOTypedCnv< class, class >::interfaceID ( ) [static, inherited]

Reimplemented from RootIOBaseCnv.


Member Data Documentation

std::string RootIOTypedCnv< class, class >::m_perclassName [protected, inherited]
PerType * RootIOTypedCnv< class, class >::m_perInObj [protected, inherited]
PerType * RootIOTypedCnv< class, class >::m_perOutObj [protected, inherited]
IRootIOSvc * RootIOTypedCnv< class, class >::m_rioSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

IConversionSvc * RootIOTypedCnv< class, class >::m_cnvSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

RootInputStream * RootIOTypedCnv< class, class >::m_ris [protected, inherited]

Reimplemented from RootIOBaseCnv.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:00:35 for PerRecEvent by doxygen 1.7.4