CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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* params) : params_(params) {};
21 
23 
24 
25 void Stage1Layer2JetAlgorithmImpPP::processEvent(const std::vector<l1t::CaloRegion> & regions,
26  const std::vector<l1t::CaloEmCand> & EMCands,
27  std::vector<l1t::Jet> * jets,
28  std::vector<l1t::Jet> * preGtJets){
29 
30 
31  std::vector<l1t::CaloRegion> * subRegions = new std::vector<l1t::CaloRegion>();
32  std::vector<l1t::Jet> * uncalibjets = new std::vector<l1t::Jet>();
33  std::vector<l1t::Jet> * unSortedJets = new std::vector<l1t::Jet>();
34  std::vector<l1t::Jet> * preGtEtaJets = new std::vector<l1t::Jet>();
35 
36  double towerLsb = params_->towerLsbSum();
37  int jetSeedThreshold = floor( params_->jetSeedThreshold()/towerLsb + 0.5);
38  std::string jetCalibrationType = params_->jetCalibrationType();
39  std::vector<double> jetCalibrationParams = params_->jetCalibrationParams();
40 
41  //Region Correction will return uncorrected subregions
42  //if regionPUSType is set to None in the config
43  RegionCorrection(regions, subRegions, params_);
44 
45 
46  slidingWindowJetFinder(jetSeedThreshold, subRegions, uncalibjets);
47 
48  //will return jets with no response corrections
49  //if jetCalibrationType is set to None in the config
50  JetCalibration(uncalibjets, jetCalibrationParams, unSortedJets, jetCalibrationType, towerLsb);
51 
52  SortJets(unSortedJets, preGtEtaJets);
53 
54  // takes input jets (using region scales/eta) and outputs jets using Gt scales/eta
55  JetToGtEtaScales(params_, preGtEtaJets, preGtJets);
56  JetToGtPtScales(params_, preGtJets, jets);
57 
58  delete subRegions;
59  delete uncalibjets;
60  delete unSortedJets;
61  delete preGtEtaJets;
62 
63  //the jets should be sorted, highest pT first.
64  // do not truncate the tau list, GT converter handles that
65  // auto comp = [&](l1t::Jet i, l1t::Jet j)-> bool {
66  // return (i.hwPt() < j.hwPt() );
67  // };
68 
69  // std::sort(jets->begin(), jets->end(), comp);
70  // std::reverse(jets->begin(), jets->end());
71 }
std::vector< double > jetCalibrationParams()
void JetCalibration(std::vector< l1t::Jet > *uncalibjets, std::vector< double > jetCalibrationParams, std::vector< l1t::Jet > *jets, std::string jetCalibrationType, double jetLSB)
void RegionCorrection(const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions, CaloParamsHelper *params)
------— New region correction (PUsub, no response correction at the moment) --------— ...
void SortJets(std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
virtual void processEvent(const std::vector< l1t::CaloRegion > &regions, const std::vector< l1t::CaloEmCand > &EMCands, std::vector< l1t::Jet > *jets, std::vector< l1t::Jet > *preGtJets)
std::string jetCalibrationType() const
vector< PseudoJet > jets
void JetToGtEtaScales(CaloParamsHelper *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
void JetToGtPtScales(CaloParamsHelper *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