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