CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CondFormats/L1TObjects/interface/L1CaloGeometry.h

Go to the documentation of this file.
00001 #ifndef L1Geometry_L1CaloGeometry_h
00002 #define L1Geometry_L1CaloGeometry_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     L1Geometry
00006 // Class  :     L1CaloGeometry
00007 // 
00016 //
00017 // Original Author:  Werner Sun
00018 //         Created:  Mon Oct 23 21:52:29 EDT 2006
00019 // $Id: L1CaloGeometry.h,v 1.4 2009/09/28 22:59:12 wsun Exp $
00020 //
00021 
00022 // system include files
00023 #include <vector>
00024 #include <ostream>
00025 
00026 // user include files
00027 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
00028 
00029 // forward declarations
00030 
00031 class L1CaloGeometry
00032 {
00033 
00034    public:
00035 /*       static const unsigned int kNumberGctEmJetPhiBins = 18 ; */
00036 /*       static const unsigned int kNumberGctEtSumPhiBins = 72 ; */
00037 /*       static const unsigned int kNumberGctCentralEtaBinsPerHalf = 7 ; */
00038 /*       static const unsigned int kNumberGctForwardEtaBinsPerHalf = 4 ; */
00039 
00040       // calo sign bit is the 4th bit
00041 /*       static const unsigned int kEtaSignBitOffset = 8 ; */
00042 
00043       enum Versions{ kOrig, kAddedMHTPhi, kNumVersions } ;
00044 
00045       L1CaloGeometry();
00046       L1CaloGeometry( unsigned int numberGctEmJetPhiBins,
00047                       double gctEmJetPhiBinOffset, // -0.5 bins usually
00048                       unsigned int numberGctEtSumPhiBins,
00049                       double gctEtSumPhiBinOffset, // 0 bins usually
00050                       unsigned int numberGctHtSumPhiBins,
00051                       double gctHtSumPhiBinOffset, // 0 bins usually
00052                       unsigned int numberGctCentralEtaBinsPerHalf,
00053                       unsigned int numberGctForwardEtaBinsPerHalf,
00054                       unsigned int etaSignBitOffset,
00055                       const std::vector< double >& gctEtaBinBoundaries ) ;
00056       virtual ~L1CaloGeometry();
00057 
00058       // ---------- const member functions ---------------------
00059 
00060       unsigned int version() const { return m_version ; }
00061 
00062       // Central/tau jets and EM have etaIndex = 0-6 for eta = 0.0-3.0
00063       // Forward jets have etaIndex = 0-3 for eta = 3.0-5.0
00064       double etaBinCenter( unsigned int etaIndex,
00065                            bool central = true ) const ;
00066       double etaBinLowEdge( unsigned int etaIndex,
00067                             bool central = true ) const ;
00068       double etaBinHighEdge( unsigned int etaIndex,
00069                              bool central = true ) const ;
00070 
00071       // Global index = 0-21
00072       double globalEtaBinCenter( unsigned int globalEtaIndex ) const ;
00073       double globalEtaBinLowEdge( unsigned int globalEtaIndex ) const ;
00074       double globalEtaBinHighEdge( unsigned int globalEtaIndex ) const ;
00075 
00076       // Eta index of L1CaloRegionDetId is global index 0-21.
00077       double etaBinCenter( const L1CaloRegionDetId& detId ) const
00078       { return globalEtaBinCenter( detId.ieta() ) ; }
00079       double etaBinLowEdge( const L1CaloRegionDetId& detId ) const
00080       { return globalEtaBinLowEdge( detId.ieta() ) ; }
00081       double etaBinHighEdge( const L1CaloRegionDetId& detId ) const
00082       { return globalEtaBinHighEdge( detId.ieta() ) ; }
00083 
00084       double emJetPhiBinCenter( unsigned int phiIndex ) const ;
00085       double emJetPhiBinLowEdge( unsigned int phiIndex ) const ;
00086       double emJetPhiBinHighEdge( unsigned int phiIndex ) const ;
00087 
00088       double emJetPhiBinCenter( const L1CaloRegionDetId& detId ) const
00089       { return emJetPhiBinCenter( detId.iphi() ) ; }
00090       double emJetPhiBinLowEdge( const L1CaloRegionDetId& detId ) const
00091       { return emJetPhiBinLowEdge( detId.iphi() ) ; }
00092       double emJetPhiBinHighEdge( const L1CaloRegionDetId& detId ) const
00093       { return emJetPhiBinHighEdge( detId.iphi() ) ; }
00094 
00095       double etSumPhiBinCenter( unsigned int phiIndex ) const ;
00096       double etSumPhiBinLowEdge( unsigned int phiIndex ) const ;
00097       double etSumPhiBinHighEdge( unsigned int phiIndex ) const ;
00098 
00099       double htSumPhiBinCenter( unsigned int phiIndex ) const ;
00100       double htSumPhiBinLowEdge( unsigned int phiIndex ) const ;
00101       double htSumPhiBinHighEdge( unsigned int phiIndex ) const ;
00102 
00103       unsigned int etaIndex( const double& etaValue ) const ; // 0-6 or 0-3
00104       unsigned int globalEtaIndex( const double& etaValue ) const ; // 0-21
00105       unsigned int emJetPhiIndex( const double& phiValue ) const ;
00106       unsigned int etSumPhiIndex( const double& phiValue ) const ;
00107       unsigned int htSumPhiIndex( const double& phiValue ) const ;
00108 
00109       unsigned int numberGctEmJetPhiBins() const
00110       { return m_numberGctEmJetPhiBins ; }
00111       unsigned int numberGctEtSumPhiBins() const
00112       { return m_numberGctEtSumPhiBins ; }
00113       unsigned int numberGctHtSumPhiBins() const ;
00114       unsigned int numberGctCentralEtaBinsPerHalf() const
00115       { return m_numberGctCentralEtaBinsPerHalf ; }
00116       unsigned int numberGctForwardEtaBinsPerHalf() const
00117       { return m_numberGctForwardEtaBinsPerHalf ; }
00118       unsigned int etaSignBitOffset() const
00119       { return m_etaBinsPerHalf ; }
00120 
00121       // ---------- static member functions --------------------
00122 
00123       // ---------- member functions ---------------------------
00124 
00125    private:
00126       //L1CaloGeometry(const L1CaloGeometry&); // stop default
00127 
00128       //const L1CaloGeometry& operator=(const L1CaloGeometry&); // stop default
00129 
00130       // ---------- member data --------------------------------
00131 
00132       unsigned int m_version ;
00133 
00134       unsigned int m_numberGctEmJetPhiBins ;
00135       unsigned int m_numberGctEtSumPhiBins ;
00136       unsigned int m_numberGctHtSumPhiBins ;
00137       unsigned int m_numberGctCentralEtaBinsPerHalf ;
00138       unsigned int m_numberGctForwardEtaBinsPerHalf ;
00139       unsigned int m_etaSignBitOffset ;
00140       std::vector< double > m_gctEtaBinBoundaries ;
00141 
00142       unsigned int m_etaBinsPerHalf ;
00143 
00144       // Calo phi bins are uniform.
00145       double m_gctEmJetPhiBinWidth ;
00146       double m_gctEtSumPhiBinWidth ;
00147       double m_gctHtSumPhiBinWidth ;
00148       double m_gctEmJetPhiOffset ;
00149       double m_gctEtSumPhiOffset ;
00150       double m_gctHtSumPhiOffset ;
00151 };
00152 
00153 std::ostream& operator << ( std::ostream& os, const L1CaloGeometry& obj ) ;
00154 
00155 #endif