BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
checkTof Class Reference

Simple algorithm to test functioning of "the other" TDS. More...

#include <checkTof.h>

+ Inheritance diagram for checkTof:

Public Member Functions

 checkTof (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Simple algorithm to test functioning of "the other" TDS.

Definition at line 16 of file checkTof.h.

Constructor & Destructor Documentation

◆ checkTof()

checkTof::checkTof ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 40 of file checkTof.cxx.

42 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
43{
44 // Declare properties here.
45
46}

Member Function Documentation

◆ execute()

StatusCode checkTof::execute ( )

Definition at line 88 of file checkTof.cxx.

88 {
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/TofCal";
95 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
96
97 SmartDataPtr<CalibData::TofCalibData> btof(m_pCalibDataSvc, fullPath);
98
99 for(int i =0;i<176;i++)
100 {
101 double bAtten0 = btof->getBTofAtten(i,0);
102 double bAtten1 = btof->getBTofAtten(i,1);
103 double bP0 = btof->getBTofPleft(i,0);
104 double bP1 = btof->getBTofPleft(i,1);
105 double bP2 = btof->getBTofPleft(i,2);
106 double bP3 = btof->getBTofPleft(i,3);
107 double bP4 = btof->getBTofPleft(i,4);
108 double bP5 = btof->getBTofPleft(i,5);
109 double bP10 = btof->getBTofPright(i,0);
110
111
112 // double bQ = btof->getBTofQ(i);
113 double bSpeed0 = btof->getBTofSpeed(i,0);
114 double bSpeed1 = btof->getBTofSpeed(i,1);
115 // double bW1 = btof->getBTofW(i,0);
116 // double bW2 = btof->getBTofW(i,1);
117 // double bW3 = btof->getBTofW(i,2);
118 // double bW4 = btof->getBTofW(i,3);
119 std::cout<<"=========================================="<<"\n";
120 std::cout<<"cnt ="<<i<<"\n";
121 std::cout<<"Atten0="<<bAtten0<<"Atten1="<<bAtten1<<"Q="<<"bQ"<<"Speed0="<<bSpeed0<<"Speed1="<<bSpeed1<<"P0="<<bP0<<"P1="<<bP1<<"P2="<<bP2<<"P3="<<bP3<<"P4="<<bP4<<"P10="<<bP10;
122 std::cout<<"\n";
123 std::cout<<"P5="<<bP5<<"Q="<<"bQ";
124 // std::cout<<"W1="<<bW1<<"W2="<<bW2<<"W3="<<bW3<<"W4="<<bW4;
125 std::cout<<"\n";
126
127 /*
128 std::cout<<"Atten[1]="<<*(bAtten+1)<<"P0[1]="<<*(bP0+1)<<"P1[1]="<<*(bP1+1)<<"P2[1]="<<*(bP2+1)<<"P3[1]="<<*(bP3+1)<<"P4[1]="<<*(bP4+1);
129 std::cout<<"\n";
130 std::cout<<"P5[1]="<<*(bP5+1)<<"S[1]="<<*(bS+1)<<"SS[1]="<<*(bSS+1)<<"Veff[1]="<<*(bVeff+1);
131 */
132 }
133 for(int i =0;i<96;i++)
134 {
135 double eAtten0 = btof->getETofAtten(i,0);
136 double eAtten1 = btof->getETofAtten(i,1);
137 double eP0 = btof->getETofP(i,0);
138 double eP1 = btof->getETofP(i,1);
139 double eP2 = btof->getETofP(i,2);
140 double eP3 = btof->getETofP(i,3);
141 double eP4 = btof->getETofP(i,4);
142 double eP5 = btof->getETofP(i,5);
143 double eP6 = btof->getETofP(i,6);
144
145 double eSpeed0 = btof->getETofSpeed(i,0);
146 double eSpeed1 = btof->getETofSpeed(i,1);
147
148 std::cout<<"=========================================="<<"\n";
149 std::cout<<"cnt ="<<i<<"\n";
150
151 std::cout<<"Atten0="<<eAtten0<<"Atten1="<<eAtten1<<"Speed0="<<eSpeed0<<"Speed1="<<eSpeed1<<"P0="<<eP0<<"P1="<<eP1<<"P2="<<eP2<<"P3="<<eP3<<"P4="<<eP4<<"P6="<<eP6;
152 std::cout<<"\n";
153 std::cout<<"P5="<<eP5;
154 std::cout<<"\n";
155
156 }
157 //maqm comment because cann't write
158 // m_pTreeSvc->writeToTree("./Tof_test.root", fullPath);
159
160 return StatusCode::SUCCESS;
161}

◆ finalize()

StatusCode checkTof::finalize ( )

Definition at line 165 of file checkTof.cxx.

165 {
166
167 MsgStream log(msgSvc(), name());
168 log << MSG::INFO
169 << " checkTof FINALIZE!! "
170 << endreq;
171
172 return StatusCode::SUCCESS;
173}

◆ initialize()

StatusCode checkTof::initialize ( )

Definition at line 49 of file checkTof.cxx.

49 {
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}

The documentation for this class was generated from the following files: