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"
17 Algorithm(name, pSvcLocator) {
19 declareProperty(
"KShortReconstruction", m_recKShort =
true);
20 declareProperty(
"LambdaReconstruction", m_recLambda =
true);
21 declareProperty(
"GammaConversionReconstruction", m_recGC =
true);
27 MsgStream log(
msgSvc(), name());
29 log << MSG::INFO <<
"creating VeeVertex sub Algorithm" << endreq;
34 sc = createSubAlgorithm(
"KShortReconstruction",
"KShortReconstruction", m_KShortReconstruction);
36 log << MSG::ERROR <<
"Error while creating KShortReconstruction" << endreq;
37 return StatusCode::FAILURE;
41 sc = createSubAlgorithm(
"LambdaReconstruction",
"LambdaReconstruction", m_LambdaReconstruction);
43 log << MSG::ERROR <<
"Error while creating LambdaReconstruction" << endreq;
44 return StatusCode::FAILURE;
48 sc = createSubAlgorithm(
"GammaConversionReconstruction",
"GammaConversionReconstruction", m_gcReconstruction);
50 log << MSG::ERROR <<
"Error while creating GammaConversionReconstruction" << endreq;
51 return StatusCode::FAILURE;
55 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
56 return StatusCode::SUCCESS;
60StatusCode VeeVertex::registerParent(MsgStream& log) {
61 DataObject *aEvtRecEvent;
62 eventSvc()->findObject(
"/Event/EvtRec",aEvtRecEvent);
63 if (aEvtRecEvent ==
NULL) {
65 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec",aEvtRecEvent);
66 if (sc != StatusCode::SUCCESS) {
67 log << MSG::FATAL <<
"Could not register EvtRecEvent" <<endreq;
68 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
74StatusCode VeeVertex::clearEvtRecVeeVertexCol(MsgStream& log) {
75 StatusCode sc = registerParent(log);
76 if (sc != StatusCode::SUCCESS) {
80 DataObject* aEvtRecVeeVertexCol;
81 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol",aEvtRecVeeVertexCol);
82 if (aEvtRecVeeVertexCol !=
NULL) {
83 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
84 dataManSvc->clearSubTree(
"/Event/EvtRec/EvtRecVeeVertexCol");
85 eventSvc()->unregisterObject(
"/Event/EvtRec/EvtRecVeeVertexCol");
87 return StatusCode::SUCCESS;
90void VeeVertex::registerEvtRecVeeVertexCol(MsgStream& log) {
92 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec/EvtRecVeeVertexCol",
93 aNewEvtRecVeeVertexCol);
94 if (sc != StatusCode::SUCCESS) {
95 log << MSG::FATAL <<
"Could not register EvtRecVeeVertexCol in TDS!" << endreq;
101 MsgStream log(
msgSvc(), name());
103 StatusCode sc = clearEvtRecVeeVertexCol(log);
104 if (sc != StatusCode::SUCCESS) {
108 std::vector<Algorithm*>::const_iterator it = subAlgorithms()->begin();
109 std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
110 for(; it != end; it++) {
111 sc = (*it)->execute();
113 log <<
"Error executing selection " << (*it)->name() << endreq;
117 DataObject* aEvtRecVeeVertexCol;
118 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aEvtRecVeeVertexCol);
119 if (aEvtRecVeeVertexCol ==
NULL) {
120 registerEvtRecVeeVertexCol(log);
123 return StatusCode::SUCCESS;
129 MsgStream log(
msgSvc(), name());
130 log << MSG::INFO <<
"in finalize()" << endmsg;
131 return StatusCode::SUCCESS;
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol