/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 | Protected Member Functions | Protected Attributes | Private Attributes
MixInputAlgorithm Class Reference

#include <MixInputAlgorithm.h>

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

List of all members.

Public Member Functions

 MixInputAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 ~MixInputAlgorithm ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
DayaBay::SimHeaderGetCurrentHeaderObject () const
virtual StatusCode sysInitialize ()
virtual StatusCode sysExecute ()
virtual StatusCode preExecute ()
virtual StatusCode postExecute ()
virtual StatusCode sysFinalize ()
IDataProviderSvc * arcSvc () const
void putTES (DataObject *obj, std::string location) const
TYPE * getTES (std::string location) const
TYPE * getAES (std::string location, int index) const
std::vector< DataObject * > getAEScollection (std::string location) const
int getExecNum ()
std::string Location () const

Protected Member Functions

DayaBay::SimHeaderMakeHeaderObject ()
void InitializeHeader (DayaBay::HeaderObject *header)
TYPE * MakeHeader ()
TYPE * MakeHeader (std::vector< const DayaBay::IHeader * > &inputHeaders)
TYPE * MakeHeader (const DayaBay::IHeader *referenceHeader)
void AppendInputHeader (const DayaBay::HeaderObject *header) const

Protected Attributes

DayaBay::HeaderObjectm_headerObject
bool m_pullMode
std::string m_location

Private Attributes

IMixInputSvcm_mixInputSvc

Detailed Description

Definition at line 11 of file MixInputAlgorithm.h.


Constructor & Destructor Documentation

MixInputAlgorithm::MixInputAlgorithm ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 17 of file MixInputAlgorithm.cc.

                  :DybAlgorithm<SimHeader>(name,pSvcLocator)
{
  info()<< "Construct:MixInputAlgorithm()!"<< endreq;
}
MixInputAlgorithm::~MixInputAlgorithm ( )

Definition at line 109 of file MixInputAlgorithm.cc.

{
  info()<< "Destruct:~MixInputAlgorithm()!"<< endreq;
}

Member Function Documentation

StatusCode MixInputAlgorithm::initialize ( )

Definition at line 23 of file MixInputAlgorithm.cc.

{
  StatusCode status= this->GaudiAlgorithm::initialize();
  if(status.isFailure()) 
  { 
    error()<< "Error when initializing  GaudiAlgorithm"<< endreq;
    return status;
  }
   
  info()<< "MixInputAlgorithm ininalize()"<< endreq; 
  IService* isvc = 0;
  StatusCode sc = serviceLocator()->service("RootIOCnvSvc", isvc, false);
  if(sc.isFailure()) 
  {
    error()<< "Conversion service RootIOCnvSvc"<< " could not be retrieved"<< endreq;
    return sc;
  }
  isvc->addRef();
  sc = isvc->queryInterface(IMixInputSvc::interfaceID(), (void**)&m_mixInputSvc);
  if(sc.isFailure()) 
  {
    error()<< "Conversion service RootIOCnvSvc"<< " does not implement IRootIOCnvSvc"<< endreq;
  }
  return sc;
}
StatusCode MixInputAlgorithm::execute ( )

Definition at line 49 of file MixInputAlgorithm.cc.

{
  info()<< "Now into MixInputAlgorithm executation!"<< endreq;

  SimHeader* sh = new SimHeader();
  GenHeader* gh = new GenHeader();
  m_mixInputSvc->prepareStream();
  m_mixInputSvc->getSimHeader(gh, sh);

  const SimHitHeader* shh = sh->hits();
  info()<< "SimHitHeader's address: "<< shh<< endreq;
  map<short int, SimHitCollection*> shc = shh->hitCollection();
  for(map<short int, SimHitCollection*>::iterator mit = shc.begin(); mit != shc.end(); mit++)
  {
    vector<SimHit*> vsh = mit->second->collection();
    info()<< MSG::INFO<< "In Det"<< mit->first
          << " : SimHit's num = "<< vsh.size()<< endreq;
  }

  info()<< "GenHeader: "<< gh<< "--"<< "SimHeader: "<< sh<< endreq;
                              
  if(0 != sh && 0 != gh)
  {
    // Using some functions in RegistrationSequence
    RegistrationSequence* seq = get<RegistrationSequence>(evtSvc(), RegistrationSequenceLocation::Default);
    debug()<< "ATTENTION!===========> Size = "<< seq->size()<< endreq;
    seq->setEarliest(sh->earliest());
    seq->setLatest(sh->latest());

    //If the sample coming from MDC, the codes below needed
    /*IRegistrationSequence::Registrations& regs = const_cast<IRegistrationSequence::Registrations&>(seq->registrations());
    IRegistrationSequence::Registrations::iterator regit;
    for(regit = regs.begin(); regit != regs.end(); regit++)
    {
      info()<< regit->path()<< endreq;
      if(regit->path() == "/Event/Readout/ReadoutHeader")
      {
        DataObject*    child = const_cast<DataObject*>(regit->object());   
        ReadoutHeader* reoh  = dynamic_cast<ReadoutHeader*>(child);
        info()<< reoh->readout()->triggerTime().GetSeconds()<< endreq;
        regit->setStore(false);
        info()<< "Not Storing: "<< regit->path()<< endreq;
      }
      }*/

    // Put SimHeader(GenHeader) into TES
    put(evtSvc(), gh, GenHeaderLocation::Default);
    put(evtSvc(), sh, SimHeaderLocation::Default);
  }

  info()<< "MixInputAlgorithm execute() finalized!" << endreq;
  return StatusCode::SUCCESS;
}
StatusCode MixInputAlgorithm::finalize ( )

Definition at line 103 of file MixInputAlgorithm.cc.

{
  info()<< "MixInputAlgorithm finalize()"<< endreq;
  return StatusCode::SUCCESS;
}
DayaBay::SimHeader * DybAlgorithm< DayaBay::SimHeader >::GetCurrentHeaderObject ( ) const [inherited]
virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::sysInitialize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::sysExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::preExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::postExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::sysFinalize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

IDataProviderSvc * DybAlgorithm< DayaBay::SimHeader >::arcSvc ( ) const [inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::SimHeader >::putTES ( DataObject *  obj,
std::string  location 
) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimHeader >::getTES ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimHeader >::getAES ( std::string  location,
int  index 
) const [inherited]

Reimplemented from DybBaseAlg.

std::vector< DataObject * > DybAlgorithm< DayaBay::SimHeader >::getAEScollection ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

int DybAlgorithm< DayaBay::SimHeader >::getExecNum ( ) [inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimHeader >::Location ( ) const [inherited]

Reimplemented from DybBaseAlg.

DayaBay::SimHeader * DybAlgorithm< DayaBay::SimHeader >::MakeHeaderObject ( ) [protected, inherited]
void DybAlgorithm< DayaBay::SimHeader >::InitializeHeader ( DayaBay::HeaderObject header) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimHeader >::MakeHeader ( ) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimHeader >::MakeHeader ( std::vector< const DayaBay::IHeader * > &  inputHeaders) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimHeader >::MakeHeader ( const DayaBay::IHeader referenceHeader) [protected, inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::SimHeader >::AppendInputHeader ( const DayaBay::HeaderObject header) const [protected, inherited]

Reimplemented from DybBaseAlg.


Member Data Documentation

Definition at line 21 of file MixInputAlgorithm.h.

Reimplemented from DybBaseAlg.

bool DybAlgorithm< DayaBay::SimHeader >::m_pullMode [protected, inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimHeader >::m_location [protected, inherited]

Reimplemented from DybBaseAlg.


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:14:51 for MixInputSvc by doxygen 1.7.4