CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PPSTimingCalibrationLUT.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of CTPPS offline software.
4  * Authors:
5  * Christopher Misan
6  * Filip Dej
7  * Laurent Forthomme
8  *
9  ****************************************************************************/
10 
12 #include <ostream>
13 
14 //--------------------------------------------------------------------------
15 
17  if (sector == rhs.sector) {
18  if (station == rhs.station) {
19  if (plane == rhs.plane)
20  return channel < rhs.channel;
21  return plane < rhs.plane;
22  }
23  return station < rhs.station;
24  }
25  return sector < rhs.sector;
26 }
27 
28 std::ostream& operator<<(std::ostream& os, const PPSTimingCalibrationLUT::Key& key) {
29  return os << key.sector << " " << key.station << " " << key.plane << " " << key.channel;
30 }
31 
32 //--------------------------------------------------------------------------
33 
34 std::vector<double> PPSTimingCalibrationLUT::bins(int key1, int key2, int key3, int key4) const {
35  Key key{key1, key2, key3, key4};
36  auto out = binMap_.find(key);
37  if (out == binMap_.end())
38  return {};
39  return out->second;
40 }
41 
42 std::ostream& operator<<(std::ostream& os, const PPSTimingCalibrationLUT& data) {
43  os << "\nSECTOR STATION PLANE CHANNEL SAMPLES \n";
44  for (const auto& kv : data.binMap_) {
45  os << kv.first << "\n[";
46  for (size_t i = 0; i < kv.second.size(); ++i)
47  os << (i > 0 ? ", " : "") << kv.second.at(i);
48  os << " ]\n";
49  }
50  return os;
51 }
friend std::ostream & operator<<(std::ostream &os, const PPSTimingCalibrationLUT &data)
std::vector< double > bins(int key1, int key2, int key3, int key4) const
key
prepare the HTCondor submission files and eventually submit them
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
Helper structure for indexing calibration data.
bool operator<(const Key &rhs) const
Comparison operator.