CMS 3D CMS Logo

L1RPCConeBuilder.h
Go to the documentation of this file.
1 #ifndef CondFormats_RPCObjects_L1RPCConeBuilder_h
2 #define CondFormats_RPCObjects_L1RPCConeBuilder_h
3 // -*- C++ -*-
4 //
5 // Package: RPCObjects
6 // Class : L1RPCConeBuilder
7 //
16 //
17 // Original Author: Tomasz Fruboes
18 // Created: Fri Feb 22 12:27:02 CET 2008
19 // $Id: L1RPCConeBuilder.h,v 1.8 2009/03/20 15:10:53 michals Exp $
20 //
21 
23 
24 #include <vector>
25 #include <map>
26 #include <cstdint>
27 #include <cstdlib>
29 #include <memory>
30 #include <boost/serialization/shared_ptr.hpp>
31 
33 public:
34  // uncompressed connections
35  struct TStripCon {
36  signed char m_tower;
37  unsigned char m_PAC;
38  unsigned char m_logplane;
39  unsigned char m_logstrip;
40 
42  };
43  typedef std::vector<TStripCon> TStripConVec;
44  typedef std::map<unsigned char, TStripConVec> TStrip2ConVec;
45  typedef std::map<uint32_t, TStrip2ConVec> TConMap;
46 
47  // compressed connections
48  struct TCompressedCon {
49  signed char m_tower;
50  signed char m_mul;
51  unsigned char m_PAC;
52  unsigned char m_logplane;
53  unsigned char m_validForStripFirst;
54  unsigned char m_validForStripLast;
55  signed short m_offset;
56 
58  : m_tower(99),
59  m_mul(99),
60  m_PAC(0),
61  m_logplane(99),
64  m_offset(-1000){};
65 
66  int getLogStrip(int strip, const L1RPCConeDefinition::TLPSizeVec& LPSizeVec) const {
67  int ret = -1;
69  ret = int(m_mul) * strip + int(m_offset);
70 
71  int lpSize = -1;
72  L1RPCConeDefinition::TLPSizeVec::const_iterator it = LPSizeVec.begin();
73  L1RPCConeDefinition::TLPSizeVec::const_iterator itEnd = LPSizeVec.end();
74  for (; it != itEnd; ++it) {
75  if (it->m_tower != std::abs(m_tower) || it->m_LP != m_logplane - 1)
76  continue;
77  lpSize = it->m_size;
78  }
79 
80  //FIXME
81  if (lpSize == -1) {
82  //throw cms::Exception("getLogStrip") << " lpSize==-1\n";
83  }
84 
85  //if (ret<0 || ret > LPSizesInTowers.at(std::abs(m_tower)).at(m_logplane-1) )
86  if (ret < 0 || ret > lpSize)
87  return -1;
88  }
89  return ret;
90  }
91 
92  void addStrip(unsigned char strip) {
93  if (m_validForStripFirst == 0) {
96  } else if (strip < m_validForStripFirst) {
98  } else if (strip > m_validForStripLast) {
100  }
101  }
102 
104  };
105 
106  typedef std::vector<TCompressedCon> TCompressedConVec;
107  typedef std::map<uint32_t, TCompressedConVec> TCompressedConMap;
108 
110  virtual ~L1RPCConeBuilder();
111 
112  void setConeConnectionMap(const std::shared_ptr<TConMap> connMap) { m_coneConnectionMap = connMap; };
113 
114  void setCompressedConeConnectionMap(const std::shared_ptr<TCompressedConMap> cmpConnMap) {
115  m_compressedConeConnectionMap = cmpConnMap;
116  };
117 
118  std::pair<TStripConVec::const_iterator, TStripConVec::const_iterator> getConVec(uint32_t det,
119  unsigned char strip) const;
120 
121  std::pair<TCompressedConVec::const_iterator, TCompressedConVec::const_iterator> getCompConVec(uint32_t det) const;
122 
123  void setFirstTower(int tow) { m_firstTower = tow; };
124  void setLastTower(int tow) { m_lastTower = tow; };
125 
126 private:
127  int m_firstTower;
129 
130  std::shared_ptr<TConMap> m_coneConnectionMap;
131  std::shared_ptr<TCompressedConMap> m_compressedConeConnectionMap;
132 
134 };
135 
136 #endif
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
L1RPCConeBuilder::TStripCon::m_logplane
unsigned char m_logplane
Definition: L1RPCConeBuilder.h:38
L1RPCConeBuilder::TStripCon::m_logstrip
unsigned char m_logstrip
Definition: L1RPCConeBuilder.h:39
L1RPCConeBuilder::setLastTower
void setLastTower(int tow)
Definition: L1RPCConeBuilder.h:124
L1RPCConeBuilder::setConeConnectionMap
void setConeConnectionMap(const std::shared_ptr< TConMap > connMap)
Definition: L1RPCConeBuilder.h:112
L1RPCConeBuilder::TStripCon::m_PAC
unsigned char m_PAC
Definition: L1RPCConeBuilder.h:37
L1RPCConeBuilder::TConMap
std::map< uint32_t, TStrip2ConVec > TConMap
Definition: L1RPCConeBuilder.h:45
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
L1RPCConeBuilder::setFirstTower
void setFirstTower(int tow)
Definition: L1RPCConeBuilder.h:123
L1RPCConeBuilder::setCompressedConeConnectionMap
void setCompressedConeConnectionMap(const std::shared_ptr< TCompressedConMap > cmpConnMap)
Definition: L1RPCConeBuilder.h:114
L1RPCConeBuilder::TStripCon::m_tower
signed char m_tower
Definition: L1RPCConeBuilder.h:36
L1RPCConeBuilder::TCompressedConVec
std::vector< TCompressedCon > TCompressedConVec
Definition: L1RPCConeBuilder.h:106
L1RPCConeBuilder::TCompressedCon::getLogStrip
int getLogStrip(int strip, const L1RPCConeDefinition::TLPSizeVec &LPSizeVec) const
Definition: L1RPCConeBuilder.h:66
L1RPCConeBuilder::TCompressedConMap
std::map< uint32_t, TCompressedConVec > TCompressedConMap
Definition: L1RPCConeBuilder.h:107
L1RPCConeBuilder::getConVec
std::pair< TStripConVec::const_iterator, TStripConVec::const_iterator > getConVec(uint32_t det, unsigned char strip) const
Definition: L1RPCConeBuilder.cc:27
L1RPCConeBuilder::~L1RPCConeBuilder
virtual ~L1RPCConeBuilder()
Definition: L1RPCConeBuilder.cc:24
L1RPCConeBuilder::m_compressedConeConnectionMap
std::shared_ptr< TCompressedConMap > m_compressedConeConnectionMap
Definition: L1RPCConeBuilder.h:131
L1RPCConeBuilder::TCompressedCon::addStrip
void addStrip(unsigned char strip)
Definition: L1RPCConeBuilder.h:92
L1RPCConeBuilder::m_coneConnectionMap
std::shared_ptr< TConMap > m_coneConnectionMap
Definition: L1RPCConeBuilder.h:130
L1RPCConeBuilder::TStripConVec
std::vector< TStripCon > TStripConVec
Definition: L1RPCConeBuilder.h:43
L1RPCConeBuilder::TCompressedCon::m_offset
signed short m_offset
Definition: L1RPCConeBuilder.h:55
L1RPCConeBuilder
Definition: L1RPCConeBuilder.h:32
L1RPCConeBuilder::TCompressedCon
Definition: L1RPCConeBuilder.h:48
L1RPCConeBuilder::L1RPCConeBuilder
L1RPCConeBuilder()
Definition: L1RPCConeBuilder.cc:17
L1RPCConeBuilder::TStripCon
Definition: L1RPCConeBuilder.h:35
createfilelist.int
int
Definition: createfilelist.py:10
L1RPCConeBuilder::TCompressedCon::m_validForStripFirst
unsigned char m_validForStripFirst
Definition: L1RPCConeBuilder.h:53
Serializable.h
L1RPCConeBuilder::TCompressedCon::m_PAC
unsigned char m_PAC
Definition: L1RPCConeBuilder.h:51
L1RPCConeBuilder::m_firstTower
int m_firstTower
Definition: L1RPCConeBuilder.h:124
L1RPCConeBuilder::TCompressedCon::TCompressedCon
TCompressedCon()
Definition: L1RPCConeBuilder.h:57
L1RPCConeBuilder::TStrip2ConVec
std::map< unsigned char, TStripConVec > TStrip2ConVec
Definition: L1RPCConeBuilder.h:44
L1RPCConeBuilder::TCompressedCon::m_logplane
unsigned char m_logplane
Definition: L1RPCConeBuilder.h:52
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1RPCConeBuilder::TCompressedCon::m_tower
signed char m_tower
Definition: L1RPCConeBuilder.h:49
L1RPCConeBuilder::TCompressedCon::m_validForStripLast
unsigned char m_validForStripLast
Definition: L1RPCConeBuilder.h:54
L1RPCConeDefinition::TLPSizeVec
std::vector< TLPSize > TLPSizeVec
Definition: L1RPCConeDefinition.h:22
L1RPCConeDefinition.h
L1RPCConeBuilder::m_lastTower
int m_lastTower
Definition: L1RPCConeBuilder.h:128
L1RPCConeBuilder::TCompressedCon::m_mul
signed char m_mul
Definition: L1RPCConeBuilder.h:50
L1RPCConeBuilder::getCompConVec
std::pair< TCompressedConVec::const_iterator, TCompressedConVec::const_iterator > getCompConVec(uint32_t det) const
Definition: L1RPCConeBuilder.cc:45