BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
checkDedx.cxx
Go to the documentation of this file.
1//$Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibTreeCnv/src/test/checkDedx.cxx,v 1.5 2010/05/17 06:54:24 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/Dedx/DedxCalibData.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 checkDedx : public Algorithm {
16
17public:
18 checkDedx(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#include "checkDedx.h"
44/// Instantiation of a static factory to create instances of this algorithm
45//static const AlgFactory<checkDedx> Factory;
46//const IAlgFactory& UseCalibFactory = Factory;
47//const IAlgFactory& checkDedxFactory = Factory;
48
49checkDedx::checkDedx( const std::string& name,
50 ISvcLocator* pSvcLocator )
51 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
52{
53 // Declare properties here.
54
55}
56
57
59 StatusCode sc;
60 MsgStream log(msgSvc(), name());
61 log << MSG::INFO << "Initialize()" << endreq;
62
63 // So far don't have any properties, but in case we do some day..
64// setProperties();
65
66 log<<MSG::INFO << "setProperties()" << endreq;
67
68 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
69
70 if ( !sc.isSuccess() ) {
71 log << MSG::ERROR
72 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
73 << endreq;
74 return sc;
75 } else {
76 log << MSG::DEBUG
77 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
78 << endreq;
79 }
80
81 sc = service("CalibTreeCnvSvc", m_pTreeSvc, true);
82 if ( !sc.isSuccess() ) {
83 log << MSG::ERROR
84 << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc"
85 << endreq;
86 return sc;
87 }
88 // Get properties from the JobOptionsSvc
89
90 sc = setProperties();
91
92 return StatusCode::SUCCESS;
93
94}
95
96
97StatusCode checkDedx::execute( ) {
98
99 MsgStream log(msgSvc(), name());
100
101 // Cheat for now since Windows is having trouble finding definition
102 // of Calibdata::Test_t
103 // std::string fullPath = "/Calib/MdcCal";
104// std::string fullPath = "/Calib/DedxCal";
105// std::string fullPath = "/Calib/DedxSim";
106// std::string fullPath = "/Calib/EmcCal";
107 std::string fullPath = "/Calib/EsTimeCal";
108 // std::string fullPath = "/Calib/EstTofCal";
109 // std::string fullPath = "/Calib/MucCal";
110 // std::string fullPath = "/Calib/TofCal";
111 // std::string fullPath = "/Calib/TofQElec";
112// std::string fullPath = "/Calib/TofSim";
113// std::string fullPath = "/Calib/MdcAlign";
114 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
115
116 // SmartDataPtr<CalibData::MdcCalibData> test(m_pCalibDataSvc, fullPath);
117// if(!btof) ;
118/* for(int i=0;i<16;i++){
119 std::cout<<"test->getdxEP(i)"<<test->getdxEP(i)<<std::endl;
120 }
121 for(int i=0;i<6796;i++){
122 std::cout<<"test->gettension"<<test->gettension(i)<<std::endl;
123 }*/
124// if(!test) ;
125// SmartDataPtr<CalibData::DedxCalibData> test(m_pCalibDataSvc, fullPath);
126// SmartDataPtr<CalibData::DedxSimData> test(m_pCalibDataSvc, fullPath);
127 // SmartDataPtr<CalibData::EmcCalibData> test(m_pCalibDataSvc, fullPath);
128 // SmartDataPtr<CalibData::TofElecData> test(m_pCalibDataSvc, fullPath);
129 // SmartDataPtr<CalibData::TofSimData> test(m_pCalibDataSvc, fullPath);
130// SmartDataPtr<CalibData::MdcAlignData> test(m_pCalibDataSvc, fullPath);
131SmartDataPtr<CalibData::EsTimeCalibData> test(m_pCalibDataSvc, fullPath);
132
133 if(!test) ;
134// test->getBTof(0);
135// int qtparno = test->getgain();
136// int xtno = test->getxtNo();
137 // int t0no = test->gett0No();
138 // int qtparno =test->gethistNo();
139// int qtparno =test->getDigiCalibConstNo();
140// int qtparno =test->getToffsete();
141// int qtparno =test->getRunBegin();
142 // int qtparno =test->getUniformEff();
143 // int qtparno =test->getdyWireEast(0);
144 // std::cout<<"qtparno="<<qtparno<<std::endl;
145//"xtno="<<xtno<<"t0no="<<t0no<<std::endl;
146// std::cout<<"xtno="<<xtno<<std::endl;
147
148 return StatusCode::SUCCESS;
149}
150/*
151DataSvc::retrieveObject(fullPath,CalibData::CalibTest1);
152*/
153StatusCode checkDedx::finalize( ) {
154
155 MsgStream log(msgSvc(), name());
156 log << MSG::INFO
157 << " checkDedx FINALIZE!! "
158 << endreq;
159
160 return StatusCode::SUCCESS;
161}
162
163
std::string test
IMessageSvc * msgSvc()
StatusCode execute()
Definition checkDedx.cxx:97
checkDedx(const std::string &name, ISvcLocator *pSvcLocator)
Instantiation of a static factory to create instances of this algorithm.
Definition checkDedx.cxx:49
StatusCode finalize()
StatusCode initialize()
Definition checkDedx.cxx:58