CMS 3D CMS Logo

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

RPCTBMuon Class Reference

#include <RPCTBMuon.h>

Inheritance diagram for RPCTBMuon:
RPCMuon

List of all members.

Classes

class  FSBOut
class  HSBOut
class  PACOut
class  TBOut
class  TCOut
struct  TMuonMore
 Used in sorting. More...

Public Types

enum  MuonBitsType {
  mbtPACOut, mbtTBSortOut, mbtTCSortOut, mbtHSBOut,
  mbtFSBOut, mbtUnset
}

Public Member Functions

void fromBits (MuonBitsType muonBitsType, unsigned int value)
bool gBDataKilledFirst () const
bool gBDataKilledLast () const
int getCode () const
 Combined quality and ptCode, 8 bits [7...6 m_Quality, 5...1 m_PtCode, 0 sign], used in GhoustBusters.
int getContinSegmAddr () const
int getEtaAddr () const
int getGBData () const
std::string getGBDataBitStr () const
int getPhiAddr () const
int getSectorAddr () const
int getSegmentAddr () const
bool isLive () const
void kill ()
std::string printDebugInfo (int debugFormat) const
 Gives debuging info in human readable format (1) or technicall format (2)
std::string printExtDebugInfo (int, int, int) const
 RPCTBMuon ()
 Empty muon.
 RPCTBMuon (const RPCPacMuon &pacMuon)
 RPCTBMuon (int ptCode, int quality, int sign, int patternNum, unsigned short firedPlanes)
 RPCTBMuon (int ptCode, int quality, int sign, MuonBitsType muonBitsType)
void setAddress (int etaAddr, int phiAddr)
void setAddress (int tbNumber, int tbTower, int phiAddr)
void setCode (int code)
 Sets combined code: 8 bits [7...5 m_Quality, 4...0 m_PtCode].
void setCodeAndEtaAddr (int code, int etaAddr)
void setCodeAndPhiAddr (int code, int phiAddr)
void setEtaAddr (int etaAddr)
void setGBData (unsigned int gbData)
void setGBDataKilledFirst ()
void setGBDataKilledLast ()
void setPhiAddr (int phiAddr)
void setSectorAddr (int sectorAddr)
unsigned int toBits (MuonBitsType muonBitsType) const
unsigned int toBits () const
std::string toString (int format) const
bool wasKilled () const

Private Attributes

unsigned int m_EtaAddress
unsigned int m_GBData
bool m_Killed
 true means that muon was killed during GB
MuonBitsType m_muonBitsType
unsigned int m_PhiAddress

Friends

class FSBOut
class HSBOut
class PACOut
class TBOut
class TCOut

Detailed Description

Used in Ghoust Busters and sorters. Has additionall filds: m_Killed, m_GBData, m_EtaAddress, m_PhiAddress need in these algorithms.

Author:
Karol Bunkowski (Warsaw)

Definition at line 19 of file RPCTBMuon.h.


Member Enumeration Documentation

Enumerator:
mbtPACOut 
mbtTBSortOut 
mbtTCSortOut 
mbtHSBOut 
mbtFSBOut 
mbtUnset 

Definition at line 21 of file RPCTBMuon.h.


Constructor & Destructor Documentation

RPCTBMuon::RPCTBMuon ( )

Empty muon.

Definition at line 14 of file RPCTBMuon.cc.

References m_EtaAddress, m_GBData, m_Killed, and m_PhiAddress.

                    : RPCMuon() {
    m_Killed = false;

    m_GBData = 0;

    m_EtaAddress = 0;
    m_PhiAddress = 0;
}
RPCTBMuon::RPCTBMuon ( int  ptCode,
int  quality,
int  sign,
int  patternNum,
unsigned short  firedPlanes 
)

Definition at line 23 of file RPCTBMuon.cc.

References m_EtaAddress, m_GBData, m_Killed, m_muonBitsType, m_PhiAddress, and mbtUnset.

                                                                    :
    RPCMuon(ptCode, quality, sign, patternNum, firedPlanes) 
{
    m_Killed = false;

    m_GBData = 0;

    m_EtaAddress = 0;
    m_PhiAddress = 0;
    
    m_muonBitsType = mbtUnset;
}
RPCTBMuon::RPCTBMuon ( int  ptCode,
int  quality,
int  sign,
MuonBitsType  muonBitsType 
)

Definition at line 37 of file RPCTBMuon.cc.

References m_EtaAddress, m_GBData, m_Killed, m_muonBitsType, and m_PhiAddress.

                                                                                :
    RPCMuon(ptCode, quality, sign, 0, 0)  {
    m_Killed = false;

    m_GBData = 0;

    m_EtaAddress = 0;
    m_PhiAddress = 0;
    
    m_muonBitsType = muonBitsType;
}
RPCTBMuon::RPCTBMuon ( const RPCPacMuon pacMuon)

Definition at line 187 of file RPCTBMuon.cc.

References m_EtaAddress, m_GBData, m_Killed, and m_PhiAddress.

                                             :
    RPCMuon(pacMuon) 
{
    m_Killed = false;

    m_GBData = 0;

    m_EtaAddress = 0;
    m_PhiAddress = 0;
}

Member Function Documentation

void RPCTBMuon::fromBits ( RPCTBMuon::MuonBitsType  muonBitsType,
unsigned int  value 
)

Definition at line 223 of file RPCTBMuon.cc.

References RPCTBMuon::TCOut::fromBits(), RPCTBMuon::HSBOut::fromBits(), RPCTBMuon::TBOut::fromBits(), RPCTBMuon::FSBOut::fromBits(), RPCTBMuon::PACOut::fromBits(), mbtFSBOut, mbtHSBOut, mbtPACOut, mbtTBSortOut, and mbtTCSortOut.

                                                                               {
  if (muonBitsType == mbtPACOut) {
    PACOut::fromBits(*this, value);
  } 
  else if (muonBitsType == mbtTBSortOut) {
    TBOut::fromBits(*this, value);
  } 
  else if (muonBitsType == mbtTCSortOut) {
    TCOut::fromBits(*this, value);
  } 
  else if (muonBitsType == mbtHSBOut) {
    HSBOut::fromBits(*this, value);
  } 
  else if (muonBitsType == mbtFSBOut) {
    FSBOut::fromBits(*this, value);
  }
  else {
    RPCException("unknown value of muonBitsType");
    //edm::LogError("RPCTrigger")<< "unknown value of where: " + where;
  }
}
bool RPCTBMuon::gBDataKilledFirst ( ) const

Definition at line 161 of file RPCTBMuon.cc.

References m_GBData.

{ return (m_GBData & 1);}
bool RPCTBMuon::gBDataKilledLast ( ) const

Definition at line 163 of file RPCTBMuon.cc.

References m_GBData.

{ return (m_GBData & 2);}
int RPCTBMuon::getCode ( ) const

Combined quality and ptCode, 8 bits [7...6 m_Quality, 5...1 m_PtCode, 0 sign], used in GhoustBusters.

Definition at line 88 of file RPCTBMuon.cc.

References RPCMuon::m_PtCode, RPCMuon::m_Quality, and RPCMuon::m_Sign.

Referenced by RPCTBMuon::TMuonMore::operator()().

                             {  

  // 1 bit, 0 - negative, 1 - positive.
  unsigned int signLocal = 0;
  if (m_Sign==0) signLocal=1; // invert
  return (m_Quality<<6 | m_PtCode << 1 | signLocal);

}
int RPCTBMuon::getContinSegmAddr ( ) const

Definition at line 132 of file RPCTBMuon.cc.

References getSectorAddr(), and getSegmentAddr().

{ return getSectorAddr()*12 + getSegmentAddr();}
int RPCTBMuon::getEtaAddr ( ) const

Definition at line 124 of file RPCTBMuon.cc.

References m_EtaAddress.

Referenced by printDebugInfo().

{ return m_EtaAddress; }
int RPCTBMuon::getGBData ( ) const

Definition at line 144 of file RPCTBMuon.cc.

References m_GBData.

Referenced by printDebugInfo().

{ return m_GBData;}
std::string RPCTBMuon::getGBDataBitStr ( ) const

Definition at line 146 of file RPCTBMuon.cc.

References m_GBData.

                                           {
    std::string str = "00";
    if (m_GBData == 1)
      str = "01";
    else if (m_GBData == 2)
      str = "10";
    else if (m_GBData == 3)
      str = "11";
    return str;  
}
int RPCTBMuon::getPhiAddr ( ) const

Definition at line 126 of file RPCTBMuon.cc.

References m_PhiAddress.

Referenced by printDebugInfo().

{ return m_PhiAddress; }
int RPCTBMuon::getSectorAddr ( ) const

Definition at line 130 of file RPCTBMuon.cc.

References m_PhiAddress.

Referenced by getContinSegmAddr(), and printDebugInfo().

{ return (m_PhiAddress & 0xF0)>>4; }
int RPCTBMuon::getSegmentAddr ( ) const

Definition at line 128 of file RPCTBMuon.cc.

References m_PhiAddress.

Referenced by getContinSegmAddr(), and printDebugInfo().

{ return m_PhiAddress & 15; }
bool RPCTBMuon::isLive ( ) const
Returns:
true = was no-zero muon and was not killed false = is killed or is zero

Definition at line 179 of file RPCTBMuon.cc.

References m_Killed, and RPCMuon::m_PtCode.

                             {
    if(m_PtCode > 0 && !m_Killed)
      return true;
    else return false;
}
void RPCTBMuon::kill ( )

Definition at line 167 of file RPCTBMuon.cc.

References m_Killed.

{ m_Killed = true; }
std::string RPCTBMuon::printDebugInfo ( int  debugFormat) const

Gives debuging info in human readable format (1) or technicall format (2)

Note:
Possible debugFormat codes (1,2) are defined in RPCTrigger constructor

Definition at line 55 of file RPCTBMuon.cc.

References getEtaAddr(), getGBData(), RPCMuon::getLogSector(), RPCMuon::getLogSegment(), getPhiAddr(), RPCMuon::getPtCode(), RPCMuon::getQuality(), getSectorAddr(), getSegmentAddr(), RPCMuon::getSign(), RPCMuon::getTower(), mbtFSBOut, and toBits().

                                                         {

  std::ostringstream sDebugInfo;
  if (debugFormat==1){  // Human readable

    sDebugInfo << "TBMuon: code: " << getPtCode()
               << " etaAddr: " << getEtaAddr()
               << " phiAddr: " << getPhiAddr()
               << " sgAddr: " << getSegmentAddr()
               << " scAddr: " << getSectorAddr()
               << " gbData: " << getGBData();

  }
  else {        //technicall
   sDebugInfo << "TBMuon pt "<< getPtCode() 
              <<   " ql " <<getQuality() 
              <<   " sgn " << getSign()
              <<   " tw " << getTower()
              <<   " sc " << getLogSector()
              <<   " sg " << getLogSegment()
              <<   " phi " << getPhiAddr()
              <<   " eta " << getEtaAddr()
              <<   " gbD " <<  getGBData()
              <<   " bits " << toBits(mbtFSBOut);
  }

  return sDebugInfo.str();

}
std::string RPCTBMuon::printExtDebugInfo ( int  ,
int  ,
int   
) const
void RPCTBMuon::setAddress ( int  etaAddr,
int  phiAddr 
)

Definition at line 110 of file RPCTBMuon.cc.

References m_EtaAddress, and m_PhiAddress.

                                                   { 
     m_EtaAddress = etaAddr;
     m_PhiAddress = phiAddr;
}
void RPCTBMuon::setAddress ( int  tbNumber,
int  tbTower,
int  phiAddr 
)

Definition at line 115 of file RPCTBMuon.cc.

References m_EtaAddress, and m_PhiAddress.

                                                                 {
    m_EtaAddress = (tbNumber<<2) | tbTower;
    m_PhiAddress = phiAddr;
}
void RPCTBMuon::setCode ( int  code)

Sets combined code: 8 bits [7...5 m_Quality, 4...0 m_PtCode].

Definition at line 98 of file RPCTBMuon.cc.

References RPCMuon::m_PtCode, and RPCMuon::m_Quality.

Referenced by setCodeAndEtaAddr(), and setCodeAndPhiAddr().

                                {
    m_Quality = (code & (3<<5))>>5;
    m_PtCode = code & 31;
}
void RPCTBMuon::setCodeAndEtaAddr ( int  code,
int  etaAddr 
)

Definition at line 139 of file RPCTBMuon.cc.

References m_EtaAddress, and setCode().

                                                       {
    setCode(code);
    m_EtaAddress = etaAddr;
}
void RPCTBMuon::setCodeAndPhiAddr ( int  code,
int  phiAddr 
)

Definition at line 134 of file RPCTBMuon.cc.

References m_PhiAddress, and setCode().

                                                       {
    setCode(code);
    m_PhiAddress = phiAddr;
}
void RPCTBMuon::setEtaAddr ( int  etaAddr)

Definition at line 108 of file RPCTBMuon.cc.

References m_EtaAddress.

{ m_EtaAddress = etaAddr;}
void RPCTBMuon::setGBData ( unsigned int  gbData)

Definition at line 120 of file RPCTBMuon.cc.

References m_GBData.

                                             {
        m_GBData = gbData;
}
void RPCTBMuon::setGBDataKilledFirst ( )

Definition at line 157 of file RPCTBMuon.cc.

References m_GBData.

{ m_GBData = m_GBData | 1;}
void RPCTBMuon::setGBDataKilledLast ( )

Definition at line 159 of file RPCTBMuon.cc.

References m_GBData.

{ m_GBData = m_GBData | 2; }
void RPCTBMuon::setPhiAddr ( int  phiAddr)

Definition at line 104 of file RPCTBMuon.cc.

References m_PhiAddress.

{ m_PhiAddress = phiAddr;}
void RPCTBMuon::setSectorAddr ( int  sectorAddr)

Definition at line 106 of file RPCTBMuon.cc.

References m_PhiAddress.

{ m_PhiAddress = m_PhiAddress | sectorAddr<<4;}
unsigned int RPCTBMuon::toBits ( RPCTBMuon::MuonBitsType  muonBitsType) const

Definition at line 200 of file RPCTBMuon.cc.

References mbtFSBOut, mbtHSBOut, mbtPACOut, mbtTBSortOut, mbtTCSortOut, RPCTBMuon::HSBOut::toBits(), RPCTBMuon::TCOut::toBits(), RPCTBMuon::PACOut::toBits(), RPCTBMuon::TBOut::toBits(), and RPCTBMuon::FSBOut::toBits().

                                                                       {
  if (muonBitsType == mbtPACOut) {
    return PACOut::toBits(*this);
  }
  else if (muonBitsType == mbtTBSortOut) {
    return TBOut::toBits(*this);
  }
  else if (muonBitsType == mbtTCSortOut) {
    return TCOut::toBits(*this);
  }
  else if (muonBitsType == mbtHSBOut) {
    return HSBOut::toBits(*this);
  }
  else if (muonBitsType == mbtFSBOut) {
    return FSBOut::toBits(*this);
  }
  else {
    throw RPCException("unknown value of muonBitsType");
    //edm::LogError("RPCTrigger")<<"unknown value of where: " + where;
  } 
  return 0;
}
unsigned int RPCTBMuon::toBits ( ) const [inline]

Definition at line 106 of file RPCTBMuon.h.

References m_muonBitsType.

Referenced by printDebugInfo().

                              {
        return toBits(m_muonBitsType);
  }
std::string RPCTBMuon::toString ( int  format) const

Definition at line 366 of file RPCTBMuon.cc.

References m_EtaAddress, m_PhiAddress, RPCMuon::m_PtCode, RPCMuon::m_Quality, and RPCMuon::m_Sign.

                                              {
  ostringstream ostr;
  if(format == 0) {
         ostr<<"qu "<<m_Quality<<", pt "<<setw(2)<<m_PtCode<<", sig "<<m_Sign
         <<", phi "<<setw(3)<<m_PhiAddress<<", eta "<<setw(2)<<m_EtaAddress;
  }
  else if( format == 1) {
        ostr<<" "<<m_Quality<<" "<<setw(2)<<m_PtCode<<" "<<m_Sign
        <<" "<<setw(3)<<m_PhiAddress<<" "<<setw(2)<<m_EtaAddress;
  }    
  else if( format == 2) {
        ostr<<" "<<m_Quality<<" "<<setw(2)<<m_PtCode<<" "<<m_Sign;
  }    
  
  return ostr.str();
}
bool RPCTBMuon::wasKilled ( ) const
Returns:
true = was non-empty muon and was killed false = was not killed or is zero

Definition at line 171 of file RPCTBMuon.cc.

References m_Killed, and RPCMuon::m_PtCode.

                                {
    if(m_PtCode > 0 && m_Killed)
      return true;
    else return false;
}

Friends And Related Function Documentation

friend class FSBOut [friend]

Definition at line 202 of file RPCTBMuon.h.

friend class HSBOut [friend]

Definition at line 189 of file RPCTBMuon.h.

friend class PACOut [friend]

Definition at line 146 of file RPCTBMuon.h.

friend class TBOut [friend]

Definition at line 161 of file RPCTBMuon.h.

friend class TCOut [friend]

Definition at line 175 of file RPCTBMuon.h.


Member Data Documentation

unsigned int RPCTBMuon::m_EtaAddress [private]
unsigned int RPCTBMuon::m_GBData [private]

2 bits, 0 00 - this muon did not kill nothing on the sector edge 1 01 - this muon killed muon from segment 0 (the "right" sector edge), or is in segment 0 2 10 - this muon killed muon from segment 11 (the "left" sector edge), or is in segment 11 3 11 - this muon killed muon from segment 0 and 11

Definition at line 126 of file RPCTBMuon.h.

Referenced by RPCTBMuon::TCOut::fromBits(), RPCTBMuon::TBOut::fromBits(), gBDataKilledFirst(), gBDataKilledLast(), getGBData(), getGBDataBitStr(), RPCTBMuon(), setGBData(), setGBDataKilledFirst(), setGBDataKilledLast(), RPCTBMuon::TCOut::toBits(), and RPCTBMuon::TBOut::toBits().

bool RPCTBMuon::m_Killed [private]

true means that muon was killed during GB

Definition at line 129 of file RPCTBMuon.h.

Referenced by isLive(), kill(), RPCTBMuon(), and wasKilled().

Definition at line 115 of file RPCTBMuon.h.

Referenced by RPCTBMuon(), and toBits().

unsigned int RPCTBMuon::m_PhiAddress [private]