Ignore:
Timestamp:
01/24/11 12:04:23 (14 years ago)
Author:
weitzel
Message:
new version of pixelmap class
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pixelmap_test/PixelMapTest.cc

    r18 r10116  
    11//simple test program to check the PixelMap class
     2//Q. Weitzel, ETH Zurich, December 14, 2010
    23
    34#include "../../pixelmap/PixelMap.h"
    45#include <iostream>
    56
     7using namespace std;
     8
    69int main(){
    710
    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;
    1316
    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;
    1519
     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   
    1623    pm->Print();
    1724
    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;
    2032
    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;
    2350
    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;
    2656
    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;
    2962
    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;
    3268
    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;
    5274
    5375    delete pm;
Note: See TracChangeset for help on using the changeset viewer.