CMS 3D CMS Logo

SiStripBaseDelay.h
Go to the documentation of this file.
1 #ifndef SiStripBaseDelay_h
2 #define SiStripBaseDelay_h
3 
5 
6 #include <algorithm>
7 #include <cstdint>
8 #include <sstream>
9 #include <vector>
10 
12 
24 public:
26 
27  // Defined as public for genreflex
28  struct Delay {
29  Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay)
30  : detId(inputDetId), coarseDelay(inputCoarseDelay), fineDelay(inputFineDelay) {}
32  Delay() : detId(0), coarseDelay(255), fineDelay(255) {}
33  uint32_t detId;
34  unsigned char coarseDelay;
35  unsigned char fineDelay;
36 
38  };
39  typedef std::vector<Delay>::iterator delayIt;
40  typedef std::vector<Delay>::const_iterator delayConstIt;
41 
42  bool put(const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay);
43  uint16_t coarseDelay(const uint32_t detId);
44  uint16_t fineDelay(const uint32_t detId) const;
45  double delay(const uint32_t detId) const;
46 
48  void delays(std::vector<Delay>& delays) const { delays = delays_; }
49 
51  void detIds(std::vector<uint32_t>& detIdVector) const;
52 
54  inline uint32_t delaysSize() const { return delays_.size(); }
55 
57  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
59  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
60 
61 private:
62  inline double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const {
63  return (coarseDelay * 25 + fineDelay * (25 / 24.));
64  }
65 
66  std::vector<Delay> delays_;
67 
69 };
70 
71 #endif
uint16_t coarseDelay(const uint32_t detId)
void delays(std::vector< Delay > &delays) const
Fill the input container with all the delays.
double delay(const uint32_t detId) const
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
void detIds(std::vector< uint32_t > &detIdVector) const
Get the list of all detIds for which a delay is stored.
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the average value of the delays for all layers and wheels in the SiStripTracker.
std::vector< Delay >::iterator delayIt
uint16_t fineDelay(const uint32_t detId) const
bool put(const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay)
std::vector< Delay >::const_iterator delayConstIt
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the delays for all the detIds.
Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay)
uint32_t delaysSize() const
Get the total number of delays stored (should equal the total number of modules in the SiStripTracker...
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< Delay > delays_
Delay()
Default constructor needed by genreflex.