CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Attributes

RPCConst Class Reference

#include <RPCConst.h>

List of all members.

Classes

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

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)
static int iptFromPt (const double pt)
static double phiFromLogSegSec (const int logSegment, const int logSector)
static double phiFromSegmentNum (const int iseg)
static double ptFromIpt (const int ipt)
static int segmentNumFromPhi (const double phi)
static int towerNumFromEta (const double eta)
static double vxIntegMuRate (int ptCode, double etaFrom, double etaTo)
static double vxIntegMuRate (int ptCode, int m_tower)
static double vxMuRate (int ptCode)

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]
static const double m_pts [RPCConst::IPT_MAX+1]

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.

       {
        ITOW_MIN  = 0,            
        ITOW_MAX  = 16,           
        //ITOW_MAX_LOWPT  = 7,      //!< Max m_tower number to which low_pt algorithm is used
        IPT_MAX = 31,             
        NSTRIPS   = 1152,         
        NSEG      = NSTRIPS/8,    

        OFFSET    = 5            
   };

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 43 of file RPCConst.cc.

References eta, ITOW_MAX, m_etas, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

                                                {

  int iabsitow = (atower >= 0)? atower: -atower;
  if (0==iabsitow) return 0.;
  if( iabsitow>RPCConst::ITOW_MAX) {
    //edm::LogError("RPCTrigger") << "**RPCConst::etaFromTowerNum** iabsitow>ITOW_MAX for m_tower:"
    //     << atower ;
    std::string msg = "[RPCConst::etaFromTowerNum] iabsitow>ITOW_MAX for m_tower:";
    std::ostringstream ostr;
    ostr<<atower;
    msg += ostr.str();
    throw RPCException(msg.c_str());
    return 0.;
  }
  double eta = (m_etas[iabsitow]+m_etas[iabsitow+1])/2.;
  return (atower>= 0) ? eta : -eta;
}
std::string RPCConst::intToString ( int  number)

Converts inteager number to string.

Definition at line 252 of file RPCConst.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

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

                                          {
  std::string str;
  /* Some problems. AK
  std::ostringstream ostr;
  ostr<<number;
  str = ostr.str();
  edm::LogError("RPCTrigger")<<"std::string intToString(int number)";
  edm::LogError("RPCTrigger")<<str;
  */
  char tmp[20];
  sprintf(tmp,"%d",number);
  str.append(tmp);
  return str;
}
int RPCConst::iptFromPt ( const double  pt) [static]

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

Definition at line 10 of file RPCConst.cc.

References IPT_MAX, m_pts, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

                                       {
  if(pt == 0.)return 0;
  if(pt<m_pts[0]) {
    //edm::LogError("RPCTrigger")<<"** RPCConst ** iptFromPt called with illegal pt="<<pt;
    std::string msg = "[RPCConst::iptFromPt] called with illegal pt=";
    std::ostringstream ostr;
    ostr<<pt;
    msg += ostr.str();
    throw RPCException(msg.c_str());
    return 0;
  }
 int ipt=RPCConst::IPT_MAX;
 while (pt < m_pts[ipt]) { ipt--; };
 return ipt;

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

Method converts from logSegment (0..11) and logSector(0...11) .

Definition at line 79 of file RPCConst.cc.

References m_pi, NSEG, OFFSET, and phi.

                                                                           {
  int iseg = logSegment*12 + logSector;
  double phi = OFFSET + 2.*m_pi*(iseg)/ (double) RPCConst::NSEG;
  return (phi <2.*m_pi) ? phi: phi-2.*m_pi;
}
double RPCConst::phiFromSegmentNum ( const int  iseg) [static]

Method converts from segment number (0, 144). obsolete

Definition at line 74 of file RPCConst.cc.

References m_pi, NSEG, OFFSET, and phi.

                                                 {
  double phi = OFFSET + 2.*m_pi*(iseg)/ (double) RPCConst::NSEG;
  return (phi <2.*m_pi) ? phi: phi-2.*m_pi;
}
double RPCConst::ptFromIpt ( const int  ipt) [static]

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

Definition at line 28 of file RPCConst.cc.

References IPT_MAX, m_pts, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by vxIntegMuRate(), and vxMuRate().

                                        {
  
  if ( ipt<0 || ipt>RPCConst::IPT_MAX ) {
    //edm::LogError("RPCTrigger") <<"**RPCConst::ptFromIpt** problem with ipt: "<<ipt;
    std::string msg = "[RPCConst::ptFromIpt] problem with ipt: ";
    std::ostringstream ostr;
    ostr<<ipt;
    msg += ostr.str();
    throw RPCException(msg.c_str());
    return 0.;
  }
  else return m_pts[ipt];
}
int RPCConst::segmentNumFromPhi ( const double  phi) [static]

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

Definition at line 85 of file RPCConst.cc.

References createXMLFile::iphi, m_pi, NSEG, OFFSET, and phi.

                                                {
  double iphi;
  if(phi-OFFSET < 0) {
    iphi = 2*m_pi + phi;
  }    
  else {
    iphi = phi-OFFSET;    
  }    
  int iseg = (int)(iphi * RPCConst::NSEG/(2.*m_pi));
  return iseg;
}
int RPCConst::stringToInt ( std::string  str)

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

Definition at line 243 of file RPCConst.cc.

References i.

Referenced by RPCPatternsParser::startElement().

                                       {
  for(unsigned int i = 0; i < str.size(); i++)
    if(str[i] < '0' || str[i] > '9')
      throw RPCException("Error in stringToInt(): the string cannot be converted to a number");
      //edm::LogError("RPCTrigger")<< "Error in stringToInt(): the string cannot be converted to a number";
  return atoi(str.c_str());
}
int RPCConst::towerNumFromEta ( const double  eta) [static]

Method converts from eta to trigger m_tower number.

Definition at line 62 of file RPCConst.cc.

References eta, ITOW_MAX, and m_etas.

Referenced by RPCPhiEff::analyze().

                                             {
  int m_tower=0;
  double abseta = (eta >=0.) ? eta:-eta;
  while (m_tower<=ITOW_MAX){
      if(m_etas[m_tower] <= abseta && abseta< m_etas[m_tower+1])break;
      m_tower++;
  }
  if(m_tower > ITOW_MAX)
    m_tower = ITOW_MAX;
  return (eta>=0) ? m_tower:-m_tower; 
}
double RPCConst::vxIntegMuRate ( int  ptCode,
double  etaFrom,
double  etaTo 
) [static]

Definition at line 132 of file RPCConst.cc.

References ptFromIpt(), RPCpg::rate(), and vxMuRate().

Referenced by vxIntegMuRate().

                                                                       {  
  //calkowanie metoda trapezow - nie do konca dobre
  double rate = 0.5 * (vxMuRate(ptCode) + vxMuRate(ptCode+1))*
               (RPCConst::ptFromIpt(ptCode + 1) - RPCConst::ptFromIpt(ptCode));

  rate = rate * (etaTo - etaFrom);

  //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
  return rate;
}
double RPCConst::vxIntegMuRate ( int  ptCode,
int  m_tower 
) [static]

Definition at line 145 of file RPCConst.cc.

References abs, m_etas, RPCpg::rate(), and vxIntegMuRate().

                                                      {  
  //calkowanie metoda trapezow - nie do konca dobre
  double rate = vxIntegMuRate(ptCode, RPCConst::m_etas[abs(m_tower)], RPCConst::m_etas[abs(m_tower)+1]);

  //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
  return rate;
}
double RPCConst::vxMuRate ( int  ptCode) [static]

Spectrum of muons originating from vertex. See CMS-TN-1995/150

Definition at line 108 of file RPCConst.cc.

References a, funct::exp(), RPCpg::mu, ptFromIpt(), RPCpg::rate(), and indexGen::s2.

Referenced by vxIntegMuRate().

                                    {  
  double pt_ev = RPCConst::ptFromIpt(ptCode);
  if (pt_ev == 0)
    return 0.0;
  const double lum = 2.0e33; //defoult is 1.0e34;
  const double dabseta = 1.0;
  const double dpt = 1.0;
  const double afactor = 1.0e-34*lum*dabseta*dpt;
  const double a  = 2*1.3084E6;
  const double mu=-0.725;
  const double sigma=0.4333;
  const double s2=2*sigma*sigma;
  
  double ptlog10;
  ptlog10 = log10(pt_ev);
  double ex = (ptlog10-mu)*(ptlog10-mu)/s2;
  double rate = (a * exp(-ex) * afactor); 

  //edm::LogError("RPCTrigger")<<ptCode<<" "<<rate;//<<<<<<<<<<<<<<<<<<<<<<<<
  return rate;
}

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]
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(), 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:

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(), and RPCTriggerConfig::produce().

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.