PSCalib/test/ex_cspad_calib_pars.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id$
00004 //
00005 // Description:
00006 //      Test class CSPadCalibPars of the PSCalib packadge
00007 //
00008 // Author List:
00009 //      Mikhail Dubrovin
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 
00017 #include "PSCalib/CSPadCalibPars.h"
00018 
00019 #include <string>
00020 #include <iostream>
00021 
00022 using std::cout;
00023 using std::endl;
00024 
00025 //using namespace PSTime;
00026 typedef PSCalib::CSPadCalibPars CALIB;
00027 
00028 //-----------------
00029 
00030 int test01 () // Test for XPP
00031 {
00032   const std::string calibDir   = "/reg/d/psdm/xpp/xpptut13/calib";
00033   const std::string groupName  = "CsPad::CalibV1";
00034   const std::string source     = "XppGon.0:Cspad.0";
00035   unsigned long     runNumber  = 10;
00036 
00037   cout << "Test of PSCalib::CSPadCalibPars\n";     
00038 
00039   CALIB *calibpars = new CALIB(calibDir, groupName, source, runNumber);  
00040 
00041   calibpars->printCalibPars();
00042   calibpars->printCalibParsStatus();
00043 
00044   size_t quad=1, sect=7; // for example...
00045   cout << "\ngetCenterGlobal[pix] =" << calibpars -> getCenterGlobalX(quad, sect) << " for quad=" << quad << " sect=" << sect << "\n";  
00046 
00047   return 0;
00048 }
00049 
00050 //-----------------
00051 
00052 int test02 () // Test for CXI
00053 {
00054   //const std::string calibDir   = "/reg/d/psdm/cxi/cxi35711/calib";
00055   //const std::string calibDir   = "/reg/d/psdm/cxi/cxi35711/calib_xxx"; // to test default pars
00056   //const std::string calibDir   = "/reg/neh/home1/dubrovin/LCLS/CSPadAlignment-v01/calib-test-calibpars";
00057   const std::string calibDir   = "/reg/d/psdm/cxi/cxitut13/calib";
00058   const std::string groupName  = "CsPad::CalibV1";
00059   const std::string source     = "CxiDs1.0:Cspad.0";
00060   unsigned long     runNumber  = 10;
00061 
00062   cout << "Test of PSCalib::CSPadCalibPars\n";     
00063 
00064   CALIB *calibpars = new CALIB(calibDir, groupName, source, runNumber);  
00065 
00066   calibpars->printCalibPars();
00067   calibpars->printCalibParsStatus();
00068 
00069   return 0;
00070 }
00071 
00072 //-----------------
00073 
00074 int main (int argc, char* argv[])
00075 {  
00076   cout << "Number of input arguments = " << argc << endl; 
00077 
00078   if      (argc == 1)                     {test01();}
00079   else if (argc == 2 && atoi(argv[1])==1) {test01();}
00080   else if (argc == 2 && atoi(argv[1])==2) {test02();}
00081   else    {
00082         cout << "WARNING!!! Unexpected input arguments, argc=" << argc << endl; 
00083         for(int i = 0; i < argc; i++)
00084             cout << "argv[" << i << "] = " << argv[i] << endl;
00085         cout << "Use command: " << argv[0] << " N, where N stands for test number 1,2,3,...\n"; 
00086   }
00087   return 0;
00088 }
00089 
00090 //-----------------

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7