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

#include <SimHitSplitAlgorithm.h>

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

List of all members.

Public Member Functions

 SimHitSplitAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 ~SimHitSplitAlgorithm ()
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

ISimHitSplitSvcm_simHitSplitSvc
vector< TimeStampm_hitEarliest
vector< TimeStampm_hitLatest

Detailed Description

Definition at line 11 of file SimHitSplitAlgorithm.h.


Constructor & Destructor Documentation

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

Definition at line 17 of file SimHitSplitAlgorithm.cc.

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

Definition at line 102 of file SimHitSplitAlgorithm.cc.

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

Member Function Documentation

StatusCode SimHitSplitAlgorithm::initialize ( )

Definition at line 23 of file SimHitSplitAlgorithm.cc.

{
  StatusCode status = this->GaudiAlgorithm::initialize();
  if(status.isFailure()) 
  { 
    error()<< "Error when initializing  GaudiAlgorithm"<< endreq;
    return status;
  }
   
  info()<< "SimHitSplitAlgorithm ininalize()"<< endreq;

  //Initialize the SimHitSplitSvc
  IService* isvc = 0;
  StatusCode sc = serviceLocator()->service("SimHitSplitSvc", isvc, false);
  if(sc.isFailure()) 
  {
    error()<< "Service : SimHitSplitSvc could not be retrieved"<< endreq;
    return sc;
  }
  isvc->addRef();
  sc = isvc->queryInterface(ISimHitSplitSvc::interfaceID(), (void**)&m_simHitSplitSvc);
  if(sc.isFailure()) 
  {
    error()<< "Service SimHitSplitSvc does not implement ISimHitSplitSvc"<< endreq;
  }
  return sc;
}
StatusCode SimHitSplitAlgorithm::execute ( )

Definition at line 51 of file SimHitSplitAlgorithm.cc.

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

  vector<SimHitHeader*> shhs;
  SimHeader* sh = 0;
  sh = get<SimHeader>(evtSvc(), SimHeaderLocation::Default);
  StatusCode sc = m_simHitSplitSvc->getSimHitHeader(sh, shhs, m_hitEarliest, m_hitLatest);
  if(sc.isFailure()) return StatusCode::SUCCESS;

  for(vector<SimHitHeader*>::iterator vit = shhs.begin(); vit != shhs.end(); vit++)
  {
    if(!(*vit))
    {
      error()<< "Error when get one SimHitHeader!"<< endreq;
      return StatusCode::FAILURE;
    }
    info()<< "SimHitHeader's address: "<< (*vit)<< endreq;

    map<short int, SimHitCollection*> shc = (*vit)->hitCollection();
    for(map<short int, SimHitCollection*>::iterator mit = shc.begin(); mit != shc.end(); mit++)
    {
      vector<SimHit*> vsh = mit->second->collection();
      info()<< MSG::DEBUG<< "In Det"<< mit->first
            << " : SimHit's num = "<< vsh.size()<< endreq;
    }
    //delete (*vit);
  }     
  if(shhs.size() != 1 || shhs[0] != sh->hits())
  {
    for(vector<SimHitHeader*>::size_type i = 0; i < shhs.size(); i++)
    {
      SimHitHeader::hc_map& maphc = shhs[i]->hitCollection();
      for (SimHitHeader::hc_map::iterator it = maphc.begin(); it != maphc.end(); ++it)
      {
        it->second->collection().clear();
      }
      //shhs[i]->hitCollection().clear();
      delete shhs[i];
    }
  }
  info()<< "SimHitSplitAlgorithm execute() finalized!" << endreq;
  return StatusCode::SUCCESS;
}
StatusCode SimHitSplitAlgorithm::finalize ( )

Definition at line 96 of file SimHitSplitAlgorithm.cc.

{
  info()<< "SimHitSplitAlgorithm 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 22 of file SimHitSplitAlgorithm.h.

Definition at line 23 of file SimHitSplitAlgorithm.h.

Definition at line 24 of file SimHitSplitAlgorithm.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:42 for SimHitSplitSvc by doxygen 1.7.4