BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
test_strips.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/calibUtil/src/test/test_strips.cxx,v 1.1.1.1
2// 2005/10/17 06:12:26 maqm Exp $
3/** @file test_strips.cxx
4 Sample program to exercise low-level calibration strip services.
5 Optional argument is path to file using badStrips.dtd. If omitted,
6 use file $CALIBUTILROOT/xml/test/testHot.xml
7*/
8#include "calibUtil/StripSrv.h"
9#include "facilities/Util.h"
10
11#include <fstream>
12#include <iostream>
13#include <string>
14
16
17class MyObject : public calibUtil::ClientObject {
18
19 virtual calibUtil::eVisitorRet badTower( unsigned int row, unsigned int col, int badness );
20 virtual calibUtil::eVisitorRet badPlane( unsigned int row, unsigned int col,
21 unsigned int tray, bool top, int badness,
22 bool allBad, const StripCol& strips );
23};
24
25int main( int argc, char* argv[] ) {
27
28 std::string name = "$(CALIBUTILROOT)/xml/test/testHot.xml";
29
30 if ( argc > 1 ) { name = std::string( ( argv[1] ) ); }
32
33 StripSrv ssObj( name );
34
35 std::vector<StripSrv::towerRC> trc;
36 ssObj.getBadTowers( trc );
37 for ( unsigned int i = 0; i < trc.size(); i++ )
38 {
39 std::cout << "Tower id is (" << trc[i].row << ", " << trc[i].col;
40 std::cout << ")" << std::endl;
41 }
42 std::cout << std::endl;
43
44 std::cout << "Bad type is " << (int)ssObj.getBadType() << std::endl;
45
46 std::cout << "calType name is " << ssObj.getCalType() << std::endl;
47
48 MyObject cli;
49 ssObj.traverseInfo( &cli );
50
51 return ( 0 );
52
53} /* end of main */
54
55calibUtil::eVisitorRet MyObject::badTower( unsigned int row, unsigned int col, int badness ) {
56
57 std::cout << "MyObject::badTower called back for tower (" << row << ", " << col
58 << ") badness = " << badness << std::endl;
59 return calibUtil::CONT;
60}
61
62calibUtil::eVisitorRet MyObject::badPlane( unsigned int row, unsigned int col,
63 unsigned int tray, bool top, int badness,
64 bool allBad, const calibUtil::StripCol& strips ) {
65
66 std::cout << "MyObject::badPlane called back for tower (" << row << ", " << col
67 << ") tray = " << tray << " top = " << top << std::endl;
68 std::cout << "badness = " << badness << " allBad = " << allBad << std::endl;
69 std::cout << "#strips in strip collection = " << strips.size() << std::endl;
70
71 return calibUtil::CONT;
72}
file for sample client
Definition MyObject.h:11
static int expandEnvVar(std::string *toExpand, const std::string &openDel=std::string("$("), const std::string &closeDel=std::string(")"))
std::vector< unsigned short int > StripCol
int main()
Definition phokhara.cc:42