BOSS 8.0.0
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 17 of file checkTof.h.

Constructor & Destructor Documentation

◆ checkTof()

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

Definition at line 41 of file checkTof.cxx.

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

Member Function Documentation

◆ execute()

StatusCode checkTof::execute ( )

Definition at line 80 of file checkTof.cxx.

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

◆ finalize()

StatusCode checkTof::finalize ( )

Definition at line 163 of file checkTof.cxx.

163 {
164
165 MsgStream log( msgSvc(), name() );
166 log << MSG::INFO << " checkTof FINALIZE!! " << endmsg;
167
168 return StatusCode::SUCCESS;
169}

◆ initialize()

StatusCode checkTof::initialize ( )

Definition at line 46 of file checkTof.cxx.

46 {
47 StatusCode sc;
48 MsgStream log( msgSvc(), name() );
49 log << MSG::INFO << "Initialize()" << endmsg;
50
51 // So far don't have any properties, but in case we do some day..
52 // setProperties();
53
54 log << MSG::INFO << "setProperties()" << endmsg;
55
56 sc = service( "CalibDataSvc", m_pCalibDataSvc, true );
57
58 if ( !sc.isSuccess() )
59 {
60 log << MSG::ERROR << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
61 << endmsg;
62 return sc;
63 }
64 else
65 { log << MSG::DEBUG << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" << endmsg; }
66
67 sc = service( "CalibTreeCnvSvc", m_pTreeSvc, true );
68 if ( !sc.isSuccess() )
69 {
70 log << MSG::ERROR << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc" << endmsg;
71 return sc;
72 }
73 // Get properties from the JobOptionsSvc
74
75 sc = setProperties();
76
77 return StatusCode::SUCCESS;
78}

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