CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
25 public:
26 
27  enum {
28  ITOW_MIN = 0,
29  ITOW_MAX = 16,
30  //ITOW_MAX_LOWPT = 7, //!< Max m_tower number to which low_pt algorithm is used
31  IPT_MAX = 31,
32  NSTRIPS = 1152,
33  NSEG = NSTRIPS/8,
34  OFFSET = 5
36  };
37 
38  //static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
39 
40 //-----------------import from L1RpcParameters beg------------------
41 
42  //static const double m_pi = 3.14159265358979;
43  static const int m_TOWER_COUNT = 16 + 1;
44 
45  static const int m_PT_CODE_MAX = 31;
46 
47  static const int m_LOGPLANES_COUNT = 6;
48 
49  static const int m_LOGPLANE1 = 0;
50  static const int m_LOGPLANE2 = 1;
51  static const int m_LOGPLANE3 = 2;
52  static const int m_LOGPLANE4 = 3;
53  static const int m_LOGPLANE5 = 4;
54  static const int m_LOGPLANE6 = 5;
55 
56  static const int m_FIRST_PLANE = m_LOGPLANE1;
57  static const int m_LAST_PLANE = m_LOGPLANE6;
58 
59  /*
60 
61  static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
62 
63  static const int m_PT_CODE_MAX; //!< Pt_code range = 0-m_PT_CODE_MAX
64 
65  static const int m_LOGPLANES_COUNT = 6; //!< Max Logic Planes Count in trigger towers
66 
67  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
68  static const int m_LOGPLANE2;
69  static const int m_LOGPLANE3;
70  static const int m_LOGPLANE4;
71  static const int m_LOGPLANE5;
72  static const int m_LOGPLANE6;
73 
74  static const int m_FIRST_PLANE; //!< Use ase a first index in loops.
75  static const int m_LAST_PLANE; //!< Use ase a last index in loops.
76  */
77 
79  static const std::string m_LOGPLANE_STR[];
80 
82  static const unsigned int m_LOGPLANE_SIZE[m_TOWER_COUNT][m_LOGPLANES_COUNT];
83 
85  static const int m_REF_PLANE[m_TOWER_COUNT];
86 
89 
92 
93  static const int m_VLPT_CUT = 7;
94 
95  static const int m_NOT_CONECTED = 99;
96 
97 
98  //-------------------------quallity tab-----------------------------------------
99  //should be moved somwhere else
100  /*
101  typedef std::bitset<m_LOGPLANES_COUNT> TQualityBitset; //for quallity tab
102 
103  struct bitsetLes : public std::less<TQualityBitset>
104  {
105  bool operator() (const TQualityBitset& x, const TQualityBitset& y) const
106  {
107  return(x.count() < y.count());
108  }
109  };
110 
111  typedef std::multimap<TQualityBitset, int , bitsetLes> TQualityTab;
112  typedef TQualityTab::value_type TQualityTabValueType;
113  */
114  typedef std::vector<short> TQualityTab;
115  typedef std::vector<TQualityTab> TQualityTabsVec;
116  //----------------------end quallity tab----------------------------------------
117 
120  int m_Tower;
123 
125  m_Tower = 0;
126  m_LogSector = 0;
127  m_LogSegment = 0;
128  }
129 
130  l1RpcConeCrdnts(int m_tower, int logSector, int logSegment ) {
131  m_Tower = m_tower;
132  m_LogSector = logSector ;
133  m_LogSegment = logSegment;
134  }
135 
137  return m_LogSector * 12 + m_LogSegment;
138  }
139 
140  bool operator < (const l1RpcConeCrdnts& cone) const;
141 
142  bool operator == (const l1RpcConeCrdnts& cone) const;
143  };
144 
145 
146 
147  /*
148  class RPCMuonGen {
149  public:
150  int m_RunNum, m_EventNum, m_PtCodeGen;
151  double m_EtaGen, m_PhiGen, m_PtGen;
152  int m_Sign, m_MaxFiredPlanesCnt;
153 
154  int possibleTrigger;
155 };*/
156 
157  //hardware consts - fixed by board design
158  static const unsigned int m_TOWERS_ON_TB_CNT = 4;
159  static const unsigned int m_SEGMENTS_IN_SECTOR_CNT = 12;
160  static const unsigned int m_GBPHI_OUT_MUONS_CNT = 4;
161  static const unsigned int m_GBETA_OUT_MUONS_CNT = 4;
162  static const unsigned int m_TCGB_OUT_MUONS_CNT = 4;
163  static const unsigned int m_FINAL_OUT_MUONS_CNT = 4;
164  //const that are dependent on trigger configuration (f.e. TBs cnt in TC)
165  //are in RPCTriggerConfiguration
166 
167 
169  int stringToInt(std::string str);
170 
173 
174 //-----------------import from L1RpcParameters end------------------
178  static int iptFromPt(const double pt);
179 
183  static double ptFromIpt(const int ipt);
184 
188  static double etaFromTowerNum(const int atower);
189 
193  static int towerNumFromEta(const double eta);
194 
198  static double phiFromSegmentNum(const int iseg);
199 
203  static double phiFromLogSegSec(const int logSegment, const int logSector);
204 
208  static int segmentNumFromPhi(const double phi);
209 
210  /* obsolete
214  static int checkBarrel(const int atower);
215  */
216 
217  /* obsolete
221  static const int IPT_THRESHOLD [2][ITOW_MAX+1];
222  */
223 
227  static double vxMuRate(int ptCode);
228 
229  static double vxIntegMuRate(int ptCode, double etaFrom, double etaTo);
230 
231  static double vxIntegMuRate(int ptCode, int m_tower);
232 
233 private:
237  static const double m_pts[RPCConst::IPT_MAX+1];
238 
241  static const double m_etas[RPCConst::ITOW_MAX+2];
242 
243 
244 };
245 #endif
246 
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:88
static const int m_LOGPLANE6
Definition: RPCConst.h:54
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:161
l1RpcConeCrdnts(int m_tower, int logSector, int logSegment)
Definition: RPCConst.h:130
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:162
static const int m_VLPT_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes used for Very Low Pt patterns.
Definition: RPCConst.h:91
static const int m_LOGPLANE2
Definition: RPCConst.h:50
static const unsigned int m_FINAL_OUT_MUONS_CNT
m_Number of muon candidates return by Final GhostBuster&amp;Sorter
Definition: RPCConst.h:163
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:119
static const int m_LAST_PLANE
Use ase a last index in loops.
Definition: RPCConst.h:57
bool operator<(const l1RpcConeCrdnts &cone) const
Definition: RPCConst.cc:267
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:49
static const int m_REF_PLANE[m_TOWER_COUNT]
Definition of Referenece Plane for each m_Tower.
Definition: RPCConst.h:85
bool operator==(const l1RpcConeCrdnts &cone) const
Definition: RPCConst.cc:278
T eta() const
static double vxMuRate(int ptCode)
Definition: RPCConst.cc:108
static const int m_VLPT_CUT
Max Pt code of Very Low Pt patterns.
Definition: RPCConst.h:93
static const int m_LOGPLANE4
Definition: RPCConst.h:52
static const std::string m_LOGPLANE_STR[]
Log Planes names.
Definition: RPCConst.h:79
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:159
m_Number of Rpc strips in phi direction.
Definition: RPCConst.h:32
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:160
static double phiFromLogSegSec(const int logSegment, const int logSector)
Definition: RPCConst.cc:79
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:252
static const int m_LOGPLANE3
Definition: RPCConst.h:51
static const double m_etas[RPCConst::ITOW_MAX+2]
Definition: RPCConst.h:241
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:82
static const int m_TOWER_COUNT
Only half of the detector.
Definition: RPCConst.h:43
static const int m_FIRST_PLANE
Use ase a first index in loops.
Definition: RPCConst.h:56
static const unsigned int m_TOWERS_ON_TB_CNT
Max number of towers covered by one Trugger Board.
Definition: RPCConst.h:158
static double phiFromSegmentNum(const int iseg)
Definition: RPCConst.cc:74
static double ptFromIpt(const int ipt)
Definition: RPCConst.cc:28
static const int m_PT_CODE_MAX
Pt_code range = 0-m_PT_CODE_MAX.
Definition: RPCConst.h:45
static const int m_LOGPLANES_COUNT
Max Logic Planes Count in trigger towers.
Definition: RPCConst.h:47
std::vector< short > TQualityTab
Definition: RPCConst.h:114
static double etaFromTowerNum(const int atower)
Definition: RPCConst.cc:43
static int segmentNumFromPhi(const double phi)
Definition: RPCConst.cc:85
static double vxIntegMuRate(int ptCode, double etaFrom, double etaTo)
Definition: RPCConst.cc:132
static const double m_pts[RPCConst::IPT_MAX+1]
Definition: RPCConst.h:237
Maximal number of abs(m_tower_number)
Definition: RPCConst.h:29
static int towerNumFromEta(const double eta)
Definition: RPCConst.cc:62
std::vector< TQualityTab > TQualityTabsVec
Definition: RPCConst.h:115
Minimal number of abs(m_tower_number)
Definition: RPCConst.h:28
static int iptFromPt(const double pt)
Definition: RPCConst.cc:10
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:95
static const int m_LOGPLANE5
Definition: RPCConst.h:53
Max pt bin code.
Definition: RPCConst.h:31
Offset of the first trigger phi sector [deg].
Definition: RPCConst.h:35
Definition: DDAxes.h:10
int stringToInt(std::string str)
Converts string to inteager number. If string contains chars, that are not digits, throws RPCException.
Definition: RPCConst.cc:243