Changeset 10116 for fact/tools/pixelmap_test/PixelMapTest.cc
- Timestamp:
- 01/24/11 12:04:23 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pixelmap_test/PixelMapTest.cc
r18 r10116 1 1 //simple test program to check the PixelMap class 2 //Q. Weitzel, ETH Zurich, December 14, 2010 2 3 3 4 #include "../../pixelmap/PixelMap.h" 4 5 #include <iostream> 5 6 7 using namespace std; 8 6 9 int main(){ 7 10 8 std::cout << std::endl;9 std::cout << "==============================" << std::endl;10 std::cout << "PixelMap Test Program" << std::endl;11 std::cout << "==============================" << std::endl;12 std::cout << std::endl;11 cout << endl; 12 cout << "==============================" << endl; 13 cout << "PixelMap Test Program" << endl; 14 cout << "==============================" << endl; 15 cout << endl; 13 16 14 PixelMap* pm = new PixelMap("Test_PixelMap.txt", true); 17 cout << "Return value when asking for a non-existing pixel: " << PixelMap::PM_ERROR_CODE << endl; 18 cout << endl; 15 19 20 //PixelMap* pm = new PixelMap("", true); 21 PixelMap* pm = new PixelMap("0: 0 0 0 0 0 2 0 0 0; 1: 0 0 0 1 0 0 1 -1 -1; 237: 0 0 0 2 0 0 1 0 -1;", true); 22 16 23 pm->Print(); 17 24 18 std::string drs1 = pm->DRS_to_Pixel(0,0,0,true); 19 std::cout << "Name: " << drs1 << std::endl; 25 unsigned int fpa; 26 fpa = pm->FPA_to_Pixel(0,0,0,0,true); 27 cout << "PixelID: " << fpa << endl; 28 fpa = pm->FPA_to_Pixel(0,1,0,0,true); 29 cout << "PixelID: " << fpa << endl; 30 fpa = pm->FPA_to_Pixel(0,0,0,0,true); 31 cout << "PixelID: " << fpa << endl; 20 32 21 std::string drs2 = pm->DRS_to_Pixel(1,0,0,true); 22 std::cout << "Name: " << drs2 << std::endl; 33 vector<unsigned int> hv; 34 hv = pm->HV_to_Pixel(6,1,8,true); 35 cout << hv.size() << " PixelIDs found: "; 36 for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} 37 cout << endl; 38 hv = pm->HV_to_Pixel(6,9,1,true); 39 cout << hv.size() << " PixelIDs found: "; 40 for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} 41 cout << endl; 42 hv = pm->HV_to_Pixel(0,0,1,true); 43 cout << hv.size() << " PixelIDs found: "; 44 for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} 45 cout << endl; 46 hv = pm->HV_to_Pixel(0,0,1,true); 47 cout << hv.size() << " PixelIDs found: "; 48 for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} 49 cout << endl; 23 50 24 std::string drs3 = pm->DRS_to_Pixel(0,0,0,true); 25 std::cout << "Name: " << drs3 << std::endl; 51 unsigned int pos; 52 pos = pm->POS_to_Pixel(-1,-1,true); 53 cout << "PixelID: " << pos << endl; 54 pos = pm->POS_to_Pixel(-10,1,true); 55 cout << "PixelID: " << pos << endl; 26 56 27 std::string hv1 = pm->HV_to_Pixel(6,1,8,true); 28 std::cout << "Name: " << hv1 << std::endl; 57 unsigned int fpab; 58 fpab = pm->Pixel_to_FPAboard(0,true); 59 cout << "Board: " << fpab << endl; 60 fpab = pm->Pixel_to_FPAboard(5,true); 61 cout << "Board: " << fpab << endl; 29 62 30 std::string hv2 = pm->HV_to_Pixel(6,9,1,true); 31 std::cout << "Name: " << hv2 << std::endl; 63 unsigned int hvboard; 64 hvboard = pm->Pixel_to_HVboard(0,true); 65 cout << "Board: " << hvboard << endl; 66 hvboard = pm->Pixel_to_HVboard(5,true); 67 cout << "Board: " << hvboard << endl; 32 68 33 std::string hv3 = pm->HV_to_Pixel(1,0,0,true); 34 std::cout << "Name: " << hv3 << std::endl; 35 36 unsigned int drsb1 = pm->Pixel_to_DRSboard("0-1-1",true); 37 std::cout << "Board: " << drsb1 << std::endl; 38 39 unsigned int drsb2 = pm->Pixel_to_DRSboard("1-0-0",true); 40 std::cout << "Board: " << drsb2 << std::endl; 41 42 pm->Print(); 43 44 std::string drs4 = pm->DRS_to_Pixel(0,0,1,true); 45 std::cout << "Name: " << drs4 << std::endl; 46 47 unsigned int hvchain1 = pm->Pixel_to_HVchain("0-1-1",true); 48 std::cout << "Chain: " << hvchain1 << std::endl; 49 50 unsigned int hvchain2 = pm->Pixel_to_HVchain("1-0-0",true); 51 std::cout << "Chain: " << hvchain2 << std::endl; 69 int posy; 70 posy = pm->Pixel_to_POSy(1,true); 71 cout << "POSy: " << posy << endl; 72 posy = pm->Pixel_to_POSy(15,true); 73 cout << "POSy: " << posy << endl; 52 74 53 75 delete pm;
Note:
See TracChangeset
for help on using the changeset viewer.