/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
ElecHeaderCnv Class Reference

Convert a ElecHeader and its subobjects. More...

#include <ElecHeaderCnv.h>

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

List of all members.

Public Member Functions

 ElecHeaderCnv (ISvcLocator *svc)
virtual ~ElecHeaderCnv ()
StatusCode PerToTran (const PerElecHeader &tobj, DayaBay::ElecHeader &dobj)
 Copy data from TObject based class of type TType to DataObject based class of type DOType.
StatusCode TranToPer (const DayaBay::ElecHeader &dobj, PerElecHeader &tobj)
 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)
PerElecCrateHeaderconvert (const DayaBay::ElecCrateHeader &transCH)
PerElecPulseHeaderconvert (const DayaBay::ElecPulseHeader &transPH)
PerElecCrateconvert (const DayaBay::ElecCrate &transCrate)
PerElecFeeChannelconvert (const DayaBay::ElecFeeChannel &in_ch)
PerElecFecBoardconvert (const DayaBay::ElecFecBoard &in_brd)
PerElecFecCrateconvert (const DayaBay::ElecFecCrate &transFecCrate)
PerElecFeeCrateconvert (const DayaBay::ElecFeeCrate &transFeeCrate)
PerElecPulseCollectionconvert (const DayaBay::ElecPulseCollection &transPCol)
PerElecPulseconvert (const DayaBay::ElecPulse &transPulse)
DayaBay::ElecCrateHeaderconvert (const PerElecCrateHeader &perCH)
DayaBay::ElecPulseHeaderconvert (const PerElecPulseHeader &perPH)
DayaBay::ElecCrateconvert (const PerElecCrate &perCrate)
DayaBay::ElecFeeChannelconvert (const PerElecFeeChannel &perChannel)
DayaBay::ElecFecBoardconvert (const PerElecFecBoard &perBoard)
DayaBay::ElecFecCrateconvert (const PerElecFecCrate &perFecCrate)
DayaBay::ElecFeeCrateconvert (const PerElecFeeCrate &perFeeCrate)
DayaBay::ElecPulseCollectionconvert (const PerElecPulseCollection &perEPC)
DayaBay::ElecPulseconvert (const PerElecPulse &perEP)
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_savePulseData
bool m_saveChannelData
bool m_saveBoardData
bool m_saveEsumData

Detailed Description

Convert a ElecHeader and its subobjects.

bseilhan@iit.edu Aug 17, 2008

Based on GenHeaderConv.h

Definition at line 37 of file ElecHeaderCnv.h.


Constructor & Destructor Documentation

ElecHeaderCnv::ElecHeaderCnv ( ISvcLocator *  svc)

Definition at line 26 of file ElecHeaderCnv.cc.

    : RootIOTypedCnv<PerElecHeader,ElecHeader>("PerElecHeader",
                                             classID(),svc)
{
  // FIXME: Converters do not have properties
  //declareProperty("SaveChannelData",m_saveChannelData=true,
  //                "Save channel-level simulation data in output");
  //declareProperty("SaveBoardData",m_saveBoardData=true,
  //                "Save board-level simulation data in output");

  // Helper variables to allow control of writing electronics
  // simulation data

  m_savePulseData = true;
  m_saveChannelData = true;
  m_saveBoardData = true;
  m_saveEsumData = true;

  char* pruneElecSimData = getenv("NUWA_PRUNEELECSIM");
  if (pruneElecSimData) {
    m_savePulseData = false;
    m_saveChannelData = false;
    m_saveBoardData = false;
    m_saveEsumData = false;
  }

}
ElecHeaderCnv::~ElecHeaderCnv ( ) [virtual]

Definition at line 54 of file ElecHeaderCnv.cc.

{
}

Member Function Documentation

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

Definition at line 41 of file ElecHeaderCnv.h.

                                 {
        return DayaBay::CLID_ElecHeader;
    }
StatusCode ElecHeaderCnv::PerToTran ( const PerElecHeader tobj,
DayaBay::ElecHeader dobj 
)

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

Definition at line 60 of file ElecHeaderCnv.cc.

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

    MsgStream log(msgSvc(), "ElecHeaderCnv::PerToTran");

    PerElecCrateHeader* perECH = perobj.crateHeader ;
    ElecCrateHeader* transECH = 0;
    if( perECH!=0 ) {
      transECH = convert(*perECH);
      transECH->setHeader( &tranobj );
    }

    // convert ElecPulseHeader to PerElecPulseHeader
    PerElecPulseHeader* perEPH = perobj.pulseHeader ;
    ElecPulseHeader* transEPH = 0;
    if( perEPH!=0 ) {
      transEPH = convert(*perEPH);
      transEPH->setHeader( &tranobj );
    }

    tranobj.setCrateHeader(transECH);
    tranobj.setPulseHeader(transEPH);

    return StatusCode::SUCCESS;
}
StatusCode ElecHeaderCnv::TranToPer ( const DayaBay::ElecHeader dobj,
PerElecHeader tobj 
)

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

Definition at line 90 of file ElecHeaderCnv.cc.

{
    MsgStream log(msgSvc(), "ElecHeaderCnv::TranToPer");
    log<<MSG::DEBUG<<"TranToPer called"<<endreq;

    StatusCode sc = HeaderObjectCnv::toPer(tranobj,perobj);
    if (sc.isFailure()) return sc;

    // convert PerElecCrateHeader to PerElecCrateHeader;
    if (perobj.crateHeader != 0 ) {
      delete perobj.crateHeader;   // delete the old one
    }
    const ElecCrateHeader* transECH = tranobj.crateHeader() ;
    PerElecCrateHeader* perECH = 0;
    if (transECH != 0) {
        log<<MSG::DEBUG<<"Converting ElecCrateHeader"<<endreq;
      perECH = convert(*transECH); // create a new one
    }
    perobj.crateHeader=perECH;

    // convert ElecPulseHeader to PerElecPulseHeader
    if (perobj.pulseHeader != 0 ) {
      delete perobj.pulseHeader;   // delete the old one
    }
    const ElecPulseHeader* transEPH = tranobj.pulseHeader() ;
    PerElecPulseHeader* perEPH = 0;
    if (transEPH != 0) {
      perEPH = convert(*transEPH); // create a new one
    }
    perobj.pulseHeader=perEPH;

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

Reimplemented from RootIOTypedCnv< PerElecHeader, DayaBay::ElecHeader >.

Definition at line 125 of file ElecHeaderCnv.cc.

{
    MsgStream log(msgSvc(), "ElecHeaderCnv::fillRepRefs");
    ElecHeader* eh = dynamic_cast<ElecHeader*>(dobj);

    log << MSG::DEBUG
        << "Saving links to " << eh->inputHeaders().size()
        << " input headers" << endreq;

    StatusCode sc = HeaderObjectCnv::fillPer(m_rioSvc,*eh,*m_perOutObj);
    if (sc.isFailure()) {
        log << MSG::ERROR << "Failed to fill HeaderObject part" << endreq;
        return sc;
    }

    // ... fill ElecHeader part...
    return sc;
}
StatusCode ElecHeaderCnv::fillObjRefs ( IOpaqueAddress *  addr,
DataObject *  dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerElecHeader, DayaBay::ElecHeader >.

Definition at line 144 of file ElecHeaderCnv.cc.

{
    MsgStream log(msgSvc(), "ElecHeaderCnv::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 ElecHeader part...
    return sc;
}
PerElecCrateHeader * ElecHeaderCnv::convert ( const DayaBay::ElecCrateHeader transCH)

Definition at line 165 of file ElecHeaderCnv.cc.

                                                                        {
  MsgStream log(msgSvc(), "ElecHeaderCnv");

  PerElecCrateHeader::detCrateVec cratevec;
  const map<Detector,ElecCrate*>& in_cmap = transCH.crates();
  map<Detector,ElecCrate*>::const_iterator it, done = in_cmap.end() ;
  for (it = in_cmap.begin(); it != done; ++it ){
    //short int detId = (it->first).siteDetPackedData();
    const ElecCrate* cr = it->second;
    PerElecCrate* pcr = convert(*cr);
    if(pcr!=0) {
      cratevec.push_back( pcr );
    } else {
      log<<MSG::ERROR<<"You are trying to save a null pointer of ElecCrate to file. Skipped."<<endreq;
      continue;
    }
  }
  return new PerElecCrateHeader(cratevec);
}
PerElecPulseHeader * ElecHeaderCnv::convert ( const DayaBay::ElecPulseHeader transPH)

Definition at line 293 of file ElecHeaderCnv.cc.

                                                                        {
  PerElecPulseHeader::detCollMap pulsemap;
  if(m_savePulseData){
    const map<Detector,ElecPulseCollection*>& in_pmap = transPH.pulseCollection();
    map<Detector,ElecPulseCollection*>::const_iterator it, done = in_pmap.end() ;
    for (it = in_pmap.begin(); it != done; ++it ){
      short int detId = (it->first).siteDetPackedData();
      const ElecPulseCollection* pls = it->second;
      pulsemap[detId] = convert(*pls);
    }
  }
  return new PerElecPulseHeader(pulsemap);
}
PerElecCrate * ElecHeaderCnv::convert ( const DayaBay::ElecCrate transCrate)

Definition at line 185 of file ElecHeaderCnv.cc.

                                                               {
  Detector det = transCrate.detector();

  if(det.detectorId() == DetectorId::kUnknown){
      return 0;
  }else if( det.detectorId() != DetectorId::kRPC ){
      return convert( static_cast<const ElecFeeCrate&>(transCrate) );
  }else{
      MsgStream log (msgSvc(), "ElecHeaderCnv::convert()");
      log << MSG::DEBUG << "converting RPC crate" << endreq;
      return convert( static_cast<const ElecFecCrate&>(transCrate) );
  }

}
PerElecFeeChannel * ElecHeaderCnv::convert ( const DayaBay::ElecFeeChannel in_ch)

Definition at line 284 of file ElecHeaderCnv.cc.

                                                                    {
  vector<int> hit = in_ch.hit();
  vector<int> adcHigh = in_ch.adcHigh();
  vector<int> adcLow = in_ch.adcLow();
  vector<int> tdc = in_ch.tdc();
  vector<double> energy = in_ch.energy();
  return new PerElecFeeChannel(hit,adcHigh,adcLow,tdc,energy);
}
PerElecFecBoard * ElecHeaderCnv::convert ( const DayaBay::ElecFecBoard in_brd)

Definition at line 273 of file ElecHeaderCnv.cc.

{
    std::map<PerElecCrate::ChannelId_type,DigitalSignal> channels;
    ElecFecBoard::ChannelMap::const_iterator it, done = in_brd.channels().end();
    for (it = in_brd.channels().begin(); it != done; it ++) {
        channels[it->first.fullPackedData()] = it->second.hits();
    }
    return new PerElecFecBoard(channels);
}
PerElecFecCrate * ElecHeaderCnv::convert ( const DayaBay::ElecFecCrate transFecCrate)

Definition at line 252 of file ElecHeaderCnv.cc.

{
    MsgStream log(msgSvc(), "ElecHeaderCnv::convert()");
    log<<MSG::DEBUG<<"Conversion of transFecCrate to persistent one called" << endreq;
    // get detector Id
    short int det = (transFecCrate.detector()).siteDetPackedData();

    // make channel map
    std::map<PerElecCrate::BoardId_type,PerElecFecBoard*> brds;
    if(m_saveChannelData){
        log<<MSG::DEBUG<<"Saving board data"<<endreq;
        // Save channel data if requested
        const ElecFecCrate::FecBoardMap& in_brds = transFecCrate.fecBoards();
        ElecFecCrate::FecBoardMap::const_iterator it, done=in_brds.end();
        for( it = in_brds.begin() ; it != done ; ++it ){
          brds[(it->first).fullPackedData()] = convert( it->second ) ;
        }
    }
    return new PerElecFecCrate(det, brds);
}
PerElecFeeCrate * ElecHeaderCnv::convert ( const DayaBay::ElecFeeCrate transFeeCrate)

Definition at line 200 of file ElecHeaderCnv.cc.

                                                                        {
  // get detector Id
  short int det = (transFeeCrate.detector()).siteDetPackedData();

  // make channel map
  map<PerElecCrate::ChannelId_type,PerElecFeeChannel*> chan;
  if(m_saveChannelData){
    // Save channel data if requested
    const map<FeeChannelId, ElecFeeChannel>& in_channels = transFeeCrate.channelData();
    map<FeeChannelId, ElecFeeChannel>::const_iterator it, done=in_channels.end();
    for( it = in_channels.begin() ; it != done ; ++it ){
      chan[(it->first).fullPackedData()] = convert( it->second ) ;
    }
  }

  // make board energy map
  std::map<PerElecCrate::BoardId_type,AnalogSignal> BrdEnergy;
  // make board nHit map
  std::map<PerElecCrate::BoardId_type,DigitalSignal> BrdnHit;

  if(m_saveBoardData){

    const map<FeeChannelId,AnalogSignal> in_energy = transFeeCrate.esum();
    map<FeeChannelId,AnalogSignal>::const_iterator eIt;
    for(eIt = in_energy.begin() ; eIt != in_energy.end() ; ++eIt){
      BrdEnergy[(eIt->first).fullPackedData()] = eIt->second;
    }

    const map<FeeChannelId,DigitalSignal> in_nh = transFeeCrate.nhit();
    map<FeeChannelId,DigitalSignal>::const_iterator nIt;
    for(nIt = in_nh.begin() ; nIt != in_nh.end() ; ++nIt){
      BrdnHit[(nIt->first).fullPackedData()] = nIt->second;
    }

  }

  // make the esum vectors
  AnalogSignal  ues;
  AnalogSignal  les;
  AnalogSignal  tes;
  DigitalSignal des;

  if(m_saveEsumData){
      ues = transFeeCrate.esumUpper();
      les = transFeeCrate.esumLower();
      tes = transFeeCrate.esumTotal();
      des = transFeeCrate.esumADC();
  }

  return new PerElecFeeCrate(det,chan,BrdEnergy,BrdnHit,ues,les,tes,des);
}
PerElecPulseCollection * ElecHeaderCnv::convert ( const DayaBay::ElecPulseCollection transPCol)

Definition at line 307 of file ElecHeaderCnv.cc.

                                                                                  {
  PerElecPulseCollection::PulseContainer out_pulses;
  ElecPulseCollection::PulseContainer in_pulses = transPCol.pulses();
  ElecPulseCollection::PulseContainer::iterator it;

  for(it = in_pulses.begin(); it != in_pulses.end(); ++it){
    out_pulses.push_back( convert(**(it)) );
  }

  short int det = (transPCol.detector()).siteDetPackedData();
  return new PerElecPulseCollection(det,out_pulses);
}
PerElecPulse * ElecHeaderCnv::convert ( const DayaBay::ElecPulse transPulse)

Definition at line 320 of file ElecHeaderCnv.cc.

                                                               {
  double out_t    = transPulse.time();
  int    out_cid  = (transPulse.channelId()).fullPackedData();
  float  out_amp  = transPulse.amplitude();
  int    out_type = transPulse.type();
  // PerSimHit* simhit = ...
  return new PerElecPulse( out_t, out_cid, out_amp, out_type);
}
ElecCrateHeader * ElecHeaderCnv::convert ( const PerElecCrateHeader perCH)

Definition at line 331 of file ElecHeaderCnv.cc.

                                                                      {
  MsgStream log(msgSvc(), "ElecHeaderCnv");

  ElecCrateHeader *out_header = new ElecCrateHeader(); // make header to return;
  std::vector<PerElecCrate*> cratevec = perCH.crates;
  std::vector<PerElecCrate*>::iterator it;
  for(it = cratevec.begin(); it != cratevec.end(); ++it){
    PerElecCrate *perCrate = *it;
    if(perCrate==0) {
      log<<MSG::ERROR<<"What? You got a zero pointer from file?"<<endreq;
      continue;  // drop this turn
    }
    ElecCrate *transCrate = convert( *perCrate );
    // wangzhe
    if( transCrate==0 ) {
      log<<MSG::ERROR<<"What? A null pointer for a ElecCrate?"<<endreq;
      continue;  // drop this turn
    }
    // wz
    out_header->addCrate(transCrate);
  }
  return out_header;
}
ElecPulseHeader * ElecHeaderCnv::convert ( const PerElecPulseHeader perPH)

Definition at line 355 of file ElecHeaderCnv.cc.

                                                                      {
  ElecPulseHeader *out_pulseH = new ElecPulseHeader();
  PerElecPulseHeader::detCollMap colmap = perPH.pulseCollections;
  PerElecPulseHeader::detCollMap::iterator it;
  for(it=colmap.begin();it!=colmap.end();++it){
    ElecPulseCollection *coll = convert( *(it->second));
    coll->setHeader(out_pulseH);
    Detector det(it->first);
    coll->setDetector(det);
    out_pulseH->addPulseCollection(coll);
  }
  return out_pulseH;
}
ElecCrate * ElecHeaderCnv::convert ( const PerElecCrate perCrate)

Definition at line 369 of file ElecHeaderCnv.cc.

                                                             {
  Detector det(perCrate.detId);

  if(det.detectorId() == DetectorId::kUnknown){
      return 0;
  }else if( det.detectorId() != DetectorId::kRPC ){
      return convert( static_cast<const PerElecFeeCrate&>(perCrate) );
  }else{
      return convert( static_cast<const PerElecFecCrate&>(perCrate) );
  }

  return 0;
}
ElecFeeChannel * ElecHeaderCnv::convert ( const PerElecFeeChannel perChannel)

Definition at line 383 of file ElecHeaderCnv.cc.

                                                                         {
  ElecFeeChannel *outCh = new ElecFeeChannel();
  outCh->setHit(perChannel.nHit);
  outCh->setAdcHigh(perChannel.adcHigh);
  outCh->setAdcLow(perChannel.adcLow);
  outCh->setEnergy(perChannel.energy);
  outCh->setTdc(perChannel.tdc);
  return outCh;
}
ElecFecBoard * ElecHeaderCnv::convert ( const PerElecFecBoard perBoard)

Definition at line 393 of file ElecHeaderCnv.cc.

{
    ElecFecBoard *outBrd = new ElecFecBoard();
    std::map<PerElecCrate::ChannelId_type,DigitalSignal>::const_iterator chIt, chDone = perBoard.channels.end();
    for (chIt = perBoard.channels.begin(); chIt != chDone; chIt++) {
        ElecFecChannel& ch = outBrd->channel(chIt->first);
        ch.setChannelId(chIt->first);
        ch.setHits(chIt->second);
        DigitalSignal::const_iterator clkIt, clkDone = chIt->second.end();
        DigitalSignal hitIndexes;
        int clk = 0;
        for (clkIt = chIt->second.begin(); clkIt != clkDone; clkIt++, clk++) {
            if (*clkIt) hitIndexes.push_back(clk);
        }
        ch.setHitIndexes(hitIndexes);
    }

    return outBrd;
}
ElecFecCrate * ElecHeaderCnv::convert ( const PerElecFecCrate perFecCrate)

Definition at line 413 of file ElecHeaderCnv.cc.

{
    ElecFecCrate *out_crate = new  ElecFecCrate( Detector(perFecCrate.detId) , 0);
    // convert channels
    map<PerElecCrate::ChannelId_type,PerElecFecBoard*> brds = perFecCrate.boards;
    map<PerElecCrate::ChannelId_type,PerElecFecBoard*>::iterator brdIt, brdDone = brds.end();
    for(brdIt = brds.begin();brdIt != brdDone; ++brdIt){
        FecChannelId fecId(brdIt->first);
        PerElecFecBoard* fecBrd = brdIt->second;
        ElecFecBoard* outBrd=convert( *fecBrd );
        outBrd->setBoardId(fecId);
        out_crate->board(fecId)=*outBrd; // makes a copy of outCh
        delete outBrd;
    }

    return out_crate;
}
ElecFeeCrate * ElecHeaderCnv::convert ( const PerElecFeeCrate perFeeCrate)

Definition at line 431 of file ElecHeaderCnv.cc.

                                                                      {
  ElecFeeCrate *out_crate = new  ElecFeeCrate( Detector(perFeeCrate.detId) , 0);

  // convert channels
  map<PerElecCrate::ChannelId_type,PerElecFeeChannel*> chan = perFeeCrate.channels;
  map<PerElecCrate::ChannelId_type,PerElecFeeChannel*>::iterator chIt;
  for(chIt=chan.begin();chIt!=chan.end();++chIt){
    FeeChannelId feeId(chIt->first);
    PerElecFeeChannel* feeCh = chIt->second;
    ElecFeeChannel* outCh=convert( *feeCh );
    out_crate->channel(feeId)=*outCh; // makes a copy of outCh
    delete outCh;
  }

  // convert NHit
  std::map<PerElecCrate::BoardId_type,DigitalSignal> BrdnHit = perFeeCrate.boardNHit;
  std::map<PerElecCrate::BoardId_type,DigitalSignal>::iterator nhIt;
  for(nhIt=BrdnHit.begin();nhIt!=BrdnHit.end();++nhIt){
    FeeChannelId feeId(nhIt->first);
    out_crate->nhitSignal(feeId) = nhIt->second;
  }

  // convert ESum
  std::map<PerElecCrate::BoardId_type,AnalogSignal> BrdeSum = perFeeCrate.boardEnergy;
  std::map<PerElecCrate::BoardId_type,AnalogSignal>::iterator esIt;
  for(esIt=BrdeSum.begin();esIt!=BrdeSum.end();++esIt){
    FeeChannelId feeId(esIt->first);
    out_crate->esumSignal(feeId) = esIt->second;
  }

  out_crate->setEsumTotal(perFeeCrate.totalESum);
  out_crate->setEsumUpper(perFeeCrate.upperESum);
  out_crate->setEsumLower(perFeeCrate.lowerESum);
  out_crate->setEsumADC(perFeeCrate.digitalESum);

  return out_crate;
}
ElecPulseCollection * ElecHeaderCnv::convert ( const PerElecPulseCollection perEPC)

Definition at line 469 of file ElecHeaderCnv.cc.

                                                                               {
  ElecPulseCollection* out_pcol = new ElecPulseCollection();
  ElecPulseCollection::PulseContainer out_pulseCon;
  const std::vector<PerElecPulse*>& in_pulseCon = perEPC.pulses;
  std::vector<PerElecPulse*>::const_iterator it;
  for(it=in_pulseCon.begin();it!=in_pulseCon.end();++it){
    ElecPulse *ep = convert(**it);
    ep->setPc(out_pcol);
    out_pulseCon.push_back(ep);
  }
  out_pcol->setPulses(out_pulseCon);
  return out_pcol;
}
ElecPulse * ElecHeaderCnv::convert ( const PerElecPulse perEP)

Definition at line 483 of file ElecHeaderCnv.cc.

                                                          {
  ElecPulse *out_pulse = new ElecPulse();
  out_pulse->setTime(perEP.time);
  FeeChannelId feeId(perEP.channelId);
  out_pulse->setChannelId(feeId);
  out_pulse->setAmplitude(perEP.amplitude);
  out_pulse->setType(perEP.type);
  //out_pulse->setAncestor()
  return out_pulse;
}
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 84 of file ElecHeaderCnv.h.

Definition at line 87 of file ElecHeaderCnv.h.

Definition at line 90 of file ElecHeaderCnv.h.

Definition at line 93 of file ElecHeaderCnv.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:56 for PerElecEvent by doxygen 1.7.4