Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ///
0002 /// \class l1t::Stage1Layer2JetAlgorithmImpSimpleHW
0003 ///
0004 ///
0005 /// \author: R. Alex Barbieri MIT
0006 ///
0007 
0008 // This is a simple algorithm for use in comparing with early versions of the Stage1 firmware
0009 
0010 #include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2JetAlgorithmImp.h"
0011 #include "L1Trigger/L1TCalorimeter/interface/JetFinderMethods.h"
0012 #include "L1Trigger/L1TCalorimeter/interface/PUSubtractionMethods.h"
0013 #include "L1Trigger/L1TCalorimeter/interface/legacyGtHelper.h"
0014 #include "L1Trigger/L1TCalorimeter/interface/HardwareSortingMethods.h"
0015 
0016 #include <bitset>
0017 #include <iostream>
0018 
0019 using namespace std;
0020 using namespace l1t;
0021 
0022 Stage1Layer2JetAlgorithmImpSimpleHW::Stage1Layer2JetAlgorithmImpSimpleHW(CaloParamsHelper const* params)
0023     : params_(params) {}
0024 
0025 void Stage1Layer2JetAlgorithmImpSimpleHW::processEvent(const std::vector<l1t::CaloRegion>& regions,
0026                                                        const std::vector<l1t::CaloEmCand>& EMCands,
0027                                                        std::vector<l1t::Jet>* jets,
0028                                                        std::vector<l1t::Jet>* debugJets) {
0029   std::vector<l1t::CaloRegion> subRegions;
0030   std::vector<l1t::Jet> preGtEtaJets;
0031   std::vector<l1t::Jet> calibratedRankedJets;
0032   std::vector<l1t::Jet> sortedJets;
0033 
0034   double towerLsb = params_->towerLsbSum();
0035   int jetSeedThreshold = floor(params_->jetSeedThreshold() / towerLsb + 0.5);
0036 
0037   RegionCorrection(regions, &subRegions, params_);
0038 
0039   slidingWindowJetFinder(jetSeedThreshold, &subRegions, &preGtEtaJets);
0040 
0041   calibrateAndRankJets(params_, &preGtEtaJets, &calibratedRankedJets);
0042 
0043   SortJets(&calibratedRankedJets, &sortedJets);
0044 
0045   JetToGtEtaScales(params_, &sortedJets, jets);
0046   JetToGtEtaScales(params_, &preGtEtaJets, debugJets);
0047   //JetToGtPtScales(params_, preGtJets, jets);
0048 }