CMS 3D CMS Logo

SiStripDelay.h
Go to the documentation of this file.
1 #ifndef SiStripObjects_SiStripDelay_h
2 #define SiStripObjects_SiStripDelay_h
3 // -*- C++ -*-
4 //
5 // Package: SiStripObjects
6 // Class : SiStripDelay
7 //
29 #include <memory>
30 #include <unordered_map>
31 #include <vector>
32 
33 class SiStripDelay {
34 public:
36  virtual ~SiStripDelay(){};
37 
38  SiStripDelay(const SiStripDelay &) = delete;
39  const SiStripDelay &operator=(const SiStripDelay &) = delete;
40 
41  inline SiStripDelay(const SiStripBaseDelay &baseDelay,
42  const int sumSign,
43  const std::pair<std::string, std::string> &recordLabelPair) {
44  fillNewDelay(baseDelay, sumSign, recordLabelPair);
45  }
46 
47  void fillNewDelay(const SiStripBaseDelay &baseDelay,
48  const int sumSign,
49  const std::pair<std::string, std::string> &recordLabelPair);
50 
52  float getDelay(const uint32_t detId) const;
53 
55  bool makeDelay();
56 
58  void clear();
59 
66  inline const SiStripBaseDelay *getBaseDelay(const uint32_t index) const { return baseDelayVector_[index]; }
67 
68  inline size_t getNumberOfTags() const { return baseDelayVector_.size(); }
69  inline std::string getRcdName(const uint32_t index) const { return recordLabelPair_[index].first; }
70  inline std::string getLabelName(const uint32_t index) const { return recordLabelPair_[index].second; }
71  inline int getTagSign(const uint32_t index) const { return sumSignVector_[index]; }
72 
75  void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
77  void printDebug(std::stringstream &ss, const TrackerTopology *tTopo) const;
78 
79 private:
80  // ---------- member data --------------------------------
81 
82  std::vector<const SiStripBaseDelay *> baseDelayVector_;
83  std::vector<int> sumSignVector_;
84  std::vector<std::pair<std::string, std::string>> recordLabelPair_;
85  std::unordered_map<uint32_t, double> delays_;
86 };
87 
88 #endif
const SiStripBaseDelay * getBaseDelay(const uint32_t index) const
Definition: SiStripDelay.h:66
int getTagSign(const uint32_t index) const
Definition: SiStripDelay.h:71
void fillNewDelay(const SiStripBaseDelay &baseDelay, const int sumSign, const std::pair< std::string, std::string > &recordLabelPair)
Definition: SiStripDelay.cc:17
std::vector< std::pair< std::string, std::string > > recordLabelPair_
Definition: SiStripDelay.h:84
std::vector< const SiStripBaseDelay * > baseDelayVector_
Definition: SiStripDelay.h:82
size_t getNumberOfTags() const
Definition: SiStripDelay.h:68
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
void printDebug(std::stringstream &ss, const TrackerTopology *tTopo) const
Prints the delays for all the detIds.
std::string getRcdName(const uint32_t index) const
Definition: SiStripDelay.h:69
bool makeDelay()
Builds the boost::unordered_map.
Definition: SiStripDelay.cc:33
std::string getLabelName(const uint32_t index) const
Definition: SiStripDelay.h:70
void clear()
Empty all the containers.
virtual ~SiStripDelay()
Definition: SiStripDelay.h:36
const SiStripDelay & operator=(const SiStripDelay &)=delete
std::vector< int > sumSignVector_
Definition: SiStripDelay.h:83
SiStripDelay(const SiStripBaseDelay &baseDelay, const int sumSign, const std::pair< std::string, std::string > &recordLabelPair)
Definition: SiStripDelay.h:41
float getDelay(const uint32_t detId) const
Return the delay combining all the baseDelays.
Definition: SiStripDelay.cc:25
std::unordered_map< uint32_t, double > delays_
Definition: SiStripDelay.h:85