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