00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00035
00036
00037
00038
00039 #include "checkTof.h"
00040 checkTof::checkTof( const std::string& name,
00041 ISvcLocator* pSvcLocator )
00042 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
00043 {
00044
00045
00046 }
00047
00048
00049 StatusCode checkTof::initialize() {
00050 StatusCode sc;
00051 MsgStream log(msgSvc(), name());
00052 log << MSG::INFO << "Initialize()" << endreq;
00053
00054
00055
00056
00057 log<<MSG::INFO << "setProperties()" << endreq;
00058
00059 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
00060
00061 if ( !sc.isSuccess() ) {
00062 log << MSG::ERROR
00063 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
00064 << endreq;
00065 return sc;
00066 } else {
00067 log << MSG::DEBUG
00068 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
00069 << endreq;
00070 }
00071
00072 sc = service("CalibTreeCnvSvc", m_pTreeSvc, true);
00073 if ( !sc.isSuccess() ) {
00074 log << MSG::ERROR
00075 << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc"
00076 << endreq;
00077 return sc;
00078 }
00079
00080
00081 sc = setProperties();
00082
00083 return StatusCode::SUCCESS;
00084
00085 }
00086
00087
00088 StatusCode checkTof::execute( ) {
00089
00090 MsgStream log(msgSvc(), name());
00091
00092
00093
00094 std::string fullPath = "/Calib/TofCal";
00095 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
00096
00097 SmartDataPtr<CalibData::TofCalibData> btof(m_pCalibDataSvc, fullPath);
00098
00099 for(int i =0;i<176;i++)
00100 {
00101 double bAtten0 = btof->getBTofAtten(i,0);
00102 double bAtten1 = btof->getBTofAtten(i,1);
00103 double bP0 = btof->getBTofPleft(i,0);
00104 double bP1 = btof->getBTofPleft(i,1);
00105 double bP2 = btof->getBTofPleft(i,2);
00106 double bP3 = btof->getBTofPleft(i,3);
00107 double bP4 = btof->getBTofPleft(i,4);
00108 double bP5 = btof->getBTofPleft(i,5);
00109 double bP10 = btof->getBTofPright(i,0);
00110
00111
00112
00113 double bSpeed0 = btof->getBTofSpeed(i,0);
00114 double bSpeed1 = btof->getBTofSpeed(i,1);
00115
00116
00117
00118
00119 std::cout<<"=========================================="<<"\n";
00120 std::cout<<"cnt ="<<i<<"\n";
00121 std::cout<<"Atten0="<<bAtten0<<"Atten1="<<bAtten1<<"Q="<<"bQ"<<"Speed0="<<bSpeed0<<"Speed1="<<bSpeed1<<"P0="<<bP0<<"P1="<<bP1<<"P2="<<bP2<<"P3="<<bP3<<"P4="<<bP4<<"P10="<<bP10;
00122 std::cout<<"\n";
00123 std::cout<<"P5="<<bP5<<"Q="<<"bQ";
00124
00125 std::cout<<"\n";
00126
00127
00128
00129
00130
00131
00132 }
00133 for(int i =0;i<96;i++)
00134 {
00135 double eAtten0 = btof->getETofAtten(i,0);
00136 double eAtten1 = btof->getETofAtten(i,1);
00137 double eP0 = btof->getETofP(i,0);
00138 double eP1 = btof->getETofP(i,1);
00139 double eP2 = btof->getETofP(i,2);
00140 double eP3 = btof->getETofP(i,3);
00141 double eP4 = btof->getETofP(i,4);
00142 double eP5 = btof->getETofP(i,5);
00143 double eP6 = btof->getETofP(i,6);
00144
00145 double eSpeed0 = btof->getETofSpeed(i,0);
00146 double eSpeed1 = btof->getETofSpeed(i,1);
00147
00148 std::cout<<"=========================================="<<"\n";
00149 std::cout<<"cnt ="<<i<<"\n";
00150
00151 std::cout<<"Atten0="<<eAtten0<<"Atten1="<<eAtten1<<"Speed0="<<eSpeed0<<"Speed1="<<eSpeed1<<"P0="<<eP0<<"P1="<<eP1<<"P2="<<eP2<<"P3="<<eP3<<"P4="<<eP4<<"P6="<<eP6;
00152 std::cout<<"\n";
00153 std::cout<<"P5="<<eP5;
00154 std::cout<<"\n";
00155
00156 }
00157
00158
00159
00160 return StatusCode::SUCCESS;
00161 }
00162
00163
00164
00165 StatusCode checkTof::finalize( ) {
00166
00167 MsgStream log(msgSvc(), name());
00168 log << MSG::INFO
00169 << " checkTof FINALIZE!! "
00170 << endreq;
00171
00172 return StatusCode::SUCCESS;
00173 }
00174
00175