2#include "EventModel/Event.h"
3#include "EventModel/EventModel.h"
4#include "EvtRecEvent/EvtRecEvent.h"
5#include "EvtRecEvent/EvtRecVeeVertex.h"
6#include "Gaudi/Sequence.h"
7#include "GaudiKernel/IDataManagerSvc.h"
8#include "GaudiKernel/IDataProviderSvc.h"
9#include "GaudiKernel/ISvcLocator.h"
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/PropertyMgr.h"
12#include "GaudiKernel/SmartDataPtr.h"
17 : Gaudi::
Sequence( 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" << endmsg;
35 sc = createSubAlgorithm(
"KShortReconstruction",
"KShortReconstruction",
36 m_KShortReconstruction );
39 log << MSG::ERROR <<
"Error while creating KShortReconstruction" << endmsg;
40 return StatusCode::FAILURE;
45 sc = createSubAlgorithm(
"LambdaReconstruction",
"LambdaReconstruction",
46 m_LambdaReconstruction );
49 log << MSG::ERROR <<
"Error while creating LambdaReconstruction" << endmsg;
50 return StatusCode::FAILURE;
55 sc = createSubAlgorithm(
"GammaConversionReconstruction",
"GammaConversionReconstruction",
59 log << MSG::ERROR <<
"Error while creating GammaConversionReconstruction" << endmsg;
60 return StatusCode::FAILURE;
64 log << MSG::INFO <<
"Calling Sequence::initialize()" << endmsg;
66 return Sequence::initialize();
69StatusCode VeeVertex::registerParent( MsgStream& log )
const {
70 DataObject* aEvtRecEvent;
71 eventSvc()->findObject(
"/Event/EvtRec", aEvtRecEvent );
72 if ( aEvtRecEvent == NULL )
75 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec", aEvtRecEvent );
76 if ( sc != StatusCode::SUCCESS )
78 log << MSG::FATAL <<
"Could not register EvtRecEvent" << endmsg;
79 return StatusCode::FAILURE;
82 return StatusCode::SUCCESS;
85StatusCode VeeVertex::clearEvtRecVeeVertexCol( MsgStream& log )
const {
86 StatusCode sc = registerParent( log );
87 if ( sc != StatusCode::SUCCESS ) {
return sc; }
89 DataObject* aEvtRecVeeVertexCol;
90 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aEvtRecVeeVertexCol );
91 if ( aEvtRecVeeVertexCol != NULL )
93 SmartIF<IDataManagerSvc> dataManSvc( eventSvc() );
94 dataManSvc->clearSubTree(
"/Event/EvtRec/EvtRecVeeVertexCol" );
95 eventSvc()->unregisterObject(
"/Event/EvtRec/EvtRecVeeVertexCol" );
97 return StatusCode::SUCCESS;
100void VeeVertex::registerEvtRecVeeVertexCol( MsgStream& log )
const {
103 eventSvc()->registerObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aNewEvtRecVeeVertexCol );
104 if ( sc != StatusCode::SUCCESS )
105 { log << MSG::FATAL <<
"Could not register EvtRecVeeVertexCol in TDS!" << endmsg; }
111 MsgStream log(
msgSvc(), name() );
113 StatusCode sc = clearEvtRecVeeVertexCol( log );
114 if ( sc != StatusCode::SUCCESS ) {
return sc; }
125 for (
auto subAlg : *subAlgorithms() )
127 sc = subAlg->execute( ctx );
128 if ( sc.isFailure() ) { log <<
"Error executing selection " << subAlg->name() << endmsg; }
131 DataObject* aEvtRecVeeVertexCol;
132 eventSvc()->findObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aEvtRecVeeVertexCol );
133 if ( aEvtRecVeeVertexCol == NULL ) { registerEvtRecVeeVertexCol( log ); }
135 return StatusCode::SUCCESS;
141 MsgStream log(
msgSvc(), name() );
142 log << MSG::INFO <<
"in finalize()" << endmsg;
143 return StatusCode::SUCCESS;
DECLARE_COMPONENT(BesBdkRc)
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
VeeVertex(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode execute(const EventContext &ctx) const