Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ///
0002 /// \class l1t::Stage1Layer2JetAlgorithmImpHI
0003 ///
0004 ///
0005 /// \author: R. Alex Barbieri MIT
0006 ///
0007 
0008 // This example implements algorithm version 1 and 2.
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/JetCalibrationMethods.h"
0014 #include "L1Trigger/L1TCalorimeter/interface/legacyGtHelper.h"
0015 #include "L1Trigger/L1TCalorimeter/interface/HardwareSortingMethods.h"
0016 
0017 using namespace std;
0018 using namespace l1t;
0019 
0020 Stage1Layer2JetAlgorithmImpPP::Stage1Layer2JetAlgorithmImpPP(CaloParamsHelper const* params) : params_(params){};
0021 
0022 void Stage1Layer2JetAlgorithmImpPP::processEvent(const std::vector<l1t::CaloRegion>& regions,
0023                                                  const std::vector<l1t::CaloEmCand>& EMCands,
0024                                                  std::vector<l1t::Jet>* jets,
0025                                                  std::vector<l1t::Jet>* preGtJets) {
0026   std::vector<l1t::CaloRegion> subRegions;
0027   std::vector<l1t::Jet> uncalibjets;
0028   std::vector<l1t::Jet> unSortedJets;
0029   std::vector<l1t::Jet> preGtEtaJets;
0030 
0031   double towerLsb = params_->towerLsbSum();
0032   int jetSeedThreshold = floor(params_->jetSeedThreshold() / towerLsb + 0.5);
0033   std::string jetCalibrationType = params_->jetCalibrationType();
0034   std::vector<double> jetCalibrationParams = params_->jetCalibrationParams();
0035 
0036   //Region Correction will return uncorrected subregions
0037   //if regionPUSType is set to None in the config
0038   RegionCorrection(regions, &subRegions, params_);
0039 
0040   slidingWindowJetFinder(jetSeedThreshold, &subRegions, &uncalibjets);
0041 
0042   //will return jets with no response corrections
0043   //if jetCalibrationType is set to None in the config
0044   JetCalibration(&uncalibjets, jetCalibrationParams, &unSortedJets, jetCalibrationType, towerLsb);
0045 
0046   SortJets(&unSortedJets, &preGtEtaJets);
0047 
0048   // takes input jets (using region scales/eta) and outputs jets using Gt scales/eta
0049   JetToGtEtaScales(params_, &preGtEtaJets, preGtJets);
0050   JetToGtPtScales(params_, preGtJets, jets);
0051 
0052   //the jets should be sorted, highest pT first.
0053   // do not truncate the tau list, GT converter handles that
0054   // auto comp = [&](l1t::Jet i, l1t::Jet j)-> bool {
0055   //   return (i.hwPt() < j.hwPt() );
0056   // };
0057 
0058   // std::sort(jets->begin(), jets->end(), comp);
0059   // std::reverse(jets->begin(), jets->end());
0060 }