test
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 
5 
6 #include <vector>
7 #include <algorithm>
8 #include <stdint.h>
9 #include <sstream>
10 #include <boost/bind/bind.hpp>
11 
13 
25 {
26  public:
27 
29 
30  // Defined as public for genreflex
31  struct Delay
32  {
33  Delay(const uint32_t inputDetId, const uint16_t inputCoarseDelay, const uint16_t inputFineDelay) :
34  detId(inputDetId),
35  coarseDelay(inputCoarseDelay),
36  fineDelay(inputFineDelay)
37  {}
39  Delay() :
40  detId(0),
41  coarseDelay(255),
42  fineDelay(255)
43  {}
44  uint32_t detId;
45  unsigned char coarseDelay;
46  unsigned char fineDelay;
47 
49 };
50  typedef std::vector<Delay>::iterator delayIt;
51  typedef std::vector<Delay>::const_iterator delayConstIt;
52 
53  bool put( const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay );
54  uint16_t coarseDelay(const uint32_t detId);
55  uint16_t fineDelay(const uint32_t detId) const;
56  double delay(const uint32_t detId) const;
57 
59  void delays(std::vector<Delay> & delays) const
60  {
61  delays = delays_;
62  }
63 
65  void detIds(std::vector<uint32_t> & detIdVector) const;
66 
68  inline uint32_t delaysSize() const
69  {
70  return delays_.size();
71  }
72 
74  void printSummary(std::stringstream & ss) const;
76  void printDebug(std::stringstream & ss) const;
77 
78  private:
79 
80  inline double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
81  {
82  return( coarseDelay*25 + fineDelay*(25/24.) );
83  }
84 
85  std::vector<Delay> delays_;
86 
88 };
89 
90 #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...
#define COND_SERIALIZABLE
Definition: Serializable.h:30
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.