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