BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
PPbar.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/PropertyMgr.h"
8
9#include <vector>
10
11DECLARE_COMPONENT(PPbar)
12/////////////////////////////////////////////////////////////////////////////
13PPbar::PPbar(const std::string& name, ISvcLocator* pSvcLocator) :
14 Algorithm(name, pSvcLocator) {
15 //Declare the properties
16 declareProperty ("testv", m_testv = false);
17 // declareProperty ("signal", m_signal = false);
18 // declareProperty ("mctruth", m_mctruth = false);
19}
20
21StatusCode PPbar::initialize(){
22 MsgStream log(msgSvc(), name());
23
24 log << MSG::INFO << "in initialize()" << endmsg;
25 StatusCode sc;
26
27 if (m_testv){
28 sc = createSubAlgorithm("TestV", "TestV", m_TestV);
29 if(sc.isFailure()) {
30 log << MSG::ERROR << "Error create 'TestV' algorithm" << endreq;
31 return StatusCode::FAILURE;
32 }
33 }
34
35// if (m_signal){
36// sc = createSubAlgorithm("Signal", "Signal", m_Signal);
37// if(sc.isFailure()) {
38// log << MSG::ERROR << "Error create 'Signal' algorithm" << endreq;
39// return StatusCode::FAILURE;
40// }
41// }
42//
43// if (m_mctruth){
44// sc = createSubAlgorithm("McTruth", "McTruth", m_McTruth);
45// if(sc.isFailure()) {
46// log << MSG::ERROR << "Error create 'McTruth' algorithm" << endreq;
47// return StatusCode::FAILURE;
48// }
49// }
50
51 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
52 return StatusCode::SUCCESS;
53}
54
55/////////////////////////////////////////////////////////////////////////////
56StatusCode PPbar::execute() {
57
58 MsgStream log(msgSvc(), name());
59 log << MSG::INFO << "in execute()" << endreq;
60 StatusCode sc;
61 std::vector<Algorithm*>::const_iterator it = subAlgorithms()->begin();
62 std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
63 for(; it != end; it++) {
64 sc = (*it)->execute();
65 if(sc.isFailure())
66 log << "Error while executing " << (*it)->name() << endreq;
67 }
68 return StatusCode::SUCCESS;
69}
70
71/////////////////////////////////////////////////////////////////////////////
72StatusCode PPbar::finalize() {
73 MsgStream log(msgSvc(), name());
74 log << MSG::INFO << "in finalize()" << endmsg;
75 return StatusCode::SUCCESS;
76}
77
IMessageSvc * msgSvc()
Definition PPbar.h:8
StatusCode finalize()
Definition PPbar.cxx:72
StatusCode execute()
Definition PPbar.cxx:56
StatusCode initialize()
Definition PPbar.cxx:21