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

#include <Stage2Layer2JetSumAlgorithmFirmware.h>

Inheritance diagram for l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1:
l1t::Stage2Layer2JetSumAlgorithm

Public Member Functions

virtual void processEvent (const std::vector< l1t::Jet > &alljets, std::vector< l1t::EtSum > &htsums)
 
 Stage2Layer2JetSumAlgorithmFirmwareImp1 (CaloParamsHelper *params)
 
virtual ~Stage2Layer2JetSumAlgorithmFirmwareImp1 ()
 
- Public Member Functions inherited from l1t::Stage2Layer2JetSumAlgorithm
virtual ~Stage2Layer2JetSumAlgorithm ()
 

Private Attributes

int32_t etSumEtaMaxEt_
 
int32_t etSumEtaMaxMet_
 
int32_t etSumEtaMinEt_
 
int32_t etSumEtaMinMet_
 
int32_t etSumEtThresholdHwEt_
 
int32_t etSumEtThresholdHwMet_
 
CaloParamsHelperparams_
 

Detailed Description

Author
: Jim Brooke

Description: first iteration of stage 2 jet algo

Definition at line 22 of file Stage2Layer2JetSumAlgorithmFirmware.h.

Constructor & Destructor Documentation

l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::Stage2Layer2JetSumAlgorithmFirmwareImp1 ( CaloParamsHelper params)

Definition at line 11 of file Stage2Layer2JetSumAlgorithmFirmwareImp1.cc.

References l1t::CaloParamsHelper::etSumEtaMax(), etSumEtaMaxEt_, etSumEtaMaxMet_, l1t::CaloParamsHelper::etSumEtaMin(), etSumEtaMinEt_, etSumEtaMinMet_, l1t::CaloParamsHelper::etSumEtThreshold(), etSumEtThresholdHwEt_, etSumEtThresholdHwMet_, l1t::CaloParamsHelper::jetLsb(), and params_.

11  :
12  params_(params)
13 {
16 
19 
22 }
double etSumEtThreshold(unsigned isum) const
int etSumEtaMax(unsigned isum) const
int etSumEtaMin(unsigned isum) const
double jetLsb() const
l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::~Stage2Layer2JetSumAlgorithmFirmwareImp1 ( )
virtual

Definition at line 25 of file Stage2Layer2JetSumAlgorithmFirmwareImp1.cc.

25  {
26 
27 
28 }

Member Function Documentation

void l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::processEvent ( const std::vector< l1t::Jet > &  alljets,
std::vector< l1t::EtSum > &  htsums 
)
virtual

Implements l1t::Stage2Layer2JetSumAlgorithm.

Definition at line 31 of file Stage2Layer2JetSumAlgorithmFirmwareImp1.cc.

References funct::cos(), HLT_25ns14e33_v1_cff::etaMax, HLT_25ns14e33_v1_cff::etaMin, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPt(), i, M_PI, p4, funct::sin(), and estimatePileup_makeJSON::trunc.

32 {
33 
34  int etaMax=40, etaMin=1, phiMax=72, phiMin=1;
35 
36  // etaSide=1 is positive eta, etaSide=-1 is negative eta
37  for (int etaSide=1; etaSide>=-1; etaSide-=2) {
38 
39  int32_t hx(0), hy(0), ht(0);
40 
41  std::vector<int> rings;
42  for (int i=etaMin; i<=etaMax; i++) rings.push_back(i*etaSide);
43 
44  // loop over rings
45  for (unsigned etaIt=0; etaIt<rings.size(); etaIt++) {
46 
47  int ieta = rings.at(etaIt);
48 
49  int32_t ringHx(0), ringHy(0), ringHt(0);
50 
51  // loop over phi
52  for (int iphi=phiMin; iphi<=phiMax; iphi++) {
53 
54  // find the jet at this (eta,phi)
55  l1t::Jet thisJet;
56  bool foundJet = false;
57  for (unsigned jetIt=0; jetIt<alljets.size(); jetIt++) {
58  if (alljets.at(jetIt).hwEta()==ieta && alljets.at(jetIt).hwPhi()==iphi) {
59  thisJet = alljets.at(jetIt);
60  foundJet = true;
61  }
62  }
63  if (!foundJet) continue;
64 
65  if (thisJet.hwPt()>etSumEtThresholdHwMet_ && thisJet.hwEta()>=etSumEtaMinMet_ && thisJet.hwEta()<=etSumEtaMaxMet_) {
66  ringHx += (int32_t) ( thisJet.hwPt() * std::trunc ( 511. * cos ( 2 * M_PI * (72 - iphi) / 72.0 ) )) >> 10;
67  ringHy += (int32_t) ( thisJet.hwPt() * std::trunc ( 511. * sin ( 2 * M_PI * iphi / 72.0 ) )) >> 10;
68  }
69 
70  if (thisJet.hwPt()>etSumEtThresholdHwEt_ && thisJet.hwEta()>=etSumEtaMinEt_ && thisJet.hwEta()<=etSumEtaMaxEt_) {
71  ringHt += thisJet.hwPt();
72  }
73  }
74 
75  hx += (ringHx >> 5);
76  hy += (ringHy >> 5);
77  ht += (ringHt >> 5);
78 
79  }
80 
82 
83  l1t::EtSum htSumHt(p4,l1t::EtSum::EtSumType::kTotalHt,ht,0,0,0);
84  l1t::EtSum htSumHx(p4,l1t::EtSum::EtSumType::kTotalHtx,hx,0,0,0);
85  l1t::EtSum htSumHy(p4,l1t::EtSum::EtSumType::kTotalHty,hy,0,0,0);
86 
87  htsums.push_back(htSumHt);
88  htsums.push_back(htSumHx);
89  htsums.push_back(htSumHy);
90 
91  }
92 }
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Definition: Jet.h:13
double p4[4]
Definition: TauolaWrapper.h:92
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int hwEta() const
Definition: L1Candidate.cc:74
#define M_PI
int hwPt() const
Definition: L1Candidate.cc:69

Member Data Documentation

int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtaMaxEt_
private
int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtaMaxMet_
private
int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtaMinEt_
private
int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtaMinMet_
private
int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtThresholdHwEt_
private
int32_t l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::etSumEtThresholdHwMet_
private
CaloParamsHelper* l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::params_
private