Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:51

0001 #ifndef L1GCTREGION_H
0002 #define L1GCTREGION_H
0003 
0004 /*!
0005  * \author Greg Heath
0006  * \date September 2007
0007  */
0008 
0009 /*! \class L1GctRegion
0010  * \brief Gct version of a calorimeter region, used within GCT emulation
0011  * 
0012  * Only differs from L1CaloRegion by the treatment of overflows
0013  */
0014 
0015 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
0016 
0017 class L1GctRegion : public L1CaloRegion {
0018 public:
0019   enum numberOfBits {
0020     kGctRegionNBits = 10,
0021     kGctRegionOFlowBit = 1 << kGctRegionNBits,
0022     kGctRegionMaxValue = kGctRegionOFlowBit - 1
0023   };
0024 
0025   // Constructors and destructor
0026   L1GctRegion();
0027 
0028   ~L1GctRegion();
0029 
0030   // Named constructors
0031   static L1GctRegion makeJfInputRegion(const L1CaloRegion&);
0032   static L1GctRegion makeProtoJetRegion(const unsigned et,
0033                                         const bool overFlow,
0034                                         const bool fineGrain,
0035                                         const bool tauIsolationVeto,
0036                                         const unsigned ieta,
0037                                         const unsigned iphi,
0038                                         const int16_t bx);
0039   static L1GctRegion makeFinalJetRegion(const unsigned et,
0040                                         const bool overFlow,
0041                                         const bool fineGrain,
0042                                         const unsigned ieta,
0043                                         const unsigned iphi,
0044                                         const int16_t bx);
0045 
0046   // Replace et() method to use 10 bits for all eta
0047   unsigned et() const { return overFlow() ? kGctRegionMaxValue : raw() & kGctRegionMaxValue; }
0048 
0049   // Replace local eta with a non-physical value
0050   unsigned rctEta() const { return (empty() ? 12 : id().rctEta()); }
0051 
0052   // Access to additional bit fields
0053   bool featureBit0() { return ((raw() >> 14) & 0x1) != 0; }
0054   bool featureBit1() { return ((raw() >> 15) & 0x1) != 0; }
0055 
0056   void setFeatureBit0() { setBit(14, true); }
0057   void clrFeatureBit0() { setBit(14, false); }
0058   void setFeatureBit1() { setBit(15, true); }
0059   void clrFeatureBit1() { setBit(15, false); }
0060 
0061 private:
0062   // constructor for internal use
0063   L1GctRegion(const unsigned et,
0064               const bool overFlow,
0065               const bool fineGrain,
0066               const unsigned ieta,
0067               const unsigned iphi,
0068               const int16_t bx);
0069 
0070   void setBit(const unsigned bitNum, const bool onOff);
0071 };
0072 
0073 #endif