CMS 3D CMS Logo

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 34 of file PPSTimingCalibration.h.

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

Definition at line 35 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 38 of file PPSTimingCalibration.h.

References parameters(), and ~PPSTimingCalibration().

38  :
39  formula_( formula ), parameters_( params ), timeInfo_( timeinfo ) {}
const std::string & formula() const
PPSTimingCalibration::~PPSTimingCalibration ( )
default

Referenced by PPSTimingCalibration().

Member Function Documentation

const std::string& PPSTimingCalibration::formula ( ) const
inline
std::vector< double > PPSTimingCalibration::parameters ( int  key1,
int  key2,
int  key3,
int  key4 
) const
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 47 of file PPSTimingCalibration.cc.

References crabWrapper::key, MillePedeFileConverter_cfg::out, and timeInfo_.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build(), formula(), and TotemTimingConversions::timeOfFirstSample().

48 {
49  Key key{ key1, key2, key3, key4 };
50  auto out = timeInfo_.find( key );
51  if ( out == timeInfo_.end() )
52  return 0.;
53  return out->second.first;
54 }
double PPSTimingCalibration::timePrecision ( int  key1,
int  key2,
int  key3,
int  key4 = -1 
) const

Definition at line 57 of file PPSTimingCalibration.cc.

References crabWrapper::key, MillePedeFileConverter_cfg::out, and timeInfo_.

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

58 {
59  Key key{ key1, key2, key3, key4 };
60  auto out = timeInfo_.find( key );
61  if ( out == timeInfo_.end() )
62  return 0.;
63  return out->second.second;
64 }

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 54 of file PPSTimingCalibration.h.

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

Definition at line 54 of file PPSTimingCalibration.h.

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

Definition at line 67 of file PPSTimingCalibration.cc.

68 {
69  os << "FORMULA: "<< data.formula_ << "\nDB SAMPIC CHANNEL CELL PARAMETERS TIME_OFFSET\n";
70  for ( const auto& kv : data.parameters_ ) {
71  os << kv.first <<" [";
72  for ( size_t i = 0; i < kv.second.size(); ++i )
73  os << ( i > 0 ? ", " : "" ) << kv.second.at( i );
74  const auto& time = data.timeInfo_.at( kv.first );
75  os << "] " << time.first << " " << time.second << "\n";
76  }
77  return os;
78 }

Member Data Documentation

std::string PPSTimingCalibration::formula_
private

Definition at line 50 of file PPSTimingCalibration.h.

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

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

Definition at line 52 of file PPSTimingCalibration.h.

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