CMS 3D CMS Logo

Stage1Layer2JetAlgorithmImpPP.cc
Go to the documentation of this file.
1 
8 // This example implements algorithm version 1 and 2.
9 
16 
17 using namespace std;
18 using namespace l1t;
19 
20 Stage1Layer2JetAlgorithmImpPP::Stage1Layer2JetAlgorithmImpPP(CaloParamsHelper const* params) : params_(params) {};
21 
22 
23 void Stage1Layer2JetAlgorithmImpPP::processEvent(const std::vector<l1t::CaloRegion> & regions,
24  const std::vector<l1t::CaloEmCand> & EMCands,
25  std::vector<l1t::Jet> * jets,
26  std::vector<l1t::Jet> * preGtJets){
27 
28 
29  std::vector<l1t::CaloRegion> subRegions;
30  std::vector<l1t::Jet> uncalibjets;
31  std::vector<l1t::Jet> unSortedJets;
32  std::vector<l1t::Jet> preGtEtaJets;
33 
34  double towerLsb = params_->towerLsbSum();
35  int jetSeedThreshold = floor( params_->jetSeedThreshold()/towerLsb + 0.5);
36  std::string jetCalibrationType = params_->jetCalibrationType();
37  std::vector<double> jetCalibrationParams = params_->jetCalibrationParams();
38 
39  //Region Correction will return uncorrected subregions
40  //if regionPUSType is set to None in the config
41  RegionCorrection(regions, &subRegions, params_);
42 
43 
44  slidingWindowJetFinder(jetSeedThreshold, &subRegions, &uncalibjets);
45 
46  //will return jets with no response corrections
47  //if jetCalibrationType is set to None in the config
48  JetCalibration(&uncalibjets, jetCalibrationParams, &unSortedJets, jetCalibrationType, towerLsb);
49 
50  SortJets(&unSortedJets, &preGtEtaJets);
51 
52  // takes input jets (using region scales/eta) and outputs jets using Gt scales/eta
53  JetToGtEtaScales(params_, &preGtEtaJets, preGtJets);
54  JetToGtPtScales(params_, preGtJets, jets);
55 
56  //the jets should be sorted, highest pT first.
57  // do not truncate the tau list, GT converter handles that
58  // auto comp = [&](l1t::Jet i, l1t::Jet j)-> bool {
59  // return (i.hwPt() < j.hwPt() );
60  // };
61 
62  // std::sort(jets->begin(), jets->end(), comp);
63  // std::reverse(jets->begin(), jets->end());
64 }
void JetCalibration(std::vector< l1t::Jet > *uncalibjets, std::vector< double > jetCalibrationParams, std::vector< l1t::Jet > *jets, std::string jetCalibrationType, double jetLSB)
std::string const & jetCalibrationType() const
delete x;
Definition: CaloConfig.h:22
void SortJets(std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
void RegionCorrection(const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions, CaloParamsHelper const *params)
------— New region correction (PUsub, no response correction at the moment) --------— ...
std::vector< double > const & jetCalibrationParams() const
void processEvent(const std::vector< l1t::CaloRegion > &regions, const std::vector< l1t::CaloEmCand > &EMCands, std::vector< l1t::Jet > *jets, std::vector< l1t::Jet > *preGtJets) override
void JetToGtEtaScales(CaloParamsHelper const *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
vector< PseudoJet > jets
void JetToGtPtScales(CaloParamsHelper const *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
void slidingWindowJetFinder(const int, const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
double towerLsbSum() const
double jetSeedThreshold() const