CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
PPSTimingCalibration Class Reference

#include <PPSTimingCalibration.h>

Classes

struct  Key
 Helper structure for indexing calibration data. More...
 

Public Types

using ParametersMap = std::map< Key, std::vector< double > >
 
using TimingMap = std::map< Key, std::pair< double, double > >
 

Public Member Functions

const std::string & formula () const
 
std::vector< double > parameters (int key1, int key2, int key3, int key4) const
 
 PPSTimingCalibration ()=default
 
 PPSTimingCalibration (const std::string &formula, const ParametersMap &params, const TimingMap &timeinfo)
 
double timeOffset (int key1, int key2, int key3, int key4=-1) const
 
double timePrecision (int key1, int key2, int key3, int key4=-1) const
 
 ~PPSTimingCalibration ()=default
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::string formula_
 
ParametersMap parameters_
 
TimingMap timeInfo_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
std::ostream & operator<< (std::ostream &os, const PPSTimingCalibration &data)
 

Detailed Description

Definition at line 18 of file PPSTimingCalibration.h.

Member Typedef Documentation

using PPSTimingCalibration::ParametersMap = std::map<Key, std::vector<double> >

Definition at line 32 of file PPSTimingCalibration.h.

using PPSTimingCalibration::TimingMap = std::map<Key, std::pair<double, double> >

Definition at line 33 of file PPSTimingCalibration.h.

Constructor & Destructor Documentation

PPSTimingCalibration::PPSTimingCalibration ( )
default
PPSTimingCalibration::PPSTimingCalibration ( const std::string &  formula,
const ParametersMap params,
const TimingMap timeinfo 
)
inline

Definition at line 36 of file PPSTimingCalibration.h.

PPSTimingCalibration::~PPSTimingCalibration ( )
default

Member Function Documentation

const std::string& PPSTimingCalibration::formula ( ) const
inline
std::vector< double > PPSTimingCalibration::parameters ( int  key1,
int  key2,
int  key3,
int  key4 
) const

Definition at line 33 of file PPSTimingCalibration.cc.

References submitPVResolutionJobs::key, submitPVResolutionJobs::out, and parameters_.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build(), PPSDiamondSampicTimingCalibrationPCLHarvester::calibDb(), and TotemTimingConversions::voltSamples().

33  {
34  Key key{key1, key2, key3, key4};
35  auto out = parameters_.find(key);
36  if (out == parameters_.end())
37  return {};
38  return out->second;
39 }
tuple key
prepare the HTCondor submission files and eventually submit them
template<class Archive >
void PPSTimingCalibration::serialize ( Archive &  ar,
const unsigned int  version 
)
private
double PPSTimingCalibration::timeOffset ( int  key1,
int  key2,
int  key3,
int  key4 = -1 
) const

Definition at line 41 of file PPSTimingCalibration.cc.

References submitPVResolutionJobs::key, submitPVResolutionJobs::out, and timeInfo_.

Referenced by DiamondSampicCalibrationDQMSource::analyze(), CTPPSDiamondRecHitProducerAlgorithm::build(), PPSDiamondSampicTimingCalibrationPCLHarvester::calibDb(), and TotemTimingConversions::timeOfFirstSample().

41  {
42  Key key{key1, key2, key3, key4};
43  auto out = timeInfo_.find(key);
44  if (out == timeInfo_.end())
45  return 0.;
46  return out->second.first;
47 }
tuple key
prepare the HTCondor submission files and eventually submit them
double PPSTimingCalibration::timePrecision ( int  key1,
int  key2,
int  key3,
int  key4 = -1 
) const

Definition at line 49 of file PPSTimingCalibration.cc.

References submitPVResolutionJobs::key, submitPVResolutionJobs::out, and timeInfo_.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build(), PPSDiamondSampicTimingCalibrationPCLHarvester::calibDb(), and TotemTimingConversions::timePrecision().

49  {
50  Key key{key1, key2, key3, key4};
51  auto out = timeInfo_.find(key);
52  if (out == timeInfo_.end())
53  return 0.;
54  return out->second.second;
55 }
tuple key
prepare the HTCondor submission files and eventually submit them

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 52 of file PPSTimingCalibration.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 52 of file PPSTimingCalibration.h.

std::ostream& operator<< ( std::ostream &  os,
const PPSTimingCalibration data 
)
friend

Definition at line 57 of file PPSTimingCalibration.cc.

57  {
58  os << "FORMULA: " << data.formula_ << "\nDB SAMPIC CHANNEL CELL PARAMETERS TIME_OFFSET\n";
59  for (const auto& kv : data.parameters_) {
60  os << kv.first << " [";
61  for (size_t i = 0; i < kv.second.size(); ++i)
62  os << (i > 0 ? ", " : "") << kv.second.at(i);
63  const auto& time = data.timeInfo_.at(kv.first);
64  os << "] " << time.first << " " << time.second << "\n";
65  }
66  return os;
67 }

Member Data Documentation

std::string PPSTimingCalibration::formula_
private

Definition at line 48 of file PPSTimingCalibration.h.

Referenced by formula(), and operator<<().

ParametersMap PPSTimingCalibration::parameters_
private
TimingMap PPSTimingCalibration::timeInfo_
private

Definition at line 50 of file PPSTimingCalibration.h.

Referenced by operator<<(), timeOffset(), and timePrecision().