Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:36

0001 ///
0002 /// Description: Firmware headers
0003 ///
0004 /// Implementation:
0005 ///    Concrete firmware implementations
0006 ///
0007 /// \author: Jim Brooke - University of Bristol
0008 ///
0009 
0010 //
0011 //
0012 
0013 #ifndef Stage2Layer2TauAlgorithmFirmware_H
0014 #define Stage2Layer2TauAlgorithmFirmware_H
0015 
0016 #include "L1Trigger/L1TCalorimeter/interface/Stage2Layer2TauAlgorithm.h"
0017 #include "L1Trigger/L1TCalorimeter/interface/CaloStage2Nav.h"
0018 #include "L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.h"
0019 
0020 namespace l1t {
0021 
0022   // Imp1 is for v1 and v2
0023   class Stage2Layer2TauAlgorithmFirmwareImp1 : public Stage2Layer2TauAlgorithm {
0024   public:
0025     Stage2Layer2TauAlgorithmFirmwareImp1(CaloParamsHelper const* params);  //const CaloMainProcessorParams & dbPars);
0026     ~Stage2Layer2TauAlgorithmFirmwareImp1() override;
0027     void processEvent(const std::vector<CaloCluster>& clusters,
0028                       const std::vector<CaloTower>& towers,
0029                       std::vector<Tau>& taus) override;
0030 
0031   private:
0032     void merging(const std::vector<l1t::CaloCluster>& clusters,
0033                  const std::vector<l1t::CaloTower>& towers,
0034                  std::vector<l1t::Tau>& taus);
0035     void dosorting(std::vector<l1t::Tau>& taus);
0036 
0037     // isolation
0038     int isoCalTauHwFootPrint(const l1t::CaloCluster&, const std::vector<l1t::CaloTower>&);
0039 
0040     //calibration
0041     void loadCalibrationLuts();
0042 
0043     // double calibratedPt(int hwPtEm, int hwPtHad, int ieta);
0044 
0045     // parameters
0046     CaloParamsHelper const* params_;
0047     std::vector<std::vector<float>> coefficients_;
0048 
0049     float offsetBarrelEH_;
0050     float offsetBarrelH_;
0051     float offsetEndcapsEH_;
0052     float offsetEndcapsH_;
0053     unsigned int isoLutIndex(int Et, int hweta, unsigned int nrTowers);
0054     unsigned int trimMainLutIndex(int neighPos, bool isWe);
0055     static bool compareTowers(l1t::CaloTower TT1, l1t::CaloTower TT2);  // implements operator < for TT
0056     bool is3x3Maximum(const l1t::CaloTower& tower,
0057                       const std::vector<CaloTower>& towers,
0058                       l1t::CaloStage2Nav& caloNav);  // is maximum in the 3x3 window? (recompute jet flag)
0059     std::vector<std::unique_ptr<l1t::CaloCluster>> makeSecClusters(
0060         const std::vector<l1t::CaloTower>& towers,
0061         std::vector<int>& sites,
0062         const l1t::CaloCluster& mainCluster,
0063         l1t::CaloStage2Nav& caloNav);  // make the secondary clusters fr merging (need to be deleted later)
0064     unsigned int calibLutIndex(int ieta, int Et, int hasEM, int isMerged);
0065     int calibratedPt(const l1t::CaloCluster& clus, const std::vector<l1t::CaloTower>& towers, int hwPt, bool isMerged);
0066   };
0067 
0068 }  // namespace l1t
0069 
0070 #endif