CSPadPixCoords/test/ex_CSPadConfigPars.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id$
00004 //
00005 // Description:
00006 //      Test class CSPadConfigPars of the CSPadPixCoords packadge
00007 //
00008 // Author List:
00009 //      Mikhail Dubrovin
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 
00017 #include "CSPadPixCoords/CSPadConfigPars.h"
00018 
00019 //#include <string>
00020 //#include <iostream>
00021 
00022 //using std::cout;
00023 //using std::endl;
00024 
00025 using namespace std;
00026 
00027 typedef CSPadPixCoords::CSPadConfigPars CONFIG;
00028 
00029 //-----------------
00030 
00031 void test01()
00032 {
00033   CONFIG *config = new CONFIG();  
00034 
00035   config -> printCSPadConfigPars();
00036 
00037   cout << "  quad roi mask for quad 2 is " << config -> roiMask(2) << "\n"; 
00038 }
00039 
00040 //-----------------
00041 
00042 void test02()
00043 {
00044   uint32_t numQuads         = 3;                     // 4; 
00045   uint32_t quadNumber[]     = {0,1,3,3};             // {0,1,2,3};
00046   uint32_t roiMask[]        = {0377,0355,0377,0377}; // {0377,0377,0377,0377};
00047   CONFIG *config = new CONFIG( numQuads, quadNumber, roiMask );  
00048 
00049   config -> printCSPadConfigPars();
00050 
00051   cout << "  quad roi mask for quad 2 is " << config -> roiMask(2) << "\n"; 
00052 }
00053 
00054 //-----------------
00055 
00056 int main (int argc, char* argv[])
00057 {  
00058   cout << "Number of input arguments = " << argc << endl; 
00059 
00060   if      (argc == 1)                     {test01();}
00061   else if (argc == 2 && atoi(argv[1])==1) {test01();}
00062   else if (argc == 2 && atoi(argv[1])==2) {test02();}
00063   else    {
00064         cout << "WARNING!!! Unexpected input arguments, argc=" << argc << endl; 
00065         for(int i = 0; i < argc; i++)
00066             cout << "argv[" << i << "] = " << argv[i] << endl;
00067         cout << "Use command: " << argv[0] << " N, where N stands for test number 1,2,3,...\n"; 
00068   }
00069   return 0;
00070 }
00071 
00072 //-----------------
00073 

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7