CMS 3D CMS Logo

RPCConst Class Reference

Class contains number of L1RpcTrigger specific constanst, and transforming methods (eg. More...

#include <L1Trigger/RPCTrigger/interface/RPCConst.h>

List of all members.

Public Types

enum  {
  ITOW_MIN = 0, ITOW_MAX = 16, IPT_MAX = 31, NSTRIPS = 1152,
  NSEG = NSTRIPS/8, OFFSET = 5
}
typedef std::vector< short > TQualityTab
typedef std::vector< TQualityTabTQualityTabsVec

Public Member Functions

std::string intToString (int number)
 Converts inteager number to string.
int stringToInt (std::string str)
 Converts string to inteager number. If string contains chars, that are not digits, throws RPCException.

Static Public Member Functions

static double etaFromTowerNum (const int atower)
 Method converts from m_tower number to eta (gives center of m_tower).
static int iptFromPt (const double pt)
 Method converts pt [Gev/c] into pt bin number (0, 31).
static double phiFromLogSegSec (const int logSegment, const int logSector)
 Method converts from logSegment (0.
static double phiFromSegmentNum (const int iseg)
 Method converts from segment number (0, 144).
static double ptFromIpt (const int ipt)
 Method converts pt bin number (0, 31) to pt [GeV/c].
static int segmentNumFromPhi (const double phi)
 obsolete Method converts phi to segment number (0, 144).
static int towerNumFromEta (const double eta)
 Method converts from eta to trigger m_tower number.
static double vxIntegMuRate (int ptCode, int m_tower)
static double vxIntegMuRate (int ptCode, double etaFrom, double etaTo)
static double vxMuRate (int ptCode)
 Spectrum of muons originating from vertex.

Static Public Attributes

static const unsigned int m_FINAL_OUT_MUONS_CNT = 4
 m_Number of muon candidates return by Final GhostBuster&Sorter
static const int m_FIRST_PLANE = m_LOGPLANE1
 Use ase a first index in loops.
static const unsigned int m_GBETA_OUT_MUONS_CNT = 4
 m_Number of muon candidates return by Trigger Board's eta Ghost Buster
static const unsigned int m_GBPHI_OUT_MUONS_CNT = 4
 m_Number of muon candidates return by Trigger Board's phi Ghost Buster
static const int m_LAST_PLANE = m_LOGPLANE6
 Use ase a last index in loops.
static const int m_LOGPLANE1 = 0
 The Logic Planes are named starting from '1', but in varoius loop indeks are from '0', that's why always use these consts.
static const int m_LOGPLANE2 = 1
static const int m_LOGPLANE3 = 2
static const int m_LOGPLANE4 = 3
static const int m_LOGPLANE5 = 4
static const int m_LOGPLANE6 = 5
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.
static const std::string m_LOGPLANE_STR []
 Log Planes names.
static const int m_LOGPLANES_COUNT = 6
 Max Logic Planes Count in trigger towers.
static const int m_NOT_CONECTED = 99
 Denotes Logic m_Strips that is not valid (f.e. in Patterns denotes, that in given plane the pattern is not defined).
static const int m_PT_CODE_MAX = 31
 Pt_code range = 0-m_PT_CODE_MAX.
static const int m_REF_PLANE [m_TOWER_COUNT]
 Definition of Referenece Plane for each m_Tower.
static const unsigned int m_SEGMENTS_IN_SECTOR_CNT = 12
 m_Number of Logic Segments in one Logic Sector, defines also the number of Logic Cones for one Logic Sector of one m_Tower.
static const unsigned int m_TCGB_OUT_MUONS_CNT = 4
 m_Number of muon candidates return by Trigger Crate's Ghost Buster
static const int m_TOWER_COUNT = 16 + 1
 Only half of the detector.
static const unsigned int m_TOWERS_ON_TB_CNT = 4
 Max number of towers covered by one Trugger Board.
static const int m_USED_PLANES_COUNT [m_TOWER_COUNT]
 m_Number of Logic Planes existing in each m_Tower.
static const int m_VLPT_CUT = 7
 Max Pt code of Very Low Pt patterns.
static const int m_VLPT_PLANES_COUNT [m_TOWER_COUNT]
 m_Number of Logic Planes used for Very Low Pt patterns.

Static Private Attributes

static const double m_etas [RPCConst::ITOW_MAX+2]
 Matrix with approximate upper towers limits.
static const double m_pts [RPCConst::IPT_MAX+1]
 Matrix with pt bins upper limits.

Classes

struct  l1RpcConeCrdnts
 The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment. More...


Detailed Description

Class contains number of L1RpcTrigger specific constanst, and transforming methods (eg.

phi <-> segment number) (Should migrate to DDD?)

Author:
Marcin Konecki, Warsaw Artur Kalinowski, Warsaw

Definition at line 23 of file RPCConst.h.


Member Typedef Documentation

typedef std::vector<short> RPCConst::TQualityTab

Definition at line 114 of file RPCConst.h.

typedef std::vector<TQualityTab> RPCConst::TQualityTabsVec

Definition at line 115 of file RPCConst.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
ITOW_MIN  Minimal number of abs(m_tower_number).
ITOW_MAX  Maximal number of abs(m_tower_number).
IPT_MAX  Max pt bin code.
NSTRIPS  m_Number of Rpc strips in phi direction.
NSEG  m_Number of trigger segments.

One segment covers 8 RPC strips in referencial plane (hardware 2 or 6(2')

OFFSET  Offset of the first trigger phi sector [deg].

Definition at line 27 of file RPCConst.h.

00027        {
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    };


Member Function Documentation

double RPCConst::etaFromTowerNum ( const int  atower  )  [static]

Method converts from m_tower number to eta (gives center of m_tower).

Definition at line 42 of file RPCConst.cc.

References eta, ITOW_MAX, m_etas, and alivecheck_mergeAndRegister::msg.

00042                                                 {
00043 
00044   int iabsitow = (atower >= 0)? atower: -atower;
00045   if (0==iabsitow) return 0.;
00046   if( iabsitow>RPCConst::ITOW_MAX) {
00047     //edm::LogError("RPCTrigger") << "**RPCConst::etaFromTowerNum** iabsitow>ITOW_MAX for m_tower:"
00048     //     << atower ;
00049     std::string msg = "[RPCConst::etaFromTowerNum] iabsitow>ITOW_MAX for m_tower:";
00050     std::ostringstream ostr;
00051     ostr<<atower;
00052     msg += ostr.str();
00053     throw RPCException(msg.c_str());
00054     return 0.;
00055   }
00056   double eta = (m_etas[iabsitow]+m_etas[iabsitow+1])/2.;
00057   return (atower>= 0) ? eta : -eta;
00058 }

std::string RPCConst::intToString ( int  number  ) 

Converts inteager number to string.

Definition at line 251 of file RPCConst.cc.

References tmp.

Referenced by RPCPacData::getPatternsGroupDescription(), RPCPacData::insertPatterns(), and RPCPacData::RPCPacData().

00251                                           {
00252   std::string str;
00253   /* Some problems. AK
00254   std::ostringstream ostr;
00255   ostr<<number;
00256   str = ostr.str();
00257   edm::LogError("RPCTrigger")<<"std::string intToString(int number)";
00258   edm::LogError("RPCTrigger")<<str;
00259   */
00260   char tmp[20];
00261   sprintf(tmp,"%d",number);
00262   str.append(tmp);
00263   return str;
00264 }

int RPCConst::iptFromPt ( const double  pt  )  [static]

Method converts pt [Gev/c] into pt bin number (0, 31).

Definition at line 9 of file RPCConst.cc.

References IPT_MAX, m_pts, and alivecheck_mergeAndRegister::msg.

00009                                        {
00010   if(pt == 0.)return 0;
00011   if(pt<m_pts[0]) {
00012     //edm::LogError("RPCTrigger")<<"** RPCConst ** iptFromPt called with illegal pt="<<pt;
00013     std::string msg = "[RPCConst::iptFromPt] called with illegal pt=";
00014     std::ostringstream ostr;
00015     ostr<<pt;
00016     msg += ostr.str();
00017     throw RPCException(msg.c_str());
00018     return 0;
00019   }
00020  int ipt=RPCConst::IPT_MAX;
00021  while (pt < m_pts[ipt]) { ipt--; };
00022  return ipt;
00023 
00024 }

double RPCConst::phiFromLogSegSec ( const int  logSegment,
const int  logSector 
) [static]

Method converts from logSegment (0.

.11) and logSector(0...11) .

Definition at line 78 of file RPCConst.cc.

References m_pi, NSEG, OFFSET, and phi.

00078                                                                            {
00079   int iseg = logSegment*12 + logSector;
00080   double phi = OFFSET + 2.*m_pi*(iseg)/ (double) RPCConst::NSEG;
00081   return (phi <2.*m_pi) ? phi: phi-2.*m_pi;
00082 }

double RPCConst::phiFromSegmentNum ( const int  iseg  )  [static]

Method converts from segment number (0, 144).

obsolete

Definition at line 73 of file RPCConst.cc.

References m_pi, NSEG, OFFSET, and phi.

00073                                                  {
00074   double phi = OFFSET + 2.*m_pi*(iseg)/ (double) RPCConst::NSEG;
00075   return (phi <2.*m_pi) ? phi: phi-2.*m_pi;
00076 }

double RPCConst::ptFromIpt ( const int  ipt  )  [static]

Method converts pt bin number (0, 31) to pt [GeV/c].

Definition at line 27 of file RPCConst.cc.

References IPT_MAX, m_pts, and alivecheck_mergeAndRegister::msg.

Referenced by vxIntegMuRate(), and vxMuRate().

00027                                         {
00028   
00029   if ( ipt<0 || ipt>RPCConst::IPT_MAX ) {
00030     //edm::LogError("RPCTrigger") <<"**RPCConst::ptFromIpt** problem with ipt: "<<ipt;
00031     std::string msg = "[RPCConst::ptFromIpt] problem with ipt: ";
00032     std::ostringstream ostr;
00033     ostr<<ipt;
00034     msg += ostr.str();
00035     throw RPCException(msg.c_str());
00036     return 0.;
00037   }
00038   else return m_pts[ipt];
00039 }

int RPCConst::segmentNumFromPhi ( const double  phi  )  [static]

obsolete Method converts phi to segment number (0, 144).

Definition at line 84 of file RPCConst.cc.

References int, m_pi, NSEG, and OFFSET.

00084                                                 {
00085   double iphi;
00086   if(phi-OFFSET < 0) {
00087     iphi = 2*m_pi + phi;
00088   }    
00089   else {
00090     iphi = phi-OFFSET;    
00091   }    
00092   int iseg = (int)(iphi * RPCConst::NSEG/(2.*m_pi));
00093   return iseg;
00094 }

int RPCConst::stringToInt ( std::string  str  ) 

Converts string to inteager number. If string contains chars, that are not digits, throws RPCException.

Definition at line 242 of file RPCConst.cc.

References i.

Referenced by RPCPatternsParser::startElement().

00242                                        {
00243   for(unsigned int i = 0; i < str.size(); i++)
00244     if(str[i] < '0' || str[i] > '9')
00245       throw RPCException("Error in stringToInt(): the string cannot be converted to a number");
00246       //edm::LogError("RPCTrigger")<< "Error in stringToInt(): the string cannot be converted to a number";
00247   return atoi(str.c_str());
00248 }

int RPCConst::towerNumFromEta ( const double  eta  )  [static]

Method converts from eta to trigger m_tower number.

Definition at line 61 of file RPCConst.cc.

References ITOW_MAX, and m_etas.

00061                                              {
00062   int m_tower=0;
00063   double abseta = (eta >=0.) ? eta:-eta;
00064   while (m_tower<=ITOW_MAX){
00065       if(m_etas[m_tower] <= abseta && abseta< m_etas[m_tower+1])break;
00066       m_tower++;
00067   }
00068   if(m_tower > ITOW_MAX)
00069     m_tower = ITOW_MAX;
00070   return (eta>=0) ? m_tower:-m_tower; 
00071 }

double RPCConst::vxIntegMuRate ( int  ptCode,
int  m_tower 
) [static]

Definition at line 144 of file RPCConst.cc.

References funct::abs(), m_etas, and vxIntegMuRate().

00144                                                       {  
00145   //calkowanie metoda trapezow - nie do konca dobre
00146   double rate = vxIntegMuRate(ptCode, RPCConst::m_etas[abs(m_tower)], RPCConst::m_etas[abs(m_tower)+1]);
00147 
00148   //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
00149   return rate;
00150 }

double RPCConst::vxIntegMuRate ( int  ptCode,
double  etaFrom,
double  etaTo 
) [static]

Definition at line 131 of file RPCConst.cc.

References ptFromIpt(), and vxMuRate().

Referenced by vxIntegMuRate().

00131                                                                        {  
00132   //calkowanie metoda trapezow - nie do konca dobre
00133   double rate = 0.5 * (vxMuRate(ptCode) + vxMuRate(ptCode+1))*
00134                (RPCConst::ptFromIpt(ptCode + 1) - RPCConst::ptFromIpt(ptCode));
00135 
00136   rate = rate * (etaTo - etaFrom);
00137 
00138   //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
00139   return rate;
00140 }

double RPCConst::vxMuRate ( int  ptCode  )  [static]

Spectrum of muons originating from vertex.

See CMS-TN-1995/150

Definition at line 107 of file RPCConst.cc.

References a, funct::exp(), ptFromIpt(), and s2.

Referenced by vxIntegMuRate().

00107                                     {  
00108   double pt_ev = RPCConst::ptFromIpt(ptCode);
00109   if (pt_ev == 0)
00110     return 0.0;
00111   const double lum = 2.0e33; //defoult is 1.0e34;
00112   const double dabseta = 1.0;
00113   const double dpt = 1.0;
00114   const double afactor = 1.0e-34*lum*dabseta*dpt;
00115   const double a  = 2*1.3084E6;
00116   const double mu=-0.725;
00117   const double sigma=0.4333;
00118   const double s2=2*sigma*sigma;
00119   
00120   double ptlog10;
00121   ptlog10 = log10(pt_ev);
00122   double ex = (ptlog10-mu)*(ptlog10-mu)/s2;
00123   double rate = (a * exp(-ex) * afactor); 
00124 
00125   //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
00126   return rate;
00127 }


Member Data Documentation

const double RPCConst::m_etas [static, private]

Initial value:

                                         {0.00, 0.07, 0.27, 0.44, 0.58, 0.72,
                                          0.83, 0.93, 1.04, 1.14, 1.24, 1.36,
                                          1.48, 1.61, 1.73, 1.85, 1.97, 2.10}
Matrix with approximate upper towers limits.

Only positive ones are reported, for negative ones mirror symmetry assumed.

Definition at line 241 of file RPCConst.h.

Referenced by etaFromTowerNum(), towerNumFromEta(), and vxIntegMuRate().

const unsigned int RPCConst::m_FINAL_OUT_MUONS_CNT = 4 [static]

m_Number of muon candidates return by Final GhostBuster&Sorter

Definition at line 163 of file RPCConst.h.

Referenced by RPCFinalSorter::runFinalSorter(), and RPCHalfSorter::runHalf().

const int RPCConst::m_FIRST_PLANE = m_LOGPLANE1 [static]

Use ase a first index in loops.

Definition at line 56 of file RPCConst.h.

Referenced by RPCLogCone::getCompressedCone(), RPCLogCone::getFiredPlanesCnt(), RPCLogCone::possibleTrigger(), RPCLogCone::RPCLogCone(), RPCPac::runEnergeticPatternsGroups(), RPCPac::runTrackPatternsGroup(), RPCLogCone::shift(), RPCLogCone::toString(), and TPatternsGroup::updateShape().

const unsigned int RPCConst::m_GBETA_OUT_MUONS_CNT = 4 [static]

m_Number of muon candidates return by Trigger Board's eta Ghost Buster

Definition at line 161 of file RPCConst.h.

Referenced by RPCTBGhostBuster::gBEta().

const unsigned int RPCConst::m_GBPHI_OUT_MUONS_CNT = 4 [static]

m_Number of muon candidates return by Trigger Board's phi Ghost Buster

Definition at line 160 of file RPCConst.h.

Referenced by RPCTBGhostBuster::gBPhi().

const int RPCConst::m_LAST_PLANE = m_LOGPLANE6 [static]

Use ase a last index in loops.

Definition at line 57 of file RPCConst.h.

Referenced by RPCLogCone::shift(), RPCLogCone::toString(), and TPatternsGroup::updateShape().

const int RPCConst::m_LOGPLANE1 = 0 [static]

The Logic Planes are named starting from '1', but in varoius loop indeks are from '0', that's why always use these consts.

Definition at line 49 of file RPCConst.h.

const int RPCConst::m_LOGPLANE2 = 1 [static]

Definition at line 50 of file RPCConst.h.

const int RPCConst::m_LOGPLANE3 = 2 [static]

Definition at line 51 of file RPCConst.h.

const int RPCConst::m_LOGPLANE4 = 3 [static]

Definition at line 52 of file RPCConst.h.

Referenced by RPCLogCone::possibleTrigger().

const int RPCConst::m_LOGPLANE5 = 4 [static]

Definition at line 53 of file RPCConst.h.

const int RPCConst::m_LOGPLANE6 = 5 [static]

Definition at line 54 of file RPCConst.h.

const unsigned int RPCConst::m_LOGPLANE_SIZE [static]

Initial value:

 {
    
              {72, 56,  8, 40, 40, 24}, 
              {72, 56,  8, 40, 40, 24}, 
              {72, 56,  8, 40, 40, 24}, 
              {72, 56,  8, 40, 40, 24}, 
              {72, 56,  8, 40, 40, 24}, 
              {72, 56, 40,  8, 40, 24}, 
              {56, 72, 40,  8, 24,  0}, 
              {72, 56, 40,  8, 24,  0}, 
              {72, 24, 40,  8,  0,  0}, 
              {72,  8, 40,  0,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}, 
              {72,  8, 40, 24,  0,  0}  
    }
Definition of Logic Cone Sizes - number of Logic m_Strips in each plane.

Definition at line 82 of file RPCConst.h.

Referenced by RPCLogCone::getCompressedCone(), RPCLogCone::RPCLogCone(), RPCPac::runEnergeticPatternsGroups(), RPCLogCone::shift(), and RPCLogCone::toString().

const std::string RPCConst::m_LOGPLANE_STR [static]

Initial value:

 {
      "m_LOGPLANE1", "m_LOGPLANE2", "m_LOGPLANE3", "m_LOGPLANE4", "m_LOGPLANE5", "m_LOGPLANE6"
    }
Log Planes names.

Definition at line 79 of file RPCConst.h.

Referenced by RPCLogCone::toString().

const int RPCConst::m_LOGPLANES_COUNT = 6 [static]

Max Logic Planes Count in trigger towers.

Definition at line 47 of file RPCConst.h.

Referenced by RPCPacData::insertQualityRecord(), and RPCLogCone::RPCLogCone().

const int RPCConst::m_NOT_CONECTED = 99 [static]

Denotes Logic m_Strips that is not valid (f.e. in Patterns denotes, that in given plane the pattern is not defined).

Definition at line 95 of file RPCConst.h.

Referenced by RPCPac::runEnergeticPatternsGroups(), RPCPac::runTrackPatternsGroup(), and TPatternsGroup::updateShape().

const int RPCConst::m_PT_CODE_MAX = 31 [static]

Pt_code range = 0-m_PT_CODE_MAX.

Definition at line 45 of file RPCConst.h.

const double RPCConst::m_pts [static, private]

Initial value:

{
                        0.0,  0.01,    
                        1.5,  2.0, 2.5,  3.0,  3.5,  4.0,  4.5, 
                        5.,   6.,   7.,   8.,  
                        10.,  12., 14.,  16.,  18.,  
                        20.,  25.,  30., 35.,  40.,  45., 
                        50.,  60.,  70., 80.,  90.,  100., 120., 140.}
Matrix with pt bins upper limits.

Definition at line 237 of file RPCConst.h.

Referenced by iptFromPt(), and ptFromIpt().

const int RPCConst::m_REF_PLANE [static]

Initial value:

 {
    
      m_LOGPLANE3, m_LOGPLANE3, m_LOGPLANE3, m_LOGPLANE3, m_LOGPLANE3,
    
      m_LOGPLANE4,  m_LOGPLANE4, m_LOGPLANE4, m_LOGPLANE4,
    
      m_LOGPLANE2, m_LOGPLANE2, m_LOGPLANE2, m_LOGPLANE2, m_LOGPLANE2,  m_LOGPLANE2, m_LOGPLANE2, m_LOGPLANE2
    }
Definition of Referenece Plane for each m_Tower.

Definition at line 85 of file RPCConst.h.

const unsigned int RPCConst::m_SEGMENTS_IN_SECTOR_CNT = 12 [static]

m_Number of Logic Segments in one Logic Sector, defines also the number of Logic Cones for one Logic Sector of one m_Tower.

Definition at line 159 of file RPCConst.h.

Referenced by RPCTBGhostBuster::gBPhi(), RPCHalfSorter::runHalf(), and RPCTriggerBoard::runTBGB().

const unsigned int RPCConst::m_TCGB_OUT_MUONS_CNT = 4 [static]

m_Number of muon candidates return by Trigger Crate's Ghost Buster

Definition at line 162 of file RPCConst.h.

Referenced by RPCTCGhostBusterSorter::run().

const int RPCConst::m_TOWER_COUNT = 16 + 1 [static]

Only half of the detector.

Definition at line 43 of file RPCConst.h.

Referenced by RPCPacManager< RPCPacData >::init(), RPCTriggerConfig::produce(), and popcon::L1RPCConfigSourceHandler::readConfig().

const unsigned int RPCConst::m_TOWERS_ON_TB_CNT = 4 [static]

Max number of towers covered by one Trugger Board.

Definition at line 158 of file RPCConst.h.

Referenced by RPCTriggerBoard::runTBGB().

const int RPCConst::m_USED_PLANES_COUNT [static]

Initial value:

 {
    
      6, 6, 6, 6, 6, 6, 5, 5, 4, 3, 4,  4,  4,  4,  4,  4,  4
    }
m_Number of Logic Planes existing in each m_Tower.

Definition at line 88 of file RPCConst.h.

Referenced by RPCLogCone::getCompressedCone(), RPCLogCone::getFiredPlanesCnt(), RPCLogCone::possibleTrigger(), RPCLogCone::RPCLogCone(), RPCPac::runEnergeticPatternsGroups(), and RPCPac::runTrackPatternsGroup().

const int RPCConst::m_VLPT_CUT = 7 [static]

Max Pt code of Very Low Pt patterns.

Definition at line 93 of file RPCConst.h.

const int RPCConst::m_VLPT_PLANES_COUNT [static]

Initial value:

 {
      4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3,  3,  3,  3,  3,  3,  3
    }
m_Number of Logic Planes used for Very Low Pt patterns.

Definition at line 91 of file RPCConst.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:54 2009 for CMSSW by  doxygen 1.5.4