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::Stage1Layer2JetAlgorithmImpHI Class Reference

#include <Stage1Layer2JetAlgorithmImp.h>

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

Private Attributes

CaloParamsHelper *const params_
 

Detailed Description

Author
: R. Alex Barbieri MIT

Definition at line 27 of file Stage1Layer2JetAlgorithmImp.h.

Constructor & Destructor Documentation

Stage1Layer2JetAlgorithmImpHI::Stage1Layer2JetAlgorithmImpHI ( CaloParamsHelper params)

Definition at line 19 of file Stage1Layer2JetAlgorithmImpHI.cc.

19 : params_(params) { };
Stage1Layer2JetAlgorithmImpHI::~Stage1Layer2JetAlgorithmImpHI ( )
virtual

Definition at line 21 of file Stage1Layer2JetAlgorithmImpHI.cc.

21 {};

Member Function Documentation

void Stage1Layer2JetAlgorithmImpHI::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 25 of file Stage1Layer2JetAlgorithmImpHI.cc.

References gather_cfg::cout, l1t::HICaloRingSubtraction(), l1t::CaloParamsHelper::jetRegionMask(), l1t::CaloParamsHelper::jetSeedThreshold(), l1t::JetToGtEtaScales(), l1t::JetToGtPtScales(), l1t::pack15bits(), l1t::pack16bits(), params_, l1t::SortJets(), cond::to_string(), and l1t::TwoByTwoFinder().

28  {
29 
30  //std::vector<double> regionPUSParams = params_->regionPUSParams();
31  int jetThreshold = params_->jetSeedThreshold();
32 
33  unsigned int etaMask = params_->jetRegionMask();
34 
35  std::vector<l1t::CaloRegion> *subRegions = new std::vector<l1t::CaloRegion>();
36  std::vector<l1t::Jet> *unSortedJets = new std::vector<l1t::Jet>();
37  std::vector<l1t::Jet> *preGtEtaJets = new std::vector<l1t::Jet>();
38  std::vector<l1t::Jet> *preRankJets = new std::vector<l1t::Jet>();
39 
40  HICaloRingSubtraction(regions, subRegions, params_);
41  TwoByTwoFinder(jetThreshold, etaMask, subRegions, preRankJets);
42  //slidingWindowJetFinder(0, subRegions, unSortedJets);
43  JetToGtPtScales(params_, preRankJets, unSortedJets);
44  //verboseDumpJets(*unSortedJets);
45  SortJets(unSortedJets, preGtEtaJets);
46  JetToGtEtaScales(params_, preGtEtaJets, preGtJets);
47  JetToGtEtaScales(params_, preGtEtaJets, jets);
48  //JetToGtPtScales(params_, preGtJets, jets);
49 
50  delete subRegions;
51  delete unSortedJets;
52  delete preGtEtaJets;
53 
54  const bool verbose = false;
55  const bool hex = true;
56  if(verbose)
57  {
58  if(!hex)
59  {
60  int cJets = 0;
61  int fJets = 0;
62  printf("Jets Central\n");
63  //printf("pt\teta\tphi\n");
64  for(std::vector<l1t::Jet>::const_iterator itJet = jets->begin();
65  itJet != jets->end(); ++itJet){
66  if((itJet->hwQual() & 2) == 2) continue;
67  cJets++;
68  unsigned int packed = pack15bits(itJet->hwPt(), itJet->hwEta(), itJet->hwPhi());
69  cout << bitset<15>(packed).to_string() << endl;
70  if(cJets == 4) break;
71  }
72 
73  printf("Jets Forward\n");
74  //printf("pt\teta\tphi\n");
75  for(std::vector<l1t::Jet>::const_iterator itJet = jets->begin();
76  itJet != jets->end(); ++itJet){
77  if((itJet->hwQual() & 2) != 2) continue;
78  fJets++;
79  unsigned int packed = pack15bits(itJet->hwPt(), itJet->hwEta(), itJet->hwPhi());
80  cout << bitset<15>(packed).to_string() << endl;
81 
82  if(fJets == 4) break;
83  }
84  } else {
85  std::cout << "Jets" << std::endl;
86  l1t::Jet ajets[8];
87  for(std::vector<l1t::Jet>::const_iterator itJet = jets->begin();
88  itJet != jets->end(); ++itJet){
89  ajets[itJet - jets->begin()] = *itJet;
90  }
91  //std::cout << "Jets (hex)" << std::endl;
92  std::cout << std::hex << pack16bits(ajets[0].hwPt(), ajets[0].hwEta(), ajets[0].hwPhi());
93  std::cout << " ";
94  std::cout << std::hex << pack16bits(ajets[1].hwPt(), ajets[1].hwEta(), ajets[1].hwPhi());
95  std::cout << " ";
96  std::cout << std::hex << pack16bits(ajets[4].hwPt(), ajets[4].hwEta(), ajets[4].hwPhi());
97  std::cout << " ";
98  std::cout << std::hex << pack16bits(ajets[5].hwPt(), ajets[5].hwEta(), ajets[5].hwPhi());
99  std::cout << std::endl;
100  std::cout << std::hex << pack16bits(ajets[2].hwPt(), ajets[2].hwEta(), ajets[2].hwPhi());
101  std::cout << " ";
102  std::cout << std::hex << pack16bits(ajets[3].hwPt(), ajets[3].hwEta(), ajets[3].hwPhi());
103  std::cout << " ";
104  std::cout << std::hex << pack16bits(ajets[6].hwPt(), ajets[6].hwEta(), ajets[6].hwPhi());
105  std::cout << " ";
106  std::cout << std::hex << pack16bits(ajets[7].hwPt(), ajets[7].hwEta(), ajets[7].hwPhi());
107  std::cout << std::endl;
108  }
109  }
110 }
void SortJets(std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
Definition: Jet.h:13
std::string to_string(const T &t)
Definition: Logger.cc:26
void TwoByTwoFinder(const int, const int, const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
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)
unsigned int pack15bits(int pt, int eta, int phi)
unsigned int pack16bits(int pt, int eta, int phi)
tuple cout
Definition: gather_cfg.py:121
double jetSeedThreshold() const
void HICaloRingSubtraction(const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions, CaloParamsHelper *params)
------------— For heavy ion ----------------------------------—

Member Data Documentation

CaloParamsHelper* const l1t::Stage1Layer2JetAlgorithmImpHI::params_
private

Definition at line 36 of file Stage1Layer2JetAlgorithmImp.h.

Referenced by processEvent().