CMS 3D CMS Logo

RPCConst.h
Go to the documentation of this file.
1 #ifndef L1Trigger_RPCConst_h
2 #define L1Trigger_RPCConst_h
3 
4 #ifndef _STAND_ALONE
6 #endif //_STAND_ALONE
7 
8 #include <string>
9 #include <map>
10 #include <vector>
11 #include <bitset>
23 class RPCConst {
24 public:
25  enum {
26  ITOW_MIN = 0,
27  ITOW_MAX = 16,
28  //ITOW_MAX_LOWPT = 7, //!< Max m_tower number to which low_pt algorithm is used
29  IPT_MAX = 31,
30  NSTRIPS = 1152,
31  NSEG = NSTRIPS / 8,
32  OFFSET = 5
34  };
35 
36  //static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
37 
38  //-----------------import from L1RpcParameters beg------------------
39 
40  //static const double m_pi = 3.14159265358979;
41  static const int m_TOWER_COUNT = 16 + 1;
42 
43  static const int m_PT_CODE_MAX = 31;
44 
45  static const int m_LOGPLANES_COUNT = 6;
46 
47  static const int m_LOGPLANE1 =
48  0;
49  static const int m_LOGPLANE2 = 1;
50  static const int m_LOGPLANE3 = 2;
51  static const int m_LOGPLANE4 = 3;
52  static const int m_LOGPLANE5 = 4;
53  static const int m_LOGPLANE6 = 5;
54 
55  static const int m_FIRST_PLANE = m_LOGPLANE1;
56  static const int m_LAST_PLANE = m_LOGPLANE6;
57 
58  /*
59 
60  static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
61 
62  static const int m_PT_CODE_MAX; //!< Pt_code range = 0-m_PT_CODE_MAX
63 
64  static const int m_LOGPLANES_COUNT = 6; //!< Max Logic Planes Count in trigger towers
65 
66  static const int m_LOGPLANE1; //!< The Logic Planes are named starting from '1', but in varoius loop indeks are from '0', that's why always use these consts
67  static const int m_LOGPLANE2;
68  static const int m_LOGPLANE3;
69  static const int m_LOGPLANE4;
70  static const int m_LOGPLANE5;
71  static const int m_LOGPLANE6;
72 
73  static const int m_FIRST_PLANE; //!< Use ase a first index in loops.
74  static const int m_LAST_PLANE; //!< Use ase a last index in loops.
75  */
76 
78  static const std::string m_LOGPLANE_STR[];
79 
81  static const unsigned int m_LOGPLANE_SIZE[m_TOWER_COUNT][m_LOGPLANES_COUNT];
82 
84  static const int m_REF_PLANE[m_TOWER_COUNT];
85 
88 
91 
92  static const int m_VLPT_CUT = 7;
93 
94  static const int m_NOT_CONECTED =
95  99;
96 
97  //-------------------------quallity tab-----------------------------------------
98  //should be moved somwhere else
99  /*
100  typedef std::bitset<m_LOGPLANES_COUNT> TQualityBitset; //for quallity tab
101 
102  struct bitsetLes : public std::less<TQualityBitset>
103  {
104  bool operator() (const TQualityBitset& x, const TQualityBitset& y) const
105  {
106  return(x.count() < y.count());
107  }
108  };
109 
110  typedef std::multimap<TQualityBitset, int , bitsetLes> TQualityTab;
111  typedef TQualityTab::value_type TQualityTabValueType;
112  */
113  typedef std::vector<short> TQualityTab;
114  typedef std::vector<TQualityTab> TQualityTabsVec;
115  //----------------------end quallity tab----------------------------------------
116 
119  int m_Tower;
122 
124  m_Tower = 0;
125  m_LogSector = 0;
126  m_LogSegment = 0;
127  }
128 
129  l1RpcConeCrdnts(int m_tower, int logSector, int logSegment) {
130  m_Tower = m_tower;
131  m_LogSector = logSector;
132  m_LogSegment = logSegment;
133  }
134 
135  int getSegmentNum() { return m_LogSector * 12 + m_LogSegment; }
136 
137  bool operator<(const l1RpcConeCrdnts& cone) const;
138 
139  bool operator==(const l1RpcConeCrdnts& cone) const;
140  };
141 
142  /*
143  class RPCMuonGen {
144  public:
145  int m_RunNum, m_EventNum, m_PtCodeGen;
146  double m_EtaGen, m_PhiGen, m_PtGen;
147  int m_Sign, m_MaxFiredPlanesCnt;
148 
149  int possibleTrigger;
150 };*/
151 
152  //hardware consts - fixed by board design
153  static const unsigned int m_TOWERS_ON_TB_CNT = 4;
154  static const unsigned int m_SEGMENTS_IN_SECTOR_CNT =
155  12;
156  static const unsigned int m_GBPHI_OUT_MUONS_CNT =
157  4;
158  static const unsigned int m_GBETA_OUT_MUONS_CNT =
159  4;
160  static const unsigned int m_TCGB_OUT_MUONS_CNT =
161  4;
162  static const unsigned int m_FINAL_OUT_MUONS_CNT =
163  4;
164  //const that are dependent on trigger configuration (f.e. TBs cnt in TC)
165  //are in RPCTriggerConfiguration
166 
169 
172 
173  //-----------------import from L1RpcParameters end------------------
177  static int iptFromPt(const double pt);
178 
182  static double ptFromIpt(const int ipt);
183 
187  static double etaFromTowerNum(const int atower);
188 
192  static int towerNumFromEta(const double eta);
193 
197  static double phiFromSegmentNum(const int iseg);
198 
202  static double phiFromLogSegSec(const int logSegment, const int logSector);
203 
207  static int segmentNumFromPhi(const double phi);
208 
209  /* obsolete
213  static int checkBarrel(const int atower);
214  */
215 
216  /* obsolete
220  static const int IPT_THRESHOLD [2][ITOW_MAX+1];
221  */
222 
226  static double vxMuRate(int ptCode);
227 
228  static double vxIntegMuRate(int ptCode, double etaFrom, double etaTo);
229 
230  static double vxIntegMuRate(int ptCode, int m_tower);
231 
232 private:
236  static const double m_pts[RPCConst::IPT_MAX + 1];
237 
240  static const double m_etas[RPCConst::ITOW_MAX + 2];
241 };
242 #endif
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:87
static const int m_LOGPLANE6
Definition: RPCConst.h:53
static const unsigned int m_GBETA_OUT_MUONS_CNT
m_Number of muon candidates return by Trigger Board&#39;s eta Ghost Buster
Definition: RPCConst.h:158
l1RpcConeCrdnts(int m_tower, int logSector, int logSegment)
Definition: RPCConst.h:129
static const unsigned int m_TCGB_OUT_MUONS_CNT
m_Number of muon candidates return by Trigger Crate&#39;s Ghost Buster
Definition: RPCConst.h:160
static const int m_VLPT_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes used for Very Low Pt patterns.
Definition: RPCConst.h:90
static const int m_LOGPLANE2
Definition: RPCConst.h:49
static const unsigned int m_FINAL_OUT_MUONS_CNT
m_Number of muon candidates return by Final GhostBuster&Sorter
Definition: RPCConst.h:162
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:118
Minimal number of abs(m_tower_number)
Definition: RPCConst.h:26
static const int m_LAST_PLANE
Use ase a last index in loops.
Definition: RPCConst.h:56
static const int m_LOGPLANE1
The Logic Planes are named starting from &#39;1&#39;, but in varoius loop indeks are from &#39;0&#39;...
Definition: RPCConst.h:47
Offset of the first trigger phi sector [deg].
Definition: RPCConst.h:33
static const int m_REF_PLANE[m_TOWER_COUNT]
Definition of Referenece Plane for each m_Tower.
Definition: RPCConst.h:84
static double vxMuRate(int ptCode)
Definition: RPCConst.cc:106
static const int m_VLPT_CUT
Max Pt code of Very Low Pt patterns.
Definition: RPCConst.h:92
static const int m_LOGPLANE4
Definition: RPCConst.h:51
static const std::string m_LOGPLANE_STR[]
Log Planes names.
Definition: RPCConst.h:78
static const unsigned int m_SEGMENTS_IN_SECTOR_CNT
m_Number of Logic Segments in one Logic Sector, defines also the number of Logic Cones for one Logic ...
Definition: RPCConst.h:154
static const unsigned int m_GBPHI_OUT_MUONS_CNT
m_Number of muon candidates return by Trigger Board&#39;s phi Ghost Buster
Definition: RPCConst.h:156
static double phiFromLogSegSec(const int logSegment, const int logSector)
Definition: RPCConst.cc:78
bool operator<(const l1RpcConeCrdnts &cone) const
Definition: RPCConst.cc:279
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:264
static const int m_LOGPLANE3
Definition: RPCConst.h:50
Maximal number of abs(m_tower_number)
Definition: RPCConst.h:27
static const double m_etas[RPCConst::ITOW_MAX+2]
Definition: RPCConst.h:240
static const unsigned int m_LOGPLANE_SIZE[m_TOWER_COUNT][m_LOGPLANES_COUNT]
Definition of Logic Cone Sizes - number of Logic m_Strips in each plane.
Definition: RPCConst.h:81
static const int m_TOWER_COUNT
Only half of the detector.
Definition: RPCConst.h:41
static const int m_FIRST_PLANE
Use ase a first index in loops.
Definition: RPCConst.h:55
static const unsigned int m_TOWERS_ON_TB_CNT
Max number of towers covered by one Trugger Board.
Definition: RPCConst.h:153
static double phiFromSegmentNum(const int iseg)
Definition: RPCConst.cc:73
static double ptFromIpt(const int ipt)
Definition: RPCConst.cc:29
static const int m_PT_CODE_MAX
Pt_code range = 0-m_PT_CODE_MAX.
Definition: RPCConst.h:43
static const int m_LOGPLANES_COUNT
Max Logic Planes Count in trigger towers.
Definition: RPCConst.h:45
std::vector< short > TQualityTab
Definition: RPCConst.h:113
static double etaFromTowerNum(const int atower)
Definition: RPCConst.cc:42
static int segmentNumFromPhi(const double phi)
Definition: RPCConst.cc:84
static double vxIntegMuRate(int ptCode, double etaFrom, double etaTo)
Definition: RPCConst.cc:130
static const double m_pts[RPCConst::IPT_MAX+1]
Definition: RPCConst.h:236
static int towerNumFromEta(const double eta)
Definition: RPCConst.cc:60
std::vector< TQualityTab > TQualityTabsVec
Definition: RPCConst.h:114
static int iptFromPt(const double pt)
Definition: RPCConst.cc:10
#define str(s)
m_Number of Rpc strips in phi direction.
Definition: RPCConst.h:30
bool operator==(const l1RpcConeCrdnts &cone) const
Definition: RPCConst.cc:290
static const int m_NOT_CONECTED
Denotes Logic m_Strips that is not valid (f.e. in Patterns denotes, that in given plane the pattern i...
Definition: RPCConst.h:94
Max pt bin code.
Definition: RPCConst.h:29
static const int m_LOGPLANE5
Definition: RPCConst.h:52
int stringToInt(std::string str)
Converts string to inteager number. If string contains chars, that are not digits, throws RPCException.
Definition: RPCConst.cc:255