diff --git a/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloEGammaUtils.h b/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloEGammaUtils.h index a325850b399e8..97c2eeb25c446 100644 --- a/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloEGammaUtils.h +++ b/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloEGammaUtils.h @@ -60,7 +60,7 @@ namespace p2eg { static constexpr float e0_looseTkss = 0.944, e1_looseTkss = 0.65, e2_looseTkss = 0.4; // passes_looseTkss static constexpr float cut_500_MeV = 0.5; - static constexpr float ECAL_LSB = 0.125; // to convert from int to float (GeV) multiply by LSB + static constexpr float ECAL_LSB = 0.5; // to convert from int to float (GeV) multiply by LSB static constexpr float HCAL_LSB = 0.5; static constexpr int N_CLUSTERS_PER_REGION = 4; // number of clusters per ECAL region @@ -709,7 +709,7 @@ namespace p2eg { float newEt = getEt() * factor; // Convert the new pT to an unsigned int (16 bits so we can take the logical OR with the bit mask later) - ap_uint<16> newEt_uint = (ap_uint<16>)(int)(newEt * 8.0); + ap_uint<16> newEt_uint = (ap_uint<16>)(int)(newEt / ECAL_LSB); // Make sure the first four bits are zero newEt_uint = (newEt_uint & 0x0FFF); @@ -721,9 +721,7 @@ namespace p2eg { /* * For towers: Calculate H/E ratio given the ECAL and HCAL energies and modify the hoe() value. */ - void getHoverE(ap_uint<12> ECAL, ap_uint<12> HCAL_inHcalConvention) { - // Convert HCAL ET to ECAL ET convention - ap_uint<12> HCAL = convertHcalETtoEcalET(HCAL_inHcalConvention); + void addHoverEToTower(ap_uint<12> ECAL, ap_uint<12> HCAL) { ap_uint<4> hoeOut; ap_uint<1> hoeLSB = 0; ap_uint<4> hoe = 0; @@ -1497,6 +1495,7 @@ namespace p2eg { l1tp2::CaloTower l1CaloTower; // Store total Et (HCAL+ECAL) in the ECAL Et member l1CaloTower.setEcalTowerEt(totalEtFloat()); + l1CaloTower.setHcalTowerEt(ecalEtFloat()); int global_tower_iEta = globalToweriEtaFromGCTcardiEta(gctCard_tower_iEta); int global_tower_iPhi = globalToweriPhiFromGCTcardiPhi(nGCTCard, gctCard_tower_iPhi); l1CaloTower.setTowerIEta(global_tower_iEta); diff --git a/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloJetEmulator.h b/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloJetEmulator.h index 4ccf93df4efec..202c7dfc8c297 100644 --- a/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloJetEmulator.h +++ b/L1Trigger/L1CaloTrigger/interface/Phase2L1CaloJetEmulator.h @@ -482,7 +482,7 @@ namespace gctobj { jet_tmp.tauEt = 0.; } jet_tmp.etaCenter = jet.etaCenter; // this is the ET weighted eta centre of the ST - jet_tmp.phiCenter = jet.phiCenter; // this is the ET weighted eta centre of the ST + jet_tmp.phiCenter = jet.phiCenter; // this is the ET weighted phi centre of the ST jet_tmp.etaMax = jet.etaMax; // this is the leading tower eta in the ST jet_tmp.phiMax = jet.phiMax; // this is the leading tower phi in the ST return jet_tmp; diff --git a/L1Trigger/L1CaloTrigger/interface/Phase2L1GCT.h b/L1Trigger/L1CaloTrigger/interface/Phase2L1GCT.h index 7751a9e3c0c81..2f28a4cf35566 100644 --- a/L1Trigger/L1CaloTrigger/interface/Phase2L1GCT.h +++ b/L1Trigger/L1CaloTrigger/interface/Phase2L1GCT.h @@ -240,7 +240,6 @@ inline p2eg::GCTinternal_t p2eg::getClustersTowers(const p2eg::GCTcard_t& GCTcar */ inline p2eg::GCTintTowers_t p2eg::getFullTowers(const p2eg::GCTinternal_t& GCTinternal) { p2eg::GCTintTowers_t GCTintTowers; - // Positive eta for (int i = 0; i < p2eg::N_GCTPOSITIVE_FIBERS; i = i + 4) { for (int i1 = 0; i1 < 4; i1++) { @@ -249,6 +248,8 @@ inline p2eg::GCTintTowers_t p2eg::getFullTowers(const p2eg::GCTinternal_t& GCTin ap_uint<15> eta = p2eg::N_GCTETA / 2 + k; GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].et; GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].hoe; + GCTintTowers.GCTtower[eta][phi].ecalEt = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].ecalEt; + GCTintTowers.GCTtower[eta][phi].hcalEt = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].hcalEt; for (int ic1 = 0; ic1 < 4; ic1++) { for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) { ap_uint<15> eta1 = p2eg::N_GCTETA / 2 + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta; @@ -271,6 +272,8 @@ inline p2eg::GCTintTowers_t p2eg::getFullTowers(const p2eg::GCTinternal_t& GCTin ap_uint<15> phi = i + i1 - p2eg::N_GCTPOSITIVE_FIBERS; GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].et; GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].hoe; + GCTintTowers.GCTtower[eta][phi].ecalEt = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].ecalEt; + GCTintTowers.GCTtower[eta][phi].hcalEt = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].hcalEt; for (int ic1 = 0; ic1 < 4; ic1++) { for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) { ap_uint<15> eta1 = p2eg::N_GCTETA / 2 - 1 - GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta; diff --git a/L1Trigger/L1CaloTrigger/interface/Phase2L1RCT.h b/L1Trigger/L1CaloTrigger/interface/Phase2L1RCT.h index 43547af9d0bd8..02a3fb47e375f 100644 --- a/L1Trigger/L1CaloTrigger/interface/Phase2L1RCT.h +++ b/L1Trigger/L1CaloTrigger/interface/Phase2L1RCT.h @@ -1036,18 +1036,15 @@ inline void p2eg::getECALTowersEt(p2eg::crystal tempX[p2eg::CRYSTAL_IN_ETA][p2eg } } - towerEt[0] = towerEtN[0][0][0] + towerEtN[0][0][1] + towerEtN[0][0][2] + towerEtN[0][0][3] + towerEtN[0][0][4]; - towerEt[1] = towerEtN[0][1][0] + towerEtN[0][1][1] + towerEtN[0][1][2] + towerEtN[0][1][3] + towerEtN[0][1][4]; - towerEt[2] = towerEtN[0][2][0] + towerEtN[0][2][1] + towerEtN[0][2][2] + towerEtN[0][2][3] + towerEtN[0][2][4]; - towerEt[3] = towerEtN[0][3][0] + towerEtN[0][3][1] + towerEtN[0][3][2] + towerEtN[0][3][3] + towerEtN[0][3][4]; - towerEt[4] = towerEtN[1][0][0] + towerEtN[1][0][1] + towerEtN[1][0][2] + towerEtN[1][0][3] + towerEtN[1][0][4]; - towerEt[5] = towerEtN[1][1][0] + towerEtN[1][1][1] + towerEtN[1][1][2] + towerEtN[1][1][3] + towerEtN[1][1][4]; - towerEt[6] = towerEtN[1][2][0] + towerEtN[1][2][1] + towerEtN[1][2][2] + towerEtN[1][2][3] + towerEtN[1][2][4]; - towerEt[7] = towerEtN[1][3][0] + towerEtN[1][3][1] + towerEtN[1][3][2] + towerEtN[1][3][3] + towerEtN[1][3][4]; - towerEt[8] = towerEtN[2][0][0] + towerEtN[2][0][1] + towerEtN[2][0][2] + towerEtN[2][0][3] + towerEtN[2][0][4]; - towerEt[9] = towerEtN[2][1][0] + towerEtN[2][1][1] + towerEtN[2][1][2] + towerEtN[2][1][3] + towerEtN[2][1][4]; - towerEt[10] = towerEtN[2][2][0] + towerEtN[2][2][1] + towerEtN[2][2][2] + towerEtN[2][2][3] + towerEtN[2][2][4]; - towerEt[11] = towerEtN[2][3][0] + towerEtN[2][3][1] + towerEtN[2][3][2] + towerEtN[2][3][3] + towerEtN[2][3][4]; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 4; j++) { + int index = j + 4 * i; + towerEt[index] = 0; + for (int k = 0; k < 5; k++) { + towerEt[index] += (towerEtN[i][j][k] >> 2); + } + } + } ap_uint<12> totalEt; for (int i = 0; i < 12; i++) { @@ -1226,7 +1223,7 @@ inline p2eg::clusterInfo p2eg::getBremsValuesPos(p2eg::crystal tempX[p2eg::CRYST for (int i = 0; i < 3; i++) { eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i]; } - cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]); + cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]) >> 2; return cluster_tmp; } @@ -1301,7 +1298,7 @@ inline p2eg::clusterInfo p2eg::getBremsValuesNeg(p2eg::crystal tempX[p2eg::CRYST for (int i = 0; i < 3; i++) { eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i]; } - cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]); + cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]) >> 2; return cluster_tmp; } @@ -1392,7 +1389,7 @@ inline p2eg::clusterInfo p2eg::getClusterValues(p2eg::crystal tempX[p2eg::CRYSTA eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i]; } - cluster_tmp.energy = (eta_slice[1] + eta_slice[2] + eta_slice[3]); + cluster_tmp.energy = (eta_slice[1] + eta_slice[2] + eta_slice[3]) >> 2; // Get the energy totals in the 5x5 and also in two 2x5 et5x5Tot = (eta_slice[0] + eta_slice[1] + eta_slice[2] + eta_slice[3] + eta_slice[4]); @@ -1404,8 +1401,8 @@ inline p2eg::clusterInfo p2eg::getClusterValues(p2eg::crystal tempX[p2eg::CRYSTA else etSum2x5 = et2x5_2Tot; - cluster_tmp.et5x5 = et5x5Tot; - cluster_tmp.et2x5 = etSum2x5; + cluster_tmp.et5x5 = et5x5Tot >> 2; + cluster_tmp.et2x5 = etSum2x5 >> 2; return cluster_tmp; } @@ -1427,7 +1424,7 @@ inline p2eg::Cluster p2eg::getClusterFromRegion3x4(p2eg::crystal temp[p2eg::CRYS cluster_tmp = p2eg::getClusterPosition(ecalRegion); - float seedEnergyFloat = cluster_tmp.seedEnergy / 8.0; + float seedEnergyFloat = cluster_tmp.seedEnergy * ECAL_LSB; // Do not make cluster if seed is less than 1.0 GeV if (seedEnergyFloat < 1.0) { diff --git a/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloEGammaEmulator.cc b/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloEGammaEmulator.cc index 209b285f3fb29..999b208da8cde 100644 --- a/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloEGammaEmulator.cc +++ b/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloEGammaEmulator.cc @@ -134,8 +134,8 @@ void Phase2L1CaloEGammaEmulator::produce(edm::Event& iEvent, const edm::EventSet for (const auto& hit : *pcalohits.product()) { if (hit.encodedEt() > 0) // hit.encodedEt() returns an int corresponding to 2x the crystal Et { - // Et is 10 bit, by keeping the ADC saturation Et at 120 GeV it means that you have to divide by 8 - float et = hit.encodedEt() * p2eg::ECAL_LSB; + // Et is 10 bit, by keeping the ADC saturation Et at 120 GeV it means that you have to multiply by 0.125 (input LSB) + float et = hit.encodedEt() * 0.125; if (et < p2eg::cut_500_MeV) { continue; // Reject hits with < 500 MeV ET } @@ -332,8 +332,9 @@ void Phase2L1CaloEGammaEmulator::produce(edm::Event& iEvent, const edm::EventSet // Iteratively find four clusters and remove them from 'temporary' as we go, and fill cluster_list for (int c = 0; c < p2eg::N_CLUSTERS_PER_REGION; c++) { - p2eg::Cluster newCluster = p2eg::getClusterFromRegion3x4(temporary); // remove cluster from 'temporary' - newCluster.setRegionIdx(idxRegion); // add the region number + p2eg::Cluster newCluster = p2eg::getClusterFromRegion3x4( + temporary); // remove cluster from 'temporary', adjust for LSB 0.5 at GCT in getClusterValues + newCluster.setRegionIdx(idxRegion); // add the region number if (newCluster.clusterEnergy() > 0) { // do not push back 0-energy clusters cluster_list[cc].push_back(newCluster); @@ -342,7 +343,7 @@ void Phase2L1CaloEGammaEmulator::produce(edm::Event& iEvent, const edm::EventSet // Create towers using remaining ECAL energy, and the HCAL towers were already calculated in towersEtHCAL[12] ap_uint<12> towerEtECAL[12]; - p2eg::getECALTowersEt(temporary, towerEtECAL); + p2eg::getECALTowersEt(temporary, towerEtECAL); // adjust for LSB 0.5 at GCT // Fill towerHCALCard and towerECALCard arrays for (int i = 0; i < 12; i++) { @@ -440,7 +441,7 @@ void Phase2L1CaloEGammaEmulator::produce(edm::Event& iEvent, const edm::EventSet for (int jj = 0; jj < p2eg::n_towers_cardPhi; ++jj) { // 4 towers per card in phi ap_uint<12> ecalEt = towerECALCard[ii][jj][cc].et(); ap_uint<12> hcalEt = towerHCALCard[ii][jj][cc].et(); - towerECALCard[ii][jj][cc].getHoverE(ecalEt, hcalEt); + towerECALCard[ii][jj][cc].addHoverEToTower(ecalEt, hcalEt); } } diff --git a/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloJetEmulator.cc b/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloJetEmulator.cc index 1da6563b31ebe..089d630fa6fc3 100644 --- a/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloJetEmulator.cc +++ b/L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloJetEmulator.cc @@ -47,6 +47,7 @@ #include #include #include +#include "TF1.h" // // class declaration @@ -61,12 +62,46 @@ class Phase2L1CaloJetEmulator : public edm::stream::EDProducer<> { private: void produce(edm::Event&, const edm::EventSetup&) override; + float get_jet_pt_calibration(const float& jet_pt, const float& jet_eta) const; + float get_tau_pt_calibration(const float& tau_pt, const float& tau_eta) const; // ----------member data --------------------------- edm::EDGetTokenT caloTowerToken_; edm::EDGetTokenT hgcalTowerToken_; edm::EDGetTokenT hfToken_; edm::ESGetToken decoderTag_; + std::vector nHits_to_nvtx_params; + std::vector nvtx_to_PU_sub_params; + std::map nHits_to_nvtx_funcs; + std::map hgcalEM_nvtx_to_PU_sub_funcs; + std::map hgcalHad_nvtx_to_PU_sub_funcs; + std::map hf_nvtx_to_PU_sub_funcs; + std::map> all_nvtx_to_PU_sub_funcs; + + // For fetching jet pt calibrations + std::vector jetPtBins; + std::vector absEtaBinsBarrel; + std::vector jetCalibrationsBarrel; + std::vector absEtaBinsHGCal; + std::vector jetCalibrationsHGCal; + std::vector absEtaBinsHF; + std::vector jetCalibrationsHF; + + // For fetching tau pt calibrations + std::vector tauPtBins; + std::vector tauAbsEtaBinsBarrel; + std::vector tauCalibrationsBarrel; + std::vector tauAbsEtaBinsHGCal; + std::vector tauCalibrationsHGCal; + + // For storing jet calibrations + std::vector> calibrationsBarrel; + std::vector> calibrationsHGCal; + std::vector> calibrationsHF; + + // For storing tau calibrations + std::vector> tauPtCalibrationsBarrel; + std::vector> tauPtCalibrationsHGCal; }; // @@ -76,7 +111,106 @@ Phase2L1CaloJetEmulator::Phase2L1CaloJetEmulator(const edm::ParameterSet& iConfi : caloTowerToken_(consumes(iConfig.getParameter("gctFullTowers"))), hgcalTowerToken_(consumes(iConfig.getParameter("hgcalTowers"))), hfToken_(consumes(iConfig.getParameter("hcalDigis"))), - decoderTag_(esConsumes(edm::ESInputTag("", ""))) { + decoderTag_(esConsumes(edm::ESInputTag("", ""))), + nHits_to_nvtx_params(iConfig.getParameter>("nHits_to_nvtx_params")), + nvtx_to_PU_sub_params(iConfig.getParameter>("nvtx_to_PU_sub_params")), + jetPtBins(iConfig.getParameter>("jetPtBins")), + absEtaBinsBarrel(iConfig.getParameter>("absEtaBinsBarrel")), + jetCalibrationsBarrel(iConfig.getParameter>("jetCalibrationsBarrel")), + absEtaBinsHGCal(iConfig.getParameter>("absEtaBinsHGCal")), + jetCalibrationsHGCal(iConfig.getParameter>("jetCalibrationsHGCal")), + absEtaBinsHF(iConfig.getParameter>("absEtaBinsHF")), + jetCalibrationsHF(iConfig.getParameter>("jetCalibrationsHF")), + tauPtBins(iConfig.getParameter>("tauPtBins")), + tauAbsEtaBinsBarrel(iConfig.getParameter>("tauAbsEtaBinsBarrel")), + tauCalibrationsBarrel(iConfig.getParameter>("tauCalibrationsBarrel")), + tauAbsEtaBinsHGCal(iConfig.getParameter>("tauAbsEtaBinsHGCal")), + tauCalibrationsHGCal(iConfig.getParameter>("tauCalibrationsHGCal")) { + for (uint i = 0; i < nHits_to_nvtx_params.size(); i++) { + edm::ParameterSet* pset = &nHits_to_nvtx_params.at(i); + std::string calo = pset->getParameter("fit"); + nHits_to_nvtx_funcs[calo.c_str()] = TF1(calo.c_str(), "[0] + [1] * x"); + nHits_to_nvtx_funcs[calo.c_str()].SetParameter(0, pset->getParameter>("nHits_params").at(0)); + nHits_to_nvtx_funcs[calo.c_str()].SetParameter(1, pset->getParameter>("nHits_params").at(1)); + } + all_nvtx_to_PU_sub_funcs["hgcalEM"] = hgcalEM_nvtx_to_PU_sub_funcs; + all_nvtx_to_PU_sub_funcs["hgcalHad"] = hgcalHad_nvtx_to_PU_sub_funcs; + all_nvtx_to_PU_sub_funcs["hf"] = hf_nvtx_to_PU_sub_funcs; + for (uint i = 0; i < nvtx_to_PU_sub_params.size(); i++) { + edm::ParameterSet* pset = &nvtx_to_PU_sub_params.at(i); + std::string calo = pset->getParameter("calo"); + std::string iEta = pset->getParameter("iEta"); + double p1 = pset->getParameter>("nvtx_params").at(0); + double p2 = pset->getParameter>("nvtx_params").at(1); + + all_nvtx_to_PU_sub_funcs[calo.c_str()][iEta.c_str()] = TF1(calo.c_str(), "[0] + [1] * x"); + all_nvtx_to_PU_sub_funcs[calo.c_str()][iEta.c_str()].SetParameter(0, p1); + all_nvtx_to_PU_sub_funcs[calo.c_str()][iEta.c_str()].SetParameter(1, p2); + } + + // Fill the jet pt calibration 2D vector + // Dimension 1 is AbsEta bin + // Dimension 2 is jet pT bin which is filled with the actual callibration value + // size()-1 b/c the inputs have lower and upper bounds + // Do Barrel, then HGCal, then HF + int index = 0; + for (unsigned int abs_eta = 0; abs_eta < absEtaBinsBarrel.size() - 1; abs_eta++) { + std::vector pt_bin_calibs; + for (unsigned int pt = 0; pt < jetPtBins.size() - 1; pt++) { + pt_bin_calibs.push_back(jetCalibrationsBarrel.at(index)); + index++; + } + calibrationsBarrel.push_back(pt_bin_calibs); + } + + index = 0; + for (unsigned int abs_eta = 0; abs_eta < absEtaBinsHGCal.size() - 1; abs_eta++) { + std::vector pt_bin_calibs; + for (unsigned int pt = 0; pt < jetPtBins.size() - 1; pt++) { + pt_bin_calibs.push_back(jetCalibrationsHGCal.at(index)); + index++; + } + calibrationsHGCal.push_back(pt_bin_calibs); + } + + index = 0; + for (unsigned int abs_eta = 0; abs_eta < absEtaBinsHF.size() - 1; abs_eta++) { + std::vector pt_bin_calibs; + for (unsigned int pt = 0; pt < jetPtBins.size() - 1; pt++) { + pt_bin_calibs.push_back(jetCalibrationsHF.at(index)); + index++; + } + calibrationsHF.push_back(pt_bin_calibs); + } + + // Fill the tau pt calibration 2D vector + // Dimension 1 is AbsEta bin + // Dimension 2 is tau pT bin which is filled with the actual calibration value + // Do Barrel, then HGCal + // + // Note to future developers: be very concious of the order in which the calibrations are printed + // out in tool which makse the cfg files. You need to match that exactly when loading them and + // using the calibrations below. + index = 0; + for (unsigned int abs_eta = 0; abs_eta < tauAbsEtaBinsBarrel.size() - 1; abs_eta++) { + std::vector pt_bin_calibs; + for (unsigned int pt = 0; pt < tauPtBins.size() - 1; pt++) { + pt_bin_calibs.push_back(tauCalibrationsBarrel.at(index)); + index++; + } + tauPtCalibrationsBarrel.push_back(pt_bin_calibs); + } + + index = 0; + for (unsigned int abs_eta = 0; abs_eta < tauAbsEtaBinsHGCal.size() - 1; abs_eta++) { + std::vector pt_bin_calibs; + for (unsigned int pt = 0; pt < tauPtBins.size() - 1; pt++) { + pt_bin_calibs.push_back(tauCalibrationsHGCal.at(index)); + index++; + } + tauPtCalibrationsHGCal.push_back(pt_bin_calibs); + } + produces("GCTJet"); } @@ -113,13 +247,53 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& float temporary[nBarrelEta / 2][nBarrelPhi]; - // Assign ETs to each eta-half of the endcap region (18x72) + // HGCal and HF info used for nvtx estimation edm::Handle hgcalTowerCollection; if (!iEvent.getByToken(hgcalTowerToken_, hgcalTowerCollection)) edm::LogError("Phase2L1CaloJetEmulator") << "Failed to get towers from hgcalTowerCollection!"; l1t::HGCalTowerBxCollection hgcalTowerColl; iEvent.getByToken(hgcalTowerToken_, hgcalTowerCollection); hgcalTowerColl = (*hgcalTowerCollection.product()); + + edm::Handle hfHandle; + if (!iEvent.getByToken(hfToken_, hfHandle)) + edm::LogError("Phase2L1CaloJetEmulator") << "Failed to get HcalTrigPrimDigi for HF!"; + iEvent.getByToken(hfToken_, hfHandle); + + int i_hgcalEM_hits_leq_threshold = 0; + int i_hgcalHad_hits_leq_threshold = 0; + int i_hf_hits_leq_threshold = 0; + for (auto it = hgcalTowerColl.begin(0); it != hgcalTowerColl.end(0); it++) { + if (it->etEm() <= 1.75 && it->etEm() >= 1.25) { + i_hgcalEM_hits_leq_threshold++; + } + if (it->etHad() <= 1.25 && it->etHad() >= 0.75) { + i_hgcalHad_hits_leq_threshold++; + } + } + const auto& decoder = iSetup.getData(decoderTag_); + for (const auto& hit : *hfHandle.product()) { + double et = decoder.hcaletValue(hit.id(), hit.t0()); + if (abs(hit.id().ieta()) < l1t::CaloTools::kHFBegin) + continue; + if (abs(hit.id().ieta()) > l1t::CaloTools::kHFEnd) + continue; + if (et <= 15.0 && et >= 10.0) + i_hf_hits_leq_threshold++; + } + + double hgcalEM_nvtx = nHits_to_nvtx_funcs["hgcalEM"].Eval(i_hgcalEM_hits_leq_threshold); + if (hgcalEM_nvtx < 0) + hgcalEM_nvtx = 0; + double hgcalHad_nvtx = nHits_to_nvtx_funcs["hgcalHad"].Eval(i_hgcalHad_hits_leq_threshold); + if (hgcalHad_nvtx < 0) + hgcalHad_nvtx = 0; + double hf_nvtx = nHits_to_nvtx_funcs["hf"].Eval(i_hf_hits_leq_threshold); + if (hf_nvtx < 0) + hf_nvtx = 0; + double EstimatedNvtx = (hgcalEM_nvtx + hgcalHad_nvtx + hf_nvtx) / 3.; + + // Assign ETs to each eta-half of the endcap region (18x72) float hgcalTowers[nHgcalEta][nHgcalPhi]; float hgcalEta[nHgcalEta][nHgcalPhi]; float hgcalPhi[nHgcalEta][nHgcalPhi]; @@ -145,21 +319,39 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& if (eta > 1.479) ieta = ieta - 4; int iphi = it->id().iPhi(); + + float hgcal_etEm = it->etEm(); + float hgcal_etHad = it->etHad(); + std::string etaKey = ""; + if (abs(eta) <= 1.8) + etaKey = "er1p4to1p8"; + else if (abs(eta) <= 2.1 && abs(eta) > 1.8) + etaKey = "er1p8to2p1"; + else if (abs(eta) <= 2.4 && abs(eta) > 2.1) + etaKey = "er2p1to2p4"; + else if (abs(eta) <= 2.7 && abs(eta) > 2.4) + etaKey = "er2p4to2p7"; + else if (abs(eta) <= 3.1 && abs(eta) > 2.7) + etaKey = "er2p7to3p1"; + if (!etaKey.empty()) { + hgcal_etEm = it->etEm() - all_nvtx_to_PU_sub_funcs["hgcalEM"][etaKey].Eval(EstimatedNvtx); + hgcal_etHad = it->etHad() - all_nvtx_to_PU_sub_funcs["hgcalHad"][etaKey].Eval(EstimatedNvtx); + } + + if (hgcal_etEm < 0) + hgcal_etEm = 0; + if (hgcal_etHad < 0) + hgcal_etHad = 0; if ((it->etEm() + it->etHad() > 1.) && abs(eta) > 1.479) - hgcalTowers[ieta][iphi] = it->etEm() + it->etHad(); // suppress <= 1 GeV towers + hgcalTowers[ieta][iphi] = hgcal_etEm + hgcal_etHad; // suppress <= 1 GeV towers } float temporary_hgcal[nHgcalEta / 2][nHgcalPhi]; // Assign ETs to each eta-half of the forward region (12x72) - edm::Handle hfHandle; - if (!iEvent.getByToken(hfToken_, hfHandle)) - edm::LogError("Phase2L1CaloJetEmulator") << "Failed to get HcalTrigPrimDigi for HF!"; - iEvent.getByToken(hfToken_, hfHandle); float hfTowers[nHfEta][nHfPhi]; float hfEta[nHfEta][nHfPhi]; float hfPhi[nHfEta][nHfPhi]; - for (int iphi = 0; iphi < nHfPhi; iphi++) { for (int ieta = 0; ieta < nHfEta; ieta++) { hfTowers[ieta][iphi] = 0; @@ -173,7 +365,6 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& } } - const auto& decoder = iSetup.getData(decoderTag_); for (const auto& hit : *hfHandle.product()) { double et = decoder.hcaletValue(hit.id(), hit.t0()); int ieta = 0; @@ -191,6 +382,14 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& iphi = hit.id().iphi() + (nHfPhi / 2 - 1); else if (hit.id().iphi() > nHfPhi / 2) iphi = hit.id().iphi() - (nHfPhi / 2 + 1); + if (abs(hit.id().ieta()) <= 33 && abs(hit.id().ieta()) >= 29) + et = et - all_nvtx_to_PU_sub_funcs["hf"]["er29to33"].Eval(EstimatedNvtx); + if (abs(hit.id().ieta()) <= 37 && abs(hit.id().ieta()) >= 34) + et = et - all_nvtx_to_PU_sub_funcs["hf"]["er34to37"].Eval(EstimatedNvtx); + if (abs(hit.id().ieta()) <= 41 && abs(hit.id().ieta()) >= 38) + et = et - all_nvtx_to_PU_sub_funcs["hf"]["er38to41"].Eval(EstimatedNvtx); + if (et < 0) + et = 0; if (et > 1.) hfTowers[ieta][iphi] = et; // suppress <= 1 GeV towers } @@ -230,8 +429,6 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& for (int i = 0; i < nJets; i++) { jet[i] = gctobj::getRegion(tempST); l1tp2::Phase2L1CaloJet tempJet; - tempJet.setJetEt(jet[i].energy); - tempJet.setTauEt(jet[i].tauEt); int gctjeteta = jet[i].etaCenter; int gctjetphi = jet[i].phiCenter; tempJet.setJetIEta(gctjeteta + k * nBarrelEta / 2); @@ -240,6 +437,8 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& float jetphi = realPhi[gctjeteta + k * nBarrelEta / 2][gctjetphi]; tempJet.setJetEta(jeteta); tempJet.setJetPhi(jetphi); + tempJet.setJetEt(get_jet_pt_calibration(jet[i].energy, jeteta)); + tempJet.setTauEt(get_tau_pt_calibration(jet[i].tauEt, jeteta)); tempJet.setTowerEt(jet[i].energyMax); int gcttowereta = jet[i].etaMax; int gcttowerphi = jet[i].phiMax; @@ -275,8 +474,6 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& for (int i = nJets; i < 2 * nJets; i++) { jet[i] = gctobj::getRegion(tempST_hgcal); l1tp2::Phase2L1CaloJet tempJet; - tempJet.setJetEt(jet[i].energy); - tempJet.setTauEt(jet[i].tauEt); int hgcaljeteta = jet[i].etaCenter; int hgcaljetphi = jet[i].phiCenter; tempJet.setJetIEta(hgcaljeteta + k * nHgcalEta / 2); @@ -285,6 +482,8 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& float jetphi = hgcalPhi[hgcaljeteta + k * nHgcalEta / 2][hgcaljetphi]; tempJet.setJetEta(jeteta); tempJet.setJetPhi(jetphi); + tempJet.setJetEt(get_jet_pt_calibration(jet[i].energy, jeteta)); + tempJet.setTauEt(get_tau_pt_calibration(jet[i].tauEt, jeteta)); tempJet.setTowerEt(jet[i].energyMax); int hgcaltowereta = jet[i].etaMax; int hgcaltowerphi = jet[i].phiMax; @@ -320,8 +519,6 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& for (int i = 2 * nJets; i < 3 * nJets; i++) { jet[i] = gctobj::getRegion(tempST_hf); l1tp2::Phase2L1CaloJet tempJet; - tempJet.setJetEt(jet[i].energy); - tempJet.setTauEt(jet[i].tauEt); int hfjeteta = jet[i].etaCenter; int hfjetphi = jet[i].phiCenter; tempJet.setJetIEta(hfjeteta + k * nHfEta / 2); @@ -330,6 +527,8 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& float jetphi = hfPhi[hfjeteta + k * nHfEta / 2][hfjetphi]; tempJet.setJetEta(jeteta); tempJet.setJetPhi(jetphi); + tempJet.setJetEt(get_jet_pt_calibration(jet[i].energy, jeteta)); + tempJet.setTauEt(get_tau_pt_calibration(jet[i].tauEt, jeteta)); tempJet.setTowerEt(jet[i].energyMax); int hftowereta = jet[i].etaMax; int hftowerphi = jet[i].phiMax; @@ -453,12 +652,271 @@ void Phase2L1CaloJetEmulator::produce(edm::Event& iEvent, const edm::EventSetup& iEvent.put(std::move(jetCands), "GCTJet"); } +// Apply calibrations to HCAL energy based on Jet Eta, Jet pT +float Phase2L1CaloJetEmulator::get_jet_pt_calibration(const float& jet_pt, const float& jet_eta) const { + float abs_eta = std::abs(jet_eta); + float tmp_jet_pt = jet_pt; + if (tmp_jet_pt > 499) + tmp_jet_pt = 499; + + // Different indices sizes in different calo regions. + // Barrel... + size_t eta_index = 0; + size_t pt_index = 0; + float calib = 1.0; + if (abs_eta <= 1.5) { + // Start loop checking 2nd value + for (unsigned int i = 1; i < absEtaBinsBarrel.size(); i++) { + if (abs_eta <= absEtaBinsBarrel.at(i)) + break; + eta_index++; + } + // Start loop checking 2nd value + for (unsigned int i = 1; i < jetPtBins.size(); i++) { + if (tmp_jet_pt <= jetPtBins.at(i)) + break; + pt_index++; + } + calib = calibrationsBarrel[eta_index][pt_index]; + } // end Barrel + else if (abs_eta <= 3.0) // HGCal + { + // Start loop checking 2nd value + for (unsigned int i = 1; i < absEtaBinsHGCal.size(); i++) { + if (abs_eta <= absEtaBinsHGCal.at(i)) + break; + eta_index++; + } + // Start loop checking 2nd value + for (unsigned int i = 1; i < jetPtBins.size(); i++) { + if (tmp_jet_pt <= jetPtBins.at(i)) + break; + pt_index++; + } + calib = calibrationsHGCal[eta_index][pt_index]; + } // end HGCal + else // HF + { + // Start loop checking 2nd value + for (unsigned int i = 1; i < absEtaBinsHF.size(); i++) { + if (abs_eta <= absEtaBinsHF.at(i)) + break; + eta_index++; + } + // Start loop checking 2nd value + for (unsigned int i = 1; i < jetPtBins.size(); i++) { + if (tmp_jet_pt <= jetPtBins.at(i)) + break; + pt_index++; + } + calib = calibrationsHF[eta_index][pt_index]; + } // end HF + + return jet_pt * calib; +} + +// Apply calibrations to tau pT based on L1EG info, EM Fraction, Tau Eta, Tau pT +float Phase2L1CaloJetEmulator::get_tau_pt_calibration(const float& tau_pt, const float& tau_eta) const { + float abs_eta = std::abs(tau_eta); + float tmp_tau_pt = tau_pt; + if (tmp_tau_pt > 199) + tmp_tau_pt = 199; + + // Different indices sizes in different calo regions. + // Barrel... + size_t eta_index = 0; + size_t pt_index = 0; + float calib = 1.0; + if (abs_eta <= 1.5) { + // Start loop checking 2nd value + for (unsigned int i = 1; i < tauAbsEtaBinsBarrel.size(); i++) { + if (abs_eta <= tauAbsEtaBinsBarrel.at(i)) + break; + eta_index++; + } + // Start loop checking 2nd value + for (unsigned int i = 1; i < tauPtBins.size(); i++) { + if (tmp_tau_pt <= tauPtBins.at(i)) + break; + pt_index++; + } + calib = tauPtCalibrationsBarrel[eta_index][pt_index]; + } // end Barrel + else if (abs_eta <= 3.0) // HGCal + { + // Start loop checking 2nd value + for (unsigned int i = 1; i < tauAbsEtaBinsHGCal.size(); i++) { + if (abs_eta <= tauAbsEtaBinsHGCal.at(i)) + break; + eta_index++; + } + // Start loop checking 2nd value + for (unsigned int i = 1; i < tauPtBins.size(); i++) { + if (tmp_tau_pt <= tauPtBins.at(i)) + break; + pt_index++; + } + calib = tauPtCalibrationsHGCal[eta_index][pt_index]; + } // end HGCal + else + return calib; + + return tau_pt * calib; +} + // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void Phase2L1CaloJetEmulator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("gctFullTowers", edm::InputTag("l1tPhase2L1CaloEGammaEmulator", "GCTFullTowers")); desc.add("hgcalTowers", edm::InputTag("l1tHGCalTowerProducer", "HGCalTowerProcessor")); desc.add("hcalDigis", edm::InputTag("simHcalTriggerPrimitiveDigis")); + + edm::ParameterSetDescription nHits_params_validator; + nHits_params_validator.add("fit", "type"); + nHits_params_validator.add>("nHits_params", {1., 1.}); + std::vector nHits_params_default; + edm::ParameterSet nHits_params1; + nHits_params1.addParameter("fit", "hgcalEM"); + nHits_params1.addParameter>("nHits_params", {157.522, 0.090}); + nHits_params_default.push_back(nHits_params1); + edm::ParameterSet nHits_params2; + nHits_params2.addParameter("fit", "hgcalHad"); + nHits_params2.addParameter>("nHits_params", {159.295, 0.178}); + nHits_params_default.push_back(nHits_params2); + edm::ParameterSet nHits_params3; + nHits_params3.addParameter("fit", "hf"); + nHits_params3.addParameter>("nHits_params", {165.706, 0.153}); + nHits_params_default.push_back(nHits_params3); + desc.addVPSet("nHits_to_nvtx_params", nHits_params_validator, nHits_params_default); + + edm::ParameterSetDescription nvtx_params_validator; + nvtx_params_validator.add("calo", "type"); + nvtx_params_validator.add("iEta", "etaregion"); + nvtx_params_validator.add>("nvtx_params", {1., 1.}); + std::vector nvtx_params_default; + edm::ParameterSet nvtx_params1; + nvtx_params1.addParameter("calo", "hgcalEM"); + nvtx_params1.addParameter("iEta", "er1p4to1p8"); + nvtx_params1.addParameter>("nvtx_params", {-0.011772, 0.004142}); + nvtx_params_default.push_back(nvtx_params1); + edm::ParameterSet nvtx_params2; + nvtx_params2.addParameter("calo", "hgcalEM"); + nvtx_params2.addParameter("iEta", "er1p8to2p1"); + nvtx_params2.addParameter>("nvtx_params", {-0.015488, 0.005410}); + nvtx_params_default.push_back(nvtx_params2); + edm::ParameterSet nvtx_params3; + nvtx_params3.addParameter("calo", "hgcalEM"); + nvtx_params3.addParameter("iEta", "er2p1to2p4"); + nvtx_params3.addParameter>("nvtx_params", {-0.021150, 0.006078}); + nvtx_params_default.push_back(nvtx_params3); + edm::ParameterSet nvtx_params4; + nvtx_params4.addParameter("calo", "hgcalEM"); + nvtx_params4.addParameter("iEta", "er2p4to2p7"); + nvtx_params4.addParameter>("nvtx_params", {-0.015705, 0.005339}); + nvtx_params_default.push_back(nvtx_params4); + edm::ParameterSet nvtx_params5; + nvtx_params5.addParameter("calo", "hgcalEM"); + nvtx_params5.addParameter("iEta", "er2p7to3p1"); + nvtx_params5.addParameter>("nvtx_params", {-0.018492, 0.005620}); + nvtx_params_default.push_back(nvtx_params5); + edm::ParameterSet nvtx_params6; + nvtx_params6.addParameter("calo", "hgcalHad"); + nvtx_params6.addParameter("iEta", "er1p4to1p8"); + nvtx_params6.addParameter>("nvtx_params", {0.005675, 0.000615}); + nvtx_params_default.push_back(nvtx_params6); + edm::ParameterSet nvtx_params7; + nvtx_params7.addParameter("calo", "hgcalHad"); + nvtx_params7.addParameter("iEta", "er1p8to2p1"); + nvtx_params7.addParameter>("nvtx_params", {0.004560, 0.001099}); + nvtx_params_default.push_back(nvtx_params7); + edm::ParameterSet nvtx_params8; + nvtx_params8.addParameter("calo", "hgcalHad"); + nvtx_params8.addParameter("iEta", "er2p1to2p4"); + nvtx_params8.addParameter>("nvtx_params", {0.000036, 0.001608}); + nvtx_params_default.push_back(nvtx_params8); + edm::ParameterSet nvtx_params9; + nvtx_params9.addParameter("calo", "hgcalHad"); + nvtx_params9.addParameter("iEta", "er2p4to2p7"); + nvtx_params9.addParameter>("nvtx_params", {0.000869, 0.001754}); + nvtx_params_default.push_back(nvtx_params9); + edm::ParameterSet nvtx_params10; + nvtx_params10.addParameter("calo", "hgcalHad"); + nvtx_params10.addParameter("iEta", "er2p7to3p1"); + nvtx_params10.addParameter>("nvtx_params", {-0.006574, 0.003134}); + nvtx_params_default.push_back(nvtx_params10); + edm::ParameterSet nvtx_params11; + nvtx_params11.addParameter("calo", "hf"); + nvtx_params11.addParameter("iEta", "er29to33"); + nvtx_params11.addParameter>("nvtx_params", {-0.203291, 0.044096}); + nvtx_params_default.push_back(nvtx_params11); + edm::ParameterSet nvtx_params12; + nvtx_params12.addParameter("calo", "hf"); + nvtx_params12.addParameter("iEta", "er34to37"); + nvtx_params12.addParameter>("nvtx_params", {-0.210922, 0.045628}); + nvtx_params_default.push_back(nvtx_params12); + edm::ParameterSet nvtx_params13; + nvtx_params13.addParameter("calo", "hf"); + nvtx_params13.addParameter("iEta", "er38to41"); + nvtx_params13.addParameter>("nvtx_params", {-0.229562, 0.050560}); + nvtx_params_default.push_back(nvtx_params13); + desc.addVPSet("nvtx_to_PU_sub_params", nvtx_params_validator, nvtx_params_default); + + desc.add>("jetPtBins", {0.0, 5.0, 7.5, 10.0, 12.5, 15.0, 17.5, 20.0, 22.5, 25.0, 27.5, + 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, + 85.0, 90.0, 95.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0, 170.0, + 180.0, 190.0, 200.0, 225.0, 250.0, 275.0, 300.0, 325.0, 400.0, 500.0}); + desc.add>("absEtaBinsBarrel", {0.00, 0.30, 0.60, 1.00, 1.50}); + desc.add>( + "jetCalibrationsBarrel", + {2.459, 2.320, 2.239, 2.166, 2.100, 2.040, 1.986, 1.937, 1.892, 1.852, 1.816, 1.768, 1.714, 1.670, 1.633, 1.603, + 1.578, 1.557, 1.540, 1.525, 1.513, 1.502, 1.493, 1.486, 1.479, 1.470, 1.460, 1.452, 1.445, 1.439, 1.433, 1.427, + 1.422, 1.417, 1.411, 1.403, 1.390, 1.377, 1.365, 1.352, 1.327, 1.284, 4.695, 3.320, 2.751, 2.361, 2.093, 1.908, + 1.781, 1.694, 1.633, 1.591, 1.562, 1.533, 1.511, 1.499, 1.492, 1.486, 1.482, 1.478, 1.474, 1.470, 1.467, 1.463, + 1.459, 1.456, 1.452, 1.447, 1.440, 1.433, 1.425, 1.418, 1.411, 1.404, 1.397, 1.390, 1.382, 1.370, 1.352, 1.334, + 1.316, 1.298, 1.262, 1.200, 5.100, 3.538, 2.892, 2.448, 2.143, 1.933, 1.789, 1.689, 1.620, 1.572, 1.539, 1.506, + 1.482, 1.469, 1.460, 1.455, 1.450, 1.446, 1.442, 1.438, 1.434, 1.431, 1.427, 1.423, 1.420, 1.414, 1.407, 1.400, + 1.392, 1.385, 1.378, 1.370, 1.363, 1.356, 1.348, 1.336, 1.317, 1.299, 1.281, 1.263, 1.226, 1.162, 3.850, 3.438, + 3.211, 3.017, 2.851, 2.708, 2.585, 2.479, 2.388, 2.310, 2.243, 2.159, 2.072, 2.006, 1.956, 1.917, 1.887, 1.863, + 1.844, 1.828, 1.814, 1.802, 1.791, 1.782, 1.773, 1.760, 1.744, 1.729, 1.714, 1.699, 1.685, 1.670, 1.656, 1.641, + 1.627, 1.602, 1.566, 1.530, 1.494, 1.458, 1.386, 1.260}); + desc.add>("absEtaBinsHGCal", {1.50, 1.90, 2.40, 3.00}); + desc.add>( + "jetCalibrationsHGCal", + {5.604, 4.578, 4.061, 3.647, 3.314, 3.047, 2.832, 2.660, 2.521, 2.410, 2.320, 2.216, 2.120, 2.056, + 2.013, 1.983, 1.961, 1.945, 1.932, 1.922, 1.913, 1.905, 1.898, 1.891, 1.884, 1.874, 1.861, 1.848, + 1.835, 1.822, 1.810, 1.797, 1.784, 1.771, 1.759, 1.736, 1.704, 1.673, 1.641, 1.609, 1.545, 1.434, + 4.385, 3.584, 3.177, 2.849, 2.584, 2.370, 2.197, 2.057, 1.944, 1.853, 1.780, 1.695, 1.616, 1.564, + 1.530, 1.507, 1.491, 1.480, 1.472, 1.466, 1.462, 1.459, 1.456, 1.453, 1.451, 1.447, 1.443, 1.439, + 1.435, 1.431, 1.427, 1.423, 1.419, 1.416, 1.412, 1.405, 1.395, 1.385, 1.376, 1.366, 1.346, 1.312, + 562.891, 68.647, 17.648, 5.241, 2.223, 1.490, 1.312, 1.270, 1.260, 1.259, 1.259, 1.260, 1.263, 1.265, + 1.267, 1.269, 1.271, 1.273, 1.275, 1.277, 1.279, 1.281, 1.283, 1.285, 1.287, 1.290, 1.295, 1.299, + 1.303, 1.307, 1.311, 1.315, 1.319, 1.323, 1.328, 1.335, 1.345, 1.355, 1.366, 1.376, 1.397, 1.433}); + desc.add>("absEtaBinsHF", {3.00, 3.60, 6.00}); + desc.add>( + "jetCalibrationsHF", + {8.169, 6.873, 6.155, 5.535, 5.001, 4.539, 4.141, 3.798, 3.501, 3.245, 3.024, 2.748, 2.463, 2.249, + 2.090, 1.971, 1.881, 1.814, 1.763, 1.725, 1.695, 1.673, 1.655, 1.642, 1.631, 1.618, 1.605, 1.596, + 1.588, 1.581, 1.575, 1.569, 1.563, 1.557, 1.551, 1.541, 1.527, 1.513, 1.498, 1.484, 1.456, 1.406, + 2.788, 2.534, 2.388, 2.258, 2.141, 2.037, 1.945, 1.862, 1.788, 1.722, 1.664, 1.587, 1.503, 1.436, + 1.382, 1.339, 1.305, 1.277, 1.255, 1.237, 1.223, 1.211, 1.201, 1.193, 1.186, 1.178, 1.170, 1.164, + 1.159, 1.154, 1.151, 1.147, 1.144, 1.141, 1.138, 1.133, 1.126, 1.118, 1.111, 1.104, 1.090, 1.064}); + desc.add>("tauPtBins", {0.0, 5.0, 7.5, 10.0, 12.5, 15.0, 20.0, 25.0, 30.0, 35.0, + 40.0, 45.0, 50.0, 55.0, 60.0, 70.0, 80.0, 100.0, 150.0, 200.0}); + desc.add>("tauAbsEtaBinsBarrel", {0.00, 0.30, 0.60, 1.00, 1.50}); + desc.add>("tauCalibrationsBarrel", + {1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, + 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, + 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.102, + 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, + 1.102, 1.102, 1.102, 1.102, 1.102, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139}); + desc.add>("tauAbsEtaBinsHGCal", {1.50, 1.90, 2.40, 3.00}); + desc.add>( + "tauCalibrationsHGCal", + {1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, + 1.384, 1.384, 1.384, 1.384, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, + 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, + 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133}); + descriptions.addWithDefaultLabel(desc); } diff --git a/L1Trigger/L1CaloTrigger/python/l1tPhase2CaloJetEmulator_cfi.py b/L1Trigger/L1CaloTrigger/python/l1tPhase2CaloJetEmulator_cfi.py index 44cda2b527e55..fd0ba87e750ee 100644 --- a/L1Trigger/L1CaloTrigger/python/l1tPhase2CaloJetEmulator_cfi.py +++ b/L1Trigger/L1CaloTrigger/python/l1tPhase2CaloJetEmulator_cfi.py @@ -1,7 +1,123 @@ import FWCore.ParameterSet.Config as cms l1tPhase2CaloJetEmulator = cms.EDProducer("Phase2L1CaloJetEmulator", - gctFullTowers = cms.InputTag("l1tPhase2L1CaloEGammaEmulator","GCTFullTowers"), - hgcalTowers = cms.InputTag("l1tHGCalTowerProducer","HGCalTowerProcessor"), - hcalDigis = cms.InputTag("simHcalTriggerPrimitiveDigis"), + gctFullTowers = cms.InputTag("l1tPhase2L1CaloEGammaEmulator","GCTFullTowers"), + hgcalTowers = cms.InputTag("l1tHGCalTowerProducer","HGCalTowerProcessor"), + hcalDigis = cms.InputTag("simHcalTriggerPrimitiveDigis"), + nHits_to_nvtx_params = cms.VPSet( + cms.PSet( + fit = cms.string( "hgcalEM" ), + nHits_params = cms.vdouble( 157.522, 0.090 ) + ), + cms.PSet( + fit = cms.string( "hgcalHad" ), + nHits_params = cms.vdouble( 159.295, 0.178 ) + ), + cms.PSet( + fit = cms.string( "hf" ), + nHits_params = cms.vdouble( 165.706, 0.153 ) + ), + ), + nvtx_to_PU_sub_params = cms.VPSet( + cms.PSet( + calo = cms.string( "hgcalEM" ), + iEta = cms.string( "er1p4to1p8" ), + nvtx_params = cms.vdouble( -0.011772, 0.004142 ) + ), + cms.PSet( + calo = cms.string( "hgcalEM" ), + iEta = cms.string( "er1p8to2p1" ), + nvtx_params = cms.vdouble( -0.015488, 0.005410 ) + ), + cms.PSet( + calo = cms.string( "hgcalEM" ), + iEta = cms.string( "er2p1to2p4" ), + nvtx_params = cms.vdouble( -0.021150, 0.006078 ) + ), + cms.PSet( + calo = cms.string( "hgcalEM" ), + iEta = cms.string( "er2p4to2p7" ), + nvtx_params = cms.vdouble( -0.015705, 0.005339 ) + ), + cms.PSet( + calo = cms.string( "hgcalEM" ), + iEta = cms.string( "er2p7to3p1" ), + nvtx_params = cms.vdouble( -0.018492, 0.005620 ) + ), + cms.PSet( + calo = cms.string( "hgcalHad" ), + iEta = cms.string( "er1p4to1p8" ), + nvtx_params = cms.vdouble( 0.005675, 0.000615 ) + ), + cms.PSet( + calo = cms.string( "hgcalHad" ), + iEta = cms.string( "er1p8to2p1" ), + nvtx_params = cms.vdouble( 0.004560, 0.001099 ) + ), + cms.PSet( + calo = cms.string( "hgcalHad" ), + iEta = cms.string( "er2p1to2p4" ), + nvtx_params = cms.vdouble( 0.000036, 0.001608 ) + ), + cms.PSet( + calo = cms.string( "hgcalHad" ), + iEta = cms.string( "er2p4to2p7" ), + nvtx_params = cms.vdouble( 0.000869, 0.001754 ) + ), + cms.PSet( + calo = cms.string( "hgcalHad" ), + iEta = cms.string( "er2p7to3p1" ), + nvtx_params = cms.vdouble( -0.006574, 0.003134 ) + ), + cms.PSet( + calo = cms.string( "hf" ), + iEta = cms.string( "er29to33" ), + nvtx_params = cms.vdouble( -0.203291, 0.044096 ) + ), + cms.PSet( + calo = cms.string( "hf" ), + iEta = cms.string( "er34to37" ), + nvtx_params = cms.vdouble( -0.210922, 0.045628 ) + ), + cms.PSet( + calo = cms.string( "hf" ), + iEta = cms.string( "er38to41" ), + nvtx_params = cms.vdouble( -0.229562, 0.050560 ) + ), + ), + # Calibrations derived 7 December 2023 on 13_2_0 Phase2Fall22DRMiniAOD QCD sample + jetPtBins = cms.vdouble([ 0.0,5.0,7.5,10.0,12.5,15.0,17.5,20.0,22.5,25.0,27.5,30.0,35.0,40.0,45.0,50.0,55.0,60.0,65.0,70.0,75.0,80.0,85.0,90.0,95.0,100.0,110.0,120.0,130.0,140.0,150.0,160.0,170.0,180.0,190.0,200.0,225.0,250.0,275.0,300.0,325.0,400.0,500.0]), + absEtaBinsBarrel = cms.vdouble([ 0.00,0.30,0.60,1.00,1.50]), + jetCalibrationsBarrel = cms.vdouble([ + 2.459, 2.320, 2.239, 2.166, 2.100, 2.040, 1.986, 1.937, 1.892, 1.852, 1.816, 1.768, 1.714, 1.670, 1.633, 1.603, 1.578, 1.557, 1.540, 1.525, 1.513, 1.502, 1.493, 1.486, 1.479, 1.470, 1.460, 1.452, 1.445, 1.439, 1.433, 1.427, 1.422, 1.417, 1.411, 1.403, 1.390, 1.377, 1.365, 1.352, 1.327, 1.284, + 4.695, 3.320, 2.751, 2.361, 2.093, 1.908, 1.781, 1.694, 1.633, 1.591, 1.562, 1.533, 1.511, 1.499, 1.492, 1.486, 1.482, 1.478, 1.474, 1.470, 1.467, 1.463, 1.459, 1.456, 1.452, 1.447, 1.440, 1.433, 1.425, 1.418, 1.411, 1.404, 1.397, 1.390, 1.382, 1.370, 1.352, 1.334, 1.316, 1.298, 1.262, 1.200, + 5.100, 3.538, 2.892, 2.448, 2.143, 1.933, 1.789, 1.689, 1.620, 1.572, 1.539, 1.506, 1.482, 1.469, 1.460, 1.455, 1.450, 1.446, 1.442, 1.438, 1.434, 1.431, 1.427, 1.423, 1.420, 1.414, 1.407, 1.400, 1.392, 1.385, 1.378, 1.370, 1.363, 1.356, 1.348, 1.336, 1.317, 1.299, 1.281, 1.263, 1.226, 1.162, + 3.850, 3.438, 3.211, 3.017, 2.851, 2.708, 2.585, 2.479, 2.388, 2.310, 2.243, 2.159, 2.072, 2.006, 1.956, 1.917, 1.887, 1.863, 1.844, 1.828, 1.814, 1.802, 1.791, 1.782, 1.773, 1.760, 1.744, 1.729, 1.714, 1.699, 1.685, 1.670, 1.656, 1.641, 1.627, 1.602, 1.566, 1.530, 1.494, 1.458, 1.386, 1.260, + ]), + absEtaBinsHGCal = cms.vdouble([ 1.50,1.90,2.40,3.00]), + jetCalibrationsHGCal = cms.vdouble([ + 5.604, 4.578, 4.061, 3.647, 3.314, 3.047, 2.832, 2.660, 2.521, 2.410, 2.320, 2.216, 2.120, 2.056, 2.013, 1.983, 1.961, 1.945, 1.932, 1.922, 1.913, 1.905, 1.898, 1.891, 1.884, 1.874, 1.861, 1.848, 1.835, 1.822, 1.810, 1.797, 1.784, 1.771, 1.759, 1.736, 1.704, 1.673, 1.641, 1.609, 1.545, 1.434, + 4.385, 3.584, 3.177, 2.849, 2.584, 2.370, 2.197, 2.057, 1.944, 1.853, 1.780, 1.695, 1.616, 1.564, 1.530, 1.507, 1.491, 1.480, 1.472, 1.466, 1.462, 1.459, 1.456, 1.453, 1.451, 1.447, 1.443, 1.439, 1.435, 1.431, 1.427, 1.423, 1.419, 1.416, 1.412, 1.405, 1.395, 1.385, 1.376, 1.366, 1.346, 1.312, + 562.891, 68.647, 17.648, 5.241, 2.223, 1.490, 1.312, 1.270, 1.260, 1.259, 1.259, 1.260, 1.263, 1.265, 1.267, 1.269, 1.271, 1.273, 1.275, 1.277, 1.279, 1.281, 1.283, 1.285, 1.287, 1.290, 1.295, 1.299, 1.303, 1.307, 1.311, 1.315, 1.319, 1.323, 1.328, 1.335, 1.345, 1.355, 1.366, 1.376, 1.397, 1.433, + ]), + absEtaBinsHF = cms.vdouble([ 3.00,3.60,6.00]), + jetCalibrationsHF = cms.vdouble([ + 8.169, 6.873, 6.155, 5.535, 5.001, 4.539, 4.141, 3.798, 3.501, 3.245, 3.024, 2.748, 2.463, 2.249, 2.090, 1.971, 1.881, 1.814, 1.763, 1.725, 1.695, 1.673, 1.655, 1.642, 1.631, 1.618, 1.605, 1.596, 1.588, 1.581, 1.575, 1.569, 1.563, 1.557, 1.551, 1.541, 1.527, 1.513, 1.498, 1.484, 1.456, 1.406, + 2.788, 2.534, 2.388, 2.258, 2.141, 2.037, 1.945, 1.862, 1.788, 1.722, 1.664, 1.587, 1.503, 1.436, 1.382, 1.339, 1.305, 1.277, 1.255, 1.237, 1.223, 1.211, 1.201, 1.193, 1.186, 1.178, 1.170, 1.164, 1.159, 1.154, 1.151, 1.147, 1.144, 1.141, 1.138, 1.133, 1.126, 1.118, 1.111, 1.104, 1.090, 1.064, + ]), + # Calibrations derived 7 December 2023 on 13_2_0 Phase2Fall22DRMiniAOD VBFHiggsTauTau sample + tauPtBins = cms.vdouble([ 0.0,5.0,7.5,10.0,12.5,15.0,20.0,25.0,30.0,35.0,40.0,45.0,50.0,55.0,60.0,70.0,80.0,100.0,150.0,200.0]), + tauAbsEtaBinsBarrel = cms.vdouble([ 0.00,0.30,0.60,1.00,1.50]), + tauCalibrationsBarrel = cms.vdouble([ + 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, 1.067, + 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, 1.106, + 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, 1.102, + 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, 1.139, + ]), + tauAbsEtaBinsHGCal = cms.vdouble([ 1.50,1.90,2.40,3.00]), + tauCalibrationsHGCal = cms.vdouble([ + 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, 1.384, + 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, 1.473, + 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, 1.133, + ]), )