#include <CalibFileFinder.h>
Public Member Functions | |
CalibFileFinder () | |
CalibFileFinder (const std::string &calibDir, const std::string &className, const unsigned &print_bits=255) | |
Creates object with elements of the path to the calibration file. | |
~CalibFileFinder () | |
std::string | findCalibFile (const std::string &src, const std::string &datatype, unsigned long runNumber) const |
Returns complete path/name of the calibration file. | |
std::string | findCalibFile (const Pds::Src &src, const std::string &datatype, unsigned long runNumber) const |
Returns complete path/name of the calibration file. | |
Static Public Member Functions | |
static std::string | selectCalibFile (const std::vector< std::string > &files, unsigned long runNumber, unsigned print_bits=255) |
Selects calibration file from a list of file names. | |
static std::string | trancateSourceName (const std::string &str) |
If source name has DetInfo(...) - remove it. |
When all input parameters are provided at class initialization the method findCalibFile(...) returns the path/name to the file with requested calibration parameters.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 47 of file CalibFileFinder.h.
PSCalib::CalibFileFinder::CalibFileFinder | ( | ) | [inline] |
Definition at line 51 of file CalibFileFinder.h.
PSCalib::CalibFileFinder::CalibFileFinder | ( | const std::string & | calibDir, | |
const std::string & | className, | |||
const unsigned & | print_bits = 255 | |||
) |
Creates object with elements of the path to the calibration file.
Calibration directory typically comes from environment for psana jobs.
[in] | calibDir | Calibration directory for current experiment. |
[in] | className | Calibration class name, e.g. CsPad::CalibV1 |
[in] | print_bits | =0-print nothing, +1-wrong file extension, +2-skipping file |
PSCalib::CalibFileFinder::~CalibFileFinder | ( | ) |
std::string PSCalib::CalibFileFinder::findCalibFile | ( | const Pds::Src & | src, | |
const std::string & | datatype, | |||
unsigned long | runNumber | |||
) | const |
Returns complete path/name of the calibration file.
[in] | src | Address of the data source, only DetInfo addresses are accepted. |
[in] | datatype | Type of the calibration parameters (i.e. "rotation"). |
[in] | runNumber | Run number to search the valid file name. |
std::string PSCalib::CalibFileFinder::findCalibFile | ( | const std::string & | src, | |
const std::string & | datatype, | |||
unsigned long | runNumber | |||
) | const |
Returns complete path/name of the calibration file.
[in] | src | The name of the data source, e.g. CxiDs1.0:Cspad.0 |
[in] | datatype | Type of the calibration parameters (i.e. "rotation"). |
[in] | runNumber | Run number to search the valid file name. |
Referenced by CSPadPixCoords::CSPadImageProducer::getGeometryPars(), CSPadPixCoords::CSPad2x2ImageProducer::getGeometryPars(), and main().
static std::string PSCalib::CalibFileFinder::selectCalibFile | ( | const std::vector< std::string > & | files, | |
unsigned long | runNumber, | |||
unsigned | print_bits = 255 | |||
) | [static] |
Selects calibration file from a list of file names.
This method is mostly for testing purposes, it is used in implementation of findCalibFile(). It can be used if you have the list of file names instead of scanning pre-defined directory. File names that do not match standard naming convention are ignored. Standard convention is two run number separated with '-' and extension '.data', second run can be specified as 'end'.
[in] | files | List of file names. |
[in] | runNumber | Run number to search the valid file name. |
[in] | print_bits | print control bit-word. |
static std::string PSCalib::CalibFileFinder::trancateSourceName | ( | const std::string & | str | ) | [static] |
If source name has DetInfo(...) - remove it.
[in] | str | - input string with source name, ex: "DetInfo(Camp.0:pnCCD.0)" |