pdscalibdata/src/CsPad2x2TiltV1.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id$
00004 //
00005 // Description:
00006 //      Class CsPad2x2TiltV1...
00007 //
00008 // Author List:
00009 //      Mikhail S. Dubrovin
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "pdscalibdata/CsPad2x2TiltV1.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 #include <string.h>
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 #include "MsgLogger/MsgLogger.h"
00027 
00028 //-----------------------------------------------------------------------
00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00030 //-----------------------------------------------------------------------
00031 
00032 using namespace std;
00033 
00034 //              ----------------------------------------
00035 //              -- Public Function Member Definitions --
00036 //              ----------------------------------------
00037 
00038 namespace pdscalibdata {
00039 
00040 //----------------
00041 // Constructors --
00042 //----------------
00043 
00044 CsPad2x2TiltV1::CsPad2x2TiltV1 ()
00045 {
00046   // Default tilts are 0:
00047   std::fill_n(&m_tilt[0], int(NSect), double(0));
00048 }
00049 
00050 //----------------
00051 
00052 CsPad2x2TiltV1::CsPad2x2TiltV1( const std::vector<double> v_parameters )
00053 {
00054     if (v_parameters.size() != NUMBER_OF_PARAMETERS) {
00055         WithMsgLog("CsPad2x2TiltV1", error, str) {
00056         str << "Expected number of parameters is " << NUMBER_OF_PARAMETERS ;
00057         str << ", read from file " << v_parameters.size() ;
00058         str << ": check the file.\n" ;
00059         }       
00060         abort();
00061     }
00062     size_t arr_size = sizeof( double ) * v_parameters.size();
00063     memcpy( &m_tilt, &v_parameters[0], arr_size );
00064     //this->print();
00065 }
00066 
00067 void CsPad2x2TiltV1::print()
00068 {
00069     cout << endl << "Tilt:";  
00070     for( int sect=0; sect<NSect; ++sect ) { cout << "  " << m_tilt[sect]; }
00071     cout << endl;
00072 }
00073 
00074 //----------------
00075 
00076 CsPad2x2TiltV1::~CsPad2x2TiltV1 ()
00077 {
00078 }
00079 
00080 } // namespace pdscalibdata

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7