CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripBaseDelay.h
Go to the documentation of this file.
1 #ifndef SiStripBaseDelay_h
2 #define SiStripBaseDelay_h
3 
4 #include <vector>
5 #include <algorithm>
6 #include <stdint.h>
7 #include <sstream>
8 #include <boost/bind/bind.hpp>
9 
11 
23 {
24  public:
25 
27 
28  // Defined as public for genreflex
29  struct Delay
30  {
31  Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay) :
32  detId(inputDetId),
33  coarseDelay(inputCoarseDelay),
34  fineDelay(inputFineDelay)
35  {}
37  Delay() :
38  detId(0),
39  coarseDelay(255),
40  fineDelay(255)
41  {}
42  uint32_t detId;
43  unsigned char coarseDelay;
44  unsigned char fineDelay;
45  };
46  typedef std::vector<Delay>::iterator delayIt;
47  typedef std::vector<Delay>::const_iterator delayConstIt;
48 
49  bool put( const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay );
50  uint16_t coarseDelay(const uint32_t detId);
51  uint16_t fineDelay(const uint32_t detId) const;
52  double delay(const uint32_t detId) const;
53 
55  void delays(std::vector<Delay> & delays) const
56  {
57  delays = delays_;
58  }
59 
61  void detIds(std::vector<uint32_t> & detIdVector) const;
62 
64  inline uint32_t delaysSize() const
65  {
66  return delays_.size();
67  }
68 
70  void printSummary(std::stringstream & ss) const;
72  void printDebug(std::stringstream & ss) const;
73 
74  private:
75 
76  inline double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
77  {
78  return( coarseDelay*25 + fineDelay*(25/24.) );
79  }
80 
81  std::vector<Delay> delays_;
82 };
83 
84 #endif
uint16_t coarseDelay(const uint32_t detId)
std::vector< Delay >::iterator delayIt
bool put(const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay)
std::vector< Delay >::const_iterator delayConstIt
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
void printSummary(std::stringstream &ss) const
Prints the average value of the delays for all layers and wheels in the SiStripTracker.
double delay(const uint32_t detId) const
void printDebug(std::stringstream &ss) const
Prints the delays for all the detIds.
Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay)
void delays(std::vector< Delay > &delays) const
Fill the input container with all the delays.
uint32_t delaysSize() const
Get the total number of delays stored (should equal the total number of modules in the SiStripTracker...
uint16_t fineDelay(const uint32_t detId) const
void detIds(std::vector< uint32_t > &detIdVector) const
Get the list of all detIds for which a delay is stored.
std::vector< Delay > delays_
Delay()
Default constructor needed by genreflex.