Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:20

0001 #ifndef L1TObjects_L1MuCSCPtLut_h
0002 #define L1TObjects_L1MuCSCPtLut_h
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include <string>
0007 #include <cstring>
0008 
0009 class CSCTFConfigProducer;
0010 
0011 class L1MuCSCPtLut {
0012 private:
0013   unsigned short pt_lut[1 << 21];
0014   friend class CSCTFConfigProducer;
0015 
0016 public:
0017   void readFromDBS(std::string& ptLUT);
0018 
0019   unsigned short pt(unsigned long addr) const throw() {
0020     if (addr < (1 << 21))
0021       return pt_lut[(unsigned int)addr];
0022     else
0023       return 0;
0024   }
0025 
0026   const unsigned short* lut(void) const throw() { return pt_lut; }
0027 
0028   L1MuCSCPtLut& operator=(const L1MuCSCPtLut& lut) {
0029     memcpy(pt_lut, lut.pt_lut, sizeof(pt_lut));
0030     return *this;
0031   }
0032 
0033   L1MuCSCPtLut(void) { bzero(pt_lut, sizeof(pt_lut)); }
0034   L1MuCSCPtLut(const L1MuCSCPtLut& lut) { memcpy(pt_lut, lut.pt_lut, sizeof(pt_lut)); }
0035   ~L1MuCSCPtLut(void) {}
0036 
0037   COND_SERIALIZABLE;
0038 };
0039 
0040 #endif