BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
checkEmc.cxx
Go to the documentation of this file.
1//$Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibTreeCnv/src/test/checkEmc.cxx,v 1.1.1.1 2008/04/09 02:08:13 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/Emc/EmcCalibData.h"
10//#include "CalibData/Emc/bEmcCalibBase.h"
11#include "CalibData/CalibModel.h"
12#include "GaudiKernel/DataSvc.h"
13#include "CalibDataSvc/ICalibTreeSvc.h"
14using namespace std;
15/// Simple algorithm to test functioning of "the other" TDS
16class checkEmc : public Algorithm {
17
18public:
19 checkEmc(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<checkEmc> Factory;
36//const IAlgFactory& UseCalibFactory = Factory;
37//const IAlgFactory& checkEmcFactory = Factory;
38#include "checkEmc.h"
39
40checkEmc::checkEmc( const std::string& name,
41 ISvcLocator* pSvcLocator )
42 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
43{
44 // Declare properties here.
45
46}
47
48
50 StatusCode sc;
51 MsgStream log(msgSvc(), name());
52 log << MSG::INFO << "Initialize()" << endreq;
53
54 // So far don't have any properties, but in case we do some day..
55// setProperties();
56
57 log<<MSG::INFO << "setProperties()" << endreq;
58
59 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
60
61 if ( !sc.isSuccess() ) {
62 log << MSG::ERROR
63 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
64 << endreq;
65 return sc;
66 } else {
67 log << MSG::DEBUG
68 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
69 << endreq;
70 }
71
72 sc = service("CalibTreeCnvSvc", m_pTreeSvc, true);
73 if ( !sc.isSuccess() ) {
74 log << MSG::ERROR
75 << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc"
76 << endreq;
77 return sc;
78 }
79 // Get properties from the JobOptionsSvc
80
81 sc = setProperties();
82
83 return StatusCode::SUCCESS;
84
85}
86
87
88StatusCode checkEmc::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/EmcCal";
95 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
96 SmartDataPtr<CalibData::EmcCalibData> test(m_pCalibDataSvc, fullPath);
97 int no1 = test->getDigiCalibConstNo();
98 for(int i=0;i<no1;i++){
99 double aa = test->getDigiCalibConst(i);
100 std::cout<<"getDigiCalibConst("<<i<<")========="<<aa<<endl;
101 }
102 return StatusCode::SUCCESS;
103}
104/*
105DataSvc::retrieveObject(fullPath,CalibData::CalibTest1);
106*/
107StatusCode checkEmc::finalize( ) {
108
109 MsgStream log(msgSvc(), name());
110 log << MSG::INFO
111 << " checkEmc FINALIZE!! "
112 << endreq;
113
114 return StatusCode::SUCCESS;
115}
116
117
std::string test
IMessageSvc * msgSvc()
checkEmc(const std::string &name, ISvcLocator *pSvcLocator)
Instantiation of a static factory to create instances of this algorithm.
Definition checkEmc.cxx:40
StatusCode initialize()
Definition checkEmc.cxx:49
StatusCode finalize()
Definition checkEmc.cxx:107
StatusCode execute()
Definition checkEmc.cxx:88