23 tauIsoEtThreshold_(0.),
24 htJetEtThreshold_(0.),
25 mhtJetEtThreshold_(0.),
26 cenForJetEtaBoundary_(0),
30 convertToEnergy_(
false),
31 energyConversionCoeffs_() {}
38 double tauIsoEtThresh,
40 double mhtJetEtThresh,
43 const std::vector<std::vector<double> >& jetCorrCoeffs,
44 const std::vector<std::vector<double> >& tauCorrCoeffs,
46 const std::vector<double>& energyConvCoeffs)
47 : rgnEtLsb_(rgnEtLsb),
49 cenJetEtSeed_(cJetSeed),
50 forJetEtSeed_(fJetSeed),
51 tauJetEtSeed_(tJetSeed),
52 tauIsoEtThreshold_(tauIsoEtThresh),
53 htJetEtThreshold_(htJetEtThresh),
54 mhtJetEtThreshold_(mhtJetEtThresh),
55 cenForJetEtaBoundary_(etaBoundary),
57 jetCorrCoeffs_(jetCorrCoeffs),
58 tauCorrCoeffs_(tauCorrCoeffs),
59 convertToEnergy_(convertToEnergy),
60 energyConversionCoeffs_(energyConvCoeffs) {
64 LogDebug(
"L1-O2O") <<
"GCT jet corrections constructed with " <<
jetCorrCoeffs_.size() <<
" bins, expected " 66 LogDebug(
"L1-O2O") <<
"GCT tau corrections constructed with " <<
tauCorrCoeffs_.size() <<
" bins, expected " 72 <<
"L1GctJetFinderParams constructed with wrong number of eta bins : " <<
jetCorrCoeffs_.size() <<
" jets, " 78 unsigned expCoeffs = 0;
90 std::vector<std::vector<double> >::const_iterator itr;
92 if (itr->size() != expCoeffs) {
94 <<
"L1GctJetFinderParams constructed with " << itr->size() <<
" jet correction coefficients, when " 95 << expCoeffs <<
" expected" << std::endl;
99 if (itr->size() != expCoeffs) {
101 <<
"L1GctJetFinderParams constructed with " << itr->size() <<
" tau correction coefficients, when " 102 << expCoeffs <<
" expected" << std::endl;
118 const double fJetSeed,
119 const double tJetSeed,
120 const unsigned etaBoundary) {
128 const std::vector<std::vector<double> >& jetCorrCoeffs,
129 const std::vector<std::vector<double> >& tauCorrCoeffs) {
155 const double cJetSeed,
156 const double fJetSeed,
157 const double tJetSeed,
158 const double tauIsoEtThresh,
159 const double htJetEtThresh,
160 const double mhtJetEtThresh,
161 const unsigned etaBoundary,
162 const unsigned corrType,
163 const std::vector<std::vector<double> >& jetCorrCoeffs,
164 const std::vector<std::vector<double> >& tauCorrCoeffs) {
199 double scaledEt = correctedEt /
htLsb_;
201 uint16_t jetEtOut =
static_cast<uint16_t
>(scaledEt);
241 for (
unsigned i = 0;
i < coeffs.size();
i++) {
242 corrEt += coeffs.at(
i) *
pow(Et, (
int)
i);
251 std::vector<double>::const_iterator next_coeff = coeffs.begin();
252 while (next_coeff != coeffs.end()) {
254 double A = *next_coeff++;
255 double B = *next_coeff++;
256 double C = *next_coeff++;
260 return 2 * (Et -
A) / (
B +
sqrt(
B *
B - 4 *
A *
C + 4 * Et *
C));
274 return coeffs.at(0) + coeffs.at(1) / (
pow(log10(Et), coeffs.at(2)) + coeffs.at(3)) + (coeffs.at(4) / Et);
285 std::vector<double>::const_iterator next_coeff = coeffs.begin();
286 while (next_coeff != coeffs.end()) {
289 double A = *next_coeff++;
290 double B = *next_coeff++;
291 double C = *next_coeff++;
292 double D = *next_coeff++;
296 etOut += (
A + etOut * (
B + etOut * (
C + etOut *
D)));
309 return et * (coeffs.at(0) + coeffs.at(1) / (
pow(log10(
et), 2) + coeffs.at(2)) +
310 coeffs.at(3) *
exp(-coeffs.at(4) * (log10(
et) - coeffs.at(5)) * (log10(
et) - coeffs.at(5))));
316 os <<
"=== Level-1 GCT : Jet Finder Parameters ===" << std::endl;
317 os <<
"RCT region LSB : " <<
std::fixed <<
fn.getRgnEtLsbGeV() <<
" GeV" << std::endl;
318 os <<
"Central jet seed threshold : " <<
std::fixed <<
fn.getCenJetEtSeedGeV() <<
" GeV" << std::endl;
319 os <<
"Tau jet seed threshold : " <<
std::fixed <<
fn.getTauJetEtSeedGeV() <<
" GeV" << std::endl;
320 os <<
"Forward jet seed threshold : " <<
std::fixed <<
fn.getForJetEtSeedGeV() <<
" GeV" << std::endl;
321 os <<
"Tau isolation threshold : " <<
std::fixed <<
fn.getTauIsoEtThresholdGeV() <<
" GeV" << std::endl;
322 os <<
"Ht jet Et threshold : " <<
std::fixed <<
fn.getHtJetEtThresholdGeV() <<
" GeV" << std::endl;
323 os <<
"MHt jet Et threshold : " <<
std::fixed <<
fn.getMHtJetEtThresholdGeV() <<
" GeV" << std::endl;
324 os <<
"Ht LSB : " <<
std::fixed <<
fn.getHtLsbGeV() <<
" GeV" << std::endl;
325 os <<
"Central/Forward boundary : " <<
std::fixed <<
fn.getCenForJetEtaBoundary() << std::endl;
329 os << std::setprecision(6);
330 os << ios::scientific;
332 os <<
"=== Level-1 GCT : Jet Et Calibration Function ===" << std::endl;
333 if (
fn.getCorrType() == 0) {
334 os <<
"No jet energy corrections applied" << std::endl;
336 switch (
fn.getCorrType()) {
338 os <<
"Function = Power series" << std::endl;
341 os <<
"Function = ORCA" << std::endl;
344 os <<
"Function = Simple" << std::endl;
347 os <<
"Function = PiecewiseCubic" << std::endl;
350 os <<
"Function = PF" << std::endl;
353 os <<
"Unrecognised" << std::endl;
356 std::vector<std::vector<double> > jetCoeffs =
fn.getJetCorrCoeffs();
357 std::vector<std::vector<double> > tauCoeffs =
fn.getTauCorrCoeffs();
359 os <<
"Non-tau jet correction coefficients" << std::endl;
360 for (
unsigned i = 0;
i < jetCoeffs.size();
i++) {
361 os <<
"Eta =" << std::setw(2) <<
i;
362 if (jetCoeffs.at(
i).empty()) {
363 os <<
", no coefficients";
365 os <<
" Coefficients = ";
366 for (
unsigned j = 0;
j < jetCoeffs.at(
i).size();
j++) {
367 os << jetCoeffs.at(
i).at(
j) <<
", ";
372 os <<
"Tau jet correction coefficients" << std::endl;
373 for (
unsigned i = 0;
i < tauCoeffs.size();
i++) {
374 os <<
"Eta =" << std::setw(2) <<
i;
375 if (tauCoeffs.at(
i).empty()) {
376 os <<
", no coefficients";
378 os <<
" Coefficients = ";
379 for (
unsigned j = 0;
j < tauCoeffs.at(
i).size();
j++) {
380 os << tauCoeffs.at(
i).at(
j) <<
", ";
double piecewiseCubicCorrect(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)
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...
void setJetEtConvertToEnergyOff()
uint16_t correctedEtGct(const double correctedEt) const
Convert the corrected Et value to a linear Et for Ht summing.
void setRegionEtLsb(const double rgnEtLsb)
double correctionFunction(const double Et, const std::vector< double > &coeffs) const
std::vector< std::vector< double > > tauCorrCoeffs_
double tauIsoEtThreshold_
double pfCorrect(const double Et, const std::vector< double > &coeffs) const
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)
unsigned cenForJetEtaBoundary_
void setJetEtConvertToEnergyOn(const std::vector< double > &energyConvCoeffs)
static const unsigned jetCalibratedEtMax
double orcaStyleCorrect(const double Et, const std::vector< double > &coeffs) const
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
double powerSeriesCorrect(const double Et, const std::vector< double > &coeffs) const
DecomposeProduct< arg, typename Div::arg > D
void setJetEtCalibrationParams(const unsigned corrType, const std::vector< std::vector< double > > &jetCorrCoeffs, const std::vector< std::vector< double > > &tauCorrCoeffs)
double simpleCorrect(const double Et, const std::vector< double > &coeffs) const
std::vector< std::vector< double > > jetCorrCoeffs_
void setTauAlgorithmParams(const double tauIsoEtThresh)
void setSlidingWindowParams(const double cJetSeed, const double fJetSeed, const double tJetSeed, const unsigned etaBoundary)
Power< A, B >::type pow(const A &a, const B &b)
std::vector< double > energyConversionCoeffs_
std::ostream & operator<<(std::ostream &os, const L1GctJetFinderParams &fn)
Overload << operator.