Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef UCTLayer1_hh
0002 #define UCTLayer1_hh
0003 
0004 #include <vector>
0005 
0006 class UCTCrate;
0007 class UCTRegion;
0008 class UCTTower;
0009 
0010 #include "UCTGeometry.hh"
0011 
0012 class UCTLayer1 {
0013 public:
0014   // Layer1 hardware firmware version
0015   // Default (0): initial version for 2016 running
0016   // 1: Update to include saturated tower codes to layer 2
0017   //    (put online at run >= 275908: http://cmsonline.cern.ch/cms-elog/931059)
0018   // 2: Update for all-LUT processing, initially no change in behavior
0019   //    (put online at run >= 291173: http://cmsonline.cern.ch/cms-elog/973914)
0020   // 3: Update to handle saturation codes HF (and do division in LUT, and consider HBHE saturation before decompression)
0021   //    (put online at run >= 299756: http://cmsonline.cern.ch/cms-elog/999604)
0022   //
0023   UCTLayer1(int fwv = 0);
0024 
0025   // No copy constructor is needed
0026 
0027   UCTLayer1(const UCTLayer1&) = delete;
0028 
0029   // No equality operator is needed
0030 
0031   const UCTLayer1& operator=(const UCTLayer1&) = delete;
0032 
0033   virtual ~UCTLayer1();
0034 
0035   // To access Layer1 information
0036 
0037   std::vector<UCTCrate*>& getCrates() { return crates; }
0038   const UCTRegion* getRegion(UCTRegionIndex r) const { return getRegion(r.first, r.second); }
0039   const UCTTower* getTower(UCTTowerIndex t) const { return getTower(t.first, t.second); }
0040 
0041   // To zero out event in case of selective tower filling
0042   bool clearEvent();
0043   // To be called for each non-zero tower to set the event
0044   // If calling for all towers clearEvent() can be avoided
0045   bool setECALData(UCTTowerIndex t, bool ecalFG, uint32_t ecalET);
0046   bool setHCALData(UCTTowerIndex t, uint32_t hcalFB, uint32_t hcalET);
0047   // To process event
0048   bool process();
0049 
0050   // More access functions
0051 
0052   uint32_t getSummary() { return uctSummary; }
0053   uint32_t et() { return uctSummary; }
0054 
0055   friend std::ostream& operator<<(std::ostream&, const UCTLayer1&);
0056 
0057 private:
0058   // Helper functions
0059 
0060   const UCTRegion* getRegion(int regionEtaIndex, uint32_t regionPhiIndex) const;
0061   const UCTTower* getTower(int caloEtaIndex, int caloPhiIndex) const;
0062 
0063   //Private data
0064 
0065   std::vector<UCTCrate*> crates;
0066 
0067   uint32_t uctSummary;
0068   const int fwVersion;
0069 };
0070 
0071 #endif