Go to the documentation of this file.00001 #ifndef SiStripBaseDelay_h
00002 #define SiStripBaseDelay_h
00003
00004 #include <vector>
00005 #include <algorithm>
00006 #include <stdint.h>
00007 #include <sstream>
00008 #include <boost/bind/bind.hpp>
00009
00010 #include "CondFormats/SiStripObjects/interface/SiStripDetSummary.h"
00011
00022 class SiStripBaseDelay
00023 {
00024 public:
00025
00026 SiStripBaseDelay() {}
00027
00028
00029 struct Delay
00030 {
00031 Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay) :
00032 detId(inputDetId),
00033 coarseDelay(inputCoarseDelay),
00034 fineDelay(inputFineDelay)
00035 {}
00037 Delay() :
00038 detId(0),
00039 coarseDelay(255),
00040 fineDelay(255)
00041 {}
00042 uint32_t detId;
00043 unsigned char coarseDelay;
00044 unsigned char fineDelay;
00045 };
00046 typedef std::vector<Delay>::iterator delayIt;
00047 typedef std::vector<Delay>::const_iterator delayConstIt;
00048
00049 bool put( const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay );
00050 uint16_t coarseDelay(const uint32_t detId);
00051 uint16_t fineDelay(const uint32_t detId) const;
00052 double delay(const uint32_t detId) const;
00053
00055 void delays(std::vector<Delay> & delays) const
00056 {
00057 delays = delays_;
00058 }
00059
00061 void detIds(std::vector<uint32_t> & detIdVector) const;
00062
00064 inline uint32_t delaysSize() const
00065 {
00066 return delays_.size();
00067 }
00068
00070 void printSummary(std::stringstream & ss) const;
00072 void printDebug(std::stringstream & ss) const;
00073
00074 private:
00075
00076 inline double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
00077 {
00078 return( coarseDelay*25 + fineDelay*(25/24.) );
00079 }
00080
00081 std::vector<Delay> delays_;
00082 };
00083
00084 #endif