BOSS 7.0.8
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
11/////////////////////////////////////////////////////////////////////////////
12PPbar::PPbar(const std::string& name, ISvcLocator* pSvcLocator) :
13 Algorithm(name, pSvcLocator) {
14 //Declare the properties
15 declareProperty ("testv", m_testv = false);
16 // declareProperty ("signal", m_signal = false);
17 // declareProperty ("mctruth", m_mctruth = false);
18}
19
20StatusCode PPbar::initialize(){
21 MsgStream log(msgSvc(), name());
22
23 log << MSG::INFO << "in initialize()" << endmsg;
24 StatusCode sc;
25
26 if (m_testv){
27 sc = createSubAlgorithm("TestV", "TestV", m_TestV);
28 if(sc.isFailure()) {
29 log << MSG::ERROR << "Error create 'TestV' algorithm" << endreq;
30 return StatusCode::FAILURE;
31 }
32 }
33
34// if (m_signal){
35// sc = createSubAlgorithm("Signal", "Signal", m_Signal);
36// if(sc.isFailure()) {
37// log << MSG::ERROR << "Error create 'Signal' algorithm" << endreq;
38// return StatusCode::FAILURE;
39// }
40// }
41//
42// if (m_mctruth){
43// sc = createSubAlgorithm("McTruth", "McTruth", m_McTruth);
44// if(sc.isFailure()) {
45// log << MSG::ERROR << "Error create 'McTruth' algorithm" << endreq;
46// return StatusCode::FAILURE;
47// }
48// }
49
50 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
51 return StatusCode::SUCCESS;
52}
53
54/////////////////////////////////////////////////////////////////////////////
55StatusCode PPbar::execute() {
56
57 MsgStream log(msgSvc(), name());
58 log << MSG::INFO << "in execute()" << endreq;
59 StatusCode sc;
60 std::vector<Algorithm*>::const_iterator it = subAlgorithms()->begin();
61 std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
62 for(; it != end; it++) {
63 sc = (*it)->execute();
64 if(sc.isFailure())
65 log << "Error while executing " << (*it)->name() << endreq;
66 }
67 return StatusCode::SUCCESS;
68}
69
70/////////////////////////////////////////////////////////////////////////////
71StatusCode PPbar::finalize() {
72 MsgStream log(msgSvc(), name());
73 log << MSG::INFO << "in finalize()" << endmsg;
74 return StatusCode::SUCCESS;
75}
76
IMessageSvc * msgSvc()
PPbar(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PPbar.cxx:12
StatusCode finalize()
Definition: PPbar.cxx:71
StatusCode execute()
Definition: PPbar.cxx:55
StatusCode initialize()
Definition: PPbar.cxx:20