CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
DQACtrlSamples.cxx
Go to the documentation of this file.
1#include <vector>
2
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/SmartDataPtr.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
9
10#include "DQAEvent/DQAEvent.h"
12
14
15/////////////////////////////////////////////////////////////////////////////
16
17DQACtrlSamples::DQACtrlSamples(const std::string& name, ISvcLocator* pSvcLocator) :
18 Algorithm(name, pSvcLocator) {
19
20 //Declare the properties
21 declareProperty("SelectBhabha", m_selBhabha = true);
22 declareProperty("SelectDimu", m_selDimu = true);
23 declareProperty("SelectHadron", m_selHadron = false);
24 declareProperty("SelectRhopi", m_selRhopi = false);
25 declareProperty("SelectPpbar", m_selPpbar = false);
26 declareProperty("SelectKstark", m_selKstark = false);
27 declareProperty("SelectLambdalambda", m_selLambdalambda = false);
28
29}
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
33 MsgStream log(msgSvc(), name());
34
35 log << MSG::INFO << "in initialize()" << endmsg;
36 StatusCode sc;
37
38 if ( m_selBhabha ) {
39 sc = createSubAlgorithm( "DQASelBhabha", "DQASelBhabha", m_dqaBhabha);
40 if (sc.isFailure()) {
41 log << MSG::ERROR << "Error creating Sub-Algorithm DQASelBhabha" << endreq;
42 return StatusCode::FAILURE;
43 }
44 }
45
46 if ( m_selDimu ) {
47 sc = createSubAlgorithm( "DQASelDimu", "DQASelDimu", m_dqaDimu);
48 if (sc.isFailure()) {
49 log << MSG::ERROR << "Error creating Sub-Algorithm DQASelDimu" << endreq;
50 return StatusCode::FAILURE;
51 }
52 }
53
54 if ( m_selHadron ) {
55 sc = createSubAlgorithm( "DQASelHadron", "DQASelHadron", m_dqaHadron);
56 if (sc.isFailure()) {
57 log << MSG::ERROR << "Error creating Sub-Algorithm DQASelHadron" << endreq;
58 return StatusCode::FAILURE;
59 }
60 }
61
62 if ( m_selRhopi ) {
63 sc = createSubAlgorithm( "DQARhopi", "DQARhopi", m_dqaRhopi);
64 if (sc.isFailure()) {
65 log << MSG::ERROR << "Error creating Sub-Algorithm DQARhopiAlg" << endreq;
66 return StatusCode::FAILURE;
67 }
68 }
69
70 if ( m_selPpbar ) {
71 sc = createSubAlgorithm( "DQAJpsi2PPbarAlg", "DQAJpsi2PPbarAlg", m_dqaPpbar);
72 if (sc.isFailure()) {
73 log << MSG::ERROR << "Error creating Sub-Algorithm Jpsi2PPbarAlg" << endreq;
74 return StatusCode::FAILURE;
75 }
76 }
77
78 if ( m_selKstark ) {
79 sc = createSubAlgorithm( "DQAKsKpi", "DQAKsKpi", m_dqaKstark);
80 if (sc.isFailure()) {
81 log << MSG::ERROR << "Error creating Sub-Algorithm DQAKsKpi" << endreq;
82 return StatusCode::FAILURE;
83 }
84 }
85
86 if ( m_selLambdalambda ) {
87 sc = createSubAlgorithm( "JsiLL", "JsiLL", m_dqaLambdalambda);
88 if (sc.isFailure()) {
89 log << MSG::ERROR << "Error creating Sub-Algorithm JsiLL" << endreq;
90 return StatusCode::FAILURE;
91 }
92 }
93
94 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
95 return StatusCode::SUCCESS;
96
97
98}
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
102
103 MsgStream log(msgSvc(), name());
104 log << MSG::INFO << "in execute()" << endreq;
105
106 SmartDataPtr<DQAEvent::DQAEvent> dqaevt(eventSvc(), "/Event/DQATag");
107 if( !dqaevt ) {
108 dqaevt = new DQAEvent::DQAEvent;
109 StatusCode sc;
110 sc = eventSvc()->registerObject("/Event/DQATag", dqaevt);
111 if (sc.isFailure()) {
112 log << MSG::ERROR << "Could not register DQAEvent to TDS" << endreq;
113 return StatusCode::FAILURE;
114 return sc;
115 }
116 }
117
118 if ( m_selBhabha ) {
119 m_dqaBhabha->execute();
120 if ( m_dqaBhabha->filterPassed() ) dqaevt->setBhabha(1);
121 }
122
123 if ( m_selDimu ) {
124 m_dqaDimu->execute();
125 if ( m_dqaDimu->filterPassed() ) dqaevt->setDimu(1);
126 }
127
128 if ( m_selHadron ) {
129 m_dqaHadron->execute();
130 if ( m_dqaHadron->filterPassed() ) dqaevt->setHadron(1);
131 }
132
133 if ( m_selRhopi ) {
134 m_dqaRhopi->execute();
135 if ( m_dqaRhopi->filterPassed() ) dqaevt->setRhopi(1);
136 }
137
138 if ( m_selPpbar ) {
139 m_dqaPpbar->execute();
140 if ( m_dqaPpbar->filterPassed() ) dqaevt->setPpbar(1);
141 }
142
143 if ( m_selKstark ) {
144 m_dqaKstark->execute();
145 if ( m_dqaKstark->filterPassed() ) dqaevt->setKstark(1);
146 }
147
148 if ( m_selLambdalambda ) {
149 m_dqaLambdalambda->execute();
150 if ( m_dqaLambdalambda->filterPassed() ) dqaevt->setLambdalambdabar(1);
151 }
152
153 return StatusCode::SUCCESS;
154
155}
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
159
160 MsgStream log(msgSvc(), name());
161 log << MSG::INFO << "in finalize()" << endmsg;
162 return StatusCode::SUCCESS;
163}
164
165
DECLARE_ALGORITHM_FACTORY(BesGenModule)
IMessageSvc * msgSvc()
StatusCode initialize()
StatusCode finalize()
StatusCode execute()