PSCalib::CalibFileFinder Class Reference
[PSCalib package]

CalibFileFinder class finds the pass to calibration file. More...

#include <CalibFileFinder.h>

List of all members.

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.


Detailed Description

CalibFileFinder class finds the pass to calibration file.

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.

See also:
CSPadCalibPars
Version:
Id
CalibFileFinder.h 9866 2015-04-08 00:44:28Z dubrovin@SLAC.STANFORD.EDU
Author:
Mikhail S. Dubrovin

Definition at line 47 of file CalibFileFinder.h.


Constructor & Destructor Documentation

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.

Parameters:
[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 (  ) 


Member Function Documentation

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.

Parameters:
[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.

Parameters:
[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 ImgAlgos::NDArrImageProducer::getCalibPars(), 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'.

Parameters:
[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.

Parameters:
[in] str - input string with source name, ex: "DetInfo(Camp.0:pnCCD.0)"


The documentation for this class was generated from the following file:
Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7