CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

L1CaloGeometry Class Reference

#include <L1TriggerConfig/L1Geometry/interface/L1CaloGeometry.h>

List of all members.

Public Types

enum  Versions { kOrig, kAddedMHTPhi, kNumVersions }

Public Member Functions

double emJetPhiBinCenter (unsigned int phiIndex) const
double emJetPhiBinCenter (const L1CaloRegionDetId &detId) const
double emJetPhiBinHighEdge (unsigned int phiIndex) const
double emJetPhiBinHighEdge (const L1CaloRegionDetId &detId) const
double emJetPhiBinLowEdge (const L1CaloRegionDetId &detId) const
double emJetPhiBinLowEdge (unsigned int phiIndex) const
unsigned int emJetPhiIndex (const double &phiValue) const
double etaBinCenter (const L1CaloRegionDetId &detId) const
double etaBinCenter (unsigned int etaIndex, bool central=true) const
double etaBinHighEdge (const L1CaloRegionDetId &detId) const
double etaBinHighEdge (unsigned int etaIndex, bool central=true) const
double etaBinLowEdge (const L1CaloRegionDetId &detId) const
double etaBinLowEdge (unsigned int etaIndex, bool central=true) const
unsigned int etaIndex (const double &etaValue) const
unsigned int etaSignBitOffset () const
double etSumPhiBinCenter (unsigned int phiIndex) const
double etSumPhiBinHighEdge (unsigned int phiIndex) const
double etSumPhiBinLowEdge (unsigned int phiIndex) const
unsigned int etSumPhiIndex (const double &phiValue) const
double globalEtaBinCenter (unsigned int globalEtaIndex) const
double globalEtaBinHighEdge (unsigned int globalEtaIndex) const
double globalEtaBinLowEdge (unsigned int globalEtaIndex) const
unsigned int globalEtaIndex (const double &etaValue) const
double htSumPhiBinCenter (unsigned int phiIndex) const
double htSumPhiBinHighEdge (unsigned int phiIndex) const
double htSumPhiBinLowEdge (unsigned int phiIndex) const
unsigned int htSumPhiIndex (const double &phiValue) const
 L1CaloGeometry ()
 L1CaloGeometry (unsigned int numberGctEmJetPhiBins, double gctEmJetPhiBinOffset, unsigned int numberGctEtSumPhiBins, double gctEtSumPhiBinOffset, unsigned int numberGctHtSumPhiBins, double gctHtSumPhiBinOffset, unsigned int numberGctCentralEtaBinsPerHalf, unsigned int numberGctForwardEtaBinsPerHalf, unsigned int etaSignBitOffset, const std::vector< double > &gctEtaBinBoundaries)
unsigned int numberGctCentralEtaBinsPerHalf () const
unsigned int numberGctEmJetPhiBins () const
unsigned int numberGctEtSumPhiBins () const
unsigned int numberGctForwardEtaBinsPerHalf () const
unsigned int numberGctHtSumPhiBins () const
unsigned int version () const
virtual ~L1CaloGeometry ()

Private Attributes

unsigned int m_etaBinsPerHalf
unsigned int m_etaSignBitOffset
double m_gctEmJetPhiBinWidth
double m_gctEmJetPhiOffset
std::vector< double > m_gctEtaBinBoundaries
double m_gctEtSumPhiBinWidth
double m_gctEtSumPhiOffset
double m_gctHtSumPhiBinWidth
double m_gctHtSumPhiOffset
unsigned int m_numberGctCentralEtaBinsPerHalf
unsigned int m_numberGctEmJetPhiBins
unsigned int m_numberGctEtSumPhiBins
unsigned int m_numberGctForwardEtaBinsPerHalf
unsigned int m_numberGctHtSumPhiBins
unsigned int m_version

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 31 of file L1CaloGeometry.h.


Member Enumeration Documentation

Enumerator:
kOrig 
kAddedMHTPhi 
kNumVersions 

Definition at line 43 of file L1CaloGeometry.h.


Constructor & Destructor Documentation

L1CaloGeometry::L1CaloGeometry ( )
L1CaloGeometry::L1CaloGeometry ( unsigned int  numberGctEmJetPhiBins,
double  gctEmJetPhiBinOffset,
unsigned int  numberGctEtSumPhiBins,
double  gctEtSumPhiBinOffset,
unsigned int  numberGctHtSumPhiBins,
double  gctHtSumPhiBinOffset,
unsigned int  numberGctCentralEtaBinsPerHalf,
unsigned int  numberGctForwardEtaBinsPerHalf,
unsigned int  etaSignBitOffset,
const std::vector< double > &  gctEtaBinBoundaries 
)
L1CaloGeometry::~L1CaloGeometry ( ) [virtual]

Definition at line 111 of file L1CaloGeometry.cc.

{
}

Member Function Documentation

double L1CaloGeometry::emJetPhiBinCenter ( unsigned int  phiIndex) const

Definition at line 274 of file L1CaloGeometry.cc.

References m_gctEmJetPhiBinWidth, and m_gctEmJetPhiOffset.

Referenced by L1ExtraParticlesProd::gctLorentzVector(), and operator<<().

{
   return ( ( double ) phiIndex + 0.5 ) * m_gctEmJetPhiBinWidth +
      m_gctEmJetPhiOffset ;
}
double L1CaloGeometry::emJetPhiBinCenter ( const L1CaloRegionDetId detId) const [inline]

Definition at line 88 of file L1CaloGeometry.h.

References emJetPhiBinCenter(), and L1CaloRegionDetId::iphi().

Referenced by emJetPhiBinCenter().

      { return emJetPhiBinCenter( detId.iphi() ) ; }
double L1CaloGeometry::emJetPhiBinHighEdge ( const L1CaloRegionDetId detId) const [inline]

Definition at line 92 of file L1CaloGeometry.h.

References emJetPhiBinHighEdge(), and L1CaloRegionDetId::iphi().

Referenced by emJetPhiBinHighEdge().

      { return emJetPhiBinHighEdge( detId.iphi() ) ; }
double L1CaloGeometry::emJetPhiBinHighEdge ( unsigned int  phiIndex) const
double L1CaloGeometry::emJetPhiBinLowEdge ( unsigned int  phiIndex) const
double L1CaloGeometry::emJetPhiBinLowEdge ( const L1CaloRegionDetId detId) const [inline]

Definition at line 90 of file L1CaloGeometry.h.

References emJetPhiBinLowEdge(), and L1CaloRegionDetId::iphi().

Referenced by emJetPhiBinLowEdge().

      { return emJetPhiBinLowEdge( detId.iphi() ) ; }
unsigned int L1CaloGeometry::emJetPhiIndex ( const double &  phiValue) const

Definition at line 420 of file L1CaloGeometry.cc.

References m_gctEmJetPhiBinWidth, m_gctEmJetPhiOffset, and M_PI.

{
   double phiAdjusted = phiValue - m_gctEmJetPhiOffset ;

   // Check phiValue is between m_gctEmJetPhiOffset and m_gctEmJetPhiOffset+2pi
   if( phiAdjusted < 0. )
   {
      do
      {
         phiAdjusted += 2. * M_PI ;
      }
      while( phiAdjusted < 0. ) ;
   }
   else if( phiAdjusted > 2. * M_PI )
   {
      do
      {
         phiAdjusted -= 2. * M_PI ;
      }
      while( phiAdjusted > 2. * M_PI ) ;
   }

   return ( ( int ) ( phiAdjusted / m_gctEmJetPhiBinWidth ) ) ;
}
double L1CaloGeometry::etaBinCenter ( unsigned int  etaIndex,
bool  central = true 
) const

Definition at line 196 of file L1CaloGeometry.cc.

References etaIndex(), m_etaSignBitOffset, m_gctEtaBinBoundaries, and m_numberGctCentralEtaBinsPerHalf.

Referenced by L1GtEtaPhiConversions::convertL1Scales(), L1GctConfigProducers::etToEnergyConversion(), L1ExtraParticlesProd::gctLorentzVector(), operator<<(), and L1GtEtaPhiConversions::print().

{
   // Central/tau jets and EM have etaIndex = 0-6 for eta = 0-3.
   // Forward jets have etaIndex = 0-3 for eta = 3-5.
   double etaSign = 1. ;

   // Check sign BEFORE shifting forward jet bin index.
   if( etaIndex >= m_etaSignBitOffset )
   {
      etaSign = -1. ;
      etaIndex -= m_etaSignBitOffset ;
   }

   // Shift forward jet bin index AFTER checking sign bit.
   if( !central )
   {
      etaIndex += m_numberGctCentralEtaBinsPerHalf ;
   }

   return 0.5 * etaSign *
      ( m_gctEtaBinBoundaries[ etaIndex ] +
        m_gctEtaBinBoundaries[ etaIndex + 1 ] ) ;
}
double L1CaloGeometry::etaBinCenter ( const L1CaloRegionDetId detId) const [inline]

Definition at line 77 of file L1CaloGeometry.h.

References globalEtaBinCenter(), and L1CaloRegionDetId::ieta().

      { return globalEtaBinCenter( detId.ieta() ) ; }
double L1CaloGeometry::etaBinHighEdge ( unsigned int  etaIndex,
bool  central = true 
) const

Definition at line 248 of file L1CaloGeometry.cc.

References m_etaSignBitOffset, m_gctEtaBinBoundaries, and m_numberGctCentralEtaBinsPerHalf.

Referenced by operator<<().

{
   // Central/tau jets and EM have etaIndex = 0-6 for eta = 0-3.
   // Forward jets have etaIndex = 0-3 for eta = 3-5.
   double etaSign = 1. ;

   // Check sign BEFORE shifting forward jet bin index.
   if( etaIndex >= m_etaSignBitOffset )
   {
      etaSign = -1. ;
      etaIndex -= m_etaSignBitOffset ;
   }

   // Shift forward jet bin index AFTER checking sign bit.
   if( !central )
   {
      etaIndex += m_numberGctCentralEtaBinsPerHalf ;
   }

   return ( etaSign > 0. ? 
            m_gctEtaBinBoundaries[ etaIndex + 1 ] :
            -m_gctEtaBinBoundaries[ etaIndex ] ) ;
}
double L1CaloGeometry::etaBinHighEdge ( const L1CaloRegionDetId detId) const [inline]

Definition at line 81 of file L1CaloGeometry.h.

References globalEtaBinHighEdge(), and L1CaloRegionDetId::ieta().

      { return globalEtaBinHighEdge( detId.ieta() ) ; }
double L1CaloGeometry::etaBinLowEdge ( const L1CaloRegionDetId detId) const [inline]

Definition at line 79 of file L1CaloGeometry.h.

References globalEtaBinLowEdge(), and L1CaloRegionDetId::ieta().

      { return globalEtaBinLowEdge( detId.ieta() ) ; }
double L1CaloGeometry::etaBinLowEdge ( unsigned int  etaIndex,
bool  central = true 
) const

Definition at line 222 of file L1CaloGeometry.cc.

References m_etaSignBitOffset, m_gctEtaBinBoundaries, and m_numberGctCentralEtaBinsPerHalf.

Referenced by operator<<().

{
   // Central/tau jets and EM have etaIndex = 0-6 for eta = 0-3.
   // Forward jets have etaIndex = 0-3 for eta = 3-5.
   double etaSign = 1. ;

   // Check sign BEFORE shifting forward jet bin index.
   if( etaIndex >= m_etaSignBitOffset )
   {
      etaSign = -1. ;
      etaIndex -= m_etaSignBitOffset ;
   }

   // Shift forward jet bin index AFTER checking sign bit.
   if( !central )
   {
      etaIndex += m_numberGctCentralEtaBinsPerHalf ;
   }

   return ( etaSign > 0. ? 
            m_gctEtaBinBoundaries[ etaIndex ] :
            -m_gctEtaBinBoundaries[ etaIndex + 1 ] ) ;
}
unsigned int L1CaloGeometry::etaIndex ( const double &  etaValue) const

Definition at line 361 of file L1CaloGeometry.cc.

References i, m_etaSignBitOffset, m_gctEtaBinBoundaries, m_numberGctCentralEtaBinsPerHalf, and m_numberGctForwardEtaBinsPerHalf.

Referenced by etaBinCenter(), globalEtaBinCenter(), globalEtaBinHighEdge(), globalEtaBinLowEdge(), and globalEtaIndex().

{
   unsigned int etaIndex = 0 ;

   for( unsigned int i = 0 ; i < m_numberGctCentralEtaBinsPerHalf ; ++i )
   {
      if( fabs( etaValue ) >= m_gctEtaBinBoundaries[ i ] )
      {
         etaIndex = i ;
      }
   }

   for( unsigned int i = 0 ; i < m_numberGctForwardEtaBinsPerHalf ; ++i )
   {
      if( fabs( etaValue ) >=
          m_gctEtaBinBoundaries[ i + m_numberGctCentralEtaBinsPerHalf ] )
      {
         etaIndex = i ;
      }
   }

   if( etaValue < 0. )
   {
      etaIndex += m_etaSignBitOffset ;
   }

   return etaIndex ;
}
unsigned int L1CaloGeometry::etaSignBitOffset ( ) const [inline]

Definition at line 118 of file L1CaloGeometry.h.

References m_etaBinsPerHalf.

      { return m_etaBinsPerHalf ; }
double L1CaloGeometry::etSumPhiBinCenter ( unsigned int  phiIndex) const

Definition at line 295 of file L1CaloGeometry.cc.

References m_gctEtSumPhiBinWidth, and m_gctEtSumPhiOffset.

Referenced by operator<<(), and L1ExtraParticlesProd::produce().

{
   return ( ( double ) phiIndex + 0.5 ) * m_gctEtSumPhiBinWidth +
      m_gctEtSumPhiOffset ;
}
double L1CaloGeometry::etSumPhiBinHighEdge ( unsigned int  phiIndex) const
double L1CaloGeometry::etSumPhiBinLowEdge ( unsigned int  phiIndex) const
unsigned int L1CaloGeometry::etSumPhiIndex ( const double &  phiValue) const

Definition at line 446 of file L1CaloGeometry.cc.

References m_gctEtSumPhiBinWidth, m_gctEtSumPhiOffset, and M_PI.

{
   double phiAdjusted = phiValue - m_gctEtSumPhiOffset ;

   // Check phiValue is between m_gctEtSumPhiOffset and m_gctEtSumPhiOffset+2pi
   if( phiAdjusted < 0. )
   {
      do
      {
         phiAdjusted += 2. * M_PI ;
      }
      while( phiAdjusted < 0. ) ;
   }
   else if( phiAdjusted > 2. * M_PI )
   {
      do
      {
         phiAdjusted -= 2. * M_PI ;
      }
      while( phiAdjusted > 2. * M_PI ) ;
   }

   return ( ( int ) ( phiAdjusted / m_gctEtSumPhiBinWidth ) ) ;
}
double L1CaloGeometry::globalEtaBinCenter ( unsigned int  globalEtaIndex) const

Definition at line 136 of file L1CaloGeometry.cc.

References etaIndex(), m_etaBinsPerHalf, and m_gctEtaBinBoundaries.

Referenced by etaBinCenter(), operator<<(), and L1MuGMTMIAUEtaProLUT::TheLookupFunction().

{
   int etaIndex ;
   double etaSign = 1. ;
   if( globalEtaIndex < m_etaBinsPerHalf )
   {
      etaIndex = m_etaBinsPerHalf - globalEtaIndex - 1 ;
      etaSign = -1. ;
   }
   else
   {
      etaIndex = globalEtaIndex - m_etaBinsPerHalf ;
   }

   return 0.5 * etaSign *
      ( m_gctEtaBinBoundaries[ etaIndex ] +
        m_gctEtaBinBoundaries[ etaIndex + 1 ] ) ;
}
double L1CaloGeometry::globalEtaBinHighEdge ( unsigned int  globalEtaIndex) const

Definition at line 176 of file L1CaloGeometry.cc.

References etaIndex(), m_etaBinsPerHalf, and m_gctEtaBinBoundaries.

Referenced by etaBinHighEdge(), L1GetHistLimits::getHistLimits(), and operator<<().

{
   int etaIndex ;
   double etaSign = 1. ;
   if( globalEtaIndex < m_etaBinsPerHalf )
   {
      etaIndex = m_etaBinsPerHalf - globalEtaIndex - 1 ;
      etaSign = -1. ;
   }
   else
   {
      etaIndex = globalEtaIndex - m_etaBinsPerHalf ;
   }

   return ( etaSign > 0. ? 
            m_gctEtaBinBoundaries[ etaIndex + 1 ] :
            -m_gctEtaBinBoundaries[ etaIndex ] ) ;
}
double L1CaloGeometry::globalEtaBinLowEdge ( unsigned int  globalEtaIndex) const

Definition at line 156 of file L1CaloGeometry.cc.

References etaIndex(), m_etaBinsPerHalf, and m_gctEtaBinBoundaries.

Referenced by L1GtEtaPhiConversions::convertL1Scales(), etaBinLowEdge(), L1GetHistLimits::getHistLimits(), operator<<(), and L1GtEtaPhiConversions::print().

{
   int etaIndex ;
   double etaSign = 1. ;
   if( globalEtaIndex < m_etaBinsPerHalf )
   {
      etaIndex = m_etaBinsPerHalf - globalEtaIndex - 1 ;
      etaSign = -1. ;
   }
   else
   {
      etaIndex = globalEtaIndex - m_etaBinsPerHalf ;
   }

   return ( etaSign > 0. ? 
            m_gctEtaBinBoundaries[ etaIndex ] :
            -m_gctEtaBinBoundaries[ etaIndex + 1 ] ) ;
}
unsigned int L1CaloGeometry::globalEtaIndex ( const double &  etaValue) const

Definition at line 391 of file L1CaloGeometry.cc.

References etaIndex(), i, m_etaBinsPerHalf, and m_gctEtaBinBoundaries.

Referenced by L1GtEtaPhiConversions::convertL1Scales(), L1GtEtaPhiConversions::print(), and L1MuGMTMIAUEtaProLUT::TheLookupFunction().

{
   unsigned int etaIndex = 0 ;

   if( etaValue < 0. )
   {
      for( unsigned int i = m_etaBinsPerHalf ; i > 0 ; --i )
      {
         if( fabs( etaValue ) < m_gctEtaBinBoundaries[ i ] )
         {
            etaIndex = m_etaBinsPerHalf - i ;
         }
      }
   }
   else
   {
      for( unsigned int i = 0 ; i < m_etaBinsPerHalf ; ++i )
      {
         if( etaValue >= m_gctEtaBinBoundaries[ i ] )
         {
            etaIndex = i + m_etaBinsPerHalf ;
         }
      }
   }

   return etaIndex ;
}
double L1CaloGeometry::htSumPhiBinCenter ( unsigned int  phiIndex) const

Definition at line 316 of file L1CaloGeometry.cc.

References kOrig, m_gctEtSumPhiBinWidth, m_gctEtSumPhiOffset, m_gctHtSumPhiBinWidth, m_gctHtSumPhiOffset, and m_version.

Referenced by operator<<(), and L1ExtraParticlesProd::produce().

{
  if( m_version == kOrig )
    {
      return ( ( double ) phiIndex + 0.5 ) * m_gctEtSumPhiBinWidth * 4. +
        m_gctEtSumPhiOffset ;
    }
  else
    {
      return ( ( double ) phiIndex + 0.5 ) * m_gctHtSumPhiBinWidth +
        m_gctHtSumPhiOffset ;
    }
}
double L1CaloGeometry::htSumPhiBinHighEdge ( unsigned int  phiIndex) const
double L1CaloGeometry::htSumPhiBinLowEdge ( unsigned int  phiIndex) const
unsigned int L1CaloGeometry::htSumPhiIndex ( const double &  phiValue) const

Definition at line 472 of file L1CaloGeometry.cc.

References kOrig, m_gctEtSumPhiBinWidth, m_gctEtSumPhiOffset, m_gctHtSumPhiBinWidth, M_PI, and m_version.

{
   double phiAdjusted = phiValue - m_gctEtSumPhiOffset ;

   // Check phiValue is between m_gctEtSumPhiOffset and m_gctEtSumPhiOffset+2pi
   if( phiAdjusted < 0. )
   {
      do
      {
         phiAdjusted += 2. * M_PI ;
      }
      while( phiAdjusted < 0. ) ;
   }
   else if( phiAdjusted > 2. * M_PI )
   {
      do
      {
         phiAdjusted -= 2. * M_PI ;
      }
      while( phiAdjusted > 2. * M_PI ) ;
   }

   if( m_version == kOrig )
     {
       return ( ( int ) ( phiAdjusted / ( m_gctEtSumPhiBinWidth * 4. ) ) ) ;
     }
   else
     {
       return ( ( int ) ( phiAdjusted / m_gctHtSumPhiBinWidth ) ) ;
     }
}
unsigned int L1CaloGeometry::numberGctCentralEtaBinsPerHalf ( ) const [inline]
unsigned int L1CaloGeometry::numberGctEmJetPhiBins ( ) const [inline]
unsigned int L1CaloGeometry::numberGctEtSumPhiBins ( ) const [inline]
unsigned int L1CaloGeometry::numberGctForwardEtaBinsPerHalf ( ) const [inline]
unsigned int L1CaloGeometry::numberGctHtSumPhiBins ( ) const
unsigned int L1CaloGeometry::version ( ) const [inline]

Definition at line 60 of file L1CaloGeometry.h.

References m_version.

{ return m_version ; }

Member Data Documentation

unsigned int L1CaloGeometry::m_etaBinsPerHalf [private]
unsigned int L1CaloGeometry::m_etaSignBitOffset [private]

Definition at line 139 of file L1CaloGeometry.h.

Referenced by etaBinCenter(), etaBinHighEdge(), etaBinLowEdge(), and etaIndex().

std::vector< double > L1CaloGeometry::m_gctEtaBinBoundaries [private]

Definition at line 134 of file L1CaloGeometry.h.

Referenced by L1CaloGeometry(), and numberGctEmJetPhiBins().

Definition at line 135 of file L1CaloGeometry.h.

Referenced by L1CaloGeometry(), numberGctEtSumPhiBins(), and numberGctHtSumPhiBins().

Definition at line 138 of file L1CaloGeometry.h.

Referenced by etaIndex(), L1CaloGeometry(), and numberGctForwardEtaBinsPerHalf().

Definition at line 136 of file L1CaloGeometry.h.

Referenced by L1CaloGeometry(), and numberGctHtSumPhiBins().

unsigned int L1CaloGeometry::m_version [private]