27 unsigned eicIsolationThreshold,
28 unsigned jscQuietThresholdBarrel,
29 unsigned jscQuietThresholdEndcap,
32 bool noiseVetoHEminus,
34 const std::vector<double>& eGammaECalScaleFactors,
35 const std::vector<double>& eGammaHCalScaleFactors,
36 const std::vector<double>& jetMETECalScaleFactors,
37 const std::vector<double>& jetMETHCalScaleFactors,
38 const std::vector<double>& ecal_calib,
39 const std::vector<double>& hcal_calib,
40 const std::vector<double>& hcal_high_calib,
41 const std::vector<double>& cross_terms,
42 const std::vector<double>& lowHoverE_smear,
43 const std::vector<double>& highHoverE_smear
45 eGammaLSB_(eGammaLSB),
46 jetMETLSB_(jetMETLSB),
47 eMinForFGCut_(eMinForFGCut),
48 eMaxForFGCut_(eMaxForFGCut),
50 eMinForHoECut_(eMinForHoECut),
51 eMaxForHoECut_(eMaxForHoECut),
52 hMinForHoECut_(hMinForHoECut),
53 eActivityCut_(eActivityCut),
54 hActivityCut_(hActivityCut),
55 eicIsolationThreshold_(eicIsolationThreshold),
56 jscQuietThresholdBarrel_(jscQuietThresholdBarrel),
57 jscQuietThresholdEndcap_(jscQuietThresholdEndcap),
58 noiseVetoHB_(noiseVetoHB),
59 noiseVetoHEplus_(noiseVetoHEplus),
60 noiseVetoHEminus_(noiseVetoHEminus),
61 useCorrections_(useCorrections),
62 eGammaECalScaleFactors_(eGammaECalScaleFactors),
63 eGammaHCalScaleFactors_(eGammaHCalScaleFactors),
64 jetMETECalScaleFactors_(jetMETECalScaleFactors),
65 jetMETHCalScaleFactors_(jetMETHCalScaleFactors),
66 HoverE_smear_low_(lowHoverE_smear),
67 HoverE_smear_high_(highHoverE_smear)
74 for(
unsigned i = 0;
i < ecal_calib.size(); ++
i)
76 for(
unsigned i = 0; i < hcal_calib.size(); ++
i)
78 for(
unsigned i = 0; i < hcal_high_calib.size(); ++
i)
80 for(
unsigned i = 0; i < cross_terms.size(); ++
i)
88 unsigned short crate = rct_iphi/8;
89 if(
abs(ieta) > 28) crate = rct_iphi / 2;
98 unsigned short absIeta)
const 100 unsigned short card = 999;
103 card = ((absIeta-1)/8)*2 + (rct_iphi%8)/4;
106 else if ((absIeta >= 25) && (absIeta <= 28)){
115 unsigned short absIeta)
const 117 unsigned short tower = 999;
118 unsigned short iphi = rct_iphi;
119 unsigned short regionPhi = (iphi % 8)/4;
124 tower = ((absIeta-1)%8)*4 + (iphi%4);
127 else if ((absIeta >= 25) && (absIeta <= 28)){
130 tower = (absIeta-25)*4 + (iphi%4);
133 tower = 28 + iphi % 4 + (25 - absIeta) * 4;
137 else if ((absIeta >= 29) && (absIeta <= 32)){
140 regionPhi = iphi % 2;
143 tower = (regionPhi) * 4 + absIeta - 29;
150 unsigned short iTower)
const 152 unsigned short absIEta =
calcIAbsEta(iCrate, iCard, iTower);
154 if(iCrate < 9) iEta = -absIEta;
161 unsigned short iCard,
162 unsigned short iTower)
const 166 iPhi = (iCrate % 9) * 8 + (iCard % 2) * 4 + (iTower % 4);
170 iPhi = (iCrate % 9) * 8 + (iTower % 4);
173 iPhi = (iCrate % 9) * 8 + ((iTower - 16) % 4) + 4;
177 iPhi = (iCrate % 9) * 2 + iTower / 4;
183 unsigned short iTower)
const 185 unsigned short absIEta;
187 absIEta = (iCard / 2) * 8 + (iTower / 4) + 1;
188 else if(iCard == 6) {
191 absIEta = 25 + iTower / 4;
194 absIEta = 28 - ((iTower - 16) / 4);
198 absIEta = 29 + iTower % 4;
205 if ( iAbsEta < 1 || iAbsEta > 28 )
206 throw cms::Exception(
"L1RCTParameters invalid function call") <<
"Eta out of range in MET TPGSum: " << iAbsEta;
215 int et_bin = ((
int) floor(ecal)/5);
217 if ( et_bin < 1 ) et_bin = 1;
219 if ( et_bin > 9 ) et_bin = 9;
228 int ht_bin = ((
int) floor(hcal)/5);
230 if ( ht_bin < 1 ) ht_bin = 1;
232 if ( ht_bin > 9 ) ht_bin = 9;
236 float result = ecal_c + hcal_c;
256 if ( iAbsEta < 1 || iAbsEta > 28 )
257 throw cms::Exception(
"L1RCTParameters invalid function call") <<
"Eta out of range in MET TPGSum: " << iAbsEta;
266 int et_bin = ((
int) floor(ecal)/5);
268 if ( et_bin < 1 ) et_bin = 1;
270 if ( et_bin > 9 ) et_bin = 9;
275 int ht_bin = ((
int) floor(hcal)/5);
277 if ( ht_bin < 1 ) ht_bin = 1;
279 if ( ht_bin > 9 ) ht_bin = 9;
283 float result = ecal_c + hcal_c;
300 if(index >= 28 && ecal > 120 && hcal > 120)
return (ecal + hcal);
309 double ec = 0.0,
hc = 0.0,
c = 0.0;
351 s <<
"\nPrinting record L1RCTParametersRcd" <<endl;
352 s <<
"\n\"Parameter description\" \n \"Parameter name\" \"Value\" " 354 s <<
"\ne/gamma least significant bit energy transmitted from receiver cards to EIC cards. \n " 356 s <<
"\nLSB of region Et scale from RCT to GCT (GeV) \n " 358 s <<
"\nminimum ECAL Et for which fine-grain veto is applied (GeV) \n " 360 s <<
"\nmaximum ECAL Et for which fine-grain veto is applied (GeV) \n " 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 " 366 s <<
"\nmaximum ECAL Et for which H/E veto is applied (GeV) \n " 368 s <<
"\nminimum HCAL Et for which H/E veto is applied (GeV) \n " 370 s <<
"\nECAL Et threshold above which tau activity bit is set (GeV) \n " 372 s <<
"\nHCAL Et threshold above which tau activity bit is set (GeV) \n " 374 s <<
"\nNeighboring trigger tower energy minimum threshold that marks candidate as non-isolated. (LSB bits) \n " 376 s <<
"\nIf jetMet energy in RCT Barrel Region is below this value, a quiet bit is set. (LSB bits)\n " 378 s <<
"\nIf jetMet energy in RCT Endcap Region is below this value, a quiet bit is set. (LSB bits) \n " 380 s <<
"\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Barrel \n " 382 s <<
"\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Encap+ \n " 384 s <<
"\nWhen set to TRUE, HCAL energy is ignored if no ECAL energy is present in corresponding trigger tower for RCT Endcap- \n " 387 auto printScalefactors = [&
s](
const std::vector<double> &sf) {
388 if ( sf.size() == 10*28 )
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;
394 else if ( sf.size() == 10*32 )
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;
401 s <<
"ieta ScaleFactor" <<endl;
402 for(
unsigned i = 0 ;
i<sf.size();
i++)
403 s << setw(4) <<
i+1 <<
" " << sf.at(
i) <<endl;
407 s <<
"\n\neta-dependent multiplicative factors for ECAL Et before summation \n " 408 <<
"eGammaECal Scale Factors " << endl;
411 s <<
"\n\neta-dependent multiplicative factors for HCAL Et before summation \n " 412 <<
"eGammaHCal Scale Factors "<<endl;
415 s <<
"\n\neta-dependent multiplicative factors for ECAL Et before summation \n " 416 <<
"jetMETECal Scale Factors "<<endl;
419 s <<
"\n\neta-dependent multiplicative factors for HCAL Et before summation \n" 420 <<
"jetMETHCal Scale Factors "<<endl;
424 s<<
"\n\nUSING calibration variables " <<endl;
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++)
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++)
438 s <<
"\n\necal calibrations "<<endl;
439 s <<
"ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
441 for(
int i = 0 ;
i<28;
i++) {
443 for(
int j = 0; j<
end ; j++)
450 s <<
"\n\nhcal calibrations "<<endl;
451 s <<
"ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
453 for(
int i = 0 ;
i<28;
i++) {
455 for(
int j = 0; j<
end ; j++)
461 s <<
"\n\nhcal_high calibrations "<<endl;
462 s <<
"ieta CorrFactor1 CorrFactor2 CorrFactor3" <<endl;
464 for(
int i = 0 ;
i<28;
i++) {
466 for(
int j = 0; j<
end ; j++)
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++) {
477 for(
int j = 0; j<
end ; j++)
485 s<<
"\n\nNOT USING calibration variables " <<endl;
void print(std::ostream &s) const
std::vector< double > jetMETECalScaleFactors_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
short calcIEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
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_
float correctedTPGSum(const float &ecal, const float &hcal, const unsigned &index) const
unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const
float EGammaTPGSum(const float &ecal, const float &hcal, const unsigned &iAbsEta) const
unsigned jscQuietThresholdEndcap_
std::vector< double > jetMETHCalScaleFactors_
Abs< T >::type abs(const T &t)
unsigned short calcIAbsEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
std::vector< std::vector< double > > hcal_calib_
unsigned short calcIPhi(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
std::vector< double > HoverE_smear_high_
unsigned short calcCard(unsigned short rct_iphi, unsigned short absIeta) const
std::vector< double > eGammaHCalScaleFactors_
std::vector< std::vector< double > > ecal_calib_
unsigned eicIsolationThreshold_
Power< A, B >::type pow(const A &a, const B &b)
unsigned short calcCrate(unsigned short rct_iphi, short ieta) const
float JetMETTPGSum(const float &ecal, const float &hcal, const unsigned &iAbsEta) const