File indexing completed on 2024-04-06 12:02:39
0001 #ifndef SiStripBaseDelay_h
0002 #define SiStripBaseDelay_h
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005
0006 #include <algorithm>
0007 #include <cstdint>
0008 #include <sstream>
0009 #include <vector>
0010
0011 #include "CondFormats/SiStripObjects/interface/SiStripDetSummary.h"
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 class SiStripBaseDelay {
0024 public:
0025 SiStripBaseDelay() {}
0026
0027
0028 struct Delay {
0029 Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay)
0030 : detId(inputDetId), coarseDelay(inputCoarseDelay), fineDelay(inputFineDelay) {}
0031
0032 Delay() : detId(0), coarseDelay(255), fineDelay(255) {}
0033 uint32_t detId;
0034 unsigned char coarseDelay;
0035 unsigned char fineDelay;
0036
0037 COND_SERIALIZABLE;
0038 };
0039 typedef std::vector<Delay>::iterator delayIt;
0040 typedef std::vector<Delay>::const_iterator delayConstIt;
0041
0042 bool put(const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay);
0043 uint16_t coarseDelay(const uint32_t detId);
0044 uint16_t fineDelay(const uint32_t detId) const;
0045 double delay(const uint32_t detId) const;
0046
0047
0048 void delays(std::vector<Delay>& delays) const { delays = delays_; }
0049
0050
0051 void detIds(std::vector<uint32_t>& detIdVector) const;
0052
0053
0054 inline uint32_t delaysSize() const { return delays_.size(); }
0055
0056
0057 void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
0058
0059 void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
0060
0061 private:
0062 inline double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const {
0063 return (coarseDelay * 25 + fineDelay * (25 / 24.));
0064 }
0065
0066 std::vector<Delay> delays_;
0067
0068 COND_SERIALIZABLE;
0069 };
0070
0071 #endif