CMS 3D CMS Logo

L1GctHfLutSetup Class Reference

Hf Lut setup (all the Luts in one class). More...

#include <CondFormats/L1TObjects/interface/L1GctHfLutSetup.h>

List of all members.

Public Types

enum  hfLutType {
  bitCountPosEtaRing1, bitCountPosEtaRing2, bitCountNegEtaRing1, bitCountNegEtaRing2,
  etSumPosEtaRing1, etSumPosEtaRing2, etSumNegEtaRing1, etSumNegEtaRing2,
  numberOfLutTypes
}
 Define the different types of Lut. More...
enum  numberOfCountBits { kHfCountBits = 5, kHfCountNumValues = 1 << kHfCountBits, kHfCountMaxValue = kHfCountNumValues - 1 }
enum  numberOfEtSumBits { kHfEtSumBits = 8, kHfEtSumNumValues = 1 << kHfEtSumBits, kHfEtSumMaxValue = kHfEtSumNumValues - 1 }
 Define the numbers of input and output bits. More...
enum  numberOfOutputBits { kHfOutputBits = 3, kHfOutputNumValues = 1 << kHfOutputBits, kHfOutputMaxValue = kHfOutputNumValues - 1 }

Public Member Functions

std::vector< unsigned > getCountThresholdsNegEtaRing1 () const
std::vector< unsigned > getCountThresholdsNegEtaRing2 () const
std::vector< unsigned > getCountThresholdsPosEtaRing1 () const
std::vector< unsigned > getCountThresholdsPosEtaRing2 () const
std::vector< unsigned > getEtSumThresholdsNegEtaRing1 () const
std::vector< unsigned > getEtSumThresholdsNegEtaRing2 () const
std::vector< unsigned > getEtSumThresholdsPosEtaRing1 () const
std::vector< unsigned > getEtSumThresholdsPosEtaRing2 () const
std::vector< unsigned > getThresholds (const hfLutType type) const
 L1GctHfLutSetup ()
uint16_t outputValue (const hfLutType type, const uint16_t inputValue) const
void setThresholds (const hfLutType type, const std::vector< unsigned > thr)
 ~L1GctHfLutSetup ()

Private Attributes

std::map< hfLutType,
std::vector< uint16_t > > 
m_thresholds


Detailed Description

Hf Lut setup (all the Luts in one class).

Author:
Greg Heath
Date:
Sep 2007
============================================================================

============================================================================

Definition at line 24 of file L1GctHfLutSetup.h.


Member Enumeration Documentation

enum L1GctHfLutSetup::hfLutType

Define the different types of Lut.

Enumerator:
bitCountPosEtaRing1 
bitCountPosEtaRing2 
bitCountNegEtaRing1 
bitCountNegEtaRing2 
etSumPosEtaRing1 
etSumPosEtaRing2 
etSumNegEtaRing1 
etSumNegEtaRing2 
numberOfLutTypes 

Definition at line 29 of file L1GctHfLutSetup.h.

enum L1GctHfLutSetup::numberOfCountBits

Enumerator:
kHfCountBits 
kHfCountNumValues 
kHfCountMaxValue 

Definition at line 39 of file L1GctHfLutSetup.h.

00039                          {
00040     kHfCountBits      = 5,
00041     kHfCountNumValues = 1 << kHfCountBits,
00042     kHfCountMaxValue  = kHfCountNumValues - 1
00043   };

enum L1GctHfLutSetup::numberOfEtSumBits

Define the numbers of input and output bits.

Enumerator:
kHfEtSumBits 
kHfEtSumNumValues 
kHfEtSumMaxValue 

Definition at line 33 of file L1GctHfLutSetup.h.

00033                          {
00034     kHfEtSumBits      = 8,
00035     kHfEtSumNumValues = 1 << kHfEtSumBits,
00036     kHfEtSumMaxValue  = kHfEtSumNumValues - 1
00037   };

enum L1GctHfLutSetup::numberOfOutputBits

Enumerator:
kHfOutputBits 
kHfOutputNumValues 
kHfOutputMaxValue 

Definition at line 45 of file L1GctHfLutSetup.h.

00045                           {
00046     kHfOutputBits      = 3,
00047     kHfOutputNumValues = 1 << kHfOutputBits,
00048     kHfOutputMaxValue  = kHfOutputNumValues - 1
00049   };


Constructor & Destructor Documentation

L1GctHfLutSetup::L1GctHfLutSetup (  ) 

Definition at line 4 of file L1GctHfLutSetup.cc.

00004                                  :
00005   m_thresholds()
00006 {
00007 }

L1GctHfLutSetup::~L1GctHfLutSetup (  ) 

Definition at line 9 of file L1GctHfLutSetup.cc.

00009 {}


Member Function Documentation

std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsNegEtaRing1 (  )  const [inline]

Definition at line 63 of file L1GctHfLutSetup.h.

References bitCountNegEtaRing1, and getThresholds().

std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsNegEtaRing2 (  )  const [inline]

Definition at line 64 of file L1GctHfLutSetup.h.

References bitCountNegEtaRing2, and getThresholds().

std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsPosEtaRing1 (  )  const [inline]

Definition at line 61 of file L1GctHfLutSetup.h.

References bitCountPosEtaRing1, and getThresholds().

std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsPosEtaRing2 (  )  const [inline]

Definition at line 62 of file L1GctHfLutSetup.h.

References bitCountPosEtaRing2, and getThresholds().

std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsNegEtaRing1 (  )  const [inline]

Definition at line 67 of file L1GctHfLutSetup.h.

References etSumNegEtaRing1, and getThresholds().

00067 { return getThresholds(etSumNegEtaRing1); }

std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsNegEtaRing2 (  )  const [inline]

Definition at line 68 of file L1GctHfLutSetup.h.

References etSumNegEtaRing2, and getThresholds().

00068 { return getThresholds(etSumNegEtaRing2); }

std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsPosEtaRing1 (  )  const [inline]

Definition at line 65 of file L1GctHfLutSetup.h.

References etSumPosEtaRing1, and getThresholds().

00065 { return getThresholds(etSumPosEtaRing1); }

std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsPosEtaRing2 (  )  const [inline]

Definition at line 66 of file L1GctHfLutSetup.h.

References etSumPosEtaRing2, and getThresholds().

00066 { return getThresholds(etSumPosEtaRing2); }

std::vector< unsigned > L1GctHfLutSetup::getThresholds ( const hfLutType  type  )  const

Definition at line 27 of file L1GctHfLutSetup.cc.

References m_thresholds, and HLT_VtxMuL3::result.

Referenced by getCountThresholdsNegEtaRing1(), getCountThresholdsNegEtaRing2(), getCountThresholdsPosEtaRing1(), getCountThresholdsPosEtaRing2(), getEtSumThresholdsNegEtaRing1(), getEtSumThresholdsNegEtaRing2(), getEtSumThresholdsPosEtaRing1(), getEtSumThresholdsPosEtaRing2(), L1GctGlobalHfSumAlgos::getThresholds(), and operator<<().

00028 {
00029   std::vector<unsigned> result;
00030   std::map<hfLutType, std::vector<uint16_t> >::const_iterator thrList = m_thresholds.find(type);
00031   if (thrList != m_thresholds.end()) {
00032     for (std::vector<uint16_t>::const_iterator thr = thrList->second.begin();
00033          thr != thrList->second.end(); thr++) {
00034       result.push_back(static_cast<unsigned>(*thr));
00035     }
00036   }
00037   return result;
00038 }

uint16_t L1GctHfLutSetup::outputValue ( const hfLutType  type,
const uint16_t  inputValue 
) const

Definition at line 40 of file L1GctHfLutSetup.cc.

References i, kHfOutputMaxValue, m_thresholds, and HLT_VtxMuL3::result.

Referenced by L1GctHfBitCountsLut::value(), and L1GctHfEtSumsLut::value().

00041 {
00042   // Calculate Lut contents by comparison against a set of thresholds.
00043   // Check that the Lut type requested has actually been setup - otherwise
00044   // we return the max possible output value
00045   uint16_t result = kHfOutputMaxValue;
00046   std::map<hfLutType, std::vector<uint16_t> >::const_iterator thrList = m_thresholds.find(type);
00047   if (thrList != m_thresholds.end()) {
00048     for (unsigned i=0; i<kHfOutputMaxValue; ++i) {
00049       if (inputValue < (thrList->second).at(i)) {
00050         result = i;
00051         break;
00052       }
00053     }
00054   }
00055   return result;
00056 }

void L1GctHfLutSetup::setThresholds ( const hfLutType  type,
const std::vector< unsigned >  thr 
)

Definition at line 11 of file L1GctHfLutSetup.cc.

References i, kHfEtSumMaxValue, kHfOutputMaxValue, and m_thresholds.

00012 {
00013   // Set thresholds for a particular Lut type.
00014   // Thresholds should (of course) be ordered - but no check is performed.
00015   // The number of thresholds is one fewer than the number of possible
00016   // output codes (e.g. 3 bits -> 7 thresholds)
00017   m_thresholds[type].resize(kHfOutputMaxValue);
00018   for (unsigned i=0; i<kHfOutputMaxValue; ++i) {
00019     if (i<thr.size()) {
00020       m_thresholds[type].at(i) = static_cast<uint16_t>(thr.at(i));
00021     } else {
00022       m_thresholds[type].at(i) = kHfEtSumMaxValue;
00023     }
00024   }
00025 }


Member Data Documentation

std::map<hfLutType, std::vector<uint16_t> > L1GctHfLutSetup::m_thresholds [private]

Definition at line 75 of file L1GctHfLutSetup.h.

Referenced by getThresholds(), outputValue(), and setThresholds().


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