1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/IDataManagerSvc.h"
5#include "GaudiKernel/SmartDataPtr.h"
6#include "GaudiKernel/IDataProviderSvc.h"
7#include "GaudiKernel/PropertyMgr.h"
16 Algorithm(name, pSvcLocator) {
18 declareProperty(
"KShortReconstruction", m_recKShort =
true);
19 declareProperty(
"LambdaReconstruction", m_recLambda =
true);
20 declareProperty(
"GammaConversionReconstruction", m_recGC =
true);
26 MsgStream log(
msgSvc(), name());
28 log << MSG::INFO <<
"creating VeeVertex sub Algorithm" << endreq;
33 sc = createSubAlgorithm(
"KShortReconstruction",
"KShortReconstruction", m_KShortReconstruction);
35 log << MSG::ERROR <<
"Error while creating KShortReconstruction" << endreq;
36 return StatusCode::FAILURE;
40 sc = createSubAlgorithm(
"LambdaReconstruction",
"LambdaReconstruction", m_LambdaReconstruction);
42 log << MSG::ERROR <<
"Error while creating LambdaReconstruction" << endreq;
43 return StatusCode::FAILURE;
47 sc = createSubAlgorithm(
"GammaConversionReconstruction",
"GammaConversionReconstruction", m_gcReconstruction);
49 log << MSG::ERROR <<
"Error while creating GammaConversionReconstruction" << endreq;
50 return StatusCode::FAILURE;
54 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
55 return StatusCode::SUCCESS;
59StatusCode VeeVertex::registerParent(MsgStream& log) {
60 DataObject *aEvtRecEvent;
61 eventSvc()->findObject(
"/Event/EvtRec",aEvtRecEvent);
62 if (aEvtRecEvent == NULL) {
64 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec",aEvtRecEvent);
65 if (sc != StatusCode::SUCCESS) {
66 log << MSG::FATAL <<
"Could not register EvtRecEvent" <<endreq;
67 return StatusCode::FAILURE;
70 return StatusCode::SUCCESS;
73StatusCode VeeVertex::clearEvtRecVeeVertexCol(MsgStream& log) {
74 StatusCode sc = registerParent(log);
75 if (sc != StatusCode::SUCCESS) {
79 DataObject* aEvtRecVeeVertexCol;
80 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol",aEvtRecVeeVertexCol);
81 if (aEvtRecVeeVertexCol != NULL) {
82 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
83 dataManSvc->clearSubTree(
"/Event/EvtRec/EvtRecVeeVertexCol");
84 eventSvc()->unregisterObject(
"/Event/EvtRec/EvtRecVeeVertexCol");
86 return StatusCode::SUCCESS;
89void VeeVertex::registerEvtRecVeeVertexCol(MsgStream& log) {
91 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec/EvtRecVeeVertexCol",
92 aNewEvtRecVeeVertexCol);
93 if (sc != StatusCode::SUCCESS) {
94 log << MSG::FATAL <<
"Could not register EvtRecVeeVertexCol in TDS!" << endreq;
100 MsgStream log(
msgSvc(), name());
102 StatusCode sc = clearEvtRecVeeVertexCol(log);
103 if (sc != StatusCode::SUCCESS) {
107 std::vector<Algorithm*>::const_iterator it = subAlgorithms()->begin();
108 std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
109 for(; it != end; it++) {
110 sc = (*it)->execute();
112 log <<
"Error executing selection " << (*it)->name() << endreq;
116 DataObject* aEvtRecVeeVertexCol;
117 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aEvtRecVeeVertexCol);
118 if (aEvtRecVeeVertexCol == NULL) {
119 registerEvtRecVeeVertexCol(log);
122 return StatusCode::SUCCESS;
128 MsgStream log(
msgSvc(), name());
129 log << MSG::INFO <<
"in finalize()" << endmsg;
130 return StatusCode::SUCCESS;
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
VeeVertex(const std::string &name, ISvcLocator *pSvcLocator)