CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
l1t::Stage1Layer2JetAlgorithmImpSimpleHW Class Reference

#include <Stage1Layer2JetAlgorithmImp.h>

Inheritance diagram for l1t::Stage1Layer2JetAlgorithmImpSimpleHW:
l1t::Stage1Layer2JetAlgorithm

Public Member Functions

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)
 
 Stage1Layer2JetAlgorithmImpSimpleHW (CaloParamsHelper *params)
 
virtual ~Stage1Layer2JetAlgorithmImpSimpleHW ()
 
- Public Member Functions inherited from l1t::Stage1Layer2JetAlgorithm
virtual ~Stage1Layer2JetAlgorithm ()
 

Private Attributes

CaloParamsHelper *const params_
 

Detailed Description

Author
: R. Alex Barbieri MIT

Definition at line 53 of file Stage1Layer2JetAlgorithmImp.h.

Constructor & Destructor Documentation

Stage1Layer2JetAlgorithmImpSimpleHW::Stage1Layer2JetAlgorithmImpSimpleHW ( CaloParamsHelper params)

Definition at line 22 of file Stage1Layer2JetAlgorithmImpSimpleHW.cc.

22  : params_(params)
23 {
24 }
Stage1Layer2JetAlgorithmImpSimpleHW::~Stage1Layer2JetAlgorithmImpSimpleHW ( )
virtual

Definition at line 26 of file Stage1Layer2JetAlgorithmImpSimpleHW.cc.

26 {};

Member Function Documentation

void Stage1Layer2JetAlgorithmImpSimpleHW::processEvent ( const std::vector< l1t::CaloRegion > &  regions,
const std::vector< l1t::CaloEmCand > &  EMCands,
std::vector< l1t::Jet > *  jets,
std::vector< l1t::Jet > *  preGtJets 
)
virtual

Implements l1t::Stage1Layer2JetAlgorithm.

Definition at line 28 of file Stage1Layer2JetAlgorithmImpSimpleHW.cc.

References l1t::calibrateAndRankJets(), gather_cfg::cout, l1t::CaloParamsHelper::jetSeedThreshold(), l1t::JetToGtEtaScales(), convertSQLitetoXML_cfg::output, l1t::pack15bits(), params_, l1t::RegionCorrection(), l1t::slidingWindowJetFinder(), l1t::SortJets(), cond::to_string(), and l1t::CaloParamsHelper::towerLsbSum().

31  {
32 
33  std::vector<l1t::CaloRegion> *subRegions = new std::vector<l1t::CaloRegion>();
34  std::vector<l1t::Jet> *preGtEtaJets = new std::vector<l1t::Jet>();
35  std::vector<l1t::Jet> *calibratedRankedJets = new std::vector<l1t::Jet>();
36  std::vector<l1t::Jet> *sortedJets = new std::vector<l1t::Jet>();
37 
38  double towerLsb = params_->towerLsbSum();
39  int jetSeedThreshold = floor( params_->jetSeedThreshold()/towerLsb + 0.5);
40 
41  RegionCorrection(regions, subRegions, params_);
42 
43  slidingWindowJetFinder(jetSeedThreshold, subRegions, preGtEtaJets);
44 
45  calibrateAndRankJets(params_, preGtEtaJets, calibratedRankedJets);
46 
47  SortJets(calibratedRankedJets, sortedJets);
48 
49  JetToGtEtaScales(params_, sortedJets, jets);
50  JetToGtEtaScales(params_, preGtEtaJets, debugJets);
51  //JetToGtPtScales(params_, preGtJets, jets);
52 
53  const bool verbose = false;
54  const bool hex = false;
55  if(verbose)
56  {
57  int cJets = 0;
58  int fJets = 0;
59  printf("Jets Central\n");
60  //printf("pt\teta\tphi\n");
61  for(std::vector<l1t::Jet>::const_iterator itJet = jets->begin();
62  itJet != jets->end(); ++itJet){
63  if((itJet->hwQual() & 2) == 2) continue;
64  cJets++;
65  if(!hex)
66  {
67  unsigned int packed = pack15bits(itJet->hwPt(), itJet->hwEta(), itJet->hwPhi());
68  cout << bitset<15>(packed).to_string() << endl;
69  } else {
70  uint32_t output = itJet->hwPt() + (itJet->hwEta() << 6) + (itJet->hwPhi() << 10);
71  std::cout << std::hex << std::setw(4) << std::setfill('0') << output << std::endl;
72  }
73  if(cJets == 4) break;
74  }
75 
76  printf("Jets Forward\n");
77  //printf("pt\teta\tphi\n");
78  for(std::vector<l1t::Jet>::const_iterator itJet = jets->begin();
79  itJet != jets->end(); ++itJet){
80  if((itJet->hwQual() & 2) != 2) continue;
81  fJets++;
82  if(!hex)
83  {
84  unsigned int packed = pack15bits(itJet->hwPt(), itJet->hwEta(), itJet->hwPhi());
85  cout << bitset<15>(packed).to_string() << endl;
86  } else {
87  uint32_t output = itJet->hwPt() + (itJet->hwEta() << 6) + (itJet->hwPhi() << 10);
88  std::cout << std::hex << std::setw(4) << std::setfill('0') << output << std::endl;
89  }
90 
91  if(fJets == 4) break;
92  }
93  }
94 
95  delete subRegions;
96  delete preGtEtaJets;
97  delete calibratedRankedJets;
98  delete sortedJets;
99 }
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 calibrateAndRankJets(CaloParamsHelper *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
void SortJets(std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
std::string to_string(const T &t)
Definition: Logger.cc:26
vector< PseudoJet > jets
void JetToGtEtaScales(CaloParamsHelper *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
unsigned int pack15bits(int pt, int eta, int phi)
void slidingWindowJetFinder(const int, const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
double towerLsbSum() const
tuple cout
Definition: gather_cfg.py:121
double jetSeedThreshold() const

Member Data Documentation

CaloParamsHelper* const l1t::Stage1Layer2JetAlgorithmImpSimpleHW::params_
private

Definition at line 62 of file Stage1Layer2JetAlgorithmImp.h.

Referenced by processEvent().