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 Member Functions | Private Attributes | Friends
L1RCTParameters Class Reference

#include <CondFormats/L1TObjects/interface/L1RCTParameters.h>

Public Member Functions

unsigned short calcCard (unsigned short rct_iphi, unsigned short absIeta) const
 
unsigned short calcCrate (unsigned short rct_iphi, short ieta) const
 
unsigned short calcIAbsEta (unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
 
short calcIEta (unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
 
unsigned short calcIPhi (unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
 
unsigned short calcTower (unsigned short rct_iphi, unsigned short absIeta) const
 
double eActivityCut () const
 
const std::vector< double > & eGammaECalScaleFactors () const
 
const std::vector< double > & eGammaHCalScaleFactors () const
 
double eGammaLSB () const
 
float EGammaTPGSum (const float &ecal, const float &hcal, const unsigned &iAbsEta) const
 
unsigned eicIsolationThreshold () const
 
double eMaxForFGCut () const
 
double eMaxForHoECut () const
 
double eMinForFGCut () const
 
double eMinForHoECut () const
 
double hActivityCut () const
 
double hMinForHoECut () const
 
double hOeCut () const
 
const std::vector< double > & jetMETECalScaleFactors () const
 
const std::vector< double > & jetMETHCalScaleFactors () const
 
double jetMETLSB () const
 
float JetMETTPGSum (const float &ecal, const float &hcal, const unsigned &iAbsEta) const
 
unsigned jscQuietThresholdBarrel () const
 
unsigned jscQuietThresholdEndcap () const
 
 L1RCTParameters ()
 
 L1RCTParameters (double eGammaLSB, double jetMETLSB, double eMinForFGCut, double eMaxForFGCut, double hOeCut, double eMinForHoECut, double eMaxForHoECut, double hMinForHoECut, double eActivityCut, double hActivityCut, unsigned eicIsolationThreshold, unsigned jscQuietThresholdBarrel, unsigned jscQuietThresholdEndcap, bool noiseVetoHB, bool noiseVetoHEplus, bool noiseVetoHEminus, bool useLindsey, const std::vector< double > &eGammaECalScaleFactors, const std::vector< double > &eGammaHCalScaleFactors, const std::vector< double > &jetMETECalScaleFactors, const std::vector< double > &jetMETHCalScaleFactors, const std::vector< double > &ecal_calib, const std::vector< double > &hcal_calib, const std::vector< double > &hcal_high_calib, const std::vector< double > &cross_terms, const std::vector< double > &lowHoverE_smear, const std::vector< double > &highHoverE_smear)
 
bool noiseVetoHB () const
 
bool noiseVetoHEminus () const
 
bool noiseVetoHEplus () const
 
void print (std::ostream &s) const
 
 ~L1RCTParameters ()
 

Private Member Functions

float correctedTPGSum (const float &ecal, const float &hcal, const unsigned &index) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< std::vector
< double > > 
cross_terms_
 
double eActivityCut_
 
std::vector< std::vector
< double > > 
ecal_calib_
 
std::vector< double > eGammaECalScaleFactors_
 
std::vector< double > eGammaHCalScaleFactors_
 
double eGammaLSB_
 
unsigned eicIsolationThreshold_
 
double eMaxForFGCut_
 
double eMaxForHoECut_
 
double eMinForFGCut_
 
double eMinForHoECut_
 
double hActivityCut_
 
std::vector< std::vector
< double > > 
hcal_calib_
 
std::vector< std::vector
< double > > 
hcal_high_calib_
 
double hMinForHoECut_
 
double hOeCut_
 
std::vector< double > HoverE_smear_high_
 
std::vector< double > HoverE_smear_low_
 
std::vector< double > jetMETECalScaleFactors_
 
std::vector< double > jetMETHCalScaleFactors_
 
double jetMETLSB_
 
unsigned jscQuietThresholdBarrel_
 
unsigned jscQuietThresholdEndcap_
 
bool noiseVetoHB_
 
bool noiseVetoHEminus_
 
bool noiseVetoHEplus_
 
bool useCorrections_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Description: Class to contain parameters which define RCT Lookup Tables

Usage: <usage>

Definition at line 28 of file L1RCTParameters.h.

Constructor & Destructor Documentation

L1RCTParameters::L1RCTParameters ( )
inline

Definition at line 33 of file L1RCTParameters.h.

33 {}
L1RCTParameters::L1RCTParameters ( double  eGammaLSB,
double  jetMETLSB,
double  eMinForFGCut,
double  eMaxForFGCut,
double  hOeCut,
double  eMinForHoECut,
double  eMaxForHoECut,
double  hMinForHoECut,
double  eActivityCut,
double  hActivityCut,
unsigned  eicIsolationThreshold,
unsigned  jscQuietThresholdBarrel,
unsigned  jscQuietThresholdEndcap,
bool  noiseVetoHB,
bool  noiseVetoHEplus,
bool  noiseVetoHEminus,
bool  useLindsey,
const std::vector< double > &  eGammaECalScaleFactors,
const std::vector< double > &  eGammaHCalScaleFactors,
const std::vector< double > &  jetMETECalScaleFactors,
const std::vector< double > &  jetMETHCalScaleFactors,
const std::vector< double > &  ecal_calib,
const std::vector< double > &  hcal_calib,
const std::vector< double > &  hcal_high_calib,
const std::vector< double > &  cross_terms,
const std::vector< double > &  lowHoverE_smear,
const std::vector< double > &  highHoverE_smear 
)

Definition at line 17 of file L1RCTParameters.cc.

References cross_terms_, ecal_calib_, hcal_calib_, hcal_high_calib_, and i.

44  :
49  hOeCut_(hOeCut),
61  useCorrections_(useCorrections),
66  HoverE_smear_low_(lowHoverE_smear),
67  HoverE_smear_high_(highHoverE_smear)
68 {
69  ecal_calib_.resize(28);
70  hcal_calib_.resize(28);
71  hcal_high_calib_.resize(28);
72  cross_terms_.resize(28);
73 
74  for(unsigned i = 0; i < ecal_calib.size(); ++i)
75  ecal_calib_[i/3].push_back(ecal_calib[i]);
76  for(unsigned i = 0; i < hcal_calib.size(); ++i)
77  hcal_calib_[i/3].push_back(hcal_calib[i]);
78  for(unsigned i = 0; i < hcal_high_calib.size(); ++i)
79  hcal_high_calib_[i/3].push_back(hcal_high_calib[i]);
80  for(unsigned i = 0; i < cross_terms.size(); ++i)
81  cross_terms_[i/6].push_back(cross_terms[i]);
82 
83 }
const std::vector< double > & eGammaHCalScaleFactors() const
const std::vector< double > & jetMETHCalScaleFactors() const
int i
Definition: DBlmapReader.cc:9
double eMaxForFGCut() const
std::vector< double > jetMETECalScaleFactors_
const std::vector< double > & eGammaECalScaleFactors() const
unsigned eicIsolationThreshold() const
double eMinForFGCut() const
unsigned jscQuietThresholdBarrel_
bool noiseVetoHEminus() const
std::vector< double > eGammaECalScaleFactors_
double eActivityCut() const
std::vector< std::vector< double > > cross_terms_
std::vector< std::vector< double > > hcal_high_calib_
std::vector< double > HoverE_smear_low_
unsigned jscQuietThresholdEndcap() const
bool noiseVetoHEplus() const
unsigned jscQuietThresholdEndcap_
const std::vector< double > & jetMETECalScaleFactors() const
double hActivityCut() const
double eMinForHoECut() const
std::vector< double > jetMETHCalScaleFactors_
double jetMETLSB() const
std::vector< std::vector< double > > hcal_calib_
bool noiseVetoHB() const
double eGammaLSB() const
double hOeCut() const
std::vector< double > HoverE_smear_high_
std::vector< double > eGammaHCalScaleFactors_
std::vector< std::vector< double > > ecal_calib_
unsigned eicIsolationThreshold_
double eMaxForHoECut() const
unsigned jscQuietThresholdBarrel() const
double hMinForHoECut() const
L1RCTParameters::~L1RCTParameters ( )
inline

Definition at line 65 of file L1RCTParameters.h.

65 {;}

Member Function Documentation

unsigned short L1RCTParameters::calcCard ( unsigned short  rct_iphi,
unsigned short  absIeta 
) const

Definition at line 97 of file L1RCTParameters.cc.

Referenced by L1RCT::digiInput().

99 {
100  unsigned short card = 999;
101  // Note absIeta counts from 1-32 (not 0-31)
102  if (absIeta <= 24){
103  card = ((absIeta-1)/8)*2 + (rct_iphi%8)/4;
104  }
105  // 25 <= absIeta <= 28 (card 6)
106  else if ((absIeta >= 25) && (absIeta <= 28)){
107  card = 6;
108  }
109  else{}
110  return card;
111 }
unsigned short L1RCTParameters::calcCrate ( unsigned short  rct_iphi,
short  ieta 
) const

Definition at line 86 of file L1RCTParameters.cc.

References funct::abs().

Referenced by L1RCT::digiInput(), and L1RCTLutWriter::writeRcLutFile().

87 {
88  unsigned short crate = rct_iphi/8;
89  if(abs(ieta) > 28) crate = rct_iphi / 2;
90  if (ieta > 0){
91  crate = crate + 9;
92  }
93  return crate;
94 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned short L1RCTParameters::calcIAbsEta ( unsigned short  iCrate,
unsigned short  iCard,
unsigned short  iTower 
) const

Definition at line 182 of file L1RCTParameters.cc.

Referenced by calcIEta().

184 {
185  unsigned short absIEta;
186  if(iCard < 6)
187  absIEta = (iCard / 2) * 8 + (iTower / 4) + 1; // rm -1 JLL 7Nov07
188  else if(iCard == 6) {
189  // card 6, region 0
190  if(iTower < 16) // 17->16
191  absIEta = 25 + iTower / 4; // rm -1
192  // card 6, region 1
193  else
194  absIEta = 28 - ((iTower - 16) / 4); // 17->16
195  }
196  // HF regions
197  else
198  absIEta = 29 + iTower % 4;
199  return absIEta;
200 }
short L1RCTParameters::calcIEta ( unsigned short  iCrate,
unsigned short  iCard,
unsigned short  iTower 
) const

Definition at line 149 of file L1RCTParameters.cc.

References calcIAbsEta().

Referenced by L1RCTLookupTables::lookup(), and RctInputTextToDigi::produce().

151 {
152  unsigned short absIEta = calcIAbsEta(iCrate, iCard, iTower);
153  short iEta;
154  if(iCrate < 9) iEta = -absIEta;
155  else iEta = absIEta;
156  return iEta;
157 }
unsigned short calcIAbsEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
unsigned short L1RCTParameters::calcIPhi ( unsigned short  iCrate,
unsigned short  iCard,
unsigned short  iTower 
) const

Definition at line 160 of file L1RCTParameters.cc.

Referenced by L1RCTLookupTables::lookup(), and RctInputTextToDigi::produce().

163 {
164  short iPhi;
165  if(iCard < 6)
166  iPhi = (iCrate % 9) * 8 + (iCard % 2) * 4 + (iTower % 4); // rm -1 7Nov07
167  else if(iCard == 6){
168  // region 0
169  if(iTower < 16) // 17->16
170  iPhi = (iCrate % 9) * 8 + (iTower % 4); // rm -1
171  // region 1
172  else
173  iPhi = (iCrate % 9) * 8 + ((iTower - 16) % 4) + 4; // 17 -> 16
174  }
175  // HF regions
176  else
177  iPhi = (iCrate % 9) * 2 + iTower / 4;
178  return iPhi;
179 }
unsigned short L1RCTParameters::calcTower ( unsigned short  rct_iphi,
unsigned short  absIeta 
) const

Definition at line 114 of file L1RCTParameters.cc.

Referenced by L1RCT::digiInput(), and L1RCTLutWriter::writeRcLutFile().

116 {
117  unsigned short tower = 999;
118  unsigned short iphi = rct_iphi;
119  unsigned short regionPhi = (iphi % 8)/4;
120 
121  // Note absIeta counts from 1-32 (not 0-31)
122  if (absIeta <= 24){
123  // assume iphi between 0 and 71; makes towers from 0-31, mod. 7Nov07
124  tower = ((absIeta-1)%8)*4 + (iphi%4); // REMOVED +1
125  }
126  // 25 <= absIeta <= 28 (card 6)
127  else if ((absIeta >= 25) && (absIeta <= 28)){
128  if (regionPhi == 0){
129  // towers from 0-31, modified 7Nov07 Jessica Leonard
130  tower = (absIeta-25)*4 + (iphi%4); // REMOVED +1
131  }
132  else {
133  tower = 28 + iphi % 4 + (25 - absIeta) * 4; // mod. 7Nov07 JLL
134  }
135  }
136  // absIeta >= 29 (HF regions)
137  else if ((absIeta >= 29) && (absIeta <= 32)){
138  // SPECIAL DEFINITION OF REGIONPHI FOR HF SINCE HF IPHI IS 0-17
139  // Sept. 19 J. Leonard
140  regionPhi = iphi % 2;
141  // HF MAPPING, just regions now, don't need to worry about towers
142  // just calling it "tower" for convenience
143  tower = (regionPhi) * 4 + absIeta - 29;
144  }
145  return tower;
146 }
float L1RCTParameters::correctedTPGSum ( const float &  ecal,
const float &  hcal,
const unsigned &  index 
) const
private

Definition at line 298 of file L1RCTParameters.cc.

References EnergyCorrector::c, cross_terms_, alignCSCRings::e, patCandidatesForDimuonsSequences_cff::ecal, ecal_calib_, h, AnalysisDataFormats_SUSYBSMObjects::hc, patCandidatesForDimuonsSequences_cff::hcal, hcal_calib_, hcal_high_calib_, HoverE_smear_high_, HoverE_smear_low_, cmsHarvester::index, and funct::pow().

Referenced by EGammaTPGSum(), and JetMETTPGSum().

299 {
300  if(index >= 28 && ecal > 120 && hcal > 120) return (ecal + hcal); // return plain sum if outside of calibration range or index is too high
301 
302  // let's make sure we're asking for items that are there.
303  if(ecal_calib_.at(index).size() != 3 || hcal_calib_.at(index).size() != 3 ||
304  hcal_high_calib_.at(index).size() != 3 || cross_terms_.at(index).size() != 6 ||
305  HoverE_smear_high_.size() <= index || HoverE_smear_low_.size() <= index)
306  return (ecal+hcal);
307 
308  double e = ecal, h = hcal;
309  double ec = 0.0, hc = 0.0, c = 0.0;
310 
311  ec = (ecal_calib_.at(index).at(0)*std::pow(e,3.) +
312  ecal_calib_.at(index).at(1)*std::pow(e,2.) +
313  ecal_calib_.at(index).at(2)*e);
314 
315  if(e + h < 23)
316  {
317  hc = (hcal_calib_.at(index).at(0)*std::pow(h,3.) +
318  hcal_calib_.at(index).at(1)*std::pow(h,2.) +
319  hcal_calib_.at(index).at(2)*h);
320 
321  c = (cross_terms_.at(index).at(0)*std::pow(e, 2.)*h +
322  cross_terms_.at(index).at(1)*std::pow(h, 2.)*e +
323  cross_terms_.at(index).at(2)*e*h +
324  cross_terms_.at(index).at(3)*std::pow(e, 3.)*h +
325  cross_terms_.at(index).at(4)*std::pow(h, 3.)*e +
326  cross_terms_.at(index).at(5)*std::pow(h, 2.)*std::pow(e, 2.));
327  }
328  else
329  {
330  hc = (hcal_high_calib_.at(index).at(0)*std::pow(h,3.) +
331  hcal_high_calib_.at(index).at(1)*std::pow(h,2.) +
332  hcal_high_calib_.at(index).at(2)*h);
333  }
334 
335  if(h/(e+h) >= 0.05)
336  {
337  ec *= HoverE_smear_high_.at(index);
338  hc *= HoverE_smear_high_.at(index);
339  c *= HoverE_smear_high_.at(index);
340  }
341  else
342  {
343  ec *= HoverE_smear_low_.at(index);
344  }
345  return ec + hc + c;
346 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< std::vector< double > > cross_terms_
std::vector< std::vector< double > > hcal_high_calib_
std::vector< double > HoverE_smear_low_
std::vector< std::vector< double > > hcal_calib_
std::vector< double > HoverE_smear_high_
std::vector< std::vector< double > > ecal_calib_
susybsm::HSCParticleCollection hc
Definition: classes.h:25
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double L1RCTParameters::eActivityCut ( ) const
inline

Definition at line 77 of file L1RCTParameters.h.

References eActivityCut_.

Referenced by L1RCTLookupTables::activityBit().

77 {return eActivityCut_;}
const std::vector<double>& L1RCTParameters::eGammaECalScaleFactors ( ) const
inline

Definition at line 85 of file L1RCTParameters.h.

References eGammaECalScaleFactors_.

Referenced by L1RCTLookupTables::lookup().

std::vector< double > eGammaECalScaleFactors_
const std::vector<double>& L1RCTParameters::eGammaHCalScaleFactors ( ) const
inline

Definition at line 86 of file L1RCTParameters.h.

References eGammaHCalScaleFactors_.

Referenced by L1RCTLookupTables::lookup().

std::vector< double > eGammaHCalScaleFactors_
double L1RCTParameters::eGammaLSB ( ) const
inline

Definition at line 69 of file L1RCTParameters.h.

References eGammaLSB_.

Referenced by L1RCTLookupTables::convertEcal(), and L1RCTLookupTables::eGammaETCode().

69 {return eGammaLSB_;}
float L1RCTParameters::EGammaTPGSum ( const float &  ecal,
const float &  hcal,
const unsigned &  iAbsEta 
) const

Definition at line 253 of file L1RCTParameters.cc.

References correctedTPGSum(), eGammaECalScaleFactors_, eGammaHCalScaleFactors_, Exception, mps_fire::result, and useCorrections_.

Referenced by L1RCTLookupTables::eGammaETCode().

254 {
255  // We never deal with HF in this function (EG objects don't use hcal at all, really)
256  if ( iAbsEta < 1 || iAbsEta > 28 )
257  throw cms::Exception("L1RCTParameters invalid function call") << "Eta out of range in MET TPGSum: " << iAbsEta;
258  float ecal_c = ecal*eGammaECalScaleFactors_.at(iAbsEta-1);
259  float hcal_c = hcal*eGammaHCalScaleFactors_.at(iAbsEta-1);
260 
261  // scale factors will either be length 28 for legacy, or 28*(# et bins + 1) where the first set of 28 is an average over the et bins
262  // The first set of 28 provides a legacy fallthrough option
263  // Currently, # et bins is 9
264  if ( eGammaECalScaleFactors_.size() == 28*10 )
265  {
266  int et_bin = ((int) floor(ecal)/5);
267  // lowest bin (1) is 0-10GeV
268  if ( et_bin < 1 ) et_bin = 1;
269  // highest bin (9) is 45GeV and up
270  if ( et_bin > 9 ) et_bin = 9;
271  ecal_c = ecal*eGammaECalScaleFactors_.at(et_bin*28+iAbsEta-1);
272  }
273  if ( eGammaHCalScaleFactors_.size() == 28*10 )
274  {
275  int ht_bin = ((int) floor(hcal)/5);
276  // lowest bin (1) is 0-10GeV
277  if ( ht_bin < 1 ) ht_bin = 1;
278  // highest bin (9) is 45GeV and up
279  if ( ht_bin > 9 ) ht_bin = 9;
280  hcal_c = hcal*eGammaHCalScaleFactors_.at(ht_bin*28+iAbsEta-1);
281  }
282 
283  float result = ecal_c + hcal_c;
284 
285  // defunct section (polynomial-parameterized corrections)
286  if(useCorrections_)
287  {
288  if(eGammaHCalScaleFactors_.at(iAbsEta-1) != 0)
289  hcal_c = hcal;
290 
291  result = correctedTPGSum(ecal_c,hcal_c,iAbsEta-1);
292  }
293 
294  return result;
295 }
std::vector< double > eGammaECalScaleFactors_
tuple result
Definition: mps_fire.py:83
float correctedTPGSum(const float &ecal, const float &hcal, const unsigned &index) const
std::vector< double > eGammaHCalScaleFactors_
unsigned L1RCTParameters::eicIsolationThreshold ( ) const
inline
double L1RCTParameters::eMaxForFGCut ( ) const
inline

Definition at line 72 of file L1RCTParameters.h.

References eMaxForFGCut_.

Referenced by L1RCTLookupTables::hOeFGVetoBit().

72 {return eMaxForFGCut_;}
double L1RCTParameters::eMaxForHoECut ( ) const
inline

Definition at line 75 of file L1RCTParameters.h.

References eMaxForHoECut_.

Referenced by L1RCTLookupTables::activityBit(), and L1RCTLookupTables::hOeFGVetoBit().

75 {return eMaxForHoECut_;}
double L1RCTParameters::eMinForFGCut ( ) const
inline

Definition at line 71 of file L1RCTParameters.h.

References eMinForFGCut_.

Referenced by L1RCTLookupTables::hOeFGVetoBit().

71 {return eMinForFGCut_;}
double L1RCTParameters::eMinForHoECut ( ) const
inline

Definition at line 74 of file L1RCTParameters.h.

References eMinForHoECut_.

Referenced by L1RCTLookupTables::activityBit(), and L1RCTLookupTables::hOeFGVetoBit().

74 {return eMinForHoECut_;}
double L1RCTParameters::hActivityCut ( ) const
inline

Definition at line 78 of file L1RCTParameters.h.

References hActivityCut_.

Referenced by L1RCTLookupTables::activityBit().

78 {return hActivityCut_;}
double L1RCTParameters::hMinForHoECut ( ) const
inline

Definition at line 76 of file L1RCTParameters.h.

References hMinForHoECut_.

Referenced by L1RCTLookupTables::hOeFGVetoBit().

76 {return hMinForHoECut_;}
double L1RCTParameters::hOeCut ( ) const
inline

Definition at line 73 of file L1RCTParameters.h.

References hOeCut_.

Referenced by L1RCTLookupTables::activityBit(), and L1RCTLookupTables::hOeFGVetoBit().

73 {return hOeCut_;}
const std::vector<double>& L1RCTParameters::jetMETECalScaleFactors ( ) const
inline

Definition at line 87 of file L1RCTParameters.h.

References jetMETECalScaleFactors_.

Referenced by L1RCTLookupTables::lookup().

std::vector< double > jetMETECalScaleFactors_
const std::vector<double>& L1RCTParameters::jetMETHCalScaleFactors ( ) const
inline

Definition at line 88 of file L1RCTParameters.h.

References jetMETHCalScaleFactors_.

Referenced by L1RCTLookupTables::lookup().

std::vector< double > jetMETHCalScaleFactors_
double L1RCTParameters::jetMETLSB ( ) const
inline
float L1RCTParameters::JetMETTPGSum ( const float &  ecal,
const float &  hcal,
const unsigned &  iAbsEta 
) const

Definition at line 202 of file L1RCTParameters.cc.

References correctedTPGSum(), eGammaECalScaleFactors_, Exception, jetMETECalScaleFactors_, jetMETHCalScaleFactors_, mps_fire::result, and useCorrections_.

Referenced by L1RCTLookupTables::jetMETETCode().

203 {
204  // We never deal with HF in this function (see note below)
205  if ( iAbsEta < 1 || iAbsEta > 28 )
206  throw cms::Exception("L1RCTParameters invalid function call") << "Eta out of range in MET TPGSum: " << iAbsEta;
207  float ecal_c = ecal*jetMETECalScaleFactors_.at(iAbsEta-1);
208  float hcal_c = hcal*jetMETHCalScaleFactors_.at(iAbsEta-1);
209 
210  // scale factors will either be length 28 for legacy, or 28*(# et bins + 1) where the first set is an average over the et bins
211  // The first set provides a legacy fallthrough option
212  // Currently, # et bins is 9
213  if ( jetMETECalScaleFactors_.size() == 28*10 )
214  {
215  int et_bin = ((int) floor(ecal)/5);
216  // lowest bin (1) is 0-10GeV
217  if ( et_bin < 1 ) et_bin = 1;
218  // highest bin (9) is 45GeV and up
219  if ( et_bin > 9 ) et_bin = 9;
220  ecal_c = ecal*jetMETECalScaleFactors_.at(et_bin*28+iAbsEta-1);
221  }
222 
223  // We may be interested in HF jets, in which case, there are four more scale factors
224  // for the 4 HF regions. HOWEVER, we will never expect to see them accessed from
225  // this function. HF scaling is done in L1Trigger/RegionalCaloTrigger/src/L1RCTLookupTables
226  if ( jetMETHCalScaleFactors_.size() == 32*10 )
227  {
228  int ht_bin = ((int) floor(hcal)/5);
229  // lowest bin (1) is 0-10GeV
230  if ( ht_bin < 1 ) ht_bin = 1;
231  // highest bin (9) is 45GeV and up
232  if ( ht_bin > 9 ) ht_bin = 9;
233  hcal_c = hcal*jetMETHCalScaleFactors_.at(ht_bin*32+iAbsEta-1);
234  }
235 
236  float result = ecal_c + hcal_c;
237 
238  // defunct section (polynomial-parameterized corrections)
239  if(useCorrections_)
240  {
241  if(jetMETHCalScaleFactors_.at(iAbsEta-1) != 0)
242  hcal_c = hcal;
243 
244  if(jetMETECalScaleFactors_.at(iAbsEta-1) != 0)
245  ecal_c = ecal*eGammaECalScaleFactors_.at(iAbsEta-1); // Use eGamma Corrections
246 
247  result = correctedTPGSum(ecal_c,hcal_c,iAbsEta-1);
248  }
249 
250  return result;
251 }
std::vector< double > jetMETECalScaleFactors_
std::vector< double > eGammaECalScaleFactors_
tuple result
Definition: mps_fire.py:83
float correctedTPGSum(const float &ecal, const float &hcal, const unsigned &index) const
std::vector< double > jetMETHCalScaleFactors_
unsigned L1RCTParameters::jscQuietThresholdBarrel ( ) const
inline

Definition at line 80 of file L1RCTParameters.h.

References jscQuietThresholdBarrel_.

Referenced by L1RCTLutWriter::analyze(), and L1RCTJetSummaryCard::fillQuietBits().

unsigned jscQuietThresholdBarrel_
unsigned L1RCTParameters::jscQuietThresholdEndcap ( ) const
inline

Definition at line 81 of file L1RCTParameters.h.

References jscQuietThresholdEndcap_.

Referenced by L1RCTLutWriter::analyze(), and L1RCTJetSummaryCard::fillQuietBits().

unsigned jscQuietThresholdEndcap_
bool L1RCTParameters::noiseVetoHB ( ) const
inline

Definition at line 82 of file L1RCTParameters.h.

References noiseVetoHB_.

Referenced by L1RCTLookupTables::lookup().

82 {return noiseVetoHB_;}
bool L1RCTParameters::noiseVetoHEminus ( ) const
inline

Definition at line 84 of file L1RCTParameters.h.

References noiseVetoHEminus_.

Referenced by L1RCTLookupTables::lookup().

84 {return noiseVetoHEminus_;}
bool L1RCTParameters::noiseVetoHEplus ( ) const
inline

Definition at line 83 of file L1RCTParameters.h.

References noiseVetoHEplus_.

Referenced by L1RCTLookupTables::lookup().

83 {return noiseVetoHEplus_;}
void L1RCTParameters::print ( std::ostream &  s) const

Definition at line 349 of file L1RCTParameters.cc.

References cross_terms_, eActivityCut_, ecal_calib_, eGammaECalScaleFactors_, eGammaHCalScaleFactors_, eGammaLSB_, eicIsolationThreshold_, eMaxForFGCut_, eMaxForHoECut_, eMinForFGCut_, eMinForHoECut_, end, hActivityCut_, hcal_calib_, hcal_high_calib_, hMinForHoECut_, hOeCut_, HoverE_smear_high_, HoverE_smear_low_, i, j, jetMETECalScaleFactors_, jetMETHCalScaleFactors_, jetMETLSB_, jscQuietThresholdBarrel_, jscQuietThresholdEndcap_, noiseVetoHB_, noiseVetoHEminus_, noiseVetoHEplus_, alignCSCRings::s, and useCorrections_.

349  {
350 
351  s << "\nPrinting record L1RCTParametersRcd" <<endl;
352  s << "\n\"Parameter description\" \n \"Parameter name\" \"Value\" "
353  << endl;
354  s << "\ne/gamma least significant bit energy transmitted from receiver cards to EIC cards. \n "
355  << "eGammaLSB = " << eGammaLSB_ << endl ;
356  s << "\nLSB of region Et scale from RCT to GCT (GeV) \n "
357  << "jetMETLSB = " << jetMETLSB_ << endl ;
358  s << "\nminimum ECAL Et for which fine-grain veto is applied (GeV) \n "
359  << " eMinForFGCut = " << eMinForFGCut_ << endl ;
360  s << "\nmaximum ECAL Et for which fine-grain veto is applied (GeV) \n "
361  << "eMaxForFGCut = " << eMaxForFGCut_ << endl ;
362  s << "\nmaximum value of (HCAL Et / ECAL Et) \n "
363  << "hOeCut = " << hOeCut_ << endl ;
364  s << "\nminimum ECAL Et for which H/E veto is applied (GeV) \n "
365  << "eMinForHoECut = " << eMinForHoECut_ << endl ;
366  s << "\nmaximum ECAL Et for which H/E veto is applied (GeV) \n "
367  << "eMaxForHoECut = " << eMaxForHoECut_ << endl ;
368  s << "\nminimum HCAL Et for which H/E veto is applied (GeV) \n "
369  << "hMinForHoECut = " << hMinForHoECut_ << endl ;
370  s << "\nECAL Et threshold above which tau activity bit is set (GeV) \n "
371  << "eActivityCut = " << eActivityCut_ << endl ;
372  s << "\nHCAL Et threshold above which tau activity bit is set (GeV) \n "
373  << "hActivityCut = " << hActivityCut_ << endl ;
374  s << "\nNeighboring trigger tower energy minimum threshold that marks candidate as non-isolated. (LSB bits) \n "
375  << "eicIsolationThreshold = " << eicIsolationThreshold_ << endl ;
376  s << "\nIf jetMet energy in RCT Barrel Region is below this value, a quiet bit is set. (LSB bits)\n "
377  << "jscQuietThreshBarrel = " << jscQuietThresholdBarrel_ << endl ;
378  s << "\nIf jetMet energy in RCT Endcap Region is below this value, a quiet bit is set. (LSB bits) \n "
379  << "jscQuietThreshEndcap = " << jscQuietThresholdEndcap_ << endl ;
380  s << "\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Barrel \n "
381  << "noiseVetoHB = " << noiseVetoHB_ << endl ;
382  s << "\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Encap+ \n "
383  << "noiseVetoHEplus = " << noiseVetoHEplus_ << endl ;
384  s << "\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Endcap- \n "
385  << "noiseVetoHEminus = " << noiseVetoHEminus_ << endl ;
386 
387  auto printScalefactors = [&s](const std::vector<double> &sf) {
388  if ( sf.size() == 10*28 )
389  {
390  s << "et bin ieta ScaleFactor" <<endl;
391  for(unsigned i = 0 ; i<sf.size(); i++)
392  s << setw(6) << i/28 << " " << setw(4) << i%28+1 << " " << sf.at(i) <<endl;
393  }
394  else if ( sf.size() == 10*32 ) // jet HCAL (HF regions are 29-32)
395  {
396  s << "et bin ieta ScaleFactor" <<endl;
397  for(unsigned i = 0 ; i<sf.size(); i++)
398  s << setw(6) << i/32 << " " << setw(4) << i%32+1 << " " << sf.at(i) <<endl;
399  }
400  else {
401  s << "ieta ScaleFactor" <<endl;
402  for(unsigned i = 0 ; i<sf.size(); i++)
403  s << setw(4) << i+1 << " " << sf.at(i) <<endl;
404  }
405  };
406 
407  s << "\n\neta-dependent multiplicative factors for ECAL Et before summation \n "
408  << "eGammaECal Scale Factors " << endl;
409  printScalefactors(eGammaECalScaleFactors_);
410 
411  s << "\n\neta-dependent multiplicative factors for HCAL Et before summation \n "
412  <<"eGammaHCal Scale Factors "<<endl;
413  printScalefactors(eGammaHCalScaleFactors_);
414 
415  s << "\n\neta-dependent multiplicative factors for ECAL Et before summation \n "
416  <<"jetMETECal Scale Factors "<<endl;
417  printScalefactors(jetMETECalScaleFactors_);
418 
419  s << "\n\neta-dependent multiplicative factors for HCAL Et before summation \n"
420  <<"jetMETHCal Scale Factors "<<endl;
421  printScalefactors(jetMETHCalScaleFactors_);
422 
423  if(useCorrections_) {
424  s<< "\n\nUSING calibration variables " <<endl;
425 
426 
427  s << "\n\nH over E smear low Correction Factors "<<endl;
428  s << "ieta Correction Factor" <<endl;
429  for(int i = 0 ; i<28; i++)
430  s << setw(4) <<i+1 << " " << HoverE_smear_low_.at(i) <<endl;
431 
432 
433  s << "\n\nH over E smear high Correction Factors "<<endl;
434  s <<"ieta Correction Factor" <<endl;
435  for(int i = 0 ; i<28; i++)
436  s << setw(4) <<i+1 << " " << HoverE_smear_high_.at(i) <<endl;
437 
438  s << "\n\necal calibrations "<<endl;
439  s << "ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
440  int end = ecal_calib_[0].size();
441  for(int i = 0 ; i<28; i++) {
442  s << setw(4) << i;
443  for(int j = 0; j< end ; j++)
444  s << setw(11) << setprecision(8) << ecal_calib_[i][j] ;
445 
446  s << endl;
447 
448  }
449 
450  s <<"\n\nhcal calibrations "<<endl;
451  s <<"ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
452  end = hcal_calib_[0].size();
453  for(int i = 0 ; i<28; i++) {
454  s << setw(4) << i;
455  for(int j = 0; j< end ; j++)
456  s << setw(11) << setprecision(8) << hcal_calib_[i][j] ;
457 
458  s << endl;
459 
460  }
461  s <<"\n\nhcal_high calibrations "<<endl;
462  s <<"ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
463  end = hcal_high_calib_[0].size();
464  for(int i = 0 ; i<28; i++) {
465  s << setw(4) << i;
466  for(int j = 0; j< end ; j++)
467  s << setw(11) << setprecision(8) << hcal_high_calib_[i][j] ;
468 
469  s << endl;
470 
471  }
472  end = cross_terms_[0].size();
473  s <<"\n\ncross terms calibrations "<<endl;
474  s <<"ieta CorrFactor1 CorrFactor2 CorrFactor3 CorrFactor4 CorrFactor5 CorrFactor6" <<endl;
475  for(int i = 0 ; i<28; i++) {
476  s << setw(4) << i;
477  for(int j = 0; j< end ; j++)
478  s << setw(11) << setprecision(8) << cross_terms_[i][j] ;
479 
480  s << endl;
481 
482  }
483 
484  } else
485  s<< "\n\nNOT USING calibration variables " <<endl;
486 
487  s << "\n\n" <<endl;
488 
489 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > jetMETECalScaleFactors_
unsigned jscQuietThresholdBarrel_
std::vector< double > eGammaECalScaleFactors_
std::vector< std::vector< double > > cross_terms_
std::vector< std::vector< double > > hcal_high_calib_
std::vector< double > HoverE_smear_low_
unsigned jscQuietThresholdEndcap_
std::vector< double > jetMETHCalScaleFactors_
int j
Definition: DBlmapReader.cc:9
std::vector< std::vector< double > > hcal_calib_
#define end
Definition: vmac.h:37
std::vector< double > HoverE_smear_high_
std::vector< double > eGammaHCalScaleFactors_
std::vector< std::vector< double > > ecal_calib_
unsigned eicIsolationThreshold_
template<class Archive >
void L1RCTParameters::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 226 of file L1RCTParameters.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 226 of file L1RCTParameters.h.

Member Data Documentation

std::vector<std::vector<double> > L1RCTParameters::cross_terms_
private

Definition at line 217 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), L1RCTParameters(), and print().

double L1RCTParameters::eActivityCut_
private

Definition at line 148 of file L1RCTParameters.h.

Referenced by eActivityCut(), and print().

std::vector<std::vector<double> > L1RCTParameters::ecal_calib_
private

Definition at line 214 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), L1RCTParameters(), and print().

std::vector<double> L1RCTParameters::eGammaECalScaleFactors_
private

Definition at line 196 of file L1RCTParameters.h.

Referenced by eGammaECalScaleFactors(), EGammaTPGSum(), JetMETTPGSum(), and print().

std::vector<double> L1RCTParameters::eGammaHCalScaleFactors_
private

Definition at line 197 of file L1RCTParameters.h.

Referenced by eGammaHCalScaleFactors(), EGammaTPGSum(), and print().

double L1RCTParameters::eGammaLSB_
private

Definition at line 114 of file L1RCTParameters.h.

Referenced by eGammaLSB(), and print().

unsigned L1RCTParameters::eicIsolationThreshold_
private

Definition at line 161 of file L1RCTParameters.h.

Referenced by eicIsolationThreshold(), and print().

double L1RCTParameters::eMaxForFGCut_
private

Definition at line 126 of file L1RCTParameters.h.

Referenced by eMaxForFGCut(), and print().

double L1RCTParameters::eMaxForHoECut_
private

Definition at line 138 of file L1RCTParameters.h.

Referenced by eMaxForHoECut(), and print().

double L1RCTParameters::eMinForFGCut_
private

Definition at line 122 of file L1RCTParameters.h.

Referenced by eMinForFGCut(), and print().

double L1RCTParameters::eMinForHoECut_
private

Definition at line 134 of file L1RCTParameters.h.

Referenced by eMinForHoECut(), and print().

double L1RCTParameters::hActivityCut_
private

Definition at line 154 of file L1RCTParameters.h.

Referenced by hActivityCut(), and print().

std::vector<std::vector<double> > L1RCTParameters::hcal_calib_
private

Definition at line 215 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), L1RCTParameters(), and print().

std::vector<std::vector<double> > L1RCTParameters::hcal_high_calib_
private

Definition at line 216 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), L1RCTParameters(), and print().

double L1RCTParameters::hMinForHoECut_
private

Definition at line 142 of file L1RCTParameters.h.

Referenced by hMinForHoECut(), and print().

double L1RCTParameters::hOeCut_
private

Definition at line 130 of file L1RCTParameters.h.

Referenced by hOeCut(), and print().

std::vector<double> L1RCTParameters::HoverE_smear_high_
private

Definition at line 222 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), and print().

std::vector<double> L1RCTParameters::HoverE_smear_low_
private

Definition at line 221 of file L1RCTParameters.h.

Referenced by correctedTPGSum(), and print().

std::vector<double> L1RCTParameters::jetMETECalScaleFactors_
private

Definition at line 203 of file L1RCTParameters.h.

Referenced by jetMETECalScaleFactors(), JetMETTPGSum(), and print().

std::vector<double> L1RCTParameters::jetMETHCalScaleFactors_
private

Definition at line 204 of file L1RCTParameters.h.

Referenced by jetMETHCalScaleFactors(), JetMETTPGSum(), and print().

double L1RCTParameters::jetMETLSB_
private

Definition at line 118 of file L1RCTParameters.h.

Referenced by jetMETLSB(), and print().

unsigned L1RCTParameters::jscQuietThresholdBarrel_
private

Definition at line 166 of file L1RCTParameters.h.

Referenced by jscQuietThresholdBarrel(), and print().

unsigned L1RCTParameters::jscQuietThresholdEndcap_
private

Definition at line 171 of file L1RCTParameters.h.

Referenced by jscQuietThresholdEndcap(), and print().

bool L1RCTParameters::noiseVetoHB_
private

Definition at line 177 of file L1RCTParameters.h.

Referenced by noiseVetoHB(), and print().

bool L1RCTParameters::noiseVetoHEminus_
private

Definition at line 187 of file L1RCTParameters.h.

Referenced by noiseVetoHEminus(), and print().

bool L1RCTParameters::noiseVetoHEplus_
private

Definition at line 182 of file L1RCTParameters.h.

Referenced by noiseVetoHEplus(), and print().

bool L1RCTParameters::useCorrections_
private

Definition at line 190 of file L1RCTParameters.h.

Referenced by EGammaTPGSum(), JetMETTPGSum(), and print().