CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
checkMdc.cxx
Go to the documentation of this file.
1//$Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibTreeCnv/src/test/checkMdc.cxx,v 1.1.1.1 2008/04/09 02:08:15 huangb Exp $
2/*#include <stdio.h>
3#include "GaudiKernel/Algorithm.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/Service.h"
7#include "GaudiKernel/MsgStream.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "CalibData/Mdc/MdcCalibData.h"
10#include "CalibData/CalibModel.h"
11#include "GaudiKernel/DataSvc.h"
12#include "CalibDataSvc/ICalibTreeSvc.h"
13using namespace std;
14/// Simple algorithm to test functioning of "the other" TDS
15class checkMdc : public Algorithm {
16
17public:
18 checkMdc(const std::string& name, ISvcLocator* pSvcLocator);
19
20 StatusCode initialize();
21
22 StatusCode execute();
23
24 StatusCode finalize();
25
26private:
27 IDataProviderSvc* m_pCalibDataSvc;
28 ICalibTreeSvc* m_pTreeSvc;
29 // Maybe something to say which kind of data to look up?
30
31};
32
33/// Instantiation of a static factory to create instances of this algorithm
34//static const AlgFactory<checkMdc> Factory;
35//const IAlgFactory& UseCalibFactory = Factory;
36//const IAlgFactory& checkMdcFactory = Factory;
37
38checkMdc::checkMdc( const std::string& name,
39 ISvcLocator* pSvcLocator )
40 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
41{
42 // Declare properties here.
43
44}
45*/
46#include "checkMdc.h"
47checkMdc::checkMdc( const std::string& name,
48 ISvcLocator* pSvcLocator )
49 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
50{
51 // Declare properties here.
52 //
53 }
54 //
56 StatusCode sc;
57 MsgStream log(msgSvc(), name());
58 log << MSG::INFO << "Initialize()" << endreq;
59
60 // So far don't have any properties, but in case we do some day..
61// setProperties();
62
63 log<<MSG::INFO << "setProperties()" << endreq;
64
65 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
66
67 if ( !sc.isSuccess() ) {
68 log << MSG::ERROR
69 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
70 << endreq;
71 return sc;
72 } else {
73 log << MSG::DEBUG
74 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
75 << endreq;
76 }
77
78 sc = service("CalibTreeCnvSvc", m_pTreeSvc, true);
79 if ( !sc.isSuccess() ) {
80 log << MSG::ERROR
81 << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc"
82 << endreq;
83 return sc;
84 }
85 // Get properties from the JobOptionsSvc
86
87 sc = setProperties();
88
89 return StatusCode::SUCCESS;
90
91}
92
93
94StatusCode checkMdc::execute( ) {
95
96 MsgStream log(msgSvc(), name());
97
98 // Cheat for now since Windows is having trouble finding definition
99 // of Calibdata::Test_t
100 std::string fullPath = "/Calib/MdcCal";
101 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
102
103 SmartDataPtr<CalibData::MdcCalibData> test(m_pCalibDataSvc, fullPath);
104// if(!btof) ;
105 int qtparno = test->getqtparNo();
106 int xtno = test->getxtNo();
107 int t0no = test->gett0No();
108 std::cout<<"qtparno="<<qtparno<<"xtno="<<xtno<<"t0no="<<t0no<<std::endl;
109
110
111
112
113 return StatusCode::SUCCESS;
114}
115/*
116DataSvc::retrieveObject(fullPath,CalibData::CalibTest1);
117*/
118StatusCode checkMdc::finalize( ) {
119
120 MsgStream log(msgSvc(), name());
121 log << MSG::INFO
122 << " checkMdc FINALIZE!! "
123 << endreq;
124
125 return StatusCode::SUCCESS;
126}
127
128
std::string test
IMessageSvc * msgSvc()
StatusCode initialize()
Definition checkMdc.cxx:55
checkMdc(const std::string &name, ISvcLocator *pSvcLocator)
Definition checkMdc.cxx:47
StatusCode finalize()
Definition checkMdc.cxx:118
StatusCode execute()
Definition checkMdc.cxx:94