PSCalib/test/ex_seg_geometry_store.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: ex_seg_geometry_store.cpp 9517 2015-01-23 01:47:10Z dubrovin@SLAC.STANFORD.EDU $
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/SegGeometryStore.h"
00018 
00019 #include <string>
00020 #include <iostream>
00021 #include <stdlib.h> // for atoi
00022 
00023 //using std::cout;
00024 //using std::endl;
00025 //using std::atoi;
00026 using namespace std;
00027 
00028 typedef PSCalib::SegGeometry SG;
00029 
00030 //-----------------
00031 
00032 int test01 () // Test for CSPAD SENS2X1:V1
00033 {
00034   cout << "Test of PSCalib::SegGeometryStore::Create(...)\n";     
00035 
00036   SG *seggeom = PSCalib::SegGeometryStore::Create("SENS2X1:V1", 0377);  
00037   seggeom -> print_seg_info(0377);
00038 
00039   return 0;
00040 }
00041 
00042 //-----------------
00043 
00044 int test02 () // Test for EPIX100:V1
00045 {
00046   cout << "Test of PSCalib::SegGeometryStore::Create(...)\n";     
00047 
00048   SG *seggeom = PSCalib::SegGeometryStore::Create("EPIX100:V1", 0377);  
00049   seggeom -> print_seg_info(0377);
00050 
00051   return 0;
00052 }
00053 
00054 //-----------------
00055 
00056 int test03 () // Test for PNCCD:V1
00057 {
00058   cout << "Test of PSCalib::SegGeometryStore::Create(...)\n";     
00059 
00060   SG *seggeom = PSCalib::SegGeometryStore::Create("PNCCD:V1", 0377);  
00061   seggeom -> print_seg_info(0377);
00062 
00063   return 0;
00064 }
00065 
00066 //-----------------
00067 
00068 int main (int argc, char* argv[])
00069 {  
00070   cout << "Number of input arguments = " << argc << endl; 
00071 
00072   if      (argc == 1)                     {test01();}
00073   else if (argc == 2 && atoi(argv[1])==1) {test01();}
00074   else if (argc == 2 && atoi(argv[1])==2) {test02();}
00075   else if (argc == 2 && atoi(argv[1])==3) {test03();}
00076   else    {
00077         cout << "WARNING!!! Unexpected input arguments, argc=" << argc << endl; 
00078         for(int i = 0; i < argc; i++)
00079             cout << "argv[" << i << "] = " << argv[i] << endl;
00080         cout << "Use command: " << argv[0] << " N, where N stands for test number 1,2,3,...\n"; 
00081   }
00082   return 0;
00083 }
00084 
00085 //-----------------

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7