Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-01 06:11:54

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