Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:16

0001 #ifndef L1Geometry_L1CaloGeometry_h
0002 #define L1Geometry_L1CaloGeometry_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     L1Geometry
0006 // Class  :     L1CaloGeometry
0007 //
0008 /**\class L1CaloGeometry L1CaloGeometry.h L1TriggerConfig/L1Geometry/interface/L1CaloGeometry.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Werner Sun
0018 //         Created:  Mon Oct 23 21:52:29 EDT 2006
0019 // $Id: L1CaloGeometry.h,v 1.3 2009/07/17 17:37:10 wsun Exp $
0020 //
0021 
0022 // system include files
0023 #include "CondFormats/Serialization/interface/Serializable.h"
0024 
0025 #include <vector>
0026 #include <ostream>
0027 
0028 // user include files
0029 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0030 
0031 // forward declarations
0032 
0033 class L1CaloGeometry {
0034 public:
0035   /*       static const unsigned int kNumberGctEmJetPhiBins = 18 ; */
0036   /*       static const unsigned int kNumberGctEtSumPhiBins = 72 ; */
0037   /*       static const unsigned int kNumberGctCentralEtaBinsPerHalf = 7 ; */
0038   /*       static const unsigned int kNumberGctForwardEtaBinsPerHalf = 4 ; */
0039 
0040   // calo sign bit is the 4th bit
0041   /*       static const unsigned int kEtaSignBitOffset = 8 ; */
0042 
0043   enum Versions { kOrig, kAddedMHTPhi, kNumVersions };
0044 
0045   L1CaloGeometry();
0046   L1CaloGeometry(unsigned int numberGctEmJetPhiBins,
0047                  double gctEmJetPhiBinOffset,  // -0.5 bins usually
0048                  unsigned int numberGctEtSumPhiBins,
0049                  double gctEtSumPhiBinOffset,  // 0 bins usually
0050                  unsigned int numberGctHtSumPhiBins,
0051                  double gctHtSumPhiBinOffset,  // 0 bins usually
0052                  unsigned int numberGctCentralEtaBinsPerHalf,
0053                  unsigned int numberGctForwardEtaBinsPerHalf,
0054                  unsigned int etaSignBitOffset,
0055                  const std::vector<double>& gctEtaBinBoundaries);
0056   virtual ~L1CaloGeometry();
0057 
0058   // ---------- const member functions ---------------------
0059 
0060   unsigned int version() const { return m_version; }
0061 
0062   // Central/tau jets and EM have etaIndex = 0-6 for eta = 0.0-3.0
0063   // Forward jets have etaIndex = 0-3 for eta = 3.0-5.0
0064   double etaBinCenter(unsigned int etaIndex, bool central = true) const;
0065   double etaBinLowEdge(unsigned int etaIndex, bool central = true) const;
0066   double etaBinHighEdge(unsigned int etaIndex, bool central = true) const;
0067 
0068   // Global index = 0-21
0069   double globalEtaBinCenter(unsigned int globalEtaIndex) const;
0070   double globalEtaBinLowEdge(unsigned int globalEtaIndex) const;
0071   double globalEtaBinHighEdge(unsigned int globalEtaIndex) const;
0072 
0073   // Eta index of L1CaloRegionDetId is global index 0-21.
0074   double etaBinCenter(const L1CaloRegionDetId& detId) const { return globalEtaBinCenter(detId.ieta()); }
0075   double etaBinLowEdge(const L1CaloRegionDetId& detId) const { return globalEtaBinLowEdge(detId.ieta()); }
0076   double etaBinHighEdge(const L1CaloRegionDetId& detId) const { return globalEtaBinHighEdge(detId.ieta()); }
0077 
0078   double emJetPhiBinCenter(unsigned int phiIndex) const;
0079   double emJetPhiBinLowEdge(unsigned int phiIndex) const;
0080   double emJetPhiBinHighEdge(unsigned int phiIndex) const;
0081 
0082   double emJetPhiBinCenter(const L1CaloRegionDetId& detId) const { return emJetPhiBinCenter(detId.iphi()); }
0083   double emJetPhiBinLowEdge(const L1CaloRegionDetId& detId) const { return emJetPhiBinLowEdge(detId.iphi()); }
0084   double emJetPhiBinHighEdge(const L1CaloRegionDetId& detId) const { return emJetPhiBinHighEdge(detId.iphi()); }
0085 
0086   double etSumPhiBinCenter(unsigned int phiIndex) const;
0087   double etSumPhiBinLowEdge(unsigned int phiIndex) const;
0088   double etSumPhiBinHighEdge(unsigned int phiIndex) const;
0089 
0090   double htSumPhiBinCenter(unsigned int phiIndex) const;
0091   double htSumPhiBinLowEdge(unsigned int phiIndex) const;
0092   double htSumPhiBinHighEdge(unsigned int phiIndex) const;
0093 
0094   unsigned int etaIndex(const double& etaValue) const;        // 0-6 or 0-3
0095   unsigned int globalEtaIndex(const double& etaValue) const;  // 0-21
0096   unsigned int emJetPhiIndex(const double& phiValue) const;
0097   unsigned int etSumPhiIndex(const double& phiValue) const;
0098   unsigned int htSumPhiIndex(const double& phiValue) const;
0099 
0100   unsigned int numberGctEmJetPhiBins() const { return m_numberGctEmJetPhiBins; }
0101   unsigned int numberGctEtSumPhiBins() const { return m_numberGctEtSumPhiBins; }
0102   unsigned int numberGctHtSumPhiBins() const;
0103   unsigned int numberGctCentralEtaBinsPerHalf() const { return m_numberGctCentralEtaBinsPerHalf; }
0104   unsigned int numberGctForwardEtaBinsPerHalf() const { return m_numberGctForwardEtaBinsPerHalf; }
0105   unsigned int etaSignBitOffset() const { return m_etaBinsPerHalf; }
0106 
0107   // ---------- static member functions --------------------
0108 
0109   // ---------- member functions ---------------------------
0110 
0111 private:
0112   //L1CaloGeometry(const L1CaloGeometry&); // stop default
0113 
0114   //const L1CaloGeometry& operator=(const L1CaloGeometry&); // stop default
0115 
0116   // ---------- member data --------------------------------
0117 
0118   unsigned int m_version;
0119 
0120   unsigned int m_numberGctEmJetPhiBins;
0121   unsigned int m_numberGctEtSumPhiBins;
0122   unsigned int m_numberGctHtSumPhiBins;
0123   unsigned int m_numberGctCentralEtaBinsPerHalf;
0124   unsigned int m_numberGctForwardEtaBinsPerHalf;
0125   unsigned int m_etaSignBitOffset;
0126   std::vector<double> m_gctEtaBinBoundaries;
0127 
0128   unsigned int m_etaBinsPerHalf;
0129 
0130   // Calo phi bins are uniform.
0131   double m_gctEmJetPhiBinWidth;
0132   double m_gctEtSumPhiBinWidth;
0133   double m_gctHtSumPhiBinWidth;
0134   double m_gctEmJetPhiOffset;
0135   double m_gctEtSumPhiOffset;
0136   double m_gctHtSumPhiOffset;
0137 
0138   COND_SERIALIZABLE;
0139 };
0140 
0141 std::ostream& operator<<(std::ostream& os, const L1CaloGeometry& obj);
0142 
0143 #endif