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