/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 | Private Attributes
SimReadoutHeaderCnv Class Reference

#include <SimReadoutEventCnv.h>

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

List of all members.

Public Member Functions

 SimReadoutHeaderCnv (ISvcLocator *svc)
virtual ~SimReadoutHeaderCnv ()
StatusCode PerToTran (const PerSimReadoutHeader &perobj, DayaBay::SimReadoutHeader &tranobj)
 Copy data from TObject based class of type TType to DataObject based class of type DOType.
StatusCode TranToPer (const DayaBay::SimReadoutHeader &tranobj, PerSimReadoutHeader &perobj)
 Copy data from DataObject based class of type DOType to TObject based class of type TType.
StatusCode fillRepRefs (IOpaqueAddress *addr, DataObject *dobj)
StatusCode fillObjRefs (IOpaqueAddress *addr, DataObject *dobj)
PerSimReadoutconvert (const DayaBay::SimReadout &simRo)
DayaBay::SimReadoutconvert (const PerSimReadout &perSimRo)
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

Private Attributes

bool m_saveSimReadouts
bool m_emptySimReadoutHeader

Detailed Description

Definition at line 21 of file SimReadoutEventCnv.h.


Constructor & Destructor Documentation

SimReadoutHeaderCnv::SimReadoutHeaderCnv ( ISvcLocator *  svc)

Definition at line 8 of file SimReadoutEventCnv.cc.

  : RootIOTypedCnv<PerSimReadoutHeader,SimReadoutHeader>("PerSimReadoutHeader",
                                                         classID(),svc)
{

  m_saveSimReadouts = true;
  char* pruneSimReadouts = getenv("NUWA_PRUNESIMREADOUTS");
  if(pruneSimReadouts)
  {
    m_saveSimReadouts = false;
  }

  m_emptySimReadoutHeader = false;
  char* emptySimReadoutHeader = getenv("NUWA_EMPTYSIMREADOUTHEADER");
  if(emptySimReadoutHeader)
  {
    m_emptySimReadoutHeader = true;
  }
}
SimReadoutHeaderCnv::~SimReadoutHeaderCnv ( ) [virtual]

Definition at line 29 of file SimReadoutEventCnv.cc.

{
}

Member Function Documentation

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

Definition at line 25 of file SimReadoutEventCnv.h.

                               {
    return DayaBay::CLID_SimReadoutHeader;
  }
StatusCode SimReadoutHeaderCnv::PerToTran ( const PerSimReadoutHeader perobj,
DayaBay::SimReadoutHeader tranobj 
)

Copy data from TObject based class of type TType to DataObject based class of type DOType.

Definition at line 33 of file SimReadoutEventCnv.cc.

{
  MsgStream log(msgSvc(), "SimReadoutHeaderCnv::PerToTran");

  StatusCode sc = HeaderObjectCnv::toTran(perobj,tranobj);
  if (sc.isFailure() || m_emptySimReadoutHeader) return sc;

  vector<PerSimReadout*> in_vec = perobj.readouts;
  vector<PerSimReadout*>::iterator it;
  
  for(it = in_vec.begin(); it != in_vec.end(); ++it)
  {
    SimReadout* simReadout = convert(**it);
    simReadout->setHeader(&tranobj);
    tranobj.readouts().push_back(simReadout);
  }
  return StatusCode::SUCCESS;
}                                       
StatusCode SimReadoutHeaderCnv::TranToPer ( const DayaBay::SimReadoutHeader tranobj,
PerSimReadoutHeader perobj 
)

Copy data from DataObject based class of type DOType to TObject based class of type TType.

Definition at line 53 of file SimReadoutEventCnv.cc.

{
  MsgStream log(msgSvc(), "SimReadoutHeaderCnv::TranToPer");
  perobj.clear();
  StatusCode sc = HeaderObjectCnv::toPer(tranobj,perobj);
  if (sc.isFailure()) return sc;

  if(m_saveSimReadouts){
    const vector<SimReadout*>& in_vec = tranobj.readouts();
    vector<SimReadout*>::const_iterator it;

    for(it=in_vec.begin();it!=in_vec.end();++it){
      perobj.readouts.push_back( convert(**it) );
    }
  }
  return StatusCode::SUCCESS;
  
}
StatusCode SimReadoutHeaderCnv::fillRepRefs ( IOpaqueAddress *  addr,
DataObject *  dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerSimReadoutHeader, DayaBay::SimReadoutHeader >.

Definition at line 74 of file SimReadoutEventCnv.cc.

{
    MsgStream log(msgSvc(), "SimReadoutHeaderCnv::fillRepRefs");
    SimReadoutHeader* rh = dynamic_cast<SimReadoutHeader*>(dobj);

    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 SimReadoutHeader part...
    return sc;
}
StatusCode SimReadoutHeaderCnv::fillObjRefs ( IOpaqueAddress *  addr,
DataObject *  dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerSimReadoutHeader, DayaBay::SimReadoutHeader >.

Definition at line 93 of file SimReadoutEventCnv.cc.

{
    MsgStream log(msgSvc(), "SimReadoutHeaderCnv::fillObjRefs");
    HeaderObject* hobj = dynamic_cast<HeaderObject*>(dobj);
    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 SimReadoutHeader part...
    return sc;
}
PerSimReadout * SimReadoutHeaderCnv::convert ( const DayaBay::SimReadout simRo)

Definition at line 111 of file SimReadoutEventCnv.cc.

                                                                         {
  PerSimReadout* perSimRo = new PerSimReadout;
  ReadoutHeaderCnv *readoutHeaderCnv 
    = dynamic_cast<ReadoutHeaderCnv*>( this->otherConverter(CLID_ReadoutHeader) );
  if(!readoutHeaderCnv){
    return 0;
  }
  perSimRo->readout = readoutHeaderCnv->convert( *(simRo.readout()) );
  return perSimRo;
}
SimReadout * SimReadoutHeaderCnv::convert ( const PerSimReadout perSimRo)

Definition at line 122 of file SimReadoutEventCnv.cc.

{
  SimReadout* simRo = new SimReadout;
  ReadoutHeaderCnv *readoutHeaderCnv 
    = dynamic_cast<ReadoutHeaderCnv*>( this->otherConverter(CLID_ReadoutHeader) );
  if(!readoutHeaderCnv){
    return 0;
  }

  Readout* readout = 0;
  if( perSimRo.readout!=0 ) {
    readout = readoutHeaderCnv->convert( *(perSimRo.readout) );
  }
  simRo->setReadout(readout);
  return simRo;
}
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

Definition at line 50 of file SimReadoutEventCnv.h.

Definition at line 51 of file SimReadoutEventCnv.h.

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:05:05 for PerReadoutEvent by doxygen 1.7.4