CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/L1Trigger/RPCTrigger/interface/RPCConst.h

Go to the documentation of this file.
00001 #ifndef L1Trigger_RPCConst_h
00002 #define L1Trigger_RPCConst_h
00003 
00004 #ifndef _STAND_ALONE
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 #endif //_STAND_ALONE
00007 
00008 #include <string>
00009 #include <map>
00010 #include <vector>
00011 #include <bitset>
00023 class RPCConst {
00024 
00025 public:
00026 
00027   enum {
00028         ITOW_MIN  = 0,            
00029         ITOW_MAX  = 16,           
00030         //ITOW_MAX_LOWPT  = 7,      //!< Max m_tower number to which low_pt algorithm is used
00031         IPT_MAX = 31,             
00032         NSTRIPS   = 1152,         
00033         NSEG      = NSTRIPS/8,    
00034 
00035         OFFSET    = 5            
00036    };
00037 
00038   //static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
00039   
00040 //-----------------import from L1RpcParameters beg------------------    
00041 
00042     //static const double m_pi = 3.14159265358979;
00043     static const int m_TOWER_COUNT = 16 + 1; 
00044     
00045     static const int m_PT_CODE_MAX = 31; 
00046     
00047     static const int m_LOGPLANES_COUNT = 6; 
00048     
00049     static const int m_LOGPLANE1 = 0; 
00050     static const int m_LOGPLANE2 = 1;
00051     static const int m_LOGPLANE3 = 2;
00052     static const int m_LOGPLANE4 = 3;
00053     static const int m_LOGPLANE5 = 4;
00054     static const int m_LOGPLANE6 = 5;
00055     
00056     static const int m_FIRST_PLANE = m_LOGPLANE1; 
00057     static const int m_LAST_PLANE  = m_LOGPLANE6; 
00058   
00059   /*
00060   
00061     static const int m_TOWER_COUNT = 16 + 1; //!< Only half of the detector.
00062     
00063     static const int m_PT_CODE_MAX; //!< Pt_code range = 0-m_PT_CODE_MAX
00064     
00065     static const int m_LOGPLANES_COUNT = 6; //!< Max Logic Planes Count in trigger towers
00066     
00067     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 
00068     static const int m_LOGPLANE2;
00069     static const int m_LOGPLANE3;
00070     static const int m_LOGPLANE4;
00071     static const int m_LOGPLANE5;
00072     static const int m_LOGPLANE6;
00073     
00074     static const int m_FIRST_PLANE; //!< Use ase a first index in loops.
00075     static const int m_LAST_PLANE; //!< Use ase a last index in loops.
00076     */
00077 
00079     static const std::string m_LOGPLANE_STR[];
00080     
00082     static const unsigned int m_LOGPLANE_SIZE[m_TOWER_COUNT][m_LOGPLANES_COUNT];
00083     
00085     static const int m_REF_PLANE[m_TOWER_COUNT];
00086     
00088     static const int m_USED_PLANES_COUNT[m_TOWER_COUNT];
00089     
00091     static const int m_VLPT_PLANES_COUNT[m_TOWER_COUNT];
00092     
00093     static const int m_VLPT_CUT = 7; 
00094     
00095     static const int m_NOT_CONECTED = 99; 
00096     
00097     
00098     //-------------------------quallity tab-----------------------------------------
00099     //should be moved somwhere else
00100     /*
00101     typedef std::bitset<m_LOGPLANES_COUNT> TQualityBitset; //for quallity tab
00102     
00103     struct bitsetLes : public std::less<TQualityBitset>
00104     {
00105       bool operator() (const TQualityBitset& x, const TQualityBitset& y) const
00106       {
00107         return(x.count() < y.count());
00108       }
00109     };
00110     
00111     typedef std::multimap<TQualityBitset, int , bitsetLes> TQualityTab;
00112     typedef TQualityTab::value_type TQualityTabValueType;
00113     */
00114     typedef std::vector<short> TQualityTab;
00115     typedef std::vector<TQualityTab> TQualityTabsVec;
00116     //----------------------end quallity tab----------------------------------------
00117     
00119     struct l1RpcConeCrdnts {
00120       int m_Tower;
00121       int m_LogSector;
00122       int m_LogSegment;
00123     
00124       l1RpcConeCrdnts() {
00125         m_Tower = 0;
00126         m_LogSector = 0;
00127         m_LogSegment = 0;
00128       }
00129     
00130       l1RpcConeCrdnts(int m_tower, int logSector, int logSegment ) {
00131         m_Tower = m_tower;
00132         m_LogSector = logSector ;
00133         m_LogSegment = logSegment;
00134       }
00135     
00136       int getSegmentNum() {
00137         return m_LogSector * 12 + m_LogSegment;
00138       }
00139       
00140       bool operator < (const l1RpcConeCrdnts& cone) const;
00141     
00142       bool operator == (const l1RpcConeCrdnts& cone) const;
00143     };
00144     
00145     
00146     
00147     /*
00148     class RPCMuonGen {
00149     public:
00150       int m_RunNum, m_EventNum, m_PtCodeGen;
00151       double m_EtaGen, m_PhiGen, m_PtGen;
00152       int m_Sign, m_MaxFiredPlanesCnt;
00153     
00154       int possibleTrigger;
00155 };*/
00156     
00157     //hardware consts - fixed by board design
00158     static const unsigned int m_TOWERS_ON_TB_CNT = 4;      
00159     static const unsigned int m_SEGMENTS_IN_SECTOR_CNT = 12;   
00160     static const unsigned int m_GBPHI_OUT_MUONS_CNT = 4;  
00161     static const unsigned int m_GBETA_OUT_MUONS_CNT = 4;  
00162     static const unsigned int m_TCGB_OUT_MUONS_CNT = 4;   
00163     static const unsigned int m_FINAL_OUT_MUONS_CNT = 4;  
00164     //const that are dependent on trigger configuration (f.e. TBs cnt in TC)
00165     //are in RPCTriggerConfiguration
00166     
00167     
00169     int stringToInt(std::string str);
00170     
00172     std::string intToString(int number);
00173   
00174 //-----------------import from L1RpcParameters end------------------  
00178   static int iptFromPt(const double pt);
00179 
00183   static double ptFromIpt(const int ipt);
00184 
00188   static double etaFromTowerNum(const int atower);
00189 
00193   static int   towerNumFromEta(const double eta);
00194 
00198   static double phiFromSegmentNum(const int iseg);
00199 
00203   static double phiFromLogSegSec(const int logSegment, const int logSector);
00204 
00208   static int segmentNumFromPhi(const double phi);
00209 
00210   /* obsolete
00214   static int checkBarrel(const int atower);
00215   */
00216 
00217   /* obsolete
00221   static const int IPT_THRESHOLD [2][ITOW_MAX+1];
00222   */
00223 
00227   static double vxMuRate(int ptCode);
00228 
00229   static double vxIntegMuRate(int ptCode, double etaFrom, double etaTo);
00230 
00231   static double vxIntegMuRate(int ptCode, int m_tower);
00232 
00233 private:
00237   static const double m_pts[RPCConst::IPT_MAX+1];
00238 
00241   static const double m_etas[RPCConst::ITOW_MAX+2];
00242 
00243  
00244 };
00245 #endif
00246