Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:47

0001 #ifndef L1RCTJetSummaryCard_h
0002 #define L1RCTJetSummaryCard_h
0003 
0004 #include <vector>
0005 
0006 class L1RCTLookupTables;
0007 
0008 class L1RCTJetSummaryCard {
0009 public:
0010   // There is no default constructor.
0011   // It is required to have a crate number attached to it
0012   // for bookeeping purposes.
0013   L1RCTJetSummaryCard(int crtNo, const L1RCTLookupTables *rctLookupTables);
0014 
0015   // Disabled constructors and operators
0016   L1RCTJetSummaryCard() = delete;
0017 
0018   int crateNumber() { return crtNo; }
0019 
0020   // eGamma Objects
0021   // The object is defined by a 6 bit rank (temporarily set to 7 bit linear ET)
0022   // And a position defined by (crdNo and rgnNo)
0023   // The top four from each crate are returned
0024   // The order of the candidates is not defined in hardware
0025   // although, in the case of the emulator they may always be in
0026   // the descending order of rank
0027 
0028   std::vector<unsigned short> getIsolatedEGObjects() { return isolatedEGObjects; }
0029   std::vector<unsigned short> getNonisolatedEGObjects() { return nonisolatedEGObjects; }
0030 
0031   // Region sums 10-bit energy (bits 0-9),overflow (bit 10)
0032   // bit 11 is tau bit
0033 
0034   // Except for the HF regions, the data is only 8-bit wide
0035   // packed non-linearly with no interpretation of bits by RCT
0036   // However, temporarily, we set this to be 10-bit ET as well
0037   // in bits 0-9
0038 
0039   // The following Jet Summary Card output data are packed
0040   // in unsigned 16 bit words although in reality they
0041   // are limited to lower number of bits
0042 
0043   // There are 22 total regions (2 phi x 11 eta) including
0044   // HB, HE and HF
0045 
0046   // The data are arranged in the vector such that first
0047   // 11 unsigned values are for lower phi and the next
0048   // 11 unsigned values are for higher phi in the crate
0049 
0050   // Further, the order of placement in the vector is such
0051   // that the eta decreases from -5 to 0 for crates 0-8
0052   // and increases from 0 to +5 for crates 9-17
0053 
0054   std::vector<unsigned short> getJetRegions() { return jetRegions; }
0055   std::vector<unsigned short> getBarrelRegions() { return barrelRegions; }
0056   std::vector<unsigned short> getHFRegions() { return HFRegions; }
0057 
0058   // Muon bits consist of 14 quiet bits and 14 MIP bits
0059   // These are packed into one unsigned short each
0060   // The labeling of the bits is in the order
0061   // (crdNo0, rgnNo0), (crdNo0, rgnNo1)
0062   // (crdNo1, rgnNo0), (crdNo1, rgnNo1)
0063   // ...
0064   // (crdNo6, rgnNo0), (crdNo6, rgnNo1)
0065   // The same ordering is true for Quiet bits also
0066 
0067   unsigned short getMIPBits() { return mipBits; }
0068   unsigned short getQuietBits() { return quietBits; }
0069 
0070   unsigned short getTauBits() { return tauBits; }
0071   unsigned short getOverFlowBits() { return overFlowBits; }
0072 
0073   std::vector<unsigned short> getHFFineGrainBits() { return hfFineGrainBits; }
0074 
0075   void fillHFRegionSums(const std::vector<unsigned short> &hfRegionSums);
0076   void fillRegionSums(const std::vector<unsigned short> &regSums) { barrelRegions = regSums; }
0077   void fillJetRegions();
0078 
0079   void fillIsolatedEGObjects(const std::vector<unsigned short> &isoElectrons);
0080   void fillNonIsolatedEGObjects(const std::vector<unsigned short> &nonIsoElectrons);
0081 
0082   void fillMIPBits(const std::vector<unsigned short> &mip);
0083   void fillTauBits(const std::vector<unsigned short> &tau);
0084   void fillOverFlowBits(const std::vector<unsigned short> &overflow);
0085   void fillQuietBits();
0086 
0087   void print();
0088 
0089 private:
0090   int crtNo;
0091 
0092   const L1RCTLookupTables *rctLookupTables_;
0093 
0094   std::vector<unsigned short> isolatedEGObjects;
0095   std::vector<unsigned short> nonisolatedEGObjects;
0096   std::vector<unsigned short> jetRegions;
0097 
0098   std::vector<unsigned short> HFRegions;      // 8-bit et + fine grain?
0099   std::vector<unsigned short> barrelRegions;  // no, this is 10-bit et, not
0100                                               // (activityBit)(etIn9Bits)(HE_FGBit)(etIn7Bits)
0101 
0102   unsigned short mipBits;
0103   unsigned short quietBits;
0104   unsigned short tauBits;
0105   unsigned short overFlowBits;
0106 
0107   std::vector<unsigned short> hfFineGrainBits;
0108 
0109   // unsigned quietThreshold;
0110   unsigned quietThresholdBarrel;
0111   unsigned quietThresholdEndcap;
0112 
0113   void asicSort(std::vector<unsigned short> &electrons);
0114   void asicCompare(std::vector<unsigned short> &array);
0115 };
0116 #endif