BOSS 8.0.0
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
2//2010/05/17 06:54:24 huangb Exp $
3/*#include <stdio.h>
4#include "CalibData/CalibModel.h"
5#include "CalibData/Dedx/DedxCalibData.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 checkDedx : public Algorithm {
17
18public:
19 checkDedx(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#include "CalibData/Dedx/DedxCalibData.h"
35#include "CalibData/Dedx/DedxSimData.h"
36#include "CalibData/Emc/EmcCalibData.h"
37#include "CalibData/EsTime/EsTimeCalibData.h"
38#include "CalibData/Mdc/MdcAlignData.h"
39#include "CalibData/Muc/MucCalibData.h"
40#include "CalibData/Tof/TofCalibData.h"
41#include "CalibData/Tof/TofElecData.h"
42#include "CalibData/Tof/TofSimData.h"
43#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, ISvcLocator* pSvcLocator )
50 : Algorithm( name, pSvcLocator ), m_pCalibDataSvc( 0 ) {
51 // Declare properties here.
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 checkDedx::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 // std::string fullPath = "/Calib/DedxCal";
96 // std::string fullPath = "/Calib/DedxSim";
97 // std::string fullPath = "/Calib/EmcCal";
98 std::string fullPath = "/Calib/EsTimeCal";
99 // std::string fullPath = "/Calib/EstTofCal";
100 // std::string fullPath = "/Calib/MucCal";
101 // std::string fullPath = "/Calib/TofCal";
102 // std::string fullPath = "/Calib/TofQElec";
103 // std::string fullPath = "/Calib/TofSim";
104 // std::string fullPath = "/Calib/MdcAlign";
105 log << MSG::INFO << "execute() fullPath = " << fullPath << endmsg;
106
107 // SmartDataPtr<CalibData::MdcCalibData> test(m_pCalibDataSvc, fullPath);
108 // if(!btof) ;
109 /* for(int i=0;i<16;i++){
110 std::cout<<"test->getdxEP(i)"<<test->getdxEP(i)<<std::endl;
111 }
112 for(int i=0;i<6796;i++){
113 std::cout<<"test->gettension"<<test->gettension(i)<<std::endl;
114 }*/
115 // if(!test) ;
116 // SmartDataPtr<CalibData::DedxCalibData> test(m_pCalibDataSvc, fullPath);
117 // SmartDataPtr<CalibData::DedxSimData> test(m_pCalibDataSvc, fullPath);
118 // SmartDataPtr<CalibData::EmcCalibData> test(m_pCalibDataSvc, fullPath);
119 // SmartDataPtr<CalibData::TofElecData> test(m_pCalibDataSvc, fullPath);
120 // SmartDataPtr<CalibData::TofSimData> test(m_pCalibDataSvc, fullPath);
121 // SmartDataPtr<CalibData::MdcAlignData> test(m_pCalibDataSvc, fullPath);
122 SmartDataPtr<CalibData::EsTimeCalibData> test( m_pCalibDataSvc, fullPath );
123
124 if ( !test )
125 ;
126 // test->getBTof(0);
127 // int qtparno = test->getgain();
128 // int xtno = test->getxtNo();
129 // int t0no = test->gett0No();
130 // int qtparno =test->gethistNo();
131 // int qtparno =test->getDigiCalibConstNo();
132 // int qtparno =test->getToffsete();
133 // int qtparno =test->getRunBegin();
134 // int qtparno =test->getUniformEff();
135 // int qtparno =test->getdyWireEast(0);
136 // std::cout<<"qtparno="<<qtparno<<std::endl;
137 //"xtno="<<xtno<<"t0no="<<t0no<<std::endl;
138 // std::cout<<"xtno="<<xtno<<std::endl;
139
140 return StatusCode::SUCCESS;
141}
142/*
143DataSvc::retrieveObject(fullPath,CalibData::CalibTest1);
144*/
146
147 MsgStream log( msgSvc(), name() );
148 log << MSG::INFO << " checkDedx FINALIZE!! " << endmsg;
149
150 return StatusCode::SUCCESS;
151}
std::string test
IMessageSvc * msgSvc()
StatusCode execute()
Definition checkDedx.cxx:88
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:54