23 tauIsoEtThreshold_(0.),
24 htJetEtThreshold_(0.),
25 mhtJetEtThreshold_(0.),
26 cenForJetEtaBoundary_(0),
30 convertToEnergy_(
false),
31 energyConversionCoeffs_()
39 double tauIsoEtThresh,
41 double mhtJetEtThresh,
44 const std::vector< std::vector<double> >& jetCorrCoeffs,
45 const std::vector< std::vector<double> >& tauCorrCoeffs,
47 const std::vector<double>& energyConvCoeffs) :
50 cenJetEtSeed_(cJetSeed),
51 forJetEtSeed_(fJetSeed),
52 tauJetEtSeed_(tJetSeed),
53 tauIsoEtThreshold_(tauIsoEtThresh),
54 htJetEtThreshold_(htJetEtThresh),
55 mhtJetEtThreshold_(mhtJetEtThresh),
56 cenForJetEtaBoundary_(etaBoundary),
58 jetCorrCoeffs_(jetCorrCoeffs),
59 tauCorrCoeffs_(tauCorrCoeffs),
60 convertToEnergy_(convertToEnergy),
61 energyConversionCoeffs_(energyConvCoeffs)
77 unsigned expCoeffs = 0;
86 std::vector< std::vector<double> >::const_iterator itr;
88 if (itr->size() != expCoeffs) {
89 throw cms::Exception(
"InconsistentConfig") <<
"L1GctJetFinderParams constructed with " << itr->size() <<
" jet correction coefficients, when " << expCoeffs <<
" expected" << std::endl;
93 if (itr->size() != expCoeffs) {
94 throw cms::Exception(
"InconsistentConfig") <<
"L1GctJetFinderParams constructed with " << itr->size() <<
" tau correction coefficients, when " << expCoeffs <<
" expected"<< std::endl;
115 const double fJetSeed,
116 const double tJetSeed,
117 const unsigned etaBoundary)
126 const std::vector< std::vector<double> >& jetCorrCoeffs,
127 const std::vector< std::vector<double> >& tauCorrCoeffs)
147 const double htJetEtThresh,
148 const double mhtJetEtThresh)
162 const double cJetSeed,
163 const double fJetSeed,
164 const double tJetSeed,
165 const double tauIsoEtThresh,
166 const double htJetEtThresh,
167 const double mhtJetEtThresh,
168 const unsigned etaBoundary,
169 const unsigned corrType,
170 const std::vector< std::vector<double> >& jetCorrCoeffs,
171 const std::vector< std::vector<double> >& tauCorrCoeffs)
187 const bool tauVeto)
const {
211 double scaledEt = correctedEt /
htLsb_;
213 uint16_t jetEtOut =
static_cast<uint16_t
>(scaledEt);
258 for (
unsigned i=0;
i<coeffs.size();
i++) {
259 corrEt += coeffs.at(
i)*
pow(Et,(
int)
i);
270 std::vector<double>::const_iterator next_coeff=coeffs.begin();
271 while (next_coeff != coeffs.end()) {
273 double A = *next_coeff++;
274 double B = *next_coeff++;
275 double C = *next_coeff++;
279 return 2*(Et-
A)/(B+
sqrt(B*B-4*A*C+4*Et*C));
294 return coeffs.at(0) + coeffs.at(1)/(
pow(log10(Et),coeffs.at(2))+coeffs.at(3)) + (coeffs.at(4)/Et);
308 std::vector<double>::const_iterator next_coeff=coeffs.begin();
309 while (next_coeff != coeffs.end()) {
313 double A = *next_coeff++;
314 double B = *next_coeff++;
315 double C = *next_coeff++;
316 double D = *next_coeff++;
320 etOut += (A + etOut*(B + etOut*(C + etOut*
D))) ;
336 return et * (coeffs.at(0)+coeffs.at(1)/(
pow(log10(et),2)+coeffs.at(2))+coeffs.at(3)*
exp(-coeffs.at(4)*(log10(et)-coeffs.at(5))*(log10(et)-coeffs.at(5))));
345 os <<
"=== Level-1 GCT : Jet Finder Parameters ===" << std::endl;
346 os <<
"RCT region LSB : " << std::fixed << fn.
getRgnEtLsbGeV() <<
" GeV" << std::endl;
347 os <<
"Central jet seed threshold : " << std::fixed << fn.
getCenJetEtSeedGeV() <<
" GeV" << std::endl;
348 os <<
"Tau jet seed threshold : " << std::fixed << fn.
getTauJetEtSeedGeV() <<
" GeV" << std::endl;
349 os <<
"Forward jet seed threshold : " << std::fixed << fn.
getForJetEtSeedGeV() <<
" GeV" << std::endl;
353 os <<
"Ht LSB : " << std::fixed << fn.
getHtLsbGeV() <<
" GeV" << std::endl;
358 os << std::setprecision(6);
359 os << ios::scientific;
361 os <<
"=== Level-1 GCT : Jet Et Calibration Function ===" << std::endl;
363 os <<
"No jet energy corrections applied" << std::endl;
368 os <<
"Function = Power series" << std::endl;
371 os <<
"Function = ORCA" << std::endl;
374 os <<
"Function = Simple" << std::endl;
377 os <<
"Function = PiecewiseCubic" << std::endl;
380 os <<
"Function = PF" << std::endl;
383 os <<
"Unrecognised" << std::endl;
389 os <<
"Non-tau jet correction coefficients" << std::endl;
390 for (
unsigned i=0;
i<jetCoeffs.size();
i++){
391 os <<
"Eta =" << std::setw(2) <<
i;
392 if (jetCoeffs.at(i).empty()) {
393 os <<
", no coefficients";
395 os <<
" Coefficients = ";
396 for (
unsigned j=0;
j<jetCoeffs.at(i).size();
j++){
397 os << jetCoeffs.at(i).at(
j) <<
", ";
402 os <<
"Tau jet correction coefficients" << std::endl;
403 for (
unsigned i=0;
i<tauCoeffs.size();
i++){
404 os <<
"Eta =" << std::setw(2) <<
i;
405 if (tauCoeffs.at(i).empty()) {
406 os <<
", no coefficients";
408 os <<
" Coefficients = ";
409 for (
unsigned j=0;
j<tauCoeffs.at(i).size();
j++){
410 os << tauCoeffs.at(i).at(
j) <<
", ";
417 os.unsetf(ios::fixed | ios::scientific);
double powerSeriesCorrect(const double Et, const std::vector< double > &coeffs) const
static const unsigned N_CENTRAL_ETA_VALUES
Number of eta bins used in correction.
void setHtSumParams(const double htLsb, const double htJetEtThresh, const double mhtJetEtThresh)
void setJetEtConvertToEnergyOff()
std::vector< std::vector< double > > jetCorrCoeffs_
void setRegionEtLsb(const double rgnEtLsb)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
std::vector< std::vector< double > > tauCorrCoeffs_
const std::vector< std::vector< double > > & getJetCorrCoeffs() const
double getHtLsbGeV() const
double tauIsoEtThreshold_
uint16_t correctedEtGct(const double correctedEt) const
Convert the corrected Et value to a linear Et for Ht summing.
double getCenJetEtSeedGeV() const
double getTauJetEtSeedGeV() const
double correctedEtGeV(const double et, const unsigned eta, const bool tauVeto) const
Eta takes a value from 0-10, corresponding to jet regions running from eta=0.0 to eta=5...
double mhtJetEtThreshold_
void setParams(const double rgnEtLsb, const double htLsb, const double cJetSeed, const double fJetSeed, const double tJetSeed, const double tauIsoEtThresh, const double htJetEtThresh, const double mhtJetEtThresh, const unsigned etaBoundary, const unsigned corrType, const std::vector< std::vector< double > > &jetCorrCoeffs, const std::vector< std::vector< double > > &tauCorrCoeffs)
double correctionFunction(const double Et, const std::vector< double > &coeffs) const
unsigned getCorrType() const
Access to jet Et calibration parameters.
unsigned cenForJetEtaBoundary_
double simpleCorrect(const double Et, const std::vector< double > &coeffs) const
void setJetEtConvertToEnergyOn(const std::vector< double > &energyConvCoeffs)
double getMHtJetEtThresholdGeV() const
static const unsigned jetCalibratedEtMax
double getTauIsoEtThresholdGeV() const
double piecewiseCubicCorrect(const double Et, const std::vector< double > &coeffs) const
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
unsigned getCenForJetEtaBoundary() const
void setJetEtCalibrationParams(const unsigned corrType, const std::vector< std::vector< double > > &jetCorrCoeffs, const std::vector< std::vector< double > > &tauCorrCoeffs)
double getHtJetEtThresholdGeV() const
void setTauAlgorithmParams(const double tauIsoEtThresh)
double pfCorrect(const double Et, const std::vector< double > &coeffs) const
double getRgnEtLsbGeV() const
volatile std::atomic< bool > shutdown_flag false
double orcaStyleCorrect(const double Et, const std::vector< double > &coeffs) const
void setSlidingWindowParams(const double cJetSeed, const double fJetSeed, const double tJetSeed, const unsigned etaBoundary)
DecomposeProduct< arg, typename Div::arg > D
double getForJetEtSeedGeV() const
Power< A, B >::type pow(const A &a, const B &b)
std::vector< double > energyConversionCoeffs_
const std::vector< std::vector< double > > & getTauCorrCoeffs() const