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

Member Typedef Documentation

◆ ParametersMap

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

Definition at line 37 of file PPSTimingCalibration.h.

◆ TimingMap

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

Definition at line 38 of file PPSTimingCalibration.h.

Constructor & Destructor Documentation

◆ PPSTimingCalibration() [1/2]

PPSTimingCalibration::PPSTimingCalibration ( )
default

◆ PPSTimingCalibration() [2/2]

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

Definition at line 41 of file PPSTimingCalibration.h.

41  { return formula_; }
42  double timeOffset(int key1, int key2, int key3, int key4 = -1) const;

References formula_.

◆ ~PPSTimingCalibration()

PPSTimingCalibration::~PPSTimingCalibration ( )
default

Member Function Documentation

◆ formula()

const std::string& PPSTimingCalibration::formula ( ) const
inline

◆ parameters()

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

Definition at line 31 of file PPSTimingCalibration.cc.

32  {
33  Key key{key1, key2, key3, key4};
34  auto out = parameters_.find(key);
35  if (out == parameters_.end())
36  return {};
37  return out->second;

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

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

◆ serialize()

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

◆ timeOffset()

double PPSTimingCalibration::timeOffset ( int  key1,
int  key2,
int  key3,
int  key4 = -1 
) const

Definition at line 39 of file PPSTimingCalibration.cc.

40  {
41  Key key{key1, key2, key3, key4};
42  auto out = timeInfo_.find(key);
43  if (out == timeInfo_.end())
44  return 0.;
45  return out->second.first;

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

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

◆ timePrecision()

double PPSTimingCalibration::timePrecision ( int  key1,
int  key2,
int  key3,
int  key4 = -1 
) const

Definition at line 47 of file PPSTimingCalibration.cc.

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.second;

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

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 57 of file PPSTimingCalibration.h.

◆ cond::serialization::access

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

Definition at line 57 of file PPSTimingCalibration.h.

◆ operator<<

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

Definition at line 55 of file PPSTimingCalibration.cc.

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

Member Data Documentation

◆ formula_

std::string PPSTimingCalibration::formula_
private

Definition at line 53 of file PPSTimingCalibration.h.

Referenced by PPSTimingCalibration().

◆ parameters_

ParametersMap PPSTimingCalibration::parameters_
private

◆ timeInfo_

TimingMap PPSTimingCalibration::timeInfo_
private

Definition at line 55 of file PPSTimingCalibration.h.

Referenced by timeOffset(), and timePrecision().

mps_fire.i
i
Definition: mps_fire.py:355
PPSTimingCalibration::parameters_
ParametersMap parameters_
Definition: PPSTimingCalibration.h:54
PPSTimingCalibration::formula_
std::string formula_
Definition: PPSTimingCalibration.h:53
Key
Definition: GoldenPattern.h:15
PPSTimingCalibration::timeOffset
double timeOffset(int key1, int key2, int key3, int key4=-1) const
Definition: PPSTimingCalibration.cc:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PPSTimingCalibration::timeInfo_
TimingMap timeInfo_
Definition: PPSTimingCalibration.h:55
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ntuplemaker.time
time
Definition: ntuplemaker.py:310
crabWrapper.key
key
Definition: crabWrapper.py:19